summaryrefslogtreecommitdiff
path: root/src/webidl-ast.c
diff options
context:
space:
mode:
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,