mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
girepository: Remove _
prefix from private functions
Now that libgirepository uses `GI_AVAILABLE_IN_*` macros, that’s what controls symbol visibility. The `_` prefixes are redundant, and out of keeping with the rest of GLib. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Helps: #3155
This commit is contained in:
parent
7b029e564d
commit
2b544c3f66
@ -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));
|
||||
}
|
||||
|
@ -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 */
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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) \
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
|
@ -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),
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
"<namespace/> 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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user