epoc32/include/stdapis/glib-2.0/glib/gmarkup.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/stdapis/glib-2.0/glib/gmarkup.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/stdapis/glib-2.0/glib/gmarkup.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,133 @@
     1.4 -gmarkup.h
     1.5 +/* gmarkup.h - Simple XML-like string parser/writer
     1.6 + *
     1.7 + *  Copyright 2000 Red Hat, Inc.
     1.8 + * Portions copyright (c) 2006 Nokia Corporation.  All rights reserved.
     1.9 + *
    1.10 + * GLib is free software; you can redistribute it and/or modify it
    1.11 + * under the terms of the GNU Lesser General Public License as
    1.12 + * published by the Free Software Foundation; either version 2 of the
    1.13 + * License, or (at your option) any later version.
    1.14 + *
    1.15 + * GLib is distributed in the hope that it will be useful,
    1.16 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.17 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.18 + * Lesser General Public License for more details.
    1.19 + *
    1.20 + * You should have received a copy of the GNU Lesser General Public
    1.21 + * License along with GLib; see the file COPYING.LIB.  If not,
    1.22 + * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    1.23 + *   Boston, MA 02111-1307, USA.
    1.24 + */
    1.25 +
    1.26 +#ifndef __G_MARKUP_H__
    1.27 +#define __G_MARKUP_H__
    1.28 +
    1.29 +#include <_ansi.h>
    1.30 +#include <stdarg.h>
    1.31 +
    1.32 +#include <glib/gerror.h>
    1.33 +
    1.34 +G_BEGIN_DECLS
    1.35 +
    1.36 +typedef enum
    1.37 +{
    1.38 +  G_MARKUP_ERROR_BAD_UTF8,
    1.39 +  G_MARKUP_ERROR_EMPTY,
    1.40 +  G_MARKUP_ERROR_PARSE,
    1.41 +  /* These three are primarily intended for specific GMarkupParser
    1.42 +   * implementations to set.
    1.43 +   */
    1.44 +  G_MARKUP_ERROR_UNKNOWN_ELEMENT,
    1.45 +  G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE,
    1.46 +  G_MARKUP_ERROR_INVALID_CONTENT
    1.47 +} GMarkupError;
    1.48 +
    1.49 +#define G_MARKUP_ERROR g_markup_error_quark ()
    1.50 +
    1.51 +IMPORT_C GQuark g_markup_error_quark (void);
    1.52 +
    1.53 +typedef enum
    1.54 +{
    1.55 +  /* Hmm, can't think of any at the moment */
    1.56 +  G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG = 1 << 0
    1.57 +  
    1.58 +} GMarkupParseFlags;
    1.59 +
    1.60 +typedef struct _GMarkupParseContext GMarkupParseContext;
    1.61 +typedef struct _GMarkupParser GMarkupParser;
    1.62 +
    1.63 +struct _GMarkupParser
    1.64 +{
    1.65 +  /* Called for open tags <foo bar="baz"> */
    1.66 +  void (*start_element)  (GMarkupParseContext *context,
    1.67 +                          const gchar         *element_name,
    1.68 +                          const gchar        **attribute_names,
    1.69 +                          const gchar        **attribute_values,
    1.70 +                          gpointer             user_data,
    1.71 +                          GError             **error);
    1.72 +
    1.73 +  /* Called for close tags </foo> */
    1.74 +  void (*end_element)    (GMarkupParseContext *context,
    1.75 +                          const gchar         *element_name,
    1.76 +                          gpointer             user_data,
    1.77 +                          GError             **error);
    1.78 +
    1.79 +  /* Called for character data */
    1.80 +  /* text is not nul-terminated */
    1.81 +  void (*text)           (GMarkupParseContext *context,
    1.82 +                          const gchar         *text,
    1.83 +                          gsize                text_len,  
    1.84 +                          gpointer             user_data,
    1.85 +                          GError             **error);
    1.86 +
    1.87 +  /* Called for strings that should be re-saved verbatim in this same
    1.88 +   * position, but are not otherwise interpretable.  At the moment
    1.89 +   * this includes comments and processing instructions.
    1.90 +   */
    1.91 +  /* text is not nul-terminated. */
    1.92 +  void (*passthrough)    (GMarkupParseContext *context,
    1.93 +                          const gchar         *passthrough_text,
    1.94 +                          gsize                text_len,  
    1.95 +                          gpointer             user_data,
    1.96 +                          GError             **error);
    1.97 +
    1.98 +  /* Called on error, including one set by other
    1.99 +   * methods in the vtable. The GError should not be freed.
   1.100 +   */
   1.101 +  void (*error)          (GMarkupParseContext *context,
   1.102 +                          GError              *error,
   1.103 +                          gpointer             user_data);
   1.104 +};
   1.105 +
   1.106 +IMPORT_C GMarkupParseContext *g_markup_parse_context_new   (const GMarkupParser *parser,
   1.107 +                                                   GMarkupParseFlags    flags,
   1.108 +                                                   gpointer             user_data,
   1.109 +                                                   GDestroyNotify       user_data_dnotify);
   1.110 +IMPORT_C void                 g_markup_parse_context_free  (GMarkupParseContext *context);
   1.111 +IMPORT_C gboolean             g_markup_parse_context_parse (GMarkupParseContext *context,
   1.112 +                                                   const gchar         *text,
   1.113 +                                                   gssize               text_len,  
   1.114 +                                                   GError             **error);
   1.115 +                                                   
   1.116 +IMPORT_C gboolean             g_markup_parse_context_end_parse (GMarkupParseContext *context,
   1.117 +                                                       GError             **error);
   1.118 +IMPORT_C G_CONST_RETURN gchar *g_markup_parse_context_get_element (GMarkupParseContext *context);
   1.119 +
   1.120 +/* For user-constructed error messages, has no precise semantics */
   1.121 +IMPORT_C void                 g_markup_parse_context_get_position (GMarkupParseContext *context,
   1.122 +                                                          gint                *line_number,
   1.123 +                                                          gint                *char_number);
   1.124 +
   1.125 +/* useful when saving */
   1.126 +IMPORT_C gchar* g_markup_escape_text (const gchar *text,
   1.127 +                             gssize       length);  
   1.128 +
   1.129 +IMPORT_C gchar *g_markup_printf_escaped (const char *format,
   1.130 +				...) G_GNUC_PRINTF (1, 2);
   1.131 +IMPORT_C gchar *g_markup_vprintf_escaped (const char *format,
   1.132 +				 va_list     args);
   1.133 +
   1.134 +G_END_DECLS
   1.135 +
   1.136 +#endif /* __G_MARKUP_H__ */
   1.137 +