X-Git-Url: http://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/509cf0693fc440c71bdd3e71ea8947a6b4eb0bcf..4d534c82fb65897999ade6867534ab952a9bc019:/src/treefuncs.h diff --git a/src/treefuncs.h b/src/treefuncs.h index 974540a..b21c241 100644 --- a/src/treefuncs.h +++ b/src/treefuncs.h @@ -2,9 +2,8 @@ * Do not edit by hand! */ -#ifndef _TREEFUNCS_H_ - -#define _TREEFUNCS_H_ +#ifndef TREEFUNCS_H +#define TREEFUNCS_H /* for ccode type */ enum { @@ -49,6 +48,8 @@ enum { }; + +typedef long NodeType; enum { CLASS_NODE, TYPE_NODE, @@ -56,8 +57,13 @@ enum { CHECK_NODE, FUNCARG_NODE, ARGUMENT_NODE, + PROPERTY_NODE, METHOD_NODE, VARIABLE_NODE, + ENUMDEF_NODE, + ENUMVALUE_NODE, + FLAGS_NODE, + ERROR_NODE, LAST_NODE_TYPE }; @@ -68,12 +74,17 @@ typedef struct _CCode CCode; typedef struct _Check Check; typedef struct _FuncArg FuncArg; typedef struct _Argument Argument; +typedef struct _Property Property; typedef struct _Method Method; typedef struct _Variable Variable; +typedef struct _EnumDef EnumDef; +typedef struct _EnumValue EnumValue; +typedef struct _Flags Flags; +typedef struct _Error Error; struct _Argument { - int type; + NodeType type; char * gtktype; Type * atype; GList * flags; @@ -86,34 +97,66 @@ struct _Argument { }; struct _CCode { - int type; + NodeType type; int cctype; char * cbuf; int line_no; }; struct _Check { - int type; + NodeType type; int chtype; char * number; }; struct _Class { - int type; + NodeType type; char * otype; char * ptype; + char * bonobo_object_class; + gboolean glade_xml; + char * chunk_size; + GList * interfaces; GList * nodes; + gboolean abstract; +}; + +struct _EnumDef { + NodeType type; + char * etype; + char * prefix; + GList * values; +}; + +struct _EnumValue { + NodeType type; + char * name; + char * value; +}; + +struct _Error { + NodeType type; + char * etype; + char * prefix; + GList * values; +}; + +struct _Flags { + NodeType type; + char * ftype; + char * prefix; + GList * values; }; struct _FuncArg { - int type; + NodeType type; Type * atype; char * name; GList * checks; }; struct _Method { - int type; + NodeType type; int scope; int method; Type * mtype; @@ -129,75 +172,83 @@ struct _Method { int ccode_line; gboolean vararg; int unique_id; + gboolean bonobo_object_func; + char * interface; +}; + +struct _Property { + NodeType type; + char * gtktype; + Type * ptype; + GList * flags; + char * name; + char * nick; + char * blurb; + char * minimum; + char * maximum; + char * default_value; + char * extra_gtktype; + gboolean override; + gboolean link; + gboolean export; + char * get; + int get_line; + char * set; + int set_line; + int line_no; }; struct _Type { - int type; - int stars; + NodeType type; char * name; + char * pointer; char * postfix; }; struct _Variable { - int type; + NodeType type; int scope; Type * vtype; + gboolean glade_widget; char * id; int line_no; + gboolean destructor_unref; char * destructor; int destructor_line; gboolean destructor_simple; char * initializer; int initializer_line; + gboolean initializer_simple; }; union _Node { - int type; + NodeType type; Argument argument; CCode ccode; Check check; Class class; + EnumDef enumdef; + EnumValue enumvalue; + Error error; + Flags flags; FuncArg funcarg; Method method; + Property property; Type _type; Variable variable; }; -/* New functions */ -Node * new_argument (char * gtktype, Type * atype, GList * flags, char * name, char * get, int get_line, char * set, int set_line, int line_no); -Node * new_ccode (int cctype, char * cbuf, int line_no); -Node * new_check (int chtype, char * number); -Node * new_class (char * otype, char * ptype, GList * nodes); -Node * new_funcarg (Type * atype, char * name, GList * checks); -Node * new_method (int scope, int method, Type * mtype, char * otype, GList * gtktypes, GList * flags, char * id, GList * args, char * onerror, char * defreturn, char * cbuf, int line_no, int ccode_line, gboolean vararg, int unique_id); -Node * new_type (int stars, char * name, char * postfix); -Node * new_variable (int scope, Type * vtype, char * id, int line_no, char * destructor, int destructor_line, gboolean destructor_simple, char * initializer, int initializer_line); /* General copy/free functions */ -Node * copy_node(Node *node); -void free_node(Node *node); - -GList * copy_node_list(GList *nodes); -void free_node_list(GList *nodes); - -/* Copy functions */ -Argument * copy_argument (Argument * self); -CCode * copy_ccode (CCode * self); -Check * copy_check (Check * self); -Class * copy_class (Class * self); -FuncArg * copy_funcarg (FuncArg * self); -Method * copy_method (Method * self); -Type * copy_type (Type * self); -Variable * copy_variable (Variable * self); - -/* Free functions */ -void free_argument (Argument * self); -void free_ccode (CCode * self); -void free_check (Check * self); -void free_class (Class * self); -void free_funcarg (FuncArg * self); -void free_method (Method * self); -void free_type (Type * self); -void free_variable (Variable * self); - -#endif /*_TREEFUNCS_H_*/ +Node * node_copy (Node *node); +void node_free (Node *node); + +GList * node_list_copy (GList *nodes); +void node_list_free (GList *nodes); + +/* Node new/set functions */ +Node * node_new (NodeType type, ...); +void node_set (Node *node, ...); + + +#endif /* TREEFUNCS_H */