1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
|
diff -r -C2 domc-0.7.0/Makefile domc/Makefile
*** domc-0.7.0/Makefile 2003-03-22 17:08:50.000000000 -0700
--- domc/Makefile 2004-07-29 16:16:16.337211622 -0600
***************
*** 1,6 ****
! prefix = /usr/local
! includedir = $(prefix)/include
! libdir = $(prefix)/lib
! mandir = $(prefix)/man
CC = gcc
LIBNAME = domc
--- 1,7 ----
! _EXTRA = -I../libmba/src/ -L../libmba/
! prefix = ./
! includedir = $(prefix)
! libdir = $(prefix)
! mandir = $(prefix)
CC = gcc
LIBNAME = domc
***************
*** 12,16 ****
DISTRO = $(LIBNAME)-$(MINVERSION)
RPM_OPT_FLAGS = -O2
! CFLAGS = -Wall -W -DMSGNO $(RPM_OPT_FLAGS) -I$(includedir) -L$(libdir)
#CFLAGS = -Wall -W -DMSGNO -I$(includedir) -L$(libdir) $(RPM_OPT_FLAGS) -ansi -pedantic -Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -Wtraditional -Wconversion -Waggregate-return -Wno-parentheses
OBJS = src/expatls.o src/events.o src/node.o src/nodelist.o src/namednodemap.o src/dom.o src/timestamp.o src/wcwidth.o
--- 13,17 ----
DISTRO = $(LIBNAME)-$(MINVERSION)
RPM_OPT_FLAGS = -O2
! CFLAGS = -Wall -W -DMSGNO $(RPM_OPT_FLAGS) $(_EXTRA) -I$(includedir) -L$(libdir)
#CFLAGS = -Wall -W -DMSGNO -I$(includedir) -L$(libdir) $(RPM_OPT_FLAGS) -ansi -pedantic -Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -Wtraditional -Wconversion -Waggregate-return -Wno-parentheses
OBJS = src/expatls.o src/events.o src/node.o src/nodelist.o src/namednodemap.o src/dom.o src/timestamp.o src/wcwidth.o
***************
*** 20,24 ****
$(SONAME): $(OBJS)
! $(CC) -shared $(OBJS) -L$(libdir) -lmba -lexpat -Wl,-h,$(SOVERSION) -o $(SONAME)
.c.a:
--- 21,25 ----
$(SONAME): $(OBJS)
! $(CC) -shared $(OBJS) $(_EXTRA) -L$(libdir) -lmba -Wl,-h,$(SOVERSION) -o $(SONAME)
.c.a:
***************
*** 48,51 ****
clean:
rm -f $(OBJS) $(ARNAME) $(SONAME) $(includedir)/domc.h $(libdir)/$(ARNAME) $(libdir)/$(SONAME) $(libdir)/$(SOVERSION) $(libdir)/lib$(LIBNAME).so $(DISTRO).zip
! cd $(mandir)/man3 && rm -f $(MAN)
--- 49,52 ----
clean:
rm -f $(OBJS) $(ARNAME) $(SONAME) $(includedir)/domc.h $(libdir)/$(ARNAME) $(libdir)/$(SONAME) $(libdir)/$(SOVERSION) $(libdir)/lib$(LIBNAME).so $(DISTRO).zip
! # cd $(mandir)/man3 && rm -f $(MAN)
diff -r -C2 domc-0.7.0/src/defines.h domc/src/defines.h
*** domc-0.7.0/src/defines.h 2003-03-22 16:35:36.000000000 -0700
--- domc/src/defines.h 2004-07-29 16:16:16.338211509 -0600
***************
*** 22,26 ****
#define HAVE_STRDUP 1
#define HAVE_STRNLEN 0
! #define HAVE_EXPAT 195
#define HAVE_MBSTATE 0
#define HAVE_WCWIDTH 0
--- 22,26 ----
#define HAVE_STRDUP 1
#define HAVE_STRNLEN 0
! #define HAVE_EXPAT 0
#define HAVE_MBSTATE 0
#define HAVE_WCWIDTH 0
***************
*** 36,40 ****
#define HAVE_STRDUP 1
#define HAVE_STRNLEN 1
! #define HAVE_EXPAT 195
#define HAVE_MBSTATE 1
#define HAVE_WCWIDTH 1
--- 36,40 ----
#define HAVE_STRDUP 1
#define HAVE_STRNLEN 1
! #define HAVE_EXPAT 0
#define HAVE_MBSTATE 1
#define HAVE_WCWIDTH 1
diff -r -C2 domc-0.7.0/src/domc.h domc/src/domc.h
*** domc-0.7.0/src/domc.h 2003-03-22 16:46:46.000000000 -0700
--- domc/src/domc.h 2004-07-29 16:16:16.375207324 -0600
***************
*** 186,189 ****
--- 186,191 ----
} ProcessingInstruction;
} u;
+ unsigned int rtfxRefCount; /* Reference counting added for RTFX */
+ void* userData; /* User data added for RTFX */
};
***************
*** 213,216 ****
--- 215,220 ----
unsigned short filter;
struct DOM_NodeList *list; /* Used for entities and notations */
+ /* Reference counting added for RTFX */
+ unsigned int rtfxRefCount;
};
***************
*** 287,293 ****
*/
int DOM_DocumentLS_load(DOM_DocumentLS *this, const char *uri);
- int DOM_DocumentLS_save(DOM_DocumentLS *this, const char *uri, const DOM_Node *node);
int DOM_DocumentLS_fread(DOM_DocumentLS *this, FILE *stream);
int DOM_DocumentLS_fwrite(const DOM_DocumentLS *this, FILE *stream);
--- 291,299 ----
*/
+ #if HAVE_EXPAT > 0
int DOM_DocumentLS_load(DOM_DocumentLS *this, const char *uri);
int DOM_DocumentLS_fread(DOM_DocumentLS *this, FILE *stream);
+ #endif /* HAVE_EXPAT */
+ int DOM_DocumentLS_save(DOM_DocumentLS *this, const char *uri, const DOM_Node *node);
int DOM_DocumentLS_fwrite(const DOM_DocumentLS *this, FILE *stream);
Only in domc/src: dom.o
Only in domc/src: events.o
diff -r -C2 domc-0.7.0/src/expatls.c domc/src/expatls.c
*** domc-0.7.0/src/expatls.c 2003-03-21 02:20:24.000000000 -0700
--- domc/src/expatls.c 2004-07-29 16:53:54.199838102 -0600
***************
*** 64,67 ****
--- 64,68 ----
#endif
+
#if HAVE_EXPAT > 130
#include <expat.h>
***************
*** 128,131 ****
--- 129,134 ----
}
+ #if HAVE_EXPAT > 0
+
static void
xmldecl_fn(void *userData, const XML_Char *version, const XML_Char *encoding, int standalone)
***************
*** 708,711 ****
--- 711,754 ----
}
+ #endif /* HAVE_EXPAT */
+
+ static void
+ fputds_encoded(const DOM_String *s, FILE *stream)
+ {
+ size_t l;
+
+ while (*s) {
+ l = strcspn(s, "<>&\"'");
+ if (l > 0) {
+ fwrite((void*)s, 1, sizeof(DOM_String) * l, stream);
+ s += l;
+ }
+ switch (*s) {
+ case '\0':
+ break;
+ case '<':
+ fputs("<", stream);
+ break;
+ case '>':
+ fputs(">", stream);
+ break;
+ case '&':
+ fputs("'", stream);
+ break;
+ case '"':
+ fputs(""", stream);
+ break;
+ case '\'':
+ fputs("&squot;", stream);
+ break;
+ default:
+ AMSG("");
+ break;
+ };
+ if(*s)
+ ++s;
+ }
+ }
+
int
DOM_DocumentLS_fwrite(const DOM_DocumentLS *node, FILE *stream)
***************
*** 732,736 ****
fputds(e->node->nodeName, stream);
fputs("=\"", stream);
! fputds(e->node->nodeValue, stream);
fputc('"', stream);
}
--- 775,779 ----
fputds(e->node->nodeName, stream);
fputs("=\"", stream);
! fputds_encoded(e->node->nodeValue, stream);
fputc('"', stream);
}
***************
*** 753,757 ****
break;
case DOM_TEXT_NODE:
! fputds(node->nodeValue, stream);
break;
case DOM_CDATA_SECTION_NODE:
--- 796,800 ----
break;
case DOM_TEXT_NODE:
! fputds_encoded(node->nodeValue, stream);
break;
case DOM_CDATA_SECTION_NODE:
***************
*** 805,814 ****
fputds(node->u.ProcessingInstruction.target, stream);
fputc(' ', stream);
! fputds(node->u.ProcessingInstruction.data, stream);
fputs("?>", stream);
break;
case DOM_COMMENT_NODE:
fputs("<!--", stream);
! fputds(node->nodeValue, stream);
fputs("-->", stream);
break;
--- 848,857 ----
fputds(node->u.ProcessingInstruction.target, stream);
fputc(' ', stream);
! fputds_encoded(node->u.ProcessingInstruction.data, stream);
fputs("?>", stream);
break;
case DOM_COMMENT_NODE:
fputs("<!--", stream);
! fputds_encoded(node->nodeValue, stream);
fputs("-->", stream);
break;
|