Function

Rotulusmirc_parse

Declaration [src]

RotulusRun*
rotulus_mirc_parse (
  const char* text,
  int len,
  int* n_runs
)

Description [src]

Splits text carrying mIRC formatting codes (bold, italic, underline, strikethrough, monospace, reverse, reset, and colors by number or hex) into runs, with the codes removed. The runs point into text, which must outlive them. Colors 0..15 address the palette’s mIRC slots; the extended colors and hex colors are RGB.

This function is not directly available to language bindings.

Parameters

text

Type: const char*

Text carrying IRC formatting codes.

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

Type: int

Its length in bytes, or -1 when it is NUL-terminated.

n_runs

Type: int*

How many runs there are.

The argument will be set by the function.

Return value

Type: RotulusRun

The runs; free the array with g_free().

The caller of the function takes ownership of the data, and is responsible for freeing it.