Skip to content

Commit 2efe8dd

Browse files
author
mike
committed
Rename mxmlFindValue to mxmlFindPath.
Rename mxmlGetPrevious to mxmlGetPrevSibling. Rename mxmlGetNext to mxmlGetNextSibling. Update documentation. git-svn-id: http://svn.msweet.org/mxml/trunk@427 52f9b3e4-c3ee-0310-a999-ee1bd40a8cf0
1 parent 9302e1c commit 2efe8dd

30 files changed

+811
-450
lines changed

CHANGES

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CHANGES - 2011-01-01
1+
CHANGES - 2011-01-02
22
--------------------
33

44
CHANGES IN Mini-XML 2.7
@@ -8,7 +8,7 @@ CHANGES IN Mini-XML 2.7
88
header to preserve source compatibility (STR #118)
99
- Updated the source headers to reference the Mini-XML license and its
1010
exceptions to the LGPL2 (STR #108)
11-
- Added a new mxmlFindValue() function to find the value node of a
11+
- Added a new mxmlFindPath() function to find the value node of a
1212
named element (STR #110)
1313
- Building a static version of the library did not work on Windows
1414
(STR #112)

COPYING

+15-15
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ The Mini-XML library and included programs are provided under the
66
terms of the GNU Library General Public License version 2 (LGPL2)
77
with the following exceptions:
88

9-
1. Static linking of applications to the Mini-XML library
10-
does not constitute a derivative work and does not require
11-
the author to provide source code for the application, use
12-
the shared Mini-XML libraries, or link their applications
13-
against a user-supplied version of Mini-XML.
14-
15-
If you link the application to a modified version of
16-
Mini-XML, then the changes to Mini-XML must be provided
17-
under the terms of the LGPL2 in sections 1, 2, and 4.
18-
19-
2. You do not have to provide a copy of the Mini-XML license
20-
with programs that are linked to the Mini-XML library, nor
21-
do you have to identify the Mini-XML license in your
22-
program or documentation as required by section 6 of the
23-
LGPL2.
9+
1. Static linking of applications to the Mini-XML library
10+
does not constitute a derivative work and does not require
11+
the author to provide source code for the application, use
12+
the shared Mini-XML libraries, or link their applications
13+
against a user-supplied version of Mini-XML.
14+
15+
If you link the application to a modified version of
16+
Mini-XML, then the changes to Mini-XML must be provided
17+
under the terms of the LGPL2 in sections 1, 2, and 4.
18+
19+
2. You do not have to provide a copy of the Mini-XML license
20+
with programs that are linked to the Mini-XML library, nor
21+
do you have to identify the Mini-XML license in your
22+
program or documentation as required by section 6 of the
23+
LGPL2.
2424

2525

2626
GNU LIBRARY GENERAL PUBLIC LICENSE

Makefile.in

+64-15
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Makefile for Mini-XML, a small XML-like file parsing library.
55
#
6-
# Copyright 2003-2010 by Michael R Sweet.
6+
# Copyright 2003-2011 by Michael R Sweet.
77
#
88
# These coded instructions, statements, and computer programs are the
99
# property of Michael R Sweet and are protected by Federal copyright
@@ -69,9 +69,11 @@ INSTALL_SCRIPT = $(INSTALL) -m 755
6969
# Rules...
7070
#
7171

72+
.SILENT:
7273
.SUFFIXES: .c .man .o
7374
.c.o:
74-
$(CC) $(CFLAGS) -c $<
75+
echo Compiling $<
76+
$(CC) $(CFLAGS) -c -o $@ $<
7577

7678

7779
#
@@ -101,6 +103,7 @@ all: Makefile config.h $(TARGETS)
101103
#
102104

103105
clean:
106+
echo Cleaning build files...
104107
$(RM) $(OBJS) $(TARGETS)
105108
$(RM) mxmldoc-static libmxml.a
106109

@@ -110,6 +113,7 @@ clean:
110113
#
111114

112115
distclean: clean
116+
echo Cleaning distribution files...
113117
$(RM) config.cache config.log config.status
114118
$(RM) Makefile config.h
115119
$(RM) -r autom4te*.cache
@@ -123,9 +127,11 @@ distclean: clean
123127

124128
.PHONY: clang clang-changes
125129
clang:
130+
echo Doing static code analysis of all code using CLANG...
126131
$(RM) -r clang
127132
scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all
128133
clang-changes:
134+
echo Doing static code analysis of changed code using CLANG...
129135
scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all
130136

131137

@@ -134,41 +140,50 @@ clang-changes:
134140
#
135141

136142
install: $(TARGETS) install-$(LIBMXML) install-libmxml.a
143+
echo Installing mxmldoc in $(BUILDROOT)$(bindir)...
137144
$(INSTALL_DIR) $(BUILDROOT)$(bindir)
138-
$(INSTALL_BIN) mxmldoc $(BUILDROOT)$(bindir)
145+
$(INSTALL_BIN) mxmldoc $(BUILDROOT)$(bindir)
146+
echo Installing documentation in $(BUILDROOT)$(docdir)...
139147
$(INSTALL_DIR) $(BUILDROOT)$(docdir)
140148
for file in $(DOCFILES); do \
141149
$(INSTALL_MAN) $$file $(BUILDROOT)$(docdir); \
142150
done
151+
echo Installing header files in $(BUILDROOT)$(includedir)...
143152
$(INSTALL_DIR) $(BUILDROOT)$(includedir)
144153
$(INSTALL_DATA) mxml.h $(BUILDROOT)$(includedir)
154+
echo Installing pkgconfig files in $(BUILDROOT)$(libdir)/pkgconfig...
145155
$(INSTALL_DIR) $(BUILDROOT)$(libdir)/pkgconfig
146156
$(INSTALL_DATA) mxml.pc $(BUILDROOT)$(libdir)/pkgconfig
157+
echo Installing man pages in $(BUILDROOT)$(mandir)...
147158
$(INSTALL_DIR) $(BUILDROOT)$(mandir)/man1
148159
$(INSTALL_MAN) doc/mxmldoc.man $(BUILDROOT)$(mandir)/man1/mxmldoc.1
149160
$(INSTALL_DIR) $(BUILDROOT)$(mandir)/man3
150161
$(INSTALL_MAN) doc/mxml.man $(BUILDROOT)$(mandir)/man3/mxml.3
151162

152163
install-libmxml.a:
164+
echo Installing libmxml.a to $(BUILDROOT)$(libdir)...
153165
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
154166
$(INSTALL_LIB) libmxml.a $(BUILDROOT)$(libdir)
155167
$(RANLIB) $(BUILDROOT)$(libdir)/libmxml.a
156168

157-
install-libmxml.so.1.4:
169+
install-libmxml.so.1.5:
170+
echo Installing libmxml.so to $(BUILDROOT)$(libdir)...
158171
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
159-
$(INSTALL_LIB) libmxml.so.1.4 $(BUILDROOT)$(libdir)
172+
$(INSTALL_LIB) libmxml.so.1.5 $(BUILDROOT)$(libdir)
160173
$(RM) $(BUILDROOT)$(libdir)/libmxml.so
161-
$(LN) libmxml.so.1.4 $(BUILDROOT)$(libdir)/libmxml.so
174+
$(LN) libmxml.so.1.5 $(BUILDROOT)$(libdir)/libmxml.so
162175
$(RM) $(BUILDROOT)$(libdir)/libmxml.so.1
163-
$(LN) libmxml.so.1.4 $(BUILDROOT)$(libdir)/libmxml.so.1
176+
$(LN) libmxml.so.1.5 $(BUILDROOT)$(libdir)/libmxml.so.1
164177

165178
install-libmxml.sl.1:
179+
echo Installing libmxml.sl to $(BUILDROOT)$(libdir)...
166180
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
167181
$(INSTALL_LIB) libmxml.sl.1 $(BUILDROOT)$(libdir)
168182
$(RM) $(BUILDROOT)$(libdir)/libmxml.so
169183
$(LN) libmxml.sl.1 $(BUILDROOT)$(libdir)/libmxml.sl
170184

171185
install-libmxml.1.dylib:
186+
echo Installing libmxml.dylib to $(BUILDROOT)$(libdir)...
172187
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
173188
$(INSTALL_LIB) libmxml.1.dylib $(BUILDROOT)$(libdir)
174189
$(RM) $(BUILDROOT)$(libdir)/libmxml.dylib
@@ -180,35 +195,45 @@ install-libmxml.1.dylib:
180195
#
181196

182197
uninstall: uninstall-$(LIBMXML) uninstall-libmxml.a
198+
echo Uninstalling mxmldoc from $(BUILDROOT)$(bindir)...
183199
$(RM) $(BUILDROOT)$(bindir)/mxmldoc
200+
echo Uninstalling documentation from $(BUILDROOT)$(docdir)...
184201
$(RM) -r $(BUILDROOT)$(docdir)
202+
echo Uninstalling headers from $(BUILDROOT)$(includedir)...
185203
$(RM) $(BUILDROOT)$(includedir)/mxml.h
204+
echo Uninstalling pkgconfig files from $(BUILDROOT)$(libdir)/pkgconfig...
186205
$(RM) $(BUILDROOT)$(libdir)/pkgconfig/mxml.pc
206+
echo Uninstalling man pages from $(BUILDROOT)$(mandir)...
187207
$(RM) $(BUILDROOT)$(mandir)/man1/mxmldoc.1
188208
$(RM) $(BUILDROOT)$(mandir)/man3/mxml.3
189209

190210
uninstall-libmxml.a:
211+
echo Uninstalling libmxml.a from $(BUILDROOT)$(libdir)...
191212
$(RM) $(BUILDROOT)$(libdir)/libmxml.a
192213

193-
uninstall-libmxml.so.1.4:
214+
uninstall-libmxml.so.1.5:
215+
echo Uninstalling libmxml.so from $(BUILDROOT)$(libdir)...
194216
$(RM) $(BUILDROOT)$(libdir)/libmxml.so
195217
$(RM) $(BUILDROOT)$(libdir)/libmxml.so.1
196218
$(RM) $(BUILDROOT)$(libdir)/libmxml.so.1.4
197219

198220
uninstall-libmxml.sl.1:
221+
echo Uninstalling libmxml.sl from $(BUILDROOT)$(libdir)...
199222
$(RM) $(BUILDROOT)$(libdir)/libmxml.sl
200223
$(RM) $(BUILDROOT)$(libdir)/libmxml.sl.1
201224

202225
uninstall-libmxml.1.dylib:
226+
echo Uninstalling libmxml.dylib from $(BUILDROOT)$(libdir)...
203227
$(RM) $(BUILDROOT)$(libdir)/libmxml.dylib
204228
$(RM) $(BUILDROOT)$(libdir)/libmxml.1.dylib
205229

206230

207231
#
208-
# Make packages using EPM (http://www.easysw.com/epm/)
232+
# Make packages using EPM (http://www.epmhome.org/)
209233
#
210234

211235
epm: all
236+
echo Creating distribution packages...
212237
epm --output-dir dist -v -f native mxml
213238
epm --output-dir dist -v -f portable mxml
214239

@@ -218,6 +243,7 @@ epm: all
218243
#
219244

220245
Makefile: configure Makefile.in
246+
echo Updating makefile...
221247
if test -f config.status; then \
222248
./config.status --recheck; \
223249
./config.status; \
@@ -228,6 +254,7 @@ Makefile: configure Makefile.in
228254

229255

230256
config.h: configure config.h.in
257+
echo Updating config.h...
231258
autoconf
232259
if test -f config.status; then \
233260
./config.status --recheck; \
@@ -238,11 +265,24 @@ config.h: configure config.h.in
238265
touch config.h
239266

240267

268+
#
269+
# Figure out lines-of-code...
270+
#
271+
272+
.PHONY: sloc
273+
274+
sloc:
275+
echo "libmxml: \c"
276+
sloccount $(LIBOBJS:.o=.c) mxml-private.c mxml.h 2>/dev/null | \
277+
grep "Total Physical" | awk '{print $$9}'
278+
279+
241280
#
242281
# libmxml.a
243282
#
244283

245284
libmxml.a: $(LIBOBJS)
285+
echo Creating $@...
246286
$(RM) $@
247287
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
248288
$(RANLIB) $@
@@ -252,21 +292,23 @@ mxml-entity.o mxml-file.o mxml-private.o: mxml-private.h
252292

253293

254294
#
255-
# libmxml.so.1.4
295+
# libmxml.so.1.5
256296
#
257297

258-
libmxml.so.1.4: $(LIBOBJS)
259-
$(DSO) $(DSOFLAGS) -o libmxml.so.1.4 $(LIBOBJS)
298+
libmxml.so.1.5: $(LIBOBJS)
299+
echo Creating $@...
300+
$(DSO) $(DSOFLAGS) -o libmxml.so.1.5 $(LIBOBJS)
260301
$(RM) libmxml.so libmxml.so.1
261-
$(LN) libmxml.so.1.4 libmxml.so
262-
$(LN) libmxml.so.1.4 libmxml.so.1
302+
$(LN) libmxml.so.1.5 libmxml.so
303+
$(LN) libmxml.so.1.5 libmxml.so.1
263304

264305

265306
#
266307
# libmxml.sl.1
267308
#
268309

269310
libmxml.sl.1: $(LIBOBJS)
311+
echo Creating $@...
270312
$(DSO) $(DSOFLAGS) -o libmxml.sl.1 $(LIBOBJS)
271313
$(RM) libmxml.sl
272314
$(LN) libmxml.sl.1 libmxml.sl
@@ -277,9 +319,10 @@ libmxml.sl.1: $(LIBOBJS)
277319
#
278320

279321
libmxml.1.dylib: $(LIBOBJS)
322+
echo Creating $@...
280323
$(DSO) $(DSOFLAGS) -o libmxml.1.dylib \
281324
-install_name $(libdir)/libmxml.dylib \
282-
-current_version 1.4.0 \
325+
-current_version 1.5.0 \
283326
-compatibility_version 1.0.0 \
284327
$(LIBOBJS)
285328
$(RM) libmxml.dylib
@@ -291,9 +334,11 @@ libmxml.1.dylib: $(LIBOBJS)
291334
#
292335

293336
mxmldoc: $(LIBMXML) mxmldoc.o
337+
echo Linking $@...
294338
$(CC) -L. $(LDFLAGS) -o $@ mxmldoc.o -lmxml $(LIBS)
295339

296340
mxmldoc-static: libmxml.a mxmldoc.o
341+
echo Linking $@...
297342
$(CC) $(LDFLAGS) -o $@ mxmldoc.o libmxml.a $(LIBS)
298343

299344
mxmldoc.o: mxml.h
@@ -304,6 +349,7 @@ mxmldoc.o: mxml.h
304349
#
305350

306351
testmxml: libmxml.a testmxml.o
352+
echo Linking $@...
307353
$(CC) $(LDFLAGS) -o $@ testmxml.o libmxml.a $(LIBS)
308354
@echo Testing library...
309355
./testmxml test.xml >temp1.xml 2>temp1s.xml
@@ -335,6 +381,7 @@ testmxml.o: mxml.h
335381
#
336382

337383
mxml.xml: mxmldoc-static mxml.h $(PUBLIBOBJS:.o=.c)
384+
echo Generating API documentation...
338385
$(RM) mxml.xml
339386
./mxmldoc-static --header doc/reference.heading mxml.xml mxml.h $(PUBLIBOBJS:.o=.c) >doc/reference.html
340387
if test "x`uname`" = xDarwin; then \
@@ -351,6 +398,7 @@ mxml.xml: mxmldoc-static mxml.h $(PUBLIBOBJS:.o=.c)
351398
fi
352399

353400
valgrind: mxmldoc-static
401+
echo Doing dynamic code analysis using Valgrind...
354402
$(RM) valgrind.xml
355403
valgrind --tool=memcheck --leak-check=yes ./mxmldoc-static \
356404
valgrind.xml mxml.h $(PUBLIBOBJS:.o=.c) \
@@ -362,6 +410,7 @@ valgrind: mxmldoc-static
362410
#
363411

364412
doc/mxml.man: mxmldoc-static mxml.xml
413+
echo "Generating mxml(3) man page..."
365414
$(RM) doc/mxml.man
366415
./mxmldoc-static --man mxml --title "Mini-XML API" \
367416
--intro doc/intro.man --footer doc/footer.man \

README

+20-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
README - 2010-11-08
1+
README - 2011-01-02
22
-------------------
33

44

@@ -133,7 +133,7 @@ DOCUMENTATION
133133

134134
/* Find the first "a" element with "href" to a URL */
135135
node = mxmlFindElement(tree, tree, "a", "href",
136-
"http://www.easysw.com/~mike/mxml/",
136+
"http://www.minixml.org/",
137137
MXML_DESCEND);
138138

139139
/* Find the first element with a "src" attribute*/
@@ -156,11 +156,25 @@ DOCUMENTATION
156156
... do something ...
157157
}
158158

159-
The "mxmlFindValue()" function finds the (first) value node under a specific
159+
The "mxmlFindPath()" function finds the (first) value node under a specific
160160
element using a "path":
161161

162-
mxml_node_t *value = mxmlFindValue(tree, "path/to/*/foo/bar");
163-
162+
mxml_node_t *value = mxmlFindPath(tree, "path/to/*/foo/bar");
163+
164+
The "mxmlGetInteger()", "mxmlGetOpaque()", "mxmlGetReal()", and
165+
"mxmlGetText()" functions retrieve the value from a node:
166+
167+
mxml_node_t *node;
168+
169+
int intvalue = mxmlGetInteger(node);
170+
171+
const char *opaquevalue = mxmlGetOpaque(node);
172+
173+
double realvalue = mxmlGetReal(node);
174+
175+
int whitespacevalue;
176+
const char *textvalue = mxmlGetText(node, &whitespacevalue);
177+
164178
Finally, once you are done with the XML data, use the "mxmlDelete()"
165179
function to recursively free the memory that is used for a particular node
166180
or the entire tree:
@@ -178,5 +192,5 @@ GETTING HELP AND REPORTING PROBLEMS
178192

179193
LEGAL STUFF
180194

181-
The Mini-XML library is Copyright 2003-2010 by Michael Sweet. License terms
195+
The Mini-XML library is Copyright 2003-2011 by Michael Sweet. License terms
182196
are described in the file "COPYING".

0 commit comments

Comments
 (0)