Routino SVN Repository Browser

Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino

ViewVC logotype

Contents of /trunk/src/xmlparse.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 344 - (show annotations) (download) (as text)
Wed Mar 31 17:19:22 2010 UTC (15 years ago) by amb
File MIME type: text/x-chdr
File size: 2000 byte(s)
Call the XML tag functions for the end tags as well as the start tags.

1 /***************************************
2 $Header: /home/amb/CVS/routino/src/xmlparse.h,v 1.3 2010-03-31 17:18:27 amb Exp $
3
4 A simple XML parser
5
6 Part of the Routino routing software.
7 ******************/ /******************
8 This file Copyright 2010 Andrew M. Bishop
9
10 This program is free software: you can redistribute it and/or modify
11 it under the terms of the GNU Affero General Public License as published by
12 the Free Software Foundation, either version 3 of the License, or
13 (at your option) any later version.
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 Affero General Public License for more details.
19
20 You should have received a copy of the GNU Affero General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 ***************************************/
23
24
25 #ifndef XMLPARSE_H
26 #define XMLPARSE_H /*+ To stop multiple inclusions. +*/
27
28 #include <stdio.h>
29
30
31 /*+ The maximum number of attributes per tag. +*/
32 #define XMLPARSE_MAX_ATTRS 16
33
34 /*+ The maximum number of subtags per tag. +*/
35 #define XMLPARSE_MAX_SUBTAGS 16
36
37 /*+ A flag to indicate the start and/or end of a tag. +*/
38 #define XMLPARSE_TAG_START 1
39 #define XMLPARSE_TAG_END 2
40
41
42 /*+ A forward definition of the xmltag +*/
43 typedef struct _xmltag xmltag;
44
45
46 /*+ A structure to hold the definition of a tag. +*/
47 struct _xmltag
48 {
49 char *name; /*+ The name of the tag. +*/
50
51 char *attributes[XMLPARSE_MAX_ATTRS]; /*+ The valid attributes for the tag (null terminated). +*/
52
53 void (*callback)(); /*+ The callback function when the tag is seen. +*/
54
55 xmltag *subtags[XMLPARSE_MAX_SUBTAGS]; /*+ The list of valid tags contained within this one (null terminated). +*/
56 };
57
58
59 /* XML parser function */
60
61 void ParseXML(FILE *file,xmltag **tags,int ignore_unknown_attributes);
62
63
64 #endif /* XMLPARSE_H */

Properties

Name Value
cvs:description A simple generic XML parser (header file).