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 da...@apache.org on 2004/10/22 15:30:09 UTC

cvs commit: ws-axis/c/src/xml/txpp/tests/test2 test2.c

damitha     2004/10/22 06:30:09

  Modified:    c/src/xml/txpp INSTALL Makefile.am
               c/src/xml/txpp/src spp.c
               c/src/xml/txpp/tests/test1 test1.c
               c/src/xml/txpp/tests/test2 test2.c
  Added:       c/src/xml/txpp config.sh
               c/src/xml/txpp/src spp.h
  Removed:     c/src/xml/txpp build.sh
               c/src/xml/txpp/include spp.h
  Log:
  These are related to txpp pull parser work. Have no relation to the release
  
  Revision  Changes    Path
  1.2       +13 -16    ws-axis/c/src/xml/txpp/INSTALL
  
  Index: INSTALL
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/xml/txpp/INSTALL,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- INSTALL	30 Jun 2004 08:59:37 -0000	1.1
  +++ INSTALL	22 Oct 2004 13:30:08 -0000	1.2
  @@ -1,33 +1,30 @@
   create environment variable TXPP_HOME to point where
  -txpp is.
  -TXPP_HOME="/home/damitha/txpp"
  +txpp source is.
  +TXPP_HOME="/home/foo/txpp"
   
   export TXPP_HOME
   
   Now
  -cd $TXPP_HOME/lib
  +cd $TXPP_HOME
   
   to build
   
  -sh build.sh
  +./configure --prefix=<your install dir, say inst-dir>
   
  -This will install libtxpp.so in $TXPP_HOME/lib
  -
  -To build and run the samples
  +make
   
  -set environment variable LD_LIBRARY_PATH to point to
  -TXPP_HOME/lib
  +make install
   
  -LD_LIBRARY_PATH="$TXPP_HOME/lib:$LD_LIBRARY_PATH"
  -
  -export LD_LIBRARY_PATH
  +This will install libtxpp.so in $TXPP_HOME/lib
   
  -cd $TXPP_HOME/examples
  +By default tests are also built and installed in
  +$TXPP_HOME/bin. If you don't want tests to build,
  +give the configure option 
  +configure --enable-tests=no
   
  -sh build_test1.sh
  -sh build_test2.sh
  +To run the tests
   
  -to run
  +cd inst-dir/bin
   
   sh run_test1.sh
   sh run_test2.sh
  
  
  
  1.2       +1 -1      ws-axis/c/src/xml/txpp/Makefile.am
  
  Index: Makefile.am
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/xml/txpp/Makefile.am,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Makefile.am	30 Jul 2004 07:25:17 -0000	1.1
  +++ Makefile.am	22 Oct 2004 13:30:08 -0000	1.2
  @@ -1,2 +1,2 @@
   SUBDIRS=src @TESTS@
  -include_HEADERS = include/spp.h
  +include_HEADERS = src/spp.h
  
  
  
  1.1                  ws-axis/c/src/xml/txpp/config.sh
  
  Index: config.sh
  ===================================================================
  #!/bin/bash
  echo "run configure"
  ./configure --prefix=$TXPP_HOME
  
  
  
  1.2       +1 -1      ws-axis/c/src/xml/txpp/src/spp.c
  
  Index: spp.c
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/xml/txpp/src/spp.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- spp.c	30 Jul 2004 08:31:01 -0000	1.1
  +++ spp.c	22 Oct 2004 13:30:08 -0000	1.2
  @@ -18,7 +18,7 @@
   #include <stdio.h>
   #include <stdlib.h>
   #include "internal.h"
  -#include <spp.h>
  +#include "spp.h"
   #include "spp_converter.h"
   #include "tag.h"
   
  
  
  
  1.1                  ws-axis/c/src/xml/txpp/src/spp.h
  
  Index: spp.h
  ===================================================================
  /*
   *   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.
   */
  
  #include <stdlib.h>
  
  #ifndef XPP_H_OF_AXIS_INCLUDED
  #define XPP_H_OF_AXIS_INCLUDED
  #ifdef XML_UNICODE     /* Information is UTF-16 encoded. */
  #ifdef XML_UNICODE_WCHAR_T
  typedef wchar_t XML_Char;
  typedef wchar_t XML_LChar;
  #else
  typedef unsigned short XML_Char;
  typedef char XML_LChar;
  #endif /* XML_UNICODE_WCHAR_T */
  #else                  /* Information is UTF-8 encoded. */
  typedef char XML_Char;
  typedef char XML_LChar;
  #endif /* XML_UNICODE */
  
  typedef unsigned char XML_Bool;
  #define XML_TRUE   ((XML_Bool) 1)
  #define XML_FALSE  ((XML_Bool) 0)
  
  
  #ifdef XML_UNICODE
  
  #ifdef XML_UNICODE_WCHAR_T
  #define XML_T(x) (const wchar_t)x
  #define XML_L(x) L ## x
  #else
  #define XML_T(x) (const unsigned short)x
  #define XML_L(x) x
  #endif
  
  #else
  
  #define XML_T(x) x
  #define XML_L(x) x
  
  #endif
  
  
  #ifdef XML_UNICODE
  #define XML_ENCODE_MAX XML_UTF16_ENCODE_MAX
  #define XmlConvert XmlUtf16Convert
  #define XmlGetInternalEncoding XmlGetUtf16InternalEncoding
  #define XmlEncode XmlUtf16Encode
  #define MUST_CONVERT(enc, s) (!(enc)->isUtf16 || (((unsigned long)s) & 1))
  typedef unsigned short ICHAR;
  #else
  #define XML_ENCODE_MAX XML_UTF8_ENCODE_MAX
  #define XmlConvert XmlUtf8Convert
  #define XmlGetInternalEncoding XmlGetUtf8InternalEncoding
  #define XmlEncode XmlUtf8Encode
  #define MUST_CONVERT(enc, s) (!(enc)->isUtf8)
  typedef char ICHAR;
  #endif
  
  
  /** Tokenizing states*/
  enum 
  {
      S_0, S_1, S_2, S_3, S_4, S_5, S_6, S_7,
      S_8, S_9, S_10, S_11, S_12, S_13, S_14
  };        
  
  /** Special characters*/
  enum 
  {
      START_TAG, END_TAG, EMPTY_ELEMENT_TAG, PCDATA
  };
  
  /** Error codes*/
  enum SPP_Error 
  {
      SPP_ERROR_NONE,
      SPP_ERROR_NO_MEMORY,
      SPP_ERROR_SYNTAX,
      SPP_ERROR_NO_ELEMENTS,
      SPP_ERROR_INVALID_TOKEN,
      SPP_ERROR_UNCLOSED_TOKEN,
      SPP_ERROR_TAG_MISMATCH,
      SPP_ERROR_DUPLICATE_ATTRIBUTE,
      SPP_ERROR_UNKNOWN_ENCODING,
      SPP_ERROR_INCORRECT_ENCODING,
      SPP_ERROR_NOT_STANDALONE,
      SPP_ERROR_UNEXPECTED_STATE,
      SPP_ERROR_TOKENIZER_FAILED,
      SPP_ERROR_UNEXPECTED_TOKEN_CONTENT,
      SPP_ERROR_PARSE_FAILED,
      SPP_ERROR_READ_BLOCK,
      SPP_ERROR_PARSER_INIT_FAILED,
      SPP_ERROR_UNKNOWN
  };
  
  /** Memeory handling structure*/
  typedef struct mm 
  {
      void *( *mallocFcn)(size_t size);
      void *( *memMoveFcn)(void *ptrto, void *ptrfrom, size_t size);
      void *( *reallocFcn)(void *ptr, size_t size);
      void ( *freeFcn)(void *ptr);
  } SppMemoryHandlingSuite;
  
  /** Struct to hold ptrs to tokenized data*/
  typedef struct data
  {
      int type;
      int ptrBuffSize;
      int numOfPtrs;
      int numOfPtrsUtf8;
      char **ptrBuff;
      char **utf8PtrBuff;
  } TokDataStruct;
  
  /* char *tn[] = {"START_TAG", "END_TAG", "EMPTY_ELEMENT_TAG", "PCDATA"}; */
  
  struct SPPContext;
  
  /** SPP parser structure*/
  typedef struct SPPContext SPPParser;
  
  /** Parser create with encoding*/
  SPPParser* parserCreate(const XML_Char *encodingName);
  
  /** Parser create with encoding, namspace*/
  SPPParser* parserCreate_ns(const XML_Char *encodingName, XML_Char nsSep);
  
  /** Parser create with encoding, external memory handling suite and namespace*/
  SPPParser* parserCreate_mh(const XML_Char *encodingName, 
      const SppMemoryHandlingSuite *memsuite,
      XML_Char nsSep);
  enum SPP_Error parseProlog(SPPParser* ct);
  
  void* parserFree(SPPParser* ct);
  
  /** Parse the next element tag*/
  TokDataStruct* next(SPPParser* ct);
  
  /** Get next element as integer*/
  int getNextElementAsInt(SPPParser* ct, int* parseError);
  
  /** Get next attribute as integer*/
  int getNextAttributeAsInt(SPPParser* ct, int* parseError);
  
  #endif
  
  
  
  
  1.2       +1 -1      ws-axis/c/src/xml/txpp/tests/test1/test1.c
  
  Index: test1.c
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/xml/txpp/tests/test1/test1.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- test1.c	30 Jul 2004 07:25:17 -0000	1.1
  +++ test1.c	22 Oct 2004 13:30:08 -0000	1.2
  @@ -14,7 +14,7 @@
    *   limitations under the License.
    */
   
  -#include "../../include/spp.h"
  +#include "../../src/spp.h"
   
   char *tn[] = {"START_TAG", "END_TAG", "EMPTY_ELEMENT_TAG", "PCDATA"};
   
  
  
  
  1.2       +1 -1      ws-axis/c/src/xml/txpp/tests/test2/test2.c
  
  Index: test2.c
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/xml/txpp/tests/test2/test2.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- test2.c	30 Jul 2004 07:25:18 -0000	1.1
  +++ test2.c	22 Oct 2004 13:30:08 -0000	1.2
  @@ -14,7 +14,7 @@
    *   limitations under the License.
    */
   
  -#include "../../include/spp.h"
  +#include "../../src/spp.h"
   
   char *tn[] = {"START_TAG", "END_TAG", "EMPTY_ELEMENT_TAG", "PCDATA"};