summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-01-01 15:09:10 +0000
committerVincent Sanders <vince@kyllikki.org>2014-05-16 14:38:56 +0100
commit0d89adf43b0c3b85d698e333c157e7589f51beb7 (patch)
treec601e182fd251787a8e3ed00e8f0769abf0e38ab /src
parented92dd097848f4628abfa3a8cc8be802a996272d (diff)
downloadnsgenbind-0d89adf43b0c3b85d698e333c157e7589f51beb7.tar.gz
nsgenbind-0d89adf43b0c3b85d698e333c157e7589f51beb7.tar.bz2
rename jsapi method generation to be named function rather than oddly named webidl operator nomenclature
Diffstat (limited to 'src')
-rw-r--r--src/Makefile2
-rw-r--r--src/jsapi-libdom-function.c (renamed from src/jsapi-libdom-operator.c)8
-rw-r--r--src/jsapi-libdom.c10
-rw-r--r--src/jsapi-libdom.h5
4 files changed, 14 insertions, 11 deletions
diff --git a/src/Makefile b/src/Makefile
index 8233398..2f42c4a 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,7 +1,7 @@
CFLAGS := $(CFLAGS) -I$(BUILDDIR) -Isrc/ -g -DYYENABLE_NLS=0
# Sources in this directory
-DIR_SOURCES := nsgenbind.c webidl-ast.c nsgenbind-ast.c jsapi-libdom.c jsapi-libdom-operator.c jsapi-libdom-property.c jsapi-libdom-init.c jsapi-libdom-new.c
+DIR_SOURCES := nsgenbind.c webidl-ast.c nsgenbind-ast.c jsapi-libdom.c jsapi-libdom-function.c jsapi-libdom-property.c jsapi-libdom-init.c jsapi-libdom-new.c
SOURCES := $(SOURCES) $(BUILDDIR)/nsgenbind-parser.c $(BUILDDIR)/nsgenbind-lexer.c $(BUILDDIR)/webidl-parser.c $(BUILDDIR)/webidl-lexer.c
diff --git a/src/jsapi-libdom-operator.c b/src/jsapi-libdom-function.c
index 1d16afe..594a100 100644
--- a/src/jsapi-libdom-operator.c
+++ b/src/jsapi-libdom-function.c
@@ -1,4 +1,4 @@
-/* function/operator generation
+/* jsapi function generation for webidl bodies
*
* This file is part of nsgenbind.
* Licensed under the MIT License,
@@ -813,12 +813,12 @@ static int webidl_implements_cb(struct webidl_node *node, void *ctx)
{
struct binding *binding = ctx;
- return output_operator_body(binding, webidl_node_gettext(node));
+ return output_function_body(binding, webidl_node_gettext(node));
}
/* exported interface documented in jsapi-libdom.h */
int
-output_operator_body(struct binding *binding, const char *interface)
+output_function_body(struct binding *binding, const char *interface)
{
struct webidl_node *interface_node;
struct webidl_node *members_node;
@@ -863,7 +863,7 @@ output_operator_body(struct binding *binding, const char *interface)
WEBIDL_NODE_TYPE_INTERFACE_INHERITANCE);
if (inherit_node != NULL) {
- res = output_operator_body(binding,
+ res = output_function_body(binding,
webidl_node_gettext(inherit_node));
}
diff --git a/src/jsapi-libdom.c b/src/jsapi-libdom.c
index 895ccf4..bd1dbbe 100644
--- a/src/jsapi-libdom.c
+++ b/src/jsapi-libdom.c
@@ -897,7 +897,7 @@ build_interface_map(struct genbind_node *binding_node,
int inf;
interfaces[idx].inherit_idx = -1;
for (inf = 0; inf < interfacec; inf++ ) {
- /* cannot inherit from self. and name must match */
+ /* cannot inherit from self and name must match */
if ((inf != idx) &&
(strcmp(interfaces[idx].inherit_name,
interfaces[inf].name) == 0)) {
@@ -1109,15 +1109,15 @@ jsapi_libdom_output(struct options *options,
return 85;
}
- /* user code output just before function bodies emitted */
+ /* user code output just before interface code bodies emitted */
res = output_prologue(binding);
if (res) {
return 89;
}
- /* operator and atrtribute body generation */
+ /* method (function) and property body generation */
- res = output_operator_body(binding, binding->interface);
+ res = output_function_body(binding, binding->interface);
if (res) {
return 90;
}
@@ -1127,7 +1127,7 @@ jsapi_libdom_output(struct options *options,
return 100;
}
- /* operator and atrtribute specifier generation */
+ /* method (function) and property specifier generation */
res = output_function_spec(binding);
if (res) {
diff --git a/src/jsapi-libdom.h b/src/jsapi-libdom.h
index bdf4bec..13a5276 100644
--- a/src/jsapi-libdom.h
+++ b/src/jsapi-libdom.h
@@ -18,6 +18,9 @@ struct binding_interface {
const char *inherit_name; /* name of interface this inherits from */
int inherit_idx; /* index into binding map of inherited interface or -1 for not in map */
int refcount; /* number of entries in map that refer to this interface */
+ int own_properties; /* the number of properties the interface has */
+ int own_functions; /* the number of functions the interface has */
+
};
struct binding {
@@ -76,7 +79,7 @@ int output_function_spec(struct binding *binding);
* @param binding The binding information
* @param interface The interface to generate operator bodys for
*/
-int output_operator_body(struct binding *binding, const char *interface);
+int output_function_body(struct binding *binding, const char *interface);
/** generate property tinyid enum */
int output_property_tinyid(struct binding *binding);