Introduction
Introduction Statistics Contact Development Disclaimer Help
skeleton.c - xmlparser - XML parser
git clone git://git.codemadness.org/xmlparser
Log
Files
Refs
README
LICENSE
---
skeleton.c (2248B)
---
1 #include <stdio.h>
2
3 #include "xml.h"
4
5 void
6 xmlattr(XMLParser *x, const char *t, size_t tl, const char *a, size_t al,
7 const char *v, size_t vl)
8 {
9 }
10
11 void
12 xmlattrentity(XMLParser *x, const char *t, size_t tl, const char *a, siz…
13 const char *v, size_t vl)
14 {
15 #if 0
16 char buf[16];
17 int len;
18
19 /* try to translate entity, else just pass as data to
20 * xmlattr handler. */
21 if ((len = xml_entitytostr(v, buf, sizeof(buf))) > 0)
22 xmlattr(x, t, tl, a, al, buf, (size_t)len);
23 else
24 xmlattr(x, t, tl, a, al, v, vl);
25 #endif
26 }
27
28 void
29 xmlattrend(XMLParser *x, const char *t, size_t tl, const char *a, size_t…
30 {
31 }
32
33 void
34 xmlattrstart(XMLParser *x, const char *t, size_t tl, const char *a, size…
35 {
36 }
37
38 void
39 xmlcdatastart(XMLParser *x)
40 {
41 }
42
43 void
44 xmlcdata(XMLParser *x, const char *d, size_t dl)
45 {
46 }
47
48 void
49 xmlcdataend(XMLParser *x)
50 {
51 }
52
53 void
54 xmlcommentstart(XMLParser *x)
55 {
56 }
57
58 void
59 xmlcomment(XMLParser *x, const char *c, size_t cl)
60 {
61 }
62
63 void
64 xmlcommentend(XMLParser *x)
65 {
66 }
67
68 void
69 xmldata(XMLParser *x, const char *d, size_t dl)
70 {
71 }
72
73 void
74 xmldataend(XMLParser *x)
75 {
76 }
77
78 void
79 xmldataentity(XMLParser *x, const char *d, size_t dl)
80 {
81 #if 0
82 char buf[16];
83 int len;
84
85 /* try to translate entity, else just pass as data to
86 * xmldata handler. */
87 if ((len = xml_entitytostr(d, buf, sizeof(buf))) > 0)
88 xmldata(x, buf, (size_t)len);
89 else
90 xmldata(x, d, dl);
91 #endif
92 }
93
94 void
95 xmldatastart(XMLParser *x)
96 {
97 }
98
99 void
100 xmltagend(XMLParser *x, const char *t, size_t tl, int isshort)
101 {
102 }
103
104 void
105 xmltagstart(XMLParser *x, const char *t, size_t tl)
106 {
107 }
108
109 void
110 xmltagstartparsed(XMLParser *x, const char *t, size_t tl, int isshort)
111 {
112 }
113
114 int
115 main(void)
116 {
117 XMLParser x = { 0 };
118
119 x.xmlattr = xmlattr;
120 x.xmlattrend = xmlattrend;
121 x.xmlattrstart = xmlattrstart;
122 x.xmlattrentity = xmlattrentity;
123 x.xmlcdatastart = xmlcdatastart;
124 x.xmlcdata = xmlcdata;
125 x.xmlcdataend = xmlcdataend;
126 x.xmlcommentstart = xmlcommentstart;
127 x.xmlcomment = xmlcomment;
128 x.xmlcommentend = xmlcommentend;
129 x.xmldata = xmldata;
130 x.xmldataend = xmldataend;
131 x.xmldataentity = xmldataentity;
132 x.xmldatastart = xmldatastart;
133 x.xmltagend = xmltagend;
134 x.xmltagstart = xmltagstart;
135 x.xmltagstartparsed = xmltagstartparsed;
136
137 x.getnext = getchar;
138
139 xml_parse(&x);
140
141 return 0;
142 }
You are viewing proxied material from codemadness.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.