You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2005/08/03 10:45:39 UTC

cvs commit: ws-axis/c/src/guththila Array.hpp Attribute.hpp Buffer.hpp Depth.hpp FileInputStream.hpp InputStream.hpp Namespace.hpp Token.hpp XmlPullParser.hpp XmlPullParserException.hpp history.xml unicode.hpp FileInputStream.cpp Makefile.am Makefile.in XmlPullParser.cpp unicode.cpp

samisa      2005/08/03 01:45:38

  Modified:    c/src/guththila FileInputStream.cpp Makefile.am Makefile.in
                        XmlPullParser.cpp unicode.cpp
  Added:       c/src/guththila Array.hpp Attribute.hpp Buffer.hpp Depth.hpp
                        FileInputStream.hpp InputStream.hpp Namespace.hpp
                        Token.hpp XmlPullParser.hpp
                        XmlPullParserException.hpp history.xml unicode.hpp
  Log:
  Added the latest modified files
  
  Revision  Changes    Path
  1.2       +41 -41    ws-axis/c/src/guththila/FileInputStream.cpp
  
  Index: FileInputStream.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/guththila/FileInputStream.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FileInputStream.cpp	27 Jul 2005 11:06:54 -0000	1.1
  +++ FileInputStream.cpp	3 Aug 2005 08:45:38 -0000	1.2
  @@ -1,41 +1,41 @@
  -/*
  - *   Copyright 2003-2004 The Apache Software Foundation.
  - *
  - *   Licensed under the Apache License, Version 2.0 (the "License");
  - *   you may not use this file except in compliance with the License.
  - *   You may obtain a copy of the License at
  - *
  - *       http://www.apache.org/licenses/LICENSE-2.0
  - *
  - *   Unless required by applicable law or agreed to in writing, software
  - *   distributed under the License is distributed on an "AS IS" BASIS,
  - *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  - *   See the License for the specific language governing permissions and
  - *   limitations under the License.
  - *
  - * @author Dasarath Weerathunga (dasarath@opensource.lk)
  - *
  - */
  -
  -#include <FileInputStream.hpp>
  -
  -FileInputStream::FileInputStream (FILE * s)
  -{
  -  this->s = s;
  -  if (!s)
  -    throw new XmlPullParserException ();
  -}
  -
  -
  -
  -FileInputStream::~FileInputStream ()
  -{
  -  fclose (s);
  -}
  -
  -
  -int
  -FileInputStream::read (char *buffer, int offset, int length)
  -{
  -  return fread (buffer + offset, 1, length, s);
  -}
  +/*
  + *   Copyright 2003-2004 The Apache Software Foundation.
  + *
  + *   Licensed under the Apache License, Version 2.0 (the "License");
  + *   you may not use this file except in compliance with the License.
  + *   You may obtain a copy of the License at
  + *
  + *       http://www.apache.org/licenses/LICENSE-2.0
  + *
  + *   Unless required by applicable law or agreed to in writing, software
  + *   distributed under the License is distributed on an "AS IS" BASIS,
  + *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + *   See the License for the specific language governing permissions and
  + *   limitations under the License.
  + *
  + * @author Dasarath Weerathunga (dasarath@opensource.lk)
  + *
  + */
  +
  +#include "FileInputStream.hpp"
  +
  +FileInputStream::FileInputStream (FILE * s)
  +{
  +  this->s = s;
  +  if (!s)
  +    throw new XmlPullParserException ();
  +}
  +
  +
  +
  +FileInputStream::~FileInputStream ()
  +{
  +  fclose (s);
  +}
  +
  +
  +int
  +FileInputStream::read (char *buffer, int offset, int length)
  +{
  +  return fread (buffer + offset, 1, length, s);
  +}
  
  
  
  1.2       +26 -26    ws-axis/c/src/guththila/Makefile.am
  
  Index: Makefile.am
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/guththila/Makefile.am,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Makefile.am	27 Jul 2005 11:06:54 -0000	1.1
  +++ Makefile.am	3 Aug 2005 08:45:38 -0000	1.2
  @@ -1,26 +1,26 @@
  -AUTOMAKE_OPTIONS = gnu	
  -if TRUE
  -#bin_PROGRAMS = tspp
  -#tspp_SOURCES = main.cpp XmlPullParser.cpp FileInputStream.cpp unicode.cpp
  -
  -if UNICODE_OUT
  -INCLUDES = -I../include -DUNICODE_OUT -ggdb3
  -else
  -INCLUDES = -I../include -ggdb3
  -endif
  -
  -lib_LTLIBRARIES = libguththila.la
  -libguththila_la_SOURCES = XmlPullParser.cpp FileInputStream.cpp unicode.cpp
  -endif
  -
  -
  -
  -
  -
  -
  -
  -
  -
  -
  -
  -
  +AUTOMAKE_OPTIONS = gnu	
  +if TRUE
  +#bin_PROGRAMS = tspp
  +#tspp_SOURCES = main.cpp XmlPullParser.cpp FileInputStream.cpp unicode.cpp
  +
  +if UNICODE_OUT
  +INCLUDES = -I../include -DUNICODE_OUT -ggdb3
  +else
  +INCLUDES = -I../include -ggdb3
  +endif
  +
  +lib_LTLIBRARIES = libguththila.la
  +libguththila_la_SOURCES = XmlPullParser.cpp FileInputStream.cpp unicode.cpp
  +endif
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  +
  
  
  
  1.2       +396 -396  ws-axis/c/src/guththila/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/guththila/Makefile.in,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Makefile.in	27 Jul 2005 11:06:54 -0000	1.1
  +++ Makefile.in	3 Aug 2005 08:45:38 -0000	1.2
  @@ -1,396 +1,396 @@
  -# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
  -
  -# Copyright (C) 1994, 1995-8, 1999, 2001 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.
  -
  -
  -SHELL = @SHELL@
  -
  -srcdir = @srcdir@
  -top_srcdir = @top_srcdir@
  -VPATH = @srcdir@
  -prefix = @prefix@
  -exec_prefix = @exec_prefix@
  -
  -bindir = @bindir@
  -sbindir = @sbindir@
  -libexecdir = @libexecdir@
  -datadir = @datadir@
  -sysconfdir = @sysconfdir@
  -sharedstatedir = @sharedstatedir@
  -localstatedir = @localstatedir@
  -libdir = @libdir@
  -infodir = @infodir@
  -mandir = @mandir@
  -includedir = @includedir@
  -oldincludedir = /usr/include
  -
  -DESTDIR =
  -
  -pkgdatadir = $(datadir)/@PACKAGE@
  -pkglibdir = $(libdir)/@PACKAGE@
  -pkgincludedir = $(includedir)/@PACKAGE@
  -
  -top_builddir = ..
  -
  -ACLOCAL = @ACLOCAL@
  -AUTOCONF = @AUTOCONF@
  -AUTOMAKE = @AUTOMAKE@
  -AUTOHEADER = @AUTOHEADER@
  -
  -INSTALL = @INSTALL@
  -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
  -INSTALL_DATA = @INSTALL_DATA@
  -INSTALL_SCRIPT = @INSTALL_SCRIPT@
  -transform = @program_transform_name@
  -
  -NORMAL_INSTALL = :
  -PRE_INSTALL = :
  -POST_INSTALL = :
  -NORMAL_UNINSTALL = :
  -PRE_UNINSTALL = :
  -POST_UNINSTALL = :
  -host_alias = @host_alias@
  -host_triplet = @host@
  -AR = @AR@
  -AS = @AS@
  -CC = @CC@
  -CXX = @CXX@
  -CXXCPP = @CXXCPP@
  -DLLTOOL = @DLLTOOL@
  -ECHO = @ECHO@
  -EGREP = @EGREP@
  -EXEEXT = @EXEEXT@
  -F77 = @F77@
  -GCJ = @GCJ@
  -GCJFLAGS = @GCJFLAGS@
  -HAVE_LIB = @HAVE_LIB@
  -LIB = @LIB@
  -LIBTOOL = @LIBTOOL@
  -LN_S = @LN_S@
  -LTLIB = @LTLIB@
  -MAKEINFO = @MAKEINFO@
  -OBJDUMP = @OBJDUMP@
  -OBJEXT = @OBJEXT@
  -PACKAGE = @PACKAGE@
  -RANLIB = @RANLIB@
  -RC = @RC@
  -STRIP = @STRIP@
  -VERSION = @VERSION@
  -
  -AUTOMAKE_OPTIONS = gnu	
  -@TRUE_TRUE@bin_PROGRAMS = tspp
  -@TRUE_TRUE@tspp_SOURCES = main.cpp XmlPullParser.cpp FileInputStream.cpp unicode.cpp
  -@TRUE_TRUE@@UNICODE_OUT_TRUE@INCLUDES = -I../include -DUNICODE_OUT -ggdb3
  -@TRUE_TRUE@@UNICODE_OUT_FALSE@INCLUDES = -I../include -ggdb3
  -
  -@TRUE_TRUE@lib_LTLIBRARIES = libguththila.la
  -@TRUE_TRUE@libguththila_la_SOURCES = XmlPullParser.cpp FileInputStream.cpp unicode.cpp
  -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
  -CONFIG_CLEAN_FILES = 
  -LTLIBRARIES =  $(lib_LTLIBRARIES)
  -
  -
  -DEFS = @DEFS@ -I. -I$(srcdir) 
  -CPPFLAGS = @CPPFLAGS@
  -LDFLAGS = @LDFLAGS@
  -LIBS = @LIBS@
  -libguththila_la_LDFLAGS = 
  -libguththila_la_LIBADD = 
  -@TRUE_TRUE@libguththila_la_OBJECTS =  XmlPullParser.lo \
  -@TRUE_TRUE@FileInputStream.lo unicode.lo
  -@TRUE_TRUE@bin_PROGRAMS =  tspp$(EXEEXT)
  -PROGRAMS =  $(bin_PROGRAMS)
  -
  -@TRUE_TRUE@tspp_OBJECTS =  main.$(OBJEXT) XmlPullParser.$(OBJEXT) \
  -@TRUE_TRUE@FileInputStream.$(OBJEXT) unicode.$(OBJEXT)
  -tspp_LDADD = $(LDADD)
  -tspp_DEPENDENCIES = 
  -tspp_LDFLAGS = 
  -CXXFLAGS = @CXXFLAGS@
  -CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
  -LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
  -CXXLD = $(CXX)
  -CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
  -DIST_COMMON =  Makefile.am Makefile.in
  -
  -
  -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
  -
  -TAR = tar
  -GZIP_ENV = --best
  -SOURCES = $(libguththila_la_SOURCES) $(tspp_SOURCES)
  -OBJECTS = $(libguththila_la_OBJECTS) $(tspp_OBJECTS)
  -
  -all: all-redirect
  -.SUFFIXES:
  -.SUFFIXES: .S .c .cpp .lo .o .obj .s
  -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) 
  -	cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/Makefile
  -
  -Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
  -	cd $(top_builddir) \
  -	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
  -
  -
  -mostlyclean-libLTLIBRARIES:
  -
  -clean-libLTLIBRARIES:
  -	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
  -
  -distclean-libLTLIBRARIES:
  -
  -maintainer-clean-libLTLIBRARIES:
  -
  -install-libLTLIBRARIES: $(lib_LTLIBRARIES)
  -	@$(NORMAL_INSTALL)
  -	$(mkinstalldirs) $(DESTDIR)$(libdir)
  -	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
  -	  if test -f $$p; then \
  -	    echo "$(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \
  -	    $(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
  -	  else :; fi; \
  -	done
  -
  -uninstall-libLTLIBRARIES:
  -	@$(NORMAL_UNINSTALL)
  -	list='$(lib_LTLIBRARIES)'; for p in $$list; do \
  -	  $(LIBTOOL)  --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
  -	done
  -
  -.c.o:
  -	$(COMPILE) -c $<
  -
  -# FIXME: We should only use cygpath when building on Windows,
  -# and only if it is available.
  -.c.obj:
  -	$(COMPILE) -c `cygpath -w $<`
  -
  -.s.o:
  -	$(COMPILE) -c $<
  -
  -.S.o:
  -	$(COMPILE) -c $<
  -
  -mostlyclean-compile:
  -	-rm -f *.o core *.core
  -	-rm -f *.$(OBJEXT)
  -
  -clean-compile:
  -
  -distclean-compile:
  -	-rm -f *.tab.c
  -
  -maintainer-clean-compile:
  -
  -.c.lo:
  -	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
  -
  -.s.lo:
  -	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
  -
  -.S.lo:
  -	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
  -
  -mostlyclean-libtool:
  -	-rm -f *.lo
  -
  -clean-libtool:
  -	-rm -rf .libs _libs
  -
  -distclean-libtool:
  -
  -maintainer-clean-libtool:
  -
  -libguththila.la: $(libguththila_la_OBJECTS) $(libguththila_la_DEPENDENCIES)
  -	$(CXXLINK) -rpath $(libdir) $(libguththila_la_LDFLAGS) $(libguththila_la_OBJECTS) $(libguththila_la_LIBADD) $(LIBS)
  -
  -mostlyclean-binPROGRAMS:
  -
  -clean-binPROGRAMS:
  -	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
  -
  -distclean-binPROGRAMS:
  -
  -maintainer-clean-binPROGRAMS:
  -
  -install-binPROGRAMS: $(bin_PROGRAMS)
  -	@$(NORMAL_INSTALL)
  -	$(mkinstalldirs) $(DESTDIR)$(bindir)
  -	@list='$(bin_PROGRAMS)'; for p in $$list; do \
  -	  if test -f $$p; then \
  -	    echo " $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
  -	    $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
  -	  else :; fi; \
  -	done
  -
  -uninstall-binPROGRAMS:
  -	@$(NORMAL_UNINSTALL)
  -	list='$(bin_PROGRAMS)'; for p in $$list; do \
  -	  rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
  -	done
  -
  -tspp$(EXEEXT): $(tspp_OBJECTS) $(tspp_DEPENDENCIES)
  -	@rm -f tspp$(EXEEXT)
  -	$(CXXLINK) $(tspp_LDFLAGS) $(tspp_OBJECTS) $(tspp_LDADD) $(LIBS)
  -.cpp.o:
  -	$(CXXCOMPILE) -c $<
  -.cpp.obj:
  -	$(CXXCOMPILE) -c `cygpath -w $<`
  -.cpp.lo:
  -	$(LTCXXCOMPILE) -c $<
  -
  -tags: TAGS
  -
  -ID: $(HEADERS) $(SOURCES) $(LISP)
  -	list='$(SOURCES) $(HEADERS)'; \
  -	unique=`for i in $$list; do echo $$i; done | \
  -	  awk '    { files[$$0] = 1; } \
  -	       END { for (i in files) print i; }'`; \
  -	here=`pwd` && cd $(srcdir) \
  -	  && mkid -f$$here/ID $$unique $(LISP)
  -
  -TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) $(LISP)
  -	tags=; \
  -	here=`pwd`; \
  -	list='$(SOURCES) $(HEADERS)'; \
  -	unique=`for i in $$list; do echo $$i; done | \
  -	  awk '    { files[$$0] = 1; } \
  -	       END { for (i in files) print i; }'`; \
  -	test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
  -	  || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags  $$unique $(LISP))
  -
  -mostlyclean-tags:
  -
  -clean-tags:
  -
  -distclean-tags:
  -	-rm -f TAGS ID
  -
  -maintainer-clean-tags:
  -
  -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
  -
  -subdir = src
  -
  -distdir: $(DISTFILES)
  -	@for file in $(DISTFILES); do \
  -	  d=$(srcdir); \
  -	  if test -d $$d/$$file; then \
  -	    cp -pr $$d/$$file $(distdir)/$$file; \
  -	  else \
  -	    test -f $(distdir)/$$file \
  -	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
  -	    || cp -p $$d/$$file $(distdir)/$$file || :; \
  -	  fi; \
  -	done
  -FileInputStream.lo FileInputStream.o : FileInputStream.cpp \
  -	../include/FileInputStream.hpp ../include/InputStream.hpp \
  -	../include/XmlPullParserException.hpp
  -main.o: main.cpp ../include/XmlPullParser.hpp \
  -	../include/XmlPullParserException.hpp \
  -	../include/FileInputStream.hpp ../include/InputStream.hpp \
  -	../include/Array.hpp ../include/Buffer.hpp \
  -	../include/unicode.hpp ../include/Token.hpp \
  -	../include/Namespace.hpp ../include/Attribute.hpp \
  -	../include/Depth.hpp
  -unicode.lo unicode.o : unicode.cpp ../include/unicode.hpp
  -XmlPullParser.lo XmlPullParser.o : XmlPullParser.cpp \
  -	../include/XmlPullParser.hpp \
  -	../include/XmlPullParserException.hpp \
  -	../include/FileInputStream.hpp ../include/InputStream.hpp \
  -	../include/Array.hpp ../include/Buffer.hpp \
  -	../include/unicode.hpp ../include/Token.hpp \
  -	../include/Namespace.hpp ../include/Attribute.hpp \
  -	../include/Depth.hpp
  -
  -info-am:
  -info: info-am
  -dvi-am:
  -dvi: dvi-am
  -check-am: all-am
  -check: check-am
  -installcheck-am:
  -installcheck: installcheck-am
  -install-exec-am: install-libLTLIBRARIES install-binPROGRAMS
  -install-exec: install-exec-am
  -
  -install-data-am:
  -install-data: install-data-am
  -
  -install-am: all-am
  -	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
  -install: install-am
  -uninstall-am: uninstall-libLTLIBRARIES uninstall-binPROGRAMS
  -uninstall: uninstall-am
  -all-am: Makefile $(LTLIBRARIES) $(PROGRAMS)
  -all-redirect: all-am
  -install-strip:
  -	$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
  -installdirs:
  -	$(mkinstalldirs)  $(DESTDIR)$(libdir) $(DESTDIR)$(bindir)
  -
  -
  -mostlyclean-generic:
  -
  -clean-generic:
  -
  -distclean-generic:
  -	-rm -f Makefile $(CONFIG_CLEAN_FILES)
  -	-rm -f config.cache config.log stamp-h stamp-h[0-9]*
  -
  -maintainer-clean-generic:
  -mostlyclean-am:  mostlyclean-libLTLIBRARIES mostlyclean-compile \
  -		mostlyclean-libtool mostlyclean-binPROGRAMS \
  -		mostlyclean-tags mostlyclean-generic
  -
  -mostlyclean: mostlyclean-am
  -
  -clean-am:  clean-libLTLIBRARIES clean-compile clean-libtool \
  -		clean-binPROGRAMS clean-tags clean-generic \
  -		mostlyclean-am
  -
  -clean: clean-am
  -
  -distclean-am:  distclean-libLTLIBRARIES distclean-compile \
  -		distclean-libtool distclean-binPROGRAMS distclean-tags \
  -		distclean-generic clean-am
  -	-rm -f libtool
  -
  -distclean: distclean-am
  -
  -maintainer-clean-am:  maintainer-clean-libLTLIBRARIES \
  -		maintainer-clean-compile maintainer-clean-libtool \
  -		maintainer-clean-binPROGRAMS maintainer-clean-tags \
  -		maintainer-clean-generic distclean-am
  -	@echo "This command is intended for maintainers to use;"
  -	@echo "it deletes files that may require special tools to rebuild."
  -
  -maintainer-clean: maintainer-clean-am
  -
  -.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
  -clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
  -uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \
  -distclean-compile clean-compile maintainer-clean-compile \
  -mostlyclean-libtool distclean-libtool clean-libtool \
  -maintainer-clean-libtool mostlyclean-binPROGRAMS distclean-binPROGRAMS \
  -clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
  -install-binPROGRAMS tags mostlyclean-tags distclean-tags clean-tags \
  -maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \
  -installcheck-am installcheck install-exec-am install-exec \
  -install-data-am install-data install-am install uninstall-am uninstall \
  -all-redirect all-am all installdirs mostlyclean-generic \
  -distclean-generic clean-generic maintainer-clean-generic clean \
  -mostlyclean distclean maintainer-clean
  -
  -
  -# 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:
  +# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
  +
  +# Copyright (C) 1994, 1995-8, 1999, 2001 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.
  +
  +
  +SHELL = @SHELL@
  +
  +srcdir = @srcdir@
  +top_srcdir = @top_srcdir@
  +VPATH = @srcdir@
  +prefix = @prefix@
  +exec_prefix = @exec_prefix@
  +
  +bindir = @bindir@
  +sbindir = @sbindir@
  +libexecdir = @libexecdir@
  +datadir = @datadir@
  +sysconfdir = @sysconfdir@
  +sharedstatedir = @sharedstatedir@
  +localstatedir = @localstatedir@
  +libdir = @libdir@
  +infodir = @infodir@
  +mandir = @mandir@
  +includedir = @includedir@
  +oldincludedir = /usr/include
  +
  +DESTDIR =
  +
  +pkgdatadir = $(datadir)/@PACKAGE@
  +pkglibdir = $(libdir)/@PACKAGE@
  +pkgincludedir = $(includedir)/@PACKAGE@
  +
  +top_builddir = ..
  +
  +ACLOCAL = @ACLOCAL@
  +AUTOCONF = @AUTOCONF@
  +AUTOMAKE = @AUTOMAKE@
  +AUTOHEADER = @AUTOHEADER@
  +
  +INSTALL = @INSTALL@
  +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
  +INSTALL_DATA = @INSTALL_DATA@
  +INSTALL_SCRIPT = @INSTALL_SCRIPT@
  +transform = @program_transform_name@
  +
  +NORMAL_INSTALL = :
  +PRE_INSTALL = :
  +POST_INSTALL = :
  +NORMAL_UNINSTALL = :
  +PRE_UNINSTALL = :
  +POST_UNINSTALL = :
  +host_alias = @host_alias@
  +host_triplet = @host@
  +AR = @AR@
  +AS = @AS@
  +CC = @CC@
  +CXX = @CXX@
  +CXXCPP = @CXXCPP@
  +DLLTOOL = @DLLTOOL@
  +ECHO = @ECHO@
  +EGREP = @EGREP@
  +EXEEXT = @EXEEXT@
  +F77 = @F77@
  +GCJ = @GCJ@
  +GCJFLAGS = @GCJFLAGS@
  +HAVE_LIB = @HAVE_LIB@
  +LIB = @LIB@
  +LIBTOOL = @LIBTOOL@
  +LN_S = @LN_S@
  +LTLIB = @LTLIB@
  +MAKEINFO = @MAKEINFO@
  +OBJDUMP = @OBJDUMP@
  +OBJEXT = @OBJEXT@
  +PACKAGE = @PACKAGE@
  +RANLIB = @RANLIB@
  +RC = @RC@
  +STRIP = @STRIP@
  +VERSION = @VERSION@
  +
  +AUTOMAKE_OPTIONS = gnu	
  +@TRUE_TRUE@bin_PROGRAMS = tspp
  +@TRUE_TRUE@tspp_SOURCES = main.cpp XmlPullParser.cpp FileInputStream.cpp unicode.cpp
  +@TRUE_TRUE@@UNICODE_OUT_TRUE@INCLUDES = -I../include -DUNICODE_OUT -ggdb3
  +@TRUE_TRUE@@UNICODE_OUT_FALSE@INCLUDES = -I../include -ggdb3
  +
  +@TRUE_TRUE@lib_LTLIBRARIES = libguththila.la
  +@TRUE_TRUE@libguththila_la_SOURCES = XmlPullParser.cpp FileInputStream.cpp unicode.cpp
  +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
  +CONFIG_CLEAN_FILES = 
  +LTLIBRARIES =  $(lib_LTLIBRARIES)
  +
  +
  +DEFS = @DEFS@ -I. -I$(srcdir) 
  +CPPFLAGS = @CPPFLAGS@
  +LDFLAGS = @LDFLAGS@
  +LIBS = @LIBS@
  +libguththila_la_LDFLAGS = 
  +libguththila_la_LIBADD = 
  +@TRUE_TRUE@libguththila_la_OBJECTS =  XmlPullParser.lo \
  +@TRUE_TRUE@FileInputStream.lo unicode.lo
  +@TRUE_TRUE@bin_PROGRAMS =  tspp$(EXEEXT)
  +PROGRAMS =  $(bin_PROGRAMS)
  +
  +@TRUE_TRUE@tspp_OBJECTS =  main.$(OBJEXT) XmlPullParser.$(OBJEXT) \
  +@TRUE_TRUE@FileInputStream.$(OBJEXT) unicode.$(OBJEXT)
  +tspp_LDADD = $(LDADD)
  +tspp_DEPENDENCIES = 
  +tspp_LDFLAGS = 
  +CXXFLAGS = @CXXFLAGS@
  +CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
  +LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
  +CXXLD = $(CXX)
  +CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
  +DIST_COMMON =  Makefile.am Makefile.in
  +
  +
  +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
  +
  +TAR = tar
  +GZIP_ENV = --best
  +SOURCES = $(libguththila_la_SOURCES) $(tspp_SOURCES)
  +OBJECTS = $(libguththila_la_OBJECTS) $(tspp_OBJECTS)
  +
  +all: all-redirect
  +.SUFFIXES:
  +.SUFFIXES: .S .c .cpp .lo .o .obj .s
  +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) 
  +	cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/Makefile
  +
  +Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
  +	cd $(top_builddir) \
  +	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
  +
  +
  +mostlyclean-libLTLIBRARIES:
  +
  +clean-libLTLIBRARIES:
  +	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
  +
  +distclean-libLTLIBRARIES:
  +
  +maintainer-clean-libLTLIBRARIES:
  +
  +install-libLTLIBRARIES: $(lib_LTLIBRARIES)
  +	@$(NORMAL_INSTALL)
  +	$(mkinstalldirs) $(DESTDIR)$(libdir)
  +	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
  +	  if test -f $$p; then \
  +	    echo "$(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \
  +	    $(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
  +	  else :; fi; \
  +	done
  +
  +uninstall-libLTLIBRARIES:
  +	@$(NORMAL_UNINSTALL)
  +	list='$(lib_LTLIBRARIES)'; for p in $$list; do \
  +	  $(LIBTOOL)  --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
  +	done
  +
  +.c.o:
  +	$(COMPILE) -c $<
  +
  +# FIXME: We should only use cygpath when building on Windows,
  +# and only if it is available.
  +.c.obj:
  +	$(COMPILE) -c `cygpath -w $<`
  +
  +.s.o:
  +	$(COMPILE) -c $<
  +
  +.S.o:
  +	$(COMPILE) -c $<
  +
  +mostlyclean-compile:
  +	-rm -f *.o core *.core
  +	-rm -f *.$(OBJEXT)
  +
  +clean-compile:
  +
  +distclean-compile:
  +	-rm -f *.tab.c
  +
  +maintainer-clean-compile:
  +
  +.c.lo:
  +	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
  +
  +.s.lo:
  +	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
  +
  +.S.lo:
  +	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
  +
  +mostlyclean-libtool:
  +	-rm -f *.lo
  +
  +clean-libtool:
  +	-rm -rf .libs _libs
  +
  +distclean-libtool:
  +
  +maintainer-clean-libtool:
  +
  +libguththila.la: $(libguththila_la_OBJECTS) $(libguththila_la_DEPENDENCIES)
  +	$(CXXLINK) -rpath $(libdir) $(libguththila_la_LDFLAGS) $(libguththila_la_OBJECTS) $(libguththila_la_LIBADD) $(LIBS)
  +
  +mostlyclean-binPROGRAMS:
  +
  +clean-binPROGRAMS:
  +	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
  +
  +distclean-binPROGRAMS:
  +
  +maintainer-clean-binPROGRAMS:
  +
  +install-binPROGRAMS: $(bin_PROGRAMS)
  +	@$(NORMAL_INSTALL)
  +	$(mkinstalldirs) $(DESTDIR)$(bindir)
  +	@list='$(bin_PROGRAMS)'; for p in $$list; do \
  +	  if test -f $$p; then \
  +	    echo " $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
  +	    $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
  +	  else :; fi; \
  +	done
  +
  +uninstall-binPROGRAMS:
  +	@$(NORMAL_UNINSTALL)
  +	list='$(bin_PROGRAMS)'; for p in $$list; do \
  +	  rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
  +	done
  +
  +tspp$(EXEEXT): $(tspp_OBJECTS) $(tspp_DEPENDENCIES)
  +	@rm -f tspp$(EXEEXT)
  +	$(CXXLINK) $(tspp_LDFLAGS) $(tspp_OBJECTS) $(tspp_LDADD) $(LIBS)
  +.cpp.o:
  +	$(CXXCOMPILE) -c $<
  +.cpp.obj:
  +	$(CXXCOMPILE) -c `cygpath -w $<`
  +.cpp.lo:
  +	$(LTCXXCOMPILE) -c $<
  +
  +tags: TAGS
  +
  +ID: $(HEADERS) $(SOURCES) $(LISP)
  +	list='$(SOURCES) $(HEADERS)'; \
  +	unique=`for i in $$list; do echo $$i; done | \
  +	  awk '    { files[$$0] = 1; } \
  +	       END { for (i in files) print i; }'`; \
  +	here=`pwd` && cd $(srcdir) \
  +	  && mkid -f$$here/ID $$unique $(LISP)
  +
  +TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) $(LISP)
  +	tags=; \
  +	here=`pwd`; \
  +	list='$(SOURCES) $(HEADERS)'; \
  +	unique=`for i in $$list; do echo $$i; done | \
  +	  awk '    { files[$$0] = 1; } \
  +	       END { for (i in files) print i; }'`; \
  +	test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
  +	  || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags  $$unique $(LISP))
  +
  +mostlyclean-tags:
  +
  +clean-tags:
  +
  +distclean-tags:
  +	-rm -f TAGS ID
  +
  +maintainer-clean-tags:
  +
  +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
  +
  +subdir = src
  +
  +distdir: $(DISTFILES)
  +	@for file in $(DISTFILES); do \
  +	  d=$(srcdir); \
  +	  if test -d $$d/$$file; then \
  +	    cp -pr $$d/$$file $(distdir)/$$file; \
  +	  else \
  +	    test -f $(distdir)/$$file \
  +	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
  +	    || cp -p $$d/$$file $(distdir)/$$file || :; \
  +	  fi; \
  +	done
  +FileInputStream.lo FileInputStream.o : FileInputStream.cpp \
  +	../include/FileInputStream.hpp ../include/InputStream.hpp \
  +	../include/XmlPullParserException.hpp
  +main.o: main.cpp ../include/XmlPullParser.hpp \
  +	../include/XmlPullParserException.hpp \
  +	../include/FileInputStream.hpp ../include/InputStream.hpp \
  +	../include/Array.hpp ../include/Buffer.hpp \
  +	../include/unicode.hpp ../include/Token.hpp \
  +	../include/Namespace.hpp ../include/Attribute.hpp \
  +	../include/Depth.hpp
  +unicode.lo unicode.o : unicode.cpp ../include/unicode.hpp
  +XmlPullParser.lo XmlPullParser.o : XmlPullParser.cpp \
  +	../include/XmlPullParser.hpp \
  +	../include/XmlPullParserException.hpp \
  +	../include/FileInputStream.hpp ../include/InputStream.hpp \
  +	../include/Array.hpp ../include/Buffer.hpp \
  +	../include/unicode.hpp ../include/Token.hpp \
  +	../include/Namespace.hpp ../include/Attribute.hpp \
  +	../include/Depth.hpp
  +
  +info-am:
  +info: info-am
  +dvi-am:
  +dvi: dvi-am
  +check-am: all-am
  +check: check-am
  +installcheck-am:
  +installcheck: installcheck-am
  +install-exec-am: install-libLTLIBRARIES install-binPROGRAMS
  +install-exec: install-exec-am
  +
  +install-data-am:
  +install-data: install-data-am
  +
  +install-am: all-am
  +	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
  +install: install-am
  +uninstall-am: uninstall-libLTLIBRARIES uninstall-binPROGRAMS
  +uninstall: uninstall-am
  +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS)
  +all-redirect: all-am
  +install-strip:
  +	$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
  +installdirs:
  +	$(mkinstalldirs)  $(DESTDIR)$(libdir) $(DESTDIR)$(bindir)
  +
  +
  +mostlyclean-generic:
  +
  +clean-generic:
  +
  +distclean-generic:
  +	-rm -f Makefile $(CONFIG_CLEAN_FILES)
  +	-rm -f config.cache config.log stamp-h stamp-h[0-9]*
  +
  +maintainer-clean-generic:
  +mostlyclean-am:  mostlyclean-libLTLIBRARIES mostlyclean-compile \
  +		mostlyclean-libtool mostlyclean-binPROGRAMS \
  +		mostlyclean-tags mostlyclean-generic
  +
  +mostlyclean: mostlyclean-am
  +
  +clean-am:  clean-libLTLIBRARIES clean-compile clean-libtool \
  +		clean-binPROGRAMS clean-tags clean-generic \
  +		mostlyclean-am
  +
  +clean: clean-am
  +
  +distclean-am:  distclean-libLTLIBRARIES distclean-compile \
  +		distclean-libtool distclean-binPROGRAMS distclean-tags \
  +		distclean-generic clean-am
  +	-rm -f libtool
  +
  +distclean: distclean-am
  +
  +maintainer-clean-am:  maintainer-clean-libLTLIBRARIES \
  +		maintainer-clean-compile maintainer-clean-libtool \
  +		maintainer-clean-binPROGRAMS maintainer-clean-tags \
  +		maintainer-clean-generic distclean-am
  +	@echo "This command is intended for maintainers to use;"
  +	@echo "it deletes files that may require special tools to rebuild."
  +
  +maintainer-clean: maintainer-clean-am
  +
  +.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
  +clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
  +uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \
  +distclean-compile clean-compile maintainer-clean-compile \
  +mostlyclean-libtool distclean-libtool clean-libtool \
  +maintainer-clean-libtool mostlyclean-binPROGRAMS distclean-binPROGRAMS \
  +clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
  +install-binPROGRAMS tags mostlyclean-tags distclean-tags clean-tags \
  +maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \
  +installcheck-am installcheck install-exec-am install-exec \
  +install-data-am install-data install-am install uninstall-am uninstall \
  +all-redirect all-am all installdirs mostlyclean-generic \
  +distclean-generic clean-generic maintainer-clean-generic clean \
  +mostlyclean distclean maintainer-clean
  +
  +
  +# 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:
  
  
  
  1.2       +763 -763  ws-axis/c/src/guththila/XmlPullParser.cpp
  
  Index: XmlPullParser.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/guththila/XmlPullParser.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XmlPullParser.cpp	27 Jul 2005 11:06:54 -0000	1.1
  +++ XmlPullParser.cpp	3 Aug 2005 08:45:38 -0000	1.2
  @@ -1,763 +1,763 @@
  -/*
  - *   Copyright 2003-2004 The Apache Software Foundation.
  - *
  - *   Licensed under the Apache License, Version 2.0 (the "License");
  - *   you may not use this file except in compliance with the License.
  - *   You may obtain a copy of the License at
  - *
  - *       http://www.apache.org/licenses/LICENSE-2.0
  - *
  - *   Unless required by applicable law or agreed to in writing, software
  - *   distributed under the License is distributed on an "AS IS" BASIS,
  - *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  - *   See the License for the specific language governing permissions and
  - *   limitations under the License.
  - *
  - * @author Dasarath Weerathunga (dasarath@opensource.lk)
  -
  - * @author Dinesh Premalal (xydinesh@gmail.com
  -                            premalal@opensource.lk)
  - *
  -  *@author  Susantha Kumara  ( susantha@opensource.lk )
  - */
  -
  -#include <XmlPullParser.hpp>
  -
  -void
  -XmlPullParser::relocateTokens (int offset)
  -{
  -  int size = token->count ();
  -  for (int i = 0; i < size; i++)
  -    token->get (i)->relocate (offset);
  -}
  -
  -
  -void
  -XmlPullParser::shift ()
  -{
  -  memmove (buffer->get (), buffer->get () + offset, _next - offset);
  -  _next -= offset;
  -  last -= offset;
  -  offset = 0;
  -}
  -
  -
  -int
  -XmlPullParser::read ()
  -{
  -  if (_next == buffer->getSize ())
  -    {
  -      if (offset > 0)
  -	{
  -	  relocateTokens (offset);
  -	  shift ();
  -	}
  -      else
  -	{
  -	  char *p = buffer->get ();
  -	  buffer->grow ();
  -	  relocateTokens (p - buffer->get ());
  -	}
  -    }
  -  int c = s->read (buffer->get (), _next, buffer->getSize () - _next);
  -  last += c;
  -  return !c;
  -}
  -
  -
  -/*! check with BOM
  -   *This may or may not be presant with utf8 documents 
  -   *But UTF-16 document must have BOM 0xff 0xfe in any order, 
  -   * for LE = 0xff 0xfe, 
  -   * for BE = 0xfe 0xff,  
  -   * for UTF-8 = 0xef 0xbb 0xbf ( not necessary) */
  -
  -int
  -XmlPullParser::isUtf8 ()
  -{
  -  UTF8_char utf[3] = { 0, 0, 0 };
  -  for (int i = 0; i < 3; i++)
  -    utf[i] = (UTF8_char) buffer->get ()[_next++];
  -
  -  
  -  if (0xef == utf[0] && 0xbb == utf[1] && 0xbf == utf[2])
  -    {
  -      unicodeState = None;
  -      return _next;
  -    }
  -  else
  -    return _next = 0;
  -}
  -
  -
  -/*! check for BOM */
  -int
  -XmlPullParser::isUtf16 ()
  -{
  -  if (_next == 0)
  -    {
  -      UTF8_char utf[2];
  -      int i;
  -      for (i = 0; i < 2; i++)
  -	utf[i] = (UTF8_char) buffer->get ()[_next++];
  -      if (0xff == utf[0] && 0xfe == utf[1])
  -	return LE;
  -      else if (0xfe == utf[0] && 0xff == utf[1])
  -	return BE;
  -      else
  -	{
  -	  _next = 0;
  -	  return None;
  -	}
  -    }
  -  else
  -    return None;
  -}
  -
  -
  -/*!since we are interested in special charactes such as "<",
  - *  "/",">","?","!",""",... nextCh() method suppose to return those 
  - * values. Those values are retrieved form UTF-16 characters
  - * ,Here we need not to do a convertion. Because those values are
  - * < 128 */
  -
  -int
  -XmlPullParser::fromUtf16 (int eof)
  -{
  -  int c = buffer->get ()[_next++];
  -  
  -  if (_next > last && read ())
  -    if (eof)
  -      {
  -	term = 1;
  -	return -1;
  -      }
  -    else
  -      throw new XmlPullParserException ();
  -
  -  /*UTF16_char d = *((UTF16_char *) & buffer->get ()[_next]);
  -  if (!d)
  -  {
  -  term = 1;
  -  return -1;
  -  }*/
  -  while (!c)
  -    c = buffer->get ()[_next++];
  -  return c;
  -}
  -
  -
  -int
  -XmlPullParser::nextCh (int eof)
  -{
  -  if (_next > last && read ())
  -    if (eof)
  -      {
  -	term = 1;
  -	return -1;
  -      }
  -    else
  -      throw new XmlPullParserException ();
  -
  -  if (_next == 0)
  -    {
  -      if (isUtf8 ());
  -      else
  -	(unicodeState = isUtf16 ());
  -    }
  -
  -  if (unicodeState == None)
  -    return buffer->get ()[_next++];
  -  else
  -      return fromUtf16 (eof);
  -}
  -
  -
  -char *
  -XmlPullParser::lastCh ()
  -{
  -  int i = 1;
  -  char c = buffer->get ()[_next - 1];
  -
  -  /*! If term has set to true then that is a buffer termination */
  -  if (term)
  -    return buffer->get () + _next - 1;
  -  else
  -    {
  -      while (!c)
  -	c = buffer->get ()[_next - (++i)];
  -      return buffer->get () + _next - i;
  -    }
  -}
  -
  -
  -void
  -XmlPullParser::reset (int del)
  -{
  -  offset = _next;
  -  name = NULL;
  -  prefix = NULL;
  -  namesp = NULL;
  -  term = 0;
  -  token->trunc (0);
  -  attr->trunc (0);
  -  if (!del)
  -    {
  -      if (ETag == event || EmptyElemTag == event)
  -	closeElement ();
  -    }
  -}
  -
  -
  -void
  -XmlPullParser::openToken ()
  -{
  -  token_t *t = token->append ();
  -  t->type = token_t::Unknown;
  -  t->start = lastCh ();
  -}
  -
  -
  -void
  -XmlPullParser::closeToken (int type)
  -{
  -  token_t *t = token->last ();
  -  t->type = type;
  -  t->end = lastCh () - 1;
  -}
  -
  -
  -XmlPullParser::XmlPullParser (InputStream * s)
  -{
  -  this->s = s;
  -  state = S_1;
  -  offset = 0;
  -  last = -1;
  -  _next = 0;
  -  buffer = new Buffer < char >(1024);
  -  token = new Array < token_t > (64);
  -  namespa = new Array < namespace_t > (64);
  -  depth = new Array < depth_t > (16);
  -  attr = new Array < attr_t > (64);
  -}
  -
  -
  -XmlPullParser::~XmlPullParser ()
  -{
  -  reset (-1);
  -  delete buffer;
  -  delete token;
  -  delete namespa;
  -  delete depth;
  -  delete attr;
  -}
  -
  -
  -int
  -XmlPullParser::isS (int c)
  -{
  -  return 0x9 == c || 0xA == c || 0xD == c || 0x20 == c;
  -}
  -
  -int
  -XmlPullParser::parseS (int c)
  -{
  -  while (isS (c))
  -    c = nextCh ();
  -  return c;
  -}
  -
  -
  -int
  -XmlPullParser::parseEq (int c)
  -{
  -  if ('=' == parseS (c))
  -    return parseS (nextCh ());
  -  else
  -    throw new XmlPullParserException ();
  -}
  -
  -
  -int
  -XmlPullParser::parseNameToken (int c)
  -{
  -  openToken ();
  -  while (!(isS (c) || '/' == c || '?' == c || '=' == c || '>' == c))
  -    {
  -      if (':' == c)
  -	{
  -	  closeToken (token_t::Prefix);
  -	  c = nextCh ();
  -	  openToken ();
  -	}
  -      else
  -	c = nextCh ();
  -    }
  -  closeToken (token_t::Name);
  -  return c;
  -}
  -
  -
  -int
  -XmlPullParser::parseAttValueToken (int quote)
  -{
  -  if ('\'' == quote || '"' == quote)
  -    {
  -      int c = nextCh ();
  -      openToken ();
  -      while ('&' != c && '<' != c)
  -	{
  -	  if (c == quote)
  -	    {
  -	      closeToken (token_t::AttValue);
  -	      return nextCh ();
  -	    }
  -	  c = nextCh ();
  -	}
  -    }
  -  throw new XmlPullParserException ();
  -}
  -
  -
  -int
  -XmlPullParser::parseAttribute (int c)
  -{
  -  c = parseEq (parseNameToken (c));
  -  c = parseAttValueToken (c);
  -  return parseS (c);
  -}
  -
  -
  -void
  -XmlPullParser::parseXMLDecl ()
  -{
  -  if (nextCh () == 'x' && nextCh () == 'm' && nextCh () == 'l')
  -    {
  -      int c = parseAttribute (parseS (nextCh ()));
  -      if (c == 'e')
  -	c = parseAttribute (c);
  -      if (c == 's')
  -	c = parseAttribute (c);
  -      if (c == '?' && nextCh () == '>')
  -	{
  -	  event = XMLDecl;
  -	  return;
  -	}
  -    }
  -  throw new XmlPullParserException ();
  -}
  -
  -
  -void
  -XmlPullParser::parseSTagOrEmptyElemTag (int c)
  -{
  -  c = parseS (parseNameToken (c));
  -  event = STag;
  -  for (;;)
  -    {
  -      if (c == '/')
  -	{
  -	  event = EmptyElemTag;
  -	  if (nextCh () == '>')
  -	    return;
  -	  else
  -	    throw new XmlPullParserException ();
  -	}
  -      else if (c == '>')
  -	return;
  -      else
  -	c = parseAttribute (c);
  -    }
  -}
  -
  -
  -void
  -XmlPullParser::parseETag ()
  -{
  -  if (parseS (parseNameToken (nextCh ())) == '>')
  -    event = ETag;
  -  else
  -    throw new XmlPullParserException ();
  -}
  -
  -
  -int
  -XmlPullParser::parseCharData ()
  -{
  -  int c;
  -  event = Content;
  -  openToken ();
  -  do
  -    {
  -      c = nextCh (-1);
  -      if (-1 == c)
  -	{
  -	  closeToken (token_t::CharData);
  -	  return 0;
  -	}
  -    }
  -  while ('<' != c);
  -  closeToken (token_t::CharData);
  -  return c;
  -}
  -
  -
  -int
  -XmlPullParser::tokenize ()
  -{
  -  do
  -    {
  -      int c = nextCh (-1);
  -      if (-1 == c)
  -	return -1;
  -      switch (state)
  -	{
  -	case S_1:
  -	  if ('<' == c)
  -	    state = S_2;
  -	  else
  -	    state = S_0;
  -	  break;
  -
  -	case S_2:
  -	  if ('?' == c)
  -	    parseXMLDecl ();
  -	  else
  -	    parseSTagOrEmptyElemTag (c);
  -	  state = S_3;
  -	  break;
  -
  -	case S_3:
  -	  if ('<' == c)
  -	    state = S_4;
  -	  else
  -	    {
  -	      c = parseCharData ();
  -	      if ('<' == c)
  -		{
  -		  state = S_4;
  -		  return event;
  -		}
  -	      else if ('\0' == c)
  -		state = S_3;
  -	      else
  -		state = S_0;
  -	    }
  -	  break;
  -
  -	case S_4:
  -	  if ('/' == c)
  -	    {
  -	      parseETag ();
  -	      state = S_3;
  -	    }
  -	  else if ('!' == c)
  -	    state = S_0;
  -	  else if ('?' == c)
  -	    state = S_0;
  -	  else
  -	    {
  -	      parseSTagOrEmptyElemTag (c);
  -	      state = S_3;
  -	    }
  -	}
  -      if (state == S_0)
  -	throw new XmlPullParserException ();
  -    }
  -  while (state != S_3);
  -  return event;
  -}
  -
  -
  -int
  -XmlPullParser::addNamespace (token_t * uri)
  -{
  -  namespace_t *r = namespa->append ();
  -  r->prefix = NULL;
  -  r->length = 0;
  -  r->uri = uri->toString (unicodeState);
  -  r->lengthUri = strlen(r->uri);
  -}
  -
  -
  -int
  -XmlPullParser::addNamespace (token_t * prefix, token_t * uri)
  -{
  -  namespace_t *r = namespa->append ();
  -  r->prefix = prefix->toString (unicodeState);
  -  r->length = strlen (r->prefix);
  -  r->uri = uri->toString (unicodeState);
  -  r->lengthUri = strlen(r->uri);
  -}
  -
  -
  -int
  -XmlPullParser::addAttribute (token_t * prefix, token_t * name,
  -			     token_t * value)
  -{
  -  attr_t *r = attr->append ();
  -  r->prefix = prefix;
  -  r->name = name;
  -  r->value = value;
  -  r->namesp = NULL;
  -}
  -
  -
  -void
  -XmlPullParser::openElement ()
  -{
  -  if (depth->count ())
  -    {
  -      depth_t *l = depth->last ();
  -      depth_t *m = depth->append ();
  -      m->first = l->first + l->count;
  -      m->total = namespa->count ();
  -      m->count = m->total - l->total;
  -    }
  -  else
  -    {
  -      depth_t *m = depth->append ();
  -      m->first = 0;
  -      m->total = namespa->count ();
  -      m->count = m->total;
  -    }
  -}
  -
  -
  -void
  -XmlPullParser::closeElement ()
  -{
  -  depth_t *d = depth->last ();
  -  if (d->count)
  -    {
  -      namespace_t *p = namespa->get (d->first);
  -      for (int i = 0; i < d->count; i++, p++)
  -	{
  -	  if (p->prefix)
  -	    free (p->prefix);
  -	  if(p->uri)
  -	    free(p->uri);
  -	}
  -      namespa->trunc (d->first);
  -    }
  -  depth->chip ();
  -}
  -
  -
  -int
  -XmlPullParser::next ()
  -{
  -  token_t *p;
  -  reset ();
  -  switch (tokenize ())
  -    {
  -    case -1:
  -      return -1;
  -
  -    case XMLDecl:
  -    case STag:
  -    case EmptyElemTag:
  -      p = token->last ();
  -      while (p->isOfType (token_t::AttValue))
  -	{
  -	  token_t *value = p--;
  -	  token_t *name = p--;
  -	  if (p->isOfType (token_t::Prefix))
  -	    {
  -	      if (!p->compare ("xmlns", 5))
  -		addNamespace (name, value);
  -	      else
  -		addAttribute (p, name, value);
  -	      p--;
  -	    }
  -	  else if (!name->compare ("xmlns", 5))
  -	    addNamespace (value);
  -	  else
  -	    addAttribute (NULL, name, value);
  -	}
  -      openElement ();
  -
  -    case ETag:
  -      p = token->get ();
  -      if (p->isOfType (token_t::Prefix))
  -	prefix = p++;
  -      name = p;
  -
  -    case Content:
  -    defualt:
  -      return event;
  -    }
  -}
  -
  -
  -namespace_t *
  -XmlPullParser::getNamespace (token_t * prefix)
  -{
  -  namespace_t *p = namespa->last (), *q = namespa->get ();
  -  while (1)
  -    {
  -      if (prefix == NULL)
  -	{
  -	  if (p->prefix == NULL)
  -	    return p;
  -	}
  -      else
  -	{
  -	  if (p->prefix && !prefix->compare (p->prefix, p->length))
  -	    return p;
  -	}
  -      if (p == q)
  -	throw new XmlPullParserException ();
  -      p--;
  -    }
  -}
  -
  -
  -char *
  -XmlPullParser::getName ()
  -{
  -  if (name)
  -    return name->toString (unicodeState);
  -  throw new XmlPullParserException ();
  -}
  - 
  -
  -char *
  -XmlPullParser::getPrefix ()
  -{
  -  if (prefix)
  -    return prefix->toString (unicodeState);
  -  return NULL;
  -}
  -
  -
  -char*
  -XmlPullParser::getNamespaceUri ()
  -{
  -  if (!namesp)
  -    namesp = getNamespace (prefix);
  -  return strndup (namesp->uri, namesp->lengthUri);
  -}
  -
  -char*
  -XmlPullParser::getValue ()
  -{
  -  return token->get ()->toString (unicodeState);
  -}
  -
  -
  -int
  -XmlPullParser::getDepth ()
  -{
  -  return depth->count ();
  -}
  -
  -
  -int
  -XmlPullParser::getAttributeCount ()
  -{
  -  return attr->count ();
  -}
  -
  -
  -char*
  -XmlPullParser::getAttributeName (int i)
  -{
  -  return attr->get (i)->name->toString (unicodeState);
  -}
  -
  -
  -char*
  -XmlPullParser::getAttributeValue (int i)
  -{
  -  return attr->get (i)->value->toString (unicodeState);
  -}
  -
  -
  -char*
  -XmlPullParser::getAttributePrefix (int i)
  -{
  -  attr_t *p = attr->get (i);
  -  if (p->prefix)
  -    return p->prefix->toString (unicodeState);
  -  return NULL;
  -}
  -
  -
  -char*
  -XmlPullParser::getAttributeNamespaceUri (int i)
  -{
  -  attr_t *p = attr->get (i);
  -  if (!p->namesp)
  -    p->namesp = getNamespace (p->prefix);
  -  return strndup(p->namesp->uri, p->namesp->lengthUri);
  -}
  -
  -
  -int
  -XmlPullParser::getNamespaceCount (int i)
  -{
  -  return depth->get (i - 1)->total;
  -}
  -
  -
  -char *
  -XmlPullParser::getNamespacePrefix (int i)
  -{
  -  namespace_t *p = namespa->get (i);
  -  if (p->prefix)
  -   	return strndup(p->prefix, p->length);
  -  return NULL;
  -}
  -
  -
  -char *
  -XmlPullParser::getNamespaceUri (int i)
  -{
  -  return strndup(namespa->get(i)->uri, namespa->get(i)->lengthUri);
  -}
  -
  -char *
  -XmlPullParser::getNamespaceForPrefix (char *prefix)
  -{
  -  namespace_t *p = namespa->last (), *q = namespa->get ();
  -  while (1)
  -    {
  -      if (prefix == NULL)
  -	{
  -	  if (p->prefix == NULL)
  -	    return strndup (p->uri, p->lengthUri);
  -	}
  -      else 
  -	{
  -	  if (p->prefix && !strncmp (p->prefix, prefix, p->length))
  -	    return strndup (p->uri, p->lengthUri);
  -	}
  -      if (p == q)
  -	throw new XmlPullParserException ();
  -      p--;
  -    }
  -}
  -
  -char *
  -XmlPullParser::getPrefixForNamespace (char *ns)
  -{
  -  namespace_t *p = namespa->last (), *q = namespa->get ();
  -  while (1)
  -    {
  -      if (ns == NULL)
  -	throw new XmlPullParserException ();
  -      /* No Namespace exsist with NULL URI*/
  -      else 
  -	{
  -	  if (p->uri && !strncmp (p->uri, ns, p->lengthUri))
  -	    return strndup (p->prefix, p->length);
  -	}
  -      if (p == q)
  -	throw new XmlPullParserException ();
  -      p--;
  -    }
  -}
  -
  -
  -      
  +/*
  + *   Copyright 2003-2004 The Apache Software Foundation.
  + *
  + *   Licensed under the Apache License, Version 2.0 (the "License");
  + *   you may not use this file except in compliance with the License.
  + *   You may obtain a copy of the License at
  + *
  + *       http://www.apache.org/licenses/LICENSE-2.0
  + *
  + *   Unless required by applicable law or agreed to in writing, software
  + *   distributed under the License is distributed on an "AS IS" BASIS,
  + *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + *   See the License for the specific language governing permissions and
  + *   limitations under the License.
  + *
  + * @author Dasarath Weerathunga (dasarath@opensource.lk)
  +
  + * @author Dinesh Premalal (xydinesh@gmail.com
  +                            premalal@opensource.lk)
  + *
  +  *@author  Susantha Kumara  ( susantha@opensource.lk )
  + */
  +
  +#include "XmlPullParser.hpp"
  +
  +void
  +XmlPullParser::relocateTokens (int offset)
  +{
  +  int size = token->count ();
  +  for (int i = 0; i < size; i++)
  +    token->get (i)->relocate (offset);
  +}
  +
  +
  +void
  +XmlPullParser::shift ()
  +{
  +  memmove (buffer->get (), buffer->get () + offset, _next - offset);
  +  _next -= offset;
  +  last -= offset;
  +  offset = 0;
  +}
  +
  +
  +int
  +XmlPullParser::read ()
  +{
  +  if (_next == buffer->getSize ())
  +    {
  +      if (offset > 0)
  +	{
  +	  relocateTokens (offset);
  +	  shift ();
  +	}
  +      else
  +	{
  +	  char *p = buffer->get ();
  +	  buffer->grow ();
  +	  relocateTokens (p - buffer->get ());
  +	}
  +    }
  +  int c = s->read (buffer->get (), _next, buffer->getSize () - _next);
  +  last += c;
  +  return !c;
  +}
  +
  +
  +/*! check with BOM
  +   *This may or may not be presant with utf8 documents 
  +   *But UTF-16 document must have BOM 0xff 0xfe in any order, 
  +   * for LE = 0xff 0xfe, 
  +   * for BE = 0xfe 0xff,  
  +   * for UTF-8 = 0xef 0xbb 0xbf ( not necessary) */
  +
  +int
  +XmlPullParser::isUtf8 ()
  +{
  +  UTF8_char utf[3] = { 0, 0, 0 };
  +  for (int i = 0; i < 3; i++)
  +    utf[i] = (UTF8_char) buffer->get ()[_next++];
  +
  +  
  +  if (0xef == utf[0] && 0xbb == utf[1] && 0xbf == utf[2])
  +    {
  +      unicodeState = None;
  +      return _next;
  +    }
  +  else
  +    return _next = 0;
  +}
  +
  +
  +/*! check for BOM */
  +int
  +XmlPullParser::isUtf16 ()
  +{
  +  if (_next == 0)
  +    {
  +      UTF8_char utf[2];
  +      int i;
  +      for (i = 0; i < 2; i++)
  +	utf[i] = (UTF8_char) buffer->get ()[_next++];
  +      if (0xff == utf[0] && 0xfe == utf[1])
  +	return LE;
  +      else if (0xfe == utf[0] && 0xff == utf[1])
  +	return BE;
  +      else
  +	{
  +	  _next = 0;
  +	  return None;
  +	}
  +    }
  +  else
  +    return None;
  +}
  +
  +
  +/*!since we are interested in special charactes such as "<",
  + *  "/",">","?","!",""",... nextCh() method suppose to return those 
  + * values. Those values are retrieved form UTF-16 characters
  + * ,Here we need not to do a convertion. Because those values are
  + * < 128 */
  +
  +int
  +XmlPullParser::fromUtf16 (int eof)
  +{
  +  int c = buffer->get ()[_next++];
  +  
  +  if (_next > last && read ())
  +    if (eof)
  +      {
  +	term = 1;
  +	return -1;
  +      }
  +    else
  +      throw new XmlPullParserException ();
  +
  +  /*UTF16_char d = *((UTF16_char *) & buffer->get ()[_next]);
  +  if (!d)
  +  {
  +  term = 1;
  +  return -1;
  +  }*/
  +  while (!c)
  +    c = buffer->get ()[_next++];
  +  return c;
  +}
  +
  +
  +int
  +XmlPullParser::nextCh (int eof)
  +{
  +  if (_next > last && read ())
  +    if (eof)
  +      {
  +	term = 1;
  +	return -1;
  +      }
  +    else
  +      throw new XmlPullParserException ();
  +
  +  if (_next == 0)
  +    {
  +      if (isUtf8 ());
  +      else
  +	(unicodeState = isUtf16 ());
  +    }
  +
  +  if (unicodeState == None)
  +    return buffer->get ()[_next++];
  +  else
  +      return fromUtf16 (eof);
  +}
  +
  +
  +char *
  +XmlPullParser::lastCh ()
  +{
  +  int i = 1;
  +  char c = buffer->get ()[_next - 1];
  +
  +  /*! If term has set to true then that is a buffer termination */
  +  if (term)
  +    return buffer->get () + _next - 1;
  +  else
  +    {
  +      while (!c)
  +	c = buffer->get ()[_next - (++i)];
  +      return buffer->get () + _next - i;
  +    }
  +}
  +
  +
  +void
  +XmlPullParser::reset (int del)
  +{
  +  offset = _next;
  +  name = NULL;
  +  prefix = NULL;
  +  namesp = NULL;
  +  term = 0;
  +  token->trunc (0);
  +  attr->trunc (0);
  +  if (!del)
  +    {
  +      if (ETag == event || EmptyElemTag == event)
  +	closeElement ();
  +    }
  +}
  +
  +
  +void
  +XmlPullParser::openToken ()
  +{
  +  token_t *t = token->append ();
  +  t->type = token_t::Unknown;
  +  t->start = lastCh ();
  +}
  +
  +
  +void
  +XmlPullParser::closeToken (int type)
  +{
  +  token_t *t = token->last ();
  +  t->type = type;
  +  t->end = lastCh () - 1;
  +}
  +
  +
  +XmlPullParser::XmlPullParser (InputStream * s)
  +{
  +  this->s = s;
  +  state = S_1;
  +  offset = 0;
  +  last = -1;
  +  _next = 0;
  +  buffer = new Buffer < char >(1024);
  +  token = new Array < token_t > (64);
  +  namespa = new Array < namespace_t > (64);
  +  depth = new Array < depth_t > (16);
  +  attr = new Array < attr_t > (64);
  +}
  +
  +
  +XmlPullParser::~XmlPullParser ()
  +{
  +  reset (-1);
  +  delete buffer;
  +  delete token;
  +  delete namespa;
  +  delete depth;
  +  delete attr;
  +}
  +
  +
  +int
  +XmlPullParser::isS (int c)
  +{
  +  return 0x9 == c || 0xA == c || 0xD == c || 0x20 == c;
  +}
  +
  +int
  +XmlPullParser::parseS (int c)
  +{
  +  while (isS (c))
  +    c = nextCh ();
  +  return c;
  +}
  +
  +
  +int
  +XmlPullParser::parseEq (int c)
  +{
  +  if ('=' == parseS (c))
  +    return parseS (nextCh ());
  +  else
  +    throw new XmlPullParserException ();
  +}
  +
  +
  +int
  +XmlPullParser::parseNameToken (int c)
  +{
  +  openToken ();
  +  while (!(isS (c) || '/' == c || '?' == c || '=' == c || '>' == c))
  +    {
  +      if (':' == c)
  +	{
  +	  closeToken (token_t::Prefix);
  +	  c = nextCh ();
  +	  openToken ();
  +	}
  +      else
  +	c = nextCh ();
  +    }
  +  closeToken (token_t::Name);
  +  return c;
  +}
  +
  +
  +int
  +XmlPullParser::parseAttValueToken (int quote)
  +{
  +  if ('\'' == quote || '"' == quote)
  +    {
  +      int c = nextCh ();
  +      openToken ();
  +      while ('&' != c && '<' != c)
  +	{
  +	  if (c == quote)
  +	    {
  +	      closeToken (token_t::AttValue);
  +	      return nextCh ();
  +	    }
  +	  c = nextCh ();
  +	}
  +    }
  +  throw new XmlPullParserException ();
  +}
  +
  +
  +int
  +XmlPullParser::parseAttribute (int c)
  +{
  +  c = parseEq (parseNameToken (c));
  +  c = parseAttValueToken (c);
  +  return parseS (c);
  +}
  +
  +
  +void
  +XmlPullParser::parseXMLDecl ()
  +{
  +  if (nextCh () == 'x' && nextCh () == 'm' && nextCh () == 'l')
  +    {
  +      int c = parseAttribute (parseS (nextCh ()));
  +      if (c == 'e')
  +	c = parseAttribute (c);
  +      if (c == 's')
  +	c = parseAttribute (c);
  +      if (c == '?' && nextCh () == '>')
  +	{
  +	  event = XMLDecl;
  +	  return;
  +	}
  +    }
  +  throw new XmlPullParserException ();
  +}
  +
  +
  +void
  +XmlPullParser::parseSTagOrEmptyElemTag (int c)
  +{
  +  c = parseS (parseNameToken (c));
  +  event = STag;
  +  for (;;)
  +    {
  +      if (c == '/')
  +	{
  +	  event = EmptyElemTag;
  +	  if (nextCh () == '>')
  +	    return;
  +	  else
  +	    throw new XmlPullParserException ();
  +	}
  +      else if (c == '>')
  +	return;
  +      else
  +	c = parseAttribute (c);
  +    }
  +}
  +
  +
  +void
  +XmlPullParser::parseETag ()
  +{
  +  if (parseS (parseNameToken (nextCh ())) == '>')
  +    event = ETag;
  +  else
  +    throw new XmlPullParserException ();
  +}
  +
  +
  +int
  +XmlPullParser::parseCharData ()
  +{
  +  int c;
  +  event = Content;
  +  openToken ();
  +  do
  +    {
  +      c = nextCh (-1);
  +      if (-1 == c)
  +	{
  +	  closeToken (token_t::CharData);
  +	  return 0;
  +	}
  +    }
  +  while ('<' != c);
  +  closeToken (token_t::CharData);
  +  return c;
  +}
  +
  +
  +int
  +XmlPullParser::tokenize ()
  +{
  +  do
  +    {
  +      int c = nextCh (-1);
  +      if (-1 == c)
  +	return -1;
  +      switch (state)
  +	{
  +	case S_1:
  +	  if ('<' == c)
  +	    state = S_2;
  +	  else
  +	    state = S_0;
  +	  break;
  +
  +	case S_2:
  +	  if ('?' == c)
  +	    parseXMLDecl ();
  +	  else
  +	    parseSTagOrEmptyElemTag (c);
  +	  state = S_3;
  +	  break;
  +
  +	case S_3:
  +	  if ('<' == c)
  +	    state = S_4;
  +	  else
  +	    {
  +	      c = parseCharData ();
  +	      if ('<' == c)
  +		{
  +		  state = S_4;
  +		  return event;
  +		}
  +	      else if ('\0' == c)
  +		state = S_3;
  +	      else
  +		state = S_0;
  +	    }
  +	  break;
  +
  +	case S_4:
  +	  if ('/' == c)
  +	    {
  +	      parseETag ();
  +	      state = S_3;
  +	    }
  +	  else if ('!' == c)
  +	    state = S_0;
  +	  else if ('?' == c)
  +	    state = S_0;
  +	  else
  +	    {
  +	      parseSTagOrEmptyElemTag (c);
  +	      state = S_3;
  +	    }
  +	}
  +      if (state == S_0)
  +	throw new XmlPullParserException ();
  +    }
  +  while (state != S_3);
  +  return event;
  +}
  +
  +
  +int
  +XmlPullParser::addNamespace (token_t * uri)
  +{
  +  namespace_t *r = namespa->append ();
  +  r->prefix = NULL;
  +  r->length = 0;
  +  r->uri = uri->toString (unicodeState);
  +  r->lengthUri = strlen(r->uri);
  +}
  +
  +
  +int
  +XmlPullParser::addNamespace (token_t * prefix, token_t * uri)
  +{
  +  namespace_t *r = namespa->append ();
  +  r->prefix = prefix->toString (unicodeState);
  +  r->length = strlen (r->prefix);
  +  r->uri = uri->toString (unicodeState);
  +  r->lengthUri = strlen(r->uri);
  +}
  +
  +
  +int
  +XmlPullParser::addAttribute (token_t * prefix, token_t * name,
  +			     token_t * value)
  +{
  +  attr_t *r = attr->append ();
  +  r->prefix = prefix;
  +  r->name = name;
  +  r->value = value;
  +  r->namesp = NULL;
  +}
  +
  +
  +void
  +XmlPullParser::openElement ()
  +{
  +  if (depth->count ())
  +    {
  +      depth_t *l = depth->last ();
  +      depth_t *m = depth->append ();
  +      m->first = l->first + l->count;
  +      m->total = namespa->count ();
  +      m->count = m->total - l->total;
  +    }
  +  else
  +    {
  +      depth_t *m = depth->append ();
  +      m->first = 0;
  +      m->total = namespa->count ();
  +      m->count = m->total;
  +    }
  +}
  +
  +
  +void
  +XmlPullParser::closeElement ()
  +{
  +  depth_t *d = depth->last ();
  +  if (d->count)
  +    {
  +      namespace_t *p = namespa->get (d->first);
  +      for (int i = 0; i < d->count; i++, p++)
  +	{
  +	  if (p->prefix)
  +	    free (p->prefix);
  +	  if(p->uri)
  +	    free(p->uri);
  +	}
  +      namespa->trunc (d->first);
  +    }
  +  depth->chip ();
  +}
  +
  +
  +int
  +XmlPullParser::next ()
  +{
  +  token_t *p;
  +  reset ();
  +  switch (tokenize ())
  +    {
  +    case -1:
  +      return -1;
  +
  +    case XMLDecl:
  +    case STag:
  +    case EmptyElemTag:
  +      p = token->last ();
  +      while (p->isOfType (token_t::AttValue))
  +	{
  +	  token_t *value = p--;
  +	  token_t *name = p--;
  +	  if (p->isOfType (token_t::Prefix))
  +	    {
  +	      if (!p->compare ("xmlns", 5))
  +		addNamespace (name, value);
  +	      else
  +		addAttribute (p, name, value);
  +	      p--;
  +	    }
  +	  else if (!name->compare ("xmlns", 5))
  +	    addNamespace (value);
  +	  else
  +	    addAttribute (NULL, name, value);
  +	}
  +      openElement ();
  +
  +    case ETag:
  +      p = token->get ();
  +      if (p->isOfType (token_t::Prefix))
  +	prefix = p++;
  +      name = p;
  +
  +    case Content:
  +    defualt:
  +      return event;
  +    }
  +}
  +
  +
  +namespace_t *
  +XmlPullParser::getNamespace (token_t * prefix)
  +{
  +  namespace_t *p = namespa->last (), *q = namespa->get ();
  +  while (1)
  +    {
  +      if (prefix == NULL)
  +	{
  +	  if (p->prefix == NULL)
  +	    return p;
  +	}
  +      else
  +	{
  +	  if (p->prefix && !prefix->compare (p->prefix, p->length))
  +	    return p;
  +	}
  +      if (p == q)
  +	throw new XmlPullParserException ();
  +      p--;
  +    }
  +}
  +
  +
  +char *
  +XmlPullParser::getName ()
  +{
  +  if (name)
  +    return name->toString (unicodeState);
  +  throw new XmlPullParserException ();
  +}
  + 
  +
  +char *
  +XmlPullParser::getPrefix ()
  +{
  +  if (prefix)
  +    return prefix->toString (unicodeState);
  +  return NULL;
  +}
  +
  +
  +char*
  +XmlPullParser::getNamespaceUri ()
  +{
  +  if (!namesp)
  +    namesp = getNamespace (prefix);
  +  return strndup (namesp->uri, namesp->lengthUri);
  +}
  +
  +char*
  +XmlPullParser::getValue ()
  +{
  +  return token->get ()->toString (unicodeState);
  +}
  +
  +
  +int
  +XmlPullParser::getDepth ()
  +{
  +  return depth->count ();
  +}
  +
  +
  +int
  +XmlPullParser::getAttributeCount ()
  +{
  +  return attr->count ();
  +}
  +
  +
  +char*
  +XmlPullParser::getAttributeName (int i)
  +{
  +  return attr->get (i)->name->toString (unicodeState);
  +}
  +
  +
  +char*
  +XmlPullParser::getAttributeValue (int i)
  +{
  +  return attr->get (i)->value->toString (unicodeState);
  +}
  +
  +
  +char*
  +XmlPullParser::getAttributePrefix (int i)
  +{
  +  attr_t *p = attr->get (i);
  +  if (p->prefix)
  +    return p->prefix->toString (unicodeState);
  +  return NULL;
  +}
  +
  +
  +char*
  +XmlPullParser::getAttributeNamespaceUri (int i)
  +{
  +  attr_t *p = attr->get (i);
  +  if (!p->namesp)
  +    p->namesp = getNamespace (p->prefix);
  +  return strndup(p->namesp->uri, p->namesp->lengthUri);
  +}
  +
  +
  +int
  +XmlPullParser::getNamespaceCount (int i)
  +{
  +  return depth->get (i - 1)->total;
  +}
  +
  +
  +char *
  +XmlPullParser::getNamespacePrefix (int i)
  +{
  +  namespace_t *p = namespa->get (i);
  +  if (p->prefix)
  +   	return strndup(p->prefix, p->length);
  +  return NULL;
  +}
  +
  +
  +char *
  +XmlPullParser::getNamespaceUri (int i)
  +{
  +  return strndup(namespa->get(i)->uri, namespa->get(i)->lengthUri);
  +}
  +
  +char *
  +XmlPullParser::getNamespaceForPrefix (char *prefix)
  +{
  +  namespace_t *p = namespa->last (), *q = namespa->get ();
  +  while (1)
  +    {
  +      if (prefix == NULL)
  +	{
  +	  if (p->prefix == NULL)
  +	    return strndup (p->uri, p->lengthUri);
  +	}
  +      else 
  +	{
  +	  if (p->prefix && !strncmp (p->prefix, prefix, p->length))
  +	    return strndup (p->uri, p->lengthUri);
  +	}
  +      if (p == q)
  +	throw new XmlPullParserException ();
  +      p--;
  +    }
  +}
  +
  +char *
  +XmlPullParser::getPrefixForNamespace (char *ns)
  +{
  +  namespace_t *p = namespa->last (), *q = namespa->get ();
  +  while (1)
  +    {
  +      if (ns == NULL)
  +	throw new XmlPullParserException ();
  +      /* No Namespace exsist with NULL URI*/
  +      else 
  +	{
  +	  if (p->uri && !strncmp (p->uri, ns, p->lengthUri))
  +	    return strndup (p->prefix, p->length);
  +	}
  +      if (p == q)
  +	throw new XmlPullParserException ();
  +      p--;
  +    }
  +}
  +
  +
  +      
  
  
  
  1.2       +82 -82    ws-axis/c/src/guththila/unicode.cpp
  
  Index: unicode.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/guththila/unicode.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- unicode.cpp	27 Jul 2005 11:06:54 -0000	1.1
  +++ unicode.cpp	3 Aug 2005 08:45:38 -0000	1.2
  @@ -1,82 +1,82 @@
  -/*
  - *   Copyright 2003-2004 The Apache Software Foundation.
  - *
  - *   Licensed under the Apache License, Version 2.0 (the "License");
  - *   you may not use this file except in compliance with the License.
  - *   You may obtain a copy of the License at
  - *
  - *       http://www.apache.org/licenses/LICENSE-2.0
  - *
  - *   Unless required by applicable law or agreed to in writing, software
  - *   distributed under the License is distributed on an "AS IS" BASIS,
  - *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  - *   See the License for the specific language governing permissions and
  - *   limitations under the License.
  - *
  - * @author Dinesh Premalal (xydinesh@gmail.com)
  - *
  - */
  -
  -#include <unicode.hpp>
  -#include <stdlib.h>
  -#include <string.h>
  -#ifdef UNICODE_OUT  /* This variable for Obtain UTF-16 Output */
  -
  -
  -
  -/*! In order to determine length of UTF-16 Buffer 
  - * Basicall char *p should be a Utf-16 Buffer  */
  -
  -UTF8_char 
  -strlenUnicode (char *p)
  -{
  -  UTF8_char len = 0;
  -  UTF8_char d;
  -  UTF16_char c ;
  -  char* s = p;
  -  c = *((UTF16_char *)&s[len]);
  -  if (c)
  -    {
  -      while (c)
  -	{
  -	  c = *((UTF16_char *)&s[len]);
  -	  len +=2;
  -	  d = s[len];
  -	  if(!d)
  -	    {
  -	      return len;
  -	    break;
  -	    }
  -	}
  -      return (len-2);
  -    }
  -  else 
  -    return 0;
  -}
  -
  -
  -/*! To Duplicate UTF-16 string */
  -char * 
  -strdupUnicode (char* p)
  -{
  -  char *s;
  -  UTF8_char length;
  -  length = strlenUnicode (p);
  -  unicodeLength = length + 1;
  -  s = (char *)calloc (length, 1);
  -  return (char *)memcpy (s, p, length);
  -}
  -
  -
  -/*!To Duplicate UTF-16 String  */
  -char * 
  -strdupUnicode (char* p, int length)
  -{
  -  char *s;
  -  unicodeLength = length + 1;
  -  s = (char *)calloc (length+1, 1);
  -  s[length] = 0;
  -  return (char *)memcpy (s, p, length);
  -}
  -
  -#endif /*end of UNICODE_OUT definition  */
  +/*
  + *   Copyright 2003-2004 The Apache Software Foundation.
  + *
  + *   Licensed under the Apache License, Version 2.0 (the "License");
  + *   you may not use this file except in compliance with the License.
  + *   You may obtain a copy of the License at
  + *
  + *       http://www.apache.org/licenses/LICENSE-2.0
  + *
  + *   Unless required by applicable law or agreed to in writing, software
  + *   distributed under the License is distributed on an "AS IS" BASIS,
  + *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + *   See the License for the specific language governing permissions and
  + *   limitations under the License.
  + *
  + * @author Dinesh Premalal (xydinesh@gmail.com)
  + *
  + */
  +
  +#include "unicode.hpp"
  +#include <stdlib.h>
  +#include <string.h>
  +#ifdef UNICODE_OUT  /* This variable for Obtain UTF-16 Output */
  +
  +
  +
  +/*! In order to determine length of UTF-16 Buffer 
  + * Basicall char *p should be a Utf-16 Buffer  */
  +
  +UTF8_char 
  +strlenUnicode (char *p)
  +{
  +  UTF8_char len = 0;
  +  UTF8_char d;
  +  UTF16_char c ;
  +  char* s = p;
  +  c = *((UTF16_char *)&s[len]);
  +  if (c)
  +    {
  +      while (c)
  +	{
  +	  c = *((UTF16_char *)&s[len]);
  +	  len +=2;
  +	  d = s[len];
  +	  if(!d)
  +	    {
  +	      return len;
  +	    break;
  +	    }
  +	}
  +      return (len-2);
  +    }
  +  else 
  +    return 0;
  +}
  +
  +
  +/*! To Duplicate UTF-16 string */
  +char * 
  +strdupUnicode (char* p)
  +{
  +  char *s;
  +  UTF8_char length;
  +  length = strlenUnicode (p);
  +  unicodeLength = length + 1;
  +  s = (char *)calloc (length, 1);
  +  return (char *)memcpy (s, p, length);
  +}
  +
  +
  +/*!To Duplicate UTF-16 String  */
  +char * 
  +strdupUnicode (char* p, int length)
  +{
  +  char *s;
  +  unicodeLength = length + 1;
  +  s = (char *)calloc (length+1, 1);
  +  s[length] = 0;
  +  return (char *)memcpy (s, p, length);
  +}
  +
  +#endif /*end of UNICODE_OUT definition  */
  
  
  
  1.1                  ws-axis/c/src/guththila/Array.hpp
  
  Index: Array.hpp
  ===================================================================
  #ifndef ARRAY_HPP
  #define ARRAY_HPP
  #include <Buffer.hpp>
  
  
  template < class T >class Array:public Buffer < T >
  {
    int _last;
  
  public:
    Array (int size):Buffer < T > (size)
    {
      _last = -1;
    }
  
    T *
    get (int i = 0)
    {
      if (i > _last || _last == -1)
        throw new XmlPullParserException ();
      return &buffer[i];
    }
  
    /*! This method Will use in converstion Functions, This is a newly
      added function  */
    T 
    getElement(int i)
    {
      if (i > _last || _last == -1)
        throw new XmlPullParserException ();
      return buffer[i];
    }
    
    int 
    count ()
    {
      return _last + 1;
    }
  
    T *
    last ()
    {
      if (_last < 0)
        throw new XmlPullParserException ();
      return &buffer[_last];
    }
  
    T *
    append ()
    {
      if (++_last == size)
        grow ();
      return &buffer[_last];
    }
  
    /*! This method also use in conversion functions, This one also
      newly added one */
    void 
    append (T c)
    {
      if (++_last == size)
        grow ();
      buffer[_last] = c;
    }
  
    int 
    trunc (int size)
    {
      if ((size > 0 && _last < size) || size < 0)
        throw new XmlPullParserException ();
      else
        return _last = size - 1;
    }
  
    int 
    chip ()
    {
      if (_last < 0)
        throw new XmlPullParserException ();
      else
        return _last--;
    }
  };
  
  #endif
  
  
  
  1.1                  ws-axis/c/src/guththila/Attribute.hpp
  
  Index: Attribute.hpp
  ===================================================================
  #ifndef ATTRIBUTE_HPP
  #define ATTRIBUTE_HPP
  
  struct attr_t
  {
    token_t *prefix;
    token_t *name;
    token_t *value;
    namespace_t *namesp;
  };
  
  
  #endif
  
  
  
  1.1                  ws-axis/c/src/guththila/Buffer.hpp
  
  Index: Buffer.hpp
  ===================================================================
  #ifndef BUFFER_HPP
  #define BUFFER_HPP
  #include <stdlib.h>
  
  template < class T > class Buffer
  {
  protected:
    T * buffer;
    int size;
  
  public:
    Buffer (int size);
    ~Buffer ();
  
    void grow ();
  
    int 
    getSize ()
    {
      return size;
    }
  
  
    T *
    get ()
    {
      return buffer;
    }
  };
  
  template < class T > Buffer < T >::Buffer (int size)
  {
    this->size = size;
    buffer = (T *) malloc (sizeof (T) * size);
    if (!buffer)
      throw new XmlPullParserException ();
  }
  
  
  template < class T > Buffer < T >::~Buffer ()
  {
    free (buffer);
  }
  
  
  template < class T > void Buffer < T >::grow ()
  {
    size <<= 1;
    T *p = (T *) realloc (buffer, sizeof (T) * size);
    if (p)
      buffer = p;
    else
      throw new XmlPullParserException ();
  }
  
  #endif
  
  
  
  1.1                  ws-axis/c/src/guththila/Depth.hpp
  
  Index: Depth.hpp
  ===================================================================
  #ifndef DEPTH_HPP
  #define DEPTH_HPP
  
  struct depth_t
  {
    int first;
    int count;
    int total;
  };
  
  #endif
  
  
  
  1.1                  ws-axis/c/src/guththila/FileInputStream.hpp
  
  Index: FileInputStream.hpp
  ===================================================================
  #ifndef FILEINPUTSTREAM_HPP
  #define FILEINPUTSTREAM_HPP
  #include <InputStream.hpp>
  #include <XmlPullParserException.hpp>
  class FileInputStream:public InputStream
  {
    FILE *s;
  public:
      FileInputStream (FILE * s);
     ~FileInputStream ();
    int read (char *buffer, int offset, int length);
  };
  
  #endif
  
  
  
  1.1                  ws-axis/c/src/guththila/InputStream.hpp
  
  Index: InputStream.hpp
  ===================================================================
  #ifndef INPUTSTREAM_HPP
  #define INPUTSTREAM_HPP
  #include <stdio.h>
  
  class InputStream
  {
  public:
    virtual int read (char *buffer, int offset, int length) = 0;
  };
  #endif
  
  
  
  1.1                  ws-axis/c/src/guththila/Namespace.hpp
  
  Index: Namespace.hpp
  ===================================================================
  #ifndef NAMESPACE_HPP
  #define NAMESPACE_HPP
  
  struct namespace_t
  {
    int length;
    int lengthUri;
    char *prefix;
    char *uri;
  };
  
  #endif
  
  
  
  1.1                  ws-axis/c/src/guththila/Token.hpp
  
  Index: Token.hpp
  ===================================================================
  #ifndef TOKEN_HPP
  #define TOKEN_HPP
  
  struct token_t
  {
    int type;
    char *start, *end;
  
    enum
      {
        Unknown, Name, AttValue, Prefix, CharData
      };
  
    void 
    relocate (int offset)
    {
      start -= offset;
      end -= offset;
    }
  
    int 
    isOfType (int type)
    {
      return this->type == type;
  
    }
  
    int 
    length ()
    {
      if (end)
        return end - start + 1;
      else
        throw new XmlPullParserException ();
    }
  
  
  #ifndef UNICODE_OUT /* To Obtain UTF-8 Output */
  
    /*!added two toString methods, Because according to output format
     * converstion function will be vary
     * Here memcpy was used instead of strcpy 
     * strcpy can't survive with UTF-16 string because , it ( UTF-16
     * string) has null characters middle of string  */
  
    char*
    toString (unsigned int unicodeState)
    {
      int len = length ();
      char *p = (char *)malloc (len + 1);
      memcpy (p, start, len);
      p[len] = 0;
      unicodeLength = len;
      switch (unicodeState)
        {
        case None:
  	return p;
  	break;
        case LE:
        case BE:
  	return (char *)convertUtf16toUtf8 (p, unicodeLength);
  	break;
        };
    }
  #endif
  
  
  #ifdef UNICODE_OUT /*! To Obtain UTF-16 Output  */
  
  
    char*
    toString (unsigned int unicodeState)
    {
      int len = length ();
      char *p = (char *)malloc (len + 1);
      memcpy (p, start, len);
      p[len] = 0;
      unicodeLength = len;
      switch (unicodeState)
        {
        case None:
  	return (char *)convertUtf8toUtf16 (p, unicodeLength);
  	break;
        case LE:
        case BE:
  	return p;
  	break;
        };
    }
  #endif
  
  
    /*! To Determine length of Given UTF-8 character  */
  
    UTF8_char 
    lengthUtf8Char (char nextChar)
    {
      UTF8_char length;
  
      if ((nextChar & 0x80) == 0x00)
        length = 1;
      else if ((nextChar & 0xe0) == 0xc0)
        length = 2;
      else if ((nextChar & 0xf0) == 0xe0)
        length = 3;
      else if ((nextChar & 0xf1) == 0xf0)
        length = 4;
      else if ((nextChar & 0xfc) == 0xf1)
        length = 5;
      else
        length = 6;
  
      return length;
    }
  
  
    /*!mask will use to retrieve bits from Multibyte character  */
    UTF8_char 
    maskUtf8Char (UTF8_char length)
    {
      UTF8_char mask;
      
      switch (length)
        {
        case 1:
  	mask = 0x7f;
  	break;
        case 2:
  	mask = 0x1f;
        case 3:
  	mask = 0x0f;
  	break;
        case 4:
  	mask = 0x07;
  	break;
        case 5:
  	mask = 0x03;
  	break;
        case 6:
  	mask = 0x01;
  	break;
        };
  
      return mask;
    }
  
  
    /*! This one will Convert UTF-8 buffer to UTF-16 Buffer
     * we have to give char pointer to utf-8 buffer and length of
     *that buffer , Then it will return pointer to UTF-16 Buffer*/
  
    UTF16_char *
    convertUtf8toUtf16 (char *p, int len)
    {
      char *s;
      s = p;
      Array < UTF16_char > *outBuffer;
      outBuffer = new Array < UTF16_char > (len);
      char mask;
      char utf8Buffer[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
      UTF32_char result;
      for (int i = 0; i < len; )
        {
  	UTF8_char length = lengthUtf8Char (p[i]);
  	mask = maskUtf8Char (length);
  	for (int j = 0; j < length; j++)
  	  utf8Buffer[j] = p[i++];
  
  	result = utf8Buffer[0] & mask;
  	for (int k = 1; k < length; k++)
  	  {
  	    if ((utf8Buffer[k] & 0xc0) != 0x80)
  	      {
  		throw XmlPullParserException ();
  		break;
  	      }
  	    result <<= 6;
  	    result |= (utf8Buffer[k] & 0x3f);
  	  }
  	outBuffer->append ((UTF16_char) result);
        }
      free (s);
      UTF8_char size = outBuffer->count ();
      unicodeLength = size * sizeof (unsigned short);
      UTF16_char *out = (UTF16_char *)malloc ((size+1) * sizeof (unsigned short));
      for (int l = 0; l < size; l++)
        out[l] = outBuffer->getElement (l);
      out[size] = 0x0;
      delete outBuffer;
      return out;
    }
  
  
    /*! This function use to determine, length of UTF-8 character of
     *  Given UTF-16 character  */
    int 
    lengthUtf16Char (UTF32_char utf16Char)
    {
      int utf16CharLength;
  
      if (0x80 > utf16Char)
        utf16CharLength = 1;
      else if (0x800 > utf16Char)
        utf16CharLength = 2;
      else if (0x10000 > utf16Char)
        utf16CharLength = 3;
      else if (0x200000 > utf16Char)
        utf16CharLength = 4;
      else if (0x4000000 > utf16Char)
        utf16CharLength = 5;
      else
        utf16CharLength = 6;
  
      return utf16CharLength;
    }
  
  
    /*! after Giveing UTF-16 Character and its equivalent UTf-8 length
     *this function will create UTF-8 character and stores it into
     *dest[8] buffer  */
  
    void 
    buildUtf8String (UTF32_char utf16Char, int len, UTF8_char dest[8])
    {
      UTF8_char mask;
      
      for (int x = 0; x < 8; x++)
        {
  	dest[x] = 0x0;
        }
  
      if (len == 1)
        dest[0] = utf16Char;
      else
        {
  	switch (len)
  	  {
  	  case 1:
  	    break;
  	  case 2:
  	    mask = 0xc0;
  	    break;
  	  case 3:
  	    mask = 0xe0;
  	    break;
  	  case 4:
  	    mask = 0xf0;
  	    break;
  	  case 5:
  	    mask = 0xf8;
  	    break;
  	  case 6:
  	    mask = 0xfc;
  	    break;
  	  };
  
  	for (int i = len - 1; i > 0; i--)
  	  {
  	    dest[i] = (utf16Char & 0x3f) | 0x80;
  	    utf16Char >>= 6;
  	  }
  
  	dest[0] = utf16Char | mask;
  	dest[len] = 0;
        }
    }
  
  
    /*! This function will convert UTF-16 Buffer to UTF-8 Buffer and
      returns pointer to UTF-8 buffer */
    
    UTF8_char *
    convertUtf16toUtf8 (char *p, int len)
    {
      char *s;
      int length;
      int bufferLength;
      s = p;
      UTF8_char dest[8];
      UTF32_char utf16Char = 0;
      UTF8_char i = 0;
      UTF8_char j = 0;
      Array < UTF8_char > *out;
      out = new Array < UTF8_char > (len);
      
      while (i < len)
        {
  	utf16Char = *((UTF16_char *) & s[i]);
  	i += 2;
  	length = lengthUtf16Char (utf16Char);
  	buildUtf8String (utf16Char, length, dest);
  	j = 0;
  	while (dest[j])
  	  out->append (dest[j++]);
        }
      free (s);
      j = out->count ();
      UTF8_char *utf8Buffer = (UTF8_char *)calloc (j+1, 1);
      for (int i = 0; i < j; i++)
        utf8Buffer[i] = out->getElement (i);
      utf8Buffer[j] = 0x0;
      delete out;
      return utf8Buffer;
    }
  
  
    /*! Basically this function is use to compare "xmlns" with given
     * UTF-16 string, Otherwise it will compare "xmlns" with only first
     * characters and process Namespaces as attributes,
     *In oreder to FIX that this function defined */
  
    char *
    convertUtf16toUtf8Comp (char *p, int len)
    {
      int x = len/2;
      char buffer[x];
      int m ;
      int n;
      for (m = 0, n = 0; n<x; m +=2,n++)
        buffer[n] = p[m];
      char* s = buffer;
      return s;
    }
  
  
    /*!Basically use for compare "xmlns" with given char buffer  */
    int 
    compare (const char *s, int n)
    {
      UTF8_char *tmp;
      char *k;
      int x;
      if (unicodeState == None)
        return strncmp (start, s, n);
      else 
        {
  	k = (char *)malloc (n*2);
  	memcpy (k, start, n*2);
  	tmp = convertUtf16toUtf8 (k, n*2);
  	x = strncmp ((char *)tmp, s, n);
  	free (tmp);
  	return x;
        }
    }
  
  };
  
  #endif
  
  
  
  1.1                  ws-axis/c/src/guththila/XmlPullParser.hpp
  
  Index: XmlPullParser.hpp
  ===================================================================
  /* Guththila - Typed Pull Parser
   *  
   *  Authors: 
   *  Dasarath Weerathunga ( dasarath@cse.mrt.ac.lk,
   *                         dasarath@opensource .lk)
   *
   *  Dinesh Premalal ( premalwd@cse.mrt.ac.lk,
   *                    premalal@opensource.lk) */
  
  #ifndef XMLPULLPARSER_HPP
  #define XMLPULLPARSER_HPP
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
  #include "XmlPullParserException.hpp"
  #include "FileInputStream.hpp"
  #include "Array.hpp"
  #include "unicode.hpp"
  #include "Token.hpp"
  #include "Namespace.hpp"
  #include "Attribute.hpp"
  #include "Depth.hpp"
  
  /*! this variable useful when printing UTF-16 Buffer , normally it
   *  carries length of the UTF-16 Buffer */
  
  
  class XmlPullParser
  {
    InputStream *s;
    Buffer <char> *buffer;
    int offset;
    int last;
    int _next;
    int event;
    UTF8_char length;
    Array < token_t > *token;
    Array < namespace_t > *namespa;
    Array < attr_t > *attr;
    Array < depth_t > *depth;
  
    token_t *name;
    token_t *prefix;
    namespace_t *namesp;
  
    UTF8_char term;
    enum
      {
        S_0, S_1, S_2, S_3, S_4
      } state;
  
    int read ();
    void shift ();
    int nextCh (int eof = 0);
    /********/
    int isUtf8 ();
    int isUtf16 ();
    int fromUtf16 (int eof);
    /********/
    char *lastCh ();
    void reset (int del = 0);
    int tokenize ();
  
    void openToken ();
    void closeToken (int type);
    void relocateTokens (int offset);
  
    namespace_t *getNamespace (token_t * prefix);
    int addNamespace (token_t * uri);
    int addNamespace (token_t * prefix, token_t * uri);
    int addAttribute (token_t * prefix, token_t * name, token_t * value);
    void openElement ();
    void closeElement ();
  
    int isS (int c);
    int parseS (int c);
    int parseEq (int c);
    int parseNameToken (int c);
    int parseAttValueToken (int quote);
    int parseAttribute (int c);
    void parseXMLDecl ();
    void parseSTagOrEmptyElemTag (int c);
    void parseETag ();
    int parseCharData ();
  
  public:
    enum
      {
        XMLDecl = 0, STag, EmptyElemTag, ETag, Content
      };
  
    XmlPullParser (InputStream * in);
    ~XmlPullParser ();
  
    int next ();
  
    char *getName ();
    char *getPrefix ();
    char *getNamespaceUri ();
    char *getValue ();
  
    int getDepth ();
    int getNamespaceCount (int i);
    char *getNamespacePrefix (int i);
    char *getNamespaceUri (int i);
  
    int getAttributeCount ();
    char *getAttributeName (int i);
    char *getAttributeValue (int i);
    char *getAttributePrefix (int i);
    char *getAttributeNamespaceUri (int i);
    char *getNamespaceForPrefix (char *prefix);
    char *getPrefixForNamespace (char *ns);
  };
  
  #endif
  
  
  
  1.1                  ws-axis/c/src/guththila/XmlPullParserException.hpp
  
  Index: XmlPullParserException.hpp
  ===================================================================
  #ifndef XMLPULLPARSEREXCEPTION_HPP
  #define XMLPULLPARSEREXCEPTION_HPP
  class XmlPullParserException
  {
  };
  #endif
  
  
  
  1.1                  ws-axis/c/src/guththila/history.xml
  
  Index: history.xml
  ===================================================================
  <?xml version='1.0' encoding='UTF-8'?>
  <history>
     <processor signature="gcc -shared -ldl -lpthread -lstdc++">
        <target file="libguththila.so" lastModified="10563bbdb40">
           <source file="../../../../../obj/objects/unicode.o" lastModified="10563bbc7b8"/>
           <source file="../../../../../obj/objects/FileInputStream.o" lastModified="10563bbc7b8"/>
           <source file="../../../../../obj/objects/XmlPullParser.o" lastModified="10563bbd758"/>
        </target>
     </processor>
  </history>
  
  
  
  1.1                  ws-axis/c/src/guththila/unicode.hpp
  
  Index: unicode.hpp
  ===================================================================
  /* Guththila - Typed Pull Parser
   *  
   *  Authors: 
   *  
   *  Dinesh Premalal ( premalwd@cse.mrt.ac.lk,
   *                    premalal@opensource.lk) */
  
  #ifndef UNICODE_H
  #define UNICODE_H
  
  typedef unsigned char UTF8_char;
  typedef unsigned short UTF16_char;
  typedef unsigned int UTF32_char;
  
  
  /*! These are the values of UTF-16 Document
   * After , BOM (Byter Oreder Mark) was determined unicodeState
   * variable will set to one of the following values
   * None = Normally treated as Utf-8 Document
   * LE = Little Endian UTF-16 Document
   * BE = Big Endian UTF-16 Document
   * For the time being Endianess make no effect to the parsing  */
  enum UTF16_endianess {None=1, LE, BE};
  
  /*!This static variable will will track the Document type  */
  static unsigned int unicodeState = 0;
  
  static UTF8_char  unicodeLength = 0;
  
  #ifdef UNICODE_OUT
  #define strlen(x) strlenUnicode(x) 
  #define strndup(x, y) strdupUnicode(x, y)
  
  UTF8_char strlenUnicode (char *);
  
  char * strdupUnicode (char *);
  
  char * strdupUnicode (char *, int);
  
  #endif
  
  
  #endif /* TSPP_H */