return (Node *)self;
}
-Node * new_class (char * otype, char * ptype, GList * nodes)
+Node * new_class (char * otype, char * ptype, char * bonobo_x_class, char * chunk_size, GList * nodes)
{
Class * self = g_new0(Class, 1);
self->type = CLASS_NODE;
self->otype = otype;
self->ptype = ptype;
+ self->bonobo_x_class = bonobo_x_class;
+ self->chunk_size = chunk_size;
self->nodes = nodes;
return (Node *)self;
}
return (Node *)self;
}
-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_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)
{
Method * self = g_new0(Method, 1);
self->type = METHOD_NODE;
self->ccode_line = ccode_line;
self->vararg = vararg;
self->unique_id = unique_id;
+ self->bonobo_x_func = bonobo_x_func;
return (Node *)self;
}
-Node * new_type (int stars, char * name, char * postfix)
+Node * new_type (char * name, char * pointer, char * postfix)
{
Type * self = g_new0(Type, 1);
self->type = TYPE_NODE;
- self->stars = stars;
self->name = name;
+ self->pointer = pointer;
self->postfix = postfix;
return (Node *)self;
}
Argument * copy_argument (Argument * self)
{
Argument * new;
- g_return_if_fail(self != NULL);
- g_return_if_fail(self->type == ARGUMENT_NODE);
+ g_return_val_if_fail(self != NULL, NULL);
+ g_return_val_if_fail(self->type == ARGUMENT_NODE, NULL);
new = g_new0(Argument, 1);
new->type = ARGUMENT_NODE;
new->gtktype = g_strdup(self->gtktype);
CCode * copy_ccode (CCode * self)
{
CCode * new;
- g_return_if_fail(self != NULL);
- g_return_if_fail(self->type == CCODE_NODE);
+ g_return_val_if_fail(self != NULL, NULL);
+ g_return_val_if_fail(self->type == CCODE_NODE, NULL);
new = g_new0(CCode, 1);
new->type = CCODE_NODE;
new->cctype = self->cctype;
Check * copy_check (Check * self)
{
Check * new;
- g_return_if_fail(self != NULL);
- g_return_if_fail(self->type == CHECK_NODE);
+ g_return_val_if_fail(self != NULL, NULL);
+ g_return_val_if_fail(self->type == CHECK_NODE, NULL);
new = g_new0(Check, 1);
new->type = CHECK_NODE;
new->chtype = self->chtype;
Class * copy_class (Class * self)
{
Class * new;
- g_return_if_fail(self != NULL);
- g_return_if_fail(self->type == CLASS_NODE);
+ g_return_val_if_fail(self != NULL, NULL);
+ g_return_val_if_fail(self->type == CLASS_NODE, NULL);
new = g_new0(Class, 1);
new->type = CLASS_NODE;
new->otype = g_strdup(self->otype);
new->ptype = g_strdup(self->ptype);
+ new->bonobo_x_class = g_strdup(self->bonobo_x_class);
+ new->chunk_size = g_strdup(self->chunk_size);
new->nodes = copy_node_list(self->nodes);
return new;
}
FuncArg * copy_funcarg (FuncArg * self)
{
FuncArg * new;
- g_return_if_fail(self != NULL);
- g_return_if_fail(self->type == FUNCARG_NODE);
+ g_return_val_if_fail(self != NULL, NULL);
+ g_return_val_if_fail(self->type == FUNCARG_NODE, NULL);
new = g_new0(FuncArg, 1);
new->type = FUNCARG_NODE;
new->atype = copy_type(self->atype);
Method * copy_method (Method * self)
{
Method * new;
- g_return_if_fail(self != NULL);
- g_return_if_fail(self->type == METHOD_NODE);
+ g_return_val_if_fail(self != NULL, NULL);
+ g_return_val_if_fail(self->type == METHOD_NODE, NULL);
new = g_new0(Method, 1);
new->type = METHOD_NODE;
new->scope = self->scope;
new->ccode_line = self->ccode_line;
new->vararg = self->vararg;
new->unique_id = self->unique_id;
+ new->bonobo_x_func = self->bonobo_x_func;
return new;
}
Type * copy_type (Type * self)
{
Type * new;
- g_return_if_fail(self != NULL);
- g_return_if_fail(self->type == TYPE_NODE);
+ g_return_val_if_fail(self != NULL, NULL);
+ g_return_val_if_fail(self->type == TYPE_NODE, NULL);
new = g_new0(Type, 1);
new->type = TYPE_NODE;
- new->stars = self->stars;
new->name = g_strdup(self->name);
+ new->pointer = g_strdup(self->pointer);
new->postfix = g_strdup(self->postfix);
return new;
}
Variable * copy_variable (Variable * self)
{
Variable * new;
- g_return_if_fail(self != NULL);
- g_return_if_fail(self->type == VARIABLE_NODE);
+ g_return_val_if_fail(self != NULL, NULL);
+ g_return_val_if_fail(self->type == VARIABLE_NODE, NULL);
new = g_new0(Variable, 1);
new->type = VARIABLE_NODE;
new->scope = self->scope;
g_return_if_fail(self->type == CLASS_NODE);
g_free(self->otype);
g_free(self->ptype);
+ g_free(self->bonobo_x_class);
+ g_free(self->chunk_size);
free_node_list(self->nodes);
g_free(self);
}
g_return_if_fail(self != NULL);
g_return_if_fail(self->type == TYPE_NODE);
g_free(self->name);
+ g_free(self->pointer);
g_free(self->postfix);
g_free(self);
}
Node * copy_node(Node *node)
{
- g_return_if_fail(node != NULL);
- g_return_if_fail(node->type >= 0 && node->type < LAST_NODE_TYPE);
+ g_return_val_if_fail(node != NULL, NULL);
+ g_return_val_if_fail(node->type >= 0 && node->type < LAST_NODE_TYPE, NULL);
switch(node->type) {
case ARGUMENT_NODE: return (Node *)copy_argument ((Argument *)node);
case CCODE_NODE: return (Node *)copy_ccode ((CCode *)node);