summaryrefslogtreecommitdiff
path: root/src/webidl-ast.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-01-01 18:31:37 +0000
committerVincent Sanders <vince@kyllikki.org>2014-05-16 14:38:56 +0100
commit188c8f049581143a92e3a710203d9c1d6598056b (patch)
tree516d49d87f71bfcfa064759ab64efcd43a931502 /src/webidl-ast.c
parent0d89adf43b0c3b85d698e333c157e7589f51beb7 (diff)
downloadnsgenbind-188c8f049581143a92e3a710203d9c1d6598056b.tar.gz
nsgenbind-188c8f049581143a92e3a710203d9c1d6598056b.tar.bz2
add function and property enumerations to the interface map
Diffstat (limited to 'src/webidl-ast.c')
-rw-r--r--src/webidl-ast.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/webidl-ast.c b/src/webidl-ast.c
index d75a186..8acb2fb 100644
--- a/src/webidl-ast.c
+++ b/src/webidl-ast.c
@@ -162,6 +162,26 @@ int webidl_cmp_node_type(struct webidl_node *node, void *ctx)
return 0;
}
+static int webidl_enumerate_node(struct webidl_node *node, void *ctx)
+{
+ node = node;
+ (*((int *)ctx))++;
+ return 0;
+}
+
+/* exported interface defined in nsgenbind-ast.h */
+int
+webidl_node_enumerate_type(struct webidl_node *node,
+ enum webidl_node_type type)
+{
+ int count = 0;
+ webidl_node_for_each_type(node,
+ type,
+ webidl_enumerate_node,
+ &count);
+ return count;
+}
+
/* exported interface defined in webidl-ast.h */
struct webidl_node *
webidl_node_find(struct webidl_node *node,