gvaluearray.h 3.16 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
/* GObject - GLib Type, Object, Parameter and Signal Library
 * Copyright (C) 2001 Red Hat, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General
 * Public License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * gvaluearray.h: GLib array type holding GValues
 */
21 22 23
#ifndef __G_VALUE_ARRAY_H__
#define __G_VALUE_ARRAY_H__

24 25 26
#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
#error "Only <glib-object.h> can be included directly."
#endif
27 28 29

#include	<gobject/gvalue.h>

30
G_BEGIN_DECLS
31

32 33 34 35 36 37 38 39 40
/**
 * G_TYPE_VALUE_ARRAY:
 *
 * The type ID of the "GValueArray" type which is a boxed type,
 * used to pass around pointers to GValueArrays.
 *
 * Deprecated: 2.32: Use #GArray instead of #GValueArray
 */
#define G_TYPE_VALUE_ARRAY (g_value_array_get_type ())
41 42 43

/* --- typedefs & structs --- */
typedef struct _GValueArray GValueArray;
Stefan Kost's avatar
Stefan Kost committed
44 45 46 47 48 49 50
/**
 * GValueArray:
 * @n_values: number of values contained in the array
 * @values: array of values
 * 
 * A #GValueArray contains an array of #GValue elements.
 */
51 52 53 54
struct _GValueArray
{
  guint   n_values;
  GValue *values;
55 56 57

  /*< private >*/
  guint   n_prealloced;
58 59 60
};

/* --- prototypes --- */
61
GLIB_DEPRECATED_IN_2_32_FOR(GArray)
62 63
GType           g_value_array_get_type       (void) G_GNUC_CONST;

64
GLIB_DEPRECATED_IN_2_32_FOR(GArray)
65
GValue*		g_value_array_get_nth	     (GValueArray	*value_array,
66
					      guint		 index_);
Emmanuele Bassi's avatar
Emmanuele Bassi committed
67

68
GLIB_DEPRECATED_IN_2_32_FOR(GArray)
69
GValueArray*	g_value_array_new	     (guint		 n_prealloced);
Emmanuele Bassi's avatar
Emmanuele Bassi committed
70

71
GLIB_DEPRECATED_IN_2_32_FOR(GArray)
72
void		g_value_array_free	     (GValueArray	*value_array);
Emmanuele Bassi's avatar
Emmanuele Bassi committed
73

74
GLIB_DEPRECATED_IN_2_32_FOR(GArray)
75
GValueArray*	g_value_array_copy	     (const GValueArray *value_array);
Emmanuele Bassi's avatar
Emmanuele Bassi committed
76

77
GLIB_DEPRECATED_IN_2_32_FOR(GArray)
78 79
GValueArray*	g_value_array_prepend	     (GValueArray	*value_array,
					      const GValue	*value);
Emmanuele Bassi's avatar
Emmanuele Bassi committed
80

81
GLIB_DEPRECATED_IN_2_32_FOR(GArray)
82 83
GValueArray*	g_value_array_append	     (GValueArray	*value_array,
					      const GValue	*value);
Emmanuele Bassi's avatar
Emmanuele Bassi committed
84

85
GLIB_DEPRECATED_IN_2_32_FOR(GArray)
86
GValueArray*	g_value_array_insert	     (GValueArray	*value_array,
87
					      guint		 index_,
88
					      const GValue	*value);
Emmanuele Bassi's avatar
Emmanuele Bassi committed
89

90
GLIB_DEPRECATED_IN_2_32_FOR(GArray)
91
GValueArray*	g_value_array_remove	     (GValueArray	*value_array,
92
					      guint		 index_);
Emmanuele Bassi's avatar
Emmanuele Bassi committed
93

94
GLIB_DEPRECATED_IN_2_32_FOR(GArray)
95 96
GValueArray*	g_value_array_sort	     (GValueArray	*value_array,
					      GCompareFunc	 compare_func);
Emmanuele Bassi's avatar
Emmanuele Bassi committed
97

98
GLIB_DEPRECATED_IN_2_32_FOR(GArray)
99 100 101 102 103
GValueArray*	g_value_array_sort_with_data (GValueArray	*value_array,
					      GCompareDataFunc	 compare_func,
					      gpointer		 user_data);


104
G_END_DECLS
105 106

#endif /* __G_VALUE_ARRAY_H__ */