Function

Pangoparse_markup

Declaration [src]

gboolean
pango_parse_markup (
  const char* markup_text,
  int length,
  gunichar accel_marker,
  PangoAttrList** attr_list,
  char** text,
  gunichar* accel_char,
  GError** error
)

Description [src]

Parses marked-up text to create a plain-text string and an attribute list.

See the Pango Markup docs for details about the supported markup.

If accel_marker is nonzero, the given character will mark the character following it as an accelerator. For example, accel_marker might be an ampersand or underscore. All characters marked as an accelerator will receive a PANGO_UNDERLINE_LOW attribute, and the first character so marked will be returned in accel_char. Two accel_marker characters following each other produce a single literal accel_marker character.

To parse a stream of pango markup incrementally, use pango_markup_parser_new().

If any error happens, none of the output arguments are touched except for error.

Parameters

markup_text

Type: const char*

Markup to parse (see the Pango Markup docs).

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
length

Type: int

Length of markup_text, or -1 if nul-terminated.

accel_marker

Type: gunichar

Character that precedes an accelerator, or 0 for none.

attr_list

Type: PangoAttrList

Address of return location for a PangoAttrList.

The argument will be set by the function.
The argument can be NULL.
The caller of the function takes ownership of the returned data, and is responsible for freeing it.
text

Type: char**

Address of return location for text with tags stripped.

The argument will be set by the function.
The argument can be NULL.
The caller of the function takes ownership of the returned data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.
accel_char

Type: gunichar*

Address of return location for accelerator char.

The argument will be set by the function.
The argument can be NULL.
error

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will be left initialized to NULL by the function if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: gboolean

FALSE if error is set, otherwise TRUE.