diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-03-05 21:22:00 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-03-05 21:22:00 +0000 |
commit | 8c5c4cfaf172603650aac99fb87adbc56be8f00c (patch) | |
tree | c55c3b336a67ffaf662d76c094bb06ae97041fd2 | |
parent | 6749599bb1a6c04d78cd9e647917022c3a65f603 (diff) |
Implement empty stubs for a minimal set of GMarkup functions
-rw-r--r-- | eglib/gmain.c | 26 | ||||
-rw-r--r-- | eglib/gmain.h | 63 |
2 files changed, 89 insertions, 0 deletions
diff --git a/eglib/gmain.c b/eglib/gmain.c index 8b631eb5..9eb1308f 100644 --- a/eglib/gmain.c +++ b/eglib/gmain.c @@ -1578,3 +1578,29 @@ gchar *g_string_free(GString *string, gboolean free_segment) return segment; } + +/* GMarkup */ + +struct _GMarkupParseContext { +}; + +GMarkupParseContext *g_markup_parse_context_new(const GMarkupParser *parser, + GMarkupParseFlags flags, + gpointer user_data, + GDestroyNotify user_data_dnotify) +{ + return g_new0(GMarkupParseContext, 1); +} + +gboolean g_markup_parse_context_parse(GMarkupParseContext *context, + const gchar *text, gssize text_len, + GError **error) +{ + g_set_error(error, 0, 0, "Not implemented"); + return FALSE; +} + +void g_markup_parse_context_free(GMarkupParseContext *context) +{ + g_free(context); +} diff --git a/eglib/gmain.h b/eglib/gmain.h index 2ed00fb3..b174ef0d 100644 --- a/eglib/gmain.h +++ b/eglib/gmain.h @@ -279,4 +279,67 @@ void g_string_append_printf(GString *string, const gchar *format, ...); gchar *g_string_free(GString *string, gboolean free_segment); +/* GMarkup */ + +typedef enum { + G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG = 1 << 0, + G_MARKUP_TREAT_CDATA_AS_TEXT = 1 << 1 +} GMarkupParseFlags; + +typedef struct _GMarkupParseContext GMarkupParseContext; +typedef struct _GMarkupParser GMarkupParser; + +struct _GMarkupParser { + /* Called for open tags <foo bar="baz"> */ + void (*start_element) (GMarkupParseContext *context, + const gchar *element_name, + const gchar **attribute_names, + const gchar **attribute_values, + gpointer user_data, + GError **error); + + /* Called for close tags </foo> */ + void (*end_element) (GMarkupParseContext *context, + const gchar *element_name, + gpointer user_data, + GError **error); + + /* Called for character data */ + /* text is not nul-terminated */ + void (*text) (GMarkupParseContext *context, + const gchar *text, + gsize text_len, + gpointer user_data, + GError **error); + + /* Called for strings that should be re-saved verbatim in this same + * position, but are not otherwise interpretable. At the moment + * this includes comments and processing instructions. + */ + /* text is not nul-terminated. */ + void (*passthrough) (GMarkupParseContext *context, + const gchar *passthrough_text, + gsize text_len, + gpointer user_data, + GError **error); + + /* Called on error, including one set by other + * methods in the vtable. The GError should not be freed. + */ + void (*error) (GMarkupParseContext *context, + GError *error, + gpointer user_data); +}; + +GMarkupParseContext *g_markup_parse_context_new(const GMarkupParser *parser, + GMarkupParseFlags flags, + gpointer user_data, + GDestroyNotify user_data_dnotify); + +gboolean g_markup_parse_context_parse(GMarkupParseContext *context, + const gchar *text, gssize text_len, + GError **error); + +void g_markup_parse_context_free(GMarkupParseContext *context); + #endif /* __GMAIN_H */ |