Apache HTTPD
dummy.c
Go to the documentation of this file.
1/* Dummy handler functions for the Expat test suite
2 __ __ _
3 ___\ \/ /_ __ __ _| |_
4 / _ \\ /| '_ \ / _` | __|
5 | __// \| |_) | (_| | |_
6 \___/_/\_\ .__/ \__,_|\__|
7 |_| XML parser
8
9 Copyright (c) 2001-2006 Fred L. Drake, Jr. <[email protected]>
10 Copyright (c) 2003 Greg Stein <[email protected]>
11 Copyright (c) 2005-2007 Steven Solie <[email protected]>
12 Copyright (c) 2005-2012 Karl Waclawek <[email protected]>
13 Copyright (c) 2016-2022 Sebastian Pipping <[email protected]>
14 Copyright (c) 2017-2022 Rhodri James <[email protected]>
15 Copyright (c) 2017 Joe Orton <[email protected]>
16 Copyright (c) 2017 José Gutiérrez de la Concha <[email protected]>
17 Copyright (c) 2018 Marco Maggi <[email protected]>
18 Copyright (c) 2019 David Loffredo <[email protected]>
19 Copyright (c) 2020 Tim Gates <[email protected]>
20 Copyright (c) 2021 Donghee Na <[email protected]>
21 Licensed under the MIT license:
22
23 Permission is hereby granted, free of charge, to any person obtaining
24 a copy of this software and associated documentation files (the
25 "Software"), to deal in the Software without restriction, including
26 without limitation the rights to use, copy, modify, merge, publish,
27 distribute, sublicense, and/or sell copies of the Software, and to permit
28 persons to whom the Software is furnished to do so, subject to the
29 following conditions:
30
31 The above copyright notice and this permission notice shall be included
32 in all copies or substantial portions of the Software.
33
34 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
36 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
37 NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
38 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
39 OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
40 USE OR OTHER DEALINGS IN THE SOFTWARE.
41*/
42
43#include "expat.h"
44#include "internal.h"
45#include "common.h"
46#include "dummy.h"
47
48/* Dummy handlers for when we need to set a handler to tickle a bug,
49 but it doesn't need to do anything.
50*/
51static unsigned long dummy_handler_flags = 0;
52
53void
57
58unsigned long
62
63void XMLCALL
64dummy_xdecl_handler(void *userData, const XML_Char *version,
65 const XML_Char *encoding, int standalone) {
66 UNUSED_P(userData);
67 UNUSED_P(version);
69 UNUSED_P(standalone);
70}
71
72void XMLCALL
83
84void XMLCALL
89
90void XMLCALL
93 int value_length, const XML_Char *base,
94 const XML_Char *systemId, const XML_Char *publicId,
95 const XML_Char *notationName) {
96 UNUSED_P(userData);
101 UNUSED_P(base);
102 UNUSED_P(systemId);
103 UNUSED_P(publicId);
104 UNUSED_P(notationName);
106}
107
108void XMLCALL
109dummy_notation_decl_handler(void *userData, const XML_Char *notationName,
110 const XML_Char *base, const XML_Char *systemId,
111 const XML_Char *publicId) {
112 UNUSED_P(userData);
113 UNUSED_P(notationName);
114 UNUSED_P(base);
115 UNUSED_P(systemId);
116 UNUSED_P(publicId);
118}
119
120void XMLCALL
122 XML_Content *model) {
123 UNUSED_P(userData);
124 UNUSED_P(name);
125 /* The content model must be freed by the handler. Unfortunately
126 * we cannot pass the parser as the userData because this is used
127 * with other handlers that require other userData.
128 */
131}
132
133void XMLCALL
135 const XML_Char *attname, const XML_Char *att_type,
136 const XML_Char *dflt, int isrequired) {
137 UNUSED_P(userData);
141 UNUSED_P(dflt);
144}
145
146void XMLCALL
147dummy_comment_handler(void *userData, const XML_Char *data) {
148 UNUSED_P(userData);
149 UNUSED_P(data);
151}
152
153void XMLCALL
154dummy_pi_handler(void *userData, const XML_Char *target, const XML_Char *data) {
155 UNUSED_P(userData);
156 UNUSED_P(target);
157 UNUSED_P(data);
159}
160
161void XMLCALL
162dummy_start_element(void *userData, const XML_Char *name,
163 const XML_Char **atts) {
164 UNUSED_P(userData);
165 UNUSED_P(name);
166 UNUSED_P(atts);
168}
169
170void XMLCALL
171dummy_end_element(void *userData, const XML_Char *name) {
172 UNUSED_P(userData);
173 UNUSED_P(name);
174}
175
176void XMLCALL
181
182void XMLCALL
187
188void XMLCALL
189dummy_cdata_handler(void *userData, const XML_Char *s, int len) {
190 UNUSED_P(userData);
191 UNUSED_P(s);
192 UNUSED_P(len);
193}
194
195void XMLCALL
203
204void XMLCALL
210
211/* This handler is obsolete, but while the code exists we should
212 * ensure that dealing with the handler is covered by tests.
213 */
214void XMLCALL
216 const XML_Char *base,
217 const XML_Char *systemId,
218 const XML_Char *publicId,
219 const XML_Char *notationName) {
220 UNUSED_P(userData);
222 UNUSED_P(base);
223 UNUSED_P(systemId);
224 UNUSED_P(publicId);
225 UNUSED_P(notationName);
227}
228
229void XMLCALL
230dummy_default_handler(void *userData, const XML_Char *s, int len) {
231 UNUSED_P(userData);
232 UNUSED_P(s);
233 UNUSED_P(len);
234}
235
236void XMLCALL
247
248void XMLCALL
253
254void XMLCALL
const char apr_size_t len
Definition ap_regex.h:187
XML_Parser g_parser
Definition runtests.c:62
void XMLCALL dummy_unparsed_entity_decl_handler(void *userData, const XML_Char *entityName, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName)
Definition dummy.c:215
void XMLCALL dummy_element_decl_handler(void *userData, const XML_Char *name, XML_Content *model)
Definition dummy.c:121
void XMLCALL dummy_start_element(void *userData, const XML_Char *name, const XML_Char **atts)
Definition dummy.c:162
void XMLCALL dummy_end_element(void *userData, const XML_Char *name)
Definition dummy.c:171
void XMLCALL dummy_comment_handler(void *userData, const XML_Char *data)
Definition dummy.c:147
static unsigned long dummy_handler_flags
Definition dummy.c:51
void XMLCALL dummy_end_doctype_handler(void *userData)
Definition dummy.c:85
void XMLCALL dummy_start_cdata_handler(void *userData)
Definition dummy.c:177
void XMLCALL dummy_start_doctype_decl_handler(void *userData, const XML_Char *doctypeName, const XML_Char *sysid, const XML_Char *pubid, int has_internal_subset)
Definition dummy.c:237
void XMLCALL dummy_end_namespace_decl_handler(void *userData, const XML_Char *prefix)
Definition dummy.c:205
void XMLCALL dummy_attlist_decl_handler(void *userData, const XML_Char *elname, const XML_Char *attname, const XML_Char *att_type, const XML_Char *dflt, int isrequired)
Definition dummy.c:134
void XMLCALL dummy_end_doctype_decl_handler(void *userData)
Definition dummy.c:249
void XMLCALL dummy_start_doctype_handler(void *userData, const XML_Char *doctypeName, const XML_Char *sysid, const XML_Char *pubid, int has_internal_subset)
Definition dummy.c:73
void XMLCALL dummy_end_cdata_handler(void *userData)
Definition dummy.c:183
void XMLCALL dummy_start_namespace_decl_handler(void *userData, const XML_Char *prefix, const XML_Char *uri)
Definition dummy.c:196
void XMLCALL dummy_cdata_handler(void *userData, const XML_Char *s, int len)
Definition dummy.c:189
void XMLCALL dummy_pi_handler(void *userData, const XML_Char *target, const XML_Char *data)
Definition dummy.c:154
void XMLCALL dummy_entity_decl_handler(void *userData, const XML_Char *entityName, int is_parameter_entity, const XML_Char *value, int value_length, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName)
Definition dummy.c:91
void XMLCALL dummy_skip_handler(void *userData, const XML_Char *entityName, int is_parameter_entity)
Definition dummy.c:255
void XMLCALL dummy_xdecl_handler(void *userData, const XML_Char *version, const XML_Char *encoding, int standalone)
Definition dummy.c:64
void XMLCALL dummy_default_handler(void *userData, const XML_Char *s, int len)
Definition dummy.c:230
void XMLCALL dummy_notation_decl_handler(void *userData, const XML_Char *notationName, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId)
Definition dummy.c:109
void init_dummy_handlers(void)
Definition dummy.c:54
unsigned long get_dummy_handler_flags(void)
Definition dummy.c:59
#define DUMMY_ELEMENT_DECL_HANDLER_FLAG
Definition dummy.h:54
#define DUMMY_START_ELEMENT_HANDLER_FLAG
Definition dummy.h:58
#define DUMMY_START_DOCTYPE_DECL_HANDLER_FLAG
Definition dummy.h:64
#define DUMMY_ENTITY_DECL_HANDLER_FLAG
Definition dummy.h:52
#define DUMMY_UNPARSED_ENTITY_DECL_HANDLER_FLAG
Definition dummy.h:61
#define DUMMY_START_DOCTYPE_HANDLER_FLAG
Definition dummy.h:50
#define DUMMY_END_DOCTYPE_DECL_HANDLER_FLAG
Definition dummy.h:65
#define DUMMY_END_NS_DECL_HANDLER_FLAG
Definition dummy.h:63
#define DUMMY_COMMENT_HANDLER_FLAG
Definition dummy.h:56
#define DUMMY_SKIP_HANDLER_FLAG
Definition dummy.h:66
#define DUMMY_START_NS_DECL_HANDLER_FLAG
Definition dummy.h:62
#define DUMMY_START_CDATA_HANDLER_FLAG
Definition dummy.h:59
#define DUMMY_NOTATION_DECL_HANDLER_FLAG
Definition dummy.h:53
#define DUMMY_END_DOCTYPE_HANDLER_FLAG
Definition dummy.h:51
#define DUMMY_PI_HANDLER_FLAG
Definition dummy.h:57
#define DUMMY_END_CDATA_HANDLER_FLAG
Definition dummy.h:60
#define DUMMY_ATTLIST_DECL_HANDLER_FLAG
Definition dummy.h:55
void XML_FreeContentModel(XML_Parser parser, XML_Content *model)
Definition xmlparse.c:2388
char XML_Char
#define XMLCALL
ap_conf_vector_t * base
const char * uri
Definition apr_uri.h:159
apr_size_t size
const char * value
Definition apr_env.h:51
void * data
const char * s
Definition apr_strings.h:95
#define UNUSED_P(p)
Definition internal.h:137
char * name