Graphviz  2.41.20171026.1811
dtwalk.c
Go to the documentation of this file.
1 #include "dthdr.h"
2 
3 /* Walk a dictionary and all dictionaries viewed through it.
4 ** userf: user function
5 **
6 ** Written by Kiem-Phong Vo (5/25/96)
7 */
8 
9 int dtwalk(reg Dt_t* dt, int (*userf)(Dt_t*, void*, void*), void* data)
10 {
11  reg void *obj, *next;
12  reg Dt_t* walk;
13  reg int rv;
14 
15  for(obj = dtfirst(dt); obj; )
16  { if(!(walk = dt->walk) )
17  walk = dt;
18  next = dtnext(dt,obj);
19  if((rv = (*userf)(walk, obj, data )) < 0)
20  return rv;
21  obj = next;
22  }
23  return 0;
24 }
#define reg
Definition: dthdr.h:14
#define dtfirst(d)
Definition: cdt.h:254
#define dtnext(d, o)
Definition: cdt.h:255
CDT_API int dtwalk(Dt_t *, int(*)(Dt_t *, void *, void *), void *)
Definition: cdt.h:99
Definition: legal.c:60