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

Go to the documentation of this file.
00001 /* $Id: dtwalk.c,v 1.1.1.1 2004/12/23 04:04:01 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 /*      Walk a dictionary and all dictionaries viewed through it.
00024 **      userf:  user function
00025 **
00026 **      Written by Kiem-Phong Vo (5/25/96)
00027 */
00028 
00029 #if __STD_C
00030 int dtwalk(reg Dt_t * dt, int (*userf) (Dt_t *, Void_t *, Void_t *),
00031            Void_t * data)
00032 #else
00033 int dtwalk(dt, userf, data)
00034 reg Dt_t *dt;
00035 int (*userf) ();
00036 Void_t *data;
00037 #endif
00038 {
00039     reg Void_t *obj, *next;
00040     reg Dt_t *walk;
00041     reg int rv;
00042 
00043     for (obj = dtfirst(dt); obj;) {
00044         if (!(walk = dt->walk))
00045             walk = dt;
00046         next = dtnext(dt, obj);
00047         if ((rv = (*userf) (walk, obj, data)) < 0)
00048             return rv;
00049         obj = next;
00050     }
00051     return 0;
00052 }

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