diff options
author | Vincent Sanders <vince@kyllikki.org> | 2015-10-25 00:40:48 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-10-25 00:40:48 +0100 |
commit | 70a95724ab5c4629a9c37cfdc5db750684f48b05 (patch) | |
tree | e54d8f1087f599147d2e7db4c433fb7d7f54f0af /src/duk-libdom-interface.c | |
parent | 2c193d1fa01e116d7cdb1b5dd0f3cd8497bf7ef6 (diff) | |
download | nsgenbind-70a95724ab5c4629a9c37cfdc5db750684f48b05.tar.gz nsgenbind-70a95724ab5c4629a9c37cfdc5db750684f48b05.tar.bz2 |
extend the interface attribute setter automatic code generation to cover longs
Diffstat (limited to 'src/duk-libdom-interface.c')
-rw-r--r-- | src/duk-libdom-interface.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/duk-libdom-interface.c b/src/duk-libdom-interface.c index 77a58b0..553a213 100644 --- a/src/duk-libdom-interface.c +++ b/src/duk-libdom-interface.c @@ -1367,6 +1367,35 @@ output_generated_attribute_setter(FILE* outf, "\treturn 0;\n"); break; + case WEBIDL_TYPE_LONG: + if (atributee->type_modifier == WEBIDL_TYPE_MODIFIER_UNSIGNED) { + fprintf(outf, + "\tdom_exception exc;\n" + "\tdom_ulong l;\n" + "\n" + "\tl = duk_get_uint(ctx, 0);\n" + "\n"); + } else { + fprintf(outf, + "\tdom_exception exc;\n" + "\tdom_long l;\n" + "\n" + "\tl = duk_get_int(ctx, 0);\n" + "\n"); + } + fprintf(outf, + "\texc = dom_%s_set_%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" + "\treturn 0;\n"); + break; + case WEBIDL_TYPE_BOOL: fprintf(outf, "\tdom_exception exc;\n" |