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 #if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
22 #error "Only <glib-object.h> can be included directly."
25 #ifndef __G_VALUETYPES_H__
26 #define __G_VALUETYPES_H__
28 #include <gobject/gvalue.h>
32 /* --- type macros --- */
33 #define G_VALUE_HOLDS_CHAR(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_CHAR))
34 #define G_VALUE_HOLDS_UCHAR(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_UCHAR))
35 #define G_VALUE_HOLDS_BOOLEAN(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_BOOLEAN))
36 #define G_VALUE_HOLDS_INT(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_INT))
37 #define G_VALUE_HOLDS_UINT(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_UINT))
38 #define G_VALUE_HOLDS_LONG(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_LONG))
39 #define G_VALUE_HOLDS_ULONG(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_ULONG))
40 #define G_VALUE_HOLDS_INT64(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_INT64))
41 #define G_VALUE_HOLDS_UINT64(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_UINT64))
42 #define G_VALUE_HOLDS_FLOAT(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_FLOAT))
43 #define G_VALUE_HOLDS_DOUBLE(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_DOUBLE))
44 #define G_VALUE_HOLDS_STRING(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_STRING))
45 #define G_VALUE_HOLDS_POINTER(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_POINTER))
46 #define G_TYPE_GTYPE (g_gtype_get_type())
47 #define G_VALUE_HOLDS_GTYPE(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_GTYPE))
50 /* --- prototypes --- */
51 void g_value_set_char (GValue *value,
53 gchar g_value_get_char (const GValue *value);
54 void g_value_set_uchar (GValue *value,
56 guchar g_value_get_uchar (const GValue *value);
57 void g_value_set_boolean (GValue *value,
59 gboolean g_value_get_boolean (const GValue *value);
60 void g_value_set_int (GValue *value,
62 gint g_value_get_int (const GValue *value);
63 void g_value_set_uint (GValue *value,
65 guint g_value_get_uint (const GValue *value);
66 void g_value_set_long (GValue *value,
68 glong g_value_get_long (const GValue *value);
69 void g_value_set_ulong (GValue *value,
71 gulong g_value_get_ulong (const GValue *value);
72 void g_value_set_int64 (GValue *value,
74 gint64 g_value_get_int64 (const GValue *value);
75 void g_value_set_uint64 (GValue *value,
77 guint64 g_value_get_uint64 (const GValue *value);
78 void g_value_set_float (GValue *value,
80 gfloat g_value_get_float (const GValue *value);
81 void g_value_set_double (GValue *value,
83 gdouble g_value_get_double (const GValue *value);
84 void g_value_set_string (GValue *value,
85 const gchar *v_string);
86 void g_value_set_static_string (GValue *value,
87 const gchar *v_string);
88 G_CONST_RETURN gchar* g_value_get_string (const GValue *value);
89 gchar* g_value_dup_string (const GValue *value);
90 void g_value_set_pointer (GValue *value,
92 gpointer g_value_get_pointer (const GValue *value);
93 GType g_gtype_get_type (void);
94 void g_value_set_gtype (GValue *value,
96 GType g_value_get_gtype (const GValue *value);
99 /* Convenience for registering new pointer types */
100 GType g_pointer_type_register_static (const gchar *name);
102 /* debugging aid, describe value contents as string */
103 gchar* g_strdup_value_contents (const GValue *value);
106 void g_value_take_string (GValue *value,
108 #ifndef G_DISABLE_DEPRECATED
109 void g_value_set_string_take_ownership (GValue *value,
114 /* humpf, need a C representable type name for G_TYPE_STRING */
115 typedef gchar* gchararray;
120 #endif /* __G_VALUETYPES_H__ */