summaryrefslogtreecommitdiff
path: root/src/interface-map.h
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-07-24 00:01:51 +0100
committerVincent Sanders <vince@kyllikki.org>2015-07-24 00:01:51 +0100
commit6406dae8c4da597da888345cf145f366b8297d7c (patch)
treef862560fbfd34b913484fce42c1997894f90b093 /src/interface-map.h
parentd36c21c4f53270f9ba8137bb1e84a7de45fea0f3 (diff)
downloadnsgenbind-6406dae8c4da597da888345cf145f366b8297d7c.tar.gz
nsgenbind-6406dae8c4da597da888345cf145f366b8297d7c.tar.bz2
Build interface map allowing for correct dependency generation
This constructs an ordered list of all interfaces in their dependency order. The topological sort ordering is derived from the interfaces inheritance. The resulting table allows the generation phase to easily map interfaces to classes defined in the binding with a useful ordering. Additionally it was noticed that the uievent IDL was missing so that has now been added and allows for a much more complete graph of interfaces to be constructed.
Diffstat (limited to 'src/interface-map.h')
-rw-r--r--src/interface-map.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/interface-map.h b/src/interface-map.h
new file mode 100644
index 0000000..c9dd654
--- /dev/null
+++ b/src/interface-map.h
@@ -0,0 +1,43 @@
+/* Interface mapping
+ *
+ * This file is part of nsgenbind.
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2012 Vincent Sanders <vince@netsurf-browser.org>
+ */
+
+#ifndef nsgenbind_interface_map_h
+#define nsgenbind_interface_map_h
+
+struct genbind_node;
+struct webidl_node;
+
+struct interface_map_entry {
+ const char *name; /** interface name */
+ struct webidl_node *node; /**< AST interface node */
+ const char *inherit_name; /**< Name of interface inhertited from */
+ int operations; /**< number of operations on interface */
+ int attributes; /**< number of attributes on interface */
+ int inherit_idx; /**< index into map of inherited interface or -1 for
+ * not in map
+ */
+ int refcount; /**< number of interfacess in map that refer to this
+ * interface
+ */
+ struct genbind_node *class; /**< class from binding (if any) */
+};
+
+struct interface_map {
+ int entryc; /**< count of interfaces */
+ struct interface_map_entry *entries;
+};
+
+int interface_map_new(struct genbind_node *genbind,
+ struct webidl_node *webidl,
+ struct interface_map **index_out);
+
+int interface_map_dump(struct interface_map *index);
+
+int interface_map_dumpdot(struct interface_map *index);
+
+#endif