summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2012-09-10 00:36:35 +0100
committerVincent Sanders <vince@kyllikki.org>2012-09-10 00:36:35 +0100
commit141796f3e78e8b134a6a44709a6f349e83bdf04d (patch)
tree6cb430e188e8ee3f81b2bec2398a0f302686ae35 /src
parent74e143bf3a9cd1cf6748cf1462f8e0fb161d126e (diff)
downloadnsgenbind-141796f3e78e8b134a6a44709a6f349e83bdf04d.tar.gz
nsgenbind-141796f3e78e8b134a6a44709a6f349e83bdf04d.tar.bz2
implement node search which makes webidl loading work
Diffstat (limited to 'src')
-rw-r--r--src/genjsbind-ast.c15
1 files changed, 15 insertions, 0 deletions
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;
}