epoc32/include/stdapis/glib-2.0/glib/gstrfuncs.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/stdapis/glib-2.0/glib/gstrfuncs.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/stdapis/glib-2.0/glib/gstrfuncs.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,250 @@
     1.4 -gstrfuncs.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_STRFUNCS_H__
    1.33 +#define __G_STRFUNCS_H__
    1.34 +
    1.35 +#include <_ansi.h>
    1.36 +#include <stdarg.h>
    1.37 +#include <glib/gtypes.h>
    1.38 +
    1.39 +G_BEGIN_DECLS
    1.40 +
    1.41 +/* Functions like the ones in <ctype.h> that are not affected by locale. */
    1.42 +typedef enum {
    1.43 +  G_ASCII_ALNUM  = 1 << 0,
    1.44 +  G_ASCII_ALPHA  = 1 << 1,
    1.45 +  G_ASCII_CNTRL  = 1 << 2,
    1.46 +  G_ASCII_DIGIT  = 1 << 3,
    1.47 +  G_ASCII_GRAPH  = 1 << 4,
    1.48 +  G_ASCII_LOWER  = 1 << 5,
    1.49 +  G_ASCII_PRINT  = 1 << 6,
    1.50 +  G_ASCII_PUNCT  = 1 << 7,
    1.51 +  G_ASCII_SPACE  = 1 << 8,
    1.52 +  G_ASCII_UPPER  = 1 << 9,
    1.53 +  G_ASCII_XDIGIT = 1 << 10
    1.54 +} GAsciiType;
    1.55 +
    1.56 +#ifdef __SYMBIAN32__
    1.57 +IMPORT_C const guint16 * const * _g_ascii_table();
    1.58 +#endif /* __SYMBIAN32__ */
    1.59 +GLIB_VAR const guint16 * const g_ascii_table;
    1.60 +
    1.61 +#define g_ascii_isalnum(c) \
    1.62 +  ((g_ascii_table[(guchar) (c)] & G_ASCII_ALNUM) != 0)
    1.63 +
    1.64 +#define g_ascii_isalpha(c) \
    1.65 +  ((g_ascii_table[(guchar) (c)] & G_ASCII_ALPHA) != 0)
    1.66 +
    1.67 +#define g_ascii_iscntrl(c) \
    1.68 +  ((g_ascii_table[(guchar) (c)] & G_ASCII_CNTRL) != 0)
    1.69 +
    1.70 +#define g_ascii_isdigit(c) \
    1.71 +  ((g_ascii_table[(guchar) (c)] & G_ASCII_DIGIT) != 0)
    1.72 +
    1.73 +#define g_ascii_isgraph(c) \
    1.74 +  ((g_ascii_table[(guchar) (c)] & G_ASCII_GRAPH) != 0)
    1.75 +
    1.76 +#define g_ascii_islower(c) \
    1.77 +  ((g_ascii_table[(guchar) (c)] & G_ASCII_LOWER) != 0)
    1.78 +
    1.79 +#define g_ascii_isprint(c) \
    1.80 +  ((g_ascii_table[(guchar) (c)] & G_ASCII_PRINT) != 0)
    1.81 +
    1.82 +#define g_ascii_ispunct(c) \
    1.83 +  ((g_ascii_table[(guchar) (c)] & G_ASCII_PUNCT) != 0)
    1.84 +
    1.85 +#define g_ascii_isspace(c) \
    1.86 +  ((g_ascii_table[(guchar) (c)] & G_ASCII_SPACE) != 0)
    1.87 +
    1.88 +#define g_ascii_isupper(c) \
    1.89 +  ((g_ascii_table[(guchar) (c)] & G_ASCII_UPPER) != 0)
    1.90 +
    1.91 +#define g_ascii_isxdigit(c) \
    1.92 +  ((g_ascii_table[(guchar) (c)] & G_ASCII_XDIGIT) != 0)
    1.93 +
    1.94 +IMPORT_C gchar                 g_ascii_tolower  (gchar        c) G_GNUC_CONST;
    1.95 +IMPORT_C gchar                 g_ascii_toupper  (gchar        c) G_GNUC_CONST;
    1.96 +
    1.97 +IMPORT_C gint                  g_ascii_digit_value  (gchar    c) G_GNUC_CONST;
    1.98 +IMPORT_C gint                  g_ascii_xdigit_value (gchar    c) G_GNUC_CONST;
    1.99 +
   1.100 +/* String utility functions that modify a string argument or
   1.101 + * return a constant string that must not be freed.
   1.102 + */
   1.103 +#define	 G_STR_DELIMITERS	"_-|> <."
   1.104 +IMPORT_C gchar*	              g_strdelimit     (gchar	     *string,
   1.105 +					const gchar  *delimiters,
   1.106 +					gchar	      new_delimiter);
   1.107 +IMPORT_C gchar*	              g_strcanon       (gchar        *string,
   1.108 +					const gchar  *valid_chars,
   1.109 +					gchar         substitutor);
   1.110 +IMPORT_C G_CONST_RETURN gchar* g_strerror       (gint	      errnum) G_GNUC_CONST;
   1.111 +IMPORT_C G_CONST_RETURN gchar* g_strsignal      (gint	      signum) G_GNUC_CONST;
   1.112 +IMPORT_C gchar*	              g_strreverse     (gchar	     *string);
   1.113 +IMPORT_C gsize	              g_strlcpy	       (gchar	     *dest,
   1.114 +					const gchar  *src,
   1.115 +					gsize         dest_size);
   1.116 +IMPORT_C gsize	              g_strlcat        (gchar	     *dest,
   1.117 +					const gchar  *src,
   1.118 +					gsize         dest_size);
   1.119 +IMPORT_C gchar *               g_strstr_len     (const gchar  *haystack,
   1.120 +					gssize        haystack_len,
   1.121 +					const gchar  *needle);
   1.122 +IMPORT_C gchar *               g_strrstr        (const gchar  *haystack,
   1.123 +					const gchar  *needle);
   1.124 +IMPORT_C gchar *               g_strrstr_len    (const gchar  *haystack,
   1.125 +					gssize        haystack_len,
   1.126 +					const gchar  *needle);
   1.127 +
   1.128 +IMPORT_C gboolean              g_str_has_suffix (const gchar  *str,
   1.129 +					const gchar  *suffix);
   1.130 +IMPORT_C gboolean              g_str_has_prefix (const gchar  *str,
   1.131 +					const gchar  *prefix);
   1.132 +
   1.133 +/* String to/from double conversion functions */
   1.134 +
   1.135 +IMPORT_C gdouble	              g_strtod         (const gchar  *nptr,
   1.136 +					gchar	    **endptr);
   1.137 +IMPORT_C gdouble	              g_ascii_strtod   (const gchar  *nptr,
   1.138 +					gchar	    **endptr);
   1.139 +IMPORT_C guint64		      g_ascii_strtoull (const gchar *nptr,
   1.140 +					gchar      **endptr,
   1.141 +					guint        base);
   1.142 +/* 29 bytes should enough for all possible values that
   1.143 + * g_ascii_dtostr can produce.
   1.144 + * Then add 10 for good measure */
   1.145 +#define G_ASCII_DTOSTR_BUF_SIZE (29 + 10)
   1.146 +IMPORT_C gchar *               g_ascii_dtostr   (gchar        *buffer,
   1.147 +					gint          buf_len,
   1.148 +					gdouble       d);
   1.149 +IMPORT_C gchar *               g_ascii_formatd  (gchar        *buffer,
   1.150 +					gint          buf_len,
   1.151 +					const gchar  *format,
   1.152 +					gdouble       d);
   1.153 +
   1.154 +/* removes leading spaces */
   1.155 +IMPORT_C gchar*                g_strchug        (gchar        *string);
   1.156 +/* removes trailing spaces */
   1.157 +IMPORT_C gchar*                g_strchomp       (gchar        *string);
   1.158 +/* removes leading & trailing spaces */
   1.159 +#define g_strstrip( string )	g_strchomp (g_strchug (string))
   1.160 +
   1.161 +IMPORT_C gint                  g_ascii_strcasecmp  (const gchar *s1,
   1.162 +					   const gchar *s2);
   1.163 +IMPORT_C gint                  g_ascii_strncasecmp (const gchar *s1,
   1.164 +					   const gchar *s2,
   1.165 +					   gsize        n);
   1.166 +IMPORT_C gchar*                g_ascii_strdown     (const gchar *str,
   1.167 +					   gssize       len) G_GNUC_MALLOC;
   1.168 +IMPORT_C gchar*                g_ascii_strup       (const gchar *str,
   1.169 +					   gssize       len) G_GNUC_MALLOC;
   1.170 +
   1.171 +#ifndef G_DISABLE_DEPRECATED
   1.172 +
   1.173 +/* The following four functions are deprecated and will be removed in
   1.174 + * the next major release. They use the locale-specific tolower and
   1.175 + * toupper, which is almost never the right thing.
   1.176 + */
   1.177 +
   1.178 +IMPORT_C gint	              g_strcasecmp     (const gchar *s1,
   1.179 +					const gchar *s2);
   1.180 +IMPORT_C gint	              g_strncasecmp    (const gchar *s1,
   1.181 +					const gchar *s2,
   1.182 +					guint        n);
   1.183 +IMPORT_C gchar*	              g_strdown	       (gchar	     *string);
   1.184 +IMPORT_C gchar*	              g_strup	       (gchar	     *string);
   1.185 +
   1.186 +#endif /* G_DISABLE_DEPRECATED */
   1.187 +
   1.188 +/* String utility functions that return a newly allocated string which
   1.189 + * ought to be freed with g_free from the caller at some point.
   1.190 + */
   1.191 +IMPORT_C gchar*	              g_strdup	       (const gchar *str) G_GNUC_MALLOC;
   1.192 +IMPORT_C gchar*	              g_strdup_printf  (const gchar *format,
   1.193 +					...) G_GNUC_PRINTF (1, 2) G_GNUC_MALLOC;
   1.194 +IMPORT_C gchar*	              g_strdup_vprintf (const gchar *format,
   1.195 +					va_list      args) G_GNUC_MALLOC;
   1.196 +IMPORT_C  gchar*	              g_strndup	       (const gchar *str,
   1.197 +					gsize        n) G_GNUC_MALLOC;  
   1.198 +IMPORT_C gchar*	              g_strnfill       (gsize        length,  
   1.199 +					gchar        fill_char) G_GNUC_MALLOC;
   1.200 +IMPORT_C gchar*	              g_strconcat      (const gchar *string1,
   1.201 +					...) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED;
   1.202 +IMPORT_C gchar*                g_strjoin	       (const gchar  *separator,
   1.203 +					...) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED;
   1.204 +
   1.205 +/* Make a copy of a string interpreting C string -style escape
   1.206 + * sequences. Inverse of g_strescape. The recognized sequences are \b
   1.207 + * \f \n \r \t \\ \" and the octal format.
   1.208 + */
   1.209 +IMPORT_C gchar*                g_strcompress    (const gchar *source) G_GNUC_MALLOC;
   1.210 +
   1.211 +/* Copy a string escaping nonprintable characters like in C strings.
   1.212 + * Inverse of g_strcompress. The exceptions parameter, if non-NULL, points
   1.213 + * to a string containing characters that are not to be escaped.
   1.214 + *
   1.215 + * Deprecated API: gchar* g_strescape (const gchar *source);
   1.216 + * Luckily this function wasn't used much, using NULL as second parameter
   1.217 + * provides mostly identical semantics.
   1.218 + */
   1.219 +IMPORT_C gchar*                g_strescape      (const gchar *source,
   1.220 +					const gchar *exceptions) G_GNUC_MALLOC;
   1.221 +
   1.222 +IMPORT_C gpointer              g_memdup	       (gconstpointer mem,
   1.223 +					guint	       byte_size) G_GNUC_MALLOC;
   1.224 +
   1.225 +/* NULL terminated string arrays.
   1.226 + * g_strsplit(), g_strsplit_set() split up string into max_tokens tokens
   1.227 + * at delim and return a newly allocated string array.
   1.228 + * g_strjoinv() concatenates all of str_array's strings, sliding in an
   1.229 + * optional separator, the returned string is newly allocated.
   1.230 + * g_strfreev() frees the array itself and all of its strings.
   1.231 + * g_strdupv() copies a NULL-terminated array of strings
   1.232 + * g_strv_length() returns the length of a NULL-terminated array of strings
   1.233 + */
   1.234 +IMPORT_C gchar**	              g_strsplit       (const gchar  *string,
   1.235 +					const gchar  *delimiter,
   1.236 +					gint          max_tokens) G_GNUC_MALLOC;
   1.237 +IMPORT_C gchar **	      g_strsplit_set   (const gchar *string,
   1.238 +					const gchar *delimiters,
   1.239 +					gint         max_tokens) G_GNUC_MALLOC;
   1.240 +IMPORT_C gchar*                g_strjoinv       (const gchar  *separator,
   1.241 +					gchar       **str_array) G_GNUC_MALLOC;
   1.242 +IMPORT_C void                  g_strfreev       (gchar       **str_array);
   1.243 +IMPORT_C gchar**               g_strdupv        (gchar       **str_array) G_GNUC_MALLOC;
   1.244 +IMPORT_C guint                 g_strv_length    (gchar       **str_array);
   1.245 +
   1.246 +IMPORT_C gchar*                g_stpcpy         (gchar        *dest,
   1.247 +                                        const char   *src);
   1.248 +
   1.249 +IMPORT_C G_CONST_RETURN gchar *g_strip_context  (const gchar *msgid, 
   1.250 +					const gchar *msgval);
   1.251 +
   1.252 +G_END_DECLS
   1.253 +
   1.254 +#endif /* __G_STRFUNCS_H__ */