glib g{u}int{8|16|32|64} patch
- From: Mathieu Lacage <mathieu gnu org>
- To: gtk-devel-list gnome org
- Subject: glib g{u}int{8|16|32|64} patch
- Date: 20 Aug 2001 13:50:36 +0000
hi all,
While doing some random personal hacking, I realized I needed GValue and
GParam support for g{u}int{8|16|32|64}. So, I hacked it. The patch is
long but pretty straightforward.
Mathieu
? patch
? docs/glib-config.1
Index: docs/reference/gobject/tmpl/types.sgml
===================================================================
RCS file: /cvs/gnome/glib/docs/reference/gobject/tmpl/types.sgml,v
retrieving revision 1.18
diff -u -r1.18 types.sgml
--- docs/reference/gobject/tmpl/types.sgml 2001/08/12 00:56:22 1.18
+++ docs/reference/gobject/tmpl/types.sgml 2001/08/20 12:41:48
@@ -184,6 +184,14 @@
@G_TYPE_CHAR: Identifier for the built-in type "gchar".
@G_TYPE_UCHAR: Identifier for the built-in type "guchar".
@G_TYPE_BOOLEAN: Identifier for the built-in type "gboolean".
+ G_TYPE_INT8:
+ G_TYPE_UINT8:
+ G_TYPE_INT16:
+ G_TYPE_UINT16:
+ G_TYPE_INT32:
+ G_TYPE_UINT32:
+ G_TYPE_INT64:
+ G_TYPE_UINT64:
@G_TYPE_INT: Identifier for the built-in type "gint".
@G_TYPE_UINT: Identifier for the built-in type "guint".
@G_TYPE_LONG: Identifier for the built-in type "glong".
@@ -223,6 +231,14 @@
@G_TYPE_PARAM_VALUE_ARRAY: Identifier for the "#GParamSpecValueArray" type.
@G_TYPE_PARAM_CLOSURE: Identifier for the "#GParamClosure" type.
@G_TYPE_PARAM_OBJECT: Identifier for the "#GParamSpecObject" type.
+ G_TYPE_PARAM_INT8:
+ G_TYPE_PARAM_UINT8:
+ G_TYPE_PARAM_INT16:
+ G_TYPE_PARAM_UINT16:
+ G_TYPE_PARAM_INT32:
+ G_TYPE_PARAM_UINT32:
+ G_TYPE_PARAM_INT64:
+ G_TYPE_PARAM_UINT64:
<!-- ##### STRUCT GTypeInterface ##### -->
<para>
Index: gobject/glib-genmarshal.c
===================================================================
RCS file: /cvs/gnome/glib/gobject/glib-genmarshal.c,v
retrieving revision 1.9
diff -u -r1.9 glib-genmarshal.c
--- gobject/glib-genmarshal.c 2001/07/26 10:36:01 1.9
+++ gobject/glib-genmarshal.c 2001/08/20 12:41:48
@@ -153,9 +153,18 @@
{ "BOXED", "BOXED", "gpointer", "g_value_get_boxed", },
{ "POINTER", "POINTER", "gpointer", "g_value_get_pointer", },
{ "OBJECT", "OBJECT", "gpointer", "g_value_get_object", },
+ { "INT8", "INT8", "gint8", "g_value_get_int8", },
+ { "UINT8", "UINT8", "guint8", "g_value_get_uint8", },
+ { "INT16", "INT16", "gint16", "g_value_get_int16", },
+ { "UINT16", "UINT16", "guint16", "g_value_get_uint16", },
+ { "INT32", "INT32", "gint32", "g_value_get_int32", },
+ { "UINT32", "UINT32", "guint32", "g_value_get_uint32", },
+ { "INT64", "INT64", "gint64", "g_value_get_int64", },
+ { "UINT64", "UINT64", "guint64", "g_value_get_uint64", },
/* deprecated: */
{ "NONE", "VOID", "void", NULL, },
{ "BOOL", "BOOLEAN", "gboolean", "g_value_get_boolean", },
+
};
const guint n_args = sizeof (args) / sizeof (args[0]);
guint i;
@@ -196,6 +205,14 @@
{ "BOXED", "BOXED", "gpointer", "g_value_set_boxed_take_ownership", NULL, NULL },
{ "POINTER", "POINTER", "gpointer", "g_value_set_pointer", NULL, NULL },
{ "OBJECT", "OBJECT", "GObject*", "g_value_set_object", "g_object_unref", "NULL !=" },
+ { "INT8", "INT8", "gint8", "g_value_set_int8", NULL, NULL },
+ { "UINT8", "UINT8", "guint8", "g_value_set_uint8", NULL, NULL },
+ { "INT16", "INT16", "gint16", "g_value_set_int16", NULL, NULL },
+ { "UINT16", "UINT16", "guint16", "g_value_set_uint16", NULL, NULL },
+ { "INT32", "INT32", "gint32", "g_value_set_int32", NULL, NULL },
+ { "UINT32", "UINT32", "guint32", "g_value_set_uint32", NULL, NULL },
+ { "INT64", "INT64", "gint64", "g_value_set_int64", NULL, NULL },
+ { "UINT64", "UINT64", "guint64", "g_value_set_uint64", NULL, NULL },
/* deprecated: */
{ "NONE", "VOID", "void", NULL, NULL, NULL },
{ "BOOL", "BOOLEAN", "gboolean", "g_value_set_boolean", NULL, NULL }
Index: gobject/gparamspecs.c
===================================================================
RCS file: /cvs/gnome/glib/gobject/gparamspecs.c,v
retrieving revision 1.16
diff -u -r1.16 gparamspecs.c
--- gobject/gparamspecs.c 2001/05/10 13:58:40 1.16
+++ gobject/gparamspecs.c 2001/08/20 12:41:48
@@ -1698,3 +1698,204 @@
return G_PARAM_SPEC (ospec);
}
+GParamSpec*
+g_param_spec_int8 (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ gint8 minimum,
+ gint8 maximum,
+ gint8 default_value,
+ GParamFlags flags)
+{
+ GParamSpecInt8 *ispec;
+
+ g_return_val_if_fail (default_value >= minimum && default_value <= maximum, NULL);
+
+ ispec = g_param_spec_internal (G_TYPE_PARAM_INT8,
+ name,
+ nick,
+ blurb,
+ flags);
+
+ ispec->minimum = minimum;
+ ispec->maximum = maximum;
+ ispec->default_value = default_value;
+
+ return G_PARAM_SPEC (ispec);
+}
+GParamSpec*
+g_param_spec_uint8 (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ guint8 minimum,
+ guint8 maximum,
+ guint8 default_value,
+ GParamFlags flags)
+{
+ GParamSpecUInt8 *ispec;
+
+ g_return_val_if_fail (default_value >= minimum && default_value <= maximum, NULL);
+
+ ispec = g_param_spec_internal (G_TYPE_PARAM_UINT8,
+ name,
+ nick,
+ blurb,
+ flags);
+
+ ispec->minimum = minimum;
+ ispec->maximum = maximum;
+ ispec->default_value = default_value;
+
+ return G_PARAM_SPEC (ispec);
+}
+GParamSpec*
+g_param_spec_int16 (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ gint16 minimum,
+ gint16 maximum,
+ gint16 default_value,
+ GParamFlags flags)
+{
+ GParamSpecInt16 *ispec;
+
+ g_return_val_if_fail (default_value >= minimum && default_value <= maximum, NULL);
+
+ ispec = g_param_spec_internal (G_TYPE_PARAM_INT16,
+ name,
+ nick,
+ blurb,
+ flags);
+
+ ispec->minimum = minimum;
+ ispec->maximum = maximum;
+ ispec->default_value = default_value;
+
+ return G_PARAM_SPEC (ispec);
+}
+GParamSpec*
+g_param_spec_uint16 (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ guint16 minimum,
+ guint16 maximum,
+ guint16 default_value,
+ GParamFlags flags)
+{
+ GParamSpecUInt16 *ispec;
+
+ g_return_val_if_fail (default_value >= minimum && default_value <= maximum, NULL);
+
+ ispec = g_param_spec_internal (G_TYPE_PARAM_UINT16,
+ name,
+ nick,
+ blurb,
+ flags);
+
+ ispec->minimum = minimum;
+ ispec->maximum = maximum;
+ ispec->default_value = default_value;
+
+ return G_PARAM_SPEC (ispec);
+}
+GParamSpec*
+g_param_spec_int32 (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ gint32 minimum,
+ gint32 maximum,
+ gint32 default_value,
+ GParamFlags flags)
+{
+ GParamSpecInt32 *ispec;
+
+ g_return_val_if_fail (default_value >= minimum && default_value <= maximum, NULL);
+
+ ispec = g_param_spec_internal (G_TYPE_PARAM_INT32,
+ name,
+ nick,
+ blurb,
+ flags);
+
+ ispec->minimum = minimum;
+ ispec->maximum = maximum;
+ ispec->default_value = default_value;
+
+ return G_PARAM_SPEC (ispec);
+}
+GParamSpec*
+g_param_spec_uint32 (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ guint32 minimum,
+ guint32 maximum,
+ guint32 default_value,
+ GParamFlags flags)
+{
+ GParamSpecUInt32 *ispec;
+
+ g_return_val_if_fail (default_value >= minimum && default_value <= maximum, NULL);
+
+ ispec = g_param_spec_internal (G_TYPE_PARAM_UINT32,
+ name,
+ nick,
+ blurb,
+ flags);
+
+ ispec->minimum = minimum;
+ ispec->maximum = maximum;
+ ispec->default_value = default_value;
+
+ return G_PARAM_SPEC (ispec);
+}
+GParamSpec*
+g_param_spec_int64 (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ gint64 minimum,
+ gint64 maximum,
+ gint64 default_value,
+ GParamFlags flags)
+{
+ GParamSpecInt64 *ispec;
+
+ g_return_val_if_fail (default_value >= minimum && default_value <= maximum, NULL);
+
+ ispec = g_param_spec_internal (G_TYPE_PARAM_INT64,
+ name,
+ nick,
+ blurb,
+ flags);
+
+ ispec->minimum = minimum;
+ ispec->maximum = maximum;
+ ispec->default_value = default_value;
+
+ return G_PARAM_SPEC (ispec);
+}
+GParamSpec*
+g_param_spec_uint64 (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ guint64 minimum,
+ guint64 maximum,
+ guint64 default_value,
+ GParamFlags flags)
+{
+ GParamSpecUInt64 *ispec;
+
+ g_return_val_if_fail (default_value >= minimum && default_value <= maximum, NULL);
+
+ ispec = g_param_spec_internal (G_TYPE_PARAM_UINT64,
+ name,
+ nick,
+ blurb,
+ flags);
+
+ ispec->minimum = minimum;
+ ispec->maximum = maximum;
+ ispec->default_value = default_value;
+
+ return G_PARAM_SPEC (ispec);
+}
+
Index: gobject/gparamspecs.h
===================================================================
RCS file: /cvs/gnome/glib/gobject/gparamspecs.h,v
retrieving revision 1.12
diff -u -r1.12 gparamspecs.h
--- gobject/gparamspecs.h 2001/06/21 00:41:55 1.12
+++ gobject/gparamspecs.h 2001/08/20 12:41:48
@@ -90,6 +90,16 @@
typedef struct _GParamSpecValueArray GParamSpecValueArray;
typedef struct _GParamSpecClosure GParamSpecClosure;
typedef struct _GParamSpecObject GParamSpecObject;
+typedef struct _GParamSpecInt8 GParamSpecInt8;
+typedef struct _GParamSpecUInt8 GParamSpecUInt8;
+typedef struct _GParamSpecInt16 GParamSpecInt16;
+typedef struct _GParamSpecUInt16 GParamSpecUInt16;
+typedef struct _GParamSpecInt32 GParamSpecInt32;
+typedef struct _GParamSpecUInt32 GParamSpecUInt32;
+typedef struct _GParamSpecInt64 GParamSpecInt64;
+typedef struct _GParamSpecUInt64 GParamSpecUInt64;
+
+
struct _GParamSpecChar
{
GParamSpec parent_instance;
@@ -219,6 +229,70 @@
{
GParamSpec parent_instance;
};
+struct _GParamSpecInt8
+{
+ GParamSpec parent_instance;
+
+ gint8 minimum;
+ gint8 maximum;
+ gint8 default_value;
+};
+struct _GParamSpecUInt8
+{
+ GParamSpec parent_instance;
+
+ guint8 minimum;
+ guint8 maximum;
+ guint8 default_value;
+};
+struct _GParamSpecInt16
+{
+ GParamSpec parent_instance;
+
+ gint16 minimum;
+ gint16 maximum;
+ gint16 default_value;
+};
+struct _GParamSpecUInt16
+{
+ GParamSpec parent_instance;
+
+ guint16 minimum;
+ guint16 maximum;
+ guint16 default_value;
+};
+struct _GParamSpecInt32
+{
+ GParamSpec parent_instance;
+
+ gint32 minimum;
+ gint32 maximum;
+ gint32 default_value;
+};
+struct _GParamSpecUInt32
+{
+ GParamSpec parent_instance;
+
+ guint32 minimum;
+ guint32 maximum;
+ guint32 default_value;
+};
+struct _GParamSpecInt64
+{
+ GParamSpec parent_instance;
+
+ gint64 minimum;
+ gint64 maximum;
+ gint64 default_value;
+};
+struct _GParamSpecUInt64
+{
+ GParamSpec parent_instance;
+
+ guint64 minimum;
+ guint64 maximum;
+ guint64 default_value;
+};
/* --- GParamSpec prototypes --- */
@@ -332,6 +406,62 @@
const gchar *nick,
const gchar *blurb,
GType object_type,
+ GParamFlags flags);
+GParamSpec* g_param_spec_int8 (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ gint8 minimum,
+ gint8 maximum,
+ gint8 default_value,
+ GParamFlags flags);
+GParamSpec* g_param_spec_uint8 (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ guint8 minimum,
+ guint8 maximum,
+ guint8 default_value,
+ GParamFlags flags);
+GParamSpec* g_param_spec_int16 (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ gint16 minimum,
+ gint16 maximum,
+ gint16 default_value,
+ GParamFlags flags);
+GParamSpec* g_param_spec_uint16 (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ guint16 minimum,
+ guint16 maximum,
+ guint16 default_value,
+ GParamFlags flags);
+GParamSpec* g_param_spec_int32 (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ gint32 minimum,
+ gint32 maximum,
+ gint32 default_value,
+ GParamFlags flags);
+GParamSpec* g_param_spec_uint32 (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ guint32 minimum,
+ guint32 maximum,
+ guint32 default_value,
+ GParamFlags flags);
+GParamSpec* g_param_spec_int64 (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ gint64 minimum,
+ gint64 maximum,
+ gint64 default_value,
+ GParamFlags flags);
+GParamSpec* g_param_spec_uint64 (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ guint64 minimum,
+ guint64 maximum,
+ guint64 default_value,
GParamFlags flags);
Index: gobject/gtype.h
===================================================================
RCS file: /cvs/gnome/glib/gobject/gtype.h,v
retrieving revision 1.30
diff -u -r1.30 gtype.h
--- gobject/gtype.h 2001/08/15 09:19:52 1.30
+++ gobject/gtype.h 2001/08/20 12:41:48
@@ -46,6 +46,14 @@
G_TYPE_CHAR,
G_TYPE_UCHAR,
G_TYPE_BOOLEAN,
+ G_TYPE_INT8,
+ G_TYPE_UINT8,
+ G_TYPE_INT16,
+ G_TYPE_UINT16,
+ G_TYPE_INT32,
+ G_TYPE_UINT32,
+ G_TYPE_INT64,
+ G_TYPE_UINT64,
G_TYPE_INT,
G_TYPE_UINT,
G_TYPE_LONG,
@@ -90,7 +98,16 @@
G_TYPE_PARAM_POINTER = G_TYPE_DERIVE_ID (G_TYPE_PARAM, 16),
G_TYPE_PARAM_VALUE_ARRAY = G_TYPE_DERIVE_ID (G_TYPE_PARAM, 17),
G_TYPE_PARAM_CLOSURE = G_TYPE_DERIVE_ID (G_TYPE_PARAM, 18),
- G_TYPE_PARAM_OBJECT = G_TYPE_DERIVE_ID (G_TYPE_PARAM, 19)
+ G_TYPE_PARAM_OBJECT = G_TYPE_DERIVE_ID (G_TYPE_PARAM, 19),
+ G_TYPE_PARAM_INT8 = G_TYPE_DERIVE_ID (G_TYPE_PARAM, 20),
+ G_TYPE_PARAM_UINT8 = G_TYPE_DERIVE_ID (G_TYPE_PARAM, 21),
+ G_TYPE_PARAM_INT16 = G_TYPE_DERIVE_ID (G_TYPE_PARAM, 22),
+ G_TYPE_PARAM_UINT16 = G_TYPE_DERIVE_ID (G_TYPE_PARAM, 23),
+ G_TYPE_PARAM_INT32 = G_TYPE_DERIVE_ID (G_TYPE_PARAM, 24),
+ G_TYPE_PARAM_UINT32 = G_TYPE_DERIVE_ID (G_TYPE_PARAM, 25),
+ G_TYPE_PARAM_INT64 = G_TYPE_DERIVE_ID (G_TYPE_PARAM, 26),
+ G_TYPE_PARAM_UINT64 = G_TYPE_DERIVE_ID (G_TYPE_PARAM, 27)
+
} GTypeFundamentals;
Index: gobject/gvalue.h
===================================================================
RCS file: /cvs/gnome/glib/gobject/gvalue.h,v
retrieving revision 1.10
diff -u -r1.10 gvalue.h
--- gobject/gvalue.h 2001/03/09 21:39:51 1.10
+++ gobject/gvalue.h 2001/08/20 12:41:48
@@ -46,6 +46,18 @@
/* public for GTypeValueTable methods */
union {
+ gint8 v_int8;
+ guint8 v_uint8;
+
+ gint16 v_int16;
+ guint16 v_uint16;
+
+ gint32 v_int32;
+ guint32 v_uint32;
+
+ gint64 v_int64;
+ guint64 v_uint64;
+
gint v_int;
guint v_uint;
glong v_long;
Index: gobject/gvaluetypes.c
===================================================================
RCS file: /cvs/gnome/glib/gobject/gvaluetypes.c,v
retrieving revision 1.11
diff -u -r1.11 gvaluetypes.c
--- gobject/gvaluetypes.c 2001/03/18 04:44:38 1.11
+++ gobject/gvaluetypes.c 2001/08/20 12:41:49
@@ -711,6 +711,142 @@
return value->data[0].v_pointer;
}
+void
+g_value_set_int8 (GValue *value,
+ gint8 v_int8)
+{
+ g_return_if_fail (G_VALUE_HOLDS_INT8 (value));
+
+ value->data[0].v_int8 = v_int8;
+}
+
+gint8
+g_value_get_int8 (const GValue *value)
+{
+ g_return_val_if_fail (G_VALUE_HOLDS_INT8 (value), 0);
+
+ return value->data[0].v_int8;
+}
+
+void
+g_value_set_uint8 (GValue *value,
+ guint8 v_uint8)
+{
+ g_return_if_fail (G_VALUE_HOLDS_UINT8 (value));
+
+ value->data[0].v_uint8 = v_uint8;
+}
+
+guint8
+g_value_get_uint8 (const GValue *value)
+{
+ g_return_val_if_fail (G_VALUE_HOLDS_UINT8 (value), 0);
+
+ return value->data[0].v_uint8;
+}
+
+void
+g_value_set_int16 (GValue *value,
+ gint16 v_int16)
+{
+ g_return_if_fail (G_VALUE_HOLDS_INT16 (value));
+
+ value->data[0].v_int16 = v_int16;
+}
+
+gint16
+g_value_get_int16 (const GValue *value)
+{
+ g_return_val_if_fail (G_VALUE_HOLDS_INT16 (value), 0);
+
+ return value->data[0].v_int16;
+}
+
+void
+g_value_set_uint16 (GValue *value,
+ guint16 v_uint16)
+{
+ g_return_if_fail (G_VALUE_HOLDS_UINT16 (value));
+
+ value->data[0].v_uint16 = v_uint16;
+}
+
+guint16
+g_value_get_uint16 (const GValue *value)
+{
+ g_return_val_if_fail (G_VALUE_HOLDS_UINT16 (value), 0);
+
+ return value->data[0].v_uint16;
+}
+
+void
+g_value_set_int32 (GValue *value,
+ gint32 v_int32)
+{
+ g_return_if_fail (G_VALUE_HOLDS_INT32 (value));
+
+ value->data[0].v_int32 = v_int32;
+}
+
+gint32
+g_value_get_int32 (const GValue *value)
+{
+ g_return_val_if_fail (G_VALUE_HOLDS_INT32 (value), 0);
+
+ return value->data[0].v_int32;
+}
+
+void
+g_value_set_uint32 (GValue *value,
+ guint32 v_uint32)
+{
+ g_return_if_fail (G_VALUE_HOLDS_UINT32 (value));
+
+ value->data[0].v_uint32 = v_uint32;
+}
+
+guint32
+g_value_get_uint32 (const GValue *value)
+{
+ g_return_val_if_fail (G_VALUE_HOLDS_UINT32 (value), 0);
+
+ return value->data[0].v_uint32;
+}
+
+void
+g_value_set_int64 (GValue *value,
+ gint64 v_int64)
+{
+ g_return_if_fail (G_VALUE_HOLDS_INT64 (value));
+
+ value->data[0].v_int64 = v_int64;
+}
+
+gint64
+g_value_get_int64 (const GValue *value)
+{
+ g_return_val_if_fail (G_VALUE_HOLDS_INT64 (value), 0);
+
+ return value->data[0].v_int64;
+}
+
+void
+g_value_set_uint64 (GValue *value,
+ guint64 v_uint64)
+{
+ g_return_if_fail (G_VALUE_HOLDS_UINT64 (value));
+
+ value->data[0].v_uint64 = v_uint64;
+}
+
+guint64
+g_value_get_uint64 (const GValue *value)
+{
+ g_return_val_if_fail (G_VALUE_HOLDS_UINT64 (value), 0);
+
+ return value->data[0].v_uint64;
+}
+
/* need extra includes for g_strdup_value_contents() ;( */
#include "gobject.h"
Index: gobject/gvaluetypes.h
===================================================================
RCS file: /cvs/gnome/glib/gobject/gvaluetypes.h,v
retrieving revision 1.10
diff -u -r1.10 gvaluetypes.h
--- gobject/gvaluetypes.h 2001/03/18 04:44:38 1.10
+++ gobject/gvaluetypes.h 2001/08/20 12:41:49
@@ -38,8 +38,18 @@
#define G_VALUE_HOLDS_DOUBLE(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_DOUBLE))
#define G_VALUE_HOLDS_STRING(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_STRING))
#define G_VALUE_HOLDS_POINTER(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_POINTER))
+#define G_VALUE_HOLDS_INT8(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_INT8))
+#define G_VALUE_HOLDS_UINT8(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_UINT8))
+#define G_VALUE_HOLDS_INT16(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_INT16))
+#define G_VALUE_HOLDS_UINT16(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_UINT16))
+#define G_VALUE_HOLDS_INT32(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_INT32))
+#define G_VALUE_HOLDS_UINT32(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_UINT32))
+#define G_VALUE_HOLDS_INT64(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_INT64))
+#define G_VALUE_HOLDS_UINT64(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_UINT64))
+
+
/* --- prototypes --- */
void g_value_set_char (GValue *value,
gchar v_char);
@@ -77,6 +87,30 @@
void g_value_set_pointer (GValue *value,
gpointer v_pointer);
gpointer g_value_get_pointer (const GValue *value);
+void g_value_set_int8 (GValue *value,
+ gint8 v_int8);
+gint8 g_value_get_int8 (const GValue *value);
+void g_value_set_uint8 (GValue *value,
+ guint8 v_uint8);
+guint8 g_value_get_uint8 (const GValue *value);
+void g_value_set_int16 (GValue *value,
+ gint16 v_int16);
+gint16 g_value_get_int16 (const GValue *value);
+void g_value_set_uint16 (GValue *value,
+ guint16 v_uint16);
+guint16 g_value_get_uint16 (const GValue *value);
+void g_value_set_int32 (GValue *value,
+ gint32 v_int32);
+gint32 g_value_get_int32 (const GValue *value);
+void g_value_set_uint32 (GValue *value,
+ guint32 v_uint32);
+guint32 g_value_get_uint32 (const GValue *value);
+void g_value_set_int64 (GValue *value,
+ gint64 v_int64);
+gint64 g_value_get_int64 (const GValue *value);
+void g_value_set_uint64 (GValue *value,
+ guint64 v_uint64);
+guint64 g_value_get_uint64 (const GValue *value);
/* debugging aid, describe value contents as string */
--
Mathieu Lacage <mathieu gnu org>
Portable: <lacage orange fr>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]