Merge branch '3155-girepository-api-cleanups' into 'main'

girepository: Various API cleanups

See merge request GNOME/glib!3760
This commit is contained in:
Philip Withnall 2023-12-18 14:12:47 +00:00
commit 7688965491
33 changed files with 280 additions and 282 deletions

View File

@ -521,33 +521,41 @@ dump_error_quark (GQuark quark, const char *symbol, GOutputStream *out)
/** /**
* gi_repository_dump: * gi_repository_dump:
* @arg: Comma-separated pair of input and output filenames * @input_filename: (type filename): Input filename (for example `input.txt`)
* @output_filename: (type filename): Output filename (for example `output.xml`)
* @error: a %GError * @error: a %GError
* *
* Argument specified is a comma-separated pair of filenames; i.e. of * Dump the introspection data from the types specified in @input_filename to
* the form "input.txt,output.xml". The input file should be a * @output_filename.
*
* The input file should be a
* UTF-8 Unix-line-ending text file, with each line containing either * UTF-8 Unix-line-ending text file, with each line containing either
* "get-type:" followed by the name of a GType _get_type function, or * `get-type:` followed by the name of a [type@GObject.Type] `_get_type`
* "error-quark:" followed by the name of an error quark function. No * function, or `error-quark:` followed by the name of an error quark function.
* extra whitespace is allowed. * No extra whitespace is allowed.
* *
* The output file should already exist, but be empty. This function will * This function will overwrite the contents of the output file.
* overwrite its contents.
* *
* Returns: %TRUE on success, %FALSE on error * Returns: true on success, false on error
* Since: 2.80
*/ */
#ifndef GI_COMPILATION #ifndef GI_COMPILATION
static gboolean static gboolean
dump_irepository (const char *arg, GError **error) G_GNUC_UNUSED; dump_irepository (const char *input_filename,
const char *output_filename,
GError **error) G_GNUC_UNUSED;
static gboolean static gboolean
dump_irepository (const char *arg, GError **error) dump_irepository (const char *input_filename,
const char *output_filename,
GError **error)
#else #else
gboolean gboolean
gi_repository_dump (const char *arg, GError **error) gi_repository_dump (const char *input_filename,
const char *output_filename,
GError **error)
#endif #endif
{ {
GHashTable *output_types; GHashTable *output_types;
char **args;
GFile *input_file; GFile *input_file;
GFile *output_file; GFile *output_file;
GFileInputStream *input; GFileInputStream *input;
@ -567,12 +575,8 @@ gi_repository_dump (const char *arg, GError **error)
return FALSE; return FALSE;
} }
args = g_strsplit (arg, ",", 2); input_file = g_file_new_for_path (input_filename);
output_file = g_file_new_for_path (output_filename);
input_file = g_file_new_for_path (args[0]);
output_file = g_file_new_for_path (args[1]);
g_strfreev (args);
input = g_file_read (input_file, NULL, error); input = g_file_read (input_file, NULL, error);
g_object_unref (input_file); g_object_unref (input_file);

View File

