|
nsgenbind
|
#include <stdio.h>#include <stdlib.h>#include <stdbool.h>#include <string.h>#include <unistd.h>#include <getopt.h>#include <errno.h>#include <ctype.h>#include "options.h"#include "utils.h"#include "nsgenbind-ast.h"#include "webidl-ast.h"#include "ir.h"#include "output.h"#include "duk-libdom.h"Go to the source code of this file.
Macros | |
| #define | NSGENBIND_PREFACE |
Functions | |
| int | output_tool_preface (struct opctx *outc) |
| int | output_cdata (struct opctx *outc, struct genbind_node *node, enum genbind_node_type nodetype) |
| int | output_ccode (struct opctx *outc, struct genbind_node *node) |
| int | output_tool_prologue (struct opctx *outc) |
| int | output_ctype (struct opctx *outc, struct genbind_node *node, bool identifier) |
| int | output_method_cdata (struct opctx *outc, struct genbind_node *node, enum genbind_method_type sel_method_type) |
| char * | gen_idl2c_name (const char *idlname) |
| #define NSGENBIND_PREFACE |
Definition at line 26 of file duk-libdom-common.c.
| char * gen_idl2c_name | ( | const char * | idlname | ) |
Generate a C name from an IDL name.
The IDL interface names are camelcase and not similar to libdom naming so it is necessary to convert them to a libdom compatible class name. This implementation is simple ASCII capable only and cannot cope with multibyte codepoints.
The algorithm is:
Definition at line 181 of file duk-libdom-common.c.
| int output_ccode | ( | struct opctx * | outc, |
| struct genbind_node * | node | ||
| ) |
output c code with line directives if possible.
used for any cdata sections
| outf | The file handle to write output. |
| node | The node to search. |
| nodetype | the type of child node to search for. |
Definition at line 62 of file duk-libdom-common.c.
| int output_cdata | ( | struct opctx * | outc, |
| struct genbind_node * | node, | ||
| enum genbind_node_type | nodetype | ||
| ) |
output character data of node of given type.
used for any cdata sections
| outf | The file handle to write output. |
| node | The node to search. |
| nodetype | the type of child node to search for. |
Definition at line 43 of file duk-libdom-common.c.
| int output_ctype | ( | struct opctx * | outc, |
| struct genbind_node * | node, | ||
| bool | identifier | ||
| ) |
output a C variable type
Used to output c type and optionlly identifier declarations for parameters and structure entries. If the optional identifier is output it is ensured the type is separated from the identifier with either a * or space.
| outf | The file handle to write output. |
| node | The node to generate content for. |
| identifier | If the indentifier should be output. |
Definition at line 111 of file duk-libdom-common.c.
| int output_method_cdata | ( | struct opctx * | outc, |
| struct genbind_node * | node, | ||
| enum genbind_method_type | sel_method_type | ||
| ) |
output character data of method node of given type.
used for any cdata including pre/pro/epi/post sections
| outf | The file handle to write output. |
| node | The node to search. |
| nodetype | the type of child node to search for. |
Definition at line 149 of file duk-libdom-common.c.
| int output_tool_preface | ( | struct opctx * | outc | ) |
generate preface block for nsgenbind
Definition at line 35 of file duk-libdom-common.c.
| int output_tool_prologue | ( | struct opctx * | outc | ) |
generate preface block for nsgenbind
Definition at line 90 of file duk-libdom-common.c.