Commit 54428c28 authored by Michael R Sweet's avatar Michael R Sweet

Add strdup emulation as needed.

Bump version to 1.1.
parent 95fc4e37
README - 06/18/2003
README - 07/20/2003
-------------------
CHANGES IN Mini-XML 1.0.1
CHANGES IN Mini-XML 1.1
- The mxmlLoadFile() function now uses dynamically
allocated string buffers for element names, attribute
......@@ -9,6 +9,8 @@ CHANGES IN Mini-XML 1.0.1
capped at 16383, 255, and 255 bytes, respectively.
- Added a new mxmlLoadString() function for loading an
XML node tree from a string.
- Add emulation of strdup() if the local platform does
not provide the function.
CHANGES IN Mini-XML 1.0
......
#
# "$Id: Makefile.in,v 1.9 2003/07/20 13:19:08 mike Exp $"
# "$Id: Makefile.in,v 1.10 2003/07/20 13:41:17 mike Exp $"
#
# Makefile for mini-XML, a small XML-like file parsing library.
#
......@@ -75,7 +75,8 @@ MAN3EXT = @MAN3EXT@
#
DOCFILES = documentation.html README COPYING CHANGES
LIBOBJS = mxml-attr.o mxml-file.o mxml-node.o mxml-search.o
LIBOBJS = mxml-attr.o mxml-file.o mxml-node.o mxml-search.o \
mxml-string.o
OBJS = mxmldoc.o testmxml.o $(LIBOBJS)
TARGETS = libmxml.a mxmldoc mxml.$(CAT3EXT) mxmldoc.$(CAT1EXT) \
testmxml mxml.xml
......@@ -213,9 +214,9 @@ mxml.xml: mxmldoc mxml.h $(LIBOBJS:.o=.c)
# All object files depend on the makefile...
#
$(OBJS): Makefile
$(OBJS): Makefile config.h
#
# End of "$Id: Makefile.in,v 1.9 2003/07/20 13:19:08 mike Exp $".
# End of "$Id: Makefile.in,v 1.10 2003/07/20 13:41:17 mike Exp $".
#
README - 06/14/2003
README - 07/20/2003
-------------------
INTRODUCTION
This README file describes the Mini-XML library version
1.0.1.
1.1.
Mini-XML is a small XML parsing library that you can use to
read XML and XML-like data files in your application without
......
/*
* "$Id: config.h.in,v 1.1 2003/07/20 13:41:17 mike Exp $"
*
* Configuration file for mini-XML, a small XML-like file parsing library.
*
* Copyright 2003 by Michael Sweet.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
/*
* Do we have the strXXX() functions?
*/
#undef HAVE_STRDUP
#undef HAVE_STRLCAT
#undef HAVE_STRLCPY
/*
* Define prototypes for string functions as needed...
*/
# ifndef HAVE_STRDUP
extern char *mxml_strdup(const char *);
# define strdup mxml_strdup
# endif /* !HAVE_STRDUP */
/*
* End of "$Id: config.h.in,v 1.1 2003/07/20 13:41:17 mike Exp $".
*/
This diff is collapsed.
dnl
dnl "$Id: configure.in,v 1.5 2003/06/15 01:37:32 mike Exp $"
dnl "$Id: configure.in,v 1.6 2003/07/20 13:41:17 mike Exp $"
dnl
dnl Configuration script for mini-XML, a small XML-like file parsing library.
dnl
......@@ -16,11 +16,14 @@ dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl Specify a source file from the distribution...
AC_INIT(mxml.h)
dnl Set the name of the config header file...
AC_CONFIG_HEADER(config.h)
dnl Clear default debugging options and set normal optimization by
dnl default unless the user asks for debugging specifically.
CFLAGS="${CFLAGS:=}"
CXXFLAGS="${CXXFLAGS:=}"
LDFLAGS="${LDFLAGS:=}"
......@@ -41,6 +44,13 @@ AC_ARG_WITH(docdir, [ --with-docdir set directory for documentation],
AC_SUBST(docdir)
dnl Get the operating system and version number...
uname=`uname`
uversion=`uname -r | sed -e '1,$s/[[^0-9]]//g'`
if test x$uname = xIRIX64; then
uname="IRIX"
fi
dnl Checks for programs...
AC_PROG_CC
AC_PROG_CXX
......@@ -60,7 +70,7 @@ fi
AC_PATH_PROG(RM,rm)
dnl Flags for "ar" command...
case "`uname`" in
case "$uname" in
Darwin* | *BSD*)
ARFLAGS="-rcv"
;;
......@@ -71,6 +81,9 @@ esac
AC_SUBST(ARFLAGS)
dnl Checks for string functions.
AC_CHECK_FUNCS(strdup strlcat strlcpy)
dnl Add -Wall for GCC...
if test -n "$GCC"; then
CFLAGS="-Wall $CFLAGS"
......@@ -93,7 +106,7 @@ fi
dnl Fix "mandir" variable if it hasn't been specified...
if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/usr"; then
case "`uname`" in
case "$uname" in
*BSD* | Darwin* | Linux*)
# BSD, Darwin (MacOS X), and Linux
mandir="/usr/share/man"
......@@ -110,7 +123,7 @@ if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/usr"; then
fi
dnl More manpage stuff...
case "`uname`" in
case "$uname" in
*BSD* | Darwin*)
# *BSD
CAT1EXT="0"
......@@ -136,5 +149,5 @@ dnl Output the makefile, etc...
AC_OUTPUT(Makefile mxml.list)
dnl
dnl End of "$Id: configure.in,v 1.5 2003/06/15 01:37:32 mike Exp $".
dnl End of "$Id: configure.in,v 1.6 2003/07/20 13:41:17 mike Exp $".
dnl
......@@ -53,6 +53,7 @@
<li><a href="#mxmlSaveString"><tt>mxmlSaveString()</tt></a></li>
<li><a href="#mxmlWalkNext"><tt>mxmlWalkNext()</tt></a></li>
<li><a href="#mxmlWalkPrev"><tt>mxmlWalkPrev()</tt></a></li>
<li><a href="#mxml_strdup"><tt>mxml_strdup()</tt></a></li>
</ul>
<hr noshade/>
<h2><a name="mxmlAdd">mxmlAdd()</a></h2>
......@@ -488,6 +489,23 @@ mxmlWalkPrev(
</tbody></table></p>
<h3>Returns</h3>
<p>Previous node or NULL</p>
<hr noshade/>
<h2><a name="mxml_strdup">mxml_strdup()</a></h2>
<p>Duplicate a string.</p>
<h3>Syntax</h3>
<pre>
char *
mxml_strdup(
const char * s);
</pre>
<h3>Arguments</h3>
<p class="table"><table align="center" border="1" width="80%">
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>s</tt></td><td>String to duplicate</td></tr>
</tbody></table></p>
<h3>Returns</h3>
<p>New string pointer</p>
<h1><a name="_structures">Structures</a></h1>
<ul>
<li><a href="#mxml_attr_s"><tt>mxml_attr_s</tt></a></li>
......
......@@ -16,11 +16,11 @@ href="../index.html">Back to Home Page</a>&nbsp;]</p>
<h1 class="title" align="center">Mini-XML Home Page</h1>
<p class="title" align="center">Current Release: v1.0.1, June 15, 2003<br/>
<p class="title" align="center">Current Release: v1.1, July 20, 2003<br/>
[&nbsp;<a
href="mxml-1.0.1.tar.gz">Download&nbsp;Source&nbsp;(.tar.gz&nbsp;64k)</a>
href="mxml-1.1.tar.gz">Download&nbsp;Source&nbsp;(.tar.gz&nbsp;64k)</a>
| <a
href="mxml-1.0.1-1.i386.rpm">Download&nbsp;Linux&nbsp;RPM&nbsp;(.i386.rpm&nbsp;42k)</a>
href="mxml-1.1-1.i386.rpm">Download&nbsp;Linux&nbsp;RPM&nbsp;(.i386.rpm&nbsp;42k)</a>
| <a href="CHANGES">Change&nbsp;Log</a> | <a
href="documentation.html">Documentation</a> | <a
href="http://freshmeat.net/projects/mxml">Rate/Make&nbsp;Comments</A>&nbsp;]</p>
......
/*
* "$Id: mxml-attr.c,v 1.2 2003/06/14 23:56:47 mike Exp $"
* "$Id: mxml-attr.c,v 1.3 2003/07/20 13:41:17 mike Exp $"
*
* Attribute support code for mini-XML, a small XML-like file parsing library.
*
......@@ -26,6 +26,7 @@
*/
#include "mxml.h"
#include "config.h"
/*
......@@ -155,5 +156,5 @@ mxmlElementSetAttr(mxml_node_t *node, /* I - Element node */
/*
* End of "$Id: mxml-attr.c,v 1.2 2003/06/14 23:56:47 mike Exp $".
* End of "$Id: mxml-attr.c,v 1.3 2003/07/20 13:41:17 mike Exp $".
*/
/*
* "$Id: mxml-file.c,v 1.14 2003/07/20 13:19:08 mike Exp $"
* "$Id: mxml-file.c,v 1.15 2003/07/20 13:41:17 mike Exp $"
*
* File loading code for mini-XML, a small XML-like file parsing library.
*
......@@ -36,6 +36,7 @@
*/
#include "mxml.h"
#include "config.h"
/*
......@@ -1372,5 +1373,5 @@ mxml_write_ws(mxml_node_t *node, /* I - Current node */
/*
* End of "$Id: mxml-file.c,v 1.14 2003/07/20 13:19:08 mike Exp $".
* End of "$Id: mxml-file.c,v 1.15 2003/07/20 13:41:17 mike Exp $".
*/
/*
* "$Id: mxml-node.c,v 1.5 2003/06/14 23:56:47 mike Exp $"
* "$Id: mxml-node.c,v 1.6 2003/07/20 13:41:17 mike Exp $"
*
* Node support code for mini-XML, a small XML-like file parsing library.
*
......@@ -33,6 +33,7 @@
*/
#include "mxml.h"
#include "config.h"
/*
......@@ -489,5 +490,5 @@ mxml_new(mxml_node_t *parent, /* I - Parent node */
/*
* End of "$Id: mxml-node.c,v 1.5 2003/06/14 23:56:47 mike Exp $".
* End of "$Id: mxml-node.c,v 1.6 2003/07/20 13:41:17 mike Exp $".
*/
/*
* "$Id: mxml-search.c,v 1.6 2003/06/14 23:56:47 mike Exp $"
* "$Id: mxml-search.c,v 1.7 2003/07/20 13:41:17 mike Exp $"
*
* Search/navigation functions for mini-XML, a small XML-like file
* parsing library.
......@@ -28,6 +28,7 @@
*/
#include "mxml.h"
#include "config.h"
/*
......@@ -194,5 +195,5 @@ mxmlWalkPrev(mxml_node_t *node, /* I - Current node */
/*
* End of "$Id: mxml-search.c,v 1.6 2003/06/14 23:56:47 mike Exp $".
* End of "$Id: mxml-search.c,v 1.7 2003/07/20 13:41:17 mike Exp $".
*/
/*
* "$Id: mxml-string.c,v 1.1 2003/07/20 13:41:17 mike Exp $"
*
* String functions for mini-XML, a small XML-like file parsing library.
*
* Copyright 2003 by Michael Sweet.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Contents:
*
* mxml_strdup() - Duplicate a string.
*/
/*
* Include necessary headers...
*/
#include "config.h"
/*
* 'mxml_strdup()' - Duplicate a string.
*/
#ifndef HAVE_STRDUP
char * /* O - New string pointer */
mxml_strdup(const char *s) /* I - String to duplicate */
{
char *t; /* New string pointer */
if (s == NULL)
return (NULL);
if ((t = malloc(strlen(s) + 1)) == NULL)
return (NULL);
return (strcpy(t, s));
}
#endif /* !HAVE_STRDUP */
/*
* End of "$Id: mxml-string.c,v 1.1 2003/07/20 13:41:17 mike Exp $".
*/
......@@ -207,6 +207,11 @@ name="child"><type>mxml_node_t *</type><description>First child node</descriptio
<variable name="value"><type>mxml_value_t</type><description>Node value</description></variable>
</struct>
<typedef name="mxml_node_t"><type>struct mxml_node_s</type><description>An XML node.</description><description>An XML node.</description></typedef>
<function name="mxml_strdup"><returnvalue><description>New string pointer</description><type>char
*</type></returnvalue>
<description>Duplicate a string.</description><argument name="s"
direction="I"><type>const char *</type><description>String to duplicate</description></argument>
</function>
<struct name="mxml_text_s"><description>An XML text value.</description><variable
name="string"><type>char *</type><description>Fragment string</description></variable>
<variable name="whitespace"><type>int</type><description>Leading whitespace?</description></variable>
......
/*
* "$Id: mxmldoc.c,v 1.12 2003/06/14 23:56:47 mike Exp $"
* "$Id: mxmldoc.c,v 1.13 2003/07/20 13:41:17 mike Exp $"
*
* Documentation generator using mini-XML, a small XML-like file parsing
* library.
......@@ -35,6 +35,7 @@
*/
#include "mxml.h"
#include "config.h"
/*
......@@ -2079,5 +2080,5 @@ ws_cb(mxml_node_t *node, /* I - Element node */
/*
* End of "$Id: mxmldoc.c,v 1.12 2003/06/14 23:56:47 mike Exp $".
* End of "$Id: mxmldoc.c,v 1.13 2003/07/20 13:41:17 mike Exp $".
*/
/*
* "$Id: testmxml.c,v 1.9 2003/06/19 03:20:41 mike Exp $"
* "$Id: testmxml.c,v 1.10 2003/07/20 13:41:17 mike Exp $"
*
* Test program for mini-XML, a small XML-like file parsing library.
*
......@@ -28,6 +28,7 @@
*/
#include "mxml.h"
#include "config.h"
/*
......@@ -383,5 +384,5 @@ whitespace_cb(mxml_node_t *node, /* I - Element node */
/*
* End of "$Id: testmxml.c,v 1.9 2003/06/19 03:20:41 mike Exp $".
* End of "$Id: testmxml.c,v 1.10 2003/07/20 13:41:17 mike Exp $".
*/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment