epoc32/include/stdapis/glib-2.0/glib/garray.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/stdapis/glib-2.0/glib/garray.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/stdapis/glib-2.0/glib/garray.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,169 @@
     1.4 -garray.h
     1.5 +/* GLIB - Library of useful routines for C programming
     1.6 + * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
     1.7 + * Portions copyright (c) 2006 Nokia Corporation.  All rights reserved.
     1.8 + *
     1.9 + * This library is free software; you can redistribute it and/or
    1.10 + * modify it under the terms of the GNU Lesser General Public
    1.11 + * License as published by the Free Software Foundation; either
    1.12 + * version 2 of the License, or (at your option) any later version.
    1.13 + *
    1.14 + * This library is distributed in the hope that it will be useful,
    1.15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
    1.17 + * Lesser General Public License for more details.
    1.18 + *
    1.19 + * You should have received a copy of the GNU Lesser General Public
    1.20 + * License along with this library; if not, write to the
    1.21 + * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    1.22 + * Boston, MA 02111-1307, USA.
    1.23 + */
    1.24 +
    1.25 +/*
    1.26 + * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
    1.27 + * file for a list of people on the GLib Team.  See the ChangeLog
    1.28 + * files for a list of changes.  These files are distributed with
    1.29 + * GLib at ftp://ftp.gtk.org/pub/gtk/. 
    1.30 + */
    1.31 +
    1.32 +#ifndef __G_ARRAY_H__
    1.33 +#define __G_ARRAY_H__
    1.34 +
    1.35 +#include <_ansi.h>
    1.36 +#include <glib/gtypes.h>
    1.37 +
    1.38 +G_BEGIN_DECLS
    1.39 +
    1.40 +typedef struct _GArray		GArray;
    1.41 +typedef struct _GByteArray	GByteArray;
    1.42 +typedef struct _GPtrArray	GPtrArray;
    1.43 +
    1.44 +struct _GArray
    1.45 +{
    1.46 +  gchar *data;
    1.47 +  guint len;
    1.48 +};
    1.49 +
    1.50 +struct _GByteArray
    1.51 +{
    1.52 +  guint8 *data;
    1.53 +  guint	  len;
    1.54 +};
    1.55 +
    1.56 +struct _GPtrArray
    1.57 +{
    1.58 +  gpointer *pdata;
    1.59 +  guint	    len;
    1.60 +};
    1.61 +
    1.62 +/* Resizable arrays. remove fills any cleared spot and shortens the
    1.63 + * array, while preserving the order. remove_fast will distort the
    1.64 + * order by moving the last element to the position of the removed.
    1.65 + */
    1.66 +
    1.67 +#define g_array_append_val(a,v)	  g_array_append_vals (a, &(v), 1)
    1.68 +#define g_array_prepend_val(a,v)  g_array_prepend_vals (a, &(v), 1)
    1.69 +#define g_array_insert_val(a,i,v) g_array_insert_vals (a, i, &(v), 1)
    1.70 +#define g_array_index(a,t,i)      (((t*) (a)->data) [(i)])
    1.71 +
    1.72 +IMPORT_C GArray* g_array_new               (gboolean          zero_terminated,
    1.73 +				   gboolean          clear_,
    1.74 +				   guint             element_size);
    1.75 +IMPORT_C GArray* g_array_sized_new         (gboolean          zero_terminated,
    1.76 +				   gboolean          clear_,
    1.77 +				   guint             element_size,
    1.78 +				   guint             reserved_size);
    1.79 +IMPORT_C gchar*  g_array_free              (GArray           *array,
    1.80 +				   gboolean          free_segment);
    1.81 +IMPORT_C GArray* g_array_append_vals       (GArray           *array,
    1.82 +				   gconstpointer     data,
    1.83 +				   guint             len);
    1.84 +IMPORT_C GArray* g_array_prepend_vals      (GArray           *array,
    1.85 +				   gconstpointer     data,
    1.86 +				   guint             len);
    1.87 +IMPORT_C GArray* g_array_insert_vals       (GArray           *array,
    1.88 +				   guint             index_,
    1.89 +				   gconstpointer     data,
    1.90 +				   guint             len);
    1.91 +IMPORT_C GArray* g_array_set_size          (GArray           *array,
    1.92 +				   guint             length);
    1.93 +IMPORT_C GArray* g_array_remove_index      (GArray           *array,
    1.94 +				   guint             index_);
    1.95 +IMPORT_C GArray* g_array_remove_index_fast (GArray           *array,
    1.96 +				   guint             index_);
    1.97 +IMPORT_C GArray* g_array_remove_range      (GArray           *array,
    1.98 +				   guint             index_,
    1.99 +				   guint             length);
   1.100 +IMPORT_C void    g_array_sort              (GArray           *array,
   1.101 +				   GCompareFunc      compare_func);
   1.102 +IMPORT_C void    g_array_sort_with_data    (GArray           *array,
   1.103 +				   GCompareDataFunc  compare_func,
   1.104 +				   gpointer          user_data);
   1.105 +
   1.106 +/* Resizable pointer array.  This interface is much less complicated
   1.107 + * than the above.  Add appends a pointer.  Remove fills any cleared 
   1.108 + * spot and shortens the array. remove_fast will again distort order.  
   1.109 + */
   1.110 +#define    g_ptr_array_index(array,index_) ((array)->pdata)[index_]
   1.111 +IMPORT_C GPtrArray* g_ptr_array_new                (void);
   1.112 +IMPORT_C GPtrArray* g_ptr_array_sized_new          (guint             reserved_size);
   1.113 +IMPORT_C gpointer*  g_ptr_array_free               (GPtrArray        *array,
   1.114 +					   gboolean          free_seg);
   1.115 +IMPORT_C void       g_ptr_array_set_size           (GPtrArray        *array,
   1.116 +					   gint              length);
   1.117 +IMPORT_C gpointer   g_ptr_array_remove_index       (GPtrArray        *array,
   1.118 +					   guint             index_);
   1.119 +IMPORT_C gpointer   g_ptr_array_remove_index_fast  (GPtrArray        *array,
   1.120 +					   guint             index_);
   1.121 +IMPORT_C gboolean   g_ptr_array_remove             (GPtrArray        *array,
   1.122 +					   gpointer          data);
   1.123 +IMPORT_C gboolean   g_ptr_array_remove_fast        (GPtrArray        *array,
   1.124 +					   gpointer          data);
   1.125 +IMPORT_C void       g_ptr_array_remove_range       (GPtrArray        *array,
   1.126 +					   guint             index_,
   1.127 +					   guint             length);
   1.128 +IMPORT_C void       g_ptr_array_add                (GPtrArray        *array,
   1.129 +					   gpointer          data);
   1.130 +IMPORT_C void       g_ptr_array_sort               (GPtrArray        *array,
   1.131 +					   GCompareFunc      compare_func);
   1.132 +IMPORT_C void       g_ptr_array_sort_with_data     (GPtrArray        *array,
   1.133 +					   GCompareDataFunc  compare_func,
   1.134 +					   gpointer          user_data);
   1.135 +IMPORT_C void       g_ptr_array_foreach            (GPtrArray        *array,
   1.136 +					   GFunc             func,
   1.137 +					   gpointer          user_data);
   1.138 +
   1.139 +
   1.140 +/* Byte arrays, an array of guint8.  Implemented as a GArray,
   1.141 + * but type-safe.
   1.142 + */
   1.143 +
   1.144 +IMPORT_C GByteArray* g_byte_array_new               (void);
   1.145 +IMPORT_C GByteArray* g_byte_array_sized_new         (guint             reserved_size);
   1.146 +IMPORT_C guint8*     g_byte_array_free              (GByteArray       *array,
   1.147 +					    gboolean          free_segment);
   1.148 +IMPORT_C GByteArray* g_byte_array_append            (GByteArray       *array,
   1.149 +					    const guint8     *data,
   1.150 +					    guint             len);
   1.151 +IMPORT_C GByteArray* g_byte_array_prepend           (GByteArray       *array,
   1.152 +					    const guint8     *data,
   1.153 +					    guint             len);
   1.154 +IMPORT_C GByteArray* g_byte_array_set_size          (GByteArray       *array,
   1.155 +					    guint             length);
   1.156 +IMPORT_C GByteArray* g_byte_array_remove_index      (GByteArray       *array,
   1.157 +					    guint             index_);
   1.158 +IMPORT_C GByteArray* g_byte_array_remove_index_fast (GByteArray       *array,
   1.159 +					    guint             index_);
   1.160 +IMPORT_C GByteArray* g_byte_array_remove_range      (GByteArray       *array,
   1.161 +					    guint             index_,
   1.162 +					    guint             length);
   1.163 +IMPORT_C void        g_byte_array_sort              (GByteArray       *array,
   1.164 +					    GCompareFunc      compare_func);
   1.165 +IMPORT_C void        g_byte_array_sort_with_data    (GByteArray       *array,
   1.166 +					    GCompareDataFunc  compare_func,
   1.167 +					    gpointer          user_data);
   1.168 +
   1.169 +
   1.170 +G_END_DECLS
   1.171 +
   1.172 +#endif /* __G_ARRAY_H__ */
   1.173 +