+++ /dev/null
-Makefile
-elements
+++ /dev/null
-################################################################
-# Process this file with top-level configure script to produce Makefile
-#
-# Copyright 2000 Clark Cooper
-#
-# This file is part of EXPAT.
-#
-# EXPAT is free software; you can redistribute it and/or modify it
-# under the terms of the License (based on the MIT/X license) contained
-# in the file COPYING that comes with this distribution.
-#
-# EXPAT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-# SOFTWARE OR THE USE OR OTHER DEALINGS IN EXPAT.
-#
-LIBDIR = ../lib/.libs
-INCDIR = ../lib
-
-LDFLAGS = @LDFLAGS@ -static
-LIBS = -L$(LIBDIR) -lexpat
-CC = @CC@
-CFLAGS = @CFLAGS@ -I$(INCDIR)
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-
-
-all: elements
-
-elements: elements.o
- $(CC) -o elements elements.o $(LDFLAGS) $(LIBS)
-
-check: $(SUBDIRS)
- @echo
- @echo This package does not yet have a regression test.
- @echo
-
-clean:
- rm -f elements core *.o
-
-distclean: clean
- rm -r Makefile
-
-maintainer-clean: distclean
+++ /dev/null
-@echo off
-set LIB=..\xmlparse\Release;..\lib;%LIB%
-cl /nologo /DXMLTOKAPI=__declspec(dllimport) /DXMLPARSEAPI=__declspec(dllimport) /I..\xmlparse /Fe..\bin\elements elements.c xmlparse.lib
-@echo Run it using: ..\bin\elements ^<..\expat.html
+++ /dev/null
-/* This is simple demonstration of how to use expat. This program
-reads an XML document from standard input and writes a line with the
-name of each element to standard output indenting child elements by
-one tab stop more than their parent element. */
-
-#include <stdio.h>
-#include "expat.h"
-
-static void
-startElement(void *userData, const char *name, const char **atts)
-{
- int i;
- int *depthPtr = userData;
- for (i = 0; i < *depthPtr; i++)
- putchar('\t');
- puts(name);
- *depthPtr += 1;
-}
-
-static void
-endElement(void *userData, const char *name)
-{
- int *depthPtr = userData;
- *depthPtr -= 1;
-}
-
-int
-main(int argc, char *argv[])
-{
- char buf[BUFSIZ];
- XML_Parser parser = XML_ParserCreate(NULL);
- int done;
- int depth = 0;
- XML_SetUserData(parser, &depth);
- XML_SetElementHandler(parser, startElement, endElement);
- do {
- size_t len = fread(buf, 1, sizeof(buf), stdin);
- done = len < sizeof(buf);
- if (!XML_Parse(parser, buf, len, done)) {
- fprintf(stderr,
- "%s at line %d\n",
- XML_ErrorString(XML_GetErrorCode(parser)),
- XML_GetCurrentLineNumber(parser));
- return 1;
- }
- } while (!done);
- XML_ParserFree(parser);
- return 0;
-}