summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-10-24 18:37:22 (GMT)
committer Vincent Sanders <vince@kyllikki.org>2015-10-24 18:37:22 (GMT)
commit0f8a9def0c9480c884da9c3021f55a8e30324e45 (patch)
treeffc5f5fcc40ca8acc60d709a1ed6da1732df89a6
parenta126224b443aa279e58a6d58f316b2182086812b (diff)
downloadnsgenbind-0f8a9def0c9480c884da9c3021f55a8e30324e45.tar.gz
nsgenbind-0f8a9def0c9480c884da9c3021f55a8e30324e45.tar.bz2
extend the interface attribute getter automatic code generation to cover longs
-rw-r--r--src/duk-libdom-interface.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/duk-libdom-interface.c b/src/duk-libdom-interface.c
index a52d25b..a57c520 100644
--- a/src/duk-libdom-interface.c
+++ b/src/duk-libdom-interface.c
@@ -1224,6 +1224,30 @@ output_generated_attribute_getter(FILE* outf,
"\treturn 1;\n");
break;
+ case WEBIDL_TYPE_LONG:
+ if (atributee->type_modifier == WEBIDL_TYPE_MODIFIER_UNSIGNED) {
+ fprintf(outf, "\tdom_ulong l;\n");
+ } else {
+ fprintf(outf, "\tdom_long l;\n");
+ }
+ fprintf(outf,
+ "\tdom_exception exc;\n"
+ "\n");
+ fprintf(outf,
+ "\texc = dom_%s_get_%s((struct dom_%s *)((node_private_t*)priv)->node, &l);\n",
+ interfacee->class_name,
+ atributee->property_name,
+ interfacee->class_name);
+ fprintf(outf,
+ "\tif (exc != DOM_NO_ERR) {\n"
+ "\t\treturn 0;\n"
+ "\t}\n"
+ "\n"
+ "\tduk_push_number(ctx, (duk_double_t)l);\n"
+ "\n"
+ "\treturn 1;\n");
+ break;
+
case WEBIDL_TYPE_BOOL:
fprintf(outf,
"\tdom_exception exc;\n"