MySQL 8.4.3
Source Code Documentation
my_xml.h
Go to the documentation of this file.
1/* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef _my_xml_h
25#define _my_xml_h
26
27/**
28 @file include/my_xml.h
29*/
30
31#include <stddef.h>
32#include <sys/types.h>
33
34#define MY_XML_OK 0
35#define MY_XML_ERROR 1
36
37/*
38 A flag whether to use absolute tag names in call-back functions,
39 like "a", "a.b" and "a.b.c" (used in character set file parser),
40 or relative names like "a", "b" and "c".
41*/
42#define MY_XML_FLAG_RELATIVE_NAMES 1
43
44/*
45 A flag whether to skip normilization of text values before calling
46 call-back functions: i.e. skip leading/trailing spaces,
47 \r, \n, \t characters.
48*/
49#define MY_XML_FLAG_SKIP_TEXT_NORMALIZATION 2
50
52 MY_XML_NODE_TAG, /* can have TAG, ATTR and TEXT children */
53 MY_XML_NODE_ATTR, /* can have TEXT children */
54 MY_XML_NODE_TEXT /* cannot have children */
55};
56
58 int flags;
60 char errstr[128];
61
62 struct {
63 char static_buffer[128];
64 char *buffer;
66 char *start;
67 char *end;
69
70 const char *beg;
71 const char *cur;
72 const char *end;
73 void *user_data;
74 int (*enter)(MY_XML_PARSER *st, const char *val, size_t len);
75 int (*value)(MY_XML_PARSER *st, const char *val, size_t len);
76 int (*leave_xml)(MY_XML_PARSER *st, const char *val, size_t len);
77};
78
81int my_xml_parse(MY_XML_PARSER *st, const char *str, size_t len);
82
84 int (*)(MY_XML_PARSER *, const char *,
85 size_t len));
87 int (*)(MY_XML_PARSER *, const char *,
88 size_t len));
90 int (*)(MY_XML_PARSER *, const char *,
91 size_t len));
92void my_xml_set_user_data(MY_XML_PARSER *st, void *);
93
96
97const char *my_xml_error_string(MY_XML_PARSER *st);
98
99#endif /* _my_xml_h */
void my_xml_parser_create(MY_XML_PARSER *st)
Definition: xml.cc:461
const char * my_xml_error_string(MY_XML_PARSER *st)
Definition: xml.cc:499
int my_xml_parse(MY_XML_PARSER *st, const char *str, size_t len)
Definition: xml.cc:328
void my_xml_set_leave_handler(MY_XML_PARSER *st, int(*)(MY_XML_PARSER *, const char *, size_t len))
void my_xml_set_value_handler(MY_XML_PARSER *st, int(*)(MY_XML_PARSER *, const char *, size_t len))
unsigned my_xml_error_lineno(MY_XML_PARSER *st)
Definition: xml.cc:513
void my_xml_set_user_data(MY_XML_PARSER *st, void *)
Definition: xml.cc:495
void my_xml_set_enter_handler(MY_XML_PARSER *st, int(*)(MY_XML_PARSER *, const char *, size_t len))
void my_xml_parser_free(MY_XML_PARSER *st)
Definition: xml.cc:470
my_xml_node_type
Definition: my_xml.h:51
@ MY_XML_NODE_TEXT
Definition: my_xml.h:54
@ MY_XML_NODE_ATTR
Definition: my_xml.h:53
@ MY_XML_NODE_TAG
Definition: my_xml.h:52
size_t my_xml_error_pos(MY_XML_PARSER *st)
Definition: xml.cc:501
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1081
Definition: my_xml.h:57
char * end
Definition: my_xml.h:67
char errstr[128]
Definition: my_xml.h:60
int(* enter)(MY_XML_PARSER *st, const char *val, size_t len)
Definition: my_xml.h:74
const char * cur
Definition: my_xml.h:71
enum my_xml_node_type current_node_type
Definition: my_xml.h:59
int flags
Definition: my_xml.h:58
const char * beg
Definition: my_xml.h:70
size_t buffer_size
Definition: my_xml.h:65
const char * end
Definition: my_xml.h:72
char * buffer
Definition: my_xml.h:64
char * start
Definition: my_xml.h:66
char static_buffer[128]
Definition: my_xml.h:63
int(* value)(MY_XML_PARSER *st, const char *val, size_t len)
Definition: my_xml.h:75
struct MY_XML_PARSER::@3 attr
int(* leave_xml)(MY_XML_PARSER *st, const char *val, size_t len)
Definition: my_xml.h:76
void * user_data
Definition: my_xml.h:73