]> granicus.if.org Git - libexpat/commitdiff
All sample code is now located in the "examples" directory.
authorFred L. Drake, Jr. <fdrake@users.sourceforge.net>
Thu, 26 Jul 2001 21:55:33 +0000 (21:55 +0000)
committerFred L. Drake, Jr. <fdrake@users.sourceforge.net>
Thu, 26 Jul 2001 21:55:33 +0000 (21:55 +0000)
expat/sample/.gitignore [deleted file]
expat/sample/Makefile.in [deleted file]
expat/sample/build.bat [deleted file]
expat/sample/elements.c [deleted file]

diff --git a/expat/sample/.gitignore b/expat/sample/.gitignore
deleted file mode 100644 (file)
index 2a8e76d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-elements
diff --git a/expat/sample/Makefile.in b/expat/sample/Makefile.in
deleted file mode 100644 (file)
index 88ab0df..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-################################################################
-# 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
diff --git a/expat/sample/build.bat b/expat/sample/build.bat
deleted file mode 100755 (executable)
index 836f453..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-@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
diff --git a/expat/sample/elements.c b/expat/sample/elements.c
deleted file mode 100755 (executable)
index 9a20c34..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/* 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;
-}