1 /* GObject - GLib Type, Object, Parameter and Signal Library
2 * Copyright (C) 1997-1999, 2000-2001 Tim Janik and Red Hat, Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General
15 * Public License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
17 * Boston, MA 02111-1307, USA.
19 * gvaluetypes.h: GLib default values
21 #ifndef __G_VALUETYPES_H__
22 #define __G_VALUETYPES_H__
25 #include <gobject/gvalue.h>
29 /* --- type macros --- */
30 #define G_VALUE_HOLDS_CHAR(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_CHAR))
31 #define G_VALUE_HOLDS_UCHAR(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_UCHAR))
32 #define G_VALUE_HOLDS_BOOLEAN(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_BOOLEAN))
33 #define G_VALUE_HOLDS_INT(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_INT))
34 #define G_VALUE_HOLDS_UINT(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_UINT))
35 #define G_VALUE_HOLDS_LONG(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_LONG))
36 #define G_VALUE_HOLDS_ULONG(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_ULONG))
37 #define G_VALUE_HOLDS_FLOAT(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_FLOAT))
38 #define G_VALUE_HOLDS_DOUBLE(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_DOUBLE))
39 #define G_VALUE_HOLDS_STRING(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_STRING))
40 #define G_VALUE_HOLDS_POINTER(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_POINTER))
43 /* --- prototypes --- */
44 void g_value_set_char (GValue *value,
46 gchar g_value_get_char (const GValue *value);
47 void g_value_set_uchar (GValue *value,
49 guchar g_value_get_uchar (const GValue *value);
50 void g_value_set_boolean (GValue *value,
52 gboolean g_value_get_boolean (const GValue *value);
53 void g_value_set_int (GValue *value,
55 gint g_value_get_int (const GValue *value);
56 void g_value_set_uint (GValue *value,
58 guint g_value_get_uint (const GValue *value);
59 void g_value_set_long (GValue *value,
61 glong g_value_get_long (const GValue *value);
62 void g_value_set_ulong (GValue *value,
64 gulong g_value_get_ulong (const GValue *value);
65 void g_value_set_float (GValue *value,
67 gfloat g_value_get_float (const GValue *value);
68 void g_value_set_double (GValue *value,
70 gdouble g_value_get_double (const GValue *value);
71 void g_value_set_string (GValue *value,
72 const gchar *v_string);
73 void g_value_set_static_string (GValue *value,
74 const gchar *v_string);
75 G_CONST_RETURN gchar* g_value_get_string (const GValue *value);
76 gchar* g_value_dup_string (const GValue *value);
77 void g_value_set_pointer (GValue *value,
79 gpointer g_value_get_pointer (const GValue *value);
82 /* debugging aid, describe value contents as string */
83 gchar* g_strdup_value_contents (const GValue *value);
86 /* --- marshaller specific --- */
87 void g_value_set_string_take_ownership (GValue *value,
94 #endif /* __G_VALUETYPES_H__ */