]> git.draconx.ca Git - gob-dx.git/blob - src/treefuncs.h
Release 1.0.9
[gob-dx.git] / src / treefuncs.h
1 /* Generated by generate_treefuncs.pl from treefuncs.def!
2  * Do not edit by hand! */
3
4
5 #ifndef _TREEFUNCS_H_
6
7 #define _TREEFUNCS_H_
8
9 /* for ccode type */
10 enum {
11         A_CCODE,
12         AT_CCODE,
13         C_CCODE,
14         H_CCODE,
15         HT_CCODE,
16         PH_CCODE
17 };
18
19 /* check type */
20 enum {
21         NULL_CHECK,
22         TYPE_CHECK,
23         LT_CHECK,
24         GT_CHECK,
25         LE_CHECK,
26         GE_CHECK,
27         EQ_CHECK,
28         NE_CHECK
29 };
30
31 /* scope type */
32 enum {
33         NO_SCOPE,
34         PUBLIC_SCOPE,
35         PRIVATE_SCOPE,
36         PROTECTED_SCOPE,
37         CLASS_SCOPE
38 };
39
40 /* method type */
41 enum {
42         REGULAR_METHOD,
43         INIT_METHOD,
44         CLASS_INIT_METHOD,
45         VIRTUAL_METHOD,
46         SIGNAL_LAST_METHOD,
47         SIGNAL_FIRST_METHOD,
48         OVERRIDE_METHOD
49 };
50
51
52 enum {
53         CLASS_NODE,
54         TYPE_NODE,
55         CCODE_NODE,
56         CHECK_NODE,
57         FUNCARG_NODE,
58         ARGUMENT_NODE,
59         METHOD_NODE,
60         VARIABLE_NODE,
61         LAST_NODE_TYPE
62 };
63
64 typedef union _Node Node;
65 typedef struct _Class Class;
66 typedef struct _Type Type;
67 typedef struct _CCode CCode;
68 typedef struct _Check Check;
69 typedef struct _FuncArg FuncArg;
70 typedef struct _Argument Argument;
71 typedef struct _Method Method;
72 typedef struct _Variable Variable;
73
74
75 struct _Argument {
76         int type;
77         char * gtktype;
78         Type * atype;
79         GList * flags;
80         char * name;
81         char * get;
82         int get_line;
83         char * set;
84         int set_line;
85         int line_no;
86 };
87
88 struct _CCode {
89         int type;
90         int cctype;
91         char * cbuf;
92         int line_no;
93 };
94
95 struct _Check {
96         int type;
97         int chtype;
98         char * number;
99 };
100
101 struct _Class {
102         int type;
103         char * otype;
104         char * ptype;
105         char * bonobo_x_class;
106         char * chunk_size;
107         GList * nodes;
108 };
109
110 struct _FuncArg {
111         int type;
112         Type * atype;
113         char * name;
114         GList * checks;
115 };
116
117 struct _Method {
118         int type;
119         int scope;
120         int method;
121         Type * mtype;
122         char * otype;
123         GList * gtktypes;
124         GList * flags;
125         char * id;
126         GList * args;
127         char * onerror;
128         char * defreturn;
129         char * cbuf;
130         int line_no;
131         int ccode_line;
132         gboolean vararg;
133         int unique_id;
134         gboolean bonobo_x_func;
135 };
136
137 struct _Type {
138         int type;
139         char * name;
140         char * pointer;
141         char * postfix;
142 };
143
144 struct _Variable {
145         int type;
146         int scope;
147         Type * vtype;
148         char * id;
149         int line_no;
150         char * destructor;
151         int destructor_line;
152         gboolean destructor_simple;
153         char * initializer;
154         int initializer_line;
155 };
156
157 union _Node {
158         int type;
159         Argument argument;
160         CCode ccode;
161         Check check;
162         Class class;
163         FuncArg funcarg;
164         Method method;
165         Type _type;
166         Variable variable;
167 };
168
169 /* New functions */
170 Node * new_argument (char * gtktype, Type * atype, GList * flags, char * name, char * get, int get_line, char * set, int set_line, int line_no);
171 Node * new_ccode (int cctype, char * cbuf, int line_no);
172 Node * new_check (int chtype, char * number);
173 Node * new_class (char * otype, char * ptype, char * bonobo_x_class, char * chunk_size, GList * nodes);
174 Node * new_funcarg (Type * atype, char * name, GList * checks);
175 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, gboolean bonobo_x_func);
176 Node * new_type (char * name, char * pointer, char * postfix);
177 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);
178
179 /* General copy/free functions */
180 Node * copy_node(Node *node);
181 void free_node(Node *node);
182
183 GList * copy_node_list(GList *nodes);
184 void free_node_list(GList *nodes);
185
186 /* Copy functions */
187 Argument * copy_argument (Argument * self);
188 CCode * copy_ccode (CCode * self);
189 Check * copy_check (Check * self);
190 Class * copy_class (Class * self);
191 FuncArg * copy_funcarg (FuncArg * self);
192 Method * copy_method (Method * self);
193 Type * copy_type (Type * self);
194 Variable * copy_variable (Variable * self);
195
196 /* Free functions */
197 void free_argument (Argument * self);
198 void free_ccode (CCode * self);
199 void free_check (Check * self);
200 void free_class (Class * self);
201 void free_funcarg (FuncArg * self);
202 void free_method (Method * self);
203 void free_type (Type * self);
204 void free_variable (Variable * self);
205
206 #endif /*_TREEFUNCS_H_*/