mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-30 05:43:28 +02:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user