mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-27 16:06:16 +01:00
girepository: Consistently prefix internal functions with _
This should better avoid them being exported. Rename girepository-parser.la to girepository-internals.la for clarity.
This commit is contained in:
parent
61e5bdb7ba
commit
ff33cc0791
58
girmodule.c
58
girmodule.c
@ -30,10 +30,10 @@
|
|||||||
|
|
||||||
|
|
||||||
GIrModule *
|
GIrModule *
|
||||||
g_ir_module_new (const gchar *name,
|
_g_ir_module_new (const gchar *name,
|
||||||
const gchar *version,
|
const gchar *version,
|
||||||
const gchar *shared_library,
|
const gchar *shared_library,
|
||||||
const gchar *c_prefix)
|
const gchar *c_prefix)
|
||||||
{
|
{
|
||||||
GIrModule *module;
|
GIrModule *module;
|
||||||
|
|
||||||
@ -56,14 +56,14 @@ g_ir_module_new (const gchar *name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
g_ir_module_free (GIrModule *module)
|
_g_ir_module_free (GIrModule *module)
|
||||||
{
|
{
|
||||||
GList *e;
|
GList *e;
|
||||||
|
|
||||||
g_free (module->name);
|
g_free (module->name);
|
||||||
|
|
||||||
for (e = module->entries; e; e = e->next)
|
for (e = module->entries; e; e = e->next)
|
||||||
g_ir_node_free ((GIrNode *)e->data);
|
_g_ir_node_free ((GIrNode *)e->data);
|
||||||
|
|
||||||
g_list_free (module->entries);
|
g_list_free (module->entries);
|
||||||
/* Don't free dependencies, we inherit that from the parser */
|
/* Don't free dependencies, we inherit that from the parser */
|
||||||
@ -77,7 +77,7 @@ g_ir_module_free (GIrModule *module)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* g_ir_module_fatal:
|
* _g_ir_module_fatal:
|
||||||
* @build: Current build
|
* @build: Current build
|
||||||
* @line: Origin line number, or 0 if unknown
|
* @line: Origin line number, or 0 if unknown
|
||||||
* @msg: printf-format string
|
* @msg: printf-format string
|
||||||
@ -86,10 +86,10 @@ g_ir_module_free (GIrModule *module)
|
|||||||
* Report a fatal error, then exit.
|
* Report a fatal error, then exit.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
g_ir_module_fatal (GIrTypelibBuild *build,
|
_g_ir_module_fatal (GIrTypelibBuild *build,
|
||||||
guint line,
|
guint line,
|
||||||
const char *msg,
|
const char *msg,
|
||||||
...)
|
...)
|
||||||
{
|
{
|
||||||
GString *context;
|
GString *context;
|
||||||
char *formatted;
|
char *formatted;
|
||||||
@ -149,8 +149,8 @@ add_disguised_structure_foreach (gpointer key,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
g_ir_module_add_include_module (GIrModule *module,
|
_g_ir_module_add_include_module (GIrModule *module,
|
||||||
GIrModule *include_module)
|
GIrModule *include_module)
|
||||||
{
|
{
|
||||||
module->include_modules = g_list_prepend (module->include_modules,
|
module->include_modules = g_list_prepend (module->include_modules,
|
||||||
include_module);
|
include_module);
|
||||||
@ -184,8 +184,8 @@ write_attribute (gpointer key, gpointer value, gpointer datap)
|
|||||||
*(data->offset) += sizeof (AttributeBlob);
|
*(data->offset) += sizeof (AttributeBlob);
|
||||||
|
|
||||||
blob->offset = data->node->offset;
|
blob->offset = data->node->offset;
|
||||||
blob->name = write_string ((const char*) key, data->strings, data->databuf, data->offset2);
|
blob->name = _g_ir_write_string ((const char*) key, data->strings, data->databuf, data->offset2);
|
||||||
blob->value = write_string ((const char*) value, data->strings, data->databuf, data->offset2);
|
blob->value = _g_ir_write_string ((const char*) value, data->strings, data->databuf, data->offset2);
|
||||||
|
|
||||||
data->count++;
|
data->count++;
|
||||||
}
|
}
|
||||||
@ -222,7 +222,7 @@ node_cmp_offset_func (gconstpointer a,
|
|||||||
|
|
||||||
|
|
||||||
GITypelib *
|
GITypelib *
|
||||||
g_ir_module_build_typelib (GIrModule *module)
|
_g_ir_module_build_typelib (GIrModule *module)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
GITypelib *typelib;
|
GITypelib *typelib;
|
||||||
@ -286,7 +286,7 @@ g_ir_module_build_typelib (GIrModule *module)
|
|||||||
{
|
{
|
||||||
GIrNode *node = e->data;
|
GIrNode *node = e->data;
|
||||||
|
|
||||||
size += g_ir_node_get_full_size (node);
|
size += _g_ir_node_get_full_size (node);
|
||||||
|
|
||||||
/* Also reset the offset here */
|
/* Also reset the offset here */
|
||||||
node->offset = 0;
|
node->offset = 0;
|
||||||
@ -320,17 +320,17 @@ g_ir_module_build_typelib (GIrModule *module)
|
|||||||
* the size calculations above.
|
* the size calculations above.
|
||||||
*/
|
*/
|
||||||
if (dependencies != NULL)
|
if (dependencies != NULL)
|
||||||
header->dependencies = write_string (dependencies, strings, data, &header_size);
|
header->dependencies = _g_ir_write_string (dependencies, strings, data, &header_size);
|
||||||
else
|
else
|
||||||
header->dependencies = 0;
|
header->dependencies = 0;
|
||||||
header->size = 0; /* filled in later */
|
header->size = 0; /* filled in later */
|
||||||
header->namespace = write_string (module->name, strings, data, &header_size);
|
header->namespace = _g_ir_write_string (module->name, strings, data, &header_size);
|
||||||
header->nsversion = write_string (module->version, strings, data, &header_size);
|
header->nsversion = _g_ir_write_string (module->version, strings, data, &header_size);
|
||||||
header->shared_library = (module->shared_library?
|
header->shared_library = (module->shared_library?
|
||||||
write_string (module->shared_library, strings, data, &header_size)
|
_g_ir_write_string (module->shared_library, strings, data, &header_size)
|
||||||
: 0);
|
: 0);
|
||||||
if (module->c_prefix != NULL)
|
if (module->c_prefix != NULL)
|
||||||
header->c_prefix = write_string (module->c_prefix, strings, data, &header_size);
|
header->c_prefix = _g_ir_write_string (module->c_prefix, strings, data, &header_size);
|
||||||
else
|
else
|
||||||
header->c_prefix = 0;
|
header->c_prefix = 0;
|
||||||
header->directory = ALIGN_VALUE (header_size, 4);
|
header->directory = ALIGN_VALUE (header_size, 4);
|
||||||
@ -398,18 +398,18 @@ g_ir_module_build_typelib (GIrModule *module)
|
|||||||
|
|
||||||
entry->blob_type = 0;
|
entry->blob_type = 0;
|
||||||
entry->local = FALSE;
|
entry->local = FALSE;
|
||||||
entry->offset = write_string (namespace, strings, data, &offset2);
|
entry->offset = _g_ir_write_string (namespace, strings, data, &offset2);
|
||||||
entry->name = write_string (node->name, strings, data, &offset2);
|
entry->name = _g_ir_write_string (node->name, strings, data, &offset2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
old_offset = offset;
|
old_offset = offset;
|
||||||
offset2 = offset + g_ir_node_get_size (node);
|
offset2 = offset + _g_ir_node_get_size (node);
|
||||||
|
|
||||||
entry->blob_type = node->type;
|
entry->blob_type = node->type;
|
||||||
entry->local = TRUE;
|
entry->local = TRUE;
|
||||||
entry->offset = offset;
|
entry->offset = offset;
|
||||||
entry->name = write_string (node->name, strings, data, &offset2);
|
entry->name = _g_ir_write_string (node->name, strings, data, &offset2);
|
||||||
|
|
||||||
memset (&build, 0, sizeof (build));
|
memset (&build, 0, sizeof (build));
|
||||||
build.module = module;
|
build.module = module;
|
||||||
@ -418,13 +418,13 @@ g_ir_module_build_typelib (GIrModule *module)
|
|||||||
build.nodes_with_attributes = nodes_with_attributes;
|
build.nodes_with_attributes = nodes_with_attributes;
|
||||||
build.n_attributes = header->n_attributes;
|
build.n_attributes = header->n_attributes;
|
||||||
build.data = data;
|
build.data = data;
|
||||||
g_ir_node_build_typelib (node, NULL, &build, &offset, &offset2);
|
_g_ir_node_build_typelib (node, NULL, &build, &offset, &offset2);
|
||||||
|
|
||||||
nodes_with_attributes = build.nodes_with_attributes;
|
nodes_with_attributes = build.nodes_with_attributes;
|
||||||
header->n_attributes = build.n_attributes;
|
header->n_attributes = build.n_attributes;
|
||||||
|
|
||||||
if (offset2 > old_offset + g_ir_node_get_full_size (node))
|
if (offset2 > old_offset + _g_ir_node_get_full_size (node))
|
||||||
g_error ("left a hole of %d bytes\n", offset2 - old_offset - g_ir_node_get_full_size (node));
|
g_error ("left a hole of %d bytes\n", offset2 - old_offset - _g_ir_node_get_full_size (node));
|
||||||
}
|
}
|
||||||
|
|
||||||
entry++;
|
entry++;
|
||||||
|
16
girmodule.h
16
girmodule.h
@ -59,18 +59,18 @@ struct _GIrModule
|
|||||||
GHashTable *disguised_structures;
|
GHashTable *disguised_structures;
|
||||||
};
|
};
|
||||||
|
|
||||||
GIrModule *g_ir_module_new (const gchar *name,
|
GIrModule *_g_ir_module_new (const gchar *name,
|
||||||
const gchar *nsversion,
|
const gchar *nsversion,
|
||||||
const gchar *module_filename,
|
const gchar *module_filename,
|
||||||
const gchar *c_prefix);
|
const gchar *c_prefix);
|
||||||
void g_ir_module_free (GIrModule *module);
|
void _g_ir_module_free (GIrModule *module);
|
||||||
|
|
||||||
void g_ir_module_add_include_module (GIrModule *module,
|
void _g_ir_module_add_include_module (GIrModule *module,
|
||||||
GIrModule *include_module);
|
GIrModule *include_module);
|
||||||
|
|
||||||
GITypelib * 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;
|
void _g_ir_module_fatal (GIrTypelibBuild *build, guint line, const char *msg, ...) G_GNUC_PRINTF (3, 4) G_GNUC_NORETURN;
|
||||||
|
|
||||||
void _g_irnode_init_stats (void);
|
void _g_irnode_init_stats (void);
|
||||||
void _g_irnode_dump_stats (void);
|
void _g_irnode_dump_stats (void);
|
||||||
|
42
girnode.h
42
girnode.h
@ -354,36 +354,36 @@ struct _GIrNodeErrorDomain
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
GIrNode * g_ir_node_new (GIrNodeTypeId type,
|
GIrNode * _g_ir_node_new (GIrNodeTypeId type,
|
||||||
GIrModule *module);
|
GIrModule *module);
|
||||||
void g_ir_node_free (GIrNode *node);
|
void _g_ir_node_free (GIrNode *node);
|
||||||
guint32 g_ir_node_get_size (GIrNode *node);
|
guint32 _g_ir_node_get_size (GIrNode *node);
|
||||||
guint32 g_ir_node_get_full_size (GIrNode *node);
|
guint32 _g_ir_node_get_full_size (GIrNode *node);
|
||||||
void g_ir_node_build_typelib (GIrNode *node,
|
void _g_ir_node_build_typelib (GIrNode *node,
|
||||||
GIrNode *parent,
|
GIrNode *parent,
|
||||||
GIrTypelibBuild *build,
|
GIrTypelibBuild *build,
|
||||||
guint32 *offset,
|
guint32 *offset,
|
||||||
guint32 *offset2);
|
guint32 *offset2);
|
||||||
int g_ir_node_cmp (GIrNode *node,
|
int _g_ir_node_cmp (GIrNode *node,
|
||||||
GIrNode *other);
|
GIrNode *other);
|
||||||
gboolean g_ir_node_can_have_member (GIrNode *node);
|
gboolean _g_ir_node_can_have_member (GIrNode *node);
|
||||||
void g_ir_node_add_member (GIrNode *node,
|
void _g_ir_node_add_member (GIrNode *node,
|
||||||
GIrNodeFunction *member);
|
GIrNodeFunction *member);
|
||||||
guint32 write_string (const gchar *str,
|
guint32 _g_ir_write_string (const gchar *str,
|
||||||
GHashTable *strings,
|
GHashTable *strings,
|
||||||
guchar *data,
|
guchar *data,
|
||||||
guint32 *offset);
|
guint32 *offset);
|
||||||
|
|
||||||
const gchar * g_ir_node_param_direction_string (GIrNodeParam * node);
|
const gchar * _g_ir_node_param_direction_string (GIrNodeParam * node);
|
||||||
const gchar * g_ir_node_type_to_string (GIrNodeTypeId type);
|
const gchar * _g_ir_node_type_to_string (GIrNodeTypeId type);
|
||||||
|
|
||||||
GIrNode *g_ir_find_node (GIrTypelibBuild *build,
|
GIrNode *_g_ir_find_node (GIrTypelibBuild *build,
|
||||||
GIrModule *module,
|
GIrModule *module,
|
||||||
const char *name);
|
const char *name);
|
||||||
|
|
||||||
/* In giroffsets.c */
|
/* In giroffsets.c */
|
||||||
|
|
||||||
void g_ir_node_compute_offsets (GIrTypelibBuild *build,
|
void _g_ir_node_compute_offsets (GIrTypelibBuild *build,
|
||||||
GIrNode *node);
|
GIrNode *node);
|
||||||
|
|
||||||
|
|
||||||
|
14
giroffsets.c
14
giroffsets.c
@ -189,16 +189,16 @@ get_interface_size_alignment (GIrTypelibBuild *build,
|
|||||||
{
|
{
|
||||||
GIrNode *iface;
|
GIrNode *iface;
|
||||||
|
|
||||||
iface = g_ir_find_node (build, ((GIrNode*)type)->module, type->interface);
|
iface = _g_ir_find_node (build, ((GIrNode*)type)->module, type->interface);
|
||||||
if (!iface)
|
if (!iface)
|
||||||
{
|
{
|
||||||
g_ir_module_fatal (build, 0, "Can't resolve type '%s' for %s", type->interface, who);
|
_g_ir_module_fatal (build, 0, "Can't resolve type '%s' for %s", type->interface, who);
|
||||||
*size = -1;
|
*size = -1;
|
||||||
*alignment = -1;
|
*alignment = -1;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_ir_node_compute_offsets (build, iface);
|
_g_ir_node_compute_offsets (build, iface);
|
||||||
|
|
||||||
switch (iface->type)
|
switch (iface->type)
|
||||||
{
|
{
|
||||||
@ -247,7 +247,7 @@ get_interface_size_alignment (GIrTypelibBuild *build,
|
|||||||
{
|
{
|
||||||
g_warning ("%s has is not a pointer and is of type %s",
|
g_warning ("%s has is not a pointer and is of type %s",
|
||||||
who,
|
who,
|
||||||
g_ir_node_type_to_string (iface->type));
|
_g_ir_node_type_to_string (iface->type));
|
||||||
*size = -1;
|
*size = -1;
|
||||||
*alignment = -1;
|
*alignment = -1;
|
||||||
break;
|
break;
|
||||||
@ -497,7 +497,7 @@ check_needs_computation (GIrTypelibBuild *build,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* g_ir_node_compute_offsets:
|
* _g_ir_node_compute_offsets:
|
||||||
* @build: Current typelib build
|
* @build: Current typelib build
|
||||||
* @node: a #GIrNode
|
* @node: a #GIrNode
|
||||||
*
|
*
|
||||||
@ -506,8 +506,8 @@ check_needs_computation (GIrTypelibBuild *build,
|
|||||||
* alignment for the type.
|
* alignment for the type.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
g_ir_node_compute_offsets (GIrTypelibBuild *build,
|
_g_ir_node_compute_offsets (GIrTypelibBuild *build,
|
||||||
GIrNode *node)
|
GIrNode *node)
|
||||||
{
|
{
|
||||||
gboolean appended_stack;
|
gboolean appended_stack;
|
||||||
|
|
||||||
|
96
girparser.c
96
girparser.c
@ -161,7 +161,7 @@ static const gchar *find_attribute (const gchar *name,
|
|||||||
|
|
||||||
|
|
||||||
GIrParser *
|
GIrParser *
|
||||||
g_ir_parser_new (void)
|
_g_ir_parser_new (void)
|
||||||
{
|
{
|
||||||
GIrParser *parser = g_slice_new0 (GIrParser);
|
GIrParser *parser = g_slice_new0 (GIrParser);
|
||||||
|
|
||||||
@ -169,7 +169,7 @@ g_ir_parser_new (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
g_ir_parser_free (GIrParser *parser)
|
_g_ir_parser_free (GIrParser *parser)
|
||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
@ -177,14 +177,14 @@ g_ir_parser_free (GIrParser *parser)
|
|||||||
g_strfreev (parser->includes);
|
g_strfreev (parser->includes);
|
||||||
|
|
||||||
for (l = parser->parsed_modules; l; l = l->next)
|
for (l = parser->parsed_modules; l; l = l->next)
|
||||||
g_ir_module_free (l->data);
|
_g_ir_module_free (l->data);
|
||||||
|
|
||||||
g_slice_free (GIrParser, parser);
|
g_slice_free (GIrParser, parser);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
g_ir_parser_set_includes (GIrParser *parser,
|
_g_ir_parser_set_includes (GIrParser *parser,
|
||||||
const gchar *const *includes)
|
const gchar *const *includes)
|
||||||
{
|
{
|
||||||
if (parser->includes)
|
if (parser->includes)
|
||||||
g_strfreev (parser->includes);
|
g_strfreev (parser->includes);
|
||||||
@ -457,7 +457,7 @@ parse_type_internal (GIrModule *module,
|
|||||||
GIrNodeType *type;
|
GIrNodeType *type;
|
||||||
char *temporary_type = NULL;
|
char *temporary_type = NULL;
|
||||||
|
|
||||||
type = (GIrNodeType *)g_ir_node_new (G_IR_NODE_TYPE, module);
|
type = (GIrNodeType *)_g_ir_node_new (G_IR_NODE_TYPE, module);
|
||||||
|
|
||||||
type->unparsed = g_strdup (str);
|
type->unparsed = g_strdup (str);
|
||||||
|
|
||||||
@ -585,7 +585,7 @@ parse_type_internal (GIrModule *module,
|
|||||||
return type;
|
return type;
|
||||||
|
|
||||||
/* error: */
|
/* error: */
|
||||||
g_ir_node_free ((GIrNode *)type);
|
_g_ir_node_free ((GIrNode *)type);
|
||||||
g_free (temporary_type);
|
g_free (temporary_type);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -748,7 +748,7 @@ start_glib_boxed (GMarkupParseContext *context,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
boxed = (GIrNodeBoxed *) g_ir_node_new (G_IR_NODE_BOXED,
|
boxed = (GIrNodeBoxed *) _g_ir_node_new (G_IR_NODE_BOXED,
|
||||||
ctx->current_module);
|
ctx->current_module);
|
||||||
|
|
||||||
((GIrNode *)boxed)->name = g_strdup (name);
|
((GIrNode *)boxed)->name = g_strdup (name);
|
||||||
@ -838,7 +838,7 @@ start_function (GMarkupParseContext *context,
|
|||||||
if (shadows)
|
if (shadows)
|
||||||
name = shadows;
|
name = shadows;
|
||||||
|
|
||||||
function = (GIrNodeFunction *) g_ir_node_new (G_IR_NODE_FUNCTION,
|
function = (GIrNodeFunction *) _g_ir_node_new (G_IR_NODE_FUNCTION,
|
||||||
ctx->current_module);
|
ctx->current_module);
|
||||||
|
|
||||||
((GIrNode *)function)->name = g_strdup (name);
|
((GIrNode *)function)->name = g_strdup (name);
|
||||||
@ -1045,8 +1045,8 @@ start_parameter (GMarkupParseContext *context,
|
|||||||
if (name == NULL)
|
if (name == NULL)
|
||||||
name = "unknown";
|
name = "unknown";
|
||||||
|
|
||||||
param = (GIrNodeParam *)g_ir_node_new (G_IR_NODE_PARAM,
|
param = (GIrNodeParam *)_g_ir_node_new (G_IR_NODE_PARAM,
|
||||||
ctx->current_module);
|
ctx->current_module);
|
||||||
|
|
||||||
ctx->current_typed = (GIrNode*) param;
|
ctx->current_typed = (GIrNode*) param;
|
||||||
ctx->current_typed->name = g_strdup (name);
|
ctx->current_typed->name = g_strdup (name);
|
||||||
@ -1201,8 +1201,8 @@ start_field (GMarkupParseContext *context,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
field = (GIrNodeField *)g_ir_node_new (G_IR_NODE_FIELD,
|
field = (GIrNodeField *)_g_ir_node_new (G_IR_NODE_FIELD,
|
||||||
ctx->current_module);
|
ctx->current_module);
|
||||||
if (introspectable)
|
if (introspectable)
|
||||||
{
|
{
|
||||||
ctx->current_typed = (GIrNode*) field;
|
ctx->current_typed = (GIrNode*) field;
|
||||||
@ -1268,7 +1268,7 @@ start_field (GMarkupParseContext *context,
|
|||||||
{
|
{
|
||||||
GIrNodeConstant *constant;
|
GIrNodeConstant *constant;
|
||||||
|
|
||||||
constant = (GIrNodeConstant *) g_ir_node_new (G_IR_NODE_CONSTANT,
|
constant = (GIrNodeConstant *) _g_ir_node_new (G_IR_NODE_CONSTANT,
|
||||||
ctx->current_module);
|
ctx->current_module);
|
||||||
((GIrNode *)constant)->name = g_strdup (name);
|
((GIrNode *)constant)->name = g_strdup (name);
|
||||||
constant->value = g_strdup (branch);
|
constant->value = g_strdup (branch);
|
||||||
@ -1342,10 +1342,10 @@ start_enum (GMarkupParseContext *context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp (element_name, "enumeration") == 0)
|
if (strcmp (element_name, "enumeration") == 0)
|
||||||
enum_ = (GIrNodeEnum *) g_ir_node_new (G_IR_NODE_ENUM,
|
enum_ = (GIrNodeEnum *) _g_ir_node_new (G_IR_NODE_ENUM,
|
||||||
ctx->current_module);
|
ctx->current_module);
|
||||||
else
|
else
|
||||||
enum_ = (GIrNodeEnum *) g_ir_node_new (G_IR_NODE_FLAGS,
|
enum_ = (GIrNodeEnum *) _g_ir_node_new (G_IR_NODE_FLAGS,
|
||||||
ctx->current_module);
|
ctx->current_module);
|
||||||
((GIrNode *)enum_)->name = g_strdup (name);
|
((GIrNode *)enum_)->name = g_strdup (name);
|
||||||
enum_->gtype_name = g_strdup (typename);
|
enum_->gtype_name = g_strdup (typename);
|
||||||
@ -1409,7 +1409,7 @@ start_property (GMarkupParseContext *context,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
property = (GIrNodeProperty *) g_ir_node_new (G_IR_NODE_PROPERTY,
|
property = (GIrNodeProperty *) _g_ir_node_new (G_IR_NODE_PROPERTY,
|
||||||
ctx->current_module);
|
ctx->current_module);
|
||||||
ctx->current_typed = (GIrNode*) property;
|
ctx->current_typed = (GIrNode*) property;
|
||||||
|
|
||||||
@ -1492,7 +1492,7 @@ start_member (GMarkupParseContext *context,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
value_ = (GIrNodeValue *) g_ir_node_new (G_IR_NODE_VALUE,
|
value_ = (GIrNodeValue *) _g_ir_node_new (G_IR_NODE_VALUE,
|
||||||
ctx->current_module);
|
ctx->current_module);
|
||||||
|
|
||||||
((GIrNode *)value_)->name = g_strdup (name);
|
((GIrNode *)value_)->name = g_strdup (name);
|
||||||
@ -1566,7 +1566,7 @@ start_constant (GMarkupParseContext *context,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
constant = (GIrNodeConstant *) g_ir_node_new (G_IR_NODE_CONSTANT,
|
constant = (GIrNodeConstant *) _g_ir_node_new (G_IR_NODE_CONSTANT,
|
||||||
ctx->current_module);
|
ctx->current_module);
|
||||||
|
|
||||||
((GIrNode *)constant)->name = g_strdup (name);
|
((GIrNode *)constant)->name = g_strdup (name);
|
||||||
@ -1639,7 +1639,7 @@ start_errordomain (GMarkupParseContext *context,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
domain = (GIrNodeErrorDomain *) g_ir_node_new (G_IR_NODE_ERROR_DOMAIN,
|
domain = (GIrNodeErrorDomain *) _g_ir_node_new (G_IR_NODE_ERROR_DOMAIN,
|
||||||
ctx->current_module);
|
ctx->current_module);
|
||||||
|
|
||||||
((GIrNode *)domain)->name = g_strdup (name);
|
((GIrNode *)domain)->name = g_strdup (name);
|
||||||
@ -1702,7 +1702,7 @@ start_interface (GMarkupParseContext *context,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
iface = (GIrNodeInterface *) g_ir_node_new (G_IR_NODE_INTERFACE,
|
iface = (GIrNodeInterface *) _g_ir_node_new (G_IR_NODE_INTERFACE,
|
||||||
ctx->current_module);
|
ctx->current_module);
|
||||||
((GIrNode *)iface)->name = g_strdup (name);
|
((GIrNode *)iface)->name = g_strdup (name);
|
||||||
iface->gtype_name = g_strdup (typename);
|
iface->gtype_name = g_strdup (typename);
|
||||||
@ -1778,7 +1778,7 @@ start_class (GMarkupParseContext *context,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
iface = (GIrNodeInterface *) g_ir_node_new (G_IR_NODE_OBJECT,
|
iface = (GIrNodeInterface *) _g_ir_node_new (G_IR_NODE_OBJECT,
|
||||||
ctx->current_module);
|
ctx->current_module);
|
||||||
((GIrNode *)iface)->name = g_strdup (name);
|
((GIrNode *)iface)->name = g_strdup (name);
|
||||||
iface->gtype_name = g_strdup (typename);
|
iface->gtype_name = g_strdup (typename);
|
||||||
@ -1915,8 +1915,8 @@ start_type (GMarkupParseContext *context,
|
|||||||
const char *len;
|
const char *len;
|
||||||
const char *size;
|
const char *size;
|
||||||
|
|
||||||
typenode = (GIrNodeType *)g_ir_node_new (G_IR_NODE_TYPE,
|
typenode = (GIrNodeType *)_g_ir_node_new (G_IR_NODE_TYPE,
|
||||||
ctx->current_module);
|
ctx->current_module);
|
||||||
|
|
||||||
typenode->tag = GI_TYPE_TAG_ARRAY;
|
typenode->tag = GI_TYPE_TAG_ARRAY;
|
||||||
typenode->is_pointer = TRUE;
|
typenode->is_pointer = TRUE;
|
||||||
@ -2194,8 +2194,8 @@ start_return_value (GMarkupParseContext *context,
|
|||||||
ctx->state == STATE_FUNCTION))
|
ctx->state == STATE_FUNCTION))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
param = (GIrNodeParam *)g_ir_node_new (G_IR_NODE_PARAM,
|
param = (GIrNodeParam *)_g_ir_node_new (G_IR_NODE_PARAM,
|
||||||
ctx->current_module);
|
ctx->current_module);
|
||||||
param->in = FALSE;
|
param->in = FALSE;
|
||||||
param->out = FALSE;
|
param->out = FALSE;
|
||||||
param->retval = TRUE;
|
param->retval = TRUE;
|
||||||
@ -2305,8 +2305,8 @@ start_glib_signal (GMarkupParseContext *context,
|
|||||||
MISSING_ATTRIBUTE (context, error, element_name, "name");
|
MISSING_ATTRIBUTE (context, error, element_name, "name");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
signal = (GIrNodeSignal *)g_ir_node_new (G_IR_NODE_SIGNAL,
|
signal = (GIrNodeSignal *)_g_ir_node_new (G_IR_NODE_SIGNAL,
|
||||||
ctx->current_module);
|
ctx->current_module);
|
||||||
|
|
||||||
((GIrNode *)signal)->name = g_strdup (name);
|
((GIrNode *)signal)->name = g_strdup (name);
|
||||||
|
|
||||||
@ -2387,8 +2387,8 @@ start_vfunc (GMarkupParseContext *context,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
vfunc = (GIrNodeVFunc *)g_ir_node_new (G_IR_NODE_VFUNC,
|
vfunc = (GIrNodeVFunc *)_g_ir_node_new (G_IR_NODE_VFUNC,
|
||||||
ctx->current_module);
|
ctx->current_module);
|
||||||
|
|
||||||
((GIrNode *)vfunc)->name = g_strdup (name);
|
((GIrNode *)vfunc)->name = g_strdup (name);
|
||||||
|
|
||||||
@ -2484,7 +2484,7 @@ start_struct (GMarkupParseContext *context,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct_ = (GIrNodeStruct *) g_ir_node_new (G_IR_NODE_STRUCT,
|
struct_ = (GIrNodeStruct *) _g_ir_node_new (G_IR_NODE_STRUCT,
|
||||||
ctx->current_module);
|
ctx->current_module);
|
||||||
|
|
||||||
((GIrNode *)struct_)->name = g_strdup (name ? name : "");
|
((GIrNode *)struct_)->name = g_strdup (name ? name : "");
|
||||||
@ -2545,7 +2545,7 @@ start_union (GMarkupParseContext *context,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
union_ = (GIrNodeUnion *) g_ir_node_new (G_IR_NODE_UNION,
|
union_ = (GIrNodeUnion *) _g_ir_node_new (G_IR_NODE_UNION,
|
||||||
ctx->current_module);
|
ctx->current_module);
|
||||||
|
|
||||||
((GIrNode *)union_)->name = g_strdup (name ? name : "");
|
((GIrNode *)union_)->name = g_strdup (name ? name : "");
|
||||||
@ -2654,7 +2654,7 @@ parse_include (GMarkupParseContext *context,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
module = g_ir_parser_parse_string (ctx->parser, name, girpath, buffer, length, &error);
|
module = _g_ir_parser_parse_string (ctx->parser, name, girpath, buffer, length, &error);
|
||||||
g_free (buffer);
|
g_free (buffer);
|
||||||
if (error != NULL)
|
if (error != NULL)
|
||||||
{
|
{
|
||||||
@ -2890,7 +2890,7 @@ start_element_handler (GMarkupParseContext *context,
|
|||||||
"<namespace/> name element '%s' doesn't match file name '%s'",
|
"<namespace/> name element '%s' doesn't match file name '%s'",
|
||||||
name, ctx->namespace);
|
name, ctx->namespace);
|
||||||
|
|
||||||
ctx->current_module = g_ir_module_new (name, version, shared_library, cprefix);
|
ctx->current_module = _g_ir_module_new (name, version, shared_library, cprefix);
|
||||||
|
|
||||||
ctx->current_module->aliases = ctx->aliases;
|
ctx->current_module->aliases = ctx->aliases;
|
||||||
ctx->aliases = NULL;
|
ctx->aliases = NULL;
|
||||||
@ -2898,7 +2898,7 @@ start_element_handler (GMarkupParseContext *context,
|
|||||||
ctx->disguised_structures = NULL;
|
ctx->disguised_structures = NULL;
|
||||||
|
|
||||||
for (l = ctx->include_modules; l; l = l->next)
|
for (l = ctx->include_modules; l; l = l->next)
|
||||||
g_ir_module_add_include_module (ctx->current_module, l->data);
|
_g_ir_module_add_include_module (ctx->current_module, l->data);
|
||||||
|
|
||||||
g_list_free (ctx->include_modules);
|
g_list_free (ctx->include_modules);
|
||||||
ctx->include_modules = NULL;
|
ctx->include_modules = NULL;
|
||||||
@ -3445,7 +3445,7 @@ cleanup (GMarkupParseContext *context,
|
|||||||
GList *m;
|
GList *m;
|
||||||
|
|
||||||
for (m = ctx->modules; m; m = m->next)
|
for (m = ctx->modules; m; m = m->next)
|
||||||
g_ir_module_free (m->data);
|
_g_ir_module_free (m->data);
|
||||||
g_list_free (ctx->modules);
|
g_list_free (ctx->modules);
|
||||||
ctx->modules = NULL;
|
ctx->modules = NULL;
|
||||||
|
|
||||||
@ -3453,7 +3453,7 @@ cleanup (GMarkupParseContext *context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* g_ir_parser_parse_string:
|
* _g_ir_parser_parse_string:
|
||||||
* @parser: a #GIrParser
|
* @parser: a #GIrParser
|
||||||
* @namespace: the namespace of the string
|
* @namespace: the namespace of the string
|
||||||
* @filename: (allow-none): Path to parsed file, or %NULL
|
* @filename: (allow-none): Path to parsed file, or %NULL
|
||||||
@ -3467,12 +3467,12 @@ cleanup (GMarkupParseContext *context,
|
|||||||
* Returns: (transfer none): a new #GirModule
|
* Returns: (transfer none): a new #GirModule
|
||||||
*/
|
*/
|
||||||
GIrModule *
|
GIrModule *
|
||||||
g_ir_parser_parse_string (GIrParser *parser,
|
_g_ir_parser_parse_string (GIrParser *parser,
|
||||||
const gchar *namespace,
|
const gchar *namespace,
|
||||||
const gchar *filename,
|
const gchar *filename,
|
||||||
const gchar *buffer,
|
const gchar *buffer,
|
||||||
gssize length,
|
gssize length,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
ParseContext ctx = { 0 };
|
ParseContext ctx = { 0 };
|
||||||
GMarkupParseContext *context;
|
GMarkupParseContext *context;
|
||||||
@ -3531,7 +3531,7 @@ g_ir_parser_parse_string (GIrParser *parser,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* g_ir_parser_parse_file:
|
* _g_ir_parser_parse_file:
|
||||||
* @parser: a #GIrParser
|
* @parser: a #GIrParser
|
||||||
* @filename: filename to parse
|
* @filename: filename to parse
|
||||||
* @error: return location for a #GError, or %NULL
|
* @error: return location for a #GError, or %NULL
|
||||||
@ -3543,9 +3543,9 @@ g_ir_parser_parse_string (GIrParser *parser,
|
|||||||
* are owned by the #GIrParser and will be freed along with the parser.
|
* are owned by the #GIrParser and will be freed along with the parser.
|
||||||
*/
|
*/
|
||||||
GIrModule *
|
GIrModule *
|
||||||
g_ir_parser_parse_file (GIrParser *parser,
|
_g_ir_parser_parse_file (GIrParser *parser,
|
||||||
const gchar *filename,
|
const gchar *filename,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gchar *buffer;
|
gchar *buffer;
|
||||||
gsize length;
|
gsize length;
|
||||||
@ -3580,7 +3580,7 @@ g_ir_parser_parse_file (GIrParser *parser,
|
|||||||
if (!g_file_get_contents (filename, &buffer, &length, error))
|
if (!g_file_get_contents (filename, &buffer, &length, error))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
module = g_ir_parser_parse_string (parser, namespace, filename, buffer, length, error);
|
module = _g_ir_parser_parse_string (parser, namespace, filename, buffer, length, error);
|
||||||
|
|
||||||
g_free (namespace);
|
g_free (namespace);
|
||||||
|
|
||||||
|
26
girparser.h
26
girparser.h
@ -29,20 +29,20 @@ G_BEGIN_DECLS
|
|||||||
|
|
||||||
typedef struct _GIrParser GIrParser;
|
typedef struct _GIrParser GIrParser;
|
||||||
|
|
||||||
GIrParser *g_ir_parser_new (void);
|
GIrParser *_g_ir_parser_new (void);
|
||||||
void g_ir_parser_free (GIrParser *parser);
|
void _g_ir_parser_free (GIrParser *parser);
|
||||||
void g_ir_parser_set_includes (GIrParser *parser,
|
void _g_ir_parser_set_includes (GIrParser *parser,
|
||||||
const gchar *const *includes);
|
const gchar *const *includes);
|
||||||
|
|
||||||
GIrModule *g_ir_parser_parse_string (GIrParser *parser,
|
GIrModule *_g_ir_parser_parse_string (GIrParser *parser,
|
||||||
const gchar *namespace,
|
const gchar *namespace,
|
||||||
const gchar *filename,
|
const gchar *filename,
|
||||||
const gchar *buffer,
|
const gchar *buffer,
|
||||||
gssize length,
|
gssize length,
|
||||||
GError **error);
|
GError **error);
|
||||||
GIrModule *g_ir_parser_parse_file (GIrParser *parser,
|
GIrModule *_g_ir_parser_parse_file (GIrParser *parser,
|
||||||
const gchar *filename,
|
const gchar *filename,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user