1/* minimal xml parser
2 *
3 * Project : miniupnp
4 * Website : http://miniupnp.free.fr/
5 * Author : Thomas Bernard
6 * Copyright (c) 2005 Thomas Bernard
7 * This software is subject to the conditions detailed in the
8 * LICENCE file provided in this distribution.
9 * */
10#ifndef __MINIXML_H__
11#define __MINIXML_H__
12#define IS_WHITE_SPACE(c) ((c==' ') || (c=='\t') || (c=='\r') || (c=='\n'))
13
14/* if a callback function pointer is set to NULL,
15 * the function is not called */
16struct xmlparser {
17	const char *xmlstart;
18	const char *xmlend;
19	const char *xml;	/* pointer to current character */
20	int xmlsize;
21	void * data;
22	void (*starteltfunc) (void *, const char *, int);
23	void (*endeltfunc) (void *, const char *, int);
24	void (*datafunc) (void *, const char *, int);
25	void (*attfunc) (void *, const char *, int, const char *, int);
26};
27
28/* parsexml()
29 * the xmlparser structure must be initialized before the call
30 * the following structure members have to be initialized :
31 * xmlstart, xmlsize, data, *func
32 * xml is for internal usage, xmlend is computed automatically */
33void parsexml(struct xmlparser *);
34
35#endif
36
37