| gmarkup.h | gmarkup.h | |||
|---|---|---|---|---|
| skipping to change at line 35 | skipping to change at line 35 | |||
| #ifndef __G_MARKUP_H__ | #ifndef __G_MARKUP_H__ | |||
| #define __G_MARKUP_H__ | #define __G_MARKUP_H__ | |||
| #include <stdarg.h> | #include <stdarg.h> | |||
| #include <glib/gerror.h> | #include <glib/gerror.h> | |||
| #include <glib/gslist.h> | #include <glib/gslist.h> | |||
| G_BEGIN_DECLS | G_BEGIN_DECLS | |||
| /** | ||||
| * GMarkupError: | ||||
| * @G_MARKUP_ERROR_BAD_UTF8: text being parsed was not valid UTF-8 | ||||
| * @G_MARKUP_ERROR_EMPTY: document contained nothing, or only whitespace | ||||
| * @G_MARKUP_ERROR_PARSE: document was ill-formed | ||||
| * @G_MARKUP_ERROR_UNKNOWN_ELEMENT: error should be set by #GMarkupParser | ||||
| * functions; element wasn't known | ||||
| * @G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE: error should be set by #GMarkupParser | ||||
| * functions; attribute wasn't known | ||||
| * @G_MARKUP_ERROR_INVALID_CONTENT: error should be set by #GMarkupParser | ||||
| * functions; content was invalid | ||||
| * @G_MARKUP_ERROR_MISSING_ATTRIBUTE: error should be set by #GMarkupParser | ||||
| * functions; a required attribute was missing | ||||
| * | ||||
| * Error codes returned by markup parsing. | ||||
| */ | ||||
| typedef enum | typedef enum | |||
| { | { | |||
| G_MARKUP_ERROR_BAD_UTF8, | G_MARKUP_ERROR_BAD_UTF8, | |||
| G_MARKUP_ERROR_EMPTY, | G_MARKUP_ERROR_EMPTY, | |||
| G_MARKUP_ERROR_PARSE, | G_MARKUP_ERROR_PARSE, | |||
| /* The following are primarily intended for specific GMarkupParser | /* The following are primarily intended for specific GMarkupParser | |||
| * implementations to set. | * implementations to set. | |||
| */ | */ | |||
| G_MARKUP_ERROR_UNKNOWN_ELEMENT, | G_MARKUP_ERROR_UNKNOWN_ELEMENT, | |||
| G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, | G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, | |||
| G_MARKUP_ERROR_INVALID_CONTENT, | G_MARKUP_ERROR_INVALID_CONTENT, | |||
| G_MARKUP_ERROR_MISSING_ATTRIBUTE | G_MARKUP_ERROR_MISSING_ATTRIBUTE | |||
| } GMarkupError; | } GMarkupError; | |||
| /** | ||||
| * G_MARKUP_ERROR: | ||||
| * | ||||
| * Error domain for markup parsing. | ||||
| * Errors in this domain will be from the #GMarkupError enumeration. | ||||
| * See #GError for information on error domains. | ||||
| */ | ||||
| #define G_MARKUP_ERROR g_markup_error_quark () | #define G_MARKUP_ERROR g_markup_error_quark () | |||
| GQuark g_markup_error_quark (void); | GQuark g_markup_error_quark (void); | |||
| /** | ||||
| * GMarkupParseFlags: | ||||
| * @G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG: flag you should not use | ||||
| * @G_MARKUP_TREAT_CDATA_AS_TEXT: When this flag is set, CDATA marked | ||||
| * sections are not passed literally to the @passthrough function of | ||||
| * the parser. Instead, the content of the section (without the | ||||
| * <literal><![CDATA[</literal> and <literal>]]></literal>) is | ||||
| * passed to the @text function. This flag was added in GLib 2.12 | ||||
| * @G_MARKUP_PREFIX_ERROR_POSITION: Normally errors caught by GMarkup | ||||
| * itself have line/column information prefixed to them to let the | ||||
| * caller know the location of the error. When this flag is set the | ||||
| * location information is also prefixed to errors generated by the | ||||
| * #GMarkupParser implementation functions | ||||
| * | ||||
| * Flags that affect the behaviour of the parser. | ||||
| */ | ||||
| typedef enum | typedef enum | |||
| { | { | |||
| G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG = 1 << 0, | G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG = 1 << 0, | |||
| G_MARKUP_TREAT_CDATA_AS_TEXT = 1 << 1, | G_MARKUP_TREAT_CDATA_AS_TEXT = 1 << 1, | |||
| G_MARKUP_PREFIX_ERROR_POSITION = 1 << 2 | G_MARKUP_PREFIX_ERROR_POSITION = 1 << 2 | |||
| } GMarkupParseFlags; | } GMarkupParseFlags; | |||
| /** | ||||
| * GMarkupParseContext: | ||||
| * | ||||
| * A parse context is used to parse a stream of bytes that | ||||
| * you expect to contain marked-up text. | ||||
| * | ||||
| * See g_markup_parse_context_new(), #GMarkupParser, and so | ||||
| * on for more details. | ||||
| */ | ||||
| typedef struct _GMarkupParseContext GMarkupParseContext; | typedef struct _GMarkupParseContext GMarkupParseContext; | |||
| typedef struct _GMarkupParser GMarkupParser; | typedef struct _GMarkupParser GMarkupParser; | |||
| /** | ||||
| * GMarkupParser: | ||||
| * @start_element: Callback to invoke when the opening tag of an element | ||||
| * is seen. | ||||
| * @end_element: Callback to invoke when the closing tag of an element | ||||
| * is seen. Note that this is also called for empty tags like | ||||
| * <literal><empty/></literal>. | ||||
| * @text: Callback to invoke when some text is seen (text is always | ||||
| * inside an element). Note that the text of an element may be spread | ||||
| * over multiple calls of this function. If the | ||||
| * %G_MARKUP_TREAT_CDATA_AS_TEXT flag is set, this function is also | ||||
| * called for the content of CDATA marked sections. | ||||
| * @passthrough: Callback to invoke for comments, processing instructions | ||||
| * and doctype declarations; if you're re-writing the parsed document, | ||||
| * write the passthrough text back out in the same position. If the | ||||
| * %G_MARKUP_TREAT_CDATA_AS_TEXT flag is not set, this function is also | ||||
| * called for CDATA marked sections. | ||||
| * @error: Callback to invoke when an error occurs. | ||||
| * | ||||
| * Any of the fields in #GMarkupParser can be %NULL, in which case they | ||||
| * will be ignored. Except for the @error function, any of these callbacks | ||||
| * can set an error; in particular the %G_MARKUP_ERROR_UNKNOWN_ELEMENT, | ||||
| * %G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, and %G_MARKUP_ERROR_INVALID_CONTENT | ||||
| * errors are intended to be set from these callbacks. If you set an error | ||||
| * from a callback, g_markup_parse_context_parse() will report that error | ||||
| * back to its caller. | ||||
| */ | ||||
| struct _GMarkupParser | struct _GMarkupParser | |||
| { | { | |||
| /* Called for open tags <foo bar="baz"> */ | /* Called for open tags <foo bar="baz"> */ | |||
| void (*start_element) (GMarkupParseContext *context, | void (*start_element) (GMarkupParseContext *context, | |||
| const gchar *element_name, | const gchar *element_name, | |||
| const gchar **attribute_names, | const gchar **attribute_names, | |||
| const gchar **attribute_values, | const gchar **attribute_values, | |||
| gpointer user_data, | gpointer user_data, | |||
| GError **error); | GError **error); | |||
| skipping to change at line 116 | skipping to change at line 191 | |||
| GMarkupParseContext *g_markup_parse_context_new (const GMarkupParser *par ser, | GMarkupParseContext *g_markup_parse_context_new (const GMarkupParser *par ser, | |||
| GMarkupParseFlags fla gs, | GMarkupParseFlags fla gs, | |||
| gpointer use r_data, | gpointer use r_data, | |||
| GDestroyNotify use r_data_dnotify); | GDestroyNotify use r_data_dnotify); | |||
| void g_markup_parse_context_free (GMarkupParseContext *con text); | void g_markup_parse_context_free (GMarkupParseContext *con text); | |||
| gboolean g_markup_parse_context_parse (GMarkupParseContext *con text, | gboolean g_markup_parse_context_parse (GMarkupParseContext *con text, | |||
| const gchar *tex t, | const gchar *tex t, | |||
| gssize tex t_len, | gssize tex t_len, | |||
| GError **err or); | GError **err or); | |||
| void g_markup_parse_context_push (GMarkupParseContext *con text, | void g_markup_parse_context_push (GMarkupParseContext *con text, | |||
| GMarkupParser *par ser, | const GMarkupParser *par ser, | |||
| gpointer use r_data); | gpointer use r_data); | |||
| gpointer g_markup_parse_context_pop (GMarkupParseContext *con text); | gpointer g_markup_parse_context_pop (GMarkupParseContext *con text); | |||
| gboolean g_markup_parse_context_end_parse (GMarkupParseContext *context, | gboolean g_markup_parse_context_end_parse (GMarkupParseContext *context, | |||
| GError * *error); | GError * *error); | |||
| G_CONST_RETURN gchar *g_markup_parse_context_get_element (GMarkupParseConte xt *context); | G_CONST_RETURN gchar *g_markup_parse_context_get_element (GMarkupParseConte xt *context); | |||
| G_CONST_RETURN GSList *g_markup_parse_context_get_element_stack (GMarkupPar seContext *context); | G_CONST_RETURN GSList *g_markup_parse_context_get_element_stack (GMarkupPar seContext *context); | |||
| /* For user-constructed error messages, has no precise semantics */ | /* For user-constructed error messages, has no precise semantics */ | |||
| void g_markup_parse_context_get_position (GMarkupParseConte xt *context, | void g_markup_parse_context_get_position (GMarkupParseConte xt *context, | |||
| End of changes. 6 change blocks. | ||||
| 1 lines changed or deleted | 76 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ | ||||