summaryrefslogtreecommitdiff
path: root/src/jsapi-libdom.c
diff options
context:
space:
mode:
authorVincent Sanders <vincent.sanders@collabora.co.uk>2012-09-14 19:57:09 +0100
committerVincent Sanders <vincent.sanders@collabora.co.uk>2012-09-14 19:57:09 +0100
commitcdd39954a238ec07224c3c9cff66a4f8f101d71c (patch)
treedb822cce0b40536d0c5a9fbd0354264cfb6f1f09 /src/jsapi-libdom.c
parent6ccbb7e3fe88c9a6ddb232c43f71b9c8cb80a884 (diff)
downloadnsgenbind-cdd39954a238ec07224c3c9cff66a4f8f101d71c.tar.gz
nsgenbind-cdd39954a238ec07224c3c9cff66a4f8f101d71c.tar.bz2
add preamble output
add operation nodes to webidl ast
Diffstat (limited to 'src/jsapi-libdom.c')
-rw-r--r--src/jsapi-libdom.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/jsapi-libdom.c b/src/jsapi-libdom.c
index e7c13d2..3cae66f 100644
--- a/src/jsapi-libdom.c
+++ b/src/jsapi-libdom.c
@@ -19,6 +19,25 @@
#define HDR_COMMENT_SEP "\n * "
#define HDR_COMMENT_PREABLE "Generated by nsgenjsapi"
+static int webidl_preamble_cb(struct genbind_node *node, void *ctx)
+{
+ FILE *outfile = ctx;
+ char *txt;
+ txt = genbind_node_gettext(node);
+ fprintf(outfile, "%s", txt);
+ return 0;
+}
+
+static int
+output_preamble(FILE *outfile, struct genbind_node *genbind_ast)
+{
+ genbind_node_for_each_type(genbind_ast,
+ GENBIND_NODE_TYPE_PREAMBLE,
+ webidl_preamble_cb,
+ outfile);
+ return 0;
+}
+
static int webidl_hdrcomments_cb(struct genbind_node *node, void *ctx)
{
FILE *outfile = ctx;
@@ -102,9 +121,9 @@ int jsapi_libdom_output(char *outfilename, struct genbind_node *genbind_ast)
output_header_comments(outfile, genbind_ast);
- /* fprintf(outfile, " %s\n \n\n", genbind_ast->hdr_comments);
+ output_preamble(outfile, genbind_ast);
- fprintf(outfile, "%s", genbind_ast->preamble);
+ /*
fprintf(outfile, " interface %s \n\n", genbind_ast->ifname);
*/