gobject-introspection r394 - in trunk: . girepository
- From: johan svn gnome org
- To: svn-commits-list gnome org
- Subject: gobject-introspection r394 - in trunk: . girepository
- Date: Mon, 18 Aug 2008 08:52:47 +0000 (UTC)
Author: johan
Date: Mon Aug 18 08:52:47 2008
New Revision: 394
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=394&view=rev
Log:
2008-08-18 Johan Dahlin <johan gnome org>
* girepository/girepository.c (g_type_tag_to_string):
* girepository/girepository.h:
* girepository/girnode.c (g_ir_node_get_full_size_internal),
(find_entry_node):
* girepository/girnode.h:
Make enum serializing functions public. Clean up some whitespace.
Modified:
trunk/ChangeLog
trunk/girepository/girepository.c
trunk/girepository/girepository.h
trunk/girepository/girnode.c
trunk/girepository/girnode.h
Modified: trunk/girepository/girepository.c
==============================================================================
--- trunk/girepository/girepository.c (original)
+++ trunk/girepository/girepository.c Mon Aug 18 08:52:47 2008
@@ -502,3 +502,65 @@
quark = g_quark_from_static_string ("g-irepository-error-quark");
return quark;
}
+
+const gchar*
+g_type_tag_to_string (GITypeTag type)
+{
+ switch (type)
+ {
+ case GI_TYPE_TAG_VOID:
+ return "void";
+ case GI_TYPE_TAG_BOOLEAN:
+ return "boolean";
+ case GI_TYPE_TAG_INT8:
+ return "int8";
+ case GI_TYPE_TAG_UINT8:
+ return "uint8";
+ case GI_TYPE_TAG_INT16:
+ return "int16";
+ case GI_TYPE_TAG_UINT16:
+ return "uint16";
+ case GI_TYPE_TAG_INT32:
+ return "int32";
+ case GI_TYPE_TAG_UINT32:
+ return "uint32";
+ case GI_TYPE_TAG_INT64:
+ return "int64";
+ case GI_TYPE_TAG_UINT64:
+ return "uint64";
+ case GI_TYPE_TAG_INT:
+ return "int";
+ case GI_TYPE_TAG_UINT:
+ return "uint";
+ case GI_TYPE_TAG_LONG:
+ return "long";
+ case GI_TYPE_TAG_ULONG:
+ return "ulong";
+ case GI_TYPE_TAG_SSIZE:
+ return "ssize";
+ case GI_TYPE_TAG_SIZE:
+ return "size";
+ case GI_TYPE_TAG_FLOAT:
+ return "float";
+ case GI_TYPE_TAG_DOUBLE:
+ return "double";
+ case GI_TYPE_TAG_UTF8:
+ return "utf8";
+ case GI_TYPE_TAG_FILENAME:
+ return "filename";
+ case GI_TYPE_TAG_ARRAY:
+ return "array";
+ case GI_TYPE_TAG_INTERFACE:
+ return "interface";
+ case GI_TYPE_TAG_GLIST:
+ return "glist";
+ case GI_TYPE_TAG_GSLIST:
+ return "gslist";
+ case GI_TYPE_TAG_GHASH:
+ return "ghash";
+ case GI_TYPE_TAG_ERROR:
+ return "error";
+ default:
+ return "unknown";
+ }
+}
Modified: trunk/girepository/girepository.h
==============================================================================
--- trunk/girepository/girepository.h (original)
+++ trunk/girepository/girepository.h Mon Aug 18 08:52:47 2008
@@ -285,6 +285,8 @@
GI_TYPE_TAG_ERROR = 25
} GITypeTag;
+const gchar* g_type_tag_to_string (GITypeTag type);
+
gboolean g_type_info_is_pointer (GITypeInfo *info);
GITypeTag g_type_info_get_tag (GITypeInfo *info);
GITypeInfo * g_type_info_get_param_type (GITypeInfo *info,
Modified: trunk/girepository/girnode.c
==============================================================================
--- trunk/girepository/girnode.c (original)
+++ trunk/girepository/girnode.c Mon Aug 18 08:52:47 2008
@@ -56,7 +56,7 @@
(( ((unsigned long)(this)) + (((unsigned long)(boundary)) -1)) & (~(((unsigned long)(boundary))-1)))
-static const gchar *
+const gchar *
g_ir_node_type_to_string (GIrNodeTypeId type)
{
switch (type)
@@ -104,68 +104,6 @@
}
}
-static const gchar*
-gi_type_tag_to_string (GITypeTag type)
-{
- switch (type)
- {
- case GI_TYPE_TAG_VOID:
- return "void";
- case GI_TYPE_TAG_BOOLEAN:
- return "boolean";
- case GI_TYPE_TAG_INT8:
- return "int8";
- case GI_TYPE_TAG_UINT8:
- return "uint8";
- case GI_TYPE_TAG_INT16:
- return "int16";
- case GI_TYPE_TAG_UINT16:
- return "uint16";
- case GI_TYPE_TAG_INT32:
- return "int32";
- case GI_TYPE_TAG_UINT32:
- return "uint32";
- case GI_TYPE_TAG_INT64:
- return "int64";
- case GI_TYPE_TAG_UINT64:
- return "uint64";
- case GI_TYPE_TAG_INT:
- return "int";
- case GI_TYPE_TAG_UINT:
- return "uint";
- case GI_TYPE_TAG_LONG:
- return "long";
- case GI_TYPE_TAG_ULONG:
- return "ulong";
- case GI_TYPE_TAG_SSIZE:
- return "ssize";
- case GI_TYPE_TAG_SIZE:
- return "size";
- case GI_TYPE_TAG_FLOAT:
- return "float";
- case GI_TYPE_TAG_DOUBLE:
- return "double";
- case GI_TYPE_TAG_UTF8:
- return "utf8";
- case GI_TYPE_TAG_FILENAME:
- return "filename";
- case GI_TYPE_TAG_ARRAY:
- return "array";
- case GI_TYPE_TAG_INTERFACE:
- return "interface";
- case GI_TYPE_TAG_GLIST:
- return "glist";
- case GI_TYPE_TAG_GSLIST:
- return "gslist";
- case GI_TYPE_TAG_GHASH:
- return "ghash";
- case GI_TYPE_TAG_ERROR:
- return "error";
- default:
- return "unknown";
- }
-}
-
GIrNode *
g_ir_node_new (GIrNodeTypeId type)
{
@@ -598,7 +536,8 @@
/* returns the full size of the blob including variable-size parts */
static guint32
-g_ir_node_get_full_size_internal (GIrNode *parent, GIrNode *node)
+g_ir_node_get_full_size_internal (GIrNode *parent,
+ GIrNode *node)
{
GList *l;
gint size, n;
@@ -655,7 +594,7 @@
else
{
g_debug ("node %p type tag '%s'", node,
- gi_type_tag_to_string (type->tag));
+ g_type_tag_to_string (type->tag));
switch (type->tag)
{
@@ -923,7 +862,7 @@
void
g_ir_node_add_member (GIrNode *node,
- GIrNodeFunction *member)
+ GIrNodeFunction *member)
{
g_return_if_fail (node != NULL);
g_return_if_fail (member != NULL);
@@ -1014,7 +953,7 @@
}
static GIrNode *
-find_entry_node (GIrModule *module,
+find_entry_node (GIrModule *module,
GList *modules,
const gchar *name,
guint16 *idx)
@@ -1026,6 +965,9 @@
gint n_names;
GIrNode *result = NULL;
+ g_assert (name != NULL);
+ g_assert (strlen (name) > 0);
+
names = g_strsplit (name, ".", 0);
n_names = g_strv_length (names);
if (n_names > 2)
@@ -1082,7 +1024,7 @@
}
static guint16
-find_entry (GIrModule *module,
+find_entry (GIrModule *module,
GList *modules,
const gchar *name)
{
@@ -1094,9 +1036,9 @@
}
static void
-serialize_type (GIrModule *module,
+serialize_type (GIrModule *module,
GList *modules,
- GIrNodeType *node,
+ GIrNodeType *node,
GString *str)
{
gint i;
@@ -1211,8 +1153,8 @@
}
void
-g_ir_node_build_typelib (GIrNode *node,
- GIrModule *module,
+g_ir_node_build_typelib (GIrNode *node,
+ GIrModule *module,
GList *modules,
GHashTable *strings,
GHashTable *types,
Modified: trunk/girepository/girnode.h
==============================================================================
--- trunk/girepository/girnode.h (original)
+++ trunk/girepository/girnode.h Mon Aug 18 08:52:47 2008
@@ -328,6 +328,7 @@
guint32 *offset);
const gchar * g_ir_node_param_direction_string (GIrNodeParam * node);
+const gchar * g_ir_node_type_to_string (GIrNodeTypeId type);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]