Compare commits

..

No commits in common. "8ba0e97ec205ef24bcf925ae338ea8ed6754d561" and "61eddf1b62c58766eeba5bc84235551d76b263b5" have entirely different histories.

9 changed files with 14 additions and 481 deletions

View File

@ -5,12 +5,11 @@ Changes in Mini-XML
Changes in Mini-XML 4.0.4
-------------------------
- Added Linux-specific build files and dropped unused `long long` config tests
(Issue #335)
- Fixed an issue when reporting errors with a `NULL` options pointer
(Issue #329)
- Fixed some compiler warnings (Issue #333)
- Fixed some documentation issues (Issue #334)
- Dropped unused `long long` config tests (Issue #335)
Changes in Mini-XML 4.0.3

View File

@ -179,8 +179,8 @@ clean:
$(RM) mxml4.lib
$(RM) libmxml4.a
$(RM) libmxml4.so
$(RM) libmxml4.so.2
$(RM) libmxml4.2.dylib
$(RM) libmxml4.so.1
$(RM) libmxml4.1.dylib
$(RM) libmxml4.dylib
@ -415,18 +415,13 @@ testmxml-vg: $(LIBOBJS) testmxml.o
testmxml.o: mxml.h
#
# Fuzz-test the library <>
#
.PHONY: afl
afl:
$(MAKE) -$(MAKEFLAGS) CC="afl-clang-fast" COMMONFLAGS="-g" clean all
test afl-output || rm -rf afl-output
afl-fuzz -x xml.dict -i afl-input -o afl-output -V 600 -e xml -t 5000 ./testmxml @@ temps.xml
#
# Analyze code with the Clang static analyzer <https://clang-analyzer.llvm.org>
#

View File

@ -1,394 +0,0 @@
#
# Linux makefile for Mini-XML, a small XML-like file parsing library.
#
# https://www.msweet.org/mxml
#
# Copyright © 2003-2024 by Michael R Sweet.
#
# Licensed under Apache License v2.0. See the file "LICENSE" for more
# information.
#
#
# This is a POSIX makefile
#
.POSIX:
#
# Mini-XML version...
#
MXML_VERSION = 4.0.4
#
# Programs...
#
AR = /usr/bin/ar
CC = gcc
DSO = $(CC)
INSTALL = /home/mike/c/mxml/install-sh
LN = /usr/bin/ln -sf
MKDIR = /usr/bin/mkdir -p
RANLIB = ranlib
RM = /usr/bin/rm -f
RMDIR = /usr/bin/rmdir
SHELL = /bin/sh
#
# Installation programs...
#
INSTALL_BIN = $(INSTALL) -c -m 755
INSTALL_DATA = $(INSTALL) -c -m 444
INSTALL_DIR = $(INSTALL) -d -m 755
INSTALL_LIB = $(INSTALL) -c -m 755
INSTALL_MAN = $(INSTALL) -c -m 444
#
# Libraries...
#
LIBMXML = libmxml4.so.2
LIBMXML_BASE = libmxml4
LIBMXML_STATIC = libmxml4.a
MXML_MAN = mxml4.3
MXML_PC = mxml4.pc
#
# Install static libraries?
#
INSTALL_STATIC = install-libmxml4.a
#
# Code signing...
#
CODE_SIGN = /usr/bin/true
CODESIGN_IDENTITY = -
CSFLAGS = -s "$(CODESIGN_IDENTITY)" -o runtime --timestamp
#
# Library archiver...
#
ARFLAGS = cr
#
# C compiler and preprocessor...
#
CFLAGS = -fPIC $(CPPFLAGS) $(OPTIM) $(WARNINGS)
CPPFLAGS = -D_THREAD_SAFE -D_REENTRANT -D_FORTIFY_SOURCE=3 -D__USE_MISC -D_GNU_SOURCE
WARNINGS = -Wall -Wunused -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format-truncation -Wno-format-y2k -Wno-switch -Wno-unused-result
#
# Linker options...
#
DSOFLAGS = -Wl,-soname,`basename $@` -shared $(OPTIM)
LDFLAGS = -fPIE -pie -Wl,-z,relro,-z,now $(OPTIM)
LIBS = -lpthread -lm
#
# Optimization and architecture options for both the compiler and linker.
#
OPTIM = -g -Os
#
# Directories...
#
bindir = ${exec_prefix}/bin
datadir = ${datarootdir}
datarootdir = ${prefix}/share
docdir = ${prefix}/share/doc/mxml4
exec_prefix = ${prefix}
includedir = ${prefix}/include/libmxml4
infodir = ${datarootdir}/info
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localstatedir = ${prefix}/var
mandir = ${datarootdir}/man
oldincludedir = /usr/include
prefix = /usr/local
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
srcdir = .
sysconfdir = ${prefix}/etc
top_srcdir = .
BUILDROOT = $(DSTROOT)$(DESTDIR)
#
# Silent build...
#
.SILENT:
#
# Targets...
#
DOCFILES = doc/mxml.epub doc/mxml.html doc/mxml-cover.png \
CHANGES.md LICENSE NOTICE README.md
PUBLIBOBJS = mxml-attr.o mxml-file.o mxml-get.o mxml-index.o \
mxml-node.o mxml-options.o mxml-search.o mxml-set.o
LIBOBJS = $(PUBLIBOBJS) mxml-private.o
OBJS = testmxml.o $(LIBOBJS)
ALLTARGETS = $(LIBMXML) testmxml
CROSSTARGETS = $(LIBMXML)
TARGETS = $(ALLTARGETS)
#
# Make everything...
#
all: $(TARGETS)
#
# Clean everything...
#
clean:
echo Cleaning build files...
$(RM) $(OBJS) $(ALLTARGETS)
$(RM) libmxml4.a
$(RM) libmxml4.so
$(RM) libmxml4.so.2
#
# Really clean everything...
#
distclean: clean
echo Cleaning distribution files...
$(RM) test.xmlfd
$(RM) temp1.xml temp1.xmlfd temp1s.xml
$(RM) temp2.xml temp2s.xml
$(RM) -r clang
#
# Install everything...
#
.NOTPARALLEL: install install-$(LIBMXML) $(INSTALL_STATIC)
install: $(TARGETS) install-$(LIBMXML) $(INSTALL_STATIC)
echo Installing documentation in $(BUILDROOT)$(docdir)...
$(INSTALL_DIR) $(BUILDROOT)$(docdir)
for file in $(DOCFILES); do \
$(INSTALL_MAN) ../$$file $(BUILDROOT)$(docdir)/`basename $$file .md`; \
done
echo Installing header files in $(BUILDROOT)$(includedir)...
$(INSTALL_DIR) $(BUILDROOT)$(includedir)
$(INSTALL_DATA) ../mxml.h $(BUILDROOT)$(includedir)
echo Installing pkgconfig files in $(BUILDROOT)$(libdir)/pkgconfig...
$(INSTALL_DIR) $(BUILDROOT)$(libdir)/pkgconfig
$(INSTALL_DATA) mxml4.pc $(BUILDROOT)$(libdir)/pkgconfig/$(MXML_PC)
echo Installing man pages in $(BUILDROOT)$(mandir)...
$(INSTALL_DIR) $(BUILDROOT)$(mandir)/man3
$(INSTALL_MAN) ../doc/mxml.3 $(BUILDROOT)$(mandir)/man3/$(MXML_MAN)
install-libmxml.a: libmxml.a
echo Installing libmxml.a to $(BUILDROOT)$(libdir)...
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmxml.a $(BUILDROOT)$(libdir)
$(RANLIB) $(BUILDROOT)$(libdir)/libmxml.a
install-libmxml.so.2: libmxml.so.2
echo Installing libmxml.so to $(BUILDROOT)$(libdir)...
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmxml.so.2 $(BUILDROOT)$(libdir)
$(RM) $(BUILDROOT)$(libdir)/libmxml.so
$(LN) libmxml.so.2 $(BUILDROOT)$(libdir)/libmxml.so
$(LDCONFIG)
install-libmxml4.a: libmxml4.a
echo Installing libmxml4.a to $(BUILDROOT)$(libdir)...
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmxml4.a $(BUILDROOT)$(libdir)
$(RANLIB) $(BUILDROOT)$(libdir)/libmxml4.a
install-libmxml4.so.2: libmxml4.so.2
echo Installing libmxml4.so to $(BUILDROOT)$(libdir)...
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmxml4.so.2 $(BUILDROOT)$(libdir)
$(RM) $(BUILDROOT)$(libdir)/libmxml4.so
$(LN) libmxml4.so.2 $(BUILDROOT)$(libdir)/libmxml4.so
$(LDCONFIG)
#
# Uninstall everything...
#
uninstall: uninstall-$(LIBMXML) uninstall-libmxml4.a
echo Uninstalling documentation from $(BUILDROOT)$(docdir)...
$(RM) -r $(BUILDROOT)$(docdir)
echo Uninstalling headers from $(BUILDROOT)$(includedir)...
$(RM) $(BUILDROOT)$(includedir)/mxml.h
echo Uninstalling pkgconfig files from $(BUILDROOT)$(libdir)/pkgconfig...
$(RM) $(BUILDROOT)$(libdir)/pkgconfig/$(MXML_PC)
echo Uninstalling man pages from $(BUILDROOT)$(mandir)...
$(RM) $(BUILDROOT)$(mandir)/man3/$(MXML_MAN)
uninstall-libmxml.a:
echo Uninstalling libmxml.a from $(BUILDROOT)$(libdir)...
$(RM) $(BUILDROOT)$(libdir)/libmxml.a
uninstall-libmxml.so.2:
echo Uninstalling libmxml.so from $(BUILDROOT)$(libdir)...
$(RM) $(BUILDROOT)$(libdir)/libmxml.so
$(RM) $(BUILDROOT)$(libdir)/libmxml.so.2
$(LDCONFIG)
uninstall-libmxml4.a:
echo Uninstalling libmxml4.a from $(BUILDROOT)$(libdir)...
$(RM) $(BUILDROOT)$(libdir)/libmxml4.a
uninstall-libmxml4.so.2:
echo Uninstalling libmxml4.so from $(BUILDROOT)$(libdir)...
$(RM) $(BUILDROOT)$(libdir)/libmxml4.so
$(RM) $(BUILDROOT)$(libdir)/libmxml4.so.2
$(LDCONFIG)
#
# Test everything...
#
test: testmxml
@echo Testing library...
./testmxml ../test.xml temp1s.xml >temp1.xml
./testmxml temp1.xml temp2s.xml >temp2.xml
@if cmp temp1.xml temp2.xml; then \
echo Stdio file test passed!; \
$(RM) temp2.xml temp2s.xml; \
else \
echo Stdio file test failed!; \
exit 1; \
fi
@if cmp temp1.xml temp1s.xml; then \
echo String test passed!; \
$(RM) temp1.xml temp1s.xml; \
else \
echo String test failed!; \
exit 1; \
fi
@if cmp ../test.xml ../test.xmlfd; then \
echo File descriptor test passed!; \
$(RM) test.xmlfd temp1.xmlfd; \
else \
echo File descriptor test failed!; \
exit 1; \
fi
#
# libmxml.a
#
libmxml.a libmxml4.a: $(LIBOBJS)
echo Creating $@...
$(RM) $@
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
$(RANLIB) $@
#
# libmxml.so.2
#
libmxml.so.2 libmxml4.so.2: $(LIBOBJS)
echo Creating $@...
$(DSO) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS)
$(RM) `basename $@ .2`
$(LN) $@ `basename $@ .2`
#
# testmxml
#
testmxml: $(LIBMXML_STATIC) testmxml.o
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testmxml.o $(LIBMXML_STATIC) $(LIBS)
#
# Documentation (depends on separate codedoc utility)
#
.PHONY: doc
doc: ../mxml.h $(PUBLIBOBJS:.o=.c) \
../doc/body.md ../doc/body.man ../doc/footer.man \
../doc/mxml-cover.png
echo Generating API documentation...
$(RM) mxml.xml
codedoc --body ../doc/body.md \
--coverimage ../doc/mxml-cover.png \
mxml.xml mxml.h $(PUBLIBOBJS:.o=.c) >../doc/mxml.html
codedoc --body ../doc/body.md \
--coverimage ../doc/mxml-cover.png \
--epub ../doc/mxml.epub mxml.xml
codedoc --man mxml --title "Mini-XML API" \
--body ../doc/body.man --footer ../doc/footer.man \
mxml.xml >../doc/mxml.3
$(RM) mxml.xml
#
# All object files depend on the makefile and config header...
#
mxml-attr.o: ../mxml-attr.c ../mxml.h ../mxml-private.h Makefile config.h
echo Compiling $<
$(CC) $(CFLAGS) -c -o $@ $<
mxml-file.o: ../mxml-file.c ../mxml.h ../mxml-private.h Makefile config.h
echo Compiling $<
$(CC) $(CFLAGS) -c -o $@ $<
mxml-get.o: ../mxml-get.c ../mxml.h ../mxml-private.h Makefile config.h
echo Compiling $<
$(CC) $(CFLAGS) -c -o $@ $<
mxml-index.o: ../mxml-index.c ../mxml.h ../mxml-private.h Makefile config.h
echo Compiling $<
$(CC) $(CFLAGS) -c -o $@ $<
mxml-node.o: ../mxml-node.c ../mxml.h ../mxml-private.h Makefile config.h
echo Compiling $<
$(CC) $(CFLAGS) -c -o $@ $<
mxml-options.o: ../mxml-options.c ../mxml.h ../mxml-private.h Makefile config.h
echo Compiling $<
$(CC) $(CFLAGS) -c -o $@ $<
mxml-private.o: ../mxml-private.c ../mxml.h ../mxml-private.h Makefile config.h
echo Compiling $<
$(CC) $(CFLAGS) -c -o $@ $<
mxml-search.o: ../mxml-search.c ../mxml.h ../mxml-private.h Makefile config.h
echo Compiling $<
$(CC) $(CFLAGS) -c -o $@ $<
mxml-set.o: ../mxml-set.c ../mxml.h ../mxml-private.h Makefile config.h
echo Compiling $<
$(CC) $(CFLAGS) -c -o $@ $<
testmxml.o: ../testmxml.c ../mxml.h ../mxml-private.h Makefile config.h
echo Compiling $<
$(CC) $(CFLAGS) -c -o $@ $<

View File

@ -1,42 +0,0 @@
//
// Linux configuration file for Mini-XML, a small XML file parsing library.
//
// https://www.msweet.org/mxml
//
// Copyright © 2003-2024 by Michael R Sweet.
//
// Licensed under Apache License v2.0. See the file "LICENSE" for more
// information.
//
#ifndef MXML_CONFIG_H
# define MXML_CONFIG_H
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <stdarg.h>
# include <ctype.h>
//
// Version number
//
# define MXML_VERSION "Mini-XML v4.0.4"
//
// Inline function support
//
# define inline
//
// Have <pthread.h>?
//
# define HAVE_PTHREAD_H 1
#endif // !MXML_CONFIG_H

View File

@ -1,10 +0,0 @@
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include/libmxml4
Name: Mini-XML
Description: Lightweight XML support library
Version: 4.0.4
Libs: -lmxml4
Cflags: -I${includedir}

View File

@ -49,16 +49,6 @@ if ! grep -q "Version: $version" mxml.spec; then
status=1
fi
if test "$(grep MXML_VERSION linux/config.h | awk '${print $5}')" != "v$version\""; then
echo "Update MXML_VERSION in linux/config.h."
status=1
fi
if test "$(grep MXML_VERSION vcnet/config.h | awk '${print $5}')" != "v$version\""; then
echo "Update MXML_VERSION in vcnet/config.h."
status=1
fi
if ! grep -q "<version>$version</version>" vcnet/libmxml4_native.nuspec; then
echo "Update vcnet/libmxml4_native.nuspec."
status=1
@ -73,11 +63,6 @@ if ! grep -q "<version>$version</version>" vcnet/libmxml4_native.redist.nuspec;
status=1
fi
if test "$(grep MXML_VERSION xcode/config.h | awk '${print $5}')" != "v$version\""; then
echo "Update MXML_VERSION in xcode/config.h."
status=1
fi
if test $status = 1; then
exit 1
fi

View File

@ -1,9 +1,9 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>libmxml4_native</id>
<id>libmxml2_native</id>
<title>Small XML File Parsing Library for VS2019+</title>
<version>4.0.4</version>
<version>4.0.3</version>
<authors>Michael R Sweet</authors>
<owners>michaelrsweet</owners>
<projectUrl>https://github.com/michaelrsweet/mxml</projectUrl>
@ -16,15 +16,15 @@
<copyright>Copyright © 2003-2024 by Michael R Sweet</copyright>
<tags>xml</tags>
<dependencies>
<dependency id="libmxml4_native.redist" version="4.0.4" />
<dependency id="libmxml2_native.redist" version="4.0.3" />
</dependencies>
</metadata>
<files>
<file src="..\doc\mxml-128.png" target="build\native" />
<file src="..\README.md" target="build\native" />
<file src="libmxml4_native.props" target="build\native" />
<file src="libmxml2_native.props" target="build\native" />
<file src="..\mxml.h" target="build\native\include" />
<!--<file src="Win32\**\mxml4.lib" target="build\native\lib\Win32" />-->
<file src="x64\**\mxml4.lib" target="build\native\lib\x64" />
<!--<file src="Win32\**\libmxml2.lib" target="build\native\lib\Win32" />-->
<file src="x64\**\libmxml2.lib" target="build\native\lib\x64" />
</files>
</package>

View File

@ -5,7 +5,7 @@
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalDependencies>$(MSBuildThisFileDirectory)\lib\$(Platform)\$(Configuration)\mxml4.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>$(MSBuildThisFileDirectory)\lib\$(Platform)\$(Configuration)\libmxml2.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
</Project>

View File

@ -1,9 +1,9 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>libmxml4_native.redist</id>
<id>libmxml2_native.redist</id>
<title>Small XML File Parsing Library for VS2019+ Redist</title>
<version>4.0.4</version>
<version>4.0.3</version>
<authors>Michael R Sweet</authors>
<owners>michaelrsweet</owners>
<projectUrl>https://github.com/michaelrsweet/mxml</projectUrl>
@ -19,7 +19,7 @@
<files>
<file src="..\doc\mxml-128.png" target="build\native" />
<file src="..\README.md" target="build\native" />
<!--<file src="Win32\**\mxml4.dll" target="build\native\bin\Win32" />-->
<file src="x64\**\mxml4.dll" target="build\native\bin\x64" />
<!--<file src="Win32\**\libmxml2.dll" target="build\native\bin\Win32" />-->
<file src="x64\**\libmxml2.dll" target="build\native\bin\x64" />
</files>
</package>