Top |
These functions are a convenient way to slice-allocate GValues with various contents, as used in dbus-glib.
GValue *
tp_g_value_slice_new (GType type
);
Slice-allocate an empty GValue. tp_g_value_slice_new_boolean()
and similar
functions are likely to be more convenient to use for the types supported.
a newly allocated, newly initialized GValue, to be freed with
tp_g_value_slice_free()
or g_slice_free()
.
Since 0.5.14
GValue *
tp_g_value_slice_new_boolean (gboolean b
);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type G_TYPE_BOOLEAN
with value b
, to be freed with
tp_g_value_slice_free()
or g_slice_free()
Since 0.7.27
GValue * tp_g_value_slice_new_boxed (GType type
,gconstpointer p
);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type type
whose value is a copy of p
,
to be freed with tp_g_value_slice_free()
or g_slice_free()
Since 0.7.27
GValue * tp_g_value_slice_new_static_boxed (GType type
,gconstpointer p
);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type type
whose value is p
,
to be freed with tp_g_value_slice_free()
or g_slice_free()
Since 0.7.27
GValue * tp_g_value_slice_new_take_boxed (GType type
,gpointer p
);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
type |
a boxed type |
|
p |
a pointer of type |
a GValue of type type
whose value is p
,
to be freed with tp_g_value_slice_free()
or g_slice_free()
Since 0.7.27
GValue *
tp_g_value_slice_new_double (double d
);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type G_TYPE_DOUBLE
with value n
, to be freed with
tp_g_value_slice_free()
or g_slice_free()
Since 0.7.27
GValue *
tp_g_value_slice_new_int (gint n
);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type G_TYPE_INT
with value n
, to be freed with
tp_g_value_slice_free()
or g_slice_free()
Since 0.7.27
GValue *
tp_g_value_slice_new_int64 (gint64 n
);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type G_TYPE_INT64
with value n
, to be freed with
tp_g_value_slice_free()
or g_slice_free()
Since 0.7.27
GValue *
tp_g_value_slice_new_string (const gchar *string
);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type G_TYPE_STRING
whose value is a copy of string
,
to be freed with tp_g_value_slice_free()
or g_slice_free()
Since 0.7.27
GValue *
tp_g_value_slice_new_static_string (const gchar *string
);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type G_TYPE_STRING
whose value is string
,
to be freed with tp_g_value_slice_free()
or g_slice_free()
Since 0.7.27
GValue *
tp_g_value_slice_new_take_string (gchar *string
);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type G_TYPE_STRING
whose value is string
,
to be freed with tp_g_value_slice_free()
or g_slice_free()
Since 0.7.27
GValue *
tp_g_value_slice_new_uint (guint n
);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type G_TYPE_UINT
with value n
, to be freed with
tp_g_value_slice_free()
or g_slice_free()
Since 0.7.27
GValue *
tp_g_value_slice_new_uint64 (guint64 n
);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type G_TYPE_UINT64
with value n
, to be freed with
tp_g_value_slice_free()
or g_slice_free()
Since 0.7.27
GValue *
tp_g_value_slice_new_byte (guchar n
);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type G_TYPE_UCHAR
with value n
, to be freed with
tp_g_value_slice_free()
or g_slice_free()
Since 0.11.0
void
tp_g_value_slice_free (GValue *value
);
Unset and free a slice-allocated GValue.
(GDestroyNotify) tp_g_value_slice_free
can be used
as a destructor for values in a GHashTable, for example.
GValue *
tp_g_value_slice_dup (const GValue *value
);
a newly allocated copy of value
, to be freed with
tp_g_value_slice_free()
or g_slice_free()
.
Since 0.5.14
GValue * tp_g_value_slice_new_bytes (guint length
,gconstpointer bytes
);
Slice-allocate a GValue containing a byte-array, using
tp_g_value_slice_new_boxed()
. This function is convenient to use when
constructing hash tables from string to GValue, for example.
length |
number of bytes to copy |
|
bytes |
location of an array of bytes to be copied (this may be |
a GValue of type DBUS_TYPE_G_UCHAR_ARRAY
whose value is a copy
of length
bytes from bytes
, to be freed with tp_g_value_slice_free()
or
g_slice_free()
Since 0.7.27
GValue *
tp_g_value_slice_new_take_bytes (GArray *bytes
);
Slice-allocate a GValue containing bytes
, using
tp_g_value_slice_new_boxed()
. This function is convenient to use when
constructing hash tables from string to GValue, for example.
a GValue of type DBUS_TYPE_G_UCHAR_ARRAY
whose value is
bytes
, to be freed with tp_g_value_slice_free()
or
g_slice_free()
Since 0.7.27
GValue *
tp_g_value_slice_new_object_path (const gchar *path
);
Slice-allocate a GValue containing an object path, using
tp_g_value_slice_new_boxed()
. This function is convenient to use when
constructing hash tables from string to GValue, for example.
a GValue of type DBUS_TYPE_G_OBJECT_PATH
whose value is a copy
of path
, to be freed with tp_g_value_slice_free()
or g_slice_free()
Since 0.7.27
GValue *
tp_g_value_slice_new_static_object_path
(const gchar *path
);
Slice-allocate a GValue containing an object path, using
tp_g_value_slice_new_static_boxed()
. This function is convenient to use when
constructing hash tables from string to GValue, for example.
a GValue of type DBUS_TYPE_G_OBJECT_PATH
whose value is path
,
to be freed with tp_g_value_slice_free()
or g_slice_free()
Since 0.7.27
GValue *
tp_g_value_slice_new_take_object_path (gchar *path
);
Slice-allocate a GValue containing an object path, using
tp_g_value_slice_new_take_boxed()
. This function is convenient to use when
constructing hash tables from string to GValue, for example.
a GValue of type DBUS_TYPE_G_OBJECT_PATH
whose value is path
,
to be freed with tp_g_value_slice_free()
or g_slice_free()
Since 0.7.27