diff --git a/girepository/giarginfo.c b/girepository/giarginfo.c index bb0bef115..aec94dc22 100644 --- a/girepository/giarginfo.c +++ b/girepository/giarginfo.c @@ -308,7 +308,7 @@ gi_arg_info_get_type (GIArgInfo *info) g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (GI_IS_ARG_INFO (info), NULL); - return _gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (ArgBlob, arg_type)); + return gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (ArgBlob, arg_type)); } /** @@ -331,5 +331,5 @@ gi_arg_info_load_type (GIArgInfo *info, g_return_if_fail (info != NULL); g_return_if_fail (GI_IS_ARG_INFO (info)); - _gi_type_info_init (type, (GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (ArgBlob, arg_type)); + gi_type_info_init (type, (GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (ArgBlob, arg_type)); } diff --git a/girepository/gibaseinfo.c b/girepository/gibaseinfo.c index 8f29c2d14..27cb1d3aa 100644 --- a/girepository/gibaseinfo.c +++ b/girepository/gibaseinfo.c @@ -53,11 +53,11 @@ gi_base_info_gtype_get_type (void) /* info creation */ GIBaseInfo * -_gi_info_new_full (GIInfoType type, - GIRepository *repository, - GIBaseInfo *container, - GITypelib *typelib, - guint32 offset) +gi_info_new_full (GIInfoType type, + GIRepository *repository, + GIBaseInfo *container, + GITypelib *typelib, + guint32 offset) { GIRealInfo *info; @@ -65,7 +65,7 @@ _gi_info_new_full (GIInfoType type, info = g_slice_new (GIRealInfo); - _gi_info_init (info, type, repository, container, typelib, offset); + gi_info_init (info, type, repository, container, typelib, offset); info->ref_count = 1; if (container && ((GIRealInfo *) container)->ref_count != INVALID_REFCOUNT) @@ -93,16 +93,16 @@ gi_info_new (GIInfoType type, GITypelib *typelib, guint32 offset) { - return _gi_info_new_full (type, ((GIRealInfo*)container)->repository, container, typelib, offset); + return gi_info_new_full (type, ((GIRealInfo*)container)->repository, container, typelib, offset); } void -_gi_info_init (GIRealInfo *info, - GIInfoType type, - GIRepository *repository, - GIBaseInfo *container, - GITypelib *typelib, - guint32 offset) +gi_info_init (GIRealInfo *info, + GIInfoType type, + GIRepository *repository, + GIBaseInfo *container, + GITypelib *typelib, + guint32 offset) { memset (info, 0, sizeof (GIRealInfo)); @@ -121,15 +121,15 @@ _gi_info_init (GIRealInfo *info, } GIBaseInfo * -_gi_info_from_entry (GIRepository *repository, - GITypelib *typelib, - guint16 index) +gi_info_from_entry (GIRepository *repository, + GITypelib *typelib, + guint16 index) { GIBaseInfo *result; DirEntry *entry = gi_typelib_get_dir_entry (typelib, index); if (entry->local) - result = _gi_info_new_full (entry->blob_type, repository, NULL, typelib, entry->offset); + result = gi_info_new_full (entry->blob_type, repository, NULL, typelib, entry->offset); else { const gchar *namespace = gi_typelib_get_string (typelib, entry->offset); @@ -158,9 +158,9 @@ _gi_info_from_entry (GIRepository *repository, } GITypeInfo * -_gi_type_info_new (GIBaseInfo *container, - GITypelib *typelib, - guint32 offset) +gi_type_info_new (GIBaseInfo *container, + GITypelib *typelib, + guint32 offset) { SimpleTypeBlob *type = (SimpleTypeBlob *)&typelib->data[offset]; @@ -169,16 +169,16 @@ _gi_type_info_new (GIBaseInfo *container, } void -_gi_type_info_init (GIBaseInfo *info, - GIBaseInfo *container, - GITypelib *typelib, - guint32 offset) +gi_type_info_init (GIBaseInfo *info, + GIBaseInfo *container, + GITypelib *typelib, + guint32 offset) { GIRealInfo *rinfo = (GIRealInfo*)container; SimpleTypeBlob *type = (SimpleTypeBlob *)&typelib->data[offset]; - _gi_info_init ((GIRealInfo*)info, GI_INFO_TYPE_TYPE, rinfo->repository, container, typelib, - (type->flags.reserved == 0 && type->flags.reserved2 == 0) ? offset : type->offset); + gi_info_init ((GIRealInfo*)info, GI_INFO_TYPE_TYPE, rinfo->repository, container, typelib, + (type->flags.reserved == 0 && type->flags.reserved2 == 0) ? offset : type->offset); } /* GIBaseInfo functions */ diff --git a/girepository/gicallableinfo.c b/girepository/gicallableinfo.c index 336d44d6f..37997eef3 100644 --- a/girepository/gicallableinfo.c +++ b/girepository/gicallableinfo.c @@ -184,7 +184,7 @@ gi_callable_info_get_return_type (GICallableInfo *info) offset = signature_offset (info); - return _gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, offset); + return gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, offset); } @@ -211,7 +211,7 @@ gi_callable_info_load_return_type (GICallableInfo *info, offset = signature_offset (info); - _gi_type_info_init (type, (GIBaseInfo*)info, rinfo->typelib, offset); + gi_type_info_init (type, (GIBaseInfo*)info, rinfo->typelib, offset); } /** @@ -392,8 +392,8 @@ gi_callable_info_load_arg (GICallableInfo *info, offset = signature_offset (info); header = (Header *)rinfo->typelib->data; - _gi_info_init ((GIRealInfo*)arg, GI_INFO_TYPE_ARG, rinfo->repository, (GIBaseInfo*)info, rinfo->typelib, - offset + header->signature_blob_size + n * header->arg_blob_size); + gi_info_init ((GIRealInfo*)arg, GI_INFO_TYPE_ARG, rinfo->repository, (GIBaseInfo*)info, rinfo->typelib, + offset + header->signature_blob_size + n * header->arg_blob_size); } /** diff --git a/girepository/giconstantinfo.c b/girepository/giconstantinfo.c index 38a918e48..01223e236 100644 --- a/girepository/giconstantinfo.c +++ b/girepository/giconstantinfo.c @@ -62,7 +62,7 @@ gi_constant_info_get_type (GIConstantInfo *info) g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (GI_IS_CONSTANT_INFO (info), NULL); - return _gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + 8); + return gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + 8); } #define DO_ALIGNED_COPY(dest_addr, src_addr, type) \ diff --git a/girepository/gifieldinfo.c b/girepository/gifieldinfo.c index c10f034ed..ec8f7af7a 100644 --- a/girepository/gifieldinfo.c +++ b/girepository/gifieldinfo.c @@ -156,7 +156,7 @@ gi_field_info_get_type (GIFieldInfo *info) type_info->type_is_embedded = TRUE; } else - return _gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (FieldBlob, type)); + return gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (FieldBlob, type)); return (GIBaseInfo*)type_info; } diff --git a/girepository/gifunctioninfo.c b/girepository/gifunctioninfo.c index 83c9ab5dc..6a7bedcdd 100644 --- a/girepository/gifunctioninfo.c +++ b/girepository/gifunctioninfo.c @@ -48,10 +48,10 @@ */ GIFunctionInfo * -_gi_base_info_find_method (GIBaseInfo *base, - guint32 offset, - gint n_methods, - const gchar *name) +gi_base_info_find_method (GIBaseInfo *base, + guint32 offset, + gint n_methods, + const gchar *name) { /* FIXME hash */ GIRealInfo *rinfo = (GIRealInfo*)base; diff --git a/girepository/giinterfaceinfo.c b/girepository/giinterfaceinfo.c index 40a2cac09..e2072f492 100644 --- a/girepository/giinterfaceinfo.c +++ b/girepository/giinterfaceinfo.c @@ -88,8 +88,8 @@ gi_interface_info_get_prerequisite (GIInterfaceInfo *info, blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset]; - return _gi_info_from_entry (rinfo->repository, - rinfo->typelib, blob->prerequisites[n]); + return gi_info_from_entry (rinfo->repository, + rinfo->typelib, blob->prerequisites[n]); } @@ -228,7 +228,7 @@ gi_interface_info_find_method (GIInterfaceInfo *info, + (blob->n_prerequisites + (blob->n_prerequisites % 2)) * 2 + blob->n_properties * header->property_blob_size; - return _gi_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name); + return gi_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name); } /** @@ -412,7 +412,7 @@ gi_interface_info_find_vfunc (GIInterfaceInfo *info, + blob->n_methods * header->function_blob_size + blob->n_signals * header->signal_blob_size; - return _gi_base_info_find_vfunc (rinfo, offset, blob->n_vfuncs, name); + return gi_base_info_find_vfunc (rinfo, offset, blob->n_vfuncs, name); } /** @@ -495,8 +495,8 @@ gi_interface_info_get_iface_struct (GIInterfaceInfo *info) blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->gtype_struct) - return (GIStructInfo *) _gi_info_from_entry (rinfo->repository, - rinfo->typelib, blob->gtype_struct); + return (GIStructInfo *) gi_info_from_entry (rinfo->repository, + rinfo->typelib, blob->gtype_struct); else return NULL; } diff --git a/girepository/giobjectinfo.c b/girepository/giobjectinfo.c index ccd3b2fa6..4a8ef5300 100644 --- a/girepository/giobjectinfo.c +++ b/girepository/giobjectinfo.c @@ -103,8 +103,8 @@ gi_object_info_get_parent (GIObjectInfo *info) blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->parent) - return (GIObjectInfo *) _gi_info_from_entry (rinfo->repository, - rinfo->typelib, blob->parent); + return (GIObjectInfo *) gi_info_from_entry (rinfo->repository, + rinfo->typelib, blob->parent); else return NULL; } @@ -269,8 +269,8 @@ gi_object_info_get_interface (GIObjectInfo *info, blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; - return (GIInterfaceInfo *) _gi_info_from_entry (rinfo->repository, - rinfo->typelib, blob->interfaces[n]); + return (GIInterfaceInfo *) gi_info_from_entry (rinfo->repository, + rinfo->typelib, blob->interfaces[n]); } /** @@ -467,7 +467,7 @@ gi_object_info_find_method (GIObjectInfo *info, + blob->n_field_callbacks * header->callback_blob_size + blob->n_properties * header->property_blob_size; - return _gi_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name); + return gi_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name); } /** @@ -718,7 +718,7 @@ gi_object_info_find_vfunc (GIObjectInfo *info, + blob->n_methods * header->function_blob_size + blob->n_signals * header->signal_blob_size; - return _gi_base_info_find_vfunc (rinfo, offset, blob->n_vfuncs, name); + return gi_base_info_find_vfunc (rinfo, offset, blob->n_vfuncs, name); } /** @@ -864,8 +864,8 @@ gi_object_info_get_class_struct (GIObjectInfo *info) blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->gtype_struct) - return (GIStructInfo *) _gi_info_from_entry (rinfo->repository, - rinfo->typelib, blob->gtype_struct); + return (GIStructInfo *) gi_info_from_entry (rinfo->repository, + rinfo->typelib, blob->gtype_struct); else return NULL; } diff --git a/girepository/gipropertyinfo.c b/girepository/gipropertyinfo.c index b9b21b7c1..829d9089a 100644 --- a/girepository/gipropertyinfo.c +++ b/girepository/gipropertyinfo.c @@ -96,9 +96,9 @@ gi_property_info_get_type (GIPropertyInfo *info) g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (GI_IS_PROPERTY_INFO (info), NULL); - return _gi_type_info_new ((GIBaseInfo*)info, - rinfo->typelib, - rinfo->offset + G_STRUCT_OFFSET (PropertyBlob, type)); + return gi_type_info_new ((GIBaseInfo*)info, + rinfo->typelib, + rinfo->offset + G_STRUCT_OFFSET (PropertyBlob, type)); } /** diff --git a/girepository/girepository-private.h b/girepository/girepository-private.h index 67232ce1b..18d784876 100644 --- a/girepository/girepository-private.h +++ b/girepository/girepository-private.h @@ -78,38 +78,38 @@ struct _GIUnresolvedInfo const gchar *namespace; }; -void _gi_info_init (GIRealInfo *info, - GIInfoType type, - GIRepository *repository, - GIBaseInfo *container, - GITypelib *typelib, - guint32 offset); +void gi_info_init (GIRealInfo *info, + GIInfoType type, + GIRepository *repository, + GIBaseInfo *container, + GITypelib *typelib, + guint32 offset); -GIBaseInfo * _gi_info_from_entry (GIRepository *repository, - GITypelib *typelib, - guint16 index); +GIBaseInfo * gi_info_from_entry (GIRepository *repository, + GITypelib *typelib, + guint16 index); -GIBaseInfo * _gi_info_new_full (GIInfoType type, - GIRepository *repository, - GIBaseInfo *container, - GITypelib *typelib, - guint32 offset); +GIBaseInfo * gi_info_new_full (GIInfoType type, + GIRepository *repository, + GIBaseInfo *container, + GITypelib *typelib, + guint32 offset); -GITypeInfo * _gi_type_info_new (GIBaseInfo *container, - GITypelib *typelib, - guint32 offset); +GITypeInfo * gi_type_info_new (GIBaseInfo *container, + GITypelib *typelib, + guint32 offset); -void _gi_type_info_init (GIBaseInfo *info, - GIBaseInfo *container, - GITypelib *typelib, - guint32 offset); +void gi_type_info_init (GIBaseInfo *info, + GIBaseInfo *container, + GITypelib *typelib, + guint32 offset); -GIFunctionInfo * _gi_base_info_find_method (GIBaseInfo *base, - guint32 offset, - gint n_methods, - const gchar *name); +GIFunctionInfo * gi_base_info_find_method (GIBaseInfo *base, + guint32 offset, + gint n_methods, + const gchar *name); -GIVFuncInfo * _gi_base_info_find_vfunc (GIRealInfo *rinfo, - guint32 offset, - gint n_vfuncs, - const gchar *name); +GIVFuncInfo * gi_base_info_find_vfunc (GIRealInfo *rinfo, + guint32 offset, + gint n_vfuncs, + const gchar *name); diff --git a/girepository/girepository.c b/girepository/girepository.c index 85af08cde..bf7127ed8 100644 --- a/girepository/girepository.c +++ b/girepository/girepository.c @@ -754,9 +754,9 @@ gi_repository_get_info (GIRepository *repository, entry = gi_typelib_get_dir_entry (typelib, index + 1); if (entry == NULL) return NULL; - return _gi_info_new_full (entry->blob_type, - repository, - NULL, typelib, entry->offset); + return gi_info_new_full (entry->blob_type, + repository, + NULL, typelib, entry->offset); } typedef struct { @@ -854,9 +854,9 @@ gi_repository_find_by_gtype (GIRepository *repository, if (entry != NULL) { - cached = _gi_info_new_full (entry->blob_type, - repository, - NULL, data.result_typelib, entry->offset); + cached = gi_info_new_full (entry->blob_type, + repository, + NULL, data.result_typelib, entry->offset); g_hash_table_insert (repository->priv->info_by_gtype, (gpointer) gtype, @@ -901,9 +901,9 @@ gi_repository_find_by_name (GIRepository *repository, entry = gi_typelib_get_dir_entry_by_name (typelib, name); if (entry == NULL) return NULL; - return _gi_info_new_full (entry->blob_type, - repository, - NULL, typelib, entry->offset); + return gi_info_new_full (entry->blob_type, + repository, + NULL, typelib, entry->offset); } typedef struct { @@ -971,9 +971,9 @@ gi_repository_find_by_error_domain (GIRepository *repository, if (data.result != NULL) { - cached = _gi_info_new_full (data.result->blob_type, - repository, - NULL, data.result_typelib, data.result->offset); + cached = gi_info_new_full (data.result->blob_type, + repository, + NULL, data.result_typelib, data.result->offset); g_hash_table_insert (repository->priv->info_by_error_domain, GUINT_TO_POINTER (domain), diff --git a/girepository/girmodule-private.h b/girepository/girmodule-private.h index 076043be8..ef386638d 100644 --- a/girepository/girmodule-private.h +++ b/girepository/girmodule-private.h @@ -66,20 +66,20 @@ struct _GIIrModule GHashTable *disguised_structures; }; -GIIrModule *_gi_ir_module_new (const gchar *name, - const gchar *nsversion, - const gchar *module_filename, - const gchar *c_prefix); -void _gi_ir_module_free (GIIrModule *module); +GIIrModule *gi_ir_module_new (const gchar *name, + const gchar *nsversion, + const gchar *module_filename, + const gchar *c_prefix); +void gi_ir_module_free (GIIrModule *module); -void _gi_ir_module_add_include_module (GIIrModule *module, - GIIrModule *include_module); +void gi_ir_module_add_include_module (GIIrModule *module, + GIIrModule *include_module); -GITypelib * _gi_ir_module_build_typelib (GIIrModule *module); +GITypelib * gi_ir_module_build_typelib (GIIrModule *module); -void _gi_ir_module_fatal (GIIrTypelibBuild *build, guint line, const char *msg, ...) G_GNUC_PRINTF (3, 4) G_GNUC_NORETURN; +void gi_ir_module_fatal (GIIrTypelibBuild *build, guint line, const char *msg, ...) G_GNUC_PRINTF (3, 4) G_GNUC_NORETURN; -void _gi_ir_node_init_stats (void); -void _gi_ir_node_dump_stats (void); +void gi_ir_node_init_stats (void); +void gi_ir_node_dump_stats (void); G_END_DECLS diff --git a/girepository/girmodule.c b/girepository/girmodule.c index 02b799091..309cc787c 100644 --- a/girepository/girmodule.c +++ b/girepository/girmodule.c @@ -38,10 +38,10 @@ #define NUM_SECTIONS 2 GIIrModule * -_gi_ir_module_new (const gchar *name, - const gchar *version, - const gchar *shared_library, - const gchar *c_prefix) +gi_ir_module_new (const gchar *name, + const gchar *version, + const gchar *shared_library, + const gchar *c_prefix) { GIIrModule *module; @@ -64,14 +64,14 @@ _gi_ir_module_new (const gchar *name, } void -_gi_ir_module_free (GIIrModule *module) +gi_ir_module_free (GIIrModule *module) { GList *e; g_free (module->name); for (e = module->entries; e; e = e->next) - _gi_ir_node_free ((GIIrNode *)e->data); + gi_ir_node_free ((GIIrNode *)e->data); g_list_free (module->entries); /* Don't free dependencies, we inherit that from the parser */ @@ -86,7 +86,7 @@ _gi_ir_module_free (GIIrModule *module) } /** - * _gi_ir_module_fatal: + * gi_ir_module_fatal: * @build: Current build * @line: Origin line number, or 0 if unknown * @msg: printf-format string @@ -95,10 +95,10 @@ _gi_ir_module_free (GIIrModule *module) * Report a fatal error, then exit. */ void -_gi_ir_module_fatal (GIIrTypelibBuild *build, - guint line, - const char *msg, - ...) +gi_ir_module_fatal (GIIrTypelibBuild *build, + guint line, + const char *msg, + ...) { GString *context; char *formatted; @@ -168,8 +168,8 @@ add_disguised_structure_foreach (gpointer key, } void -_gi_ir_module_add_include_module (GIIrModule *module, - GIIrModule *include_module) +gi_ir_module_add_include_module (GIIrModule *module, + GIIrModule *include_module) { module->include_modules = g_list_prepend (module->include_modules, include_module); @@ -206,8 +206,8 @@ write_attribute (gpointer key, gpointer value, gpointer datap) *(data->offset) += sizeof (AttributeBlob); blob->offset = data->node->offset; - blob->name = _gi_ir_write_string ((const char*) key, data->strings, data->databuf, data->offset2); - blob->value = _gi_ir_write_string ((const char*) value, data->strings, data->databuf, data->offset2); + blob->name = gi_ir_write_string ((const char*) key, data->strings, data->databuf, data->offset2); + blob->value = gi_ir_write_string ((const char*) value, data->strings, data->databuf, data->offset2); data->count++; } @@ -274,7 +274,7 @@ add_directory_index_section (guint8 *data, GIIrModule *module, guint32 *offset2) guint16 required_size; guint32 new_offset; - dirindex_builder = _gi_typelib_hash_builder_new (); + dirindex_builder = gi_typelib_hash_builder_new (); n_interfaces = ((Header *)data)->n_local_entries; @@ -283,37 +283,37 @@ add_directory_index_section (guint8 *data, GIIrModule *module, guint32 *offset2) const char *str; entry = (DirEntry *)&data[header->directory + (i * header->entry_blob_size)]; str = (const char *) (&data[entry->name]); - _gi_typelib_hash_builder_add_string (dirindex_builder, str, i); + gi_typelib_hash_builder_add_string (dirindex_builder, str, i); } - if (!_gi_typelib_hash_builder_prepare (dirindex_builder)) + if (!gi_typelib_hash_builder_prepare (dirindex_builder)) { /* This happens if CMPH couldn't create a perfect hash. So * we just punt and leave no directory index section. */ - _gi_typelib_hash_builder_destroy (dirindex_builder); + gi_typelib_hash_builder_destroy (dirindex_builder); return data; } alloc_section (data, GI_SECTION_DIRECTORY_INDEX, *offset2); - required_size = _gi_typelib_hash_builder_get_buffer_size (dirindex_builder); + required_size = gi_typelib_hash_builder_get_buffer_size (dirindex_builder); required_size = ALIGN_VALUE (required_size, 4); new_offset = *offset2 + required_size; data = g_realloc (data, new_offset); - _gi_typelib_hash_builder_pack (dirindex_builder, ((guint8*)data) + *offset2, required_size); + gi_typelib_hash_builder_pack (dirindex_builder, ((guint8*)data) + *offset2, required_size); *offset2 = new_offset; - _gi_typelib_hash_builder_destroy (dirindex_builder); + gi_typelib_hash_builder_destroy (dirindex_builder); return data; } GITypelib * -_gi_ir_module_build_typelib (GIIrModule *module) +gi_ir_module_build_typelib (GIIrModule *module) { GError *error = NULL; GITypelib *typelib; @@ -360,7 +360,7 @@ _gi_ir_module_build_typelib (GIIrModule *module) } restart: - _gi_ir_node_init_stats (); + gi_ir_node_init_stats (); strings = g_hash_table_new (g_str_hash, g_str_equal); types = g_hash_table_new (g_str_hash, g_str_equal); nodes_with_attributes = NULL; @@ -378,7 +378,7 @@ _gi_ir_module_build_typelib (GIIrModule *module) { GIIrNode *node = e->data; - size += _gi_ir_node_get_full_size (node); + size += gi_ir_node_get_full_size (node); /* Also reset the offset here */ node->offset = 0; @@ -414,17 +414,17 @@ _gi_ir_module_build_typelib (GIIrModule *module) * the size calculations above. */ if (dependencies != NULL) - header->dependencies = _gi_ir_write_string (dependencies, strings, data, &header_size); + header->dependencies = gi_ir_write_string (dependencies, strings, data, &header_size); else header->dependencies = 0; header->size = 0; /* filled in later */ - header->namespace = _gi_ir_write_string (module->name, strings, data, &header_size); - header->nsversion = _gi_ir_write_string (module->version, strings, data, &header_size); + header->namespace = gi_ir_write_string (module->name, strings, data, &header_size); + header->nsversion = gi_ir_write_string (module->version, strings, data, &header_size); header->shared_library = (module->shared_library? - _gi_ir_write_string (module->shared_library, strings, data, &header_size) + gi_ir_write_string (module->shared_library, strings, data, &header_size) : 0); if (module->c_prefix != NULL) - header->c_prefix = _gi_ir_write_string (module->c_prefix, strings, data, &header_size); + header->c_prefix = gi_ir_write_string (module->c_prefix, strings, data, &header_size); else header->c_prefix = 0; header->entry_blob_size = sizeof (DirEntry); @@ -507,18 +507,18 @@ _gi_ir_module_build_typelib (GIIrModule *module) entry->blob_type = 0; entry->local = FALSE; - entry->offset = _gi_ir_write_string (namespace, strings, data, &offset2); - entry->name = _gi_ir_write_string (node->name, strings, data, &offset2); + entry->offset = gi_ir_write_string (namespace, strings, data, &offset2); + entry->name = gi_ir_write_string (node->name, strings, data, &offset2); } else { old_offset = offset; - offset2 = offset + _gi_ir_node_get_size (node); + offset2 = offset + gi_ir_node_get_size (node); entry->blob_type = node->type; entry->local = TRUE; entry->offset = offset; - entry->name = _gi_ir_write_string (node->name, strings, data, &offset2); + entry->name = gi_ir_write_string (node->name, strings, data, &offset2); memset (&build, 0, sizeof (build)); build.module = module; @@ -527,13 +527,13 @@ _gi_ir_module_build_typelib (GIIrModule *module) build.nodes_with_attributes = nodes_with_attributes; build.n_attributes = header->n_attributes; build.data = data; - _gi_ir_node_build_typelib (node, NULL, &build, &offset, &offset2, NULL); + gi_ir_node_build_typelib (node, NULL, &build, &offset, &offset2, NULL); nodes_with_attributes = build.nodes_with_attributes; header->n_attributes = build.n_attributes; - if (offset2 > old_offset + _gi_ir_node_get_full_size (node)) - g_error ("left a hole of %d bytes\n", offset2 - old_offset - _gi_ir_node_get_full_size (node)); + if (offset2 > old_offset + gi_ir_node_get_full_size (node)) + g_error ("left a hole of %d bytes\n", offset2 - old_offset - gi_ir_node_get_full_size (node)); } entry++; @@ -544,7 +544,7 @@ _gi_ir_module_build_typelib (GIIrModule *module) g_message ("header: %d entries, %d attributes", header->n_entries, header->n_attributes); - _gi_ir_node_dump_stats (); + gi_ir_node_dump_stats (); /* Write attributes after the blobs */ offset = offset2; diff --git a/girepository/girnode-private.h b/girepository/girnode-private.h index 67d2691fd..61a3794f1 100644 --- a/girepository/girnode-private.h +++ b/girepository/girnode-private.h @@ -363,38 +363,38 @@ struct _GIIrNodeUnion }; -GIIrNode *_gi_ir_node_new (GIIrNodeTypeId type, - GIIrModule *module); -void _gi_ir_node_free (GIIrNode *node); -guint32 _gi_ir_node_get_size (GIIrNode *node); -guint32 _gi_ir_node_get_full_size (GIIrNode *node); -void _gi_ir_node_build_typelib (GIIrNode *node, - GIIrNode *parent, - GIIrTypelibBuild *build, - guint32 *offset, - guint32 *offset2, - guint16 *count2); -int _gi_ir_node_cmp (GIIrNode *node, - GIIrNode *other); -gboolean _gi_ir_node_can_have_member (GIIrNode *node); -void _gi_ir_node_add_member (GIIrNode *node, - GIIrNodeFunction *member); -guint32 _gi_ir_write_string (const gchar *str, - GHashTable *strings, - guchar *data, - guint32 *offset); +GIIrNode *gi_ir_node_new (GIIrNodeTypeId type, + GIIrModule *module); +void gi_ir_node_free (GIIrNode *node); +guint32 gi_ir_node_get_size (GIIrNode *node); +guint32 gi_ir_node_get_full_size (GIIrNode *node); +void gi_ir_node_build_typelib (GIIrNode *node, + GIIrNode *parent, + GIIrTypelibBuild *build, + guint32 *offset, + guint32 *offset2, + guint16 *count2); +int gi_ir_node_cmp (GIIrNode *node, + GIIrNode *other); +gboolean gi_ir_node_can_have_member (GIIrNode *node); +void gi_ir_node_add_member (GIIrNode *node, + GIIrNodeFunction *member); +guint32 gi_ir_write_string (const gchar *str, + GHashTable *strings, + guchar *data, + guint32 *offset); -const gchar * _gi_ir_node_param_direction_string (GIIrNodeParam * node); -const gchar * _gi_ir_node_type_to_string (GIIrNodeTypeId type); +const gchar * gi_ir_node_param_direction_string (GIIrNodeParam * node); +const gchar * gi_ir_node_type_to_string (GIIrNodeTypeId type); -GIIrNode *_gi_ir_find_node (GIIrTypelibBuild *build, - GIIrModule *module, - const char *name); +GIIrNode *gi_ir_find_node (GIIrTypelibBuild *build, + GIIrModule *module, + const char *name); /* In giroffsets.c */ -void _gi_ir_node_compute_offsets (GIIrTypelibBuild *build, - GIIrNode *node); +void gi_ir_node_compute_offsets (GIIrTypelibBuild *build, + GIIrNode *node); G_END_DECLS diff --git a/girepository/girnode.c b/girepository/girnode.c index 1c27d8720..004d670e5 100644 --- a/girepository/girnode.c +++ b/girepository/girnode.c @@ -45,7 +45,7 @@ static gulong types_count = 0; static gulong unique_types_count = 0; void -_gi_ir_node_init_stats (void) +gi_ir_node_init_stats (void) { string_count = 0; unique_string_count = 0; @@ -56,7 +56,7 @@ _gi_ir_node_init_stats (void) } void -_gi_ir_node_dump_stats (void) +gi_ir_node_dump_stats (void) { g_message ("%lu strings (%lu before sharing), %lu bytes (%lu before sharing)", unique_string_count, string_count, unique_string_size, string_size); @@ -75,7 +75,7 @@ do { \ const gchar * -_gi_ir_node_type_to_string (GIIrNodeTypeId type) +gi_ir_node_type_to_string (GIIrNodeTypeId type) { switch (type) { @@ -121,8 +121,8 @@ _gi_ir_node_type_to_string (GIIrNodeTypeId type) } GIIrNode * -_gi_ir_node_new (GIIrNodeTypeId type, - GIIrModule *module) +gi_ir_node_new (GIIrNodeTypeId type, + GIIrModule *module) { GIIrNode *node = NULL; @@ -206,7 +206,7 @@ _gi_ir_node_new (GIIrNodeTypeId type, } void -_gi_ir_node_free (GIIrNode *node) +gi_ir_node_free (GIIrNode *node) { GList *l; @@ -223,9 +223,9 @@ _gi_ir_node_free (GIIrNode *node) g_free (node->name); g_free (function->symbol); g_free (function->property); - _gi_ir_node_free ((GIIrNode *)function->result); + gi_ir_node_free ((GIIrNode *)function->result); for (l = function->parameters; l; l = l->next) - _gi_ir_node_free ((GIIrNode *)l->data); + gi_ir_node_free ((GIIrNode *)l->data); g_list_free (function->parameters); } break; @@ -235,8 +235,8 @@ _gi_ir_node_free (GIIrNode *node) GIIrNodeType *type = (GIIrNodeType *)node; g_free (node->name); - _gi_ir_node_free ((GIIrNode *)type->parameter_type1); - _gi_ir_node_free ((GIIrNode *)type->parameter_type2); + gi_ir_node_free ((GIIrNode *)type->parameter_type1); + gi_ir_node_free ((GIIrNode *)type->parameter_type2); g_free (type->giinterface); g_strfreev (type->errors); @@ -249,7 +249,7 @@ _gi_ir_node_free (GIIrNode *node) GIIrNodeParam *param = (GIIrNodeParam *)node; g_free (node->name); - _gi_ir_node_free ((GIIrNode *)param->type); + gi_ir_node_free ((GIIrNode *)param->type); } break; @@ -260,7 +260,7 @@ _gi_ir_node_free (GIIrNode *node) g_free (node->name); g_free (property->setter); g_free (property->getter); - _gi_ir_node_free ((GIIrNode *)property->type); + gi_ir_node_free ((GIIrNode *)property->type); } break; @@ -270,9 +270,9 @@ _gi_ir_node_free (GIIrNode *node) g_free (node->name); for (l = signal->parameters; l; l = l->next) - _gi_ir_node_free ((GIIrNode *)l->data); + gi_ir_node_free ((GIIrNode *)l->data); g_list_free (signal->parameters); - _gi_ir_node_free ((GIIrNode *)signal->result); + gi_ir_node_free ((GIIrNode *)signal->result); } break; @@ -283,9 +283,9 @@ _gi_ir_node_free (GIIrNode *node) g_free (node->name); g_free (vfunc->invoker); for (l = vfunc->parameters; l; l = l->next) - _gi_ir_node_free ((GIIrNode *)l->data); + gi_ir_node_free ((GIIrNode *)l->data); g_list_free (vfunc->parameters); - _gi_ir_node_free ((GIIrNode *)vfunc->result); + gi_ir_node_free ((GIIrNode *)vfunc->result); } break; @@ -294,8 +294,8 @@ _gi_ir_node_free (GIIrNode *node) GIIrNodeField *field = (GIIrNodeField *)node; g_free (node->name); - _gi_ir_node_free ((GIIrNode *)field->type); - _gi_ir_node_free ((GIIrNode *)field->callback); + gi_ir_node_free ((GIIrNode *)field->type); + gi_ir_node_free ((GIIrNode *)field->callback); } break; @@ -321,7 +321,7 @@ _gi_ir_node_free (GIIrNode *node) g_list_free (iface->interfaces); for (l = iface->members; l; l = l->next) - _gi_ir_node_free ((GIIrNode *)l->data); + gi_ir_node_free ((GIIrNode *)l->data); g_list_free (iface->members); } @@ -344,11 +344,11 @@ _gi_ir_node_free (GIIrNode *node) g_free (enum_->error_domain); for (l = enum_->values; l; l = l->next) - _gi_ir_node_free ((GIIrNode *)l->data); + gi_ir_node_free ((GIIrNode *)l->data); g_list_free (enum_->values); for (l = enum_->methods; l; l = l->next) - _gi_ir_node_free ((GIIrNode *)l->data); + gi_ir_node_free ((GIIrNode *)l->data); g_list_free (enum_->methods); } break; @@ -362,7 +362,7 @@ _gi_ir_node_free (GIIrNode *node) g_free (boxed->gtype_init); for (l = boxed->members; l; l = l->next) - _gi_ir_node_free ((GIIrNode *)l->data); + gi_ir_node_free ((GIIrNode *)l->data); g_list_free (boxed->members); } break; @@ -378,7 +378,7 @@ _gi_ir_node_free (GIIrNode *node) g_free (struct_->free_func); for (l = struct_->members; l; l = l->next) - _gi_ir_node_free ((GIIrNode *)l->data); + gi_ir_node_free ((GIIrNode *)l->data); g_list_free (struct_->members); } break; @@ -389,7 +389,7 @@ _gi_ir_node_free (GIIrNode *node) g_free (node->name); g_free (constant->value); - _gi_ir_node_free ((GIIrNode *)constant->type); + gi_ir_node_free ((GIIrNode *)constant->type); } break; @@ -412,11 +412,11 @@ _gi_ir_node_free (GIIrNode *node) g_free (union_->copy_func); g_free (union_->free_func); - _gi_ir_node_free ((GIIrNode *)union_->discriminator_type); + gi_ir_node_free ((GIIrNode *)union_->discriminator_type); for (l = union_->members; l; l = l->next) - _gi_ir_node_free ((GIIrNode *)l->data); + gi_ir_node_free ((GIIrNode *)l->data); for (l = union_->discriminators; l; l = l->next) - _gi_ir_node_free ((GIIrNode *)l->data); + gi_ir_node_free ((GIIrNode *)l->data); } break; @@ -432,7 +432,7 @@ _gi_ir_node_free (GIIrNode *node) /* returns the fixed size of the blob */ guint32 -_gi_ir_node_get_size (GIIrNode *node) +gi_ir_node_get_size (GIIrNode *node) { GList *l; gint size, n; @@ -464,7 +464,7 @@ _gi_ir_node_get_size (GIIrNode *node) size = sizeof (ObjectBlob) + 2 * (n + (n % 2)); for (l = iface->members; l; l = l->next) - size += _gi_ir_node_get_size ((GIIrNode *)l->data); + size += gi_ir_node_get_size ((GIIrNode *)l->data); } break; @@ -476,7 +476,7 @@ _gi_ir_node_get_size (GIIrNode *node) size = sizeof (InterfaceBlob) + 2 * (n + (n % 2)); for (l = iface->members; l; l = l->next) - size += _gi_ir_node_get_size ((GIIrNode *)l->data); + size += gi_ir_node_get_size ((GIIrNode *)l->data); } break; @@ -487,9 +487,9 @@ _gi_ir_node_get_size (GIIrNode *node) size = sizeof (EnumBlob); for (l = enum_->values; l; l = l->next) - size += _gi_ir_node_get_size ((GIIrNode *)l->data); + size += gi_ir_node_get_size ((GIIrNode *)l->data); for (l = enum_->methods; l; l = l->next) - size += _gi_ir_node_get_size ((GIIrNode *)l->data); + size += gi_ir_node_get_size ((GIIrNode *)l->data); } break; @@ -503,7 +503,7 @@ _gi_ir_node_get_size (GIIrNode *node) size = sizeof (StructBlob); for (l = struct_->members; l; l = l->next) - size += _gi_ir_node_get_size ((GIIrNode *)l->data); + size += gi_ir_node_get_size ((GIIrNode *)l->data); } break; @@ -513,7 +513,7 @@ _gi_ir_node_get_size (GIIrNode *node) size = sizeof (StructBlob); for (l = boxed->members; l; l = l->next) - size += _gi_ir_node_get_size ((GIIrNode *)l->data); + size += gi_ir_node_get_size ((GIIrNode *)l->data); } break; @@ -535,7 +535,7 @@ _gi_ir_node_get_size (GIIrNode *node) size = sizeof (FieldBlob); if (field->callback) - size += _gi_ir_node_get_size ((GIIrNode *)field->callback); + size += gi_ir_node_get_size ((GIIrNode *)field->callback); } break; @@ -553,20 +553,20 @@ _gi_ir_node_get_size (GIIrNode *node) size = sizeof (UnionBlob); for (l = union_->members; l; l = l->next) - size += _gi_ir_node_get_size ((GIIrNode *)l->data); + size += gi_ir_node_get_size ((GIIrNode *)l->data); for (l = union_->discriminators; l; l = l->next) - size += _gi_ir_node_get_size ((GIIrNode *)l->data); + size += gi_ir_node_get_size ((GIIrNode *)l->data); } break; default: g_error ("Unhandled node type '%s'\n", - _gi_ir_node_type_to_string (node->type)); + gi_ir_node_type_to_string (node->type)); size = 0; } g_debug ("node %p type '%s' size %d", node, - _gi_ir_node_type_to_string (node->type), size); + gi_ir_node_type_to_string (node->type), size); return size; } @@ -585,8 +585,8 @@ add_attribute_size (gpointer key, gpointer value, gpointer data) /* returns the full size of the blob including variable-size parts (including attributes) */ static guint32 -_gi_ir_node_get_full_size_internal (GIIrNode *parent, - GIIrNode *node) +gi_ir_node_get_full_size_internal (GIIrNode *parent, + GIIrNode *node) { GList *l; gint size, n; @@ -595,7 +595,7 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, g_error ("Caught NULL node, parent=%s", parent->name); g_debug ("node %p type '%s'", node, - _gi_ir_node_type_to_string (node->type)); + gi_ir_node_type_to_string (node->type)); switch (node->type) { @@ -606,9 +606,9 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size += ALIGN_VALUE (strlen (node->name) + 1, 4); for (l = function->parameters; l; l = l->next) { - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); } - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)function->result); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)function->result); } break; @@ -619,8 +619,8 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, 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 += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)function->result); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)function->result); } break; @@ -632,7 +632,7 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size = sizeof (ArgBlob) - sizeof (SimpleTypeBlob); if (node->name) size += ALIGN_VALUE (strlen (node->name) + 1, 4); - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)param->type); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)param->type); } break; @@ -650,7 +650,7 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, case GI_TYPE_TAG_ARRAY: size = sizeof (ArrayTypeBlob); if (type->parameter_type1) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)type->parameter_type1); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)type->parameter_type1); break; case GI_TYPE_TAG_INTERFACE: size += sizeof (InterfaceTypeBlob); @@ -659,14 +659,14 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, case GI_TYPE_TAG_GSLIST: size += sizeof (ParamTypeBlob); if (type->parameter_type1) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)type->parameter_type1); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)type->parameter_type1); break; case GI_TYPE_TAG_GHASH: size += sizeof (ParamTypeBlob) * 2; if (type->parameter_type1) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)type->parameter_type1); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)type->parameter_type1); if (type->parameter_type2) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)type->parameter_type2); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)type->parameter_type2); break; case GI_TYPE_TAG_ERROR: size += sizeof (ErrorTypeBlob); @@ -704,7 +704,7 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size += 2 * (n + (n % 2)); for (l = iface->members; l; l = l->next) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); } break; @@ -720,7 +720,7 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size += 2 * (n + (n % 2)); for (l = iface->members; l; l = l->next) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); } break; @@ -740,9 +740,9 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size += ALIGN_VALUE (strlen (enum_->error_domain) + 1, 4); for (l = enum_->values; l; l = l->next) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); for (l = enum_->methods; l; l = l->next) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); } break; @@ -768,7 +768,7 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, if (struct_->free_func) size += ALIGN_VALUE (strlen (struct_->free_func) + 1, 4); for (l = struct_->members; l; l = l->next) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); } break; @@ -784,7 +784,7 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size += ALIGN_VALUE (strlen (boxed->gtype_init) + 1, 4); } for (l = boxed->members; l; l = l->next) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); } break; @@ -794,7 +794,7 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size = sizeof (PropertyBlob); size += ALIGN_VALUE (strlen (node->name) + 1, 4); - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)prop->type); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)prop->type); } break; @@ -805,8 +805,8 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size = sizeof (SignalBlob); size += ALIGN_VALUE (strlen (node->name) + 1, 4); for (l = signal->parameters; l; l = l->next) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)signal->result); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)signal->result); } break; @@ -817,8 +817,8 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size = sizeof (VFuncBlob); size += ALIGN_VALUE (strlen (node->name) + 1, 4); for (l = vfunc->parameters; l; l = l->next) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)vfunc->result); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)vfunc->result); } break; @@ -829,9 +829,9 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size = sizeof (FieldBlob); size += ALIGN_VALUE (strlen (node->name) + 1, 4); if (field->callback) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)field->callback); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)field->callback); else - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)field->type); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)field->type); } break; @@ -843,7 +843,7 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size += ALIGN_VALUE (strlen (node->name) + 1, 4); /* FIXME non-string values */ size += ALIGN_VALUE (strlen (constant->value) + 1, 4); - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)constant->type); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)constant->type); } break; @@ -872,9 +872,9 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, if (union_->free_func) size += ALIGN_VALUE (strlen (union_->free_func) + 1, 4); for (l = union_->members; l; l = l->next) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); for (l = union_->discriminators; l; l = l->next) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); } break; @@ -887,7 +887,7 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, node->name ? "'" : "", node->name ? node->name : "", node->name ? "' " : "", - node, _gi_ir_node_type_to_string (node->type), size); + node, gi_ir_node_type_to_string (node->type), size); g_hash_table_foreach (node->attributes, add_attribute_size, &size); @@ -895,14 +895,14 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, } guint32 -_gi_ir_node_get_full_size (GIIrNode *node) +gi_ir_node_get_full_size (GIIrNode *node) { - return _gi_ir_node_get_full_size_internal (NULL, node); + return gi_ir_node_get_full_size_internal (NULL, node); } int -_gi_ir_node_cmp (GIIrNode *node, - GIIrNode *other) +gi_ir_node_cmp (GIIrNode *node, + GIIrNode *other) { if (node->type < other->type) return -1; @@ -913,7 +913,7 @@ _gi_ir_node_cmp (GIIrNode *node, } gboolean -_gi_ir_node_can_have_member (GIIrNode *node) +gi_ir_node_can_have_member (GIIrNode *node) { switch (node->type) { @@ -949,8 +949,8 @@ _gi_ir_node_can_have_member (GIIrNode *node) } void -_gi_ir_node_add_member (GIIrNode *node, - GIIrNodeFunction *member) +gi_ir_node_add_member (GIIrNode *node, + GIIrNodeFunction *member) { g_return_if_fail (node != NULL); g_return_if_fail (member != NULL); @@ -963,7 +963,7 @@ _gi_ir_node_add_member (GIIrNode *node, GIIrNodeInterface *iface = (GIIrNodeInterface *)node; iface->members = g_list_insert_sorted (iface->members, member, - (GCompareFunc) _gi_ir_node_cmp); + (GCompareFunc) gi_ir_node_cmp); break; } case GI_IR_NODE_BOXED: @@ -971,7 +971,7 @@ _gi_ir_node_add_member (GIIrNode *node, GIIrNodeBoxed *boxed = (GIIrNodeBoxed *)node; boxed->members = g_list_insert_sorted (boxed->members, member, - (GCompareFunc) _gi_ir_node_cmp); + (GCompareFunc) gi_ir_node_cmp); break; } case GI_IR_NODE_STRUCT: @@ -979,7 +979,7 @@ _gi_ir_node_add_member (GIIrNode *node, GIIrNodeStruct *struct_ = (GIIrNodeStruct *)node; struct_->members = g_list_insert_sorted (struct_->members, member, - (GCompareFunc) _gi_ir_node_cmp); + (GCompareFunc) gi_ir_node_cmp); break; } case GI_IR_NODE_UNION: @@ -987,7 +987,7 @@ _gi_ir_node_add_member (GIIrNode *node, GIIrNodeUnion *union_ = (GIIrNodeUnion *)node; union_->members = g_list_insert_sorted (union_->members, member, - (GCompareFunc) _gi_ir_node_cmp); + (GCompareFunc) gi_ir_node_cmp); break; } default: @@ -998,7 +998,7 @@ _gi_ir_node_add_member (GIIrNode *node, } const gchar * -_gi_ir_node_param_direction_string (GIIrNodeParam * node) +gi_ir_node_param_direction_string (GIIrNodeParam * node) { if (node->out) { @@ -1087,7 +1087,7 @@ find_entry_node (GIIrTypelibBuild *build, if (n_names > 1) { - GIIrNode *node = _gi_ir_node_new (GI_IR_NODE_XREF, module); + GIIrNode *node = gi_ir_node_new (GI_IR_NODE_XREF, module); ((GIIrNodeXRef *)node)->namespace = g_strdup (names[0]); node->name = g_strdup (names[1]); @@ -1105,7 +1105,7 @@ find_entry_node (GIIrTypelibBuild *build, } - _gi_ir_module_fatal (build, -1, "type reference '%s' not found", name); + gi_ir_module_fatal (build, -1, "type reference '%s' not found", name); out: g_strfreev (names); @@ -1149,9 +1149,9 @@ find_namespace (GIIrModule *module, } GIIrNode * -_gi_ir_find_node (GIIrTypelibBuild *build, - GIIrModule *src_module, - const char *name) +gi_ir_find_node (GIIrTypelibBuild *build, + GIIrModule *src_module, + const char *name) { GList *l; GIIrNode *return_node = NULL; @@ -1340,14 +1340,14 @@ serialize_type (GIIrTypelibBuild *build, } static void -_gi_ir_node_build_members (GList **members, - GIIrNodeTypeId type, - guint16 *count, - GIIrNode *parent, - GIIrTypelibBuild *build, - guint32 *offset, - guint32 *offset2, - guint16 *count2) +gi_ir_node_build_members (GList **members, + GIIrNodeTypeId type, + guint16 *count, + GIIrNode *parent, + GIIrTypelibBuild *build, + guint32 *offset, + guint32 *offset2, + guint16 *count2) { GList *l = *members; @@ -1359,7 +1359,7 @@ _gi_ir_node_build_members (GList **members, if (member->type == type) { (*count)++; - _gi_ir_node_build_typelib (member, parent, build, offset, offset2, count2); + gi_ir_node_build_typelib (member, parent, build, offset, offset2, count2); *members = g_list_delete_link (*members, l); } l = next; @@ -1367,8 +1367,8 @@ _gi_ir_node_build_members (GList **members, } static void -_gi_ir_node_check_unhandled_members (GList **members, - GIIrNodeTypeId container_type) +gi_ir_node_check_unhandled_members (GList **members, + GIIrNodeTypeId container_type) { #if 0 if (*members) @@ -1379,9 +1379,9 @@ _gi_ir_node_check_unhandled_members (GList **members, { GIIrNode *member = (GIIrNode *)l->data; g_printerr ("Unhandled '%s' member '%s' type '%s'\n", - _gi_ir_node_type_to_string (container_type), + gi_ir_node_type_to_string (container_type), member->name, - _gi_ir_node_type_to_string (member->type)); + gi_ir_node_type_to_string (member->type)); } g_list_free (*members); @@ -1396,12 +1396,12 @@ _gi_ir_node_check_unhandled_members (GList **members, } void -_gi_ir_node_build_typelib (GIIrNode *node, - GIIrNode *parent, - GIIrTypelibBuild *build, - guint32 *offset, - guint32 *offset2, - guint16 *count2) +gi_ir_node_build_typelib (GIIrNode *node, + GIIrNode *parent, + GIIrTypelibBuild *build, + guint32 *offset, + guint32 *offset2, + guint16 *count2) { gboolean appended_stack; GHashTable *strings = build->strings; @@ -1416,7 +1416,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, g_debug ("build_typelib: %s%s(%s)", node->name ? node->name : "", node->name ? " " : "", - _gi_ir_node_type_to_string (node->type)); + gi_ir_node_type_to_string (node->type)); if (build->stack) appended_stack = node != (GIIrNode*)build->stack->data; @@ -1425,7 +1425,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, if (appended_stack) build->stack = g_list_prepend (build->stack, node); - _gi_ir_node_compute_offsets (build, node); + gi_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. @@ -1501,8 +1501,8 @@ _gi_ir_node_build_typelib (GIIrNode *node, pos = *offset2 + G_STRUCT_OFFSET (ArrayTypeBlob, type); *offset2 += sizeof (ArrayTypeBlob); - _gi_ir_node_build_typelib ((GIIrNode *)type->parameter_type1, - node, build, &pos, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)type->parameter_type1, + node, build, &pos, offset2, NULL); } break; @@ -1535,8 +1535,8 @@ _gi_ir_node_build_typelib (GIIrNode *node, pos = *offset2 + G_STRUCT_OFFSET (ParamTypeBlob, type); *offset2 += sizeof (ParamTypeBlob) + sizeof (SimpleTypeBlob); - _gi_ir_node_build_typelib ((GIIrNode *)type->parameter_type1, - node, build, &pos, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)type->parameter_type1, + node, build, &pos, offset2, NULL); } break; @@ -1554,10 +1554,10 @@ _gi_ir_node_build_typelib (GIIrNode *node, pos = *offset2 + G_STRUCT_OFFSET (ParamTypeBlob, type); *offset2 += sizeof (ParamTypeBlob) + sizeof (SimpleTypeBlob)*2; - _gi_ir_node_build_typelib ((GIIrNode *)type->parameter_type1, - node, build, &pos, offset2, NULL); - _gi_ir_node_build_typelib ((GIIrNode *)type->parameter_type2, - node, build, &pos, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)type->parameter_type1, + node, build, &pos, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)type->parameter_type2, + node, build, &pos, offset2, NULL); } break; @@ -1591,7 +1591,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob = (FieldBlob *)&data[*offset]; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); blob->readable = field->readable; blob->writable = field->writable; blob->reserved = 0; @@ -1606,8 +1606,8 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->has_embedded_type = TRUE; blob->type.offset = GI_INFO_TYPE_CALLBACK; *offset += sizeof (FieldBlob); - _gi_ir_node_build_typelib ((GIIrNode *)field->callback, - node, build, offset, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)field->callback, + node, build, offset, offset2, NULL); /* Fields with callbacks are bigger than normal, update count2 * as an extra hint which represents the number of fields which are * callbacks. This allows us to gain constant time performance in the @@ -1621,8 +1621,8 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->has_embedded_type = FALSE; /* We handle the size member specially below, so subtract it */ *offset += sizeof (FieldBlob) - sizeof (SimpleTypeBlob); - _gi_ir_node_build_typelib ((GIIrNode *)field->type, - node, build, offset, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)field->type, + node, build, offset, offset2, NULL); } } break; @@ -1634,7 +1634,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, /* We handle the size member specially below, so subtract it */ *offset += sizeof (PropertyBlob) - sizeof (SimpleTypeBlob); - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); blob->deprecated = prop->deprecated; blob->readable = prop->readable; blob->writable = prop->writable; @@ -1674,8 +1674,8 @@ _gi_ir_node_build_typelib (GIIrNode *node, else blob->getter = ACCESSOR_SENTINEL; - _gi_ir_node_build_typelib ((GIIrNode *)prop->type, - node, build, offset, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)prop->type, + node, build, offset, offset2, NULL); } break; @@ -1702,8 +1702,8 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->wraps_vfunc = function->wraps_vfunc; blob->throws = function->throws; /* Deprecated. Also stored in SignatureBlob. */ blob->index = 0; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); - blob->symbol = _gi_ir_write_string (function->symbol, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); + blob->symbol = gi_ir_write_string (function->symbol, strings, data, offset2); blob->signature = signature; if (function->is_setter || function->is_getter) @@ -1731,8 +1731,8 @@ _gi_ir_node_build_typelib (GIIrNode *node, g_debug ("building function '%s'", function->symbol); - _gi_ir_node_build_typelib ((GIIrNode *)function->result->type, - node, build, &signature, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)function->result->type, + node, build, &signature, offset2, NULL); blob2->may_return_null = function->result->nullable; blob2->caller_owns_return_value = function->result->transfer; @@ -1749,7 +1749,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, { GIIrNode *param = (GIIrNode *)l->data; - _gi_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); + gi_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); } } @@ -1772,11 +1772,11 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->blob_type = BLOB_TYPE_CALLBACK; blob->deprecated = function->deprecated; blob->reserved = 0; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); blob->signature = signature; - _gi_ir_node_build_typelib ((GIIrNode *)function->result->type, - node, build, &signature, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)function->result->type, + node, build, &signature, offset2, NULL); blob2->may_return_null = function->result->nullable; blob2->caller_owns_return_value = function->result->transfer; @@ -1791,7 +1791,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, { GIIrNode *param = (GIIrNode *)l->data; - _gi_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); + gi_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); } } break; @@ -1822,7 +1822,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->true_stops_emit = 0; /* FIXME */ blob->reserved = 0; blob->class_closure = 0; /* FIXME */ - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_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 @@ -1833,8 +1833,8 @@ _gi_ir_node_build_typelib (GIIrNode *node, g_assert (((GIIrNode *) signal->result)->offset == 0); ((GIIrNode *) signal->result)->offset = signature; - _gi_ir_node_build_typelib ((GIIrNode *)signal->result->type, - node, build, &signature, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)signal->result->type, + node, build, &signature, offset2, NULL); blob2->may_return_null = signal->result->nullable; blob2->caller_owns_return_value = signal->result->transfer; @@ -1849,7 +1849,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, { GIIrNode *param = (GIIrNode *)l->data; - _gi_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); + gi_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); } } break; @@ -1868,7 +1868,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, *offset += sizeof (VFuncBlob); *offset2 += sizeof (SignatureBlob) + n * sizeof (ArgBlob); - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_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 */ @@ -1892,8 +1892,8 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->reserved2 = 0; blob->signature = signature; - _gi_ir_node_build_typelib ((GIIrNode *)vfunc->result->type, - node, build, &signature, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)vfunc->result->type, + node, build, &signature, offset2, NULL); blob2->may_return_null = vfunc->result->nullable; blob2->caller_owns_return_value = vfunc->result->transfer; @@ -1909,7 +1909,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, { GIIrNode *param = (GIIrNode *)l->data; - _gi_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); + gi_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); } } break; @@ -1924,7 +1924,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, */ *offset += sizeof (ArgBlob) - sizeof (SimpleTypeBlob); - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); blob->in = param->in; blob->out = param->out; blob->caller_allocates = param->caller_allocates; @@ -1939,7 +1939,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->closure = param->closure; blob->destroy = param->destroy; - _gi_ir_node_build_typelib ((GIIrNode *)param->type, node, build, offset, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)param->type, node, build, offset, offset2, NULL); } break; @@ -1954,15 +1954,15 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->deprecated = struct_->deprecated; blob->is_gtype_struct = struct_->is_gtype_struct; blob->reserved = 0; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_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 = _gi_ir_write_string (struct_->gtype_name, strings, data, offset2); - blob->gtype_init = _gi_ir_write_string (struct_->gtype_init, strings, data, offset2); + blob->gtype_name = gi_ir_write_string (struct_->gtype_name, strings, data, offset2); + blob->gtype_init = gi_ir_write_string (struct_->gtype_init, strings, data, offset2); } else { @@ -1972,9 +1972,9 @@ _gi_ir_node_build_typelib (GIIrNode *node, } if (struct_->copy_func) - blob->copy_func = _gi_ir_write_string (struct_->copy_func, strings, data, offset2); + blob->copy_func = gi_ir_write_string (struct_->copy_func, strings, data, offset2); if (struct_->free_func) - blob->free_func = _gi_ir_write_string (struct_->free_func, strings, data, offset2); + blob->free_func = gi_ir_write_string (struct_->free_func, strings, data, offset2); blob->n_fields = 0; blob->n_methods = 0; @@ -1983,13 +1983,13 @@ _gi_ir_node_build_typelib (GIIrNode *node, members = g_list_copy (struct_->members); - _gi_ir_node_build_members (&members, GI_IR_NODE_FIELD, &blob->n_fields, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_FIELD, &blob->n_fields, + node, build, offset, offset2, NULL); - _gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_methods, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_methods, + node, build, offset, offset2, NULL); - _gi_ir_node_check_unhandled_members (&members, node->type); + gi_ir_node_check_unhandled_members (&members, node->type); g_assert (members == NULL); } @@ -2005,9 +2005,9 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->deprecated = boxed->deprecated; blob->unregistered = FALSE; blob->reserved = 0; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); - blob->gtype_name = _gi_ir_write_string (boxed->gtype_name, strings, data, offset2); - blob->gtype_init = _gi_ir_write_string (boxed->gtype_init, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); + blob->gtype_name = gi_ir_write_string (boxed->gtype_name, strings, data, offset2); + blob->gtype_init = gi_ir_write_string (boxed->gtype_init, strings, data, offset2); blob->alignment = boxed->alignment; blob->size = boxed->size; @@ -2018,13 +2018,13 @@ _gi_ir_node_build_typelib (GIIrNode *node, members = g_list_copy (boxed->members); - _gi_ir_node_build_members (&members, GI_IR_NODE_FIELD, &blob->n_fields, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_FIELD, &blob->n_fields, + node, build, offset, offset2, NULL); - _gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_methods, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_methods, + node, build, offset, offset2, NULL); - _gi_ir_node_check_unhandled_members (&members, node->type); + gi_ir_node_check_unhandled_members (&members, node->type); g_assert (members == NULL); } @@ -2039,14 +2039,14 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->blob_type = BLOB_TYPE_UNION; blob->deprecated = union_->deprecated; blob->reserved = 0; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_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 = _gi_ir_write_string (union_->gtype_name, strings, data, offset2); - blob->gtype_init = _gi_ir_write_string (union_->gtype_init, strings, data, offset2); + blob->gtype_name = gi_ir_write_string (union_->gtype_name, strings, data, offset2); + blob->gtype_init = gi_ir_write_string (union_->gtype_init, strings, data, offset2); } else { @@ -2061,9 +2061,9 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->discriminator_offset = union_->discriminator_offset; if (union_->copy_func) - blob->copy_func = _gi_ir_write_string (union_->copy_func, strings, data, offset2); + blob->copy_func = gi_ir_write_string (union_->copy_func, strings, data, offset2); if (union_->free_func) - blob->free_func = _gi_ir_write_string (union_->free_func, strings, data, offset2); + blob->free_func = gi_ir_write_string (union_->free_func, strings, data, offset2); /* We don't support Union discriminators right now. */ /* @@ -2071,8 +2071,8 @@ _gi_ir_node_build_typelib (GIIrNode *node, { *offset += 28; blob->discriminated = TRUE; - _gi_ir_node_build_typelib ((GIIrNode *)union_->discriminator_type, - build, offset, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)union_->discriminator_type, + build, offset, offset2, NULL); } else { @@ -2083,13 +2083,13 @@ _gi_ir_node_build_typelib (GIIrNode *node, members = g_list_copy (union_->members); - _gi_ir_node_build_members (&members, GI_IR_NODE_FIELD, &blob->n_fields, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_FIELD, &blob->n_fields, + node, build, offset, offset2, NULL); - _gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_functions, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_functions, + node, build, offset, offset2, NULL); - _gi_ir_node_check_unhandled_members (&members, node->type); + gi_ir_node_check_unhandled_members (&members, node->type); g_assert (members == NULL); @@ -2099,7 +2099,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, { GIIrNode *member = (GIIrNode *)l->data; - _gi_ir_node_build_typelib (member, node, build, offset, offset2, NULL); + gi_ir_node_build_typelib (member, node, build, offset, offset2, NULL); } } } @@ -2121,12 +2121,12 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->deprecated = enum_->deprecated; blob->reserved = 0; blob->storage_type = enum_->storage_type; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); if (enum_->gtype_name) { blob->unregistered = FALSE; - blob->gtype_name = _gi_ir_write_string (enum_->gtype_name, strings, data, offset2); - blob->gtype_init = _gi_ir_write_string (enum_->gtype_init, strings, data, offset2); + blob->gtype_name = gi_ir_write_string (enum_->gtype_name, strings, data, offset2); + blob->gtype_init = gi_ir_write_string (enum_->gtype_init, strings, data, offset2); } else { @@ -2135,7 +2135,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->gtype_init = 0; } if (enum_->error_domain) - blob->error_domain = _gi_ir_write_string (enum_->error_domain, strings, data, offset2); + blob->error_domain = gi_ir_write_string (enum_->error_domain, strings, data, offset2); else blob->error_domain = 0; @@ -2147,7 +2147,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, GIIrNode *value = (GIIrNode *)l->data; blob->n_values++; - _gi_ir_node_build_typelib (value, node, build, offset, offset2, NULL); + gi_ir_node_build_typelib (value, node, build, offset, offset2, NULL); } for (l = enum_->methods; l; l = l->next) @@ -2155,7 +2155,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, GIIrNode *method = (GIIrNode *)l->data; blob->n_methods++; - _gi_ir_node_build_typelib (method, node, build, offset, offset2, NULL); + gi_ir_node_build_typelib (method, node, build, offset, offset2, NULL); } } break; @@ -2172,17 +2172,17 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->final_ = object->final_; blob->deprecated = object->deprecated; blob->reserved = 0; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); - blob->gtype_name = _gi_ir_write_string (object->gtype_name, strings, data, offset2); - blob->gtype_init = _gi_ir_write_string (object->gtype_init, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); + blob->gtype_name = gi_ir_write_string (object->gtype_name, strings, data, offset2); + blob->gtype_init = gi_ir_write_string (object->gtype_init, strings, data, offset2); if (object->ref_func) - blob->ref_func = _gi_ir_write_string (object->ref_func, strings, data, offset2); + blob->ref_func = gi_ir_write_string (object->ref_func, strings, data, offset2); if (object->unref_func) - blob->unref_func = _gi_ir_write_string (object->unref_func, strings, data, offset2); + blob->unref_func = gi_ir_write_string (object->unref_func, strings, data, offset2); if (object->set_value_func) - blob->set_value_func = _gi_ir_write_string (object->set_value_func, strings, data, offset2); + blob->set_value_func = gi_ir_write_string (object->set_value_func, strings, data, offset2); if (object->get_value_func) - blob->get_value_func = _gi_ir_write_string (object->get_value_func, strings, data, offset2); + blob->get_value_func = gi_ir_write_string (object->get_value_func, strings, data, offset2); if (object->parent) blob->parent = find_entry (build, object->parent); else @@ -2212,30 +2212,30 @@ _gi_ir_node_build_typelib (GIIrNode *node, members = g_list_copy (object->members); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_FIELD, &blob->n_fields, - node, build, offset, offset2, &blob->n_field_callbacks); + gi_ir_node_build_members (&members, GI_IR_NODE_FIELD, &blob->n_fields, + node, build, offset, offset2, &blob->n_field_callbacks); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_PROPERTY, &blob->n_properties, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_PROPERTY, &blob->n_properties, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_methods, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_methods, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_SIGNAL, &blob->n_signals, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_SIGNAL, &blob->n_signals, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_VFUNC, &blob->n_vfuncs, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_VFUNC, &blob->n_vfuncs, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_CONSTANT, &blob->n_constants, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_CONSTANT, &blob->n_constants, + node, build, offset, offset2, NULL); - _gi_ir_node_check_unhandled_members (&members, node->type); + gi_ir_node_check_unhandled_members (&members, node->type); g_assert (members == NULL); } @@ -2250,9 +2250,9 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->blob_type = BLOB_TYPE_INTERFACE; blob->deprecated = iface->deprecated; blob->reserved = 0; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); - blob->gtype_name = _gi_ir_write_string (iface->gtype_name, strings, data, offset2); - blob->gtype_init = _gi_ir_write_string (iface->gtype_init, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); + blob->gtype_name = gi_ir_write_string (iface->gtype_name, strings, data, offset2); + blob->gtype_init = gi_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 @@ -2275,26 +2275,26 @@ _gi_ir_node_build_typelib (GIIrNode *node, members = g_list_copy (iface->members); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_PROPERTY, &blob->n_properties, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_PROPERTY, &blob->n_properties, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_methods, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_methods, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_SIGNAL, &blob->n_signals, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_SIGNAL, &blob->n_signals, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_VFUNC, &blob->n_vfuncs, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_VFUNC, &blob->n_vfuncs, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_CONSTANT, &blob->n_constants, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_CONSTANT, &blob->n_constants, + node, build, offset, offset2, NULL); - _gi_ir_node_check_unhandled_members (&members, node->type); + gi_ir_node_check_unhandled_members (&members, node->type); g_assert (members == NULL); } @@ -2310,7 +2310,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->deprecated = value->deprecated; blob->reserved = 0; blob->unsigned_value = value->value >= 0 ? 1 : 0; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); blob->value = (gint32)value->value; } break; @@ -2327,7 +2327,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->blob_type = BLOB_TYPE_CONSTANT; blob->deprecated = constant->deprecated; blob->reserved = 0; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); blob->offset = *offset2; switch (constant->type->tag) @@ -2386,7 +2386,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, } *offset2 += ALIGN_VALUE (blob->size, 4); - _gi_ir_node_build_typelib ((GIIrNode *)constant->type, node, build, &pos, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)constant->type, node, build, &pos, offset2, NULL); } break; default: @@ -2397,12 +2397,12 @@ _gi_ir_node_build_typelib (GIIrNode *node, node->name ? "'" : "", node->name ? node->name : "", node->name ? "' " : "", - node, _gi_ir_node_type_to_string (node->type), + node, gi_ir_node_type_to_string (node->type), old_offset, *offset, old_offset2, *offset2); - if (*offset2 - old_offset2 + *offset - old_offset > _gi_ir_node_get_full_size (node)) + if (*offset2 - old_offset2 + *offset - old_offset > gi_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, _gi_ir_node_get_full_size (node)); + *offset, old_offset, *offset2, old_offset2, gi_ir_node_get_full_size (node)); if (appended_stack) build->stack = g_list_delete_link (build->stack, build->stack); @@ -2413,10 +2413,10 @@ _gi_ir_node_build_typelib (GIIrNode *node, * typelib is not large enough to hold the string, reallocate it. */ guint32 -_gi_ir_write_string (const gchar *str, - GHashTable *strings, - guchar *data, - guint32 *offset) +gi_ir_write_string (const gchar *str, + GHashTable *strings, + guchar *data, + guint32 *offset) { gpointer value; guint32 start; diff --git a/girepository/giroffsets.c b/girepository/giroffsets.c index 2fa2a1e18..1e7271538 100644 --- a/girepository/giroffsets.c +++ b/girepository/giroffsets.c @@ -194,16 +194,16 @@ get_interface_size_alignment (GIIrTypelibBuild *build, { GIIrNode *iface; - iface = _gi_ir_find_node (build, ((GIIrNode*)type)->module, type->giinterface); + iface = gi_ir_find_node (build, ((GIIrNode*)type)->module, type->giinterface); if (!iface) { - _gi_ir_module_fatal (build, 0, "Can't resolve type '%s' for %s", type->giinterface, who); + gi_ir_module_fatal (build, 0, "Can't resolve type '%s' for %s", type->giinterface, who); *size = -1; *alignment = -1; return FALSE; } - _gi_ir_node_compute_offsets (build, iface); + gi_ir_node_compute_offsets (build, iface); switch (iface->type) { @@ -252,7 +252,7 @@ get_interface_size_alignment (GIIrTypelibBuild *build, { g_warning ("%s has is not a pointer and is of type %s", who, - _gi_ir_node_type_to_string (iface->type)); + gi_ir_node_type_to_string (iface->type)); *size = -1; *alignment = -1; break; @@ -502,7 +502,7 @@ check_needs_computation (GIIrTypelibBuild *build, } /* - * _gi_ir_node_compute_offsets: + * gi_ir_node_compute_offsets: * @build: Current typelib build * @node: a #GIIrNode * @@ -511,8 +511,8 @@ check_needs_computation (GIIrTypelibBuild *build, * alignment for the type. */ void -_gi_ir_node_compute_offsets (GIIrTypelibBuild *build, - GIIrNode *node) +gi_ir_node_compute_offsets (GIIrTypelibBuild *build, + GIIrNode *node) { gboolean appended_stack; diff --git a/girepository/girparser-private.h b/girepository/girparser-private.h index 6683ce6b1..a2dcb6a85 100644 --- a/girepository/girparser-private.h +++ b/girepository/girparser-private.h @@ -31,19 +31,19 @@ G_BEGIN_DECLS typedef struct _GIIrParser GIIrParser; -GIIrParser *_gi_ir_parser_new (void); -void _gi_ir_parser_free (GIIrParser *parser); -void _gi_ir_parser_set_includes (GIIrParser *parser, - const gchar *const *includes); +GIIrParser *gi_ir_parser_new (void); +void gi_ir_parser_free (GIIrParser *parser); +void gi_ir_parser_set_includes (GIIrParser *parser, + const gchar *const *includes); -GIIrModule *_gi_ir_parser_parse_string (GIIrParser *parser, - const gchar *namespace, - const gchar *filename, - const gchar *buffer, - gssize length, - GError **error); -GIIrModule *_gi_ir_parser_parse_file (GIIrParser *parser, - const gchar *filename, - GError **error); +GIIrModule *gi_ir_parser_parse_string (GIIrParser *parser, + const gchar *namespace, + const gchar *filename, + const gchar *buffer, + gssize length, + GError **error); +GIIrModule *gi_ir_parser_parse_file (GIIrParser *parser, + const gchar *filename, + GError **error); G_END_DECLS diff --git a/girepository/girparser.c b/girepository/girparser.c index fd360f189..60160514d 100644 --- a/girepository/girparser.c +++ b/girepository/girparser.c @@ -183,7 +183,7 @@ static const gchar *find_attribute (const gchar *name, GIIrParser * -_gi_ir_parser_new (void) +gi_ir_parser_new (void) { GIIrParser *parser = g_slice_new0 (GIIrParser); const char *gi_gir_path = g_getenv ("GI_GIR_PATH"); @@ -195,7 +195,7 @@ _gi_ir_parser_new (void) } void -_gi_ir_parser_free (GIIrParser *parser) +gi_ir_parser_free (GIIrParser *parser) { GList *l; @@ -203,14 +203,14 @@ _gi_ir_parser_free (GIIrParser *parser) g_strfreev (parser->gi_gir_path); for (l = parser->parsed_modules; l; l = l->next) - _gi_ir_module_free (l->data); + gi_ir_module_free (l->data); g_slice_free (GIIrParser, parser); } void -_gi_ir_parser_set_includes (GIIrParser *parser, - const gchar *const *includes) +gi_ir_parser_set_includes (GIIrParser *parser, + const gchar *const *includes) { g_strfreev (parser->includes); @@ -541,7 +541,7 @@ parse_type_internal (GIIrModule *module, GIIrNodeType *type; char *temporary_type = NULL; - type = (GIIrNodeType *)_gi_ir_node_new (GI_IR_NODE_TYPE, module); + type = (GIIrNodeType *)gi_ir_node_new (GI_IR_NODE_TYPE, module); type->unparsed = g_strdup (str); @@ -670,7 +670,7 @@ parse_type_internal (GIIrModule *module, return type; /* error: */ - _gi_ir_node_free ((GIIrNode *)type); + gi_ir_node_free ((GIIrNode *)type); g_free (temporary_type); return NULL; } @@ -835,8 +835,8 @@ start_glib_boxed (GMarkupParseContext *context, return FALSE; } - boxed = (GIIrNodeBoxed *) _gi_ir_node_new (GI_IR_NODE_BOXED, - ctx->current_module); + boxed = (GIIrNodeBoxed *) gi_ir_node_new (GI_IR_NODE_BOXED, + ctx->current_module); ((GIIrNode *)boxed)->name = g_strdup (name); boxed->gtype_name = g_strdup (typename); @@ -933,8 +933,8 @@ start_function (GMarkupParseContext *context, if (shadows) name = shadows; - function = (GIIrNodeFunction *) _gi_ir_node_new (GI_IR_NODE_FUNCTION, - ctx->current_module); + function = (GIIrNodeFunction *) gi_ir_node_new (GI_IR_NODE_FUNCTION, + ctx->current_module); ((GIIrNode *)function)->name = g_strdup (name); function->symbol = g_strdup (symbol); @@ -1237,8 +1237,8 @@ start_parameter (GMarkupParseContext *context, if (name == NULL) name = "unknown"; - param = (GIIrNodeParam *)_gi_ir_node_new (GI_IR_NODE_PARAM, - ctx->current_module); + param = (GIIrNodeParam *)gi_ir_node_new (GI_IR_NODE_PARAM, + ctx->current_module); ctx->current_typed = (GIIrNode*) param; ctx->current_typed->name = g_strdup (name); @@ -1408,8 +1408,8 @@ start_field (GMarkupParseContext *context, return FALSE; } - field = (GIIrNodeField *)_gi_ir_node_new (GI_IR_NODE_FIELD, - ctx->current_module); + field = (GIIrNodeField *)gi_ir_node_new (GI_IR_NODE_FIELD, + ctx->current_module); if (introspectable) { ctx->current_typed = (GIIrNode*) field; @@ -1475,8 +1475,8 @@ start_field (GMarkupParseContext *context, { GIIrNodeConstant *constant; - constant = (GIIrNodeConstant *) _gi_ir_node_new (GI_IR_NODE_CONSTANT, - ctx->current_module); + constant = (GIIrNodeConstant *) gi_ir_node_new (GI_IR_NODE_CONSTANT, + ctx->current_module); ((GIIrNode *)constant)->name = g_strdup (name); constant->value = g_strdup (branch); constant->type = union_->discriminator_type; @@ -1551,11 +1551,11 @@ start_enum (GMarkupParseContext *context, } if (strcmp (element_name, "enumeration") == 0) - enum_ = (GIIrNodeEnum *) _gi_ir_node_new (GI_IR_NODE_ENUM, - ctx->current_module); + enum_ = (GIIrNodeEnum *) gi_ir_node_new (GI_IR_NODE_ENUM, + ctx->current_module); else - enum_ = (GIIrNodeEnum *) _gi_ir_node_new (GI_IR_NODE_FLAGS, - ctx->current_module); + enum_ = (GIIrNodeEnum *) gi_ir_node_new (GI_IR_NODE_FLAGS, + ctx->current_module); ((GIIrNode *)enum_)->name = g_strdup (name); enum_->gtype_name = g_strdup (typename); enum_->gtype_init = g_strdup (typeinit); @@ -1624,8 +1624,8 @@ start_property (GMarkupParseContext *context, return FALSE; } - property = (GIIrNodeProperty *) _gi_ir_node_new (GI_IR_NODE_PROPERTY, - ctx->current_module); + property = (GIIrNodeProperty *) gi_ir_node_new (GI_IR_NODE_PROPERTY, + ctx->current_module); ctx->current_typed = (GIIrNode*) property; ((GIIrNode *)property)->name = g_strdup (name); @@ -1712,8 +1712,8 @@ start_member (GMarkupParseContext *context, return FALSE; } - value_ = (GIIrNodeValue *) _gi_ir_node_new (GI_IR_NODE_VALUE, - ctx->current_module); + value_ = (GIIrNodeValue *) gi_ir_node_new (GI_IR_NODE_VALUE, + ctx->current_module); ((GIIrNode *)value_)->name = g_strdup (name); @@ -1790,8 +1790,8 @@ start_constant (GMarkupParseContext *context, return FALSE; } - constant = (GIIrNodeConstant *) _gi_ir_node_new (GI_IR_NODE_CONSTANT, - ctx->current_module); + constant = (GIIrNodeConstant *) gi_ir_node_new (GI_IR_NODE_CONSTANT, + ctx->current_module); ((GIIrNode *)constant)->name = g_strdup (name); constant->value = g_strdup (value); @@ -1864,8 +1864,8 @@ start_interface (GMarkupParseContext *context, return FALSE; } - iface = (GIIrNodeInterface *) _gi_ir_node_new (GI_IR_NODE_INTERFACE, - ctx->current_module); + iface = (GIIrNodeInterface *) gi_ir_node_new (GI_IR_NODE_INTERFACE, + ctx->current_module); ((GIIrNode *)iface)->name = g_strdup (name); iface->gtype_name = g_strdup (typename); iface->gtype_init = g_strdup (typeinit); @@ -1942,8 +1942,8 @@ start_class (GMarkupParseContext *context, return FALSE; } - iface = (GIIrNodeInterface *) _gi_ir_node_new (GI_IR_NODE_OBJECT, - ctx->current_module); + iface = (GIIrNodeInterface *) gi_ir_node_new (GI_IR_NODE_OBJECT, + ctx->current_module); ((GIIrNode *)iface)->name = g_strdup (name); iface->gtype_name = g_strdup (typename); iface->gtype_init = g_strdup (typeinit); @@ -2080,8 +2080,8 @@ start_type (GMarkupParseContext *context, const char *len; const char *size; - typenode = (GIIrNodeType *)_gi_ir_node_new (GI_IR_NODE_TYPE, - ctx->current_module); + typenode = (GIIrNodeType *)gi_ir_node_new (GI_IR_NODE_TYPE, + ctx->current_module); typenode->tag = GI_TYPE_TAG_ARRAY; typenode->is_pointer = TRUE; @@ -2359,8 +2359,8 @@ start_return_value (GMarkupParseContext *context, ctx->state == STATE_FUNCTION)) return FALSE; - param = (GIIrNodeParam *)_gi_ir_node_new (GI_IR_NODE_PARAM, - ctx->current_module); + param = (GIIrNodeParam *)gi_ir_node_new (GI_IR_NODE_PARAM, + ctx->current_module); param->in = FALSE; param->out = FALSE; param->retval = TRUE; @@ -2480,8 +2480,8 @@ start_glib_signal (GMarkupParseContext *context, MISSING_ATTRIBUTE (context, error, element_name, "name"); return FALSE; } - signal = (GIIrNodeSignal *)_gi_ir_node_new (GI_IR_NODE_SIGNAL, - ctx->current_module); + signal = (GIIrNodeSignal *)gi_ir_node_new (GI_IR_NODE_SIGNAL, + ctx->current_module); ((GIIrNode *)signal)->name = g_strdup (name); @@ -2564,8 +2564,8 @@ start_vfunc (GMarkupParseContext *context, return FALSE; } - vfunc = (GIIrNodeVFunc *)_gi_ir_node_new (GI_IR_NODE_VFUNC, - ctx->current_module); + vfunc = (GIIrNodeVFunc *)gi_ir_node_new (GI_IR_NODE_VFUNC, + ctx->current_module); ((GIIrNode *)vfunc)->name = g_strdup (name); @@ -2674,8 +2674,8 @@ start_struct (GMarkupParseContext *context, return FALSE; } - struct_ = (GIIrNodeStruct *) _gi_ir_node_new (GI_IR_NODE_STRUCT, - ctx->current_module); + struct_ = (GIIrNodeStruct *) gi_ir_node_new (GI_IR_NODE_STRUCT, + ctx->current_module); ((GIIrNode *)struct_)->name = g_strdup (name ? name : ""); if (deprecated) @@ -2748,8 +2748,8 @@ start_union (GMarkupParseContext *context, return FALSE; } - union_ = (GIIrNodeUnion *) _gi_ir_node_new (GI_IR_NODE_UNION, - ctx->current_module); + union_ = (GIIrNodeUnion *) gi_ir_node_new (GI_IR_NODE_UNION, + ctx->current_module); ((GIIrNode *)union_)->name = g_strdup (name ? name : ""); union_->gtype_name = g_strdup (typename); @@ -2859,7 +2859,7 @@ parse_include (GMarkupParseContext *context, return FALSE; } - module = _gi_ir_parser_parse_string (ctx->parser, name, girpath, buffer, length, &error); + module = gi_ir_parser_parse_string (ctx->parser, name, girpath, buffer, length, &error); g_free (buffer); if (error != NULL) { @@ -3106,7 +3106,7 @@ start_element_handler (GMarkupParseContext *context, " name element '%s' doesn't match file name '%s'", name, ctx->namespace); - ctx->current_module = _gi_ir_module_new (name, version, shared_library, cprefix); + ctx->current_module = gi_ir_module_new (name, version, shared_library, cprefix); ctx->current_module->aliases = ctx->aliases; ctx->aliases = NULL; @@ -3116,7 +3116,7 @@ start_element_handler (GMarkupParseContext *context, ctx->pointer_structures = NULL; for (l = ctx->include_modules; l; l = l->next) - _gi_ir_module_add_include_module (ctx->current_module, l->data); + gi_ir_module_add_include_module (ctx->current_module, l->data); g_list_free (ctx->include_modules); ctx->include_modules = NULL; @@ -3663,7 +3663,7 @@ cleanup (GMarkupParseContext *context, GList *m; for (m = ctx->modules; m; m = m->next) - _gi_ir_module_free (m->data); + gi_ir_module_free (m->data); g_list_free (ctx->modules); ctx->modules = NULL; @@ -3671,7 +3671,7 @@ cleanup (GMarkupParseContext *context, } /** - * _gi_ir_parser_parse_string: + * gi_ir_parser_parse_string: * @parser: a #GIIrParser * @namespace: the namespace of the string * @filename: (allow-none): Path to parsed file, or %NULL @@ -3685,12 +3685,12 @@ cleanup (GMarkupParseContext *context, * Returns: (transfer none): a new #GirModule */ GIIrModule * -_gi_ir_parser_parse_string (GIIrParser *parser, - const gchar *namespace, - const gchar *filename, - const gchar *buffer, - gssize length, - GError **error) +gi_ir_parser_parse_string (GIIrParser *parser, + const gchar *namespace, + const gchar *filename, + const gchar *buffer, + gssize length, + GError **error) { ParseContext ctx = { 0 }; GMarkupParseContext *context; @@ -3755,7 +3755,7 @@ _gi_ir_parser_parse_string (GIIrParser *parser, } /** - * _gi_ir_parser_parse_file: + * gi_ir_parser_parse_file: * @parser: a #GIIrParser * @filename: filename to parse * @error: return location for a #GError, or %NULL @@ -3767,9 +3767,9 @@ _gi_ir_parser_parse_string (GIIrParser *parser, * are owned by the #GIIrParser and will be freed along with the parser. */ GIIrModule * -_gi_ir_parser_parse_file (GIIrParser *parser, - const gchar *filename, - GError **error) +gi_ir_parser_parse_file (GIIrParser *parser, + const gchar *filename, + GError **error) { gchar *buffer; gsize length; @@ -3803,7 +3803,7 @@ _gi_ir_parser_parse_file (GIIrParser *parser, return NULL; } - module = _gi_ir_parser_parse_string (parser, namespace, filename, buffer, length, error); + module = gi_ir_parser_parse_string (parser, namespace, filename, buffer, length, error); g_free (namespace); diff --git a/girepository/gistructinfo.c b/girepository/gistructinfo.c index a43ec01d1..8be89544a 100644 --- a/girepository/gistructinfo.c +++ b/girepository/gistructinfo.c @@ -212,7 +212,7 @@ gi_struct_info_find_method (GIStructInfo *info, StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; offset = gi_struct_get_field_offset (info, blob->n_fields); - return _gi_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name); + return gi_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name); } /** diff --git a/girepository/gitypeinfo.c b/girepository/gitypeinfo.c index 429615c9a..a7be761bf 100644 --- a/girepository/gitypeinfo.c +++ b/girepository/gitypeinfo.c @@ -146,9 +146,9 @@ gi_type_info_get_param_type (GITypeInfo *info, case GI_TYPE_TAG_GLIST: case GI_TYPE_TAG_GSLIST: case GI_TYPE_TAG_GHASH: - return _gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, - rinfo->offset + sizeof (ParamTypeBlob) - + sizeof (SimpleTypeBlob) * n); + return gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, + rinfo->offset + sizeof (ParamTypeBlob) + + sizeof (SimpleTypeBlob) * n); break; default: break; @@ -207,7 +207,7 @@ gi_type_info_get_interface (GITypeInfo *info) InterfaceTypeBlob *blob = (InterfaceTypeBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->tag == GI_TYPE_TAG_INTERFACE) - return _gi_info_from_entry (rinfo->repository, rinfo->typelib, blob->interface); + return gi_info_from_entry (rinfo->repository, rinfo->typelib, blob->interface); } } diff --git a/girepository/gitypelib-internal.h b/girepository/gitypelib-internal.h index 3e9016c83..b02f05044 100644 --- a/girepository/gitypelib-internal.h +++ b/girepository/gitypelib-internal.h @@ -1332,19 +1332,19 @@ AttributeBlob *_attribute_blob_find_first (GIBaseInfo *info, */ typedef struct _GITypelibHashBuilder GITypelibHashBuilder; -GITypelibHashBuilder * _gi_typelib_hash_builder_new (void); +GITypelibHashBuilder * gi_typelib_hash_builder_new (void); -void _gi_typelib_hash_builder_add_string (GITypelibHashBuilder *builder, const char *str, guint16 value); +void gi_typelib_hash_builder_add_string (GITypelibHashBuilder *builder, const char *str, guint16 value); -gboolean _gi_typelib_hash_builder_prepare (GITypelibHashBuilder *builder); +gboolean gi_typelib_hash_builder_prepare (GITypelibHashBuilder *builder); -guint32 _gi_typelib_hash_builder_get_buffer_size (GITypelibHashBuilder *builder); +guint32 gi_typelib_hash_builder_get_buffer_size (GITypelibHashBuilder *builder); -void _gi_typelib_hash_builder_pack (GITypelibHashBuilder *builder, guint8* mem, guint32 size); +void gi_typelib_hash_builder_pack (GITypelibHashBuilder *builder, guint8* mem, guint32 size); -void _gi_typelib_hash_builder_destroy (GITypelibHashBuilder *builder); +void gi_typelib_hash_builder_destroy (GITypelibHashBuilder *builder); -guint16 _gi_typelib_hash_search (guint8* memory, const char *str, guint n_entries); +guint16 gi_typelib_hash_search (guint8* memory, const char *str, guint n_entries); G_END_DECLS diff --git a/girepository/gitypelib.c b/girepository/gitypelib.c index 4ddad0801..f5dee7909 100644 --- a/girepository/gitypelib.c +++ b/girepository/gitypelib.c @@ -209,7 +209,7 @@ gi_typelib_get_dir_entry_by_name (GITypelib *typelib, guint8 *hash = (guint8*) &typelib->data[dirindex->offset]; guint16 index; - index = _gi_typelib_hash_search (hash, name, n_entries); + index = gi_typelib_hash_search (hash, name, n_entries); entry = gi_typelib_get_dir_entry (typelib, index + 1); entry_name = gi_typelib_get_string (typelib, entry->name); if (strcmp (name, entry_name) == 0) @@ -2298,7 +2298,7 @@ load_one_shared_library (const char *shlib) } static void -_gi_typelib_do_dlopen (GITypelib *typelib) +gi_typelib_do_dlopen (GITypelib *typelib) { Header *header; const char *shlib_str; @@ -2357,12 +2357,12 @@ _gi_typelib_do_dlopen (GITypelib *typelib) } static inline void -_gi_typelib_ensure_open (GITypelib *typelib) +gi_typelib_ensure_open (GITypelib *typelib) { if (typelib->open_attempted) return; typelib->open_attempted = TRUE; - _gi_typelib_do_dlopen (typelib); + gi_typelib_do_dlopen (typelib); } /** @@ -2505,7 +2505,7 @@ gi_typelib_symbol (GITypelib *typelib, const char *symbol_name, gpointer *symbol { GList *l; - _gi_typelib_ensure_open (typelib); + gi_typelib_ensure_open (typelib); /* * The reason for having multiple modules dates from gir-repository diff --git a/girepository/giunioninfo.c b/girepository/giunioninfo.c index 187b454a1..41966db35 100644 --- a/girepository/giunioninfo.c +++ b/girepository/giunioninfo.c @@ -173,7 +173,7 @@ gi_union_info_get_discriminator_type (GIUnionInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; - return _gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + 24); + return gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + 24); } /** @@ -234,7 +234,7 @@ gi_union_info_find_method (GIUnionInfo *info, offset = rinfo->offset + header->union_blob_size + blob->n_fields * header->field_blob_size; - return _gi_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_functions, name); + return gi_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_functions, name); } /** diff --git a/girepository/givfuncinfo.c b/girepository/givfuncinfo.c index 604b029e1..2dfe73f04 100644 --- a/girepository/givfuncinfo.c +++ b/girepository/givfuncinfo.c @@ -45,10 +45,10 @@ */ GIVFuncInfo * -_gi_base_info_find_vfunc (GIRealInfo *rinfo, - guint32 offset, - gint n_vfuncs, - const gchar *name) +gi_base_info_find_vfunc (GIRealInfo *rinfo, + guint32 offset, + gint n_vfuncs, + const gchar *name) { /* FIXME hash */ Header *header = (Header *)rinfo->typelib->data; diff --git a/girepository/gthash-test.c b/girepository/gthash-test.c index 9ae3f5d7e..ac55db91d 100644 --- a/girepository/gthash-test.c +++ b/girepository/gthash-test.c @@ -31,28 +31,28 @@ test_build_retrieve (void) guint32 bufsize; guint8* buf; - builder = _gi_typelib_hash_builder_new (); + builder = gi_typelib_hash_builder_new (); - _gi_typelib_hash_builder_add_string (builder, "Action", 0); - _gi_typelib_hash_builder_add_string (builder, "ZLibDecompressor", 42); - _gi_typelib_hash_builder_add_string (builder, "VolumeMonitor", 9); - _gi_typelib_hash_builder_add_string (builder, "FileMonitorFlags", 31); + gi_typelib_hash_builder_add_string (builder, "Action", 0); + gi_typelib_hash_builder_add_string (builder, "ZLibDecompressor", 42); + gi_typelib_hash_builder_add_string (builder, "VolumeMonitor", 9); + gi_typelib_hash_builder_add_string (builder, "FileMonitorFlags", 31); - if (!_gi_typelib_hash_builder_prepare (builder)) + if (!gi_typelib_hash_builder_prepare (builder)) g_assert_not_reached (); - bufsize = _gi_typelib_hash_builder_get_buffer_size (builder); + bufsize = gi_typelib_hash_builder_get_buffer_size (builder); buf = g_malloc (bufsize); - _gi_typelib_hash_builder_pack (builder, buf, bufsize); + gi_typelib_hash_builder_pack (builder, buf, bufsize); - _gi_typelib_hash_builder_destroy (builder); + gi_typelib_hash_builder_destroy (builder); - g_assert (_gi_typelib_hash_search (buf, "Action", 4) == 0); - g_assert (_gi_typelib_hash_search (buf, "ZLibDecompressor", 4) == 42); - g_assert (_gi_typelib_hash_search (buf, "VolumeMonitor", 4) == 9); - g_assert (_gi_typelib_hash_search (buf, "FileMonitorFlags", 4) == 31); + g_assert (gi_typelib_hash_search (buf, "Action", 4) == 0); + g_assert (gi_typelib_hash_search (buf, "ZLibDecompressor", 4) == 42); + g_assert (gi_typelib_hash_search (buf, "VolumeMonitor", 4) == 9); + g_assert (gi_typelib_hash_search (buf, "FileMonitorFlags", 4) == 31); } int diff --git a/girepository/gthash.c b/girepository/gthash.c index 8a0ee305d..023a92f82 100644 --- a/girepository/gthash.c +++ b/girepository/gthash.c @@ -64,7 +64,7 @@ struct _GITypelibHashBuilder { }; GITypelibHashBuilder * -_gi_typelib_hash_builder_new (void) +gi_typelib_hash_builder_new (void) { GITypelibHashBuilder *builder = g_slice_new0 (GITypelibHashBuilder); builder->c = NULL; @@ -73,16 +73,16 @@ _gi_typelib_hash_builder_new (void) } void -_gi_typelib_hash_builder_add_string (GITypelibHashBuilder *builder, - const char *str, - guint16 value) +gi_typelib_hash_builder_add_string (GITypelibHashBuilder *builder, + const char *str, + guint16 value) { g_return_if_fail (builder->c == NULL); g_hash_table_insert (builder->strings, g_strdup (str), GUINT_TO_POINTER ((guint) value)); } gboolean -_gi_typelib_hash_builder_prepare (GITypelibHashBuilder *builder) +gi_typelib_hash_builder_prepare (GITypelibHashBuilder *builder) { char **strs; GHashTableIter hashiter; @@ -137,7 +137,7 @@ _gi_typelib_hash_builder_prepare (GITypelibHashBuilder *builder) } guint32 -_gi_typelib_hash_builder_get_buffer_size (GITypelibHashBuilder *builder) +gi_typelib_hash_builder_get_buffer_size (GITypelibHashBuilder *builder) { g_return_val_if_fail (builder != NULL, 0); g_return_val_if_fail (builder->prepared, 0); @@ -147,7 +147,7 @@ _gi_typelib_hash_builder_get_buffer_size (GITypelibHashBuilder *builder) } void -_gi_typelib_hash_builder_pack (GITypelibHashBuilder *builder, guint8* mem, guint32 len) +gi_typelib_hash_builder_pack (GITypelibHashBuilder *builder, guint8* mem, guint32 len) { guint16 *table; GHashTableIter hashiter; @@ -185,7 +185,7 @@ _gi_typelib_hash_builder_pack (GITypelibHashBuilder *builder, guint8* mem, guint } void -_gi_typelib_hash_builder_destroy (GITypelibHashBuilder *builder) +gi_typelib_hash_builder_destroy (GITypelibHashBuilder *builder) { if (builder->c) { @@ -197,7 +197,7 @@ _gi_typelib_hash_builder_destroy (GITypelibHashBuilder *builder) } guint16 -_gi_typelib_hash_search (guint8* memory, const char *str, guint n_entries) +gi_typelib_hash_search (guint8* memory, const char *str, guint n_entries) { guint32 *mph; guint16 *table;