![]() | ![]() | ![]() | GObject Reference Manual | ![]() |
---|
GBoxed — A mechanism to wrap opaque C structures registered by the type system
#include <gobject.h> gpointer (*GBoxedCopyFunc) (gpointer boxed); void (*GBoxedFreeFunc) (gpointer boxed); gpointer g_boxed_copy (GType boxed_type, gconstpointer src_boxed); void g_boxed_free (GType boxed_type, gpointer boxed); GType g_boxed_type_register_static (const gchar *name, GBoxedCopyFunc boxed_copy, GBoxedFreeFunc boxed_free); GType g_pointer_type_register_static (const gchar *name); #define G_TYPE_GSTRING
gpointer (*GBoxedCopyFunc) (gpointer boxed);
This function is provided by the user and should produce a copy of the passed in boxed structure.
boxed : | The boxed structure to be copied. |
Returns : | The newly created copy of the boxed structure. |
void (*GBoxedFreeFunc) (gpointer boxed);
This function is provided by the user and should free the boxed structure passed.
boxed : | The boxed structure to be freed. |
gpointer g_boxed_copy (GType boxed_type, gconstpointer src_boxed);
Provide a copy of a boxed structure src_boxed which is of type boxed_type.
boxed_type : | The type of src_boxed. |
src_boxed : | The boxed structure to be copied. |
Returns : | The newly created copy of the boxed structure. |
void g_boxed_free (GType boxed_type, gpointer boxed);
Free the boxed structure boxed which is of type boxed_type.
boxed_type : | The type of boxed. |
boxed : | The boxed structure to be freed. |
GType g_boxed_type_register_static (const gchar *name, GBoxedCopyFunc boxed_copy, GBoxedFreeFunc boxed_free);
This function creates a new G_TYPE_BOXED derived type id for a new boxed type with name name. Boxed type handling functions have to be provided to copy and free opaque boxed structures of this type.
name : | Name of the new boxed type. |
boxed_copy : | Boxed structure copy function. |
boxed_free : | Boxed structure free function. |
Returns : | New G_TYPE_BOXED derived type id for name. |
GType g_pointer_type_register_static (const gchar *name);
name : | |
Returns : |
<< Enums and Flags | Generic Values >> |