You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ar...@locus.apache.org on 2000/09/11 20:44:37 UTC

cvs commit: xml-xerces/c/tests/ThreadTest Makefile.in ThreadTest.cpp

aruna1      00/09/11 11:44:34

  Modified:    c/obj    Makefile.in
               c/samples Makefile.incl
               c/samples/MemParse MemParse.cpp
               c/samples/SAX2Count Makefile.in
               c/samples/SAX2Print Makefile.in
               c/src/util/Platforms/OS390 OS390PlatformUtils.cpp
               c/tests  Makefile.incl
               c/tests/DOM/DOMIDTest DOMIDTest.cpp Makefile.in
               c/tests/DOM/DOMMemTest Makefile.in
               c/tests/DOM/RangeTest Makefile.in
               c/tests/DOM/Traversal Makefile.in
               c/tests/EncodingTest Makefile.in
               c/tests/ThreadTest Makefile.in ThreadTest.cpp
  Log:
  OS390 related updates
  
  Revision  Changes    Path
  1.18      +2 -2      xml-xerces/c/obj/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/obj/Makefile.in,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Makefile.in	2000/06/19 22:38:53	1.17
  +++ Makefile.in	2000/09/11 18:43:37	1.18
  @@ -54,7 +54,7 @@
   # <http://www.apache.org/>.
   #
   #
  -# $Id: Makefile.in,v 1.17 2000/06/19 22:38:53 aruna1 Exp $
  +# $Id: Makefile.in,v 1.18 2000/09/11 18:43:37 aruna1 Exp $
   #
   
   ###################################################################
  @@ -82,7 +82,7 @@
   LIB=${XERCESCROOT}/lib
   ## OS390BATCH
   ifeq (${OS390BATCH},1)
  -BATCH_TARGET = "//'${LOADMOD}(IXM4C31)'"
  +BATCH_TARGET = "//'${LOADMOD}(IXM4C33)'"
   endif
   ifneq (${PLATFORM}, OS400)
   LIBNAME=libxerces-c
  
  
  
  1.24      +3 -3      xml-xerces/c/samples/Makefile.incl
  
  Index: Makefile.incl
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/samples/Makefile.incl,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- Makefile.incl	2000/08/30 22:21:09	1.23
  +++ Makefile.incl	2000/09/11 18:43:43	1.24
  @@ -54,7 +54,7 @@
   # <http://www.apache.org/>.
   #
   #
  -# $Id: Makefile.incl,v 1.23 2000/08/30 22:21:09 andyh Exp $
  +# $Id: Makefile.incl,v 1.24 2000/09/11 18:43:43 aruna1 Exp $
   #
   
   ################## LIBRARY NAMES AND DIRECTORIES ##################
  @@ -162,7 +162,7 @@
   CC= g++ -c -D${PLATFORM} -D_REENTRANT -fpic -instances=static
   LINK =  g++ -D${PLATFORM} -fpic
   PLATFORM_LIB_LINK_OPTIONS=-L/usr/lib -L/usr/local/lib
  -EXTRA_LINK_OPTIONS=-lc -Wl,-rpath-link,$(XERCESCROOT)/lib
  +EXTRA_LINK_OPTIONS=-lc
   SHLIBSUFFIX=.so
   endif
   
  @@ -228,7 +228,7 @@
   OS390SIDEDECK=.x
   ## OS390BATCH
   ifeq (${OS390BATCH},1)
  -LIBRARY_NAMES="//'${LOADEXP}(IXM4C31)'"
  +LIBRARY_NAMES="//'${LOADEXP}(IXM4C33)'"
   else
   LIBRARY_NAMES=${LIB_DIR}/lib${LIBNAME}${VER}${OS390SIDEDECK}
   endif
  
  
  
  1.7       +27 -0     xml-xerces/c/samples/MemParse/MemParse.cpp
  
  Index: MemParse.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/samples/MemParse/MemParse.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MemParse.cpp	2000/03/02 19:53:42	1.6
  +++ MemParse.cpp	2000/09/11 18:43:48	1.7
  @@ -57,6 +57,9 @@
   
   /*
    * $Log: MemParse.cpp,v $
  + * Revision 1.7  2000/09/11 18:43:48  aruna1
  + * OS390 related updates
  + *
    * Revision 1.6  2000/03/02 19:53:42  roddey
    * This checkin includes many changes done while waiting for the
    * 1.1.0 code to be finished. I can't list them all here, but a list is
  @@ -118,6 +121,27 @@
   //      just for indentification purposes in case of errors. Its not a real
   //      system id (and the parser knows that.)
   // ---------------------------------------------------------------------------
  +
  +#ifdef OS390
  +static const char*  gXMLInMemBuf =
  +"\
  +<?xml version='1.0' encoding='ibm-1047-s390'?>\n\
  +<!DOCTYPE company [\n\
  +<!ELEMENT company     (product,category,developedAt)>\n\
  +<!ELEMENT product     (#PCDATA)>\n\
  +<!ELEMENT category    (#PCDATA)>\n\
  +<!ATTLIST category idea CDATA #IMPLIED>\n\
  +<!ELEMENT developedAt (#PCDATA)>\n\
  +]>\n\n\
  +<company>\n\
  +    <product>XML4C</product>\n\
  +    <category idea='great'>XML Parsing Tools</category>\n\
  +    <developedAt>\n\
  +      IBM Center for Java Technology, Silicon Valley, Cupertino, CA\n\
  +    </developedAt>\n\
  +</company>\
  +";
  +#else
   static const char*  gXMLInMemBuf =
   "\
   <?xml version='1.0' encoding='ascii'?>\n\
  @@ -136,6 +160,7 @@
       </developedAt>\n\
   </company>\
   ";
  +#endif
   
   static const char*  gMemBufId = "prodInfo";
   
  
  
  
  1.2       +2 -2      xml-xerces/c/samples/SAX2Count/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/samples/SAX2Count/Makefile.in,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Makefile.in	2000/08/08 17:17:20	1.1
  +++ Makefile.in	2000/09/11 18:43:52	1.2
  @@ -54,7 +54,7 @@
   # <http://www.apache.org/>.
   # 
   #
  -# $Id: Makefile.in,v 1.1 2000/08/08 17:17:20 jpolast Exp $
  +# $Id: Makefile.in,v 1.2 2000/09/11 18:43:52 aruna1 Exp $
   #
   
   ###################################################################
  @@ -86,7 +86,7 @@
   
   ## OS390BATCH
   ifeq (${OS390BATCH},1)
  -BATCH_TARGET= "//'${LOADMOD}(${APP_NAME})'"
  +BATCH_TARGET= "//'${LOADMOD}(SAX2Cont)'"
   all:: makedir ${BATCH_TARGET}
   else
   all:: makedir ${EXEC}/${APP_NAME}
  
  
  
  1.2       +2 -2      xml-xerces/c/samples/SAX2Print/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/samples/SAX2Print/Makefile.in,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Makefile.in	2000/08/02 19:16:14	1.1
  +++ Makefile.in	2000/09/11 18:43:57	1.2
  @@ -54,7 +54,7 @@
   # <http://www.apache.org/>.
   # 
   #
  -# $Id: Makefile.in,v 1.1 2000/08/02 19:16:14 jpolast Exp $
  +# $Id: Makefile.in,v 1.2 2000/09/11 18:43:57 aruna1 Exp $
   #
   
   ###################################################################
  @@ -86,7 +86,7 @@
   
   ## OS390BATCH
   ifeq (${OS390BATCH},1)
  -BATCH_TARGET= "//'${LOADMOD}(${APP_NAME})'"
  +BATCH_TARGET= "//'${LOADMOD}(SAX2PRNT)'"
   all:: makedir ${BATCH_TARGET}
   else
   all:: makedir ${EXEC}/${APP_NAME}
  
  
  
  1.15      +122 -72   xml-xerces/c/src/util/Platforms/OS390/OS390PlatformUtils.cpp
  
  Index: OS390PlatformUtils.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/util/Platforms/OS390/OS390PlatformUtils.cpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- OS390PlatformUtils.cpp	2000/09/06 23:10:38	1.14
  +++ OS390PlatformUtils.cpp	2000/09/11 18:44:01	1.15
  @@ -55,48 +55,7 @@
    */
   
   /*
  - * $Log: OS390PlatformUtils.cpp,v $
  - * Revision 1.14  2000/09/06 23:10:38  aruna1
  - * OS390 sockets related changes
  - *
  - * Revision 1.13  2000/07/25 22:30:24  aruna1
  - * Char definitions in XMLUni moved to XMLUniDefs
  - *
  - * Revision 1.12  2000/03/18 00:00:00  roddey
  - * Initial updates for two way transcoding support
  - *
  - * Revision 1.11  2000/03/02 21:10:37  abagchi
  - * Added empty function platformTerm()
  - *
  - * Revision 1.10  2000/03/02 19:55:29  roddey
  - * This checkin includes many changes done while waiting for the
  - * 1.1.0 code to be finished. I can't list them all here, but a list is
  - * available elsewhere.
  - *
  - * Revision 1.9  2000/02/23 00:35:49  abagchi
  - * Added OS/390 changes to comply with new ICUDATA library
  - *
  - * Revision 1.8  2000/02/08 18:55:59  abagchi
  - * Changed it to use Iconv390 transcoder
  - *
  - * Revision 1.7  2000/02/08 18:37:28  abagchi
  - * set __MUTEX_RECURSIVE
  - *
  - * Revision 1.4  2000/02/06 07:48:29  rahulj
  - * Year 2K copyright swat.
  - *
  - * Revision 1.3  2000/01/21 22:17:57  abagchi
  - * OS390 Change: updates for Version 3.1.0
  - *
  - * Revision 1.2  1999/12/18 00:47:01  rahulj
  - * Merged in some changes for OS390.
  - *
  - * Revision 1.1.1.1  1999/11/09 01:06:38  twl
  - * Initial checkin
  - *
  - * Revision 1.2  1999/11/08 20:45:31  rahul
  - * Swat for adding in Product name and CVS comment log variable.
  - *
  + * $Id: OS390PlatformUtils.cpp,v 1.15 2000/09/11 18:44:01 aruna1 Exp $
    */
   
   
  @@ -125,7 +84,7 @@
   #endif
   #include    <string.h>
   #include    <unistd.h>
  -#include    <limits.h>	
  +#include    <limits.h>
   #include    <util/XMLString.hpp>
   #include    <util/XMLUniDefs.hpp>
   #include    <util/XMLUni.hpp>
  @@ -153,9 +112,9 @@
   // ---------------------------------------------------------------------------
   static void WriteCharStr( FILE* stream, const char* const toWrite)
   {
  -    if (!fputs(toWrite, stream))
  -    {
  -	ThrowXML(XMLPlatformUtilsException, XML4CExcepts::Strm_StdErrWriteFailure);
  +    if (fputs(toWrite, stream) == EOF)
  +	    {
  +		ThrowXML(XMLPlatformUtilsException, XMLExcepts::Strm_StdErrWriteFailure);
       }
   }
   
  @@ -163,9 +122,9 @@
   {
       char* tmpVal = XMLString::transcode(toWrite);
           ArrayJanitor<char> janText(tmpVal);
  -    if (!fputs(tmpVal, stderr))
  -    {
  -	ThrowXML(XMLPlatformUtilsException, XML4CExcepts::Strm_StdErrWriteFailure);
  +    if (fputs(tmpVal, stderr) == EOF)
  +	    {
  +		ThrowXML(XMLPlatformUtilsException, XMLExcepts::Strm_StdErrWriteFailure);
       }
   }
   
  @@ -174,9 +133,9 @@
       char* tmpVal = XMLString::transcode(toWrite);
           ArrayJanitor<char> janText(tmpVal);
   
  -    if (!fputs(tmpVal, stdout))
  -    {
  -	ThrowXML(XMLPlatformUtilsException, XML4CExcepts::Strm_StdErrWriteFailure);
  +    if (fputs(tmpVal, stdout) == EOF)
  +	    {
  +		ThrowXML(XMLPlatformUtilsException, XMLExcepts::Strm_StdErrWriteFailure);
       }
   }
   
  @@ -193,8 +152,11 @@
   // ---------------------------------------------------------------------------
   //  XMLPlatformUtils: Platform init method
   // ---------------------------------------------------------------------------
  +static int posixIsOn = 0;
  +
   void XMLPlatformUtils::platformInit()
   {
  +	posixIsOn = __isPosixOn();
   }
   
   // ---------------------------------------------------------------------------
  @@ -281,7 +243,7 @@
       // Get the current position
       int curPos = ftell( (FILE*)theFile);
       if (curPos == -1)
  -	ThrowXML(XMLPlatformUtilsException, XML4CExcepts::File_CouldNotGetSize);
  +		ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotGetSize);
   
       return (unsigned int)curPos;
   }
  @@ -289,7 +251,7 @@
   void XMLPlatformUtils::closeFile(FileHandle theFile)
   {
       if (fclose((FILE*)theFile))
  -ThrowXML(XMLPlatformUtilsException, XML4CExcepts::File_CouldNotCloseFile);
  +		ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotCloseFile);
   }
   
   unsigned int XMLPlatformUtils::fileSize(FileHandle theFile)
  @@ -297,20 +259,20 @@
       // Get the current position
       long  int curPos = ftell((FILE*)theFile);
       if (curPos == -1)
  -	ThrowXML(XMLPlatformUtilsException, XML4CExcepts::File_CouldNotGetCurPos);
  +		ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotGetCurPos);
   
       // Seek to the end and save that value for return
        if (fseek( (FILE*)theFile, 0, SEEK_END) )
  -	ThrowXML(XMLPlatformUtilsException, XML4CExcepts::File_CouldNotSeekToEnd);
  +		ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotSeekToEnd);
   
       long int retVal = ftell( (FILE*)theFile);
       if (retVal == -1)
  -	ThrowXML(XMLPlatformUtilsException, XML4CExcepts::File_CouldNotSeekToEnd);
  +		ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotSeekToEnd);
   
   
       // And put the pointer back
       if (fseek( (FILE*)theFile, curPos, SEEK_SET) )
  -	ThrowXML(XMLPlatformUtilsException, XML4CExcepts::File_CouldNotSeekToPos);
  +		ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotSeekToPos);
   
       return (unsigned int)retVal;
   }
  @@ -401,6 +363,89 @@
       return retVal;
   }
   
  +FileHandle XMLPlatformUtils::openFile(const char* const fileName)
  +{
  +    FileHandle retVal = (FILE*)fopen( fileName , "rb" );
  +
  +#ifdef OS390BATCH
  +    if (retVal == NULL) {
  +    //
  +    // We failed to open the file using its native format (OE or MVS)
  +    // Try to go an extra step to map the path into a MVS dataset under BATCH:
  +    //
  +    //     /path/path2/filename.ext => //'path.path2.ext(filename)'
  +    //     /path/path2/filename     => //'path.path2.filename'
  +    // and
  +    //     path/path2/filename.ext  => //path.path2.ext(filename)
  +    //     path/path2/filename      => //path.path2.filename
  +
  +    char* datasetName = new char[ strlen(fileName) + 5 ];
  +    char *datasetPos = datasetName, *tmpPos = (char *)fileName;
  +    FileHandle retVal;
  +
  +    // We are in EBCDIC mode here
  +    // Specify "//" to indicate that the filename refers to a non-POSIX file
  +    // or a MVS data set
  +
  +    strcpy(datasetName, "//");
  +    *datasetPos += 2;
  +
  +    // If we have a leading '/' then the path is absolute
  +
  +    if( *tmpPos == '/' ) {
  +        *datasetPos++ = '\'';
  +        tmpPos++;
  +    }
  +
  +    // Find the last '/' in the path - this seperates the path from the
  +    // filename.  Then copy the pathname.
  +
  +    char* pathEnd = strrchr( tmpPos, '/' );
  +    if( pathEnd == NULL ) pathEnd = tmpPos - 1;
  +    while( tmpPos <= pathEnd ) {
  +        switch( *tmpPos ) {
  +                case '/':
  +                        *datasetPos = '.';
  +                        break;
  +                default:
  +                        *datasetPos = *tmpPos;
  +        }
  +        datasetPos++; tmpPos++;
  +    }
  +
  +    // Now we try to locate the extension, and copy that.
  +
  +    char* extStart = strrchr( fileName, '.' );
  +    if ( extStart != NULL ) {
  +        tmpPos = extStart + 1;
  +        while( *tmpPos != '\0' ) {
  +                *datasetPos++ = *tmpPos++;
  +        }
  +        *datasetPos++ = '(';
  +    }
  +
  +    // Now we copy in the filename.
  +
  +    tmpPos = pathEnd + 1;
  +    while( *tmpPos != '\0' && ((extStart == NULL) || (tmpPos < extStart)) ) {
  +        *datasetPos++ = *tmpPos++;
  +    }
  +
  +    // Finally cap off the filename with optional ")" and "'", plus a null
  +    if( extStart != NULL ) *datasetPos++ = ')';
  +    if( *fileName == '/' ) *datasetPos++ = '\'';
  +    *datasetPos = '\0';
  +
  +    retVal = (FILE*)fopen( datasetName , "rb" );
  +
  +    delete [] datasetName;
  +    }
  +#endif
  +    if( retVal == NULL )
  +        return 0;
  +    return retVal;
  +}
  +
   unsigned int
   XMLPlatformUtils::readFileBuffer(  FileHandle      theFile
                                   , const unsigned int    toRead
  @@ -410,7 +455,7 @@
   
       if(ferror((FILE*)theFile))
       {
  -	ThrowXML(XMLPlatformUtilsException, XML4CExcepts::File_CouldNotReadFromFile);
  +		ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotReadFromFile);
       }
   
       return (unsigned int)noOfItemsRead;
  @@ -421,7 +466,7 @@
   {
       // Seek to the start of the file
       if (fseek((FILE*)theFile, 0, SEEK_SET) )
  -	ThrowXML(XMLPlatformUtilsException, XML4CExcepts::File_CouldNotResetFile);
  +	ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotResetFile);
   }
   
   
  @@ -450,13 +495,14 @@
   
       // Use a local buffer that is big enough for the largest legal path
       char *absPath = new char[_POSIX_PATH_MAX];
  -        //get the absolute path
  -        char* retPath = realpath(newSrc, absPath);
  -    ArrayJanitor<char> janText2(retPath);
  +    ArrayJanitor<char> janText2(absPath);
  +	//get the absolute path
  +	char* retPath = realpath(newSrc, absPath);
   
  +
       if (!retPath)
       {
  -                ThrowXML(XMLPlatformUtilsException, XML4CExcepts::File_CouldNotGetBasePathName);
  +                ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotGetBasePathName);
       }
       return XMLString::transcode(absPath);
   }
  @@ -585,7 +631,8 @@
   
               // The base cannot provide enough levels, so its in error/
               if (basePtr < basePath)
  -                ThrowXML(PlatformUtilsException, File_BasePathUnderflow);
  +				ThrowXML(XMLPlatformUtilsException,	XMLExcepts::File_BasePathUnderflow);
  +
           }
       }
   
  @@ -615,11 +662,11 @@
       if (mtxHandle == NULL)
           return;
   #ifdef OS390BATCH
  -    if (__isPosixOn()) {
  +    if (posixIsOn) {
   #endif
       if (pthread_mutex_destroy( (pthread_mutex_t*)mtxHandle))
       {
  -	ThrowXML(XMLPlatformUtilsException, XML4CExcepts::Mutex_CouldNotDestroy);
  +	ThrowXML(XMLPlatformUtilsException, XMLExcepts::Mutex_CouldNotDestroy);
       }
       if ( (pthread_mutex_t*)mtxHandle)
           delete mtxHandle;
  @@ -636,11 +683,11 @@
       if (mtxHandle == NULL)
           return;
   #ifdef OS390BATCH
  -    if (__isPosixOn()) {
  +    if (posixIsOn) {
   #endif
       if (pthread_mutex_lock( (pthread_mutex_t*)mtxHandle))
       {
  -	ThrowXML(XMLPlatformUtilsException, XML4CExcepts::Mutex_CouldNotLock);
  +	ThrowXML(XMLPlatformUtilsException, XMLExcepts::Mutex_CouldNotLock);
       }
   #ifdef OS390BATCH
       } // __isPosixOn
  @@ -649,7 +696,7 @@
   
       do {
           unlocked = 0;
  -        compareAndSwap( (void**) &mtxHandle, (void*) &locked, (void*) &unlocked );
  +        compareAndSwap( (void**) &mtxHandle, (void*) locked, (void*) unlocked );
       } while( unlocked != 0 );
       }
   #endif
  @@ -659,12 +706,12 @@
   void* XMLPlatformUtils::makeMutex()
   {
   #ifdef OS390BATCH
  -    if (__isPosixOn()) {
  +    if (posixIsOn) {
   #endif
       pthread_mutex_t* mutex = new pthread_mutex_t;
       if (mutex == NULL)
       {
  -	ThrowXML(XMLPlatformUtilsException, XML4CExcepts::Mutex_CouldNotCreate);
  +	ThrowXML(XMLPlatformUtilsException, XMLExcepts::Mutex_CouldNotCreate);
       }
   
       pthread_mutexattr_t*  attr = new pthread_mutexattr_t;
  @@ -673,7 +720,7 @@
       if (pthread_mutex_init(mutex, attr))
       {
           ThrowXML(XMLPlatformUtilsException,
  -                XML4CExcepts::Mutex_CouldNotCreate);
  +                XMLExcepts::Mutex_CouldNotCreate);
       }
       pthread_mutexattr_destroy(attr);
       delete attr;
  @@ -694,11 +741,11 @@
       if (mtxHandle == NULL)
           return;
   #ifdef OS390BATCH
  -    if (__isPosixOn()) {
  +    if (posixIsOn) {
   #endif
       if (pthread_mutex_unlock( (pthread_mutex_t*)mtxHandle))
       {
  -	ThrowXML(XMLPlatformUtilsException, XML4CExcepts::Mutex_CouldNotUnlock);
  +	ThrowXML(XMLPlatformUtilsException, XMLExcepts::Mutex_CouldNotUnlock);
       }
   #ifdef OS390BATCH
       } // __isPosixOn
  
  
  
  1.10      +6 -35     xml-xerces/c/tests/Makefile.incl
  
  Index: Makefile.incl
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/tests/Makefile.incl,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Makefile.incl	2000/08/30 22:21:40	1.9
  +++ Makefile.incl	2000/09/11 18:44:05	1.10
  @@ -53,41 +53,9 @@
   # on the Apache Software Foundation, please see
   # <http://www.apache.org/>.
   #
  -#
  -# $Log: Makefile.incl,v $
  -# Revision 1.9  2000/08/30 22:21:40  andyh
  -# Unix Build script fixes.  Clean up some UNIX compiler warnings.
  -#
  -# Revision 1.8  2000/06/09 23:45:03  rahulj
  -# More PTX port related changes submitted by
  -# Sumit Chawla <su...@us.ibm.com>.
  -#
  -# Revision 1.7  2000/06/03 01:13:51  aruna1
  -# Version number consolidated into single file for unix
  -#
  -# Revision 1.6  2000/06/02 01:04:32  aruna1
  -# Modifed version no. to  1_2
  -#
  -# Revision 1.5  2000/04/04 20:10:16  abagchi
  -# Added PTX support
  -#
  -# Revision 1.4  2000/02/26 07:20:18  rahulj
  -#  - The threading tests now work on HPUX.
  -#  - Under HPUX 10.20 we do no build DOMMemTest and DOMTest.
  -#    It crashes the compiler.
  -#  - One could not write more worse makefiles than what exists for the
  -#    tests. Hopefully, I will get bugged enough to fix them oneday.
  -#
  -# Revision 1.3  2000/02/26 03:50:10  rahulj
  -# Auto aggregate initializations, requires the +a1 flag with CC under HPUX 10.
  -#
  -# Revision 1.2  2000/02/06 07:48:34  rahulj
  -# Year 2K copyright swat.
  -#
  -# Revision 1.1  2000/01/31 22:21:53  aruna1
  -# initial checkin
  -#
  +
   #
  +# $Id: Makefile.incl,v 1.10 2000/09/11 18:44:05 aruna1 Exp $
   #
   
   ################## LIBRARY NAMES AND DIRECTORIES ##################
  @@ -153,7 +121,7 @@
   CC= g++ -c -D${PLATFORM} -D_REENTRANT -fpic -instances=static
   LINK =  g++ -D${PLATFORM} -fpic
   PLATFORM_LIB_LINK_OPTIONS=-L/usr/lib -L/usr/local/lib
  -EXTRA_LINK_OPTIONS=-lc -Wl,-rpath-link,$(XERCESCROOT)/lib
  +EXTRA_LINK_OPTIONS=-lc
   SHLIBSUFFIX=.so
   endif
   
  @@ -208,9 +176,9 @@
   CMP= -c -DOS390 ${CXXFLAGS}
   ## OS390BATCH
   ifeq (${OS390BATCH},1)
  -CC = _CXX_CXXSUFFIX="cpp" _CXX_STEPS="-1" c++ -W0,"langlvl(extended)" -DOS390 -DOPEN_THREADS -D_XOPEN_SOURCE_EXTENDED -DOS390BATCH
  +CC = _CXX_CXXSUFFIX="cpp" _CXX_STEPS="-1" c++ -W0,"langlvl(extended)" -DOS390 -D_OPEN_THREADS -D_XOPEN_SOURCE_EXTENDED -DOS390BATCH
   else
  -CC = _CXX_CXXSUFFIX="cpp" _CXX_STEPS="-1" c++ -W0,"langlvl(extended)" -DOS390 -DOPEN_THREADS -D_XOPEN_SOURCE_EXTENDED
  +CC = _CXX_CXXSUFFIX="cpp" _CXX_STEPS="-1" c++ -W0,"langlvl(extended)" -DOS390 -D_OPEN_THREADS -D_XOPEN_SOURCE_EXTENDED
   endif
   LINK =  ${CC}
   PLATFORM_LIB_LINK_OPTIONS=
  @@ -219,7 +187,7 @@
   OS390SIDEDECK=.x
   ## OS390BATCH
   ifeq (${OS390BATCH},1)
  -LIBRARY_NAMES="//'${LOADEXP}(XERCES11)'"
  +LIBRARY_NAMES="//'${LOADEXP}(IXM4C33)'"
   else
   LIBRARY_NAMES=${LIB_DIR}/lib${LIBNAME}${VER}${OS390SIDEDECK}
   endif
  
  
  
  1.4       +41 -23    xml-xerces/c/tests/DOM/DOMIDTest/DOMIDTest.cpp
  
  Index: DOMIDTest.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/tests/DOM/DOMIDTest/DOMIDTest.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DOMIDTest.cpp	2000/05/16 18:56:41	1.3
  +++ DOMIDTest.cpp	2000/09/11 18:44:09	1.4
  @@ -1,37 +1,37 @@
   /*
    * The Apache Software License, Version 1.1
  - * 
  + *
    * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
    * reserved.
  - * 
  + *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
  - * 
  + *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  - * 
  + *    notice, this list of conditions and the following disclaimer.
  + *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
    *    the documentation and/or other materials provided with the
    *    distribution.
  - * 
  + *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  + *    if any, must include the following acknowledgment:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowledgment may appear in the software itself,
    *    if and wherever such third-party acknowledgments normally appear.
  - * 
  + *
    * 4. The names "Xerces" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache\@apache.org.
  - * 
  + *
    * 5. Products derived from this software may not be called "Apache",
    *    nor may "Apache" appear in their name, without prior written
    *    permission of the Apache Software Foundation.
  - * 
  + *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  @@ -45,7 +45,7 @@
    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    * SUCH DAMAGE.
    * ====================================================================
  - * 
  + *
    * This software consists of voluntary contributions made by many
    * individuals on behalf of the Apache Software Foundation, and was
    * originally based on software copyright (c) 1999, International
  @@ -146,7 +146,25 @@
   //  Small in-memory test document
   //
   // ---------------------------------------------------------------------------
  +#ifdef OS390
       static const char*  TestDoc1 =
  +"<?xml version='1.0' encoding='ibm-1047-s390'?>     \n\
  +<!DOCTYPE doc [                             \n\
  +<!ELEMENT doc  (elA | elB)*>                \n\
  +<!ELEMENT elA             (#PCDATA)>        \n\
  +<!ELEMENT elB             (#PCDATA)>        \n\
  +<!ATTLIST elA    id ID    #IMPLIED>         \n\
  +<!ATTLIST elB    id CDATA #IMPLIED>         \n\
  +]>                                          \n\
  +                                            \n\
  +<doc>                                       \n\
  +    <elA id='a001'/>                        \n\
  +    <elB id='a002'/>                        \n\
  +    <elA id='a003'/>                        \n\
  +</doc>                                      \n\
  +";
  +#else
  +    static const char*  TestDoc1 =
   "<?xml version='1.0' encoding='ascii'?>     \n\
   <!DOCTYPE doc [                             \n\
   <!ELEMENT doc  (elA | elB)*>                \n\
  @@ -162,7 +180,7 @@
       <elA id='a003'/>                        \n\
   </doc>                                      \n\
   ";
  -
  +#endif
   
   int main()
   {
  @@ -173,7 +191,7 @@
       }
       catch (const XMLException& toCatch)
       {
  -         fprintf(stderr, "Error during initialization! Message: \n%s\n", 
  +         fprintf(stderr, "Error during initialization! Message: \n%s\n",
                 XMLString::transcode(toCatch.getMessage()));
            return 1;
       }
  @@ -205,20 +223,20 @@
       {
           DOM_Element elA = doc.getElementById("a001");
           TASSERT(elA != 0);
  -        
  +
           DOM_Element elB = doc.getElementById("a002");
           TASSERT(elB == 0);
  -        
  +
           DOM_Element elC = doc.getElementById("a003");
           TASSERT(elC != 0);
           TASSERT(elC != elA);
  -        
  +
           DOMString s = elA.getAttribute("id");
           TASSERT(s.equals("a001"));
  -        
  +
           s = elC.getAttribute("id");
           TASSERT(s.equals("a003"));
  -        
  +
       }
       TESTEPILOG;
   
  @@ -246,16 +264,16 @@
           // This one should get an element
           DOM_Element elA = doc.getElementById("a001");
           TASSERT(!elA.isNull());
  -        
  +
           DOM_Node parent = elA.getParentNode();
           parent.removeChild(elA);
           elA = 0;
  -        
  +
           // This one should NOT get an element
  -        elA = doc.getElementById("a001");  
  +        elA = doc.getElementById("a001");
           TASSERT(elA.isNull());
       }
  -        
  +
       doc = 0;
       delete parser;
       delete memBufIS;
  
  
  
  1.4       +2 -2      xml-xerces/c/tests/DOM/DOMIDTest/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/tests/DOM/DOMIDTest/Makefile.in,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Makefile.in	2000/06/19 22:44:59	1.3
  +++ Makefile.in	2000/09/11 18:44:10	1.4
  @@ -54,7 +54,7 @@
   # <http://www.apache.org/>.
   # 
   #
  -# $Id: Makefile.in,v 1.3 2000/06/19 22:44:59 aruna1 Exp $
  +# $Id: Makefile.in,v 1.4 2000/09/11 18:44:10 aruna1 Exp $
   #
   #
   
  @@ -92,7 +92,7 @@
   
   ## OS390BATCH
   ifeq (${OS390BATCH},1)
  -BATCH_TARGET= "//'${LOADMOD}(${APP_NAME})'"
  +BATCH_TARGET= "//'${LOADMOD}(DOMIDTST)'"
   all: makedir ${BATCH_TARGET}
   else
   all: makedir ${EXEC}/${APP_NAME}
  
  
  
  1.8       +2 -2      xml-xerces/c/tests/DOM/DOMMemTest/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/tests/DOM/DOMMemTest/Makefile.in,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Makefile.in	2000/06/19 22:45:09	1.7
  +++ Makefile.in	2000/09/11 18:44:13	1.8
  @@ -54,7 +54,7 @@
   # <http://www.apache.org/>.
   # 
   #
  -# $Id: Makefile.in,v 1.7 2000/06/19 22:45:09 aruna1 Exp $
  +# $Id: Makefile.in,v 1.8 2000/09/11 18:44:13 aruna1 Exp $
   #
   #
   
  @@ -92,7 +92,7 @@
   
   ## OS390BATCH
   ifeq (${OS390BATCH},1)
  -BATCH_TARGET= "//'${LOADMOD}(${APP_NAME})'"
  +BATCH_TARGET= "//'${LOADMOD}(DOMEMTST)'"
   all: makedir ${BATCH_TARGET}
   else
   all: makedir ${EXEC}/${APP_NAME}
  
  
  
  1.2       +2 -2      xml-xerces/c/tests/DOM/RangeTest/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/tests/DOM/RangeTest/Makefile.in,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Makefile.in	2000/07/28 01:33:39	1.1
  +++ Makefile.in	2000/09/11 18:44:16	1.2
  @@ -54,7 +54,7 @@
   # <http://www.apache.org/>.
   # 
   #
  -# $Id: Makefile.in,v 1.1 2000/07/28 01:33:39 aruna1 Exp $
  +# $Id: Makefile.in,v 1.2 2000/09/11 18:44:16 aruna1 Exp $
   #
   #
   
  @@ -92,7 +92,7 @@
   
   ## OS390BATCH
   ifeq (${OS390BATCH},1)
  -BATCH_TARGET= "//'${LOADMOD}(${APP_NAME})'"
  +BATCH_TARGET= "//'${LOADMOD}(RANGETST)'"
   all: makedir ${BATCH_TARGET}
   else
   all: makedir ${EXEC}/${APP_NAME}
  
  
  
  1.6       +2 -2      xml-xerces/c/tests/DOM/Traversal/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/tests/DOM/Traversal/Makefile.in,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Makefile.in	2000/06/19 22:45:28	1.5
  +++ Makefile.in	2000/09/11 18:44:20	1.6
  @@ -54,7 +54,7 @@
   # <http://www.apache.org/>.
   # 
   #
  -# $Id: Makefile.in,v 1.5 2000/06/19 22:45:28 aruna1 Exp $
  +# $Id: Makefile.in,v 1.6 2000/09/11 18:44:20 aruna1 Exp $
   #
   #
   
  @@ -92,7 +92,7 @@
   
   ## OS390BATCH
   ifeq (${OS390BATCH},1)
  -BATCH_TARGET= "//'${LOADMOD}(${APP_NAME})'"
  +BATCH_TARGET= "//'${LOADMOD}(TRAVERSA)'"
   all: makedir ${BATCH_TARGET}
   else
   all: makedir ${EXEC}/${APP_NAME}
  
  
  
  1.6       +2 -2      xml-xerces/c/tests/EncodingTest/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/tests/EncodingTest/Makefile.in,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Makefile.in	2000/06/19 22:44:40	1.5
  +++ Makefile.in	2000/09/11 18:44:25	1.6
  @@ -54,7 +54,7 @@
   # <http://www.apache.org/>.
   # 
   #
  -# $Id: Makefile.in,v 1.5 2000/06/19 22:44:40 aruna1 Exp $
  +# $Id: Makefile.in,v 1.6 2000/09/11 18:44:25 aruna1 Exp $
   #
   
   ###################################################################
  @@ -90,7 +90,7 @@
   
   ## OS390BATCH
   ifeq (${OS390BATCH},1)
  -BATCH_TARGET= "//'${LOADMOD}(${APP_NAME})'"
  +BATCH_TARGET= "//'${LOADMOD}(ENCDNTST)'"
   all: makedir ${BATCH_TARGET}
   else
   all: makedir ${EXEC}/${APP_NAME}
  
  
  
  1.7       +2 -2      xml-xerces/c/tests/ThreadTest/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/tests/ThreadTest/Makefile.in,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Makefile.in	2000/06/19 22:44:52	1.6
  +++ Makefile.in	2000/09/11 18:44:29	1.7
  @@ -54,7 +54,7 @@
   # <http://www.apache.org/>.
   # 
   #
  -# $Id: Makefile.in,v 1.6 2000/06/19 22:44:52 aruna1 Exp $
  +# $Id: Makefile.in,v 1.7 2000/09/11 18:44:29 aruna1 Exp $
   #
   
   ###################################################################
  @@ -90,7 +90,7 @@
   
   ## OS390BATCH
   ifeq (${OS390BATCH},1)
  -BATCH_TARGET= "//'${LOADMOD}(${APP_NAME})'"
  +BATCH_TARGET= "//'${LOADMOD}(THREDTST)'"
   all: makedir ${BATCH_TARGET}
   else
   all: makedir ${EXEC}/${APP_NAME}
  
  
  
  1.10      +78 -59    xml-xerces/c/tests/ThreadTest/ThreadTest.cpp
  
  Index: ThreadTest.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/tests/ThreadTest/ThreadTest.cpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ThreadTest.cpp	2000/03/13 21:06:03	1.9
  +++ ThreadTest.cpp	2000/09/11 18:44:30	1.10
  @@ -1,37 +1,37 @@
   /*
    * The Apache Software License, Version 1.1
  - * 
  + *
    * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
    * reserved.
  - * 
  + *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
  - * 
  + *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  - * 
  + *    notice, this list of conditions and the following disclaimer.
  + *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
    *    the documentation and/or other materials provided with the
    *    distribution.
  - * 
  + *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  + *    if any, must include the following acknowledgment:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowledgment may appear in the software itself,
    *    if and wherever such third-party acknowledgments normally appear.
  - * 
  + *
    * 4. The names "Xerces" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache\@apache.org.
  - * 
  + *
    * 5. Products derived from this software may not be called "Apache",
    *    nor may "Apache" appear in their name, without prior written
    *    permission of the Apache Software Foundation.
  - * 
  + *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  @@ -45,7 +45,7 @@
    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    * SUCH DAMAGE.
    * ====================================================================
  - * 
  + *
    * This software consists of voluntary contributions made by many
    * individuals on behalf of the Apache Software Foundation, and was
    * originally based on software copyright (c) 1999, International
  @@ -54,6 +54,10 @@
    * <http://www.apache.org/>.
    */
   
  +/*
  +* $Id: ThreadTest.cpp,v 1.10 2000/09/11 18:44:30 aruna1 Exp $
  +*/
  +
   #include <stdlib.h>
   #include <stdio.h>
   #include <string.h>
  @@ -100,7 +104,7 @@
   }
   
   
  -#elif defined (AIX) || defined(SOLARIS) || defined(LINUX) || defined(HPUX)
  +#elif defined (AIX) || defined(SOLARIS) || defined(LINUX) || defined(HPUX) || defined (OS390)
   #include <pthread.h>
   #include <unistd.h>
   #include <errno.h>
  @@ -112,6 +116,10 @@
   //
   //------------------------------------------------------------------------------
   
  +#ifdef OS390
  +extern "C" {
  +#endif
  +
   
   typedef void (*ThreadFunc)(void *);
   typedef void *(*pthreadfunc)(void *);
  @@ -119,7 +127,7 @@
   class ThreadFuncs           // This class isolates OS dependent threading
   {                           //   functions from the rest of ThreadTest program.
   public:
  -    static void Sleep(int millis); 
  +    static void Sleep(int millis);
       static void startThread(ThreadFunc, void *param);
   };
   
  @@ -141,7 +149,7 @@
       x = pthread_create( &tId, pthread_attr_default,  (pthreadfunc)func,  param);
   #else
       pthread_attr_t attr;
  -    pthread_attr_init(&attr); 
  +    pthread_attr_init(&attr);
       x = pthread_create( &tId, &attr,  (pthreadfunc)func,  param);
   #endif
       if (x == -1)
  @@ -149,8 +157,11 @@
           fprintf(stderr, "Error starting thread.  Errno = %d\n", errno);
           exit(-1);
       }
  -    
  -}    
  +
  +}
  +#ifdef OS390
  +}
  +#endif
   #else
   #error This platform is not supported
   #endif
  @@ -326,14 +337,14 @@
           fSAXParser->setDocumentHandler(this);
           fSAXParser->setErrorHandler(this);
       }
  -    
  +
   }
   
   
   
   ThreadParser::~ThreadParser()
   {
  -     delete fSAXParser; 
  +     delete fSAXParser;
        delete fDOMParser;
   }
   
  @@ -356,12 +367,12 @@
                                          fInfo->fileName,
                                          false);
       }
  -        
  +
       try
       {
           if (gRunInfo.dom) {
               // Do a DOM parse
  -            if (gRunInfo.inMemory) 
  +            if (gRunInfo.inMemory)
                   fDOMParser->parse(*mbis);
               else
                   fDOMParser->parse(fInfo->fileName);
  @@ -370,14 +381,14 @@
           }
           else
           {
  -            // Do a SAX parse 
  -            if (gRunInfo.inMemory) 
  +            // Do a SAX parse
  +            if (gRunInfo.inMemory)
                   fSAXParser->parse(*mbis);
               else
                   fSAXParser->parse(fInfo->fileName);
           }
       }
  -    
  +
       catch (const XMLException& e)
       {
           char *exceptionMessage = XMLString::transcode(e.getMessage());
  @@ -385,7 +396,7 @@
               fInfo->fileName, exceptionMessage);
           delete exceptionMessage;
       }
  -    
  +
       delete mbis;
       return fCheckSum;
   }
  @@ -452,9 +463,9 @@
       DOM_Node          child;
       DOM_NamedNodeMap  attributes;
   
  -    switch (node.getNodeType() ) 
  +    switch (node.getNodeType() )
       {
  -    case DOM_Node::ELEMENT_NODE: 
  +    case DOM_Node::ELEMENT_NODE:
           {
               s = node.getNodeName();   // the element name
   
  @@ -503,8 +514,8 @@
           }
       }
   }
  - 
   
  +
   //
   // Recompute the checksum.  Meaningful only for DOM, will tell us whether
   //  a failure is transient, or whether the DOM data is permanently corrupted.
  @@ -539,9 +550,9 @@
       DOM_Node          child;
       DOM_NamedNodeMap  attributes;
   
  -    switch (node.getNodeType() ) 
  +    switch (node.getNodeType() )
       {
  -    case DOM_Node::ELEMENT_NODE: 
  +    case DOM_Node::ELEMENT_NODE:
           {
               DOMString("<").print();
               node.getNodeName().print();   // the element name
  @@ -556,7 +567,7 @@
   
               for (child=node.getFirstChild(); child!=0; child=child.getNextSibling())
                   domPrint(child);
  -            
  +
               DOMString("</").print();
               node.getNodeName().print();
               DOMString(">").print();
  @@ -594,7 +605,7 @@
           }
       }
   }
  - 
  +
   
   
   
  @@ -622,7 +633,7 @@
       gRunInfo.dumpOnErr = false;
       gRunInfo.totalTime = 0;
       gRunInfo.numInputFiles = 0;
  -    
  +
       try             // Use exceptions for command line syntax errors.
       {
           int argnum = 1;
  @@ -640,7 +651,7 @@
                   gRunInfo.reuseParser = true;
               else if (strcmp(argv[argnum], "-dump") == 0)
                   gRunInfo.dumpOnErr = true;
  -            else if (strcmp(argv[argnum], "-mem") == 0) 
  +            else if (strcmp(argv[argnum], "-mem") == 0)
                   gRunInfo.inMemory = true;
               else if (strcmp(argv[argnum], "-threads") == 0)
               {
  @@ -676,9 +687,9 @@
                   }
                   gRunInfo.files[gRunInfo.numInputFiles-1].fileName = argv[argnum];
               }
  -            argnum++; 
  +            argnum++;
           }
  -        
  +
           // We've made it through the command line.
           //  Verify that at least one input file to be parsed was specified.
           if (gRunInfo.numInputFiles == 0)
  @@ -686,8 +697,8 @@
               fprintf(stderr, "No input XML file specified on command line.\n");
               throw 1;
           };
  -        
  -        
  +
  +
       }
       catch (int)
       {
  @@ -722,7 +733,7 @@
       int     fileNum;
       FILE    *fileF;
       size_t  t;
  -    
  +
       if (gRunInfo.inMemory)
       {
           for (fileNum = 0; fileNum <gRunInfo.numInputFiles; fileNum++)
  @@ -764,6 +775,10 @@
   //
   //----------------------------------------------------------------------
   
  +#ifdef OS390
  +extern "C" {
  +#endif
  +
   void threadMain (void *param)
   {
       ThreadInfo   *thInfo = (ThreadInfo *)param;
  @@ -780,29 +795,29 @@
       //
       while (true)
       {
  -        
  +
           if (thParser == 0)
               thParser = new ThreadParser;
  -        
  +
           docNum++;
  -        
  +
           if (docNum >= gRunInfo.numInputFiles)
               docNum = 0;
  -        
  +
           InFileInfo *fInfo = &gRunInfo.files[docNum];
  -        
  +
           if (gRunInfo.verbose )
               printf("Thread #%d: starting file %s\n", thInfo->fThreadNum, fInfo->fileName);
  -        
  -        
  +
  +
           int checkSum = 0;
           checkSum = thParser->parse(docNum);
  -        
  +
           if (checkSum != gRunInfo.files[docNum].checkSum)
           {
               fprintf(stderr, "\nThread %d: Parse Check sum error on file  \"%s\".  Expected %x,  got %x\n",
                   thInfo->fThreadNum, fInfo->fileName, fInfo->checkSum, checkSum);
  -            
  +
               // Revisit - let the loop continue to run?
               int secondTryCheckSum = thParser->reCheck();
               fprintf(stderr, "   Retry checksum is %x\n", secondTryCheckSum);
  @@ -811,19 +826,23 @@
               fflush(stdout);
               exit(-1);
           }
  -        
  +
           if (gRunInfo.reuseParser == false)
           {
               delete thParser;
               thParser = 0;
           }
  -        
  -        
  +
  +
           thInfo->fHeartBeat = true;
           thInfo->fParses++;
       }
   }
   
  +#ifdef OS390
  +}
  +#endif
  +
   
   
   
  @@ -834,8 +853,8 @@
   //----------------------------------------------------------------------
   
   int main (int argc, char **argv)
  -{   
  -    
  +{
  +
   
       parseCommandLine(argc, argv);
   
  @@ -902,9 +921,9 @@
   
       if (gRunInfo.numThreads == 0)
           exit(0);
  -    
  +
       gThreadInfo = new ThreadInfo[gRunInfo.numThreads];
  -    
  +
       int threadNum;
       for (threadNum=0; threadNum < gRunInfo.numThreads; threadNum++)
       {
  @@ -917,7 +936,7 @@
       //    Each second, display "+" when all threads have completed a parse
       //                 display "." if some thread hasn't since previous "+"
       //
  -    
  +
       unsigned long startTime = XMLPlatformUtils::getCurrentMillis();
       int elapsedSeconds = 0;
       while (gRunInfo.totalTime == 0 || gRunInfo.totalTime > elapsedSeconds)
  @@ -943,14 +962,14 @@
           }
           elapsedSeconds = (XMLPlatformUtils::getCurrentMillis() - startTime) / 1000;
       };
  -    
  +
       //
       //  Time's up, we are done.  (We only get here if this was a timed run)
       //  Tally up the total number of parses completed by each of the threads.
       //  To Do:  Run the main thread at higher priority, so that the worker threads
       //    won't make much progress while we are adding up the results.
  -    //  
  -    double totalParsesCompleted = 0;       
  +    //
  +    double totalParsesCompleted = 0;
       for (threadNum=0; threadNum < gRunInfo.numThreads; threadNum++)
       {
           totalParsesCompleted += gThreadInfo[threadNum].fParses;