changed prototype of g_boxed_type_register_static() to contain an optional
[platform/upstream/glib.git] / gobject / gvaluetypes.h
1 /* GObject - GLib Type, Object, Parameter and Signal Library
2  * Copyright (C) 1997-1999, 2000-2001 Tim Janik and Red Hat, Inc.
3  *
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.
8  *
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.
13  *
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.
18  *
19  * gvaluetypes.h: GLib default values
20  */
21 #ifndef __G_VALUETYPES_H__
22 #define __G_VALUETYPES_H__
23
24
25 #include        <gobject/gvalue.h>
26
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31
32
33 /* --- type macros --- */
34 #define G_VALUE_HOLDS_CHAR(value)        (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_CHAR))
35 #define G_VALUE_HOLDS_UCHAR(value)       (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_UCHAR))
36 #define G_VALUE_HOLDS_BOOLEAN(value)     (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_BOOLEAN))
37 #define G_VALUE_HOLDS_INT(value)         (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_INT))
38 #define G_VALUE_HOLDS_UINT(value)        (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_UINT))
39 #define G_VALUE_HOLDS_LONG(value)        (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_LONG))
40 #define G_VALUE_HOLDS_ULONG(value)       (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_ULONG))
41 #define G_VALUE_HOLDS_FLOAT(value)       (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_FLOAT))
42 #define G_VALUE_HOLDS_DOUBLE(value)      (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_DOUBLE))
43 #define G_VALUE_HOLDS_STRING(value)      (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_STRING))
44 #define G_VALUE_HOLDS_POINTER(value)     (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_POINTER))
45
46
47 /* --- prototypes --- */
48 void                  g_value_set_char          (GValue       *value,
49                                                  gchar         v_char);
50 gchar                 g_value_get_char          (const GValue *value);
51 void                  g_value_set_uchar         (GValue       *value,
52                                                  guchar        v_uchar);
53 guchar                g_value_get_uchar         (const GValue *value);
54 void                  g_value_set_boolean       (GValue       *value,
55                                                  gboolean      v_boolean);
56 gboolean              g_value_get_boolean       (const GValue *value);
57 void                  g_value_set_int           (GValue       *value,
58                                                  gint          v_int);
59 gint                  g_value_get_int           (const GValue *value);
60 void                  g_value_set_uint          (GValue       *value,
61                                                  guint         v_uint);
62 guint                 g_value_get_uint          (const GValue *value);
63 void                  g_value_set_long          (GValue       *value,
64                                                  glong         v_long);
65 glong                 g_value_get_long          (const GValue *value);
66 void                  g_value_set_ulong         (GValue       *value,
67                                                  gulong        v_ulong);
68 gulong                g_value_get_ulong         (const GValue *value);
69 void                  g_value_set_float         (GValue       *value,
70                                                  gfloat        v_float);
71 gfloat                g_value_get_float         (const GValue *value);
72 void                  g_value_set_double        (GValue       *value,
73                                                  gdouble       v_double);
74 gdouble               g_value_get_double        (const GValue *value);
75 void                  g_value_set_string        (GValue       *value,
76                                                  const gchar  *v_string);
77 void                  g_value_set_static_string (GValue       *value,
78                                                  const gchar  *v_string);
79 G_CONST_RETURN gchar* g_value_get_string        (const GValue *value);
80 gchar*                g_value_dup_string        (const GValue *value);
81 void                  g_value_set_pointer       (GValue       *value,
82                                                  gpointer      v_pointer);
83 gpointer              g_value_get_pointer       (const GValue *value);
84
85
86 /* --- marshaller specific --- */
87 void g_value_set_string_take_ownership          (GValue            *value,
88                                                  gchar             *v_string);
89
90
91
92 #ifdef __cplusplus
93 }
94 #endif /* __cplusplus */
95
96 #endif /* __G_VALUETYPES_H__ */