From d09ab089457ae3c20cc98f9afa03379c6ebf9598 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Thu, 25 Mar 2004 06:59:32 +0000 Subject: [svn-inject] Installing original source version --- example/Makefile.am | 10 + example/Makefile.in | 527 ++++++++++++++++++++++++++++++++++++++++++++++++++++ example/gjobread.c | 307 ++++++++++++++++++++++++++++++ example/gjobs.xml | 57 ++++++ 4 files changed, 901 insertions(+) create mode 100644 example/Makefile.am create mode 100644 example/Makefile.in create mode 100644 example/gjobread.c create mode 100644 example/gjobs.xml (limited to 'example') diff --git a/example/Makefile.am b/example/Makefile.am new file mode 100644 index 0000000..0138775 --- /dev/null +++ b/example/Makefile.am @@ -0,0 +1,10 @@ +noinst_PROGRAMS = gjobread + +INCLUDES = \ + -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include -I@srcdir@ + +LDADD = $(top_builddir)/libxml2.la @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) -lm @WIN32_EXTRA_LIBADD@ + + diff --git a/example/Makefile.in b/example/Makefile.in new file mode 100644 index 0000000..19768e3 --- /dev/null +++ b/example/Makefile.in @@ -0,0 +1,527 @@ +# Makefile.in generated by automake 1.8.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SOURCES = gjobread.c + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_triplet = @host@ +noinst_PROGRAMS = gjobread$(EXEEXT) +subdir = example +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +PROGRAMS = $(noinst_PROGRAMS) +gjobread_SOURCES = gjobread.c +gjobread_OBJECTS = gjobread.$(OBJEXT) +gjobread_LDADD = $(LDADD) +am__DEPENDENCIES_1 = +gjobread_DEPENDENCIES = $(top_builddir)/libxml2.la \ + $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/gjobread.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = gjobread.c +DIST_SOURCES = gjobread.c +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +C14N_OBJ = @C14N_OBJ@ +CATALOG_OBJ = @CATALOG_OBJ@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_OBJ = @DEBUG_OBJ@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOCB_OBJ = @DOCB_OBJ@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FTP_OBJ = @FTP_OBJ@ +HAVE_ISINF = @HAVE_ISINF@ +HAVE_ISNAN = @HAVE_ISNAN@ +HTML_DIR = @HTML_DIR@ +HTML_OBJ = @HTML_OBJ@ +HTTP_OBJ = @HTTP_OBJ@ +ICONV_LIBS = @ICONV_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_MAJOR_VERSION = @LIBXML_MAJOR_VERSION@ +LIBXML_MICRO_VERSION = @LIBXML_MICRO_VERSION@ +LIBXML_MINOR_VERSION = @LIBXML_MINOR_VERSION@ +LIBXML_VERSION = @LIBXML_VERSION@ +LIBXML_VERSION_INFO = @LIBXML_VERSION_INFO@ +LIBXML_VERSION_NUMBER = @LIBXML_VERSION_NUMBER@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MV = @MV@ +M_LIBS = @M_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PATTERN_TEST = @PATTERN_TEST@ +PYTHON = @PYTHON@ +PYTHON_INCLUDES = @PYTHON_INCLUDES@ +PYTHON_SITE_PACKAGES = @PYTHON_SITE_PACKAGES@ +PYTHON_SUBDIR = @PYTHON_SUBDIR@ +PYTHON_TESTS = @PYTHON_TESTS@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +RDL_LIBS = @RDL_LIBS@ +READER_TEST = @READER_TEST@ +RELDATE = @RELDATE@ +RM = @RM@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STATIC_BINARIES = @STATIC_BINARIES@ +STRIP = @STRIP@ +TAR = @TAR@ +TEST_C14N = @TEST_C14N@ +TEST_CATALOG = @TEST_CATALOG@ +TEST_DEBUG = @TEST_DEBUG@ +TEST_HTML = @TEST_HTML@ +TEST_PHTML = @TEST_PHTML@ +TEST_PUSH = @TEST_PUSH@ +TEST_REGEXPS = @TEST_REGEXPS@ +TEST_SAX = @TEST_SAX@ +TEST_SCHEMAS = @TEST_SCHEMAS@ +TEST_THREADS = @TEST_THREADS@ +TEST_VALID = @TEST_VALID@ +TEST_VTIME = @TEST_VTIME@ +TEST_XINCLUDE = @TEST_XINCLUDE@ +TEST_XPATH = @TEST_XPATH@ +TEST_XPTR = @TEST_XPTR@ +THREADS_W32 = @THREADS_W32@ +THREAD_CFLAGS = @THREAD_CFLAGS@ +THREAD_LIBS = @THREAD_LIBS@ +U = @U@ +VERSION = @VERSION@ +WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ +WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ +WITH_C14N = @WITH_C14N@ +WITH_CATALOG = @WITH_CATALOG@ +WITH_DEBUG = @WITH_DEBUG@ +WITH_DOCB = @WITH_DOCB@ +WITH_FTP = @WITH_FTP@ +WITH_HTML = @WITH_HTML@ +WITH_HTTP = @WITH_HTTP@ +WITH_ICONV = @WITH_ICONV@ +WITH_ISO8859X = @WITH_ISO8859X@ +WITH_LEGACY = @WITH_LEGACY@ +WITH_MEM_DEBUG = @WITH_MEM_DEBUG@ +WITH_OUTPUT = @WITH_OUTPUT@ +WITH_PATTERN = @WITH_PATTERN@ +WITH_PUSH = @WITH_PUSH@ +WITH_PYTHON_FALSE = @WITH_PYTHON_FALSE@ +WITH_PYTHON_TRUE = @WITH_PYTHON_TRUE@ +WITH_READER = @WITH_READER@ +WITH_REGEXPS = @WITH_REGEXPS@ +WITH_SAX1 = @WITH_SAX1@ +WITH_SCHEMAS = @WITH_SCHEMAS@ +WITH_THREADS = @WITH_THREADS@ +WITH_TREE = @WITH_TREE@ +WITH_TRIO = @WITH_TRIO@ +WITH_TRIO_SOURCES_FALSE = @WITH_TRIO_SOURCES_FALSE@ +WITH_TRIO_SOURCES_TRUE = @WITH_TRIO_SOURCES_TRUE@ +WITH_VALID = @WITH_VALID@ +WITH_WRITER = @WITH_WRITER@ +WITH_XINCLUDE = @WITH_XINCLUDE@ +WITH_XPATH = @WITH_XPATH@ +WITH_XPTR = @WITH_XPTR@ +XINCLUDE_OBJ = @XINCLUDE_OBJ@ +XML_CFLAGS = @XML_CFLAGS@ +XML_INCLUDEDIR = @XML_INCLUDEDIR@ +XML_LIBDIR = @XML_LIBDIR@ +XML_LIBS = @XML_LIBS@ +XML_LIBTOOLLIBS = @XML_LIBTOOLLIBS@ +XPATH_OBJ = @XPATH_OBJ@ +XPTR_OBJ = @XPTR_OBJ@ +Z_CFLAGS = @Z_CFLAGS@ +Z_LIBS = @Z_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_AS = @ac_ct_AS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +INCLUDES = \ + -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include -I@srcdir@ + +LDADD = $(top_builddir)/libxml2.la @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) -lm @WIN32_EXTRA_LIBADD@ +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu example/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu example/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +gjobread$(EXEEXT): $(gjobread_OBJECTS) $(gjobread_DEPENDENCIES) + @rm -f gjobread$(EXEEXT) + $(LINK) $(gjobread_LDFLAGS) $(gjobread_OBJECTS) $(gjobread_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gjobread.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/example/gjobread.c b/example/gjobread.c new file mode 100644 index 0000000..b192bf4 --- /dev/null +++ b/example/gjobread.c @@ -0,0 +1,307 @@ +/* + * gjobread.c : a small test program for gnome jobs XML format + * + * See Copyright for the status of this software. + * + * Daniel.Veillard@w3.org + */ + +#include +#include +#include + +/* + * This example should compile and run indifferently with libxml-1.8.8 + + * and libxml2-2.1.0 + + * Check the COMPAT comments below + */ + +/* + * COMPAT using xml-config --cflags to get the include path this will + * work with both + */ +#include +#include + +#define DEBUG(x) printf(x) + +/* + * A person record + * an xmlChar * is really an UTF8 encoded char string (0 terminated) + */ +typedef struct person { + xmlChar *name; + xmlChar *email; + xmlChar *company; + xmlChar *organisation; + xmlChar *smail; + xmlChar *webPage; + xmlChar *phone; +} person, *personPtr; + +/* + * And the code needed to parse it + */ +static personPtr +parsePerson(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { + personPtr ret = NULL; + +DEBUG("parsePerson\n"); + /* + * allocate the struct + */ + ret = (personPtr) malloc(sizeof(person)); + if (ret == NULL) { + fprintf(stderr,"out of memory\n"); + return(NULL); + } + memset(ret, 0, sizeof(person)); + + /* We don't care what the top level element name is */ + /* COMPAT xmlChildrenNode is a macro unifying libxml1 and libxml2 names */ + cur = cur->xmlChildrenNode; + while (cur != NULL) { + if ((!xmlStrcmp(cur->name, (const xmlChar *)"Person")) && + (cur->ns == ns)) + ret->name = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); + if ((!xmlStrcmp(cur->name, (const xmlChar *)"Email")) && + (cur->ns == ns)) + ret->email = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); + cur = cur->next; + } + + return(ret); +} + +/* + * and to print it + */ +static void +printPerson(personPtr cur) { + if (cur == NULL) return; + printf("------ Person\n"); + if (cur->name) printf(" name: %s\n", cur->name); + if (cur->email) printf(" email: %s\n", cur->email); + if (cur->company) printf(" company: %s\n", cur->company); + if (cur->organisation) printf(" organisation: %s\n", cur->organisation); + if (cur->smail) printf(" smail: %s\n", cur->smail); + if (cur->webPage) printf(" Web: %s\n", cur->webPage); + if (cur->phone) printf(" phone: %s\n", cur->phone); + printf("------\n"); +} + +/* + * a Description for a Job + */ +typedef struct job { + xmlChar *projectID; + xmlChar *application; + xmlChar *category; + personPtr contact; + int nbDevelopers; + personPtr developers[100]; /* using dynamic alloc is left as an exercise */ +} job, *jobPtr; + +/* + * And the code needed to parse it + */ +static jobPtr +parseJob(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { + jobPtr ret = NULL; + +DEBUG("parseJob\n"); + /* + * allocate the struct + */ + ret = (jobPtr) malloc(sizeof(job)); + if (ret == NULL) { + fprintf(stderr,"out of memory\n"); + return(NULL); + } + memset(ret, 0, sizeof(job)); + + /* We don't care what the top level element name is */ + cur = cur->xmlChildrenNode; + while (cur != NULL) { + + if ((!xmlStrcmp(cur->name, (const xmlChar *) "Project")) && + (cur->ns == ns)) { + ret->projectID = xmlGetProp(cur, (const xmlChar *) "ID"); + if (ret->projectID == NULL) { + fprintf(stderr, "Project has no ID\n"); + } + } + if ((!xmlStrcmp(cur->name, (const xmlChar *) "Application")) && + (cur->ns == ns)) + ret->application = + xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); + if ((!xmlStrcmp(cur->name, (const xmlChar *) "Category")) && + (cur->ns == ns)) + ret->category = + xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); + if ((!xmlStrcmp(cur->name, (const xmlChar *) "Contact")) && + (cur->ns == ns)) + ret->contact = parsePerson(doc, ns, cur); + cur = cur->next; + } + + return(ret); +} + +/* + * and to print it + */ +static void +printJob(jobPtr cur) { + int i; + + if (cur == NULL) return; + printf("======= Job\n"); + if (cur->projectID != NULL) printf("projectID: %s\n", cur->projectID); + if (cur->application != NULL) printf("application: %s\n", cur->application); + if (cur->category != NULL) printf("category: %s\n", cur->category); + if (cur->contact != NULL) printPerson(cur->contact); + printf("%d developers\n", cur->nbDevelopers); + + for (i = 0;i < cur->nbDevelopers;i++) printPerson(cur->developers[i]); + printf("======= \n"); +} + +/* + * A pool of Gnome Jobs + */ +typedef struct gjob { + int nbJobs; + jobPtr jobs[500]; /* using dynamic alloc is left as an exercise */ +} gJob, *gJobPtr; + + +static gJobPtr +parseGjobFile(char *filename) { + xmlDocPtr doc; + gJobPtr ret; + jobPtr curjob; + xmlNsPtr ns; + xmlNodePtr cur; + +#ifdef LIBXML_SAX1_ENABLED + /* + * build an XML tree from a the file; + */ + doc = xmlParseFile(filename); + if (doc == NULL) return(NULL); +#else + /* + * the library has been compiled without some of the old interfaces + */ + return(NULL); +#endif /* LIBXML_SAX1_ENABLED */ + + /* + * Check the document is of the right kind + */ + + cur = xmlDocGetRootElement(doc); + if (cur == NULL) { + fprintf(stderr,"empty document\n"); + xmlFreeDoc(doc); + return(NULL); + } + ns = xmlSearchNsByHref(doc, cur, + (const xmlChar *) "http://www.gnome.org/some-location"); + if (ns == NULL) { + fprintf(stderr, + "document of the wrong type, GJob Namespace not found\n"); + xmlFreeDoc(doc); + return(NULL); + } + if (xmlStrcmp(cur->name, (const xmlChar *) "Helping")) { + fprintf(stderr,"document of the wrong type, root node != Helping"); + xmlFreeDoc(doc); + return(NULL); + } + + /* + * Allocate the structure to be returned. + */ + ret = (gJobPtr) malloc(sizeof(gJob)); + if (ret == NULL) { + fprintf(stderr,"out of memory\n"); + xmlFreeDoc(doc); + return(NULL); + } + memset(ret, 0, sizeof(gJob)); + + /* + * Now, walk the tree. + */ + /* First level we expect just Jobs */ + cur = cur->xmlChildrenNode; + while ( cur && xmlIsBlankNode ( cur ) ) + { + cur = cur -> next; + } + if ( cur == 0 ) + return ( NULL ); + if ((xmlStrcmp(cur->name, (const xmlChar *) "Jobs")) || (cur->ns != ns)) { + fprintf(stderr,"document of the wrong type, was '%s', Jobs expected", + cur->name); + fprintf(stderr,"xmlDocDump follows\n"); +#ifdef LIBXML_OUTPUT_ENABLED + xmlDocDump ( stderr, doc ); + fprintf(stderr,"xmlDocDump finished\n"); +#endif /* LIBXML_OUTPUT_ENABLED */ + xmlFreeDoc(doc); + free(ret); + return(NULL); + } + + /* Second level is a list of Job, but be laxist */ + cur = cur->xmlChildrenNode; + while (cur != NULL) { + if ((!xmlStrcmp(cur->name, (const xmlChar *) "Job")) && + (cur->ns == ns)) { + curjob = parseJob(doc, ns, cur); + if (curjob != NULL) + ret->jobs[ret->nbJobs++] = curjob; + if (ret->nbJobs >= 500) break; + } + cur = cur->next; + } + + return(ret); +} + +static void +handleGjob(gJobPtr cur) { + int i; + + /* + * Do whatever you want and free the structure. + */ + printf("%d Jobs registered\n", cur->nbJobs); + for (i = 0; i < cur->nbJobs; i++) printJob(cur->jobs[i]); +} + +int main(int argc, char **argv) { + int i; + gJobPtr cur; + + /* COMPAT: Do not genrate nodes for formatting spaces */ + LIBXML_TEST_VERSION + xmlKeepBlanksDefault(0); + + for (i = 1; i < argc ; i++) { + cur = parseGjobFile(argv[i]); + if ( cur ) + handleGjob(cur); + else + fprintf( stderr, "Error parsing file '%s'\n", argv[i]); + + } + + /* Clean up everything else before quitting. */ + xmlCleanupParser(); + + return(0); +} diff --git a/example/gjobs.xml b/example/gjobs.xml new file mode 100644 index 0000000..8372976 --- /dev/null +++ b/example/gjobs.xml @@ -0,0 +1,57 @@ + + + + + + + GBackup + Development + + + Open + Mon, 07 Jun 1999 20:27:45 -0400 MET DST + USD 0.00 + + + + + + + + + Nathan Clemons + nathan@windsofstorm.net + + + + + + + + + + + + + + The program should be released as free software, under the GPL. + + + + + + + A GNOME based system that will allow a superuser to configure + compressed and uncompressed files and/or file systems to be backed + up with a supported media in the system. This should be able to + perform via find commands generating a list of files that are passed + to tar, dd, cpio, cp, gzip, etc., to be directed to the tape machine + or via operations performed on the filesystem itself. Email + notification and GUI status display very important. + + + + + + + -- cgit v1.2.3