@ -246,7 +246,7 @@ gi_arg_info_get_scope (GIArgInfo *info)
} }
/** /**
* gi_arg_info_get_closure: * gi_arg_info_get_closure_index:
* @info: a #GIArgInfo * @info: a #GIArgInfo
* *
* Obtain the index of the user data argument. This is only valid * Obtain the index of the user data argument. This is only valid
@ -255,7 +255,7 @@ gi_arg_info_get_scope (GIArgInfo *info)
* Returns: index of the user data argument or -1 if there is none * Returns: index of the user data argument or -1 if there is none
*/ */
gint gint
gi_arg_info_get_closure (GIArgInfo *info) gi_arg_info_get_closure_index (GIArgInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob; ArgBlob *blob;
@ -269,7 +269,7 @@ gi_arg_info_get_closure (GIArgInfo *info)
} }
/** /**
* gi_arg_info_get_destroy: * gi_arg_info_get_destroy_index:
* @info: a #GIArgInfo * @info: a #GIArgInfo
* *
* Obtains the index of the #GDestroyNotify argument. This is only valid * Obtains the index of the #GDestroyNotify argument. This is only valid
@ -278,7 +278,7 @@ gi_arg_info_get_closure (GIArgInfo *info)
* Returns: index of the #GDestroyNotify argument or -1 if there is none * Returns: index of the #GDestroyNotify argument or -1 if there is none
*/ */
gint gint
gi_arg_info_get_destroy (GIArgInfo *info) gi_arg_info_get_destroy_index (GIArgInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob; ArgBlob *blob;

View File

@ -67,10 +67,10 @@ GI_AVAILABLE_IN_ALL
GIScopeType gi_arg_info_get_scope (GIArgInfo *info); GIScopeType gi_arg_info_get_scope (GIArgInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_arg_info_get_closure (GIArgInfo *info); gint gi_arg_info_get_closure_index (GIArgInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_arg_info_get_destroy (GIArgInfo *info); gint gi_arg_info_get_destroy_index (GIArgInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GITypeInfo * gi_arg_info_get_type_info (GIArgInfo *info); GITypeInfo * gi_arg_info_get_type_info (GIArgInfo *info);

View File

@ -747,7 +747,7 @@ gi_base_info_get_attribute (GIBaseInfo *info,
const gchar *name) const gchar *name)
{ {
GIAttributeIter iter = { 0, }; GIAttributeIter iter = { 0, };
gchar *curname, *curvalue; const char *curname, *curvalue;
while (gi_base_info_iterate_attributes (info, &iter, &curname, &curvalue)) while (gi_base_info_iterate_attributes (info, &iter, &curname, &curvalue))
{ {
if (strcmp (name, curname) == 0) if (strcmp (name, curname) == 0)
@ -832,8 +832,8 @@ _attribute_blob_find_first (GIBaseInfo *info,
* print_attributes (GIBaseInfo *info) * print_attributes (GIBaseInfo *info)
* { * {
* GIAttributeIter iter = { 0, }; * GIAttributeIter iter = { 0, };
* char *name; * const char *name;
* char *value; * const char *value;
* while (gi_base_info_iterate_attributes (info, &iter, &name, &value)) * while (gi_base_info_iterate_attributes (info, &iter, &name, &value))
* { * {
* g_print ("attribute name: %s value: %s", name, value); * g_print ("attribute name: %s value: %s", name, value);
@ -846,8 +846,8 @@ _attribute_blob_find_first (GIBaseInfo *info,
gboolean gboolean
gi_base_info_iterate_attributes (GIBaseInfo *info, gi_base_info_iterate_attributes (GIBaseInfo *info,
GIAttributeIter *iterator, GIAttributeIter *iterator,
gchar **name, const gchar **name,
gchar **value) const gchar **value)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
Header *header = (Header *)rinfo->typelib->data; Header *header = (Header *)rinfo->typelib->data;
@ -864,8 +864,8 @@ gi_base_info_iterate_attributes (GIBaseInfo *info,
if (next == NULL || next->offset != rinfo->offset || next >= after) if (next == NULL || next->offset != rinfo->offset || next >= after)
return FALSE; return FALSE;
*name = (gchar*) gi_typelib_get_string (rinfo->typelib, next->name); *name = gi_typelib_get_string (rinfo->typelib, next->name);
*value = (gchar*) gi_typelib_get_string (rinfo->typelib, next->value); *value = gi_typelib_get_string (rinfo->typelib, next->value);
iterator->data = next + 1; iterator->data = next + 1;
return TRUE; return TRUE;

View File

@ -79,8 +79,8 @@ const gchar * gi_base_info_get_attribute (GIBaseInfo *info,
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean gi_base_info_iterate_attributes (GIBaseInfo *info, gboolean gi_base_info_iterate_attributes (GIBaseInfo *info,
GIAttributeIter *iterator, GIAttributeIter *iterator,
char **name, const char **name,
char **value); const char **value);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIBaseInfo * gi_base_info_get_container (GIBaseInfo *info); GIBaseInfo * gi_base_info_get_container (GIBaseInfo *info);

View File

@ -322,7 +322,7 @@ gi_callable_info_get_instance_ownership_transfer (GICallableInfo *info)
* *
* Returns: The number of arguments this callable expects. * Returns: The number of arguments this callable expects.
*/ */
gint guint
gi_callable_info_get_n_args (GICallableInfo *info) gi_callable_info_get_n_args (GICallableInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -350,7 +350,7 @@ gi_callable_info_get_n_args (GICallableInfo *info)
*/ */
GIArgInfo * GIArgInfo *
gi_callable_info_get_arg (GICallableInfo *info, gi_callable_info_get_arg (GICallableInfo *info,
gint n) guint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
Header *header; Header *header;
@ -380,7 +380,7 @@ gi_callable_info_get_arg (GICallableInfo *info,
*/ */
void void
gi_callable_info_load_arg (GICallableInfo *info, gi_callable_info_load_arg (GICallableInfo *info,
gint n, guint n,
GIArgInfo *arg) GIArgInfo *arg)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -411,7 +411,7 @@ gi_callable_info_get_return_attribute (GICallableInfo *info,
const gchar *name) const gchar *name)
{ {
GIAttributeIter iter = { 0, }; GIAttributeIter iter = { 0, };
gchar *curname, *curvalue; const char *curname, *curvalue;
while (gi_callable_info_iterate_return_attributes (info, &iter, &curname, &curvalue)) while (gi_callable_info_iterate_return_attributes (info, &iter, &curname, &curvalue))
{ {
if (g_strcmp0 (name, curname) == 0) if (g_strcmp0 (name, curname) == 0)
@ -443,8 +443,8 @@ gi_callable_info_get_return_attribute (GICallableInfo *info,
gboolean gboolean
gi_callable_info_iterate_return_attributes (GICallableInfo *info, gi_callable_info_iterate_return_attributes (GICallableInfo *info,
GIAttributeIter *iterator, GIAttributeIter *iterator,
char **name, const char **name,
char **value) const char **value)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
Header *header = (Header *)rinfo->typelib->data; Header *header = (Header *)rinfo->typelib->data;
@ -464,8 +464,8 @@ gi_callable_info_iterate_return_attributes (GICallableInfo *info,
if (next == NULL || next->offset != blob_offset || next >= after) if (next == NULL || next->offset != blob_offset || next >= after)
return FALSE; return FALSE;
*name = (gchar*) gi_typelib_get_string (rinfo->typelib, next->name); *name = gi_typelib_get_string (rinfo->typelib, next->name);
*value = (gchar*) gi_typelib_get_string (rinfo->typelib, next->value); *value = gi_typelib_get_string (rinfo->typelib, next->value);
iterator->data = next + 1; iterator->data = next + 1;
return TRUE; return TRUE;
@ -601,9 +601,9 @@ gboolean
gi_callable_info_invoke (GICallableInfo *info, gi_callable_info_invoke (GICallableInfo *info,
gpointer function, gpointer function,
const GIArgument *in_args, const GIArgument *in_args,
int n_in_args, gsize n_in_args,
const GIArgument *out_args, const GIArgument *out_args,
int n_out_args, gsize n_out_args,
GIArgument *return_value, GIArgument *return_value,
gboolean is_method, gboolean is_method,
gboolean throws, gboolean throws,
@ -616,7 +616,7 @@ gi_callable_info_invoke (GICallableInfo *info,
GITypeInfo *rinfo; GITypeInfo *rinfo;
GITypeTag rtag; GITypeTag rtag;
GIArgInfo *ainfo; GIArgInfo *ainfo;
gint n_args, n_invoke_args, in_pos, out_pos, i; gsize n_args, n_invoke_args, in_pos, out_pos, i;
gpointer *args; gpointer *args;
gboolean success = FALSE; gboolean success = FALSE;
GError *local_error = NULL; GError *local_error = NULL;

View File

@ -65,8 +65,8 @@ const gchar * gi_callable_info_get_return_attribute (GICallableInfo *in
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean gi_callable_info_iterate_return_attributes (GICallableInfo *info, gboolean gi_callable_info_iterate_return_attributes (GICallableInfo *info,
GIAttributeIter *iterator, GIAttributeIter *iterator,
char **name, const char **name,
char **value); const char **value);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GITransfer gi_callable_info_get_caller_owns (GICallableInfo *info); GITransfer gi_callable_info_get_caller_owns (GICallableInfo *info);
@ -78,24 +78,24 @@ GI_AVAILABLE_IN_ALL
gboolean gi_callable_info_skip_return (GICallableInfo *info); gboolean gi_callable_info_skip_return (GICallableInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_callable_info_get_n_args (GICallableInfo *info); guint gi_callable_info_get_n_args (GICallableInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIArgInfo * gi_callable_info_get_arg (GICallableInfo *info, GIArgInfo * gi_callable_info_get_arg (GICallableInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
void gi_callable_info_load_arg (GICallableInfo *info, void gi_callable_info_load_arg (GICallableInfo *info,
gint n, guint n,
GIArgInfo *arg); GIArgInfo *arg);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean gi_callable_info_invoke (GICallableInfo *info, gboolean gi_callable_info_invoke (GICallableInfo *info,
gpointer function, gpointer function,
const GIArgument *in_args, const GIArgument *in_args,
int n_in_args, gsize n_in_args,
const GIArgument *out_args, const GIArgument *out_args,
int n_out_args, gsize n_out_args,
GIArgument *return_value, GIArgument *return_value,
gboolean is_method, gboolean is_method,
gboolean throws, gboolean throws,

View File

@ -108,9 +108,9 @@ gi_constant_info_free_value (GIConstantInfo *info,
* The size of the constant value stored in @argument will be returned. * The size of the constant value stored in @argument will be returned.
* Free the value with gi_constant_info_free_value(). * Free the value with gi_constant_info_free_value().
* *
* Returns: size of the constant * Returns: size of the constant, in bytes
*/ */
gint gsize
gi_constant_info_get_value (GIConstantInfo *info, gi_constant_info_get_value (GIConstantInfo *info,
GIArgument *value) GIArgument *value)
{ {

View File

@ -50,6 +50,6 @@ void gi_constant_info_free_value (GIConstantInfo *info,
GIArgument *value); GIArgument *value);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_constant_info_get_value (GIConstantInfo *info, gsize gi_constant_info_get_value (GIConstantInfo *info,
GIArgument *value); GIArgument *value);
G_END_DECLS G_END_DECLS

View File

@ -54,7 +54,7 @@
* *
* Returns: the number of enumeration values * Returns: the number of enumeration values
*/ */
gint guint
gi_enum_info_get_n_values (GIEnumInfo *info) gi_enum_info_get_n_values (GIEnumInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -108,7 +108,7 @@ gi_enum_info_get_error_domain (GIEnumInfo *info)
*/ */
GIValueInfo * GIValueInfo *
gi_enum_info_get_value (GIEnumInfo *info, gi_enum_info_get_value (GIEnumInfo *info,
gint n) guint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
Header *header; Header *header;
@ -133,7 +133,7 @@ gi_enum_info_get_value (GIEnumInfo *info,
* Returns: number of methods * Returns: number of methods
* Since: 2.80 * Since: 2.80
*/ */
gint guint
gi_enum_info_get_n_methods (GIEnumInfo *info) gi_enum_info_get_n_methods (GIEnumInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -160,7 +160,7 @@ gi_enum_info_get_n_methods (GIEnumInfo *info)
*/ */
GIFunctionInfo * GIFunctionInfo *
gi_enum_info_get_method (GIEnumInfo *info, gi_enum_info_get_method (GIEnumInfo *info,
gint n) guint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;

View File

@ -53,18 +53,18 @@ G_BEGIN_DECLS
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_enum_info_get_n_values (GIEnumInfo *info); guint gi_enum_info_get_n_values (GIEnumInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIValueInfo * gi_enum_info_get_value (GIEnumInfo *info, GIValueInfo * gi_enum_info_get_value (GIEnumInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_enum_info_get_n_methods (GIEnumInfo *info); guint gi_enum_info_get_n_methods (GIEnumInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFunctionInfo * gi_enum_info_get_method (GIEnumInfo *info, GIFunctionInfo * gi_enum_info_get_method (GIEnumInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GITypeTag gi_enum_info_get_storage_type (GIEnumInfo *info); GITypeTag gi_enum_info_get_storage_type (GIEnumInfo *info);

View File

@ -95,7 +95,7 @@ gi_field_info_get_flags (GIFieldInfo *info)
* Returns: the field size, in bits * Returns: the field size, in bits
* Since: 2.80 * Since: 2.80
*/ */
gint gsize
gi_field_info_get_size (GIFieldInfo *info) gi_field_info_get_size (GIFieldInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -119,7 +119,7 @@ gi_field_info_get_size (GIFieldInfo *info)
* Returns: the field offset, in bytes * Returns: the field offset, in bytes
* Since: 2.80 * Since: 2.80
*/ */
gint gsize
gi_field_info_get_offset (GIFieldInfo *info) gi_field_info_get_offset (GIFieldInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;

View File

@ -48,10 +48,10 @@ GI_AVAILABLE_IN_ALL
GIFieldInfoFlags gi_field_info_get_flags (GIFieldInfo *info); GIFieldInfoFlags gi_field_info_get_flags (GIFieldInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_field_info_get_size (GIFieldInfo *info); gsize gi_field_info_get_size (GIFieldInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_field_info_get_offset (GIFieldInfo *info); gsize gi_field_info_get_offset (GIFieldInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GITypeInfo * gi_field_info_get_type_info (GIFieldInfo *info); GITypeInfo * gi_field_info_get_type_info (GIFieldInfo *info);

View File

@ -51,15 +51,14 @@
GIFunctionInfo * GIFunctionInfo *
gi_base_info_find_method (GIBaseInfo *base, gi_base_info_find_method (GIBaseInfo *base,
guint32 offset, guint32 offset,
gint n_methods, guint n_methods,
const gchar *name) const gchar *name)
{ {
/* FIXME hash */ /* FIXME hash */
GIRealInfo *rinfo = (GIRealInfo*)base; GIRealInfo *rinfo = (GIRealInfo*)base;
Header *header = (Header *)rinfo->typelib->data; Header *header = (Header *)rinfo->typelib->data;
gint i;
for (i = 0; i < n_methods; i++) for (guint i = 0; i < n_methods; i++)
{ {
FunctionBlob *fblob = (FunctionBlob *)&rinfo->typelib->data[offset]; FunctionBlob *fblob = (FunctionBlob *)&rinfo->typelib->data[offset];
const gchar *fname = (const gchar *)&rinfo->typelib->data[fblob->name]; const gchar *fname = (const gchar *)&rinfo->typelib->data[fblob->name];
@ -256,9 +255,9 @@ gi_invoke_error_quark (void)
gboolean gboolean
gi_function_info_invoke (GIFunctionInfo *info, gi_function_info_invoke (GIFunctionInfo *info,
const GIArgument *in_args, const GIArgument *in_args,
int n_in_args, gsize n_in_args,
const GIArgument *out_args, const GIArgument *out_args,
int n_out_args, gsize n_out_args,
GIArgument *return_value, GIArgument *return_value,
GError **error) GError **error)
{ {

View File

@ -87,9 +87,9 @@ typedef enum
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean gi_function_info_invoke (GIFunctionInfo *info, gboolean gi_function_info_invoke (GIFunctionInfo *info,
const GIArgument *in_args, const GIArgument *in_args,
int n_in_args, gsize n_in_args,
const GIArgument *out_args, const GIArgument *out_args,
int n_out_args, gsize n_out_args,
GIArgument *return_value, GIArgument *return_value,
GError **error); GError **error);

View File

@ -53,7 +53,7 @@
* *
* Returns: number of prerequisites * Returns: number of prerequisites
*/ */
gint guint
gi_interface_info_get_n_prerequisites (GIInterfaceInfo *info) gi_interface_info_get_n_prerequisites (GIInterfaceInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -79,7 +79,7 @@ gi_interface_info_get_n_prerequisites (GIInterfaceInfo *info)
*/ */
GIBaseInfo * GIBaseInfo *
gi_interface_info_get_prerequisite (GIInterfaceInfo *info, gi_interface_info_get_prerequisite (GIInterfaceInfo *info,
gint n) guint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
InterfaceBlob *blob; InterfaceBlob *blob;
@ -102,7 +102,7 @@ gi_interface_info_get_prerequisite (GIInterfaceInfo *info,
* *
* Returns: number of properties * Returns: number of properties
*/ */
gint guint
gi_interface_info_get_n_properties (GIInterfaceInfo *info) gi_interface_info_get_n_properties (GIInterfaceInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -128,7 +128,7 @@ gi_interface_info_get_n_properties (GIInterfaceInfo *info)
*/ */
GIPropertyInfo * GIPropertyInfo *
gi_interface_info_get_property (GIInterfaceInfo *info, gi_interface_info_get_property (GIInterfaceInfo *info,
gint n) guint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -157,7 +157,7 @@ gi_interface_info_get_property (GIInterfaceInfo *info,
* *
* Returns: number of methods * Returns: number of methods
*/ */
gint guint
gi_interface_info_get_n_methods (GIInterfaceInfo *info) gi_interface_info_get_n_methods (GIInterfaceInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -183,7 +183,7 @@ gi_interface_info_get_n_methods (GIInterfaceInfo *info)
*/ */
GIFunctionInfo * GIFunctionInfo *
gi_interface_info_get_method (GIInterfaceInfo *info, gi_interface_info_get_method (GIInterfaceInfo *info,
gint n) guint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -240,7 +240,7 @@ gi_interface_info_find_method (GIInterfaceInfo *info,
* *
* Returns: number of signals * Returns: number of signals
*/ */
gint guint
gi_interface_info_get_n_signals (GIInterfaceInfo *info) gi_interface_info_get_n_signals (GIInterfaceInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -266,7 +266,7 @@ gi_interface_info_get_n_signals (GIInterfaceInfo *info)
*/ */
GISignalInfo * GISignalInfo *
gi_interface_info_get_signal (GIInterfaceInfo *info, gi_interface_info_get_signal (GIInterfaceInfo *info,
gint n) guint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -304,11 +304,10 @@ GISignalInfo *
gi_interface_info_find_signal (GIInterfaceInfo *info, gi_interface_info_find_signal (GIInterfaceInfo *info,
const gchar *name) const gchar *name)
{ {
gint n_signals; guint n_signals;
gint i;
n_signals = gi_interface_info_get_n_signals (info); n_signals = gi_interface_info_get_n_signals (info);
for (i = 0; i < n_signals; i++) for (guint i = 0; i < n_signals; i++)
{ {
GISignalInfo *siginfo = gi_interface_info_get_signal (info, i); GISignalInfo *siginfo = gi_interface_info_get_signal (info, i);
@ -331,7 +330,7 @@ gi_interface_info_find_signal (GIInterfaceInfo *info,
* *
* Returns: number of virtual functions * Returns: number of virtual functions
*/ */
gint guint
gi_interface_info_get_n_vfuncs (GIInterfaceInfo *info) gi_interface_info_get_n_vfuncs (GIInterfaceInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -357,7 +356,7 @@ gi_interface_info_get_n_vfuncs (GIInterfaceInfo *info)
*/ */
GIVFuncInfo * GIVFuncInfo *
gi_interface_info_get_vfunc (GIInterfaceInfo *info, gi_interface_info_get_vfunc (GIInterfaceInfo *info,
gint n) guint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -424,7 +423,7 @@ gi_interface_info_find_vfunc (GIInterfaceInfo *info,
* *
* Returns: number of constants * Returns: number of constants
*/ */
gint guint
gi_interface_info_get_n_constants (GIInterfaceInfo *info) gi_interface_info_get_n_constants (GIInterfaceInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -450,7 +449,7 @@ gi_interface_info_get_n_constants (GIInterfaceInfo *info)
*/ */
GIConstantInfo * GIConstantInfo *
gi_interface_info_get_constant (GIInterfaceInfo *info, gi_interface_info_get_constant (GIInterfaceInfo *info,
gint n) guint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;

View File

@ -43,58 +43,58 @@ G_BEGIN_DECLS
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_interface_info_get_n_prerequisites (GIInterfaceInfo *info); guint gi_interface_info_get_n_prerequisites (GIInterfaceInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIBaseInfo * gi_interface_info_get_prerequisite (GIInterfaceInfo *info, GIBaseInfo * gi_interface_info_get_prerequisite (GIInterfaceInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_interface_info_get_n_properties (GIInterfaceInfo *info); guint gi_interface_info_get_n_properties (GIInterfaceInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIPropertyInfo * gi_interface_info_get_property (GIInterfaceInfo *info, GIPropertyInfo * gi_interface_info_get_property (GIInterfaceInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_interface_info_get_n_methods (GIInterfaceInfo *info); guint gi_interface_info_get_n_methods (GIInterfaceInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFunctionInfo * gi_interface_info_get_method (GIInterfaceInfo *info, GIFunctionInfo * gi_interface_info_get_method (GIInterfaceInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFunctionInfo * gi_interface_info_find_method (GIInterfaceInfo *info, GIFunctionInfo * gi_interface_info_find_method (GIInterfaceInfo *info,
const gchar *name); const gchar *name);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_interface_info_get_n_signals (GIInterfaceInfo *info); guint gi_interface_info_get_n_signals (GIInterfaceInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GISignalInfo * gi_interface_info_get_signal (GIInterfaceInfo *info, GISignalInfo * gi_interface_info_get_signal (GIInterfaceInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GISignalInfo * gi_interface_info_find_signal (GIInterfaceInfo *info, GISignalInfo * gi_interface_info_find_signal (GIInterfaceInfo *info,
const gchar *name); const gchar *name);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_interface_info_get_n_vfuncs (GIInterfaceInfo *info); guint gi_interface_info_get_n_vfuncs (GIInterfaceInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIVFuncInfo * gi_interface_info_get_vfunc (GIInterfaceInfo *info, GIVFuncInfo * gi_interface_info_get_vfunc (GIInterfaceInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIVFuncInfo * gi_interface_info_find_vfunc (GIInterfaceInfo *info, GIVFuncInfo * gi_interface_info_find_vfunc (GIInterfaceInfo *info,
const gchar *name); const gchar *name);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_interface_info_get_n_constants (GIInterfaceInfo *info); guint gi_interface_info_get_n_constants (GIInterfaceInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIConstantInfo * gi_interface_info_get_constant (GIInterfaceInfo *info, GIConstantInfo * gi_interface_info_get_constant (GIInterfaceInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL

View File

@ -60,19 +60,18 @@
*/ */
static gint32 static gint32
gi_object_info_get_field_offset (GIObjectInfo *info, gi_object_info_get_field_offset (GIObjectInfo *info,
gint n) guint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
Header *header = (Header *)rinfo->typelib->data; Header *header = (Header *)rinfo->typelib->data;
ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; ObjectBlob *blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
guint32 offset; guint32 offset;
gint i;
FieldBlob *field_blob; FieldBlob *field_blob;
offset = rinfo->offset + header->object_blob_size offset = rinfo->offset + header->object_blob_size
+ (blob->n_interfaces + blob->n_interfaces % 2) * 2; + (blob->n_interfaces + blob->n_interfaces % 2) * 2;
for (i = 0; i < n; i++) for (guint i = 0; i < n; i++)
{ {
field_blob = (FieldBlob *)&rinfo->typelib->data[offset]; field_blob = (FieldBlob *)&rinfo->typelib->data[offset];
offset += header->field_blob_size; offset += header->field_blob_size;
@ -204,7 +203,7 @@ gi_object_info_get_type_name (GIObjectInfo *info)
} }
/** /**
* gi_object_info_get_type_init: * gi_object_info_get_type_init_function_name:
* @info: a #GIObjectInfo * @info: a #GIObjectInfo
* *
* Obtain the function which when called will return the GType * Obtain the function which when called will return the GType
@ -213,7 +212,7 @@ gi_object_info_get_type_name (GIObjectInfo *info)
* Returns: the type init function * Returns: the type init function
*/ */
const gchar * const gchar *
gi_object_info_get_type_init (GIObjectInfo *info) gi_object_info_get_type_init_function_name (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; ObjectBlob *blob;
@ -234,7 +233,7 @@ gi_object_info_get_type_init (GIObjectInfo *info)
* *
* Returns: number of interfaces * Returns: number of interfaces
*/ */
gint guint
gi_object_info_get_n_interfaces (GIObjectInfo *info) gi_object_info_get_n_interfaces (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -260,7 +259,7 @@ gi_object_info_get_n_interfaces (GIObjectInfo *info)
*/ */
GIInterfaceInfo * GIInterfaceInfo *
gi_object_info_get_interface (GIObjectInfo *info, gi_object_info_get_interface (GIObjectInfo *info,
gint n) guint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; ObjectBlob *blob;
@ -282,7 +281,7 @@ gi_object_info_get_interface (GIObjectInfo *info,
* *
* Returns: number of fields * Returns: number of fields
*/ */
gint guint
gi_object_info_get_n_fields (GIObjectInfo *info) gi_object_info_get_n_fields (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -308,7 +307,7 @@ gi_object_info_get_n_fields (GIObjectInfo *info)
*/ */
GIFieldInfo * GIFieldInfo *
gi_object_info_get_field (GIObjectInfo *info, gi_object_info_get_field (GIObjectInfo *info,
gint n) guint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -329,7 +328,7 @@ gi_object_info_get_field (GIObjectInfo *info,
* *
* Returns: number of properties * Returns: number of properties
*/ */
gint guint
gi_object_info_get_n_properties (GIObjectInfo *info) gi_object_info_get_n_properties (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -354,7 +353,7 @@ gi_object_info_get_n_properties (GIObjectInfo *info)
*/ */
GIPropertyInfo * GIPropertyInfo *
gi_object_info_get_property (GIObjectInfo *info, gi_object_info_get_property (GIObjectInfo *info,
gint n) guint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -385,7 +384,7 @@ gi_object_info_get_property (GIObjectInfo *info,
* *
* Returns: number of methods * Returns: number of methods
*/ */
gint guint
gi_object_info_get_n_methods (GIObjectInfo *info) gi_object_info_get_n_methods (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -411,7 +410,7 @@ gi_object_info_get_n_methods (GIObjectInfo *info)
*/ */
GIFunctionInfo * GIFunctionInfo *
gi_object_info_get_method (GIObjectInfo *info, gi_object_info_get_method (GIObjectInfo *info,
gint n) guint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -536,7 +535,7 @@ gi_object_info_find_method_using_interfaces (GIObjectInfo *info,
* *
* Returns: number of signals * Returns: number of signals
*/ */
gint guint
gi_object_info_get_n_signals (GIObjectInfo *info) gi_object_info_get_n_signals (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -562,7 +561,7 @@ gi_object_info_get_n_signals (GIObjectInfo *info)
*/ */
GISignalInfo * GISignalInfo *
gi_object_info_get_signal (GIObjectInfo *info, gi_object_info_get_signal (GIObjectInfo *info,
gint n) guint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -600,11 +599,10 @@ GISignalInfo *
gi_object_info_find_signal (GIObjectInfo *info, gi_object_info_find_signal (GIObjectInfo *info,
const gchar *name) const gchar *name)
{ {
gint n_signals; guint n_signals;
gint i;
n_signals = gi_object_info_get_n_signals (info); n_signals = gi_object_info_get_n_signals (info);
for (i = 0; i < n_signals; i++) for (guint i = 0; i < n_signals; i++)
{ {
GISignalInfo *siginfo = gi_object_info_get_signal (info, i); GISignalInfo *siginfo = gi_object_info_get_signal (info, i);
@ -628,7 +626,7 @@ gi_object_info_find_signal (GIObjectInfo *info,
* *
* Returns: number of virtual functions * Returns: number of virtual functions
*/ */
gint guint
gi_object_info_get_n_vfuncs (GIObjectInfo *info) gi_object_info_get_n_vfuncs (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -654,7 +652,7 @@ gi_object_info_get_n_vfuncs (GIObjectInfo *info)
*/ */
GIVFuncInfo * GIVFuncInfo *
gi_object_info_get_vfunc (GIObjectInfo *info, gi_object_info_get_vfunc (GIObjectInfo *info,
gint n) guint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -790,7 +788,7 @@ gi_object_info_find_vfunc_using_interfaces (GIObjectInfo *info,
* *
* Returns: number of constants * Returns: number of constants
*/ */
gint guint
gi_object_info_get_n_constants (GIObjectInfo *info) gi_object_info_get_n_constants (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -816,7 +814,7 @@ gi_object_info_get_n_constants (GIObjectInfo *info)
*/ */
GIConstantInfo * GIConstantInfo *
gi_object_info_get_constant (GIObjectInfo *info, gi_object_info_get_constant (GIObjectInfo *info,
gint n) guint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -906,18 +904,18 @@ _get_func(GIObjectInfo *info,
} }
/** /**
* gi_object_info_get_ref_function: * gi_object_info_get_ref_function_name:
* @info: a #GIObjectInfo * @info: a #GIObjectInfo
* *
* Obtain the symbol name of the function that should be called to ref this * Obtain the symbol name of the function that should be called to ref this
* object type. It's mainly used fundamental types. The type signature for * object type. It's mainly used fundamental types. The type signature for
* the symbol is %GIObjectInfoRefFunction, to fetch the function pointer * the symbol is %GIObjectInfoRefFunction, to fetch the function pointer
* see gi_object_info_get_ref_function(). * see gi_object_info_get_ref_function_name().
* *
* Returns: (nullable): the symbol or %NULL * Returns: (nullable): the symbol or %NULL
*/ */
const char * const char *
gi_object_info_get_ref_function (GIObjectInfo *info) gi_object_info_get_ref_function_name (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; ObjectBlob *blob;
@ -950,22 +948,22 @@ gi_object_info_get_ref_function_pointer (GIObjectInfo *info)
g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (info != NULL, NULL);
g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL); g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL);
return (GIObjectInfoRefFunction)_get_func(info, (SymbolGetter)gi_object_info_get_ref_function); return (GIObjectInfoRefFunction)_get_func(info, (SymbolGetter)gi_object_info_get_ref_function_name);
} }
/** /**
* gi_object_info_get_unref_function: * gi_object_info_get_unref_function_name:
* @info: a #GIObjectInfo * @info: a #GIObjectInfo
* *
* Obtain the symbol name of the function that should be called to unref this * Obtain the symbol name of the function that should be called to unref this
* object type. It's mainly used fundamental types. The type signature for * object type. It's mainly used fundamental types. The type signature for
* the symbol is %GIObjectInfoUnrefFunction, to fetch the function pointer * the symbol is %GIObjectInfoUnrefFunction, to fetch the function pointer
* see gi_object_info_get_unref_function(). * see gi_object_info_get_unref_function_name().
* *
* Returns: (nullable): the symbol or %NULL * Returns: (nullable): the symbol or %NULL
*/ */
const char * const char *
gi_object_info_get_unref_function (GIObjectInfo *info) gi_object_info_get_unref_function_name (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; ObjectBlob *blob;
@ -998,23 +996,23 @@ gi_object_info_get_unref_function_pointer (GIObjectInfo *info)
g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (info != NULL, NULL);
g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL); g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL);
return (GIObjectInfoUnrefFunction)_get_func(info, (SymbolGetter)gi_object_info_get_unref_function); return (GIObjectInfoUnrefFunction)_get_func(info, (SymbolGetter)gi_object_info_get_unref_function_name);
} }
/** /**
* gi_object_info_get_set_value_function: * gi_object_info_get_set_value_function_name:
* @info: a #GIObjectInfo * @info: a #GIObjectInfo
* *
* Obtain the symbol name of the function that should be called to convert * Obtain the symbol name of the function that should be called to convert
* set a GValue giving an object instance pointer of this object type. * set a GValue giving an object instance pointer of this object type.
* I's mainly used fundamental types. The type signature for the symbol * I's mainly used fundamental types. The type signature for the symbol
* is %GIObjectInfoSetValueFunction, to fetch the function pointer * is %GIObjectInfoSetValueFunction, to fetch the function pointer
* see gi_object_info_get_set_value_function(). * see gi_object_info_get_set_value_function_name().
* *
* Returns: (nullable): the symbol or %NULL * Returns: (nullable): the symbol or %NULL
*/ */
const char * const char *
gi_object_info_get_set_value_function (GIObjectInfo *info) gi_object_info_get_set_value_function_name (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; ObjectBlob *blob;
@ -1047,23 +1045,23 @@ gi_object_info_get_set_value_function_pointer (GIObjectInfo *info)
g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (info != NULL, NULL);
g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL); g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL);
return (GIObjectInfoSetValueFunction)_get_func(info, (SymbolGetter)gi_object_info_get_set_value_function); return (GIObjectInfoSetValueFunction)_get_func(info, (SymbolGetter)gi_object_info_get_set_value_function_name);
} }
/** /**
* gi_object_info_get_get_value_function: * gi_object_info_get_get_value_function_name:
* @info: a #GIObjectInfo * @info: a #GIObjectInfo
* *
* Obtain the symbol name of the function that should be called to convert * Obtain the symbol name of the function that should be called to convert
* an object instance pointer of this object type to a GValue. * an object instance pointer of this object type to a GValue.
* I's mainly used fundamental types. The type signature for the symbol * I's mainly used fundamental types. The type signature for the symbol
* is %GIObjectInfoGetValueFunction, to fetch the function pointer * is %GIObjectInfoGetValueFunction, to fetch the function pointer
* see gi_object_info_get_get_value_function(). * see gi_object_info_get_get_value_function_name().
* *
* Returns: (nullable): the symbol or %NULL * Returns: (nullable): the symbol or %NULL
*/ */
const char * const char *
gi_object_info_get_get_value_function (GIObjectInfo *info) gi_object_info_get_get_value_function_name (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; ObjectBlob *blob;
@ -1096,7 +1094,7 @@ gi_object_info_get_get_value_function_pointer (GIObjectInfo *info)
g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (info != NULL, NULL);
g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL); g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL);
return (GIObjectInfoGetValueFunction)_get_func(info, (SymbolGetter)gi_object_info_get_get_value_function); return (GIObjectInfoGetValueFunction)_get_func(info, (SymbolGetter)gi_object_info_get_get_value_function_name);
} }
void void

View File

@ -83,7 +83,7 @@ GI_AVAILABLE_IN_ALL
const gchar * gi_object_info_get_type_name (GIObjectInfo *info); const gchar * gi_object_info_get_type_name (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
const gchar * gi_object_info_get_type_init (GIObjectInfo *info); const gchar * gi_object_info_get_type_init_function_name (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean gi_object_info_get_abstract (GIObjectInfo *info); gboolean gi_object_info_get_abstract (GIObjectInfo *info);
@ -98,32 +98,32 @@ GI_AVAILABLE_IN_ALL
GIObjectInfo * gi_object_info_get_parent (GIObjectInfo *info); GIObjectInfo * gi_object_info_get_parent (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_object_info_get_n_interfaces (GIObjectInfo *info); guint gi_object_info_get_n_interfaces (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIInterfaceInfo * gi_object_info_get_interface (GIObjectInfo *info, GIInterfaceInfo * gi_object_info_get_interface (GIObjectInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_object_info_get_n_fields (GIObjectInfo *info); guint gi_object_info_get_n_fields (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFieldInfo * gi_object_info_get_field (GIObjectInfo *info, GIFieldInfo * gi_object_info_get_field (GIObjectInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_object_info_get_n_properties (GIObjectInfo *info); guint gi_object_info_get_n_properties (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIPropertyInfo * gi_object_info_get_property (GIObjectInfo *info, GIPropertyInfo * gi_object_info_get_property (GIObjectInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_object_info_get_n_methods (GIObjectInfo *info); guint gi_object_info_get_n_methods (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFunctionInfo * gi_object_info_get_method (GIObjectInfo *info, GIFunctionInfo * gi_object_info_get_method (GIObjectInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFunctionInfo * gi_object_info_find_method (GIObjectInfo *info, GIFunctionInfo * gi_object_info_find_method (GIObjectInfo *info,
@ -137,11 +137,11 @@ GIFunctionInfo * gi_object_info_find_method_using_interfaces (GIObjectInfo *in
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_object_info_get_n_signals (GIObjectInfo *info); guint gi_object_info_get_n_signals (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GISignalInfo * gi_object_info_get_signal (GIObjectInfo *info, GISignalInfo * gi_object_info_get_signal (GIObjectInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
@ -150,11 +150,11 @@ GISignalInfo * gi_object_info_find_signal (GIObjectInfo *info,
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_object_info_get_n_vfuncs (GIObjectInfo *info); guint gi_object_info_get_n_vfuncs (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIVFuncInfo * gi_object_info_get_vfunc (GIObjectInfo *info, GIVFuncInfo * gi_object_info_get_vfunc (GIObjectInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIVFuncInfo * gi_object_info_find_vfunc (GIObjectInfo *info, GIVFuncInfo * gi_object_info_find_vfunc (GIObjectInfo *info,
@ -166,39 +166,39 @@ GIVFuncInfo * gi_object_info_find_vfunc_using_interfaces (GIObjectInfo *inf
GIObjectInfo **implementor); GIObjectInfo **implementor);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_object_info_get_n_constants (GIObjectInfo *info); guint gi_object_info_get_n_constants (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIConstantInfo * gi_object_info_get_constant (GIObjectInfo *info, GIConstantInfo * gi_object_info_get_constant (GIObjectInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIStructInfo * gi_object_info_get_class_struct (GIObjectInfo *info); GIStructInfo * gi_object_info_get_class_struct (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
const char * gi_object_info_get_ref_function (GIObjectInfo *info); const char * gi_object_info_get_ref_function_name (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIObjectInfoRefFunction gi_object_info_get_ref_function_pointer (GIObjectInfo *info); GIObjectInfoRefFunction gi_object_info_get_ref_function_pointer (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
const char * gi_object_info_get_unref_function (GIObjectInfo *info); const char * gi_object_info_get_unref_function_name (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIObjectInfoUnrefFunction gi_object_info_get_unref_function_pointer (GIObjectInfo *info); GIObjectInfoUnrefFunction gi_object_info_get_unref_function_pointer (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
const char * gi_object_info_get_set_value_function (GIObjectInfo *info); const char * gi_object_info_get_set_value_function_name (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIObjectInfoSetValueFunction gi_object_info_get_set_value_function_pointer (GIObjectInfo *info); GIObjectInfoSetValueFunction gi_object_info_get_set_value_function_pointer (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
const char * gi_object_info_get_get_value_function (GIObjectInfo *info); const char * gi_object_info_get_get_value_function_name (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIObjectInfoGetValueFunction gi_object_info_get_get_value_function_pointer (GIObjectInfo *info); GIObjectInfoGetValueFunction gi_object_info_get_get_value_function_pointer (GIObjectInfo *info);

View File

@ -78,7 +78,7 @@ gi_registered_type_info_get_type_name (GIRegisteredTypeInfo *info)
} }
/** /**
* gi_registered_type_info_get_type_init: * gi_registered_type_info_get_type_init_function_name:
* @info: a #GIRegisteredTypeInfo * @info: a #GIRegisteredTypeInfo
* *
* Obtain the type init function for @info. The type init function is the * Obtain the type init function for @info. The type init function is the
@ -90,7 +90,7 @@ gi_registered_type_info_get_type_name (GIRegisteredTypeInfo *info)
* passing into g_module_symbol(). * passing into g_module_symbol().
*/ */
const gchar * const gchar *
gi_registered_type_info_get_type_init (GIRegisteredTypeInfo *info) gi_registered_type_info_get_type_init_function_name (GIRegisteredTypeInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
RegisteredTypeBlob *blob; RegisteredTypeBlob *blob;
@ -127,7 +127,7 @@ gi_registered_type_info_get_g_type (GIRegisteredTypeInfo *info)
g_return_val_if_fail (info != NULL, G_TYPE_INVALID); g_return_val_if_fail (info != NULL, G_TYPE_INVALID);
g_return_val_if_fail (GI_IS_REGISTERED_TYPE_INFO (info), G_TYPE_INVALID); g_return_val_if_fail (GI_IS_REGISTERED_TYPE_INFO (info), G_TYPE_INVALID);
type_init = gi_registered_type_info_get_type_init (info); type_init = gi_registered_type_info_get_type_init_function_name (info);
if (type_init == NULL) if (type_init == NULL)
return G_TYPE_NONE; return G_TYPE_NONE;

View File

@ -53,7 +53,7 @@ GI_AVAILABLE_IN_ALL
const gchar * gi_registered_type_info_get_type_name (GIRegisteredTypeInfo *info); const gchar * gi_registered_type_info_get_type_name (GIRegisteredTypeInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
const gchar * gi_registered_type_info_get_type_init (GIRegisteredTypeInfo *info); const gchar * gi_registered_type_info_get_type_init_function_name (GIRegisteredTypeInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GType gi_registered_type_info_get_g_type (GIRegisteredTypeInfo *info); GType gi_registered_type_info_get_g_type (GIRegisteredTypeInfo *info);

View File

@ -238,10 +238,10 @@ void gi_type_info_init (GIBaseInfo *info,
GIFunctionInfo * gi_base_info_find_method (GIBaseInfo *base, GIFunctionInfo * gi_base_info_find_method (GIBaseInfo *base,
guint32 offset, guint32 offset,
gint n_methods, guint n_methods,
const gchar *name); const gchar *name);
GIVFuncInfo * gi_base_info_find_vfunc (GIRealInfo *rinfo, GIVFuncInfo * gi_base_info_find_vfunc (GIRealInfo *rinfo,
guint32 offset, guint32 offset,
gint n_vfuncs, guint n_vfuncs,
const gchar *name); const gchar *name);

View File

@ -719,12 +719,12 @@ gi_repository_new (void)
* *
* Returns: number of metadata entries * Returns: number of metadata entries
*/ */
gint guint
gi_repository_get_n_infos (GIRepository *repository, gi_repository_get_n_infos (GIRepository *repository,
const gchar *namespace) const gchar *namespace)
{ {
GITypelib *typelib; GITypelib *typelib;
gint n_interfaces = 0; guint n_interfaces = 0;
g_return_val_if_fail (namespace != NULL, -1); g_return_val_if_fail (namespace != NULL, -1);
@ -744,7 +744,7 @@ gi_repository_get_n_infos (GIRepository *repository,
* @repository: (allow-none): A #GIRepository or %NULL for the singleton * @repository: (allow-none): A #GIRepository or %NULL for the singleton
* process-global default #GIRepository * process-global default #GIRepository
* @namespace_: Namespace to inspect * @namespace_: Namespace to inspect
* @index: 0-based offset into namespace metadata for entry * @idx: 0-based offset into namespace metadata for entry
* *
* This function returns a particular metadata entry in the * This function returns a particular metadata entry in the
* given namespace @namespace_. The namespace must have * given namespace @namespace_. The namespace must have
@ -757,7 +757,7 @@ gi_repository_get_n_infos (GIRepository *repository,
GIBaseInfo * GIBaseInfo *
gi_repository_get_info (GIRepository *repository, gi_repository_get_info (GIRepository *repository,
const gchar *namespace, const gchar *namespace,
gint index) guint idx)
{ {
GITypelib *typelib; GITypelib *typelib;
DirEntry *entry; DirEntry *entry;
@ -770,7 +770,7 @@ gi_repository_get_info (GIRepository *repository,
g_return_val_if_fail (typelib != NULL, NULL); g_return_val_if_fail (typelib != NULL, NULL);
entry = gi_typelib_get_dir_entry (typelib, index + 1); entry = gi_typelib_get_dir_entry (typelib, idx + 1);
if (entry == NULL) if (entry == NULL)
return NULL; return NULL;
return gi_info_new_full (entry->blob_type, return gi_info_new_full (entry->blob_type,
@ -1026,7 +1026,7 @@ gi_repository_find_by_error_domain (GIRepository *repository,
void void
gi_repository_get_object_gtype_interfaces (GIRepository *repository, gi_repository_get_object_gtype_interfaces (GIRepository *repository,
GType gtype, GType gtype,
guint *n_interfaces_out, gsize *n_interfaces_out,
GIInterfaceInfo ***interfaces_out) GIInterfaceInfo ***interfaces_out)
{ {
GTypeInterfaceCache *cache; GTypeInterfaceCache *cache;
@ -1740,8 +1740,11 @@ gi_repository_introspect_cb (const char *option_name,
GError **error) GError **error)
{ {
GError *tmp_error = NULL; GError *tmp_error = NULL;
gboolean ret = gi_repository_dump (value, &tmp_error); char **args;
if (!ret)
args = g_strsplit (value, ",", 2);
if (!gi_repository_dump (args[0], args[1], &tmp_error))
{ {
g_error ("Failed to extract GType data: %s", g_error ("Failed to extract GType data: %s",
tmp_error->message); tmp_error->message);

View File

@ -168,17 +168,17 @@ GIBaseInfo * gi_repository_find_by_gtype (GIRepository *repository,
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
void gi_repository_get_object_gtype_interfaces (GIRepository *repository, void gi_repository_get_object_gtype_interfaces (GIRepository *repository,
GType gtype, GType gtype,
guint *n_interfaces_out, gsize *n_interfaces_out,
GIInterfaceInfo ***interfaces_out); GIInterfaceInfo ***interfaces_out);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_repository_get_n_infos (GIRepository *repository, guint gi_repository_get_n_infos (GIRepository *repository,
const gchar *namespace_); const gchar *namespace_);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIBaseInfo * gi_repository_get_info (GIRepository *repository, GIBaseInfo * gi_repository_get_info (GIRepository *repository,
const gchar *namespace_, const gchar *namespace_,
gint index); guint idx);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIEnumInfo * gi_repository_find_by_error_domain (GIRepository *repository, GIEnumInfo * gi_repository_find_by_error_domain (GIRepository *repository,
@ -203,7 +203,9 @@ GOptionGroup * gi_repository_get_option_group (void);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean gi_repository_dump (const char *arg, GError **error); gboolean gi_repository_dump (const char *input_filename,
const char *output_filename,
GError **error);
/** /**
* GIRepositoryError: * GIRepositoryError:

View File

@ -244,7 +244,8 @@ write_type_info (const gchar *ns,
} }
else if (tag == GI_TYPE_TAG_ARRAY) else if (tag == GI_TYPE_TAG_ARRAY)
{ {
gint length, size; gint length;
gssize size;
const char *name = NULL; const char *name = NULL;
xml_start_element (file, "array"); xml_start_element (file, "array");
@ -270,13 +271,13 @@ write_type_info (const gchar *ns,
type = gi_type_info_get_param_type (info, 0); type = gi_type_info_get_param_type (info, 0);
length = gi_type_info_get_array_length (info); length = gi_type_info_get_array_length_index (info);
if (length >= 0) if (length >= 0)
xml_printf (file, " length=\"%d\"", length); xml_printf (file, " length=\"%d\"", length);
size = gi_type_info_get_array_fixed_size (info); size = gi_type_info_get_array_fixed_size (info);
if (size >= 0) if (size >= 0)
xml_printf (file, " fixed-size=\"%d\"", size); xml_printf (file, " fixed-size=\"%" G_GSSIZE_FORMAT "\"", size);
if (gi_type_info_is_zero_terminated (info)) if (gi_type_info_is_zero_terminated (info))
xml_printf (file, " zero-terminated=\"1\""); xml_printf (file, " zero-terminated=\"1\"");
@ -352,7 +353,7 @@ write_attributes (Xml *file,
GIBaseInfo *info) GIBaseInfo *info)
{ {
GIAttributeIter iter = { 0, }; GIAttributeIter iter = { 0, };
char *name, *value; const char *name, *value;
while (gi_base_info_iterate_attributes (info, &iter, &name, &value)) while (gi_base_info_iterate_attributes (info, &iter, &name, &value))
{ {
@ -367,7 +368,7 @@ write_return_value_attributes (Xml *file,
GICallableInfo *info) GICallableInfo *info)
{ {
GIAttributeIter iter = { 0, }; GIAttributeIter iter = { 0, };
char *name, *value; const char *name, *value;
while (gi_callable_info_iterate_return_attributes (info, &iter, &name, &value)) while (gi_callable_info_iterate_return_attributes (info, &iter, &name, &value))
{ {
@ -461,7 +462,6 @@ write_callable_info (const gchar *ns,
Xml *file) Xml *file)
{ {
GITypeInfo *type; GITypeInfo *type;
gint i;
if (gi_callable_info_can_throw_gerror (info)) if (gi_callable_info_can_throw_gerror (info))
xml_printf (file, " throws=\"1\""); xml_printf (file, " throws=\"1\"");
@ -490,7 +490,7 @@ write_callable_info (const gchar *ns,
return; return;
xml_start_element (file, "parameters"); xml_start_element (file, "parameters");
for (i = 0; i < gi_callable_info_get_n_args (info); i++) for (guint i = 0; i < gi_callable_info_get_n_args (info); i++)
{ {
GIArgInfo *arg = gi_callable_info_get_arg (info, i); GIArgInfo *arg = gi_callable_info_get_arg (info, i);
@ -544,11 +544,11 @@ write_callable_info (const gchar *ns,
g_assert_not_reached (); g_assert_not_reached ();
} }
if (gi_arg_info_get_closure (arg) >= 0) if (gi_arg_info_get_closure_index (arg) >= 0)
xml_printf (file, " closure=\"%d\"", gi_arg_info_get_closure (arg)); xml_printf (file, " closure=\"%d\"", gi_arg_info_get_closure_index (arg));
if (gi_arg_info_get_destroy (arg) >= 0) if (gi_arg_info_get_destroy_index (arg) >= 0)
xml_printf (file, " destroy=\"%d\"", gi_arg_info_get_destroy (arg)); xml_printf (file, " destroy=\"%d\"", gi_arg_info_get_destroy_index (arg));
if (gi_arg_info_is_skip (arg)) if (gi_arg_info_is_skip (arg))
xml_printf (file, " skip=\"1\""); xml_printf (file, " skip=\"1\"");
@ -651,15 +651,14 @@ write_struct_info (const gchar *ns,
gboolean deprecated; gboolean deprecated;
gboolean is_gtype_struct; gboolean is_gtype_struct;
gboolean foreign; gboolean foreign;
gint i;
gint size; gint size;
int n_elts; guint n_elts;
name = gi_base_info_get_name ((GIBaseInfo *)info); name = gi_base_info_get_name ((GIBaseInfo *)info);
deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info); deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info);
type_name = gi_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info); type_name = gi_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
type_init = gi_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info); type_init = gi_registered_type_info_get_type_init_function_name ((GIRegisteredTypeInfo*)info);
if (gi_base_info_get_info_type ((GIBaseInfo *) info) == GI_INFO_TYPE_BOXED) if (gi_base_info_get_info_type ((GIBaseInfo *) info) == GI_INFO_TYPE_BOXED)
{ {
@ -682,11 +681,11 @@ write_struct_info (const gchar *ns,
if (is_gtype_struct) if (is_gtype_struct)
xml_printf (file, " glib:is-gtype-struct=\"1\""); xml_printf (file, " glib:is-gtype-struct=\"1\"");
func = gi_struct_info_get_copy_function (info); func = gi_struct_info_get_copy_function_name (info);
if (func) if (func)
xml_printf (file, " copy-function=\"%s\"", func); xml_printf (file, " copy-function=\"%s\"", func);
func = gi_struct_info_get_free_function (info); func = gi_struct_info_get_free_function_name (info);
if (func) if (func)
xml_printf (file, " free-function=\"%s\"", func); xml_printf (file, " free-function=\"%s\"", func);
@ -703,14 +702,14 @@ write_struct_info (const gchar *ns,
n_elts = gi_struct_info_get_n_fields (info) + gi_struct_info_get_n_methods (info); n_elts = gi_struct_info_get_n_fields (info) + gi_struct_info_get_n_methods (info);
if (n_elts > 0) if (n_elts > 0)
{ {
for (i = 0; i < gi_struct_info_get_n_fields (info); i++) for (guint i = 0; i < gi_struct_info_get_n_fields (info); i++)
{ {
GIFieldInfo *field = gi_struct_info_get_field (info, i); GIFieldInfo *field = gi_struct_info_get_field (info, i);
write_field_info (ns, field, NULL, file); write_field_info (ns, field, NULL, file);
gi_base_info_unref ((GIBaseInfo *)field); gi_base_info_unref ((GIBaseInfo *)field);
} }
for (i = 0; i < gi_struct_info_get_n_methods (info); i++) for (guint i = 0; i < gi_struct_info_get_n_methods (info); i++)
{ {
GIFunctionInfo *function = gi_struct_info_get_method (info, i); GIFunctionInfo *function = gi_struct_info_get_method (info, i);
write_function_info (ns, function, file); write_function_info (ns, function, file);
@ -840,13 +839,12 @@ write_enum_info (const gchar *ns,
const gchar *type_init; const gchar *type_init;
const gchar *error_domain; const gchar *error_domain;
gboolean deprecated; gboolean deprecated;
gint i;
name = gi_base_info_get_name ((GIBaseInfo *)info); name = gi_base_info_get_name ((GIBaseInfo *)info);
deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info); deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info);
type_name = gi_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info); type_name = gi_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
type_init = gi_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info); type_init = gi_registered_type_info_get_type_init_function_name ((GIRegisteredTypeInfo*)info);
error_domain = gi_enum_info_get_error_domain (info); error_domain = gi_enum_info_get_error_domain (info);
if (gi_base_info_get_info_type ((GIBaseInfo *) info) == GI_INFO_TYPE_ENUM) if (gi_base_info_get_info_type ((GIBaseInfo *) info) == GI_INFO_TYPE_ENUM)
@ -865,7 +863,7 @@ write_enum_info (const gchar *ns,
write_attributes (file, (GIBaseInfo*) info); write_attributes (file, (GIBaseInfo*) info);
for (i = 0; i < gi_enum_info_get_n_values (info); i++) for (guint i = 0; i < gi_enum_info_get_n_values (info); i++)
{ {
GIValueInfo *value = gi_enum_info_get_value (info, i); GIValueInfo *value = gi_enum_info_get_value (info, i);
write_value_info (ns, value, file); write_value_info (ns, value, file);
@ -1042,7 +1040,6 @@ write_object_info (const gchar *ns,
gboolean is_final; gboolean is_final;
GIObjectInfo *pnode; GIObjectInfo *pnode;
GIStructInfo *class_struct; GIStructInfo *class_struct;
gint i;
name = gi_base_info_get_name ((GIBaseInfo *)info); name = gi_base_info_get_name ((GIBaseInfo *)info);
deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info); deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info);
@ -1051,7 +1048,7 @@ write_object_info (const gchar *ns,
is_final = gi_object_info_get_final (info); is_final = gi_object_info_get_final (info);
type_name = gi_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info); type_name = gi_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
type_init = gi_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info); type_init = gi_registered_type_info_get_type_init_function_name ((GIRegisteredTypeInfo*)info);
xml_start_element (file, "class"); xml_start_element (file, "class");
xml_printf (file, " name=\"%s\"", name); xml_printf (file, " name=\"%s\"", name);
@ -1080,19 +1077,19 @@ write_object_info (const gchar *ns,
if (is_fundamental) if (is_fundamental)
xml_printf (file, " glib:fundamental=\"1\""); xml_printf (file, " glib:fundamental=\"1\"");
func = gi_object_info_get_unref_function (info); func = gi_object_info_get_unref_function_name (info);
if (func) if (func)
xml_printf (file, " glib:unref-function=\"%s\"", func); xml_printf (file, " glib:unref-function=\"%s\"", func);
func = gi_object_info_get_ref_function (info); func = gi_object_info_get_ref_function_name (info);
if (func) if (func)
xml_printf (file, " glib:ref-function=\"%s\"", func); xml_printf (file, " glib:ref-function=\"%s\"", func);
func = gi_object_info_get_set_value_function (info); func = gi_object_info_get_set_value_function_name (info);
if (func) if (func)
xml_printf (file, " glib:set-value-function=\"%s\"", func); xml_printf (file, " glib:set-value-function=\"%s\"", func);
func = gi_object_info_get_get_value_function (info); func = gi_object_info_get_get_value_function_name (info);
if (func) if (func)
xml_printf (file, " glib:get-value-function=\"%s\"", func); xml_printf (file, " glib:get-value-function=\"%s\"", func);
@ -1103,7 +1100,7 @@ write_object_info (const gchar *ns,
if (gi_object_info_get_n_interfaces (info) > 0) if (gi_object_info_get_n_interfaces (info) > 0)
{ {
for (i = 0; i < gi_object_info_get_n_interfaces (info); i++) for (guint i = 0; i < gi_object_info_get_n_interfaces (info); i++)
{ {
GIInterfaceInfo *imp = gi_object_info_get_interface (info, i); GIInterfaceInfo *imp = gi_object_info_get_interface (info, i);
xml_start_element (file, "implements"); xml_start_element (file, "implements");
@ -1113,42 +1110,42 @@ write_object_info (const gchar *ns,
} }
} }
for (i = 0; i < gi_object_info_get_n_fields (info); i++) for (guint i = 0; i < gi_object_info_get_n_fields (info); i++)
{ {
GIFieldInfo *field = gi_object_info_get_field (info, i); GIFieldInfo *field = gi_object_info_get_field (info, i);
write_field_info (ns, field, NULL, file); write_field_info (ns, field, NULL, file);
gi_base_info_unref ((GIBaseInfo *)field); gi_base_info_unref ((GIBaseInfo *)field);
} }
for (i = 0; i < gi_object_info_get_n_methods (info); i++) for (guint i = 0; i < gi_object_info_get_n_methods (info); i++)
{ {
GIFunctionInfo *function = gi_object_info_get_method (info, i); GIFunctionInfo *function = gi_object_info_get_method (info, i);
write_function_info (ns, function, file); write_function_info (ns, function, file);
gi_base_info_unref ((GIBaseInfo *)function); gi_base_info_unref ((GIBaseInfo *)function);
} }
for (i = 0; i < gi_object_info_get_n_properties (info); i++) for (guint i = 0; i < gi_object_info_get_n_properties (info); i++)
{ {
GIPropertyInfo *prop = gi_object_info_get_property (info, i); GIPropertyInfo *prop = gi_object_info_get_property (info, i);
write_property_info (ns, prop, file); write_property_info (ns, prop, file);
gi_base_info_unref ((GIBaseInfo *)prop); gi_base_info_unref ((GIBaseInfo *)prop);
} }
for (i = 0; i < gi_object_info_get_n_signals (info); i++) for (guint i = 0; i < gi_object_info_get_n_signals (info); i++)
{ {
GISignalInfo *signal = gi_object_info_get_signal (info, i); GISignalInfo *signal = gi_object_info_get_signal (info, i);
write_signal_info (ns, signal, file); write_signal_info (ns, signal, file);
gi_base_info_unref ((GIBaseInfo *)signal); gi_base_info_unref ((GIBaseInfo *)signal);
} }
for (i = 0; i < gi_object_info_get_n_vfuncs (info); i++) for (guint i = 0; i < gi_object_info_get_n_vfuncs (info); i++)
{ {
GIVFuncInfo *vfunc = gi_object_info_get_vfunc (info, i); GIVFuncInfo *vfunc = gi_object_info_get_vfunc (info, i);
write_vfunc_info (ns, vfunc, file); write_vfunc_info (ns, vfunc, file);
gi_base_info_unref ((GIBaseInfo *)vfunc); gi_base_info_unref ((GIBaseInfo *)vfunc);
} }
for (i = 0; i < gi_object_info_get_n_constants (info); i++) for (guint i = 0; i < gi_object_info_get_n_constants (info); i++)
{ {
GIConstantInfo *constant = gi_object_info_get_constant (info, i); GIConstantInfo *constant = gi_object_info_get_constant (info, i);
write_constant_info (ns, constant, file); write_constant_info (ns, constant, file);
@ -1168,13 +1165,12 @@ write_interface_info (const gchar *ns,
const gchar *type_init; const gchar *type_init;
GIStructInfo *class_struct; GIStructInfo *class_struct;
gboolean deprecated; gboolean deprecated;
gint i;
name = gi_base_info_get_name ((GIBaseInfo *)info); name = gi_base_info_get_name ((GIBaseInfo *)info);
deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info); deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info);
type_name = gi_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info); type_name = gi_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
type_init = gi_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info); type_init = gi_registered_type_info_get_type_init_function_name ((GIRegisteredTypeInfo*)info);
xml_start_element (file, "interface"); xml_start_element (file, "interface");
xml_printf (file, " name=\"%s\" glib:type-name=\"%s\" glib:get-type=\"%s\"", xml_printf (file, " name=\"%s\" glib:type-name=\"%s\" glib:get-type=\"%s\"",
name, type_name, type_init); name, type_name, type_init);
@ -1193,7 +1189,7 @@ write_interface_info (const gchar *ns,
if (gi_interface_info_get_n_prerequisites (info) > 0) if (gi_interface_info_get_n_prerequisites (info) > 0)
{ {
for (i = 0; i < gi_interface_info_get_n_prerequisites (info); i++) for (guint i = 0; i < gi_interface_info_get_n_prerequisites (info); i++)
{ {
GIBaseInfo *req = gi_interface_info_get_prerequisite (info, i); GIBaseInfo *req = gi_interface_info_get_prerequisite (info, i);
@ -1205,35 +1201,35 @@ write_interface_info (const gchar *ns,
} }
} }
for (i = 0; i < gi_interface_info_get_n_methods (info); i++) for (guint i = 0; i < gi_interface_info_get_n_methods (info); i++)
{ {
GIFunctionInfo *function = gi_interface_info_get_method (info, i); GIFunctionInfo *function = gi_interface_info_get_method (info, i);
write_function_info (ns, function, file); write_function_info (ns, function, file);
gi_base_info_unref ((GIBaseInfo *)function); gi_base_info_unref ((GIBaseInfo *)function);
} }
for (i = 0; i < gi_interface_info_get_n_properties (info); i++) for (guint i = 0; i < gi_interface_info_get_n_properties (info); i++)
{ {
GIPropertyInfo *prop = gi_interface_info_get_property (info, i); GIPropertyInfo *prop = gi_interface_info_get_property (info, i);
write_property_info (ns, prop, file); write_property_info (ns, prop, file);
gi_base_info_unref ((GIBaseInfo *)prop); gi_base_info_unref ((GIBaseInfo *)prop);
} }
for (i = 0; i < gi_interface_info_get_n_signals (info); i++) for (guint i = 0; i < gi_interface_info_get_n_signals (info); i++)
{ {
GISignalInfo *signal = gi_interface_info_get_signal (info, i); GISignalInfo *signal = gi_interface_info_get_signal (info, i);
write_signal_info (ns, signal, file); write_signal_info (ns, signal, file);
gi_base_info_unref ((GIBaseInfo *)signal); gi_base_info_unref ((GIBaseInfo *)signal);
} }
for (i = 0; i < gi_interface_info_get_n_vfuncs (info); i++) for (guint i = 0; i < gi_interface_info_get_n_vfuncs (info); i++)
{ {
GIVFuncInfo *vfunc = gi_interface_info_get_vfunc (info, i); GIVFuncInfo *vfunc = gi_interface_info_get_vfunc (info, i);
write_vfunc_info (ns, vfunc, file); write_vfunc_info (ns, vfunc, file);
gi_base_info_unref ((GIBaseInfo *)vfunc); gi_base_info_unref ((GIBaseInfo *)vfunc);
} }
for (i = 0; i < gi_interface_info_get_n_constants (info); i++) for (guint i = 0; i < gi_interface_info_get_n_constants (info); i++)
{ {
GIConstantInfo *constant = gi_interface_info_get_constant (info, i); GIConstantInfo *constant = gi_interface_info_get_constant (info, i);
write_constant_info (ns, constant, file); write_constant_info (ns, constant, file);
@ -1253,14 +1249,13 @@ write_union_info (const gchar *ns,
const gchar *type_init; const gchar *type_init;
const gchar *func; const gchar *func;
gboolean deprecated; gboolean deprecated;
gint i; gsize size;
gint size;
name = gi_base_info_get_name ((GIBaseInfo *)info); name = gi_base_info_get_name ((GIBaseInfo *)info);
deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info); deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info);
type_name = gi_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info); type_name = gi_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
type_init = gi_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info); type_init = gi_registered_type_info_get_type_init_function_name ((GIRegisteredTypeInfo*)info);
xml_start_element (file, "union"); xml_start_element (file, "union");
xml_printf (file, " name=\"%s\"", name); xml_printf (file, " name=\"%s\"", name);
@ -1272,14 +1267,14 @@ write_union_info (const gchar *ns,
xml_printf (file, " deprecated=\"1\""); xml_printf (file, " deprecated=\"1\"");
size = gi_union_info_get_size (info); size = gi_union_info_get_size (info);
if (file->show_all && size >= 0) if (file->show_all)
xml_printf (file, " size=\"%d\"", size); xml_printf (file, " size=\"%" G_GSIZE_FORMAT "\"", size);
func = gi_union_info_get_copy_function (info); func = gi_union_info_get_copy_function_name (info);
if (func) if (func)
xml_printf (file, " copy-function=\"%s\"", func); xml_printf (file, " copy-function=\"%s\"", func);
func = gi_union_info_get_free_function (info); func = gi_union_info_get_free_function_name (info);
if (func) if (func)
xml_printf (file, " free-function=\"%s\"", func); xml_printf (file, " free-function=\"%s\"", func);
@ -1287,7 +1282,7 @@ write_union_info (const gchar *ns,
if (gi_union_info_is_discriminated (info)) if (gi_union_info_is_discriminated (info))
{ {
gint offset; guint offset;
GITypeInfo *type; GITypeInfo *type;
offset = gi_union_info_get_discriminator_offset (info); offset = gi_union_info_get_discriminator_offset (info);
@ -1300,7 +1295,7 @@ write_union_info (const gchar *ns,
gi_base_info_unref ((GIBaseInfo *)type); gi_base_info_unref ((GIBaseInfo *)type);
} }
for (i = 0; i < gi_union_info_get_n_fields (info); i++) for (guint i = 0; i < gi_union_info_get_n_fields (info); i++)
{ {
GIFieldInfo *field = gi_union_info_get_field (info, i); GIFieldInfo *field = gi_union_info_get_field (info, i);
GIConstantInfo *constant = gi_union_info_get_discriminator (info, i); GIConstantInfo *constant = gi_union_info_get_discriminator (info, i);
@ -1310,7 +1305,7 @@ write_union_info (const gchar *ns,
gi_base_info_unref ((GIBaseInfo *)constant); gi_base_info_unref ((GIBaseInfo *)constant);
} }
for (i = 0; i < gi_union_info_get_n_methods (info); i++) for (guint i = 0; i < gi_union_info_get_n_methods (info); i++)
{ {
GIFunctionInfo *function = gi_union_info_get_method (info, i); GIFunctionInfo *function = gi_union_info_get_method (info, i);
write_function_info (ns, function, file); write_function_info (ns, function, file);

View File

@ -52,7 +52,7 @@
* *
* Returns: number of fields * Returns: number of fields
*/ */
gint guint
gi_struct_info_get_n_fields (GIStructInfo *info) gi_struct_info_get_n_fields (GIStructInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -72,15 +72,14 @@ gi_struct_info_get_n_fields (GIStructInfo *info)
*/ */
static gint32 static gint32
gi_struct_get_field_offset (GIStructInfo *info, gi_struct_get_field_offset (GIStructInfo *info,
gint n) guint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
Header *header = (Header *)rinfo->typelib->data; Header *header = (Header *)rinfo->typelib->data;
guint32 offset = rinfo->offset + header->struct_blob_size; guint32 offset = rinfo->offset + header->struct_blob_size;
gint i;
FieldBlob *field_blob; FieldBlob *field_blob;
for (i = 0; i < n; i++) for (guint i = 0; i < n; i++)
{ {
field_blob = (FieldBlob *)&rinfo->typelib->data[offset]; field_blob = (FieldBlob *)&rinfo->typelib->data[offset];
offset += header->field_blob_size; offset += header->field_blob_size;
@ -103,7 +102,7 @@ gi_struct_get_field_offset (GIStructInfo *info,
*/ */
GIFieldInfo * GIFieldInfo *
gi_struct_info_get_field (GIStructInfo *info, gi_struct_info_get_field (GIStructInfo *info,
gint n) guint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -161,7 +160,7 @@ gi_struct_info_find_field (GIStructInfo *info,
* *
* Returns: number of methods * Returns: number of methods
*/ */
gint guint
gi_struct_info_get_n_methods (GIStructInfo *info) gi_struct_info_get_n_methods (GIStructInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -182,7 +181,7 @@ gi_struct_info_get_n_methods (GIStructInfo *info)
*/ */
GIFunctionInfo * GIFunctionInfo *
gi_struct_info_get_method (GIStructInfo *info, gi_struct_info_get_method (GIStructInfo *info,
gint n) guint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
@ -287,7 +286,7 @@ gi_struct_info_is_gtype_struct (GIStructInfo *info)
} }
/** /**
* gi_struct_info_get_copy_function: * gi_struct_info_get_copy_function_name:
* @info: a struct information blob * @info: a struct information blob
* *
* Retrieves the name of the copy function for @info, if any is set. * Retrieves the name of the copy function for @info, if any is set.
@ -297,7 +296,7 @@ gi_struct_info_is_gtype_struct (GIStructInfo *info)
* Since: 2.80 * Since: 2.80
*/ */
const char * const char *
gi_struct_info_get_copy_function (GIStructInfo *info) gi_struct_info_get_copy_function_name (GIStructInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
StructBlob *blob; StructBlob *blob;
@ -314,7 +313,7 @@ gi_struct_info_get_copy_function (GIStructInfo *info)
} }
/** /**
* gi_struct_info_get_free_function: * gi_struct_info_get_free_function_name:
* @info: a struct information blob * @info: a struct information blob
* *
* Retrieves the name of the free function for @info, if any is set. * Retrieves the name of the free function for @info, if any is set.
@ -324,7 +323,7 @@ gi_struct_info_get_copy_function (GIStructInfo *info)
* Since: 2.80 * Since: 2.80
*/ */
const char * const char *
gi_struct_info_get_free_function (GIStructInfo *info) gi_struct_info_get_free_function_name (GIStructInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
StructBlob *blob; StructBlob *blob;

View File

@ -43,22 +43,22 @@ G_BEGIN_DECLS
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_struct_info_get_n_fields (GIStructInfo *info); guint gi_struct_info_get_n_fields (GIStructInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFieldInfo * gi_struct_info_get_field (GIStructInfo *info, GIFieldInfo * gi_struct_info_get_field (GIStructInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFieldInfo * gi_struct_info_find_field (GIStructInfo *info, GIFieldInfo * gi_struct_info_find_field (GIStructInfo *info,
const gchar *name); const gchar *name);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_struct_info_get_n_methods (GIStructInfo *info); guint gi_struct_info_get_n_methods (GIStructInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFunctionInfo * gi_struct_info_get_method (GIStructInfo *info, GIFunctionInfo * gi_struct_info_get_method (GIStructInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFunctionInfo * gi_struct_info_find_method (GIStructInfo *info, GIFunctionInfo * gi_struct_info_find_method (GIStructInfo *info,
@ -77,9 +77,9 @@ GI_AVAILABLE_IN_ALL
gboolean gi_struct_info_is_foreign (GIStructInfo *info); gboolean gi_struct_info_is_foreign (GIStructInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
const char * gi_struct_info_get_copy_function (GIStructInfo *info); const char * gi_struct_info_get_copy_function_name (GIStructInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
const char * gi_struct_info_get_free_function (GIStructInfo *info); const char * gi_struct_info_get_free_function_name (GIStructInfo *info);
G_END_DECLS G_END_DECLS

View File

@ -135,7 +135,7 @@ gi_type_info_get_tag (GITypeInfo *info)
*/ */
GITypeInfo * GITypeInfo *
gi_type_info_get_param_type (GITypeInfo *info, gi_type_info_get_param_type (GITypeInfo *info,
gint n) guint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
SimpleTypeBlob *type; SimpleTypeBlob *type;
@ -226,17 +226,17 @@ gi_type_info_get_interface (GITypeInfo *info)
} }
/** /**
* gi_type_info_get_array_length: * gi_type_info_get_array_length_index:
* @info: a #GITypeInfo * @info: a #GITypeInfo
* *
* Obtain the position of the argument which gives the array length of the type. * Obtain the position of the argument which gives the array length of the type.
* The type tag must be a `GI_TYPE_TAG_ARRAY` or `-1` will be returned. * The type tag must be a `GI_TYPE_TAG_ARRAY` or `-1` will be returned.
* *
* Returns: the array length, or `-1` if the type is not an array * Returns: the array length argument index, or `-1` if the type is not an array
* Since: 2.80 * Since: 2.80
*/ */
gint gint
gi_type_info_get_array_length (GITypeInfo *info) gi_type_info_get_array_length_index (GITypeInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
SimpleTypeBlob *type; SimpleTypeBlob *type;
@ -270,14 +270,14 @@ gi_type_info_get_array_length (GITypeInfo *info)
* Returns: the size or `-1` if the type is not an array * Returns: the size or `-1` if the type is not an array
* Since: 2.80 * Since: 2.80
*/ */
gint gssize
gi_type_info_get_array_fixed_size (GITypeInfo *info) gi_type_info_get_array_fixed_size (GITypeInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
SimpleTypeBlob *type; SimpleTypeBlob *type;
g_return_val_if_fail (info != NULL, 0); g_return_val_if_fail (info != NULL, -1);
g_return_val_if_fail (GI_IS_TYPE_INFO (info), 0); g_return_val_if_fail (GI_IS_TYPE_INFO (info), -1);
type = (SimpleTypeBlob *)&rinfo->typelib->data[rinfo->offset]; type = (SimpleTypeBlob *)&rinfo->typelib->data[rinfo->offset];

View File

@ -90,16 +90,16 @@ GITypeTag gi_type_info_get_tag (GITypeInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GITypeInfo * gi_type_info_get_param_type (GITypeInfo *info, GITypeInfo * gi_type_info_get_param_type (GITypeInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIBaseInfo * gi_type_info_get_interface (GITypeInfo *info); GIBaseInfo * gi_type_info_get_interface (GITypeInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_type_info_get_array_length (GITypeInfo *info); gint gi_type_info_get_array_length_index (GITypeInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_type_info_get_array_fixed_size(GITypeInfo *info); gssize gi_type_info_get_array_fixed_size (GITypeInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean gi_type_info_is_zero_terminated (GITypeInfo *info); gboolean gi_type_info_is_zero_terminated (GITypeInfo *info);

View File

@ -53,7 +53,7 @@
* Returns: number of fields * Returns: number of fields
* Since: 2.80 * Since: 2.80
*/ */
gint guint
gi_union_info_get_n_fields (GIUnionInfo *info) gi_union_info_get_n_fields (GIUnionInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -75,7 +75,7 @@ gi_union_info_get_n_fields (GIUnionInfo *info)
*/ */
GIFieldInfo * GIFieldInfo *
gi_union_info_get_field (GIUnionInfo *info, gi_union_info_get_field (GIUnionInfo *info,
gint n) guint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
Header *header = (Header *)rinfo->typelib->data; Header *header = (Header *)rinfo->typelib->data;
@ -94,7 +94,7 @@ gi_union_info_get_field (GIUnionInfo *info,
* Returns: number of methods * Returns: number of methods
* Since: 2.80 * Since: 2.80
*/ */
gint guint
gi_union_info_get_n_methods (GIUnionInfo *info) gi_union_info_get_n_methods (GIUnionInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -116,7 +116,7 @@ gi_union_info_get_n_methods (GIUnionInfo *info)
*/ */
GIFunctionInfo * GIFunctionInfo *
gi_union_info_get_method (GIUnionInfo *info, gi_union_info_get_method (GIUnionInfo *info,
gint n) guint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset];
@ -157,7 +157,7 @@ gi_union_info_is_discriminated (GIUnionInfo *info)
* Returns: offset, in bytes, of the discriminator * Returns: offset, in bytes, of the discriminator
* Since: 2.80 * Since: 2.80
*/ */
gint guint
gi_union_info_get_discriminator_offset (GIUnionInfo *info) gi_union_info_get_discriminator_offset (GIUnionInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -201,7 +201,7 @@ gi_union_info_get_discriminator_type (GIUnionInfo *info)
*/ */
GIConstantInfo * GIConstantInfo *
gi_union_info_get_discriminator (GIUnionInfo *info, gi_union_info_get_discriminator (GIUnionInfo *info,
gint n) guint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset];
@ -286,7 +286,7 @@ gi_union_info_get_alignment (GIUnionInfo *info)
} }
/** /**
* gi_union_info_get_copy_function: * gi_union_info_get_copy_function_name:
* @info: a union information blob * @info: a union information blob
* *
* Retrieves the name of the copy function for @info, if any is set. * Retrieves the name of the copy function for @info, if any is set.
@ -296,7 +296,7 @@ gi_union_info_get_alignment (GIUnionInfo *info)
* Since: 2.80 * Since: 2.80
*/ */
const char * const char *
gi_union_info_get_copy_function (GIUnionInfo *info) gi_union_info_get_copy_function_name (GIUnionInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
UnionBlob *blob; UnionBlob *blob;
@ -313,7 +313,7 @@ gi_union_info_get_copy_function (GIUnionInfo *info)
} }
/** /**
* gi_union_info_get_free_function: * gi_union_info_get_free_function_name:
* @info: a union information blob * @info: a union information blob
* *
* Retrieves the name of the free function for @info, if any is set. * Retrieves the name of the free function for @info, if any is set.
@ -323,7 +323,7 @@ gi_union_info_get_copy_function (GIUnionInfo *info)
* Since: 2.80 * Since: 2.80
*/ */
const char * const char *
gi_union_info_get_free_function (GIUnionInfo *info) gi_union_info_get_free_function_name (GIUnionInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
UnionBlob *blob; UnionBlob *blob;

View File

@ -44,31 +44,31 @@ G_BEGIN_DECLS
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_UNION) (gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_UNION)
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_union_info_get_n_fields (GIUnionInfo *info); guint gi_union_info_get_n_fields (GIUnionInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFieldInfo * gi_union_info_get_field (GIUnionInfo *info, GIFieldInfo * gi_union_info_get_field (GIUnionInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_union_info_get_n_methods (GIUnionInfo *info); guint gi_union_info_get_n_methods (GIUnionInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFunctionInfo * gi_union_info_get_method (GIUnionInfo *info, GIFunctionInfo * gi_union_info_get_method (GIUnionInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean gi_union_info_is_discriminated (GIUnionInfo *info); gboolean gi_union_info_is_discriminated (GIUnionInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_union_info_get_discriminator_offset (GIUnionInfo *info); guint gi_union_info_get_discriminator_offset (GIUnionInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GITypeInfo * gi_union_info_get_discriminator_type (GIUnionInfo *info); GITypeInfo * gi_union_info_get_discriminator_type (GIUnionInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIConstantInfo * gi_union_info_get_discriminator (GIUnionInfo *info, GIConstantInfo * gi_union_info_get_discriminator (GIUnionInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFunctionInfo * gi_union_info_find_method (GIUnionInfo *info, GIFunctionInfo * gi_union_info_find_method (GIUnionInfo *info,
@ -81,9 +81,9 @@ GI_AVAILABLE_IN_ALL
gsize gi_union_info_get_alignment (GIUnionInfo *info); gsize gi_union_info_get_alignment (GIUnionInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
const char * gi_union_info_get_copy_function (GIUnionInfo *info); const char * gi_union_info_get_copy_function_name (GIUnionInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
const char * gi_union_info_get_free_function (GIUnionInfo *info); const char * gi_union_info_get_free_function_name (GIUnionInfo *info);
G_END_DECLS G_END_DECLS

View File

@ -48,14 +48,13 @@
GIVFuncInfo * GIVFuncInfo *
gi_base_info_find_vfunc (GIRealInfo *rinfo, gi_base_info_find_vfunc (GIRealInfo *rinfo,
guint32 offset, guint32 offset,
gint n_vfuncs, guint n_vfuncs,
const gchar *name) const gchar *name)
{ {
/* FIXME hash */ /* FIXME hash */
Header *header = (Header *)rinfo->typelib->data; Header *header = (Header *)rinfo->typelib->data;
gint i;
for (i = 0; i < n_vfuncs; i++) for (guint i = 0; i < n_vfuncs; i++)
{ {
VFuncBlob *fblob = (VFuncBlob *)&rinfo->typelib->data[offset]; VFuncBlob *fblob = (VFuncBlob *)&rinfo->typelib->data[offset];
const gchar *fname = (const gchar *)&rinfo->typelib->data[fblob->name]; const gchar *fname = (const gchar *)&rinfo->typelib->data[fblob->name];
@ -121,7 +120,7 @@ gi_vfunc_info_get_flags (GIVFuncInfo *info)
* Returns: the struct offset or `0xFFFF` if its unknown * Returns: the struct offset or `0xFFFF` if its unknown
* Since: 2.80 * Since: 2.80
*/ */
gint guint
gi_vfunc_info_get_offset (GIVFuncInfo *info) gi_vfunc_info_get_offset (GIVFuncInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -337,9 +336,9 @@ gboolean
gi_vfunc_info_invoke (GIVFuncInfo *info, gi_vfunc_info_invoke (GIVFuncInfo *info,
GType implementor, GType implementor,
const GIArgument *in_args, const GIArgument *in_args,
int n_in_args, gsize n_in_args,
const GIArgument *out_args, const GIArgument *out_args,
int n_out_args, gsize n_out_args,
GIArgument *return_value, GIArgument *return_value,
GError **error) GError **error)
{ {

View File

@ -47,7 +47,7 @@ GI_AVAILABLE_IN_ALL
GIVFuncInfoFlags gi_vfunc_info_get_flags (GIVFuncInfo *info); GIVFuncInfoFlags gi_vfunc_info_get_flags (GIVFuncInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_vfunc_info_get_offset (GIVFuncInfo *info); guint gi_vfunc_info_get_offset (GIVFuncInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GISignalInfo * gi_vfunc_info_get_signal (GIVFuncInfo *info); GISignalInfo * gi_vfunc_info_get_signal (GIVFuncInfo *info);
@ -64,9 +64,9 @@ GI_AVAILABLE_IN_ALL
gboolean gi_vfunc_info_invoke (GIVFuncInfo *info, gboolean gi_vfunc_info_invoke (GIVFuncInfo *info,
GType implementor, GType implementor,
const GIArgument *in_args, const GIArgument *in_args,
int n_in_args, gsize n_in_args,
const GIArgument *out_args, const GIArgument *out_args,
int n_out_args, gsize n_out_args,
GIArgument *return_value, GIArgument *return_value,
GError **error); GError **error);