Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
gmarkup.h File Reference
#include <stdarg.h>
#include <glib/gerror.h>
#include <glib/gslist.h>

Go to the source code of this file.

Data Structures

struct  _GMarkupParser
 

Macros

#define G_MARKUP_ERROR   g_markup_error_quark ()
 

Typedefs

typedef struct _GMarkupParseContext GMarkupParseContext
 
typedef struct _GMarkupParser GMarkupParser
 

Enumerations

enum  GMarkupError {
  G_MARKUP_ERROR_BAD_UTF8 , G_MARKUP_ERROR_EMPTY , G_MARKUP_ERROR_PARSE , G_MARKUP_ERROR_UNKNOWN_ELEMENT ,
  G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE , G_MARKUP_ERROR_INVALID_CONTENT , G_MARKUP_ERROR_MISSING_ATTRIBUTE
}
 
enum  GMarkupParseFlags {
  GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 0 , 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 ,
  G_MARKUP_IGNORE_QUALIFIED = 1 << 3
}
 
enum  GMarkupCollectType {
  G_MARKUP_COLLECT_INVALID , G_MARKUP_COLLECT_STRING , G_MARKUP_COLLECT_STRDUP , G_MARKUP_COLLECT_BOOLEAN ,
  G_MARKUP_COLLECT_TRISTATE , G_MARKUP_COLLECT_OPTIONAL = (1 << 16)
}
 

Functions

GLIB_AVAILABLE_IN_ALL GQuark g_markup_error_quark (void)
 
GLIB_AVAILABLE_IN_ALL GMarkupParseContextg_markup_parse_context_new (const GMarkupParser *parser, GMarkupParseFlags flags, gpointer user_data, GDestroyNotify user_data_dnotify)
 
GLIB_AVAILABLE_IN_2_36 GMarkupParseContextg_markup_parse_context_ref (GMarkupParseContext *context)
 
GLIB_AVAILABLE_IN_2_36 void g_markup_parse_context_unref (GMarkupParseContext *context)
 
GLIB_AVAILABLE_IN_ALL void g_markup_parse_context_free (GMarkupParseContext *context)
 
GLIB_AVAILABLE_IN_ALL gboolean g_markup_parse_context_parse (GMarkupParseContext *context, const gchar *text, gssize text_len, GError **error)
 
GLIB_AVAILABLE_IN_ALL void g_markup_parse_context_push (GMarkupParseContext *context, const GMarkupParser *parser, gpointer user_data)
 
GLIB_AVAILABLE_IN_ALL gpointer g_markup_parse_context_pop (GMarkupParseContext *context)
 
GLIB_AVAILABLE_IN_ALL gboolean g_markup_parse_context_end_parse (GMarkupParseContext *context, GError **error)
 
GLIB_AVAILABLE_IN_ALL const gcharg_markup_parse_context_get_element (GMarkupParseContext *context)
 
GLIB_AVAILABLE_IN_ALL const GSListg_markup_parse_context_get_element_stack (GMarkupParseContext *context)
 
GLIB_AVAILABLE_IN_ALL void g_markup_parse_context_get_position (GMarkupParseContext *context, gint *line_number, gint *char_number)
 
GLIB_AVAILABLE_IN_ALL gpointer g_markup_parse_context_get_user_data (GMarkupParseContext *context)
 
GLIB_AVAILABLE_IN_ALL gcharg_markup_escape_text (const gchar *text, gssize length)
 
