nsgenbind
Loading...
Searching...
No Matches
Functions
duk-libdom.h File Reference

Go to the source code of this file.

Functions

int duk_libdom_output (struct ir *ir)
 
int output_interface (struct ir *ir, struct ir_entry *interfacee)
 
int output_dictionary (struct ir *ir, struct ir_entry *dictionarye)
 
int output_interface_declaration (struct opctx *outc, struct ir_entry *interfacee)
 
int output_dictionary_declaration (struct opctx *outc, struct ir_entry *dictionarye)
 
int output_tool_preface (struct opctx *outc)
 
int output_tool_prologue (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_method_cdata (struct opctx *outc, struct genbind_node *node, enum genbind_method_type sel_method_type)
 
int output_ctype (struct opctx *outc, struct genbind_node *node, bool identifier)
 
char * gen_idl2c_name (const char *idlname)
 
int output_generated_attribute_setter (struct opctx *outc, struct ir_entry *interfacee, struct ir_attribute_entry *atributee)
 
int output_generated_attribute_getter (struct opctx *outc, struct ir_entry *interfacee, struct ir_attribute_entry *atributee)
 

Function Documentation

◆ duk_libdom_output()

int duk_libdom_output ( struct ir ir)

Generate output for duktape and libdom bindings.

Definition at line 579 of file duk-libdom.c.

◆ gen_idl2c_name()

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:

  • copy characters to output lowering their case
  • if the previous character in the input name was uppercase and the current one is lowercase insert an underscore before the previous character.

Definition at line 181 of file duk-libdom-common.c.

◆ output_ccode()

int output_ccode ( struct opctx outc,
struct genbind_node node 
)

output c code with line directives if possible.

used for any cdata sections

Parameters
outfThe file handle to write output.
nodeThe node to search.
nodetypethe type of child node to search for.
Returns
The number of nodes written or 0 for none.

Definition at line 62 of file duk-libdom-common.c.

◆ output_cdata()

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

Parameters
outfThe file handle to write output.
nodeThe node to search.
nodetypethe type of child node to search for.
Returns
The number of nodes written or 0 for none.

Definition at line 43 of file duk-libdom-common.c.

◆ output_ctype()

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.

Parameters
outfThe file handle to write output.
nodeThe node to generate content for.
identifierIf the indentifier should be output.
Returns
0 on success.

Definition at line 111 of file duk-libdom-common.c.

◆ output_dictionary()

int output_dictionary ( struct ir ir,
struct ir_entry dictionarye 
)

generate a source file to implement a dictionary using duk and libdom.

Definition at line 314 of file duk-libdom-dictionary.c.

◆ output_dictionary_declaration()

int output_dictionary_declaration ( struct opctx outc,
struct ir_entry dictionarye 
)

generate a declaration to implement a dictionary using duk and libdom.

Definition at line 466 of file duk-libdom-dictionary.c.

◆ output_generated_attribute_getter()

int output_generated_attribute_getter ( struct opctx outc,
struct ir_entry interfacee,
struct ir_attribute_entry atributee 
)

Generate class property getter for a single attribute.

Definition at line 82 of file duk-libdom-generated.c.

◆ output_generated_attribute_setter()

int output_generated_attribute_setter ( struct opctx outc,
struct ir_entry interfacee,
struct ir_attribute_entry atributee 
)

Generate class property setter for a single attribute.

Definition at line 275 of file duk-libdom-generated.c.

◆ output_interface()

int output_interface ( struct ir ir,
struct ir_entry interfacee 
)

generate a source file to implement an interface using duk and libdom.

Parameters
irThe intermediate representation of the binding tree.
interfaceeThe interface entry to output within the ir.

Definition at line 1643 of file duk-libdom-interface.c.

◆ output_interface_declaration()

int output_interface_declaration ( struct opctx outc,
struct ir_entry interfacee 
)

generate a declaration to implement a dictionary using duk and libdom.

Definition at line 1742 of file duk-libdom-interface.c.

◆ output_method_cdata()

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

Parameters
outfThe file handle to write output.
nodeThe node to search.
nodetypethe type of child node to search for.
Returns
The number of nodes written or 0 for none.

Definition at line 149 of file duk-libdom-common.c.

◆ output_tool_preface()

int output_tool_preface ( struct opctx outc)

generate preface block for nsgenbind

Definition at line 35 of file duk-libdom-common.c.

◆ output_tool_prologue()

int output_tool_prologue ( struct opctx outc)

generate preface block for nsgenbind

Definition at line 90 of file duk-libdom-common.c.