Remove mxmldoc (Issue #237)

This commit is contained in:
Michael R Sweet 2019-01-02 20:36:53 -05:00
parent 53c75b04c1
commit eadf40fa70
No known key found for this signature in database
GPG Key ID: 999559A027815955
16 changed files with 17 additions and 9861 deletions

7
.gitignore vendored
View File

@ -14,14 +14,7 @@ libmxml.sl.1
libmxml.so
libmxml.so.1
libmxml.so.1.5
mxml.epub
mxml.pc
mxml.xml
mxmldoc
mxmldoc-static
org.msweet.mxml.atom
org.msweet.mxml.docset
org.msweet.mxml.xar
scratch
temp1.xmlfd
test.xmlfd

View File

@ -2,9 +2,8 @@
- Fixed a potential buffer overflow when writing floating point data
(Issue #233)
- Fixed a potential crash bug in mxmldoc found by fuzzing (Issue #235,
Issue #236)
- The `mxmldoc` program now sets the EPUB subject ("Programming").
- Moved `mxmldoc` to a new `codedoc` project whose focus is on generating
code documentation (Issue #235, Issue #236, Issue #237)
# Changes in Mini-XML 2.12

View File

@ -1,7 +1,7 @@
#
# Makefile for Mini-XML, a small XML-like file parsing library.
#
# Copyright 2003-2018 by Michael R Sweet.
# Copyright 2003-2019 by Michael R Sweet.
#
# These coded instructions, statements, and computer programs are the
# property of Michael R Sweet and are protected by Federal copyright
@ -82,9 +82,9 @@ DOCFILES = doc/mxml.html doc/mxmldoc.xsd README.md COPYING CHANGES.md
PUBLIBOBJS = mxml-attr.o mxml-entity.o mxml-file.o mxml-get.o \
mxml-index.o mxml-node.o mxml-search.o mxml-set.o
LIBOBJS = $(PUBLIBOBJS) mxml-private.o mxml-string.o
OBJS = mmd.o mxmldoc.o testmxml.o zipc.o $(LIBOBJS)
ALLTARGETS = $(LIBMXML) mxmldoc testmxml mxml.xml @MXML_EPUB@
CROSSTARGETS = $(LIBMXML) mxmldoc
OBJS = testmxml.o $(LIBOBJS)
ALLTARGETS = $(LIBMXML) testmxml @MXML_EPUB@
CROSSTARGETS = $(LIBMXML)
TARGETS = $(@TARGETS@)
@ -102,7 +102,6 @@ all: $(TARGETS)
clean:
echo Cleaning build files...
$(RM) $(OBJS) $(ALLTARGETS)
$(RM) mxmldoc-static
$(RM) mxml1.dll
$(RM) libmxml.a
$(RM) libmxml.so.1.6
@ -142,9 +141,6 @@ clang-changes:
#
install: $(TARGETS) install-$(LIBMXML) install-libmxml.a
echo Installing mxmldoc in $(BUILDROOT)$(bindir)...
$(INSTALL_DIR) $(BUILDROOT)$(bindir)
$(INSTALL_BIN) mxmldoc $(BUILDROOT)$(bindir)
echo Installing documentation in $(BUILDROOT)$(docdir)...
$(INSTALL_DIR) $(BUILDROOT)$(docdir)
for file in $(DOCFILES); do \
@ -157,8 +153,6 @@ install: $(TARGETS) install-$(LIBMXML) install-libmxml.a
$(INSTALL_DIR) $(BUILDROOT)$(libdir)/pkgconfig
$(INSTALL_DATA) mxml.pc $(BUILDROOT)$(libdir)/pkgconfig
echo Installing man pages in $(BUILDROOT)$(mandir)...
$(INSTALL_DIR) $(BUILDROOT)$(mandir)/man1
$(INSTALL_MAN) doc/mxmldoc.man $(BUILDROOT)$(mandir)/man1/mxmldoc.1
$(INSTALL_DIR) $(BUILDROOT)$(mandir)/man3
$(INSTALL_MAN) doc/mxml.man $(BUILDROOT)$(mandir)/man3/mxml.3
@ -197,8 +191,6 @@ install-libmxml.1.dylib: libmxml.1.dylib
#
uninstall: uninstall-$(LIBMXML) uninstall-libmxml.a
echo Uninstalling mxmldoc from $(BUILDROOT)$(bindir)...
$(RM) $(BUILDROOT)$(bindir)/mxmldoc
echo Uninstalling documentation from $(BUILDROOT)$(docdir)...
$(RM) -r $(BUILDROOT)$(docdir)
echo Uninstalling headers from $(BUILDROOT)$(includedir)...
@ -206,7 +198,6 @@ uninstall: uninstall-$(LIBMXML) uninstall-libmxml.a
echo Uninstalling pkgconfig files from $(BUILDROOT)$(libdir)/pkgconfig...
$(RM) $(BUILDROOT)$(libdir)/pkgconfig/mxml.pc
echo Uninstalling man pages from $(BUILDROOT)$(mandir)...
$(RM) $(BUILDROOT)$(mandir)/man1/mxmldoc.1
$(RM) $(BUILDROOT)$(mandir)/man3/mxml.3
uninstall-libmxml.a:
@ -303,23 +294,6 @@ libmxml.1.dylib: $(LIBOBJS)
$(LN) libmxml.1.dylib libmxml.dylib
#
# mxmldoc
#
mxmldoc: $(LIBMXML) mxmldoc.o mmd.o @ZIPC@
echo Linking $@...
$(CC) -L. $(LDFLAGS) -o $@ mxmldoc.o mmd.o @ZIPC@ -lmxml $(LIBS)
mxmldoc-static: libmxml.a mxmldoc.o mmd.o @ZIPC@
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ mxmldoc.o mmd.o @ZIPC@ libmxml.a $(LIBS)
mxmldoc.o: mxml.h zipc.h mmd.h
zipc.o: zipc.h
mmd.o: mmd.h
#
# testmxml
#
@ -357,47 +331,35 @@ testmxml.o: mxml.h
#
# mxml.xml
# mxml.xml (depends on separate codedoc utility)
#
mxml.xml: mxmldoc-static mxml.h $(PUBLIBOBJS:.o=.c) \
mxml.xml: mxml.h $(PUBLIBOBJS:.o=.c) \
doc/body.man doc/footer.man \
doc/reference.header
echo Generating API documentation...
$(RM) mxml.xml
./mxmldoc-static --header doc/reference.header \
codedoc --header doc/reference.header \
--docversion @VERSION@ --author "Michael R Sweet" \
--copyright "Copyright 2003-2018, All Rights Reserved." \
--copyright "Copyright 2003-2019, All Rights Reserved." \
--title "Mini-XML API Reference" \
mxml.xml mxml.h $(PUBLIBOBJS:.o=.c) >doc/reference.html
./mxmldoc-static --man mxml --title "Mini-XML API" \
codedoc --man mxml --title "Mini-XML API" \
--body doc/body.man --footer doc/footer.man \
mxml.xml >doc/mxml.man
#
# mxml.epub
# mxml.epub (depends on separate codedoc utility)
#
mxml.epub: mxml.xml mxmldoc-static doc/body.md doc/mxml-cover.png
mxml.epub: mxml.xml doc/body.md doc/mxml-cover.png
echo Generating EPUB API documentation...
./mxmldoc-static --body doc/body.md \
codedoc --body doc/body.md \
--coverimage doc/mxml-cover.png \
--epub mxml.epub mxml.xml
#
# Use Valgrind (http://valgrind.org) to check for problems in mxmldoc.
#
valgrind: mxmldoc-static
echo Doing dynamic code analysis using Valgrind...
$(RM) valgrind.xml
valgrind --tool=memcheck --leak-check=yes ./mxmldoc-static \
valgrind.xml mxml.h $(PUBLIBOBJS:.o=.c) \
>valgrind.html 2>valgrind.out
#
# All object files depend on the makefile and config header...
#

View File

@ -44,13 +44,6 @@
#undef HAVE_LONG_LONG
/*
* Do we have <zlib.h>?
*/
#undef HAVE_ZLIB_H
/*
* Do we have the *printf() functions?
*/

68
configure vendored
View File

@ -635,8 +635,6 @@ PTHREAD_FLAGS
EGREP
GREP
CPP
ZIPC
MXML_EPUB
ARFLAGS
RM
MKDIR
@ -3977,72 +3975,6 @@ if test $ac_cv_c_long_long = yes; then
fi
MXML_EPUB=""
ZIPC=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gzgets" >&5
$as_echo_n "checking for library containing gzgets... " >&6; }
if ${ac_cv_search_gzgets+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char gzgets ();
int
main ()
{
return gzgets ();
;
return 0;
}
_ACEOF
for ac_lib in '' z; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_gzgets=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_gzgets+:} false; then :
break
fi
done
if ${ac_cv_search_gzgets+:} false; then :
else
ac_cv_search_gzgets=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gzgets" >&5
$as_echo "$ac_cv_search_gzgets" >&6; }
ac_res=$ac_cv_search_gzgets
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
$as_echo "#define HAVE_ZLIB_H 1" >>confdefs.h
ZIPC="zipc.o"
MXML_EPUB="mxml.epub"
LIBS="-lz $LIBS"
fi
# Check whether --enable-threads was given.
if test "${enable_threads+set}" = set; then :
enableval=$enable_threads;

View File

@ -1,7 +1,7 @@
dnl
dnl Configuration script for Mini-XML, a small XML-like file parsing library.
dnl
dnl Copyright 2003-2018 by Michael R Sweet.
dnl Copyright 2003-2019 by Michael R Sweet.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Michael R Sweet and are protected by Federal copyright
@ -124,17 +124,6 @@ if test $ac_cv_c_long_long = yes; then
AC_DEFINE(HAVE_LONG_LONG)
fi
dnl EPUB support (via libz and zipc)
MXML_EPUB=""
AC_SUBST(MXML_EPUB)
ZIPC=""
AC_SUBST(ZIPC)
AC_SEARCH_LIBS(gzgets,z,[
AC_DEFINE(HAVE_ZLIB_H)
ZIPC="zipc.o"
MXML_EPUB="mxml.epub"
LIBS="-lz $LIBS"])
dnl Threading support
AC_ARG_ENABLE(threads, [ --enable-threads enable multi-threading support])

1207
mmd.c

File diff suppressed because it is too large Load Diff

100
mmd.h
View File

@ -1,100 +0,0 @@
/*
* Header file for miniature markdown library.
*
* https://github.com/michaelrsweet/mmd
*
* Copyright © 2017-2018 by Michael R Sweet.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
#ifndef MMD_H
# define MMD_H
/*
* Include necessary headers...
*/
# include <stdio.h>
/*
* Constants...
*/
typedef enum mmd_type_e
{
MMD_TYPE_NONE = -1,
MMD_TYPE_DOCUMENT,
MMD_TYPE_METADATA,
MMD_TYPE_BLOCK_QUOTE,
MMD_TYPE_ORDERED_LIST,
MMD_TYPE_UNORDERED_LIST,
MMD_TYPE_LIST_ITEM,
MMD_TYPE_TABLE,
MMD_TYPE_TABLE_HEADER,
MMD_TYPE_TABLE_BODY,
MMD_TYPE_TABLE_ROW,
MMD_TYPE_HEADING_1 = 10,
MMD_TYPE_HEADING_2,
MMD_TYPE_HEADING_3,
MMD_TYPE_HEADING_4,
MMD_TYPE_HEADING_5,
MMD_TYPE_HEADING_6,
MMD_TYPE_PARAGRAPH,
MMD_TYPE_CODE_BLOCK,
MMD_TYPE_THEMATIC_BREAK,
MMD_TYPE_TABLE_HEADER_CELL,
MMD_TYPE_TABLE_BODY_CELL_LEFT,
MMD_TYPE_TABLE_BODY_CELL_CENTER,
MMD_TYPE_TABLE_BODY_CELL_RIGHT,
MMD_TYPE_NORMAL_TEXT = 100,
MMD_TYPE_EMPHASIZED_TEXT,
MMD_TYPE_STRONG_TEXT,
MMD_TYPE_STRUCK_TEXT,
MMD_TYPE_LINKED_TEXT,
MMD_TYPE_CODE_TEXT,
MMD_TYPE_IMAGE,
MMD_TYPE_HARD_BREAK,
MMD_TYPE_SOFT_BREAK,
MMD_TYPE_METADATA_TEXT
} mmd_type_t;
/*
* Types...
*/
typedef struct _mmd_s mmd_t;
/*
* Functions...
*/
# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
extern char *mmdCopyAllText(mmd_t *node);
extern void mmdFree(mmd_t *node);
extern mmd_t *mmdGetFirstChild(mmd_t *node);
extern mmd_t *mmdGetLastChild(mmd_t *node);
extern const char *mmdGetMetadata(mmd_t *doc, const char *keyword);
extern mmd_t *mmdGetNextSibling(mmd_t *node);
extern mmd_t *mmdGetParent(mmd_t *node);
extern mmd_t *mmdGetPrevSibling(mmd_t *node);
extern const char *mmdGetText(mmd_t *node);
extern mmd_type_t mmdGetType(mmd_t *node);
extern const char *mmdGetURL(mmd_t *node);
extern int mmdGetWhitespace(mmd_t *node);
extern int mmdIsBlock(mmd_t *node);
extern mmd_t *mmdLoad(const char *filename);
extern mmd_t *mmdLoadFile(FILE *fp);
# ifdef __cplusplus
}
# endif /* __cplusplus */
#endif /* !MMD_H */

View File

@ -1,7 +1,7 @@
#
# RPM "spec" file for Mini-XML, a small XML file parsing library.
#
# Copyright 2003-2017 by Michael R Sweet.
# Copyright 2003-2019 by Michael R Sweet.
#
# These coded instructions, statements, and computer programs are the
# property of Michael R Sweet and are protected by Federal copyright
@ -14,7 +14,7 @@
Summary: Small XML file parsing library
Name: mxml
Version: 2.11
Version: 2.13
Release: 1
License: LGPL
Group: Development/Libraries
@ -66,8 +66,6 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%dir /usr/bin
/usr/bin/*
%dir /usr/include
/usr/include/mxml.h
%dir /usr/lib
@ -76,7 +74,5 @@ rm -rf $RPM_BUILD_ROOT
/usr/lib/pkgconfig/mxml.pc
%dir /usr/share/doc/mxml
/usr/share/doc/mxml/*
%dir /usr/share/man/man1
/usr/share/man/man1/*
%dir /usr/share/man/man3
/usr/share/man/man3/*

6038
mxmldoc.c

File diff suppressed because it is too large Load Diff

View File

@ -1,217 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{D909892E-520A-4322-9A47-DAEBDA9CC7A7}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>15.0.27924.0</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(Configuration)\$(Platform)\$(ProjectName)\</OutDir>
<IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(Configuration)\$(Platform)\$(ProjectName)\</OutDir>
<IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(Configuration)\$(Platform)\$(ProjectName)\</OutDir>
<IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(Configuration)\$(Platform)\$(ProjectName)\</OutDir>
<IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../vcnet;..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(Configuration)\$(Platform)\$(ProductName)\mxmldoc.exe</OutputFile>
<IgnoreSpecificDefaultLibraries>oldnames.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)mxmldoc.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX86</TargetMachine>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>../vcnet;..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(Configuration)\$(Platform)\$(ProductName)\mxmldoc.exe</OutputFile>
<IgnoreSpecificDefaultLibraries>oldnames.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX86</TargetMachine>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../vcnet;..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(Configuration)\$(Platform)\$(ProductName)\mxmldoc.exe</OutputFile>
<IgnoreSpecificDefaultLibraries>oldnames.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)mxmldoc.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX64</TargetMachine>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>../vcnet;..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(Configuration)\$(Platform)\$(ProductName)\mxmldoc.exe</OutputFile>
<IgnoreSpecificDefaultLibraries>oldnames.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX64</TargetMachine>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\mmd.c" />
<ClCompile Include="..\mxmldoc.c" />
<ClCompile Include="..\zipc.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\mmd.h" />
<ClInclude Include="..\zipc.h" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="mxml1.vcxproj">
<Project>{e5aa9476-9751-4654-8109-b1a2112d5e73}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="packages\zlib-msvc14-x64.1.2.11.7795\build\native\zlib-msvc14-x64.targets" Condition="Exists('packages\zlib-msvc14-x64.1.2.11.7795\build\native\zlib-msvc14-x64.targets')" />
<Import Project="packages\zlib-msvc14-x86.1.2.11.7795\build\native\zlib-msvc14-x86.targets" Condition="Exists('packages\zlib-msvc14-x86.1.2.11.7795\build\native\zlib-msvc14-x86.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('packages\zlib-msvc14-x64.1.2.11.7795\build\native\zlib-msvc14-x64.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\zlib-msvc14-x64.1.2.11.7795\build\native\zlib-msvc14-x64.targets'))" />
<Error Condition="!Exists('packages\zlib-msvc14-x86.1.2.11.7795\build\native\zlib-msvc14-x86.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\zlib-msvc14-x86.1.2.11.7795\build\native\zlib-msvc14-x86.targets'))" />
</Target>
</Project>

View File

@ -1,39 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\mxmldoc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\mmd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\zipc.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\mmd.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\zipc.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project>

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>

View File

@ -14,7 +14,6 @@
);
dependencies = (
272C00491E8C6B61007EBCAC /* PBXTargetDependency */,
272C004B1E8C6B61007EBCAC /* PBXTargetDependency */,
272C004D1E8C6B61007EBCAC /* PBXTargetDependency */,
);
name = All;
@ -23,7 +22,6 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
271227FF1EAADBE200167F24 /* mmd.c in Sources */ = {isa = PBXBuildFile; fileRef = 271227FD1EAADBE200167F24 /* mmd.c */; };
272C00191E8C66C8007EBCAC /* mxml-attr.c in Sources */ = {isa = PBXBuildFile; fileRef = 272C000D1E8C66C8007EBCAC /* mxml-attr.c */; };
272C001A1E8C66C8007EBCAC /* mxml-entity.c in Sources */ = {isa = PBXBuildFile; fileRef = 272C000E1E8C66C8007EBCAC /* mxml-entity.c */; };
272C001B1E8C66C8007EBCAC /* mxml-file.c in Sources */ = {isa = PBXBuildFile; fileRef = 272C000F1E8C66C8007EBCAC /* mxml-file.c */; };
@ -38,11 +36,7 @@
272C00241E8C66C8007EBCAC /* mxml.h in Headers */ = {isa = PBXBuildFile; fileRef = 272C00181E8C66C8007EBCAC /* mxml.h */; settings = {ATTRIBUTES = (Public, ); }; };
272C00261E8C66CF007EBCAC /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 272C00251E8C66CF007EBCAC /* config.h */; };
272C00421E8C6B30007EBCAC /* testmxml.c in Sources */ = {isa = PBXBuildFile; fileRef = 272C00401E8C6B1B007EBCAC /* testmxml.c */; };
272C00431E8C6B34007EBCAC /* mxmldoc.c in Sources */ = {isa = PBXBuildFile; fileRef = 272C00331E8C6ADE007EBCAC /* mxmldoc.c */; };
272C00501E8C6B89007EBCAC /* libmxml.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 272C00051E8C6664007EBCAC /* libmxml.a */; };
272C00511E8C6B8E007EBCAC /* libmxml.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 272C00051E8C6664007EBCAC /* libmxml.a */; };
272C00591E943266007EBCAC /* zipc.c in Sources */ = {isa = PBXBuildFile; fileRef = 272C00571E943266007EBCAC /* zipc.c */; };
272C005B1E943423007EBCAC /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 272C005A1E943423007EBCAC /* libz.tbd */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -53,13 +47,6 @@
remoteGlobalIDString = 272C00041E8C6664007EBCAC;
remoteInfo = libmxml;
};
272C004A1E8C6B61007EBCAC /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 272CFFFD1E8C6664007EBCAC /* Project object */;
proxyType = 1;
remoteGlobalIDString = 272C002A1E8C6A94007EBCAC;
remoteInfo = mxmldoc;
};
272C004C1E8C6B61007EBCAC /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 272CFFFD1E8C6664007EBCAC /* Project object */;
@ -74,25 +61,9 @@
remoteGlobalIDString = 272C00041E8C6664007EBCAC;
remoteInfo = libmxml;
};
272C00521E8C6B91007EBCAC /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 272CFFFD1E8C6664007EBCAC /* Project object */;
proxyType = 1;
remoteGlobalIDString = 272C00041E8C6664007EBCAC;
remoteInfo = libmxml;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
272C00291E8C6A94007EBCAC /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
272C00371E8C6AEB007EBCAC /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
@ -105,8 +76,6 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
271227FD1EAADBE200167F24 /* mmd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mmd.c; path = ../mmd.c; sourceTree = "<group>"; };
271227FE1EAADBE200167F24 /* mmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mmd.h; path = ../mmd.h; sourceTree = "<group>"; };
272C00051E8C6664007EBCAC /* libmxml.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libmxml.a; sourceTree = BUILT_PRODUCTS_DIR; };
272C000D1E8C66C8007EBCAC /* mxml-attr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "mxml-attr.c"; path = "../mxml-attr.c"; sourceTree = "<group>"; };
272C000E1E8C66C8007EBCAC /* mxml-entity.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "mxml-entity.c"; path = "../mxml-entity.c"; sourceTree = "<group>"; };
@ -121,13 +90,9 @@
272C00171E8C66C8007EBCAC /* mxml-string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "mxml-string.c"; path = "../mxml-string.c"; sourceTree = "<group>"; };
272C00181E8C66C8007EBCAC /* mxml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mxml.h; path = ../mxml.h; sourceTree = "<group>"; };
272C00251E8C66CF007EBCAC /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
272C002B1E8C6A94007EBCAC /* mxmldoc */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = mxmldoc; sourceTree = BUILT_PRODUCTS_DIR; };
272C00331E8C6ADE007EBCAC /* mxmldoc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mxmldoc.c; path = ../mxmldoc.c; sourceTree = "<group>"; };
272C00391E8C6AEB007EBCAC /* testmxml */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testmxml; sourceTree = BUILT_PRODUCTS_DIR; };
272C00401E8C6B1B007EBCAC /* testmxml.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testmxml.c; path = ../testmxml.c; sourceTree = "<group>"; };
272C00551E8EF972007EBCAC /* libarchive.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libarchive.tbd; path = usr/lib/libarchive.tbd; sourceTree = SDKROOT; };
272C00571E943266007EBCAC /* zipc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zipc.c; path = ../zipc.c; sourceTree = "<group>"; };
272C00581E943266007EBCAC /* zipc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = zipc.h; path = ../zipc.h; sourceTree = "<group>"; };
272C005A1E943423007EBCAC /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
/* End PBXFileReference section */
@ -139,15 +104,6 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
272C00281E8C6A94007EBCAC /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
272C005B1E943423007EBCAC /* libz.tbd in Frameworks */,
272C00511E8C6B8E007EBCAC /* libmxml.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
272C00361E8C6AEB007EBCAC /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@ -163,7 +119,6 @@
isa = PBXGroup;
children = (
272C00051E8C6664007EBCAC /* libmxml.a */,
272C002B1E8C6A94007EBCAC /* mxmldoc */,
272C00391E8C6AEB007EBCAC /* testmxml */,
);
name = Products;
@ -192,12 +147,7 @@
272C00321E8C6ABB007EBCAC /* tools */ = {
isa = PBXGroup;
children = (
271227FD1EAADBE200167F24 /* mmd.c */,
271227FE1EAADBE200167F24 /* mmd.h */,
272C00331E8C6ADE007EBCAC /* mxmldoc.c */,
272C00401E8C6B1B007EBCAC /* testmxml.c */,
272C00571E943266007EBCAC /* zipc.c */,
272C00581E943266007EBCAC /* zipc.h */,
);
name = tools;
sourceTree = "<group>";
@ -254,24 +204,6 @@
productReference = 272C00051E8C6664007EBCAC /* libmxml.a */;
productType = "com.apple.product-type.library.static";
};
272C002A1E8C6A94007EBCAC /* mxmldoc */ = {
isa = PBXNativeTarget;
buildConfigurationList = 272C00311E8C6A94007EBCAC /* Build configuration list for PBXNativeTarget "mxmldoc" */;
buildPhases = (
272C00271E8C6A94007EBCAC /* Sources */,
272C00281E8C6A94007EBCAC /* Frameworks */,
272C00291E8C6A94007EBCAC /* CopyFiles */,
);
buildRules = (
);
dependencies = (
272C00531E8C6B91007EBCAC /* PBXTargetDependency */,
);
name = mxmldoc;
productName = mxmldoc;
productReference = 272C002B1E8C6A94007EBCAC /* mxmldoc */;
productType = "com.apple.product-type.tool";
};
272C00381E8C6AEB007EBCAC /* testmxml */ = {
isa = PBXNativeTarget;
buildConfigurationList = 272C003D1E8C6AEB007EBCAC /* Build configuration list for PBXNativeTarget "testmxml" */;
@ -304,11 +236,6 @@
DevelopmentTeam = RU58A2256H;
ProvisioningStyle = Automatic;
};
272C002A1E8C6A94007EBCAC = {
CreatedOnToolsVersion = 8.3;
DevelopmentTeam = RU58A2256H;
ProvisioningStyle = Automatic;
};
272C00381E8C6AEB007EBCAC = {
CreatedOnToolsVersion = 8.3;
DevelopmentTeam = RU58A2256H;
@ -335,7 +262,6 @@
targets = (
272C00441E8C6B5A007EBCAC /* All */,
272C00041E8C6664007EBCAC /* libmxml */,
272C002A1E8C6A94007EBCAC /* mxmldoc */,
272C00381E8C6AEB007EBCAC /* testmxml */,
);
};
@ -359,16 +285,6 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
272C00271E8C6A94007EBCAC /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
271227FF1EAADBE200167F24 /* mmd.c in Sources */,
272C00431E8C6B34007EBCAC /* mxmldoc.c in Sources */,
272C00591E943266007EBCAC /* zipc.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
272C00351E8C6AEB007EBCAC /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@ -385,11 +301,6 @@
target = 272C00041E8C6664007EBCAC /* libmxml */;
targetProxy = 272C00481E8C6B61007EBCAC /* PBXContainerItemProxy */;
};
272C004B1E8C6B61007EBCAC /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 272C002A1E8C6A94007EBCAC /* mxmldoc */;
targetProxy = 272C004A1E8C6B61007EBCAC /* PBXContainerItemProxy */;
};
272C004D1E8C6B61007EBCAC /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 272C00381E8C6AEB007EBCAC /* testmxml */;
@ -400,11 +311,6 @@
target = 272C00041E8C6664007EBCAC /* libmxml */;
targetProxy = 272C004E1E8C6B83007EBCAC /* PBXContainerItemProxy */;
};
272C00531E8C6B91007EBCAC /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 272C00041E8C6664007EBCAC /* libmxml */;
targetProxy = 272C00521E8C6B91007EBCAC /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
@ -527,24 +433,6 @@
};
name = Release;
};
272C002F1E8C6A94007EBCAC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = RU58A2256H;
MACOSX_DEPLOYMENT_TARGET = 10.12;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
272C00301E8C6A94007EBCAC /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = RU58A2256H;
MACOSX_DEPLOYMENT_TARGET = 10.12;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
272C003E1E8C6AEB007EBCAC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -600,15 +488,6 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
272C00311E8C6A94007EBCAC /* Build configuration list for PBXNativeTarget "mxmldoc" */ = {
isa = XCConfigurationList;
buildConfigurations = (
272C002F1E8C6A94007EBCAC /* Debug */,
272C00301E8C6A94007EBCAC /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
272C003D1E8C6AEB007EBCAC /* Build configuration list for PBXNativeTarget "testmxml" */ = {
isa = XCConfigurationList;
buildConfigurations = (

1891
zipc.c

File diff suppressed because it is too large Load Diff

91
zipc.h
View File

@ -1,91 +0,0 @@
/*
* Header file for ZIP container mini-library.
*
* https://github.com/michaelrsweet/zipc
*
* Copyright 2017 by Michael R Sweet.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ZIPC_H
# define ZIPC_H
/*
* Include necessary headers...
*/
# include <stdlib.h>
# include <sys/types.h>
/*
* Types...
*/
# ifdef WIN32
typedef long ssize_t;
# endif /* WIN32 */
typedef struct _zipc_s zipc_t; /* ZIP container */
typedef struct _zipc_file_s zipc_file_t;/* File/directory in ZIP container */
/*
* Functions...
*/
# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
extern int zipcClose(zipc_t *zc);
extern int zipcCopyFile(zipc_t *zc, const char *dstname, const char *srcname, int text, int compressed);
extern int zipcCreateDirectory(zipc_t *zc, const char *filename);
extern zipc_file_t *zipcCreateFile(zipc_t *zc, const char *filename, int compressed);
extern int zipcCreateFileWithString(zipc_t *zc, const char *filename, const char *contents);
extern const char *zipcError(zipc_t *zc);
extern int zipcFileFinish(zipc_file_t *zf);
extern int zipcFileGets(zipc_file_t *zf, char *line, size_t linesize);
extern int zipcFilePrintf(zipc_file_t *zf, const char *format, ...)
# ifdef __GNUC__
__attribute__ ((__format__ (__printf__, 2, 3)))
# endif /* __GNUC__ */
;
extern int zipcFilePuts(zipc_file_t *zf, const char *s);
extern ssize_t zipcFileRead(zipc_file_t *zf, void *data, size_t bytes);
extern int zipcFileWrite(zipc_file_t *zf, const void *data, size_t bytes);
extern int zipcFileXMLGets(zipc_file_t *zf, char *fragment, size_t fragsize);
extern int zipcFileXMLPrintf(zipc_file_t *zf, const char *format, ...)
# ifdef __GNUC__
__attribute__ ((__format__ (__printf__, 2, 3)))
# endif /* __GNUC__ */
;
extern zipc_t *zipcOpen(const char *filename, const char *mode);
extern zipc_file_t *zipcOpenFile(zipc_t *zc, const char *filename);
extern const char *zipcXMLGetAttribute(const char *element, const char *attrname, char *buffer, size_t bufsize);
# ifdef __cplusplus
}
# endif /* __cplusplus */
#endif /* !ZIPC_H */