*************************************************************************/
#include <cgraph/cghdr.h>
+#include <stdbool.h>
/* The following functions take a graph and a template (node/edge/graph)
* and return the object representing the template within the local graph.
* if obj is a graph, then it and its subgs are visited.
*/
static void rec_apply(Agraph_t * g, Agobj_t * obj, agobjfn_t fn, void *arg,
- agobjsearchfn_t objsearch, int preorder)
-{
+ agobjsearchfn_t objsearch, bool preorder) {
Agraph_t *sub;
Agobj_t *subobj;
if ((subobj = objsearch(sub, obj)))
rec_apply(sub, subobj, fn, arg, objsearch, preorder);
}
- if (NOT(preorder))
+ if (!preorder)
fn(g, obj, arg);
}
break;
}
if ((subobj = objsearch(g, obj))) {
- rec_apply(g, subobj, fn, arg, objsearch, preorder);
+ rec_apply(g, subobj, fn, arg, objsearch, preorder != 0);
return SUCCESS;
} else
return FAILURE;