Graphviz 13.0.0~dev.20241220.2304
|
#include <common/types.h>
#include <common/utils.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <util/exit.h>
#include <util/gv_ctype.h>
#include <util/unreachable.h>
Go to the source code of this file.
Functions | |
static bool | xml_isentity (const char *s) |
static int | xml_core (char previous, const char **current, xml_flags_t flags, int(*cb)(void *state, const char *s), void *state) |
int | xml_escape (const char *s, xml_flags_t flags, int(*cb)(void *state, const char *s), void *state) |
|
static |
XML-escape a character
previous | The source character preceding the current one or '\0' if there was no prior character. | |
[in,out] | current | Pointer to the current position in a source string being escaped. The pointer is updated based on how many characters are consumed. |
flags | Options for configuring behavior. | |
cb | User function for emitting escaped data. This is expected to take a caller-defined state type as the first parameter and the string to emit as the second, and then return an opaque value that is passed back to the caller. | |
state | Data to pass as the first parameter when calling cb . |
cb
. Definition at line 61 of file xml.c.
References flags, graphviz_exit(), UNREACHABLE, and xml_isentity().
Referenced by xml_escape().
int xml_escape | ( | const char * | s, |
xml_flags_t | flags, | ||
int(*)(void *state, const char *s) | cb, | ||
void * | state | ||
) |
XML-escape a string
s | Source string to process. |
flags | Options of how to configure escaping. |
cb | An fputs analogue for emitting escaped output. |
state | Caller-defined data to pass to cb . |
cb
returns or the last return value of cb
. Definition at line 179 of file xml.c.
References flags, and xml_core().
Referenced by EmbedText(), gvputs_xml(), pango_textlayout(), svg_begin_anchor(), svg_textspan(), xml_puts(), xml_puts(), xml_url_puts(), and xml_url_puts().
|
static |
Definition at line 22 of file xml.c.
References gv_isalpha(), gv_isdigit(), and gv_isxdigit().
Referenced by xml_core().