GBoxed

Name

GBoxed -- Mechanism to wrap opaque C structures registered by the type system.

Synopsis


#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


Description

Details

GBoxedCopyFunc ()

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.


GBoxedFreeFunc ()

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.


g_boxed_copy ()

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.


g_boxed_free ()

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.


g_boxed_type_register_static ()

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.


g_pointer_type_register_static ()

GType       g_pointer_type_register_static  (const gchar *name);

name :

Returns :


G_TYPE_GSTRING

#define	G_TYPE_GSTRING		(g_gstring_get_type ())

See Also

GParamSpecBoxed, g_param_spec_boxed()