mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 04:56:14 +01:00
[GIRepository] Rename GTypelib to GITypelib
Keep a typedef for backwards compatibility, until the major bindings has moved over.
This commit is contained in:
parent
9c80c84dc7
commit
14edb06326
16
gibaseinfo.c
16
gibaseinfo.c
@ -35,7 +35,7 @@ GIBaseInfo *
|
||||
_g_info_new_full (GIInfoType type,
|
||||
GIRepository *repository,
|
||||
GIBaseInfo *container,
|
||||
GTypelib *typelib,
|
||||
GITypelib *typelib,
|
||||
guint32 offset)
|
||||
{
|
||||
GIRealInfo *info;
|
||||
@ -58,7 +58,7 @@ _g_info_new_full (GIInfoType type,
|
||||
GIBaseInfo *
|
||||
g_info_new (GIInfoType type,
|
||||
GIBaseInfo *container,
|
||||
GTypelib *typelib,
|
||||
GITypelib *typelib,
|
||||
guint32 offset)
|
||||
{
|
||||
return _g_info_new_full (type, ((GIRealInfo*)container)->repository, container, typelib, offset);
|
||||
@ -69,7 +69,7 @@ _g_info_init (GIRealInfo *info,
|
||||
GIInfoType type,
|
||||
GIRepository *repository,
|
||||
GIBaseInfo *container,
|
||||
GTypelib *typelib,
|
||||
GITypelib *typelib,
|
||||
guint32 offset)
|
||||
{
|
||||
memset (info, 0, sizeof (GIRealInfo));
|
||||
@ -90,7 +90,7 @@ _g_info_init (GIRealInfo *info,
|
||||
|
||||
GIBaseInfo *
|
||||
_g_info_from_entry (GIRepository *repository,
|
||||
GTypelib *typelib,
|
||||
GITypelib *typelib,
|
||||
guint16 index)
|
||||
{
|
||||
GIBaseInfo *result;
|
||||
@ -127,7 +127,7 @@ _g_info_from_entry (GIRepository *repository,
|
||||
|
||||
GITypeInfo *
|
||||
_g_type_info_new (GIBaseInfo *container,
|
||||
GTypelib *typelib,
|
||||
GITypelib *typelib,
|
||||
guint32 offset)
|
||||
{
|
||||
SimpleTypeBlob *type = (SimpleTypeBlob *)&typelib->data[offset];
|
||||
@ -139,7 +139,7 @@ _g_type_info_new (GIBaseInfo *container,
|
||||
void
|
||||
_g_type_info_init (GIBaseInfo *info,
|
||||
GIBaseInfo *container,
|
||||
GTypelib *typelib,
|
||||
GITypelib *typelib,
|
||||
guint32 offset)
|
||||
{
|
||||
GIRealInfo *rinfo = (GIRealInfo*)container;
|
||||
@ -153,7 +153,7 @@ _g_type_info_init (GIBaseInfo *info,
|
||||
|
||||
/**
|
||||
* SECTION:gibaseinfo
|
||||
* @Short_description: Base struct for all GTypelib structs
|
||||
* @Short_description: Base struct for all GITypelib structs
|
||||
* @Title: GIBaseInfo
|
||||
*
|
||||
* GIBaseInfo is the common base struct of all other *Info structs
|
||||
@ -611,7 +611,7 @@ g_base_info_get_container (GIBaseInfo *info)
|
||||
*
|
||||
* Returns: (transfer none): the typelib.
|
||||
*/
|
||||
GTypelib *
|
||||
GITypelib *
|
||||
g_base_info_get_typelib (GIBaseInfo *info)
|
||||
{
|
||||
return ((GIRealInfo*)info)->typelib;
|
||||
|
@ -71,12 +71,12 @@ gboolean g_base_info_iterate_attributes (GIBaseInfo *info,
|
||||
char **name,
|
||||
char **value);
|
||||
GIBaseInfo * g_base_info_get_container (GIBaseInfo *info);
|
||||
GTypelib * g_base_info_get_typelib (GIBaseInfo *info);
|
||||
GITypelib * g_base_info_get_typelib (GIBaseInfo *info);
|
||||
gboolean g_base_info_equal (GIBaseInfo *info1,
|
||||
GIBaseInfo *info2);
|
||||
GIBaseInfo * g_info_new (GIInfoType type,
|
||||
GIBaseInfo *container,
|
||||
GTypelib *typelib,
|
||||
GITypelib *typelib,
|
||||
guint32 offset);
|
||||
|
||||
G_END_DECLS
|
||||
|
@ -49,7 +49,7 @@ struct _GIRealInfo
|
||||
|
||||
/* Resolved specific */
|
||||
|
||||
GTypelib *typelib;
|
||||
GITypelib *typelib;
|
||||
guint32 offset;
|
||||
|
||||
guint32 type_is_embedded : 1; /* Used by GITypeInfo */
|
||||
@ -76,26 +76,26 @@ void _g_info_init (GIRealInfo *info,
|
||||
GIInfoType type,
|
||||
GIRepository *repository,
|
||||
GIBaseInfo *container,
|
||||
GTypelib *typelib,
|
||||
GITypelib *typelib,
|
||||
guint32 offset);
|
||||
|
||||
GIBaseInfo * _g_info_from_entry (GIRepository *repository,
|
||||
GTypelib *typelib,
|
||||
GITypelib *typelib,
|
||||
guint16 index);
|
||||
|
||||
GIBaseInfo * _g_info_new_full (GIInfoType type,
|
||||
GIRepository *repository,
|
||||
GIBaseInfo *container,
|
||||
GTypelib *typelib,
|
||||
GITypelib *typelib,
|
||||
guint32 offset);
|
||||
|
||||
GITypeInfo * _g_type_info_new (GIBaseInfo *container,
|
||||
GTypelib *typelib,
|
||||
GITypelib *typelib,
|
||||
guint32 offset);
|
||||
|
||||
void _g_type_info_init (GIBaseInfo *info,
|
||||
GIBaseInfo *container,
|
||||
GTypelib *typelib,
|
||||
GITypelib *typelib,
|
||||
guint32 offset);
|
||||
|
||||
GIFunctionInfo * _g_base_info_find_method (GIBaseInfo *base,
|
||||
|
@ -42,8 +42,8 @@ static GSList *override_search_path = NULL;
|
||||
|
||||
struct _GIRepositoryPrivate
|
||||
{
|
||||
GHashTable *typelibs; /* (string) namespace -> GTypelib */
|
||||
GHashTable *lazy_typelibs; /* (string) namespace-version -> GTypelib */
|
||||
GHashTable *typelibs; /* (string) namespace -> GITypelib */
|
||||
GHashTable *lazy_typelibs; /* (string) namespace-version -> GITypelib */
|
||||
GHashTable *info_by_gtype; /* GType -> GIBaseInfo */
|
||||
};
|
||||
|
||||
@ -193,7 +193,7 @@ build_typelib_key (const char *name, const char *source)
|
||||
}
|
||||
|
||||
static char **
|
||||
get_typelib_dependencies (GTypelib *typelib)
|
||||
get_typelib_dependencies (GITypelib *typelib)
|
||||
{
|
||||
Header *header;
|
||||
const char *dependencies_glob;
|
||||
@ -218,8 +218,8 @@ get_repository (GIRepository *repository)
|
||||
return default_repository;
|
||||
}
|
||||
|
||||
static GTypelib *
|
||||
check_version_conflict (GTypelib *typelib,
|
||||
static GITypelib *
|
||||
check_version_conflict (GITypelib *typelib,
|
||||
const gchar *namespace,
|
||||
const gchar *expected_version,
|
||||
char **version_conflict)
|
||||
@ -249,7 +249,7 @@ check_version_conflict (GTypelib *typelib,
|
||||
return typelib;
|
||||
}
|
||||
|
||||
static GTypelib *
|
||||
static GITypelib *
|
||||
get_registered_status (GIRepository *repository,
|
||||
const char *namespace,
|
||||
const char *version,
|
||||
@ -257,7 +257,7 @@ get_registered_status (GIRepository *repository,
|
||||
gboolean *lazy_status,
|
||||
char **version_conflict)
|
||||
{
|
||||
GTypelib *typelib;
|
||||
GITypelib *typelib;
|
||||
repository = get_repository (repository);
|
||||
if (lazy_status)
|
||||
*lazy_status = FALSE;
|
||||
@ -274,7 +274,7 @@ get_registered_status (GIRepository *repository,
|
||||
return check_version_conflict (typelib, namespace, version, version_conflict);
|
||||
}
|
||||
|
||||
static GTypelib *
|
||||
static GITypelib *
|
||||
get_registered (GIRepository *repository,
|
||||
const char *namespace,
|
||||
const char *version)
|
||||
@ -284,7 +284,7 @@ get_registered (GIRepository *repository,
|
||||
|
||||
static gboolean
|
||||
load_dependencies_recurse (GIRepository *repository,
|
||||
GTypelib *typelib,
|
||||
GITypelib *typelib,
|
||||
GError **error)
|
||||
{
|
||||
char **dependencies;
|
||||
@ -324,7 +324,7 @@ static const char *
|
||||
register_internal (GIRepository *repository,
|
||||
const char *source,
|
||||
gboolean lazy,
|
||||
GTypelib *typelib,
|
||||
GITypelib *typelib,
|
||||
GError **error)
|
||||
{
|
||||
Header *header;
|
||||
@ -388,7 +388,7 @@ char **
|
||||
g_irepository_get_dependencies (GIRepository *repository,
|
||||
const char *namespace)
|
||||
{
|
||||
GTypelib *typelib;
|
||||
GITypelib *typelib;
|
||||
|
||||
g_return_val_if_fail (namespace != NULL, NULL);
|
||||
|
||||
@ -402,7 +402,7 @@ g_irepository_get_dependencies (GIRepository *repository,
|
||||
|
||||
const char *
|
||||
g_irepository_load_typelib (GIRepository *repository,
|
||||
GTypelib *typelib,
|
||||
GITypelib *typelib,
|
||||
GIRepositoryLoadFlags flags,
|
||||
GError **error)
|
||||
{
|
||||
@ -497,7 +497,7 @@ gint
|
||||
g_irepository_get_n_infos (GIRepository *repository,
|
||||
const gchar *namespace)
|
||||
{
|
||||
GTypelib *typelib;
|
||||
GITypelib *typelib;
|
||||
gint n_interfaces = 0;
|
||||
|
||||
g_return_val_if_fail (namespace != NULL, -1);
|
||||
@ -529,7 +529,7 @@ find_interface (gpointer key,
|
||||
gpointer data)
|
||||
{
|
||||
gint i;
|
||||
GTypelib *typelib = (GTypelib *)value;
|
||||
GITypelib *typelib = (GITypelib *)value;
|
||||
Header *header = (Header *) typelib->data;
|
||||
IfaceData *iface_data = (IfaceData *)data;
|
||||
gint index;
|
||||
@ -633,7 +633,7 @@ g_irepository_get_info (GIRepository *repository,
|
||||
gint index)
|
||||
{
|
||||
IfaceData data;
|
||||
GTypelib *typelib;
|
||||
GITypelib *typelib;
|
||||
|
||||
g_return_val_if_fail (namespace != NULL, NULL);
|
||||
|
||||
@ -727,7 +727,7 @@ g_irepository_find_by_name (GIRepository *repository,
|
||||
const gchar *name)
|
||||
{
|
||||
IfaceData data;
|
||||
GTypelib *typelib;
|
||||
GITypelib *typelib;
|
||||
|
||||
g_return_val_if_fail (namespace != NULL, NULL);
|
||||
|
||||
@ -804,7 +804,7 @@ const gchar *
|
||||
g_irepository_get_version (GIRepository *repository,
|
||||
const gchar *namespace)
|
||||
{
|
||||
GTypelib *typelib;
|
||||
GITypelib *typelib;
|
||||
Header *header;
|
||||
|
||||
g_return_val_if_fail (namespace != NULL, NULL);
|
||||
@ -838,7 +838,7 @@ const gchar *
|
||||
g_irepository_get_shared_library (GIRepository *repository,
|
||||
const gchar *namespace)
|
||||
{
|
||||
GTypelib *typelib;
|
||||
GITypelib *typelib;
|
||||
Header *header;
|
||||
|
||||
g_return_val_if_fail (namespace != NULL, NULL);
|
||||
@ -874,7 +874,7 @@ const gchar *
|
||||
g_irepository_get_c_prefix (GIRepository *repository,
|
||||
const gchar *namespace_)
|
||||
{
|
||||
GTypelib *typelib;
|
||||
GITypelib *typelib;
|
||||
Header *header;
|
||||
|
||||
g_return_val_if_fail (namespace_ != NULL, NULL);
|
||||
@ -1206,7 +1206,7 @@ g_irepository_enumerate_versions (GIRepository *repository,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static GTypelib *
|
||||
static GITypelib *
|
||||
require_internal (GIRepository *repository,
|
||||
const gchar *namespace,
|
||||
const gchar *version,
|
||||
@ -1215,9 +1215,9 @@ require_internal (GIRepository *repository,
|
||||
GError **error)
|
||||
{
|
||||
GMappedFile *mfile;
|
||||
GTypelib *ret = NULL;
|
||||
GITypelib *ret = NULL;
|
||||
Header *header;
|
||||
GTypelib *typelib = NULL;
|
||||
GITypelib *typelib = NULL;
|
||||
const gchar *typelib_namespace, *typelib_version;
|
||||
gboolean allow_lazy = (flags & G_IREPOSITORY_LOAD_FLAG_LAZY) > 0;
|
||||
gboolean is_lazy;
|
||||
@ -1335,9 +1335,9 @@ require_internal (GIRepository *repository,
|
||||
* version @version of namespace may be specified. If @version is
|
||||
* not specified, the latest will be used.
|
||||
*
|
||||
* Returns: (transfer full): a pointer to the #GTypelib if successful, %NULL otherwise
|
||||
* Returns: (transfer full): a pointer to the #GITypelib if successful, %NULL otherwise
|
||||
*/
|
||||
GTypelib *
|
||||
GITypelib *
|
||||
g_irepository_require (GIRepository *repository,
|
||||
const gchar *namespace,
|
||||
const gchar *version,
|
||||
@ -1345,7 +1345,7 @@ g_irepository_require (GIRepository *repository,
|
||||
GError **error)
|
||||
{
|
||||
GSList *search_path;
|
||||
GTypelib *typelib;
|
||||
GITypelib *typelib;
|
||||
|
||||
search_path = build_search_path_with_overrides ();
|
||||
typelib = require_internal (repository, namespace, version, flags,
|
||||
@ -1370,9 +1370,9 @@ g_irepository_require (GIRepository *repository,
|
||||
* version @version of namespace should be specified. If @version is
|
||||
* not specified, the latest will be used.
|
||||
*
|
||||
* Returns: (transfer full): a pointer to the #GTypelib if successful, %NULL otherwise
|
||||
* Returns: (transfer full): a pointer to the #GITypelib if successful, %NULL otherwise
|
||||
*/
|
||||
GTypelib *
|
||||
GITypelib *
|
||||
g_irepository_require_private (GIRepository *repository,
|
||||
const gchar *typelib_dir,
|
||||
const gchar *namespace,
|
||||
|
@ -92,7 +92,7 @@ GIRepository *g_irepository_get_default (void);
|
||||
void g_irepository_prepend_search_path (const char *directory);
|
||||
GSList * g_irepository_get_search_path (void);
|
||||
const char * g_irepository_load_typelib (GIRepository *repository,
|
||||
GTypelib *typelib,
|
||||
GITypelib *typelib,
|
||||
GIRepositoryLoadFlags flags,
|
||||
GError **error);
|
||||
gboolean g_irepository_is_registered (GIRepository *repository,
|
||||
@ -103,12 +103,12 @@ GIBaseInfo * g_irepository_find_by_name (GIRepository *repository,
|
||||
const gchar *name);
|
||||
GList * g_irepository_enumerate_versions (GIRepository *repository,
|
||||
const gchar *namespace_);
|
||||
GTypelib * g_irepository_require (GIRepository *repository,
|
||||
GITypelib * g_irepository_require (GIRepository *repository,
|
||||
const gchar *namespace_,
|
||||
const gchar *version,
|
||||
GIRepositoryLoadFlags flags,
|
||||
GError **error);
|
||||
GTypelib * g_irepository_require_private (GIRepository *repository,
|
||||
GITypelib * g_irepository_require_private (GIRepository *repository,
|
||||
const gchar *typelib_dir,
|
||||
const gchar *namespace,
|
||||
const gchar *version,
|
||||
|
@ -221,11 +221,11 @@ node_cmp_offset_func (gconstpointer a,
|
||||
}
|
||||
|
||||
|
||||
GTypelib *
|
||||
GITypelib *
|
||||
g_ir_module_build_typelib (GIrModule *module)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GTypelib *typelib;
|
||||
GITypelib *typelib;
|
||||
gsize length;
|
||||
guint i;
|
||||
GList *e;
|
||||
|
@ -68,7 +68,7 @@ void g_ir_module_free (GIrModule *module);
|
||||
void g_ir_module_add_include_module (GIrModule *module,
|
||||
GIrModule *include_module);
|
||||
|
||||
GTypelib * g_ir_module_build_typelib (GIrModule *module);
|
||||
GITypelib * g_ir_module_build_typelib (GIrModule *module);
|
||||
|
||||
void g_ir_module_fatal (GIrTypelibBuild *build, guint line, const char *msg, ...) G_GNUC_PRINTF (3, 4) G_GNUC_NORETURN;
|
||||
|
||||
|
@ -1085,9 +1085,9 @@ typedef struct {
|
||||
} AttributeBlob;
|
||||
|
||||
/**
|
||||
* GTypelib:
|
||||
* GITypelib:
|
||||
*/
|
||||
struct _GTypelib {
|
||||
struct _GITypelib {
|
||||
/* <private> */
|
||||
guchar *data;
|
||||
gsize len;
|
||||
@ -1097,7 +1097,7 @@ struct _GTypelib {
|
||||
gboolean open_attempted;
|
||||
};
|
||||
|
||||
DirEntry *g_typelib_get_dir_entry (GTypelib *typelib,
|
||||
DirEntry *g_typelib_get_dir_entry (GITypelib *typelib,
|
||||
guint16 index);
|
||||
|
||||
void g_typelib_check_sanity (void);
|
||||
@ -1106,14 +1106,14 @@ void g_typelib_check_sanity (void);
|
||||
|
||||
|
||||
/**
|
||||
* GTypelibError:
|
||||
* GITypelibError:
|
||||
* @G_TYPELIB_ERROR_INVALID: the typelib is invalid
|
||||
* @G_TYPELIB_ERROR_INVALID_HEADER: the typelib header is invalid
|
||||
* @G_TYPELIB_ERROR_INVALID_DIRECTORY: the typelib directory is invalid
|
||||
* @G_TYPELIB_ERROR_INVALID_ENTRY: a typelib entry is invalid
|
||||
* @G_TYPELIB_ERROR_INVALID_BLOB: a typelib blob is invalid
|
||||
*
|
||||
* A error set while validating the #GTypelib
|
||||
* A error set while validating the #GITypelib
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
@ -1122,13 +1122,13 @@ typedef enum
|
||||
G_TYPELIB_ERROR_INVALID_DIRECTORY,
|
||||
G_TYPELIB_ERROR_INVALID_ENTRY,
|
||||
G_TYPELIB_ERROR_INVALID_BLOB
|
||||
} GTypelibError;
|
||||
} GITypelibError;
|
||||
|
||||
#define G_TYPELIB_ERROR (g_typelib_error_quark ())
|
||||
|
||||
GQuark g_typelib_error_quark (void);
|
||||
|
||||
gboolean g_typelib_validate (GTypelib *typelib,
|
||||
gboolean g_typelib_validate (GITypelib *typelib,
|
||||
GError **error);
|
||||
|
||||
|
||||
|
120
gitypelib.c
120
gitypelib.c
@ -29,7 +29,7 @@
|
||||
#include "glib-compat.h"
|
||||
|
||||
typedef struct {
|
||||
GTypelib *typelib;
|
||||
GITypelib *typelib;
|
||||
GSList *context_stack;
|
||||
} ValidateContext;
|
||||
|
||||
@ -56,7 +56,7 @@ validate_interface_blob (ValidateContext *ctx,
|
||||
GError **error);
|
||||
|
||||
static DirEntry *
|
||||
get_dir_entry_checked (GTypelib *typelib,
|
||||
get_dir_entry_checked (GITypelib *typelib,
|
||||
guint16 index,
|
||||
GError **error)
|
||||
{
|
||||
@ -88,7 +88,7 @@ get_dir_entry_checked (GTypelib *typelib,
|
||||
|
||||
|
||||
static CommonBlob *
|
||||
get_blob (GTypelib *typelib,
|
||||
get_blob (GITypelib *typelib,
|
||||
guint32 offset,
|
||||
GError **error)
|
||||
{
|
||||
@ -104,7 +104,7 @@ get_blob (GTypelib *typelib,
|
||||
}
|
||||
|
||||
static InterfaceTypeBlob *
|
||||
get_type_blob (GTypelib *typelib,
|
||||
get_type_blob (GITypelib *typelib,
|
||||
SimpleTypeBlob *simple,
|
||||
GError **error)
|
||||
{
|
||||
@ -131,7 +131,7 @@ get_type_blob (GTypelib *typelib,
|
||||
}
|
||||
|
||||
DirEntry *
|
||||
g_typelib_get_dir_entry (GTypelib *typelib,
|
||||
g_typelib_get_dir_entry (GITypelib *typelib,
|
||||
guint16 index)
|
||||
{
|
||||
Header *header = (Header *)typelib->data;
|
||||
@ -203,7 +203,7 @@ is_aligned (guint32 offset)
|
||||
#define MAX_NAME_LEN 200
|
||||
|
||||
static const char *
|
||||
get_string (GTypelib *typelib, guint32 offset, GError **error)
|
||||
get_string (GITypelib *typelib, guint32 offset, GError **error)
|
||||
{
|
||||
if (typelib->len < offset)
|
||||
{
|
||||
@ -218,7 +218,7 @@ get_string (GTypelib *typelib, guint32 offset, GError **error)
|
||||
}
|
||||
|
||||
static const char *
|
||||
get_string_nofail (GTypelib *typelib, guint32 offset)
|
||||
get_string_nofail (GITypelib *typelib, guint32 offset)
|
||||
{
|
||||
const char *ret = get_string (typelib, offset, NULL);
|
||||
g_assert (ret);
|
||||
@ -226,7 +226,7 @@ get_string_nofail (GTypelib *typelib, guint32 offset)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
validate_name (GTypelib *typelib,
|
||||
validate_name (GITypelib *typelib,
|
||||
const char *msg,
|
||||
const guchar *data, guint32 offset,
|
||||
GError **error)
|
||||
@ -386,7 +386,7 @@ static gboolean
|
||||
validate_header (ValidateContext *ctx,
|
||||
GError **error)
|
||||
{
|
||||
GTypelib *typelib = ctx->typelib;
|
||||
GITypelib *typelib = ctx->typelib;
|
||||
|
||||
if (!validate_header_basic (typelib->data, typelib->len, error))
|
||||
return FALSE;
|
||||
@ -400,14 +400,14 @@ validate_header (ValidateContext *ctx,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean validate_type_blob (GTypelib *typelib,
|
||||
static gboolean validate_type_blob (GITypelib *typelib,
|
||||
guint32 offset,
|
||||
guint32 signature_offset,
|
||||
gboolean return_type,
|
||||
GError **error);
|
||||
|
||||
static gboolean
|
||||
validate_array_type_blob (GTypelib *typelib,
|
||||
validate_array_type_blob (GITypelib *typelib,
|
||||
guint32 offset,
|
||||
guint32 signature_offset,
|
||||
gboolean return_type,
|
||||
@ -437,7 +437,7 @@ validate_array_type_blob (GTypelib *typelib,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
validate_iface_type_blob (GTypelib *typelib,
|
||||
validate_iface_type_blob (GITypelib *typelib,
|
||||
guint32 offset,
|
||||
guint32 signature_offset,
|
||||
gboolean return_type,
|
||||
@ -459,7 +459,7 @@ validate_iface_type_blob (GTypelib *typelib,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
validate_param_type_blob (GTypelib *typelib,
|
||||
validate_param_type_blob (GITypelib *typelib,
|
||||
guint32 offset,
|
||||
guint32 signature_offset,
|
||||
gboolean return_type,
|
||||
@ -502,7 +502,7 @@ validate_param_type_blob (GTypelib *typelib,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
validate_error_type_blob (GTypelib *typelib,
|
||||
validate_error_type_blob (GITypelib *typelib,
|
||||
guint32 offset,
|
||||
guint32 signature_offset,
|
||||
gboolean return_type,
|
||||
@ -554,7 +554,7 @@ validate_error_type_blob (GTypelib *typelib,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
validate_type_blob (GTypelib *typelib,
|
||||
validate_type_blob (GITypelib *typelib,
|
||||
guint32 offset,
|
||||
guint32 signature_offset,
|
||||
gboolean return_type,
|
||||
@ -632,7 +632,7 @@ validate_type_blob (GTypelib *typelib,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
validate_arg_blob (GTypelib *typelib,
|
||||
validate_arg_blob (GITypelib *typelib,
|
||||
guint32 offset,
|
||||
guint32 signature_offset,
|
||||
GError **error)
|
||||
@ -662,7 +662,7 @@ validate_arg_blob (GTypelib *typelib,
|
||||
}
|
||||
|
||||
static SimpleTypeBlob *
|
||||
return_type_from_signature (GTypelib *typelib,
|
||||
return_type_from_signature (GITypelib *typelib,
|
||||
guint32 offset,
|
||||
GError **error)
|
||||
{
|
||||
@ -690,7 +690,7 @@ return_type_from_signature (GTypelib *typelib,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
validate_signature_blob (GTypelib *typelib,
|
||||
validate_signature_blob (GITypelib *typelib,
|
||||
guint32 offset,
|
||||
GError **error)
|
||||
{
|
||||
@ -737,7 +737,7 @@ validate_function_blob (ValidateContext *ctx,
|
||||
guint16 container_type,
|
||||
GError **error)
|
||||
{
|
||||
GTypelib *typelib = ctx->typelib;
|
||||
GITypelib *typelib = ctx->typelib;
|
||||
FunctionBlob *blob;
|
||||
SignatureBlob *sigblob;
|
||||
gboolean is_method;
|
||||
@ -873,7 +873,7 @@ validate_callback_blob (ValidateContext *ctx,
|
||||
guint32 offset,
|
||||
GError **error)
|
||||
{
|
||||
GTypelib *typelib = ctx->typelib;
|
||||
GITypelib *typelib = ctx->typelib;
|
||||
CallbackBlob *blob;
|
||||
|
||||
if (typelib->len < offset + sizeof (CallbackBlob))
|
||||
@ -910,7 +910,7 @@ validate_callback_blob (ValidateContext *ctx,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
validate_constant_blob (GTypelib *typelib,
|
||||
validate_constant_blob (GITypelib *typelib,
|
||||
guint32 offset,
|
||||
GError **error)
|
||||
{
|
||||
@ -1006,7 +1006,7 @@ validate_constant_blob (GTypelib *typelib,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
validate_value_blob (GTypelib *typelib,
|
||||
validate_value_blob (GITypelib *typelib,
|
||||
guint32 offset,
|
||||
GError **error)
|
||||
{
|
||||
@ -1034,7 +1034,7 @@ validate_field_blob (ValidateContext *ctx,
|
||||
guint32 offset,
|
||||
GError **error)
|
||||
{
|
||||
GTypelib *typelib = ctx->typelib;
|
||||
GITypelib *typelib = ctx->typelib;
|
||||
Header *header = (Header *)typelib->data;
|
||||
FieldBlob *blob;
|
||||
|
||||
@ -1066,7 +1066,7 @@ validate_field_blob (ValidateContext *ctx,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
validate_property_blob (GTypelib *typelib,
|
||||
validate_property_blob (GITypelib *typelib,
|
||||
guint32 offset,
|
||||
GError **error)
|
||||
{
|
||||
@ -1095,7 +1095,7 @@ validate_property_blob (GTypelib *typelib,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
validate_signal_blob (GTypelib *typelib,
|
||||
validate_signal_blob (GITypelib *typelib,
|
||||
guint32 offset,
|
||||
guint32 container_offset,
|
||||
GError **error)
|
||||
@ -1164,7 +1164,7 @@ validate_signal_blob (GTypelib *typelib,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
validate_vfunc_blob (GTypelib *typelib,
|
||||
validate_vfunc_blob (GITypelib *typelib,
|
||||
guint32 offset,
|
||||
guint32 container_offset,
|
||||
GError **error)
|
||||
@ -1227,7 +1227,7 @@ validate_struct_blob (ValidateContext *ctx,
|
||||
guint16 blob_type,
|
||||
GError **error)
|
||||
{
|
||||
GTypelib *typelib = ctx->typelib;
|
||||
GITypelib *typelib = ctx->typelib;
|
||||
StructBlob *blob;
|
||||
gint i;
|
||||
guint32 field_offset;
|
||||
@ -1324,7 +1324,7 @@ validate_enum_blob (ValidateContext *ctx,
|
||||
guint16 blob_type,
|
||||
GError **error)
|
||||
{
|
||||
GTypelib *typelib = ctx->typelib;
|
||||
GITypelib *typelib = ctx->typelib;
|
||||
EnumBlob *blob;
|
||||
gint i;
|
||||
|
||||
@ -1423,7 +1423,7 @@ validate_object_blob (ValidateContext *ctx,
|
||||
guint32 offset,
|
||||
GError **error)
|
||||
{
|
||||
GTypelib *typelib = ctx->typelib;
|
||||
GITypelib *typelib = ctx->typelib;
|
||||
Header *header;
|
||||
ObjectBlob *blob;
|
||||
gint i;
|
||||
@ -1603,7 +1603,7 @@ validate_interface_blob (ValidateContext *ctx,
|
||||
guint32 offset,
|
||||
GError **error)
|
||||
{
|
||||
GTypelib *typelib = ctx->typelib;
|
||||
GITypelib *typelib = ctx->typelib;
|
||||
Header *header;
|
||||
InterfaceBlob *blob;
|
||||
gint i;
|
||||
@ -1726,7 +1726,7 @@ validate_interface_blob (ValidateContext *ctx,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
validate_errordomain_blob (GTypelib *typelib,
|
||||
validate_errordomain_blob (GITypelib *typelib,
|
||||
guint32 offset,
|
||||
GError **error)
|
||||
{
|
||||
@ -1734,7 +1734,7 @@ validate_errordomain_blob (GTypelib *typelib,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
validate_union_blob (GTypelib *typelib,
|
||||
validate_union_blob (GITypelib *typelib,
|
||||
guint32 offset,
|
||||
GError **error)
|
||||
{
|
||||
@ -1746,7 +1746,7 @@ validate_blob (ValidateContext *ctx,
|
||||
guint32 offset,
|
||||
GError **error)
|
||||
{
|
||||
GTypelib *typelib = ctx->typelib;
|
||||
GITypelib *typelib = ctx->typelib;
|
||||
CommonBlob *common;
|
||||
|
||||
if (typelib->len < offset + sizeof (CommonBlob))
|
||||
@ -1815,7 +1815,7 @@ static gboolean
|
||||
validate_directory (ValidateContext *ctx,
|
||||
GError **error)
|
||||
{
|
||||
GTypelib *typelib = ctx->typelib;
|
||||
GITypelib *typelib = ctx->typelib;
|
||||
Header *header = (Header *)typelib->data;
|
||||
DirEntry *entry;
|
||||
gint i;
|
||||
@ -1892,7 +1892,7 @@ static gboolean
|
||||
validate_attributes (ValidateContext *ctx,
|
||||
GError **error)
|
||||
{
|
||||
GTypelib *typelib = ctx->typelib;
|
||||
GITypelib *typelib = ctx->typelib;
|
||||
Header *header = (Header *)typelib->data;
|
||||
|
||||
if (header->size < header->attributes + header->n_attributes * sizeof (AttributeBlob))
|
||||
@ -1936,7 +1936,7 @@ prefix_with_context (GError **error,
|
||||
}
|
||||
|
||||
gboolean
|
||||
g_typelib_validate (GTypelib *typelib,
|
||||
g_typelib_validate (GITypelib *typelib,
|
||||
GError **error)
|
||||
{
|
||||
ValidateContext ctx;
|
||||
@ -1974,7 +1974,7 @@ g_typelib_error_quark (void)
|
||||
}
|
||||
|
||||
static void
|
||||
_g_typelib_do_dlopen (GTypelib *typelib)
|
||||
_g_typelib_do_dlopen (GITypelib *typelib)
|
||||
{
|
||||
Header *header;
|
||||
const char *shlib_str;
|
||||
@ -2060,7 +2060,7 @@ _g_typelib_do_dlopen (GTypelib *typelib)
|
||||
}
|
||||
|
||||
static inline void
|
||||
_g_typelib_ensure_open (GTypelib *typelib)
|
||||
_g_typelib_ensure_open (GITypelib *typelib)
|
||||
{
|
||||
if (typelib->open_attempted)
|
||||
return;
|
||||
@ -2074,23 +2074,23 @@ _g_typelib_ensure_open (GTypelib *typelib)
|
||||
* @len: length of memory chunk containing the typelib
|
||||
* @error: a #GError
|
||||
*
|
||||
* Creates a new #GTypelib from a memory location. The memory block
|
||||
* Creates a new #GITypelib from a memory location. The memory block
|
||||
* pointed to by @typelib will be automatically g_free()d when the
|
||||
* repository is destroyed.
|
||||
*
|
||||
* Return value: the new #GTypelib
|
||||
* Return value: the new #GITypelib
|
||||
**/
|
||||
GTypelib *
|
||||
GITypelib *
|
||||
g_typelib_new_from_memory (guint8 *memory,
|
||||
gsize len,
|
||||
GError **error)
|
||||
{
|
||||
GTypelib *meta;
|
||||
GITypelib *meta;
|
||||
|
||||
if (!validate_header_basic (memory, len, error))
|
||||
return NULL;
|
||||
|
||||
meta = g_slice_new0 (GTypelib);
|
||||
meta = g_slice_new0 (GITypelib);
|
||||
meta->data = memory;
|
||||
meta->len = len;
|
||||
meta->owns_memory = TRUE;
|
||||
@ -2105,21 +2105,21 @@ g_typelib_new_from_memory (guint8 *memory,
|
||||
* @len: length of memory chunk containing the typelib
|
||||
* @error: A #GError
|
||||
*
|
||||
* Creates a new #GTypelib from a memory location.
|
||||
* Creates a new #GITypelib from a memory location.
|
||||
*
|
||||
* Return value: the new #GTypelib
|
||||
* Return value: the new #GITypelib
|
||||
**/
|
||||
GTypelib *
|
||||
GITypelib *
|
||||
g_typelib_new_from_const_memory (const guchar *memory,
|
||||
gsize len,
|
||||
GError **error)
|
||||
{
|
||||
GTypelib *meta;
|
||||
GITypelib *meta;
|
||||
|
||||
if (!validate_header_basic (memory, len, error))
|
||||
return NULL;
|
||||
|
||||
meta = g_slice_new0 (GTypelib);
|
||||
meta = g_slice_new0 (GITypelib);
|
||||
meta->data = (guchar *) memory;
|
||||
meta->len = len;
|
||||
meta->owns_memory = FALSE;
|
||||
@ -2133,22 +2133,22 @@ g_typelib_new_from_const_memory (const guchar *memory,
|
||||
* @mfile: a #GMappedFile, that will be free'd when the repository is destroyed
|
||||
* @error: a #GError
|
||||
*
|
||||
* Creates a new #GTypelib from a #GMappedFile.
|
||||
* Creates a new #GITypelib from a #GMappedFile.
|
||||
*
|
||||
* Return value: the new #GTypelib
|
||||
* Return value: the new #GITypelib
|
||||
**/
|
||||
GTypelib *
|
||||
GITypelib *
|
||||
g_typelib_new_from_mapped_file (GMappedFile *mfile,
|
||||
GError **error)
|
||||
{
|
||||
GTypelib *meta;
|
||||
GITypelib *meta;
|
||||
guint8 *data = (guint8 *) g_mapped_file_get_contents (mfile);
|
||||
gsize len = g_mapped_file_get_length (mfile);
|
||||
|
||||
if (!validate_header_basic (data, len, error))
|
||||
return NULL;
|
||||
|
||||
meta = g_slice_new0 (GTypelib);
|
||||
meta = g_slice_new0 (GITypelib);
|
||||
meta->mfile = mfile;
|
||||
meta->owns_memory = FALSE;
|
||||
meta->data = data;
|
||||
@ -2159,12 +2159,12 @@ g_typelib_new_from_mapped_file (GMappedFile *mfile,
|
||||
|
||||
/**
|
||||
* g_typelib_free:
|
||||
* @typelib: a #GTypelib
|
||||
* @typelib: a #GITypelib
|
||||
*
|
||||
* Free a #GTypelib.
|
||||
* Free a #GITypelib.
|
||||
**/
|
||||
void
|
||||
g_typelib_free (GTypelib *typelib)
|
||||
g_typelib_free (GITypelib *typelib)
|
||||
{
|
||||
if (typelib->mfile)
|
||||
g_mapped_file_unref (typelib->mfile);
|
||||
@ -2176,11 +2176,11 @@ g_typelib_free (GTypelib *typelib)
|
||||
g_list_foreach (typelib->modules, (GFunc) g_module_close, NULL);
|
||||
g_list_free (typelib->modules);
|
||||
}
|
||||
g_slice_free (GTypelib, typelib);
|
||||
g_slice_free (GITypelib, typelib);
|
||||
}
|
||||
|
||||
const gchar *
|
||||
g_typelib_get_namespace (GTypelib *typelib)
|
||||
g_typelib_get_namespace (GITypelib *typelib)
|
||||
{
|
||||
return g_typelib_get_string (typelib, ((Header *) typelib->data)->namespace);
|
||||
}
|
||||
@ -2191,12 +2191,12 @@ g_typelib_get_namespace (GTypelib *typelib)
|
||||
* @symbol_name: name of symbol to be loaded
|
||||
* @symbol: returns a pointer to the symbol value
|
||||
*
|
||||
* Loads a symbol from #GTypelib.
|
||||
* Loads a symbol from #GITypelib.
|
||||
*
|
||||
* Return value: #TRUE on success
|
||||
**/
|
||||
gboolean
|
||||
g_typelib_symbol (GTypelib *typelib, const char *symbol_name, gpointer *symbol)
|
||||
g_typelib_symbol (GITypelib *typelib, const char *symbol_name, gpointer *symbol)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
|
14
gitypelib.h
14
gitypelib.h
@ -32,22 +32,22 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _GTypelib GTypelib;
|
||||
typedef struct _GITypelib GITypelib;
|
||||
|
||||
GTypelib * g_typelib_new_from_memory (guint8 *memory,
|
||||
GITypelib * g_typelib_new_from_memory (guint8 *memory,
|
||||
gsize len,
|
||||
GError **error);
|
||||
GTypelib * g_typelib_new_from_const_memory (const guint8 *memory,
|
||||
GITypelib * g_typelib_new_from_const_memory (const guint8 *memory,
|
||||
gsize len,
|
||||
GError **error);
|
||||
GTypelib * g_typelib_new_from_mapped_file (GMappedFile *mfile,
|
||||
GITypelib * g_typelib_new_from_mapped_file (GMappedFile *mfile,
|
||||
GError **error);
|
||||
void g_typelib_free (GTypelib *typelib);
|
||||
void g_typelib_free (GITypelib *typelib);
|
||||
|
||||
gboolean g_typelib_symbol (GTypelib *typelib,
|
||||
gboolean g_typelib_symbol (GITypelib *typelib,
|
||||
const gchar *symbol_name,
|
||||
gpointer *symbol);
|
||||
const gchar * g_typelib_get_namespace (GTypelib *typelib);
|
||||
const gchar * g_typelib_get_namespace (GITypelib *typelib);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
Loading…
Reference in New Issue
Block a user