/misc/src/release/graphviz-2.18-1/src/graphviz-2.18/lib/cdt/dtextract.c

Go to the documentation of this file.
00001 /* $Id: dtextract.c,v 1.1.1.1 2004/12/23 04:03:59 ellson Exp $ $Revision: 1.1.1.1 $ */
00002 /* vim:set shiftwidth=4 ts=8: */
00003 
00004 /**********************************************************
00005 *      This software is part of the graphviz package      *
00006 *                http://www.graphviz.org/                 *
00007 *                                                         *
00008 *            Copyright (c) 1994-2004 AT&T Corp.           *
00009 *                and is licensed under the                *
00010 *            Common Public License, Version 1.0           *
00011 *                      by AT&T Corp.                      *
00012 *                                                         *
00013 *        Information and Software Systems Research        *
00014 *              AT&T Research, Florham Park NJ             *
00015 **********************************************************/
00016 
00017 #include        "dthdr.h"
00018 
00019 #ifdef DMALLOC
00020 #include "dmalloc.h"
00021 #endif
00022 
00023 /*      Extract objects of a dictionary.
00024 **
00025 **      Written by Kiem-Phong Vo (5/25/96).
00026 */
00027 
00028 #if __STD_C
00029 Dtlink_t *dtextract(reg Dt_t * dt)
00030 #else
00031 Dtlink_t *dtextract(dt)
00032 reg Dt_t *dt;
00033 #endif
00034 {
00035     reg Dtlink_t *list, **s, **ends;
00036 
00037     if (dt->data->type & (DT_OSET | DT_OBAG))
00038         list = dt->data->here;
00039     else if (dt->data->type & (DT_SET | DT_BAG)) {
00040         list = dtflatten(dt);
00041         for (ends = (s = dt->data->htab) + dt->data->ntab; s < ends; ++s)
00042             *s = NIL(Dtlink_t *);
00043     } else {                    /*if(dt->data->type&(DT_LIST|DT_STACK|DT_QUEUE)) */
00044         list = dt->data->head;
00045         dt->data->head = NIL(Dtlink_t *);
00046     }
00047 
00048     dt->data->type &= ~DT_FLATTEN;
00049     dt->data->size = 0;
00050     dt->data->here = NIL(Dtlink_t *);
00051 
00052     return list;
00053 }

Generated on Mon Mar 31 19:03:23 2008 for Graphviz by  doxygen 1.5.1