26#define NSGENBIND_PREFACE \
27 "/* Generated by nsgenbind\n" \
29 " * nsgenbind is published under the MIT Licence.\n" \
30 " * nsgenbind is similar to a compiler is a purely transformative tool which\n" \
31 " * explicitly makes no copyright claim on this generated output\n" \
78 if ((line != NULL) && (
filename != NULL)) {
95 outputf(outc,
"\n#include \"%s\"\n", fpath);
99 outputf(outc,
"#include \"%s\"\n", fpath);
103 outputf(outc,
"#include \"%s\"\n", fpath);
113 const char *type_cdata = NULL;
119 while (typename_node != NULL) {
122 outputf(outc,
"%s", type_cdata);
130 if (typename_node != NULL) {
136 if ((type_cdata != NULL) &&
137 (type_cdata[0] !=
'*') &&
138 (type_cdata[0] !=
' ')) {
159 while (method != NULL) {
167 if ((method_type != NULL) &&
168 (*method_type == sel_method_type)) {
189 if ((idlname == NULL) || (idlname[0] == 0)) {
196 name = calloc(2, strlen(idlname));
205 *outc++ = tolower(*inc++);
212 if ((inc == (idlname + 4)) &&
213 (idlname[0] ==
'H') &&
214 (idlname[1] ==
'T') &&
215 (idlname[2] ==
'M') &&
216 (idlname[3] ==
'L') &&
217 (islower(inc[1]) == 0)) {
220 if (islower(*inc) != 0) {
223 if (((outc - name) <= 3) ||
224 (*(outc - 3) !=
'_')) {
234 *outc++ = tolower(*inc++);
int output_method_cdata(struct opctx *outc, struct genbind_node *node, enum genbind_method_type sel_method_type)
int output_cdata(struct opctx *outc, struct genbind_node *node, enum genbind_node_type nodetype)
#define NSGENBIND_PREFACE
int output_tool_prologue(struct opctx *outc)
int output_ccode(struct opctx *outc, struct genbind_node *node)
int output_tool_preface(struct opctx *outc)
int output_ctype(struct opctx *outc, struct genbind_node *node, bool identifier)
char * gen_idl2c_name(const char *idlname)
struct genbind_node * genbind_node_find_type(struct genbind_node *node, struct genbind_node *prev, enum genbind_node_type type)
int * genbind_node_getint(struct genbind_node *node)
struct genbind_node * genbind_node_getnode(struct genbind_node *node)
char * genbind_node_gettext(struct genbind_node *node)
@ GENBIND_NODE_TYPE_METHOD_TYPE
@ GENBIND_NODE_TYPE_METHOD
@ GENBIND_NODE_TYPE_IDENT
@ GENBIND_NODE_TYPE_CDATA
int outputc(struct opctx *opctx, int c)
int output_line(struct opctx *opctx)
int outputf(struct opctx *opctx, const char *fmt,...)
struct genbind_node * node
char * genb_fpath(const char *fname)