GLIB_AVAILABLE_IN_ALL gcharg_markup_printf_escaped (const char *format,...) G_GNUC_PRINTF(1
 
GLIB_AVAILABLE_IN_ALL gchar GLIB_AVAILABLE_IN_ALL gcharg_markup_vprintf_escaped (const char *format, va_list args) G_GNUC_PRINTF(1
 
GLIB_AVAILABLE_IN_ALL gboolean g_markup_collect_attributes (const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, GError **error, GMarkupCollectType first_type, const gchar *first_attr,...)
 

Macro Definition Documentation

◆ G_MARKUP_ERROR

#define G_MARKUP_ERROR   g_markup_error_quark ()

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.

Definition at line 72 of file gmarkup.h.

Typedef Documentation

◆ GMarkupParseContext

typedef struct _GMarkupParseContext GMarkupParseContext

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.

Definition at line 116 of file gmarkup.h.

◆ GMarkupParser

typedef struct _GMarkupParser GMarkupParser

Definition at line 117 of file gmarkup.h.

Enumeration Type Documentation

◆ GMarkupCollectType

Enumerator
G_MARKUP_COLLECT_INVALID 
G_MARKUP_COLLECT_STRING 
G_MARKUP_COLLECT_STRDUP 
G_MARKUP_COLLECT_BOOLEAN 
G_MARKUP_COLLECT_TRISTATE 
G_MARKUP_COLLECT_OPTIONAL 

Definition at line 241 of file gmarkup.h.

242{
248
249 G_MARKUP_COLLECT_OPTIONAL = (1 << 16)
GMarkupCollectType
Definition gmarkup.h:242
@ G_MARKUP_COLLECT_OPTIONAL
Definition gmarkup.h:249
@ G_MARKUP_COLLECT_INVALID
Definition gmarkup.h:243
@ G_MARKUP_COLLECT_BOOLEAN
Definition gmarkup.h:246
@ G_MARKUP_COLLECT_STRDUP
Definition gmarkup.h:245
@ G_MARKUP_COLLECT_TRISTATE
Definition gmarkup.h:247
@ G_MARKUP_COLLECT_STRING
Definition gmarkup.h:244

◆ GMarkupError

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.

Enumerator
G_MARKUP_ERROR_BAD_UTF8 
G_MARKUP_ERROR_EMPTY 
G_MARKUP_ERROR_PARSE 
G_MARKUP_ERROR_UNKNOWN_ELEMENT 
G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE 
G_MARKUP_ERROR_INVALID_CONTENT 
G_MARKUP_ERROR_MISSING_ATTRIBUTE 

Definition at line 51 of file gmarkup.h.

52{
56 /* The following are primarily intended for specific GMarkupParser
57 * implementations to set.
58 */
GMarkupError
Definition gmarkup.h:52
@ G_MARKUP_ERROR_BAD_UTF8
Definition gmarkup.h:53
@ G_MARKUP_ERROR_EMPTY
Definition gmarkup.h:54
@ G_MARKUP_ERROR_INVALID_CONTENT
Definition gmarkup.h:61
@ G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE
Definition gmarkup.h:60
@ G_MARKUP_ERROR_MISSING_ATTRIBUTE
Definition gmarkup.h:62
@ G_MARKUP_ERROR_UNKNOWN_ELEMENT
Definition gmarkup.h:59
@ G_MARKUP_ERROR_PARSE
Definition gmarkup.h:55

◆ GMarkupParseFlags

GMarkupParseFlags: @G_MARKUP_DEFAULT_FLAGS: 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 the parser. Instead, the content of the section (without the <![CDATA[ and ]]>) 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 @G_MARKUP_IGNORE_QUALIFIED: Ignore (don't report) qualified attributes and tags, along with their contents. A qualified attribute or tag is one that contains ':' in its name (ie: is in another namespace). Since: 2.40.

Flags that affect the behaviour of the parser.

Enumerator
GLIB_AVAILABLE_ENUMERATOR_IN_2_74 
G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG 
G_MARKUP_TREAT_CDATA_AS_TEXT 
G_MARKUP_PREFIX_ERROR_POSITION 
G_MARKUP_IGNORE_QUALIFIED 

Definition at line 98 of file gmarkup.h.

99{
100 G_MARKUP_DEFAULT_FLAGS GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 0,
GMarkupParseFlags
Definition gmarkup.h:99
@ G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG
Definition gmarkup.h:101
@ GLIB_AVAILABLE_ENUMERATOR_IN_2_74
Definition gmarkup.h:100
@ G_MARKUP_PREFIX_ERROR_POSITION
Definition gmarkup.h:103
@ G_MARKUP_TREAT_CDATA_AS_TEXT
Definition gmarkup.h:102
@ G_MARKUP_IGNORE_QUALIFIED
Definition gmarkup.h:104

Function Documentation

◆ g_markup_collect_attributes()

GLIB_AVAILABLE_IN_ALL gboolean g_markup_collect_attributes ( const gchar * element_name,
const gchar ** attribute_names,
const gchar ** attribute_values,
GError ** error,
GMarkupCollectType first_type,
const gchar * first_attr,
... )

◆ g_markup_error_quark()

GLIB_AVAILABLE_IN_ALL GQuark g_markup_error_quark ( void )

◆ g_markup_escape_text()

GLIB_AVAILABLE_IN_ALL gchar * g_markup_escape_text ( const gchar * text,
gssize length )

◆ g_markup_parse_context_end_parse()

GLIB_AVAILABLE_IN_ALL gboolean g_markup_parse_context_end_parse ( GMarkupParseContext * context,
GError ** error )

◆ g_markup_parse_context_free()

GLIB_AVAILABLE_IN_ALL void g_markup_parse_context_free ( GMarkupParseContext * context)

◆ g_markup_parse_context_get_element()

GLIB_AVAILABLE_IN_ALL const gchar * g_markup_parse_context_get_element ( GMarkupParseContext * context)

◆ g_markup_parse_context_get_element_stack()

GLIB_AVAILABLE_IN_ALL const GSList * g_markup_parse_context_get_element_stack ( GMarkupParseContext * context)

◆ g_markup_parse_context_get_position()

GLIB_AVAILABLE_IN_ALL void g_markup_parse_context_get_position ( GMarkupParseContext * context,
gint * line_number,
gint * char_number )

◆ g_markup_parse_context_get_user_data()

GLIB_AVAILABLE_IN_ALL gpointer g_markup_parse_context_get_user_data ( GMarkupParseContext * context)

◆ g_markup_parse_context_new()

GLIB_AVAILABLE_IN_ALL GMarkupParseContext * g_markup_parse_context_new ( const GMarkupParser * parser,
GMarkupParseFlags flags,
gpointer user_data,
GDestroyNotify user_data_dnotify )

◆ g_markup_parse_context_parse()

GLIB_AVAILABLE_IN_ALL gboolean g_markup_parse_context_parse ( GMarkupParseContext * context,
const gchar * text,
gssize text_len,
GError ** error )

◆ g_markup_parse_context_pop()

GLIB_AVAILABLE_IN_ALL gpointer g_markup_parse_context_pop ( GMarkupParseContext * context)

◆ g_markup_parse_context_push()

GLIB_AVAILABLE_IN_ALL void g_markup_parse_context_push ( GMarkupParseContext * context,
const GMarkupParser * parser,
gpointer user_data )

◆ g_markup_parse_context_ref()

GLIB_AVAILABLE_IN_2_36 GMarkupParseContext * g_markup_parse_context_ref ( GMarkupParseContext * context)

◆ g_markup_parse_context_unref()

GLIB_AVAILABLE_IN_2_36 void g_markup_parse_context_unref ( GMarkupParseContext * context)

◆ g_markup_printf_escaped()

GLIB_AVAILABLE_IN_ALL gchar * g_markup_printf_escaped ( const char * format,
... )

◆ g_markup_vprintf_escaped()

GLIB_AVAILABLE_IN_ALL gchar GLIB_AVAILABLE_IN_ALL gchar * g_markup_vprintf_escaped ( const char * format,
va_list args )