Add a function g_pointer_type_register_static() to register a type derived

Sun Nov  4 14:01:23 2001  Owen Taylor  <otaylor@redhat.com>

        * gvaluetypes.[ch]: Add a function g_pointer_type_register_static()
        to register a type derived from G_TYPE_POINTER.
This commit is contained in:
Owen Taylor 2001-11-04 19:02:10 +00:00 committed by Owen Taylor
parent 90bb210e1e
commit 49d9628efc
3 changed files with 34 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Sun Nov 4 14:01:23 2001 Owen Taylor <otaylor@redhat.com>
* gvaluetypes.[ch]: Add a function g_pointer_type_register_static()
to register a type derived from G_TYPE_POINTER.
2001-11-03 Hans Breuer <hans@breuer.org>
* makefile.msc.in : gobject-query needs gmarshal.[hc,stings]

View File

@ -872,3 +872,29 @@ g_strdup_value_contents (const GValue *value)
return contents;
}
GType
g_pointer_type_register_static (const gchar *name)
{
static const GTypeInfo type_info = {
0, /* class_size */
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* class_init */
NULL, /* class_finalize */
NULL, /* class_data */
0, /* instance_size */
0, /* n_preallocs */
NULL, /* instance_init */
NULL /* value_table */
};
GType type;
g_return_val_if_fail (name != NULL, 0);
g_return_val_if_fail (g_type_from_name (name) == 0, 0);
type = g_type_register_static (G_TYPE_POINTER, name, &type_info, 0);
return type;
}

View File

@ -87,6 +87,9 @@ void g_value_set_pointer (GValue *value,
gpointer g_value_get_pointer (const GValue *value);
/* Convenience for registering new pointer types */
GType g_pointer_type_register_static (const gchar *name);
/* debugging aid, describe value contents as string */
gchar* g_strdup_value_contents (const GValue *value);