You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by pe...@apache.org on 2003/03/09 17:59:11 UTC

cvs commit: xml-xerces/c/src/xercesc/util/Platforms/OS400 OS400PlatformUtils.cpp

peiyongz    2003/03/09 08:59:11

  Modified:    c/src/xercesc/util/Platforms/OS400 OS400PlatformUtils.cpp
  Log:
  PanicHandler
  
  Revision  Changes    Path
  1.6       +26 -17    xml-xerces/c/src/xercesc/util/Platforms/OS400/OS400PlatformUtils.cpp
  
  Index: OS400PlatformUtils.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Platforms/OS400/OS400PlatformUtils.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- OS400PlatformUtils.cpp	4 Nov 2002 15:13:01 -0000	1.5
  +++ OS400PlatformUtils.cpp	9 Mar 2003 16:59:11 -0000	1.6
  @@ -69,6 +69,7 @@
   #include    <xercesc/util/Janitor.hpp>
   #include    <xercesc/util/XMLString.hpp>
   #include    <xercesc/util/XMLUniDefs.hpp>
  +#include    <xercesc/util/PanicHandler.hpp>
   #include    <stdio.h>
   #include    <stdlib.h>
   #include    <errno.h>
  @@ -159,7 +160,7 @@
   
       catch(...)
       {
  -        panic( XMLPlatformUtils::Panic_CantLoadMsgDomain );
  +        panic( PanicHandler::Panic_CantLoadMsgDomain );
       }
       return retVal;
   }
  @@ -167,24 +168,32 @@
   // ---------------------------------------------------------------------------
   //  XMLPlatformUtils: The panic method
   // ---------------------------------------------------------------------------
  -void XMLPlatformUtils::panic(const PanicReasons reason)
  +void XMLPlatformUtils::panic(const PanicHandler::PanicReasons reason)
   {
  +	
  +    if (fgUserPanicHandler)
  +    {
  +    	fgUserPanicHandler->panic(reason);
  +    }
  + 	
       //
       //  We just print a message and exit, Note we are currently dependent on
       // the number of reasons being under 10 for this teo work
       //
  +    else
       {
  -struct reason_code
  - {
  -    char reason_char;
  -    char endofstring;
  - }
  - reason_code;
  - reason_code.reason_char = '0';
  - reason_code.endofstring = '\0';
  - reason_code.reason_char = reason_code.reason_char + reason;
  - send_message((char*)&reason_code,GENERAL_PANIC_MESSAGE,'e');
  -}
  +        struct reason_code
  +        {
  +            char reason_char;
  +            char endofstring;
  +        }reason_code;
  +
  +        reason_code.reason_char = '0';
  +        reason_code.endofstring = '\0';
  +        reason_code.reason_char = reason_code.reason_char + reason;
  +        send_message((char*)&reason_code,GENERAL_PANIC_MESSAGE,'e');
  +    }
  +
   }
   // ---------------------------------------------------------------------------
   //  XMLPlatformUtils: File Methods
  @@ -652,7 +661,7 @@
   		delete gAtomicOpMutex;
   		gAtomicOpMutex = 0;
   
  -        panic( XMLPlatformUtils::Panic_SystemInit );
  +        panic( PanicHandler::Panic_SystemInit );
   	}
   }
   
  @@ -748,14 +757,14 @@
       // Currently its supported only in the kernel mode
   
       if (pthread_mutex_lock( gAtomicOpMutex))
  -        panic(XMLPlatformUtils::Panic_SynchronizationErr);
  +        panic(PanicHandler::Panic_SynchronizationErr);
   
       void *retVal = *toFill;
       if (*toFill == toCompare)
                 *toFill = (void *)newValue;
   
       if (pthread_mutex_unlock( gAtomicOpMutex))
  -        panic(XMLPlatformUtils::Panic_SynchronizationErr);
  +        panic(PanicHandler::Panic_SynchronizationErr);
   
       return retVal;
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org