1.1 --- a/epoc32/include/stdapis/glib-2.0/glib/gstring.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/stdapis/glib-2.0/glib/gstring.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,159 @@
1.4 -gstring.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_STRING_H__
1.33 +#define __G_STRING_H__
1.34 +
1.35 +#include <_ansi.h>
1.36 +#include <glib/gtypes.h>
1.37 +#include <glib/gunicode.h>
1.38 +#include <glib/gutils.h> /* for G_CAN_INLINE */
1.39 +
1.40 +G_BEGIN_DECLS
1.41 +
1.42 +typedef struct _GString GString;
1.43 +typedef struct _GStringChunk GStringChunk;
1.44 +
1.45 +struct _GString
1.46 +{
1.47 + gchar *str;
1.48 + gsize len;
1.49 + gsize allocated_len;
1.50 +};
1.51 +
1.52 +/* String Chunks
1.53 + */
1.54 +IMPORT_C GStringChunk* g_string_chunk_new (gsize size);
1.55 +IMPORT_C void g_string_chunk_free (GStringChunk *chunk);
1.56 +IMPORT_C gchar* g_string_chunk_insert (GStringChunk *chunk,
1.57 + const gchar *string);
1.58 +IMPORT_C gchar* g_string_chunk_insert_len (GStringChunk *chunk,
1.59 + const gchar *string,
1.60 + gssize len);
1.61 +IMPORT_C gchar* g_string_chunk_insert_const (GStringChunk *chunk,
1.62 + const gchar *string);
1.63 +
1.64 +
1.65 +/* Strings
1.66 + */
1.67 +IMPORT_C GString* g_string_new (const gchar *init);
1.68 +IMPORT_C GString* g_string_new_len (const gchar *init,
1.69 + gssize len);
1.70 +IMPORT_C GString* g_string_sized_new (gsize dfl_size);
1.71 +IMPORT_C gchar* g_string_free (GString *string,
1.72 + gboolean free_segment);
1.73 +IMPORT_C gboolean g_string_equal (const GString *v,
1.74 + const GString *v2);
1.75 +IMPORT_C guint g_string_hash (const GString *str);
1.76 +IMPORT_C GString* g_string_assign (GString *string,
1.77 + const gchar *rval);
1.78 +IMPORT_C GString* g_string_truncate (GString *string,
1.79 + gsize len);
1.80 +IMPORT_C GString* g_string_set_size (GString *string,
1.81 + gsize len);
1.82 +IMPORT_C GString* g_string_insert_len (GString *string,
1.83 + gssize pos,
1.84 + const gchar *val,
1.85 + gssize len);
1.86 +IMPORT_C GString* g_string_append (GString *string,
1.87 + const gchar *val);
1.88 +IMPORT_C GString* g_string_append_len (GString *string,
1.89 + const gchar *val,
1.90 + gssize len);
1.91 +IMPORT_C GString* g_string_append_c (GString *string,
1.92 + gchar c);
1.93 +IMPORT_C GString* g_string_append_unichar (GString *string,
1.94 + gunichar wc);
1.95 +IMPORT_C GString* g_string_prepend (GString *string,
1.96 + const gchar *val);
1.97 +IMPORT_C GString* g_string_prepend_c (GString *string,
1.98 + gchar c);
1.99 +IMPORT_C GString* g_string_prepend_unichar (GString *string,
1.100 + gunichar wc);
1.101 +IMPORT_C GString* g_string_prepend_len (GString *string,
1.102 + const gchar *val,
1.103 + gssize len);
1.104 +IMPORT_C GString* g_string_insert (GString *string,
1.105 + gssize pos,
1.106 + const gchar *val);
1.107 +IMPORT_C GString* g_string_insert_c (GString *string,
1.108 + gssize pos,
1.109 + gchar c);
1.110 +IMPORT_C GString* g_string_insert_unichar (GString *string,
1.111 + gssize pos,
1.112 + gunichar wc);
1.113 +IMPORT_C GString* g_string_erase (GString *string,
1.114 + gssize pos,
1.115 + gssize len);
1.116 +IMPORT_C GString* g_string_ascii_down (GString *string);
1.117 +IMPORT_C GString* g_string_ascii_up (GString *string);
1.118 +IMPORT_C void g_string_printf (GString *string,
1.119 + const gchar *format,
1.120 + ...) G_GNUC_PRINTF (2, 3);
1.121 +IMPORT_C void g_string_append_printf (GString *string,
1.122 + const gchar *format,
1.123 + ...) G_GNUC_PRINTF (2, 3);
1.124 +
1.125 +/* -- optimize g_strig_append_c --- */
1.126 +#ifdef G_CAN_INLINE
1.127 +static inline GString*
1.128 +g_string_append_c_inline (GString *gstring,
1.129 + gchar c)
1.130 +{
1.131 + if (gstring->len + 1 < gstring->allocated_len)
1.132 + {
1.133 + gstring->str[gstring->len++] = c;
1.134 + gstring->str[gstring->len] = 0;
1.135 + }
1.136 + else
1.137 + g_string_insert_c (gstring, -1, c);
1.138 + return gstring;
1.139 +}
1.140 +#define g_string_append_c(gstr,c) g_string_append_c_inline (gstr, c)
1.141 +#endif /* G_CAN_INLINE */
1.142 +
1.143 +
1.144 +#ifndef G_DISABLE_DEPRECATED
1.145 +
1.146 +/* The following two functions are deprecated and will be removed in
1.147 + * the next major release. They use the locale-specific tolower and
1.148 + * toupper, which is almost never the right thing.
1.149 + */
1.150 +
1.151 +IMPORT_C GString* g_string_down (GString *string);
1.152 +IMPORT_C GString* g_string_up (GString *string);
1.153 +
1.154 +/* These aliases are included for compatibility. */
1.155 +#define g_string_sprintf g_string_printf
1.156 +#define g_string_sprintfa g_string_append_printf
1.157 +
1.158 +#endif /* G_DISABLE_DEPRECATED */
1.159 +
1.160 +G_END_DECLS
1.161 +
1.162 +#endif /* __G_STRING_H__ */
1.163 +