zif-string

zif-string — Reference counted strings

Synopsis

                    ZifString;
#define             zif_string_get_value                (string)
ZifString *         zif_string_new                      (const gchar *value);
ZifString *         zif_string_new_static               (const gchar *value);
ZifString *         zif_string_new_value                (gchar *value);
ZifString *         zif_string_ref                      (ZifString *string);
ZifString *         zif_string_unref                    (ZifString *string);

Description

To avoid frequent malloc/free, we use reference counted strings to optimise many of the zif internals.

Details

ZifString

typedef struct {
	gchar		*value;
	/* other stuff */
} ZifString;


zif_string_get_value()

#define zif_string_get_value(string)		(string->value)

string :


zif_string_new ()

ZifString *         zif_string_new                      (const gchar *value);

value :

Returns :


zif_string_new_static ()

ZifString *         zif_string_new_static               (const gchar *value);

value :

Returns :


zif_string_new_value ()

ZifString *         zif_string_new_value                (gchar *value);

value :

Returns :


zif_string_ref ()

ZifString *         zif_string_ref                      (ZifString *string);

string :

Returns :


zif_string_unref ()

ZifString *         zif_string_unref                    (ZifString *string);

string :

Returns :