mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-11 19:54:05 +02:00
Merge branch 'girepository-api-tweaks' into 'main'
girepository: Various small API cleanups See merge request GNOME/glib!3805
This commit is contained in:
@@ -580,7 +580,6 @@ gi_base_info_get_name (GIBaseInfo *info)
|
|||||||
case GI_INFO_TYPE_OBJECT:
|
case GI_INFO_TYPE_OBJECT:
|
||||||
case GI_INFO_TYPE_INTERFACE:
|
case GI_INFO_TYPE_INTERFACE:
|
||||||
case GI_INFO_TYPE_CONSTANT:
|
case GI_INFO_TYPE_CONSTANT:
|
||||||
case GI_INFO_TYPE_INVALID_0:
|
|
||||||
case GI_INFO_TYPE_UNION:
|
case GI_INFO_TYPE_UNION:
|
||||||
{
|
{
|
||||||
CommonBlob *blob = (CommonBlob *)&rinfo->typelib->data[rinfo->offset];
|
CommonBlob *blob = (CommonBlob *)&rinfo->typelib->data[rinfo->offset];
|
||||||
@@ -705,7 +704,6 @@ gi_base_info_is_deprecated (GIBaseInfo *info)
|
|||||||
case GI_INFO_TYPE_OBJECT:
|
case GI_INFO_TYPE_OBJECT:
|
||||||
case GI_INFO_TYPE_INTERFACE:
|
case GI_INFO_TYPE_INTERFACE:
|
||||||
case GI_INFO_TYPE_CONSTANT:
|
case GI_INFO_TYPE_CONSTANT:
|
||||||
case GI_INFO_TYPE_INVALID_0:
|
|
||||||
{
|
{
|
||||||
CommonBlob *blob = (CommonBlob *)&rinfo->typelib->data[rinfo->offset];
|
CommonBlob *blob = (CommonBlob *)&rinfo->typelib->data[rinfo->offset];
|
||||||
|
|
||||||
|
@@ -615,15 +615,13 @@ gi_type_info_extract_ffi_return_value (GITypeInfo *return_info,
|
|||||||
* @return_value: (out caller-allocates) (not optional) (nullable): return
|
* @return_value: (out caller-allocates) (not optional) (nullable): return
|
||||||
* location for the return value from the callable; `NULL` may be returned if
|
* location for the return value from the callable; `NULL` may be returned if
|
||||||
* the callable returns that
|
* the callable returns that
|
||||||
* @is_method: `TRUE` if @info is a method
|
|
||||||
* @throws: `TRUE` if @info may throw a [type@GLib.Error]
|
|
||||||
* @error: return location for a [type@GLib.Error], or `NULL`
|
* @error: return location for a [type@GLib.Error], or `NULL`
|
||||||
*
|
*
|
||||||
* Invoke the given `GICallableInfo` by calling the given @function pointer.
|
* Invoke the given `GICallableInfo` by calling the given @function pointer.
|
||||||
*
|
*
|
||||||
* The set of arguments passed to @function will be constructed according to the
|
* The set of arguments passed to @function will be constructed according to the
|
||||||
* introspected type of the `GICallableInfo`, using @in_args, @out_args,
|
* introspected type of the `GICallableInfo`, using @in_args, @out_args
|
||||||
* @is_method, @throws and @error.
|
* and @error.
|
||||||
*
|
*
|
||||||
* Returns: `TRUE` if the callable was executed successfully and didn’t throw
|
* Returns: `TRUE` if the callable was executed successfully and didn’t throw
|
||||||
* a [type@GLib.Error]; `FALSE` if @error is set
|
* a [type@GLib.Error]; `FALSE` if @error is set
|
||||||
@@ -634,11 +632,9 @@ gi_callable_info_invoke (GICallableInfo *info,
|
|||||||
gpointer function,
|
gpointer function,
|
||||||
const GIArgument *in_args,
|
const GIArgument *in_args,
|
||||||
gsize n_in_args,
|
gsize n_in_args,
|
||||||
const GIArgument *out_args,
|
GIArgument *out_args,
|
||||||
gsize n_out_args,
|
gsize n_out_args,
|
||||||
GIArgument *return_value,
|
GIArgument *return_value,
|
||||||
gboolean is_method,
|
|
||||||
gboolean throws,
|
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
ffi_cif cif;
|
ffi_cif cif;
|
||||||
@@ -655,10 +651,13 @@ gi_callable_info_invoke (GICallableInfo *info,
|
|||||||
gpointer error_address = &local_error;
|
gpointer error_address = &local_error;
|
||||||
GIFFIReturnValue ffi_return_value;
|
GIFFIReturnValue ffi_return_value;
|
||||||
gpointer return_value_p; /* Will point inside the union return_value */
|
gpointer return_value_p; /* Will point inside the union return_value */
|
||||||
|
gboolean is_method, throws;
|
||||||
|
|
||||||
rinfo = gi_callable_info_get_return_type ((GICallableInfo *)info);
|
rinfo = gi_callable_info_get_return_type ((GICallableInfo *)info);
|
||||||
rtype = gi_type_info_get_ffi_type (rinfo);
|
rtype = gi_type_info_get_ffi_type (rinfo);
|
||||||
rtag = gi_type_info_get_tag(rinfo);
|
rtag = gi_type_info_get_tag(rinfo);
|
||||||
|
is_method = gi_callable_info_is_method (info);
|
||||||
|
throws = gi_callable_info_can_throw_gerror (info);
|
||||||
|
|
||||||
in_pos = 0;
|
in_pos = 0;
|
||||||
out_pos = 0;
|
out_pos = 0;
|
||||||
|
@@ -96,11 +96,9 @@ gboolean gi_callable_info_invoke (GICallableInfo *info
|
|||||||
gpointer function,
|
gpointer function,
|
||||||
const GIArgument *in_args,
|
const GIArgument *in_args,
|
||||||
gsize n_in_args,
|
gsize n_in_args,
|
||||||
const GIArgument *out_args,
|
GIArgument *out_args,
|
||||||
gsize n_out_args,
|
gsize n_out_args,
|
||||||
GIArgument *return_value,
|
GIArgument *return_value,
|
||||||
gboolean is_method,
|
|
||||||
gboolean throws,
|
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
GI_AVAILABLE_IN_ALL
|
GI_AVAILABLE_IN_ALL
|
||||||
|
@@ -334,7 +334,6 @@ gi_field_info_get_field (GIFieldInfo *field_info,
|
|||||||
case GI_INFO_TYPE_INTERFACE:
|
case GI_INFO_TYPE_INTERFACE:
|
||||||
case GI_INFO_TYPE_FUNCTION:
|
case GI_INFO_TYPE_FUNCTION:
|
||||||
case GI_INFO_TYPE_CONSTANT:
|
case GI_INFO_TYPE_CONSTANT:
|
||||||
case GI_INFO_TYPE_INVALID_0:
|
|
||||||
case GI_INFO_TYPE_VALUE:
|
case GI_INFO_TYPE_VALUE:
|
||||||
case GI_INFO_TYPE_SIGNAL:
|
case GI_INFO_TYPE_SIGNAL:
|
||||||
case GI_INFO_TYPE_PROPERTY:
|
case GI_INFO_TYPE_PROPERTY:
|
||||||
@@ -517,7 +516,6 @@ gi_field_info_set_field (GIFieldInfo *field_info,
|
|||||||
case GI_INFO_TYPE_INTERFACE:
|
case GI_INFO_TYPE_INTERFACE:
|
||||||
case GI_INFO_TYPE_FUNCTION:
|
case GI_INFO_TYPE_FUNCTION:
|
||||||
case GI_INFO_TYPE_CONSTANT:
|
case GI_INFO_TYPE_CONSTANT:
|
||||||
case GI_INFO_TYPE_INVALID_0:
|
|
||||||
case GI_INFO_TYPE_VALUE:
|
case GI_INFO_TYPE_VALUE:
|
||||||
case GI_INFO_TYPE_SIGNAL:
|
case GI_INFO_TYPE_SIGNAL:
|
||||||
case GI_INFO_TYPE_PROPERTY:
|
case GI_INFO_TYPE_PROPERTY:
|
||||||
|
@@ -267,15 +267,13 @@ gboolean
|
|||||||
gi_function_info_invoke (GIFunctionInfo *info,
|
gi_function_info_invoke (GIFunctionInfo *info,
|
||||||
const GIArgument *in_args,
|
const GIArgument *in_args,
|
||||||
gsize n_in_args,
|
gsize n_in_args,
|
||||||
const GIArgument *out_args,
|
GIArgument *out_args,
|
||||||
gsize n_out_args,
|
gsize n_out_args,
|
||||||
GIArgument *return_value,
|
GIArgument *return_value,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
const gchar *symbol;
|
const gchar *symbol;
|
||||||
gpointer func;
|
gpointer func;
|
||||||
gboolean is_method;
|
|
||||||
gboolean throws;
|
|
||||||
|
|
||||||
symbol = gi_function_info_get_symbol (info);
|
symbol = gi_function_info_get_symbol (info);
|
||||||
|
|
||||||
@@ -290,10 +288,6 @@ gi_function_info_invoke (GIFunctionInfo *info,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
is_method = (gi_function_info_get_flags (info) & GI_FUNCTION_IS_METHOD) != 0
|
|
||||||
&& (gi_function_info_get_flags (info) & GI_FUNCTION_IS_CONSTRUCTOR) == 0;
|
|
||||||
throws = gi_function_info_get_flags (info) & GI_FUNCTION_THROWS;
|
|
||||||
|
|
||||||
return gi_callable_info_invoke ((GICallableInfo*) info,
|
return gi_callable_info_invoke ((GICallableInfo*) info,
|
||||||
func,
|
func,
|
||||||
in_args,
|
in_args,
|
||||||
@@ -301,8 +295,6 @@ gi_function_info_invoke (GIFunctionInfo *info,
|
|||||||
out_args,
|
out_args,
|
||||||
n_out_args,
|
n_out_args,
|
||||||
return_value,
|
return_value,
|
||||||
is_method,
|
|
||||||
throws,
|
|
||||||
error);
|
error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -93,7 +93,7 @@ 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,
|
||||||
gsize n_in_args,
|
gsize n_in_args,
|
||||||
const GIArgument *out_args,
|
GIArgument *out_args,
|
||||||
gsize n_out_args,
|
gsize n_out_args,
|
||||||
GIArgument *return_value,
|
GIArgument *return_value,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
@@ -278,10 +278,10 @@ gi_cclosure_marshal_generic (GClosure *closure,
|
|||||||
GIArgument return_ffi_value = { 0, };
|
GIArgument return_ffi_value = { 0, };
|
||||||
ffi_type *rtype;
|
ffi_type *rtype;
|
||||||
void *rvalue;
|
void *rvalue;
|
||||||
int n_args;
|
unsigned int n_args;
|
||||||
ffi_type **atypes;
|
ffi_type **atypes;
|
||||||
void **args;
|
void **args;
|
||||||
int i;
|
unsigned int i;
|
||||||
ffi_cif cif;
|
ffi_cif cif;
|
||||||
GCClosure *cc = (GCClosure*) closure;
|
GCClosure *cc = (GCClosure*) closure;
|
||||||
|
|
||||||
|
@@ -92,6 +92,9 @@ struct _GIRepositoryPrivate
|
|||||||
GHashTable *info_by_error_domain; /* GQuark -> GIBaseInfo */
|
GHashTable *info_by_error_domain; /* GQuark -> GIBaseInfo */
|
||||||
GHashTable *interfaces_for_gtype; /* GType -> GTypeInterfaceCache */
|
GHashTable *interfaces_for_gtype; /* GType -> GTypeInterfaceCache */
|
||||||
GHashTable *unknown_gtypes; /* hashset of GType */
|
GHashTable *unknown_gtypes; /* hashset of GType */
|
||||||
|
|
||||||
|
char **cached_shared_libraries; /* (owned) (nullable) (array zero-terminated=1) */
|
||||||
|
size_t cached_n_shared_libraries; /* length of @cached_shared_libraries, not including NULL terminator */
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (GIRepository, gi_repository, G_TYPE_OBJECT, G_ADD_PRIVATE (GIRepository));
|
G_DEFINE_TYPE_WITH_CODE (GIRepository, gi_repository, G_TYPE_OBJECT, G_ADD_PRIVATE (GIRepository));
|
||||||
@@ -170,6 +173,8 @@ gi_repository_finalize (GObject *object)
|
|||||||
g_hash_table_destroy (repository->priv->interfaces_for_gtype);
|
g_hash_table_destroy (repository->priv->interfaces_for_gtype);
|
||||||
g_hash_table_destroy (repository->priv->unknown_gtypes);
|
g_hash_table_destroy (repository->priv->unknown_gtypes);
|
||||||
|
|
||||||
|
g_clear_pointer (&repository->priv->cached_shared_libraries, g_strfreev);
|
||||||
|
|
||||||
(* G_OBJECT_CLASS (gi_repository_parent_class)->finalize) (G_OBJECT (repository));
|
(* G_OBJECT_CLASS (gi_repository_parent_class)->finalize) (G_OBJECT (repository));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -780,10 +785,10 @@ gi_repository_get_n_infos (GIRepository *repository,
|
|||||||
*
|
*
|
||||||
* The namespace must have already been loaded before calling this function.
|
* The namespace must have already been loaded before calling this function.
|
||||||
* See [method@GIRepository.Repository.get_n_infos] to find the maximum number
|
* See [method@GIRepository.Repository.get_n_infos] to find the maximum number
|
||||||
* of entries.
|
* of entries. It is an error to pass an invalid @idx to this function.
|
||||||
*
|
*
|
||||||
* Returns: (transfer full) (nullable): [class@GIRepository.BaseInfo] containing
|
* Returns: (transfer full) (not nullable): [class@GIRepository.BaseInfo]
|
||||||
* metadata, or `NULL` if @idx was too high
|
* containing metadata
|
||||||
* Since: 2.80
|
* Since: 2.80
|
||||||
*/
|
*/
|
||||||
GIBaseInfo *
|
GIBaseInfo *
|
||||||
@@ -803,8 +808,8 @@ 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, idx + 1);
|
entry = gi_typelib_get_dir_entry (typelib, idx + 1);
|
||||||
if (entry == NULL)
|
g_return_val_if_fail (entry != NULL, NULL);
|
||||||
return NULL;
|
|
||||||
return gi_info_new_full (entry->blob_type,
|
return gi_info_new_full (entry->blob_type,
|
||||||
repository,
|
repository,
|
||||||
NULL, typelib, entry->offset);
|
NULL, typelib, entry->offset);
|
||||||
@@ -1201,12 +1206,14 @@ gi_repository_get_version (GIRepository *repository,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gi_repository_get_shared_library:
|
* gi_repository_get_shared_libraries:
|
||||||
* @repository: (nullable): A #GIRepository, or `NULL` for the singleton
|
* @repository: (nullable): A #GIRepository, or `NULL` for the singleton
|
||||||
* process-global default #GIRepository
|
* process-global default #GIRepository
|
||||||
* @namespace_: Namespace to inspect
|
* @namespace_: Namespace to inspect
|
||||||
|
* @out_n_elements: (out) (optional): Return location for the number of elements
|
||||||
|
* in the returned array
|
||||||
*
|
*
|
||||||
* This function returns a comma-separated list of paths to the
|
* This function returns an array of paths to the
|
||||||
* shared C libraries associated with the given namespace @namespace_.
|
* shared C libraries associated with the given namespace @namespace_.
|
||||||
*
|
*
|
||||||
* There may be no shared library path associated, in which case this
|
* There may be no shared library path associated, in which case this
|
||||||
@@ -1216,13 +1223,17 @@ gi_repository_get_version (GIRepository *repository,
|
|||||||
* such as [method@GIRepository.Repository.require] before calling this
|
* such as [method@GIRepository.Repository.require] before calling this
|
||||||
* function.
|
* function.
|
||||||
*
|
*
|
||||||
* Returns: (nullable): Comma-separated list of paths to shared libraries,
|
* The list is internal to [class@GIRepository.Repository] and should not be
|
||||||
* or `NULL` if none are associated
|
* freed, nor should its string elements.
|
||||||
|
*
|
||||||
|
* Returns: (nullable) (array length=out_n_elements) (transfer none): Array of
|
||||||
|
* paths to shared libraries, or `NULL` if none are associated
|
||||||
* Since: 2.80
|
* Since: 2.80
|
||||||
*/
|
*/
|
||||||
const gchar *
|
const char * const *
|
||||||
gi_repository_get_shared_library (GIRepository *repository,
|
gi_repository_get_shared_libraries (GIRepository *repository,
|
||||||
const gchar *namespace)
|
const gchar *namespace,
|
||||||
|
size_t *out_n_elements)
|
||||||
{
|
{
|
||||||
GITypelib *typelib;
|
GITypelib *typelib;
|
||||||
Header *header;
|
Header *header;
|
||||||
@@ -1236,12 +1247,31 @@ gi_repository_get_shared_library (GIRepository *repository,
|
|||||||
g_return_val_if_fail (typelib != NULL, NULL);
|
g_return_val_if_fail (typelib != NULL, NULL);
|
||||||
|
|
||||||
header = (Header *) typelib->data;
|
header = (Header *) typelib->data;
|
||||||
if (header->shared_library)
|
if (!header->shared_library)
|
||||||
return gi_typelib_get_string (typelib, header->shared_library);
|
{
|
||||||
else
|
if (out_n_elements != NULL)
|
||||||
|
*out_n_elements = 0;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Populate the cache. */
|
||||||
|
if (repository->priv->cached_shared_libraries == NULL)
|
||||||
|
{
|
||||||
|
const char *comma_separated = gi_typelib_get_string (typelib, header->shared_library);
|
||||||
|
|
||||||
|
if (comma_separated != NULL && *comma_separated != '\0')
|
||||||
|
{
|
||||||
|
repository->priv->cached_shared_libraries = g_strsplit (comma_separated, ",", -1);
|
||||||
|
repository->priv->cached_n_shared_libraries = g_strv_length (repository->priv->cached_shared_libraries);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (out_n_elements != NULL)
|
||||||
|
*out_n_elements = repository->priv->cached_n_shared_libraries;
|
||||||
|
|
||||||
|
return (const char * const *) repository->priv->cached_shared_libraries;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gi_repository_get_c_prefix:
|
* gi_repository_get_c_prefix:
|
||||||
* @repository: (nullable): A #GIRepository, or `NULL` for the singleton
|
* @repository: (nullable): A #GIRepository, or `NULL` for the singleton
|
||||||
|
@@ -185,8 +185,9 @@ GI_AVAILABLE_IN_ALL
|
|||||||
const gchar * gi_repository_get_typelib_path (GIRepository *repository,
|
const gchar * gi_repository_get_typelib_path (GIRepository *repository,
|
||||||
const gchar *namespace_);
|
const gchar *namespace_);
|
||||||
GI_AVAILABLE_IN_ALL
|
GI_AVAILABLE_IN_ALL
|
||||||
const gchar * gi_repository_get_shared_library (GIRepository *repository,
|
const gchar * const *gi_repository_get_shared_libraries (GIRepository *repository,
|
||||||
const gchar *namespace_);
|
const gchar *namespace_,
|
||||||
|
size_t *out_n_elements);
|
||||||
GI_AVAILABLE_IN_ALL
|
GI_AVAILABLE_IN_ALL
|
||||||
const gchar * gi_repository_get_c_prefix (GIRepository *repository,
|
const gchar * gi_repository_get_c_prefix (GIRepository *repository,
|
||||||
const gchar *namespace_);
|
const gchar *namespace_);
|
||||||
|
@@ -171,11 +171,12 @@ gi_type_info_get_ffi_type (GITypeInfo *info)
|
|||||||
*/
|
*/
|
||||||
static ffi_type **
|
static ffi_type **
|
||||||
gi_callable_info_get_ffi_arg_types (GICallableInfo *callable_info,
|
gi_callable_info_get_ffi_arg_types (GICallableInfo *callable_info,
|
||||||
int *n_args_p)
|
size_t *n_args_p)
|
||||||
{
|
{
|
||||||
ffi_type **arg_types;
|
ffi_type **arg_types;
|
||||||
gboolean is_method, throws;
|
gboolean is_method, throws;
|
||||||
gint n_args, n_invoke_args, i, offset;
|
size_t n_invoke_args;
|
||||||
|
guint n_args, i, offset;
|
||||||
|
|
||||||
g_return_val_if_fail (callable_info != NULL, NULL);
|
g_return_val_if_fail (callable_info != NULL, NULL);
|
||||||
|
|
||||||
@@ -321,7 +322,7 @@ gi_function_invoker_new_for_address (gpointer addr,
|
|||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
ffi_type **atypes;
|
ffi_type **atypes;
|
||||||
gint n_args;
|
size_t n_args;
|
||||||
|
|
||||||
g_return_val_if_fail (info != NULL, FALSE);
|
g_return_val_if_fail (info != NULL, FALSE);
|
||||||
g_return_val_if_fail (invoker != NULL, FALSE);
|
g_return_val_if_fail (invoker != NULL, FALSE);
|
||||||
@@ -379,7 +380,7 @@ gi_callable_info_create_closure (GICallableInfo *callable_info,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
gpointer exec_ptr;
|
gpointer exec_ptr;
|
||||||
int n_args;
|
size_t n_args;
|
||||||
ffi_type **atypes;
|
ffi_type **atypes;
|
||||||
GIClosureWrapper *closure;
|
GIClosureWrapper *closure;
|
||||||
ffi_status status;
|
ffi_status status;
|
||||||
|
@@ -1390,7 +1390,7 @@ gi_ir_writer_write (const char *filename,
|
|||||||
|
|
||||||
if (TRUE)
|
if (TRUE)
|
||||||
{
|
{
|
||||||
const gchar *shared_library;
|
const char * const *shared_libraries;
|
||||||
const gchar *c_prefix;
|
const gchar *c_prefix;
|
||||||
const char *cur_ns = ns;
|
const char *cur_ns = ns;
|
||||||
const char *cur_version;
|
const char *cur_version;
|
||||||
@@ -1398,12 +1398,16 @@ gi_ir_writer_write (const char *filename,
|
|||||||
|
|
||||||
cur_version = gi_repository_get_version (repository, cur_ns);
|
cur_version = gi_repository_get_version (repository, cur_ns);
|
||||||
|
|
||||||
shared_library = gi_repository_get_shared_library (repository, cur_ns);
|
shared_libraries = gi_repository_get_shared_libraries (repository, cur_ns, NULL);
|
||||||
c_prefix = gi_repository_get_c_prefix (repository, cur_ns);
|
c_prefix = gi_repository_get_c_prefix (repository, cur_ns);
|
||||||
xml_start_element (xml, "namespace");
|
xml_start_element (xml, "namespace");
|
||||||
xml_printf (xml, " name=\"%s\" version=\"%s\"", cur_ns, cur_version);
|
xml_printf (xml, " name=\"%s\" version=\"%s\"", cur_ns, cur_version);
|
||||||
if (shared_library)
|
if (shared_libraries != NULL)
|
||||||
xml_printf (xml, " shared-library=\"%s\"", shared_library);
|
{
|
||||||
|
char *shared_libraries_str = g_strjoinv (",", (char **) shared_libraries);
|
||||||
|
xml_printf (xml, " shared-library=\"%s\"", shared_libraries_str);
|
||||||
|
g_free (shared_libraries_str);
|
||||||
|
}
|
||||||
if (c_prefix)
|
if (c_prefix)
|
||||||
xml_printf (xml, " c:prefix=\"%s\"", c_prefix);
|
xml_printf (xml, " c:prefix=\"%s\"", c_prefix);
|
||||||
|
|
||||||
|
@@ -1338,7 +1338,7 @@ gboolean gi_typelib_matches_gtype_name_prefix (GITypelib *typelib,
|
|||||||
|
|
||||||
|
|
||||||
GI_AVAILABLE_IN_ALL
|
GI_AVAILABLE_IN_ALL
|
||||||
void gi_typelib_check_sanity (void);
|
void gi_typelib_check_format (void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gi_typelib_get_string:
|
* gi_typelib_get_string:
|
||||||
|
@@ -426,7 +426,7 @@ gi_typelib_get_dir_entry_by_error_domain (GITypelib *typelib,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gi_typelib_check_sanity:
|
* gi_typelib_check_format:
|
||||||
*
|
*
|
||||||
* Check compile-time sizes of various typelib file format types are as
|
* Check compile-time sizes of various typelib file format types are as
|
||||||
* expected.
|
* expected.
|
||||||
@@ -434,7 +434,7 @@ gi_typelib_get_dir_entry_by_error_domain (GITypelib *typelib,
|
|||||||
* Since: 2.80
|
* Since: 2.80
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gi_typelib_check_sanity (void)
|
gi_typelib_check_format (void)
|
||||||
{
|
{
|
||||||
#ifndef G_DISABLE_ASSERT
|
#ifndef G_DISABLE_ASSERT
|
||||||
/* Check that struct layout is as we expect */
|
/* Check that struct layout is as we expect */
|
||||||
@@ -616,7 +616,7 @@ validate_header_basic (const guint8 *memory,
|
|||||||
/* This is a sanity check for a specific typelib; it
|
/* This is a sanity check for a specific typelib; it
|
||||||
* prevents us from loading an incompatible typelib.
|
* prevents us from loading an incompatible typelib.
|
||||||
*
|
*
|
||||||
* The hardcoded checks in gi_typelib_check_sanity to
|
* The hardcoded checks in gi_typelib_check_format to
|
||||||
* protect against inadvertent or buggy changes to the typelib format
|
* protect against inadvertent or buggy changes to the typelib format
|
||||||
* itself.
|
* itself.
|
||||||
*/
|
*/
|
||||||
|
@@ -179,7 +179,6 @@ typedef union _GIArgument GIArgument;
|
|||||||
* @GI_INFO_TYPE_OBJECT: object, see [class@GIRepository.ObjectInfo]
|
* @GI_INFO_TYPE_OBJECT: object, see [class@GIRepository.ObjectInfo]
|
||||||
* @GI_INFO_TYPE_INTERFACE: interface, see [class@GIRepository.InterfaceInfo]
|
* @GI_INFO_TYPE_INTERFACE: interface, see [class@GIRepository.InterfaceInfo]
|
||||||
* @GI_INFO_TYPE_CONSTANT: constant, see [class@GIRepository.ConstantInfo]
|
* @GI_INFO_TYPE_CONSTANT: constant, see [class@GIRepository.ConstantInfo]
|
||||||
* @GI_INFO_TYPE_INVALID_0: deleted, used to be `GI_INFO_TYPE_ERROR_DOMAIN`.
|
|
||||||
* @GI_INFO_TYPE_UNION: union, see [class@GIRepository.UnionInfo]
|
* @GI_INFO_TYPE_UNION: union, see [class@GIRepository.UnionInfo]
|
||||||
* @GI_INFO_TYPE_VALUE: enum value, see [class@GIRepository.ValueInfo]
|
* @GI_INFO_TYPE_VALUE: enum value, see [class@GIRepository.ValueInfo]
|
||||||
* @GI_INFO_TYPE_SIGNAL: signal, see [class@GIRepository.SignalInfo]
|
* @GI_INFO_TYPE_SIGNAL: signal, see [class@GIRepository.SignalInfo]
|
||||||
@@ -219,18 +218,17 @@ typedef enum
|
|||||||
GI_INFO_TYPE_OBJECT,
|
GI_INFO_TYPE_OBJECT,
|
||||||
GI_INFO_TYPE_INTERFACE,
|
GI_INFO_TYPE_INTERFACE,
|
||||||
GI_INFO_TYPE_CONSTANT,
|
GI_INFO_TYPE_CONSTANT,
|
||||||
GI_INFO_TYPE_INVALID_0, /* 10 */
|
GI_INFO_TYPE_UNION, /* 10 */
|
||||||
GI_INFO_TYPE_UNION,
|
|
||||||
GI_INFO_TYPE_VALUE,
|
GI_INFO_TYPE_VALUE,
|
||||||
GI_INFO_TYPE_SIGNAL,
|
GI_INFO_TYPE_SIGNAL,
|
||||||
GI_INFO_TYPE_VFUNC,
|
GI_INFO_TYPE_VFUNC,
|
||||||
GI_INFO_TYPE_PROPERTY, /* 15 */
|
GI_INFO_TYPE_PROPERTY,
|
||||||
GI_INFO_TYPE_FIELD,
|
GI_INFO_TYPE_FIELD, /* 15 */
|
||||||
GI_INFO_TYPE_ARG,
|
GI_INFO_TYPE_ARG,
|
||||||
GI_INFO_TYPE_TYPE,
|
GI_INFO_TYPE_TYPE,
|
||||||
GI_INFO_TYPE_UNRESOLVED,
|
GI_INFO_TYPE_UNRESOLVED,
|
||||||
GI_INFO_TYPE_CALLABLE, /* 20 */
|
GI_INFO_TYPE_CALLABLE,
|
||||||
GI_INFO_TYPE_REGISTERED_TYPE,
|
GI_INFO_TYPE_REGISTERED_TYPE, /* 20 */
|
||||||
/* keep GI_INFO_TYPE_N_TYPES in sync with this */
|
/* keep GI_INFO_TYPE_N_TYPES in sync with this */
|
||||||
} GIInfoType;
|
} GIInfoType;
|
||||||
|
|
||||||
|
@@ -342,7 +342,7 @@ gi_vfunc_info_invoke (GIVFuncInfo *info,
|
|||||||
GType implementor,
|
GType implementor,
|
||||||
const GIArgument *in_args,
|
const GIArgument *in_args,
|
||||||
gsize n_in_args,
|
gsize n_in_args,
|
||||||
const GIArgument *out_args,
|
GIArgument *out_args,
|
||||||
gsize n_out_args,
|
gsize n_out_args,
|
||||||
GIArgument *return_value,
|
GIArgument *return_value,
|
||||||
GError **error)
|
GError **error)
|
||||||
@@ -370,8 +370,6 @@ gi_vfunc_info_invoke (GIVFuncInfo *info,
|
|||||||
out_args,
|
out_args,
|
||||||
n_out_args,
|
n_out_args,
|
||||||
return_value,
|
return_value,
|
||||||
TRUE,
|
|
||||||
FALSE,
|
|
||||||
error);
|
error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -65,7 +65,7 @@ gboolean gi_vfunc_info_invoke (GIVFuncInfo *info,
|
|||||||
GType implementor,
|
GType implementor,
|
||||||
const GIArgument *in_args,
|
const GIArgument *in_args,
|
||||||
gsize n_in_args,
|
gsize n_in_args,
|
||||||
const GIArgument *out_args,
|
GIArgument *out_args,
|
||||||
gsize n_out_args,
|
gsize n_out_args,
|
||||||
GIArgument *return_value,
|
GIArgument *return_value,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
Reference in New Issue
Block a user