const gchar *
-g_ir_node_type_to_string (GIrNodeTypeId type)
+_g_ir_node_type_to_string (GIrNodeTypeId type)
{
switch (type)
{
}
GIrNode *
-g_ir_node_new (GIrNodeTypeId type,
+_g_ir_node_new (GIrNodeTypeId type,
GIrModule *module)
{
GIrNode *node = NULL;
}
void
-g_ir_node_free (GIrNode *node)
+_g_ir_node_free (GIrNode *node)
{
GList *l;
g_free (node->name);
g_free (function->symbol);
- g_ir_node_free ((GIrNode *)function->result);
+ _g_ir_node_free ((GIrNode *)function->result);
for (l = function->parameters; l; l = l->next)
- g_ir_node_free ((GIrNode *)l->data);
+ _g_ir_node_free ((GIrNode *)l->data);
g_list_free (function->parameters);
}
break;
GIrNodeType *type = (GIrNodeType *)node;
g_free (node->name);
- g_ir_node_free ((GIrNode *)type->parameter_type1);
- g_ir_node_free ((GIrNode *)type->parameter_type2);
+ _g_ir_node_free ((GIrNode *)type->parameter_type1);
+ _g_ir_node_free ((GIrNode *)type->parameter_type2);
g_free (type->interface);
g_strfreev (type->errors);
GIrNodeParam *param = (GIrNodeParam *)node;
g_free (node->name);
- g_ir_node_free ((GIrNode *)param->type);
+ _g_ir_node_free ((GIrNode *)param->type);
}
break;
GIrNodeProperty *property = (GIrNodeProperty *)node;
g_free (node->name);
- g_ir_node_free ((GIrNode *)property->type);
+ _g_ir_node_free ((GIrNode *)property->type);
}
break;
g_free (node->name);
for (l = signal->parameters; l; l = l->next)
- g_ir_node_free ((GIrNode *)l->data);
+ _g_ir_node_free ((GIrNode *)l->data);
g_list_free (signal->parameters);
- g_ir_node_free ((GIrNode *)signal->result);
+ _g_ir_node_free ((GIrNode *)signal->result);
}
break;
g_free (node->name);
g_free (vfunc->invoker);
for (l = vfunc->parameters; l; l = l->next)
- g_ir_node_free ((GIrNode *)l->data);
+ _g_ir_node_free ((GIrNode *)l->data);
g_list_free (vfunc->parameters);
- g_ir_node_free ((GIrNode *)vfunc->result);
+ _g_ir_node_free ((GIrNode *)vfunc->result);
}
break;
GIrNodeField *field = (GIrNodeField *)node;
g_free (node->name);
- g_ir_node_free ((GIrNode *)field->type);
- g_ir_node_free ((GIrNode *)field->callback);
+ _g_ir_node_free ((GIrNode *)field->type);
+ _g_ir_node_free ((GIrNode *)field->callback);
}
break;
g_list_free (iface->interfaces);
for (l = iface->members; l; l = l->next)
- g_ir_node_free ((GIrNode *)l->data);
+ _g_ir_node_free ((GIrNode *)l->data);
g_list_free (iface->members);
}
g_free (enum_->gtype_init);
for (l = enum_->values; l; l = l->next)
- g_ir_node_free ((GIrNode *)l->data);
+ _g_ir_node_free ((GIrNode *)l->data);
g_list_free (enum_->values);
}
break;
g_free (boxed->gtype_init);
for (l = boxed->members; l; l = l->next)
- g_ir_node_free ((GIrNode *)l->data);
+ _g_ir_node_free ((GIrNode *)l->data);
g_list_free (boxed->members);
}
break;
g_free (struct_->gtype_init);
for (l = struct_->members; l; l = l->next)
- g_ir_node_free ((GIrNode *)l->data);
+ _g_ir_node_free ((GIrNode *)l->data);
g_list_free (struct_->members);
}
break;
g_free (node->name);
g_free (constant->value);
- g_ir_node_free ((GIrNode *)constant->type);
+ _g_ir_node_free ((GIrNode *)constant->type);
}
break;
g_free (union_->gtype_name);
g_free (union_->gtype_init);
- g_ir_node_free ((GIrNode *)union_->discriminator_type);
+ _g_ir_node_free ((GIrNode *)union_->discriminator_type);
for (l = union_->members; l; l = l->next)
- g_ir_node_free ((GIrNode *)l->data);
+ _g_ir_node_free ((GIrNode *)l->data);
for (l = union_->discriminators; l; l = l->next)
- g_ir_node_free ((GIrNode *)l->data);
+ _g_ir_node_free ((GIrNode *)l->data);
}
break;
/* returns the fixed size of the blob */
guint32
-g_ir_node_get_size (GIrNode *node)
+_g_ir_node_get_size (GIrNode *node)
{
GList *l;
gint size, n;
size = sizeof (ObjectBlob) + 2 * (n + (n % 2));
for (l = iface->members; l; l = l->next)
- size += g_ir_node_get_size ((GIrNode *)l->data);
+ size += _g_ir_node_get_size ((GIrNode *)l->data);
}
break;
size = sizeof (InterfaceBlob) + 2 * (n + (n % 2));
for (l = iface->members; l; l = l->next)
- size += g_ir_node_get_size ((GIrNode *)l->data);
+ size += _g_ir_node_get_size ((GIrNode *)l->data);
}
break;
size = sizeof (EnumBlob);
for (l = enum_->values; l; l = l->next)
- size += g_ir_node_get_size ((GIrNode *)l->data);
+ size += _g_ir_node_get_size ((GIrNode *)l->data);
}
break;
size = sizeof (StructBlob);
for (l = struct_->members; l; l = l->next)
- size += g_ir_node_get_size ((GIrNode *)l->data);
+ size += _g_ir_node_get_size ((GIrNode *)l->data);
}
break;
size = sizeof (StructBlob);
for (l = boxed->members; l; l = l->next)
- size += g_ir_node_get_size ((GIrNode *)l->data);
+ size += _g_ir_node_get_size ((GIrNode *)l->data);
}
break;
size = sizeof (FieldBlob);
if (field->callback)
- size += g_ir_node_get_size ((GIrNode *)field->callback);
+ size += _g_ir_node_get_size ((GIrNode *)field->callback);
}
break;
size = sizeof (UnionBlob);
for (l = union_->members; l; l = l->next)
- size += g_ir_node_get_size ((GIrNode *)l->data);
+ size += _g_ir_node_get_size ((GIrNode *)l->data);
for (l = union_->discriminators; l; l = l->next)
- size += g_ir_node_get_size ((GIrNode *)l->data);
+ size += _g_ir_node_get_size ((GIrNode *)l->data);
}
break;
default:
g_error ("Unhandled node type '%s'\n",
- g_ir_node_type_to_string (node->type));
+ _g_ir_node_type_to_string (node->type));
size = 0;
}
g_debug ("node %p type '%s' size %d", node,
- g_ir_node_type_to_string (node->type), size);
+ _g_ir_node_type_to_string (node->type), size);
return size;
}
/* returns the full size of the blob including variable-size parts (including attributes) */
static guint32
-g_ir_node_get_full_size_internal (GIrNode *parent,
+_g_ir_node_get_full_size_internal (GIrNode *parent,
GIrNode *node)
{
GList *l;
g_error ("Caught NULL node, parent=%s", parent->name);
g_debug ("node %p type '%s'", node,
- g_ir_node_type_to_string (node->type));
+ _g_ir_node_type_to_string (node->type));
switch (node->type)
{
size += ALIGN_VALUE (strlen (node->name) + 1, 4);
for (l = function->parameters; l; l = l->next)
{
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
}
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)function->result);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)function->result);
}
break;
size += ALIGN_VALUE (strlen (node->name) + 1, 4);
size += ALIGN_VALUE (strlen (function->symbol) + 1, 4);
for (l = function->parameters; l; l = l->next)
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)function->result);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)function->result);
}
break;
size = sizeof (ArgBlob) - sizeof (SimpleTypeBlob);
if (node->name)
size += ALIGN_VALUE (strlen (node->name) + 1, 4);
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)param->type);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)param->type);
}
break;
case GI_TYPE_TAG_ARRAY:
size = sizeof (ArrayTypeBlob);
if (type->parameter_type1)
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)type->parameter_type1);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)type->parameter_type1);
break;
case GI_TYPE_TAG_INTERFACE:
size += sizeof (InterfaceTypeBlob);
case GI_TYPE_TAG_GSLIST:
size += sizeof (ParamTypeBlob);
if (type->parameter_type1)
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)type->parameter_type1);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)type->parameter_type1);
break;
case GI_TYPE_TAG_GHASH:
size += sizeof (ParamTypeBlob) * 2;
if (type->parameter_type1)
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)type->parameter_type1);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)type->parameter_type1);
if (type->parameter_type2)
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)type->parameter_type2);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)type->parameter_type2);
break;
case GI_TYPE_TAG_ERROR:
{
size += 2 * (n + (n % 2));
for (l = iface->members; l; l = l->next)
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
}
break;
size += 2 * (n + (n % 2));
for (l = iface->members; l; l = l->next)
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
}
break;
}
for (l = enum_->values; l; l = l->next)
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
}
break;
if (struct_->gtype_init)
size += ALIGN_VALUE (strlen (struct_->gtype_init) + 1, 4);
for (l = struct_->members; l; l = l->next)
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
}
break;
size += ALIGN_VALUE (strlen (boxed->gtype_init) + 1, 4);
}
for (l = boxed->members; l; l = l->next)
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
}
break;
size = sizeof (PropertyBlob);
size += ALIGN_VALUE (strlen (node->name) + 1, 4);
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)prop->type);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)prop->type);
}
break;
size = sizeof (SignalBlob);
size += ALIGN_VALUE (strlen (node->name) + 1, 4);
for (l = signal->parameters; l; l = l->next)
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)signal->result);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)signal->result);
}
break;
size = sizeof (VFuncBlob);
size += ALIGN_VALUE (strlen (node->name) + 1, 4);
for (l = vfunc->parameters; l; l = l->next)
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)vfunc->result);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)vfunc->result);
}
break;
size = sizeof (FieldBlob);
size += ALIGN_VALUE (strlen (node->name) + 1, 4);
if (field->callback)
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)field->callback);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)field->callback);
else
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)field->type);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)field->type);
}
break;
size += ALIGN_VALUE (strlen (node->name) + 1, 4);
/* FIXME non-string values */
size += ALIGN_VALUE (strlen (constant->value) + 1, 4);
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)constant->type);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)constant->type);
}
break;
if (union_->gtype_init)
size += ALIGN_VALUE (strlen (union_->gtype_init) + 1, 4);
for (l = union_->members; l; l = l->next)
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
for (l = union_->discriminators; l; l = l->next)
- size += g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
+ size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data);
}
break;
node->name ? "'" : "",
node->name ? node->name : "",
node->name ? "' " : "",
- node, g_ir_node_type_to_string (node->type), size);
+ node, _g_ir_node_type_to_string (node->type), size);
g_hash_table_foreach (node->attributes, add_attribute_size, &size);
}
guint32
-g_ir_node_get_full_size (GIrNode *node)
+_g_ir_node_get_full_size (GIrNode *node)
{
- return g_ir_node_get_full_size_internal (NULL, node);
+ return _g_ir_node_get_full_size_internal (NULL, node);
}
int
-g_ir_node_cmp (GIrNode *node,
+_g_ir_node_cmp (GIrNode *node,
GIrNode *other)
{
if (node->type < other->type)
}
gboolean
-g_ir_node_can_have_member (GIrNode *node)
+_g_ir_node_can_have_member (GIrNode *node)
{
switch (node->type)
{
}
void
-g_ir_node_add_member (GIrNode *node,
+_g_ir_node_add_member (GIrNode *node,
GIrNodeFunction *member)
{
g_return_if_fail (node != NULL);
GIrNodeInterface *iface = (GIrNodeInterface *)node;
iface->members =
g_list_insert_sorted (iface->members, member,
- (GCompareFunc) g_ir_node_cmp);
+ (GCompareFunc) _g_ir_node_cmp);
break;
}
case G_IR_NODE_BOXED:
GIrNodeBoxed *boxed = (GIrNodeBoxed *)node;
boxed->members =
g_list_insert_sorted (boxed->members, member,
- (GCompareFunc) g_ir_node_cmp);
+ (GCompareFunc) _g_ir_node_cmp);
break;
}
case G_IR_NODE_STRUCT:
GIrNodeStruct *struct_ = (GIrNodeStruct *)node;
struct_->members =
g_list_insert_sorted (struct_->members, member,
- (GCompareFunc) g_ir_node_cmp);
+ (GCompareFunc) _g_ir_node_cmp);
break;
}
case G_IR_NODE_UNION:
GIrNodeUnion *union_ = (GIrNodeUnion *)node;
union_->members =
g_list_insert_sorted (union_->members, member,
- (GCompareFunc) g_ir_node_cmp);
+ (GCompareFunc) _g_ir_node_cmp);
break;
}
default:
}
const gchar *
-g_ir_node_param_direction_string (GIrNodeParam * node)
+_g_ir_node_param_direction_string (GIrNodeParam * node)
{
if (node->out)
{
if (n_names > 1)
{
- GIrNode *node = g_ir_node_new (G_IR_NODE_XREF, module);
+ GIrNode *node = _g_ir_node_new (G_IR_NODE_XREF, module);
((GIrNodeXRef *)node)->namespace = g_strdup (names[0]);
node->name = g_strdup (names[1]);
}
- g_ir_module_fatal (build, -1, "type reference '%s' not found",
- name);
+ _g_ir_module_fatal (build, -1, "type reference '%s' not found",
+ name);
out:
g_strfreev (names);
}
GIrNode *
-g_ir_find_node (GIrTypelibBuild *build,
+_g_ir_find_node (GIrTypelibBuild *build,
GIrModule *src_module,
const char *name)
{
}
static void
-g_ir_node_build_members (GList **members,
+_g_ir_node_build_members (GList **members,
GIrNodeTypeId type,
guint16 *count,
GIrNode *parent,
if (member->type == type)
{
(*count)++;
- g_ir_node_build_typelib (member, parent, build, offset, offset2);
+ _g_ir_node_build_typelib (member, parent, build, offset, offset2);
*members = g_list_delete_link (*members, l);
}
l = next;
}
static void
-g_ir_node_check_unhandled_members (GList **members,
- GIrNodeTypeId container_type)
+_g_ir_node_check_unhandled_members (GList **members,
+ GIrNodeTypeId container_type)
{
#if 0
if (*members)
{
GIrNode *member = (GIrNode *)l->data;
g_printerr ("Unhandled '%s' member '%s' type '%s'\n",
- g_ir_node_type_to_string (container_type),
+ _g_ir_node_type_to_string (container_type),
member->name,
- g_ir_node_type_to_string (member->type));
+ _g_ir_node_type_to_string (member->type));
}
g_list_free (*members);
}
void
-g_ir_node_build_typelib (GIrNode *node,
- GIrNode *parent,
- GIrTypelibBuild *build,
- guint32 *offset,
- guint32 *offset2)
+_g_ir_node_build_typelib (GIrNode *node,
+ GIrNode *parent,
+ GIrTypelibBuild *build,
+ guint32 *offset,
+ guint32 *offset2)
{
gboolean appended_stack;
GHashTable *strings = build->strings;
g_debug ("build_typelib: %s%s(%s)",
node->name ? node->name : "",
node->name ? " " : "",
- g_ir_node_type_to_string (node->type));
+ _g_ir_node_type_to_string (node->type));
if (build->stack)
appended_stack = node != (GIrNode*)build->stack->data;
if (appended_stack)
build->stack = g_list_prepend (build->stack, node);
- g_ir_node_compute_offsets (build, node);
+ _g_ir_node_compute_offsets (build, node);
/* We should only be building each node once. If we do a typelib expansion, we also
* reset the offset in girmodule.c.
pos = *offset2 + G_STRUCT_OFFSET (ArrayTypeBlob, type);
*offset2 += sizeof (ArrayTypeBlob);
- g_ir_node_build_typelib ((GIrNode *)type->parameter_type1,
+ _g_ir_node_build_typelib ((GIrNode *)type->parameter_type1,
node, build, &pos, offset2);
}
break;
pos = *offset2 + G_STRUCT_OFFSET (ParamTypeBlob, type);
*offset2 += sizeof (ParamTypeBlob) + sizeof (SimpleTypeBlob);
- g_ir_node_build_typelib ((GIrNode *)type->parameter_type1,
+ _g_ir_node_build_typelib ((GIrNode *)type->parameter_type1,
node, build, &pos, offset2);
}
break;
pos = *offset2 + G_STRUCT_OFFSET (ParamTypeBlob, type);
*offset2 += sizeof (ParamTypeBlob) + sizeof (SimpleTypeBlob)*2;
- g_ir_node_build_typelib ((GIrNode *)type->parameter_type1,
+ _g_ir_node_build_typelib ((GIrNode *)type->parameter_type1,
node, build, &pos, offset2);
- g_ir_node_build_typelib ((GIrNode *)type->parameter_type2,
+ _g_ir_node_build_typelib ((GIrNode *)type->parameter_type2,
node, build, &pos, offset2);
}
break;
blob = (FieldBlob *)&data[*offset];
- blob->name = write_string (node->name, strings, data, offset2);
+ blob->name = _g_ir_write_string (node->name, strings, data, offset2);
blob->readable = field->readable;
blob->writable = field->writable;
blob->reserved = 0;
blob->has_embedded_type = TRUE;
blob->type.offset = GI_INFO_TYPE_CALLBACK;
*offset += sizeof (FieldBlob);
- g_ir_node_build_typelib ((GIrNode *)field->callback,
+ _g_ir_node_build_typelib ((GIrNode *)field->callback,
node, build, offset, offset2);
}
else
blob->has_embedded_type = FALSE;
/* We handle the size member specially below, so subtract it */
*offset += sizeof (FieldBlob) - sizeof (SimpleTypeBlob);
- g_ir_node_build_typelib ((GIrNode *)field->type,
+ _g_ir_node_build_typelib ((GIrNode *)field->type,
node, build, offset, offset2);
}
}
/* We handle the size member specially below, so subtract it */
*offset += sizeof (PropertyBlob) - sizeof (SimpleTypeBlob);
- blob->name = write_string (node->name, strings, data, offset2);
+ blob->name = _g_ir_write_string (node->name, strings, data, offset2);
blob->deprecated = prop->deprecated;
blob->readable = prop->readable;
blob->writable = prop->writable;
blob->transfer_container_ownership = prop->shallow_transfer;
blob->reserved = 0;
- g_ir_node_build_typelib ((GIrNode *)prop->type,
+ _g_ir_node_build_typelib ((GIrNode *)prop->type,
node, build, offset, offset2);
}
break;
blob->wraps_vfunc = function->wraps_vfunc;
blob->throws = function->throws;
blob->index = 0;
- blob->name = write_string (node->name, strings, data, offset2);
- blob->symbol = write_string (function->symbol, strings, data, offset2);
+ blob->name = _g_ir_write_string (node->name, strings, data, offset2);
+ blob->symbol = _g_ir_write_string (function->symbol, strings, data, offset2);
blob->signature = signature;
/* function->result is special since it doesn't appear in the serialized format but
g_debug ("building function '%s'", function->symbol);
- g_ir_node_build_typelib ((GIrNode *)function->result->type,
+ _g_ir_node_build_typelib ((GIrNode *)function->result->type,
node, build, &signature, offset2);
blob2->may_return_null = function->result->allow_none;
{
GIrNode *param = (GIrNode *)l->data;
- g_ir_node_build_typelib (param, node, build, &signature, offset2);
+ _g_ir_node_build_typelib (param, node, build, &signature, offset2);
}
}
blob->blob_type = BLOB_TYPE_CALLBACK;
blob->deprecated = function->deprecated;
blob->reserved = 0;
- blob->name = write_string (node->name, strings, data, offset2);
+ blob->name = _g_ir_write_string (node->name, strings, data, offset2);
blob->signature = signature;
- g_ir_node_build_typelib ((GIrNode *)function->result->type,
+ _g_ir_node_build_typelib ((GIrNode *)function->result->type,
node, build, &signature, offset2);
blob2->may_return_null = function->result->allow_none;
{
GIrNode *param = (GIrNode *)l->data;
- g_ir_node_build_typelib (param, node, build, &signature, offset2);
+ _g_ir_node_build_typelib (param, node, build, &signature, offset2);
}
}
break;
blob->true_stops_emit = 0; /* FIXME */
blob->reserved = 0;
blob->class_closure = 0; /* FIXME */
- blob->name = write_string (node->name, strings, data, offset2);
+ blob->name = _g_ir_write_string (node->name, strings, data, offset2);
blob->signature = signature;
/* signal->result is special since it doesn't appear in the serialized format but
g_assert (((GIrNode *) signal->result)->offset == 0);
((GIrNode *) signal->result)->offset = signature;
- g_ir_node_build_typelib ((GIrNode *)signal->result->type,
+ _g_ir_node_build_typelib ((GIrNode *)signal->result->type,
node, build, &signature, offset2);
blob2->may_return_null = signal->result->allow_none;
{
GIrNode *param = (GIrNode *)l->data;
- g_ir_node_build_typelib (param, node, build, &signature, offset2);
+ _g_ir_node_build_typelib (param, node, build, &signature, offset2);
}
}
break;
*offset += sizeof (VFuncBlob);
*offset2 += sizeof (SignatureBlob) + n * sizeof (ArgBlob);
- blob->name = write_string (node->name, strings, data, offset2);
+ blob->name = _g_ir_write_string (node->name, strings, data, offset2);
blob->must_chain_up = 0; /* FIXME */
blob->must_be_implemented = 0; /* FIXME */
blob->must_not_be_implemented = 0; /* FIXME */
blob->reserved2 = 0;
blob->signature = signature;
- g_ir_node_build_typelib ((GIrNode *)vfunc->result->type,
+ _g_ir_node_build_typelib ((GIrNode *)vfunc->result->type,
node, build, &signature, offset2);
blob2->may_return_null = vfunc->result->allow_none;
{
GIrNode *param = (GIrNode *)l->data;
- g_ir_node_build_typelib (param, node, build, &signature, offset2);
+ _g_ir_node_build_typelib (param, node, build, &signature, offset2);
}
}
break;
*/
*offset += sizeof (ArgBlob) - sizeof (SimpleTypeBlob);
- blob->name = write_string (node->name, strings, data, offset2);
+ blob->name = _g_ir_write_string (node->name, strings, data, offset2);
blob->in = param->in;
blob->out = param->out;
blob->caller_allocates = param->caller_allocates;
blob->closure = param->closure;
blob->destroy = param->destroy;
- g_ir_node_build_typelib ((GIrNode *)param->type, node, build, offset, offset2);
+ _g_ir_node_build_typelib ((GIrNode *)param->type, node, build, offset, offset2);
}
break;
blob->deprecated = struct_->deprecated;
blob->is_gtype_struct = struct_->is_gtype_struct;
blob->reserved = 0;
- blob->name = write_string (node->name, strings, data, offset2);
+ blob->name = _g_ir_write_string (node->name, strings, data, offset2);
blob->alignment = struct_->alignment;
blob->size = struct_->size;
if (struct_->gtype_name)
{
blob->unregistered = FALSE;
- blob->gtype_name = write_string (struct_->gtype_name, strings, data, offset2);
- blob->gtype_init = write_string (struct_->gtype_init, strings, data, offset2);
+ blob->gtype_name = _g_ir_write_string (struct_->gtype_name, strings, data, offset2);
+ blob->gtype_init = _g_ir_write_string (struct_->gtype_init, strings, data, offset2);
}
else
{
members = g_list_copy (struct_->members);
- g_ir_node_build_members (&members, G_IR_NODE_FIELD, &blob->n_fields,
+ _g_ir_node_build_members (&members, G_IR_NODE_FIELD, &blob->n_fields,
node, build, offset, offset2);
- g_ir_node_build_members (&members, G_IR_NODE_FUNCTION, &blob->n_methods,
+ _g_ir_node_build_members (&members, G_IR_NODE_FUNCTION, &blob->n_methods,
node, build, offset, offset2);
- g_ir_node_check_unhandled_members (&members, node->type);
+ _g_ir_node_check_unhandled_members (&members, node->type);
g_assert (members == NULL);
}
blob->deprecated = boxed->deprecated;
blob->unregistered = FALSE;
blob->reserved = 0;
- blob->name = write_string (node->name, strings, data, offset2);
- blob->gtype_name = write_string (boxed->gtype_name, strings, data, offset2);
- blob->gtype_init = write_string (boxed->gtype_init, strings, data, offset2);
+ blob->name = _g_ir_write_string (node->name, strings, data, offset2);
+ blob->gtype_name = _g_ir_write_string (boxed->gtype_name, strings, data, offset2);
+ blob->gtype_init = _g_ir_write_string (boxed->gtype_init, strings, data, offset2);
blob->alignment = boxed->alignment;
blob->size = boxed->size;
members = g_list_copy (boxed->members);
- g_ir_node_build_members (&members, G_IR_NODE_FIELD, &blob->n_fields,
- node, build, offset, offset2);
+ _g_ir_node_build_members (&members, G_IR_NODE_FIELD, &blob->n_fields,
+ node, build, offset, offset2);
- g_ir_node_build_members (&members, G_IR_NODE_FUNCTION, &blob->n_methods,
- node, build, offset, offset2);
+ _g_ir_node_build_members (&members, G_IR_NODE_FUNCTION, &blob->n_methods,
+ node, build, offset, offset2);
- g_ir_node_check_unhandled_members (&members, node->type);
+ _g_ir_node_check_unhandled_members (&members, node->type);
g_assert (members == NULL);
}
blob->blob_type = BLOB_TYPE_UNION;
blob->deprecated = union_->deprecated;
blob->reserved = 0;
- blob->name = write_string (node->name, strings, data, offset2);
+ blob->name = _g_ir_write_string (node->name, strings, data, offset2);
blob->alignment = union_->alignment;
blob->size = union_->size;
if (union_->gtype_name)
{
blob->unregistered = FALSE;
- blob->gtype_name = write_string (union_->gtype_name, strings, data, offset2);
- blob->gtype_init = write_string (union_->gtype_init, strings, data, offset2);
+ blob->gtype_name = _g_ir_write_string (union_->gtype_name, strings, data, offset2);
+ blob->gtype_init = _g_ir_write_string (union_->gtype_init, strings, data, offset2);
}
else
{
{
*offset += 28;
blob->discriminated = TRUE;
- g_ir_node_build_typelib ((GIrNode *)union_->discriminator_type,
+ _g_ir_node_build_typelib ((GIrNode *)union_->discriminator_type,
build, offset, offset2);
}
else
members = g_list_copy (union_->members);
- g_ir_node_build_members (&members, G_IR_NODE_FIELD, &blob->n_fields,
+ _g_ir_node_build_members (&members, G_IR_NODE_FIELD, &blob->n_fields,
node, build, offset, offset2);
- g_ir_node_build_members (&members, G_IR_NODE_FUNCTION, &blob->n_functions,
+ _g_ir_node_build_members (&members, G_IR_NODE_FUNCTION, &blob->n_functions,
node, build, offset, offset2);
- g_ir_node_check_unhandled_members (&members, node->type);
+ _g_ir_node_check_unhandled_members (&members, node->type);
g_assert (members == NULL);
{
GIrNode *member = (GIrNode *)l->data;
- g_ir_node_build_typelib (member, node, build, offset, offset2);
+ _g_ir_node_build_typelib (member, node, build, offset, offset2);
}
}
}
blob->deprecated = enum_->deprecated;
blob->reserved = 0;
blob->storage_type = enum_->storage_type;
- blob->name = write_string (node->name, strings, data, offset2);
+ blob->name = _g_ir_write_string (node->name, strings, data, offset2);
if (enum_->gtype_name)
{
blob->unregistered = FALSE;
- blob->gtype_name = write_string (enum_->gtype_name, strings, data, offset2);
- blob->gtype_init = write_string (enum_->gtype_init, strings, data, offset2);
+ blob->gtype_name = _g_ir_write_string (enum_->gtype_name, strings, data, offset2);
+ blob->gtype_init = _g_ir_write_string (enum_->gtype_init, strings, data, offset2);
}
else
{
GIrNode *value = (GIrNode *)l->data;
blob->n_values++;
- g_ir_node_build_typelib (value, node, build, offset, offset2);
+ _g_ir_node_build_typelib (value, node, build, offset, offset2);
}
}
break;
blob->fundamental = object->fundamental;
blob->deprecated = object->deprecated;
blob->reserved = 0;
- blob->name = write_string (node->name, strings, data, offset2);
- blob->gtype_name = write_string (object->gtype_name, strings, data, offset2);
- blob->gtype_init = write_string (object->gtype_init, strings, data, offset2);
+ blob->name = _g_ir_write_string (node->name, strings, data, offset2);
+ blob->gtype_name = _g_ir_write_string (object->gtype_name, strings, data, offset2);
+ blob->gtype_init = _g_ir_write_string (object->gtype_init, strings, data, offset2);
if (object->ref_func)
- blob->ref_func = write_string (object->ref_func, strings, data, offset2);
+ blob->ref_func = _g_ir_write_string (object->ref_func, strings, data, offset2);
if (object->unref_func)
- blob->unref_func = write_string (object->unref_func, strings, data, offset2);
+ blob->unref_func = _g_ir_write_string (object->unref_func, strings, data, offset2);
if (object->set_value_func)
- blob->set_value_func = write_string (object->set_value_func, strings, data, offset2);
+ blob->set_value_func = _g_ir_write_string (object->set_value_func, strings, data, offset2);
if (object->get_value_func)
- blob->get_value_func = write_string (object->get_value_func, strings, data, offset2);
+ blob->get_value_func = _g_ir_write_string (object->get_value_func, strings, data, offset2);
if (object->parent)
blob->parent = find_entry (build, object->parent);
else
members = g_list_copy (object->members);
*offset = ALIGN_VALUE (*offset, 4);
- g_ir_node_build_members (&members, G_IR_NODE_FIELD, &blob->n_fields,
+ _g_ir_node_build_members (&members, G_IR_NODE_FIELD, &blob->n_fields,
node, build, offset, offset2);
*offset = ALIGN_VALUE (*offset, 4);
- g_ir_node_build_members (&members, G_IR_NODE_PROPERTY, &blob->n_properties,
+ _g_ir_node_build_members (&members, G_IR_NODE_PROPERTY, &blob->n_properties,
node, build, offset, offset2);
*offset = ALIGN_VALUE (*offset, 4);
- g_ir_node_build_members (&members, G_IR_NODE_FUNCTION, &blob->n_methods,
+ _g_ir_node_build_members (&members, G_IR_NODE_FUNCTION, &blob->n_methods,
node, build, offset, offset2);
*offset = ALIGN_VALUE (*offset, 4);
- g_ir_node_build_members (&members, G_IR_NODE_SIGNAL, &blob->n_signals,
+ _g_ir_node_build_members (&members, G_IR_NODE_SIGNAL, &blob->n_signals,
node, build, offset, offset2);
*offset = ALIGN_VALUE (*offset, 4);
- g_ir_node_build_members (&members, G_IR_NODE_VFUNC, &blob->n_vfuncs,
+ _g_ir_node_build_members (&members, G_IR_NODE_VFUNC, &blob->n_vfuncs,
node, build, offset, offset2);
*offset = ALIGN_VALUE (*offset, 4);
- g_ir_node_build_members (&members, G_IR_NODE_CONSTANT, &blob->n_constants,
+ _g_ir_node_build_members (&members, G_IR_NODE_CONSTANT, &blob->n_constants,
node, build, offset, offset2);
- g_ir_node_check_unhandled_members (&members, node->type);
+ _g_ir_node_check_unhandled_members (&members, node->type);
g_assert (members == NULL);
}
blob->blob_type = BLOB_TYPE_INTERFACE;
blob->deprecated = iface->deprecated;
blob->reserved = 0;
- blob->name = write_string (node->name, strings, data, offset2);
- blob->gtype_name = write_string (iface->gtype_name, strings, data, offset2);
- blob->gtype_init = write_string (iface->gtype_init, strings, data, offset2);
+ blob->name = _g_ir_write_string (node->name, strings, data, offset2);
+ blob->gtype_name = _g_ir_write_string (iface->gtype_name, strings, data, offset2);
+ blob->gtype_init = _g_ir_write_string (iface->gtype_init, strings, data, offset2);
if (iface->glib_type_struct)
blob->gtype_struct = find_entry (build, iface->glib_type_struct);
else
members = g_list_copy (iface->members);
*offset = ALIGN_VALUE (*offset, 4);
- g_ir_node_build_members (&members, G_IR_NODE_PROPERTY, &blob->n_properties,
+ _g_ir_node_build_members (&members, G_IR_NODE_PROPERTY, &blob->n_properties,
node, build, offset, offset2);
*offset = ALIGN_VALUE (*offset, 4);
- g_ir_node_build_members (&members, G_IR_NODE_FUNCTION, &blob->n_methods,
+ _g_ir_node_build_members (&members, G_IR_NODE_FUNCTION, &blob->n_methods,
node, build, offset, offset2);
*offset = ALIGN_VALUE (*offset, 4);
- g_ir_node_build_members (&members, G_IR_NODE_SIGNAL, &blob->n_signals,
+ _g_ir_node_build_members (&members, G_IR_NODE_SIGNAL, &blob->n_signals,
node, build, offset, offset2);
*offset = ALIGN_VALUE (*offset, 4);
- g_ir_node_build_members (&members, G_IR_NODE_VFUNC, &blob->n_vfuncs,
+ _g_ir_node_build_members (&members, G_IR_NODE_VFUNC, &blob->n_vfuncs,
node, build, offset, offset2);
*offset = ALIGN_VALUE (*offset, 4);
- g_ir_node_build_members (&members, G_IR_NODE_CONSTANT, &blob->n_constants,
+ _g_ir_node_build_members (&members, G_IR_NODE_CONSTANT, &blob->n_constants,
node, build, offset, offset2);
- g_ir_node_check_unhandled_members (&members, node->type);
+ _g_ir_node_check_unhandled_members (&members, node->type);
g_assert (members == NULL);
}
blob->deprecated = value->deprecated;
blob->reserved = 0;
blob->unsigned_value = value->value >= 0 ? 1 : 0;
- blob->name = write_string (node->name, strings, data, offset2);
+ blob->name = _g_ir_write_string (node->name, strings, data, offset2);
blob->value = (gint32)value->value;
}
break;
blob->blob_type = BLOB_TYPE_ERROR_DOMAIN;
blob->deprecated = domain->deprecated;
blob->reserved = 0;
- blob->name = write_string (node->name, strings, data, offset2);
- blob->get_quark = write_string (domain->getquark, strings, data, offset2);
+ blob->name = _g_ir_write_string (node->name, strings, data, offset2);
+ blob->get_quark = _g_ir_write_string (domain->getquark, strings, data, offset2);
blob->error_codes = find_entry (build, domain->codes);
blob->reserved2 = 0;
}
blob->blob_type = BLOB_TYPE_CONSTANT;
blob->deprecated = constant->deprecated;
blob->reserved = 0;
- blob->name = write_string (node->name, strings, data, offset2);
+ blob->name = _g_ir_write_string (node->name, strings, data, offset2);
blob->offset = *offset2;
switch (constant->type->tag)
}
*offset2 += ALIGN_VALUE (blob->size, 4);
- g_ir_node_build_typelib ((GIrNode *)constant->type, node, build, &pos, offset2);
+ _g_ir_node_build_typelib ((GIrNode *)constant->type, node, build, &pos, offset2);
}
break;
default:
node->name ? "'" : "",
node->name ? node->name : "",
node->name ? "' " : "",
- node, g_ir_node_type_to_string (node->type),
+ node, _g_ir_node_type_to_string (node->type),
old_offset, *offset, old_offset2, *offset2);
- if (*offset2 - old_offset2 + *offset - old_offset > g_ir_node_get_full_size (node))
+ if (*offset2 - old_offset2 + *offset - old_offset > _g_ir_node_get_full_size (node))
g_error ("exceeding space reservation; offset: %d (prev %d) offset2: %d (prev %d) nodesize: %d",
- *offset, old_offset, *offset2, old_offset2, g_ir_node_get_full_size (node));
+ *offset, old_offset, *offset2, old_offset2, _g_ir_node_get_full_size (node));
if (appended_stack)
build->stack = g_list_delete_link (build->stack, build->stack);
* typelib is not large enough to hold the string, reallocate it.
*/
guint32
-write_string (const gchar *str,
- GHashTable *strings,
- guchar *data,
- guint32 *offset)
+_g_ir_write_string (const gchar *str,
+ GHashTable *strings,
+ guchar *data,
+ guint32 *offset)
{
gpointer value;
guint32 start;