IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 12, 2008, 10:18:27 PM (18 years ago)
Author:
eugene
Message:

adding psAssert function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psAbort.c

    r11686 r17446  
    1111 *  @author Joshua Hoblitt, University of Hawaii
    1212 *   
    13  *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2007-02-07 23:52:54 $
     13 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2008-04-13 08:18:27 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4949    abort();
    5050}
     51
     52void p_psAssert(const char *file,
     53                unsigned int lineno,
     54                const char *func,
     55                const bool value,
     56                const char *format,
     57                ...)
     58{
     59    if (value) return;
     60    psErrorStackPrint(stderr, "Aborting. Error stack:");
     61
     62    va_list argPtr;             // variable list arguement pointer
     63    // Get the variable list parameters to pass to logging function
     64    va_start(argPtr, format);
     65
     66    // Call logging function with PS_LOG_ABORT level
     67    psLogMsgV("psLib.sys", PS_LOG_ABORT, format, argPtr);
     68
     69    // Clean up stack after variable arguement has been used
     70    va_end(argPtr);
     71
     72    // Call system abort function to terminate program execution
     73    abort();
     74}
Note: See TracChangeset for help on using the changeset viewer.