source: trunk/third/glib2/gobject/gvaluetypes.h @ 20721

Revision 20721, 4.8 KB checked in by ghudson, 21 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r20720, which included commits to RCS files with non-trunk default branches.
Line 
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#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
22#error "Only <glib-object.h> can be included directly."
23#endif
24
25#ifndef __G_VALUETYPES_H__
26#define __G_VALUETYPES_H__
27
28#include        <gobject/gvalue.h>
29
30G_BEGIN_DECLS
31
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
47
48/* --- prototypes --- */
49void                  g_value_set_char          (GValue       *value,
50                                                 gchar         v_char);
51gchar                 g_value_get_char          (const GValue *value);
52void                  g_value_set_uchar         (GValue       *value,
53                                                 guchar        v_uchar);
54guchar                g_value_get_uchar         (const GValue *value);
55void                  g_value_set_boolean       (GValue       *value,
56                                                 gboolean      v_boolean);
57gboolean              g_value_get_boolean       (const GValue *value);
58void                  g_value_set_int           (GValue       *value,
59                                                 gint          v_int);
60gint                  g_value_get_int           (const GValue *value);
61void                  g_value_set_uint          (GValue       *value,
62                                                 guint         v_uint);
63guint                 g_value_get_uint          (const GValue *value);
64void                  g_value_set_long          (GValue       *value,
65                                                 glong         v_long);
66glong                 g_value_get_long          (const GValue *value);
67void                  g_value_set_ulong         (GValue       *value,
68                                                 gulong        v_ulong);
69gulong                g_value_get_ulong         (const GValue *value);
70void                  g_value_set_int64         (GValue       *value,
71                                                 gint64        v_int64);
72gint64                g_value_get_int64         (const GValue *value);
73void                  g_value_set_uint64        (GValue       *value,
74                                                 guint64      v_uint64);
75guint64               g_value_get_uint64        (const GValue *value);
76void                  g_value_set_float         (GValue       *value,
77                                                 gfloat        v_float);
78gfloat                g_value_get_float         (const GValue *value);
79void                  g_value_set_double        (GValue       *value,
80                                                 gdouble       v_double);
81gdouble               g_value_get_double        (const GValue *value);
82void                  g_value_set_string        (GValue       *value,
83                                                 const gchar  *v_string);
84void                  g_value_set_static_string (GValue       *value,
85                                                 const gchar  *v_string);
86G_CONST_RETURN gchar* g_value_get_string        (const GValue *value);
87gchar*                g_value_dup_string        (const GValue *value);
88void                  g_value_set_pointer       (GValue       *value,
89                                                 gpointer      v_pointer);
90gpointer              g_value_get_pointer       (const GValue *value);
91
92
93/* Convenience for registering new pointer types */
94GType                 g_pointer_type_register_static (const gchar *name);
95
96/* debugging aid, describe value contents as string */
97gchar*                g_strdup_value_contents   (const GValue *value);
98
99
100void g_value_take_string                        (GValue            *value,
101                                                 gchar             *v_string);
102#ifndef G_DISABLE_DEPRECATED
103void g_value_set_string_take_ownership          (GValue            *value,
104                                                 gchar             *v_string);
105#endif
106
107
108/* humpf, need a C representable type name for G_TYPE_STRING */
109typedef gchar* gchararray;
110
111
112G_END_DECLS
113
114#endif /* __G_VALUETYPES_H__ */
Note: See TracBrowser for help on using the repository browser.