Changeset 11694 for trunk/psLib/src/sys/psError.h
- Timestamp:
- Feb 7, 2007, 3:59:28 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psError.h (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psError.h
r11674 r11694 10 10 * @author RHL, Princeton 11 11 * @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 $ 15 16 * 16 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 55 56 ); 56 57 58 57 59 /** Get last error put on the error stack 58 60 * … … 64 66 psErr* psErrorLast(void); 65 67 68 66 69 /** Get errorCode of last error put on the error stack 67 70 * … … 70 73 psErrorCode psErrorCodeLast(void); 71 74 75 72 76 /** Clears the error stack. 73 77 * … … 77 81 void psErrorClear(void); 78 82 83 79 84 /** Get the error stack depth 80 85 * … … 82 87 */ 83 88 long psErrorGetStackSize(); 89 84 90 85 91 /** Prints error stack to specified open file descriptor … … 91 97 * 92 98 */ 93 #ifdef __GNUC__94 99 void psErrorStackPrint( 95 100 FILE* fd, ///< destination file descriptor 96 101 const char* format, ///< printf-style format of header line 97 102 ... ///< any parameters required in format 103 #ifdef __GNUC__ 98 104 ) __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__ 106 108 107 109 … … 120 122 va_list va ///< any parameters required in format 121 123 ); 122 #endif // #ifndef SWIG123 124 #ifdef DOXYGEN 124 #endif // ifndef SWIG 125 126 125 127 /** Reports an error message to the logging facility 126 128 * … … 133 135 * @return psErrorCode the given error code 134 136 */ 137 #ifdef DOXYGEN 135 138 psErrorCode psError( 136 139 psErrorCode code, ///< Error class code … … 139 142 ... ///< any parameters required in format 140 143 ); 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 166 145 psErrorCode p_psError( 167 146 const char* filename, ///< file name … … 172 151 const char* format, ///< printf-style format of header line 173 152 ... ///< any parameters required in format 153 #ifdef __GNUC__ 174 154 ) __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 186 164 187 165 /** Logs a warning message. 188 166 * 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 173 void psWarning( 174 const char* format, ///< printf-style format of header line 175 ... ///< any parameters required in format 176 ); 177 #else // #ifdef DOXYGEN 195 178 void p_psWarning( 196 179 const char* file, ///< file name … … 199 182 const char* format, ///< printf-style format of header line 200 183 ... ///< any parameters required in format 184 #ifdef __GNUC__ 201 185 ) __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__ 213 189 #ifndef SWIG 214 #define ps Error(code,new,...) p_psError(__FILE__,__LINE__,__func__,code,new,__VA_ARGS__)215 #define psWarning(...)p_psWarning(__FILE__,__LINE__,__func__,__VA_ARGS__)216 #endif // #ifndef SWIG217 218 #endif // ! DOXYGEN 190 #define psWarning(...) \ 191 p_psWarning(__FILE__,__LINE__,__func__,__VA_ARGS__) 192 #endif // ifndef SWIG 193 #endif // ifdef DOXYGEN 194 219 195 220 196 /** Create a new psErr struct
Note:
See TracChangeset
for help on using the changeset viewer.
