IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 7, 2007, 3:59:28 PM (19 years ago)
Author:
jhoblitt
Message:

./sys header file cleanup:

formatting/whitespace fixes
add a few additional gcc attributes
mark p_psFileLine as deprecated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psError.h

    r11674 r11694  
    1010 *  @author RHL, Princeton
    1111 *  @author Eric Van Alst, MHPCC
    12  *
    13  *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2007-02-07 01:15:49 $
     12 *  @author Joshua Hoblitt, University of Hawaii
     13 *
     14 *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2007-02-08 01:59:28 $
    1516 *
    1617 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5556);
    5657
     58
    5759/** Get last error put on the error stack
    5860 *
     
    6466psErr* psErrorLast(void);
    6567
     68
    6669/** Get errorCode of last error put on the error stack
    6770 *
     
    7073psErrorCode psErrorCodeLast(void);
    7174
     75
    7276/** Clears the error stack.
    7377 *
     
    7781void psErrorClear(void);
    7882
     83
    7984/** Get the error stack depth
    8085 *
     
    8287 */
    8388long psErrorGetStackSize();
     89
    8490
    8591/** Prints error stack to specified open file descriptor
     
    9197 *
    9298 */
    93 #ifdef __GNUC__
    9499void psErrorStackPrint(
    95100    FILE* fd,                          ///< destination file descriptor
    96101    const char* format,                ///< printf-style format of header line
    97102    ...                                ///< any parameters required in format
     103#ifdef __GNUC__
    98104) __attribute__((format(printf, 2, 3)));
    99 #else // __GNUC__
    100 void psErrorStackPrint(
    101     FILE* fd,                          ///< destination file descriptor
    102     const char* format,                ///< printf-style format of header line
    103     ...                                ///< any parameters required in format
    104 );
    105 #endif // __GNUC__
     105#else // ifdef __GNUC__
     106);
     107#endif // ifdef __GNUC__
    106108
    107109
     
    120122    va_list va                         ///< any parameters required in format
    121123);
    122 #endif // #ifndef SWIG
    123 
    124 #ifdef DOXYGEN
     124#endif // ifndef SWIG
     125
     126
    125127/** Reports an error message to the logging facility
    126128 *
     
    133135 *  @return psErrorCode    the given error code
    134136 */
     137#ifdef DOXYGEN
    135138psErrorCode psError(
    136139    psErrorCode code,                  ///< Error class code
     
    139142    ...                                ///< any parameters required in format
    140143);
    141 
    142 /** Logs a warning message.
    143  *
    144  *  This procedure logs a message to the destination set by a prior
    145  *  call to psLogSetDestination(), This is equivalent to calling
    146  *  psLogMsg with a level of PS_LOG_WARN.
    147  *
    148  */
    149 void psWarning(
    150     const char* format,                ///< printf-style format of header line
    151     ...                                ///< any parameters required in format
    152 );
    153 #else // #ifdef DOXYGEN
    154 
    155 /** Reports an error message to the logging facility
    156  *
    157  *  This function will invoke the psLogMsg function with a level of
    158  *  PS_LOG_ERROR and pass the parameters name and format to generate a proper
    159  *  log message.  This function is used to check a specific code location.
    160  *
    161  *  This function modifies the error stack.
    162  *
    163  *  @return psErrorcode    the given error code
    164  */
    165 #ifdef __GNUC__
     144#else // ifdef DOXYGEN
    166145psErrorCode p_psError(
    167146    const char* filename,              ///< file name
     
    172151    const char* format,                ///< printf-style format of header line
    173152    ...                                ///< any parameters required in format
     153#ifdef __GNUC__
    174154) __attribute__((format(printf, 6, 7)));
    175 #else // __GNUC__
    176 psErrorCode p_psError(
    177     const char* filename,              ///< file name
    178     unsigned int lineno,               ///< line number in file
    179     const char* func,                  ///< function name
    180     psErrorCode code,                  ///< Error class code
    181     bool new,                          ///< true if error originates at this location
    182     const char* format,                ///< printf-style format of header line
    183     ...                                ///< any parameters required in format
    184 );
    185 #endif // __GNUC__
     155#else // ifdef __GNUC__
     156);
     157#endif // ifdef __GNUC__
     158#ifndef SWIG
     159#define psError(code,new,...) \
     160      p_psError(__FILE__,__LINE__,__func__,code,new,__VA_ARGS__)
     161#endif // ifndef SWIG
     162#endif // ifdef DOXYGEN
     163
    186164
    187165/** Logs a warning message.
    188166 *
    189  *  This procedure logs a message to the destination set by a prior call to
    190  *  psLogSetDestination().  This is equivalent to calling psLogMsg with a level of
    191  *  PS_LOG_WARN.  This function is used to check a specific code location.
    192  *
    193 */
    194 #ifdef __GNUC__
     167 *  This procedure logs a message to the destination set by a prior
     168 *  call to psLogSetDestination(), This is equivalent to calling
     169 *  psLogMsg with a level of PS_LOG_WARN.
     170 *
     171 */
     172#ifdef DOXYGEN
     173void psWarning(
     174    const char* format,                ///< printf-style format of header line
     175    ...                                ///< any parameters required in format
     176);
     177#else // #ifdef DOXYGEN
    195178void p_psWarning(
    196179    const char* file,                  ///< file name
     
    199182    const char* format,                ///< printf-style format of header line
    200183    ...                                ///< any parameters required in format
     184#ifdef __GNUC__
    201185) __attribute__((format(printf, 4, 5)));
    202 #else // __GNUC__
    203 void p_psWarning(
    204     const char* file,                  ///< file name
    205     int lineno,                        ///< line number in file
    206     const char* func,                  ///< function name
    207     const char* format,                ///< printf-style format of header line
    208     ...                                ///< any parameters required in format
    209 );
    210 #endif // __GNUC__
    211 
    212 
     186#else // ifdef __GNUC__
     187);
     188#endif // ifdef __GNUC__
    213189#ifndef SWIG
    214 #define psError(code,new,...) p_psError(__FILE__,__LINE__,__func__,code,new,__VA_ARGS__)
    215 #define psWarning(...) p_psWarning(__FILE__,__LINE__,__func__,__VA_ARGS__)
    216 #endif // #ifndef SWIG
    217 
    218 #endif // ! DOXYGEN
     190#define psWarning(...) \
     191      p_psWarning(__FILE__,__LINE__,__func__,__VA_ARGS__)
     192#endif // ifndef SWIG
     193#endif // ifdef DOXYGEN
     194
    219195
    220196/** Create a new psErr struct
Note: See TracChangeset for help on using the changeset viewer.