From 141796f3e78e8b134a6a44709a6f349e83bdf04d Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 10 Sep 2012 00:36:35 +0100 Subject: implement node search which makes webidl loading work --- src/genjsbind-ast.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') diff --git a/src/genjsbind-ast.c b/src/genjsbind-ast.c index e722c7c..1645f78 100644 --- a/src/genjsbind-ast.c +++ b/src/genjsbind-ast.c @@ -71,6 +71,21 @@ genbind_node_for_each_type(struct genbind_node *node, genbind_callback_t *cb, void *ctx) { + int ret; + + if (node == NULL) { + return -1; + } + if (node->l != NULL) { + ret = genbind_node_for_each_type(node->l, type, cb, ctx); + if (ret != 0) { + return ret; + } + } + if (node->type == type) { + return cb(node, ctx); + } + return 0; } -- cgit v1.2.3