mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-05-31 18:00:06 +02:00
gmarkup: Add G_MARKUP_PARSE_FLAGS_NONE
Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
cef780e9ef
commit
0d4e401ede
@ -435,7 +435,8 @@ load_comment_for_mime_helper (const char *dir,
|
||||
if (!res)
|
||||
return NULL;
|
||||
|
||||
context = g_markup_parse_context_new (&parser, 0, &parse_data, NULL);
|
||||
context = g_markup_parse_context_new (&parser, G_MARKUP_PARSE_FLAGS_NONE,
|
||||
&parse_data, NULL);
|
||||
res = g_markup_parse_context_parse (context, data, len, NULL);
|
||||
g_free (data);
|
||||
g_markup_parse_context_free (context);
|
||||
|
@ -1510,7 +1510,7 @@ g_bookmark_file_parse (GBookmarkFile *bookmark,
|
||||
parse_data->bookmark_file = bookmark;
|
||||
|
||||
context = g_markup_parse_context_new (&markup_parser,
|
||||
0,
|
||||
G_MARKUP_PARSE_FLAGS_NONE,
|
||||
parse_data,
|
||||
(GDestroyNotify) parse_data_free);
|
||||
|
||||
|
@ -76,6 +76,7 @@ GQuark g_markup_error_quark (void);
|
||||
|
||||
/**
|
||||
* GMarkupParseFlags:
|
||||
* @G_MARKUP_PARSE_FLAGS_NONE: No special behaviour. Since: 2.74
|
||||
* @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
|
||||
@ -96,6 +97,7 @@ GQuark g_markup_error_quark (void);
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
G_MARKUP_PARSE_FLAGS_NONE GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 0, /*< nick=none >*/
|
||||
G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG = 1 << 0,
|
||||
G_MARKUP_TREAT_CDATA_AS_TEXT = 1 << 1,
|
||||
G_MARKUP_PREFIX_ERROR_POSITION = 1 << 2,
|
||||
|
@ -243,7 +243,9 @@ static GMarkupParser parser = {
|
||||
static void
|
||||
test_g_markup_parse_context (void)
|
||||
{
|
||||
g_autoptr(GMarkupParseContext) val = g_markup_parse_context_new (&parser, 0, NULL, NULL);
|
||||
g_autoptr(GMarkupParseContext) val = g_markup_parse_context_new (&parser,
|
||||
G_MARKUP_PARSE_FLAGS_NONE,
|
||||
NULL, NULL);
|
||||
g_assert_nonnull (val);
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,9 @@ test_cleanup (void)
|
||||
if (!g_test_undefined ())
|
||||
return;
|
||||
|
||||
context = g_markup_parse_context_new (&cleanup_parser, 0, NULL, NULL);
|
||||
context = g_markup_parse_context_new (&cleanup_parser,
|
||||
G_MARKUP_PARSE_FLAGS_NONE, NULL,
|
||||
NULL);
|
||||
g_markup_parse_context_parse (context, XML, -1, NULL);
|
||||
|
||||
g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL,
|
||||
|
@ -314,7 +314,7 @@ main (int argc, char *argv[])
|
||||
if (argc > 1)
|
||||
{
|
||||
gint arg = 1;
|
||||
GMarkupParseFlags flags = 0;
|
||||
GMarkupParseFlags flags = G_MARKUP_PARSE_FLAGS_NONE;
|
||||
|
||||
if (strcmp (argv[1], "--cdata-as-text") == 0)
|
||||
{
|
||||
|
@ -289,7 +289,8 @@ test (gconstpointer user_data)
|
||||
|
||||
error = NULL;
|
||||
string = g_string_new (NULL);
|
||||
ctx = g_markup_parse_context_new (&parser, 0, string, NULL);
|
||||
ctx = g_markup_parse_context_new (&parser, G_MARKUP_PARSE_FLAGS_NONE,
|
||||
string, NULL);
|
||||
result = g_markup_parse_context_parse (ctx, tc->markup,
|
||||
strlen (tc->markup), &error);
|
||||
if (result)
|
||||
|
@ -80,7 +80,8 @@ test_markup_stack (void)
|
||||
gboolean res;
|
||||
GError *error = NULL;
|
||||
|
||||
context = g_markup_parse_context_new (&parser, 0, &data, NULL);
|
||||
context = g_markup_parse_context_new (&parser, G_MARKUP_PARSE_FLAGS_NONE,
|
||||
&data, NULL);
|
||||
res = g_markup_parse_context_parse (context, content, -1, &error);
|
||||
g_assert (res);
|
||||
g_assert_no_error (error);
|
||||
|
@ -560,7 +560,8 @@ test_boxed_markup (void)
|
||||
g_value_init (&value, G_TYPE_MARKUP_PARSE_CONTEXT);
|
||||
g_assert (G_VALUE_HOLDS_BOXED (&value));
|
||||
|
||||
c = g_markup_parse_context_new (&parser, 0, NULL, NULL);
|
||||
c = g_markup_parse_context_new (&parser, G_MARKUP_PARSE_FLAGS_NONE,
|
||||
NULL, NULL);
|
||||
g_value_take_boxed (&value, c);
|
||||
|
||||
c2 = g_value_get_boxed (&value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user