Changeset 1685 for trunk/psLib/src/sys/psError.h
- Timestamp:
- Sep 3, 2004, 10:39:50 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psError.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psError.h
r1683 r1685 12 12 * @author Eric Van Alst, MHPCC 13 13 * 14 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-09-0 2 22:23:20 $14 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-09-03 20:39:50 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 22 22 23 23 #include<stdio.h> 24 #include<stdbool.h> 24 25 25 26 #include "psErrorCodes.h" … … 29 30 */ 30 31 32 /** Error message object */ 31 33 typedef struct 32 34 { 33 char *name; ///< category of code that caused the error35 char* name; ///< category of code that caused the error 34 36 psErrorCode code; ///< class of error 35 char *msg; ///< the message associated with the error37 char* msg; ///< the message associated with the error 36 38 } 37 39 psErr; 38 40 39 const psErr *psErrorGet(int which); 40 const psErr *psErrorLast(void); 41 /** Get a error from the error stack 42 * 43 * Previous errors on the stack are returned by psErrorGet (a value of 0 44 * passed to psErrorGet is equivalent to a call to psErrorLast). 45 * 46 * if no error is at the which position, a non-NULL psErr is returned with 47 * code PS_ERR_NONE. 48 * 49 * @return Error message object at 'which' 50 */ 51 const psErr* psErrorGet( 52 int which ///< position in the error stack. 0 is last error on stack. 53 ); 54 55 /** Get last error put on the error stack 56 * 57 * The last error reported is available from psErrorLast; if no errors are 58 * current, a non-NULL psErr is returned with code PS_ERR_NONE. 59 * 60 * @return psErr* Reference to last error message on error stack 61 */ 62 const psErr* psErrorLast(void); 63 64 /** Clears the error stack. 65 * 66 * The error stack may be completely cleared with psErrorClear. 67 * 68 */ 41 69 void psErrorClear(void); 42 70 43 void psErrorStackPrint(FILE *fd, const char *fmt, ...); 44 void psErrorStackPrintV(FILE *fd, const char *fmt, va_list va); 71 /** Prints error stack to specified open file descriptor 72 * 73 * The entire error stack may be printed to an open file descriptor by 74 * calling psErrorStackPrint; if and only if there are current errors, the 75 * printf-style string fmt is first printed to the file descriptor fd. In 76 * this printout, error codes are replaced by their string equivalents. 77 * 78 */ 79 void psErrorStackPrint( 80 FILE* fd, ///< destination file descriptor 81 const char* fmt, ///< printf-style format of header line 82 ... ///< any parameters required in fmt 83 ); 84 85 /** Prints error stack to specified open file descriptor 86 * 87 * The entire error stack may be printed to an open file descriptor by 88 * calling psErrorStackPrintV; if and only if there are current errors, the 89 * vprintf-style string fmt is first printed to the file descriptor fd. In 90 * this printout, error codes are replaced by their string equivalents. 91 * 92 */ 93 void psErrorStackPrintV( 94 FILE* fd, ///< destination file descriptor 95 const char* fmt, ///< printf-style format of header line 96 va_list va ///< any parameters required in fmt 97 ); 45 98 46 99 /** Reports an error message to the logging facility … … 57 110 ); 58 111 112 /** Reports an error message to the logging facility 113 * 114 * This function will invoke the psLogMsg function with a level of 115 * PS_LOG_ERROR and pass the parameters name and fmt to generate a proper 116 * log message. 117 * 118 */ 119 void psErrorMsg( 120 const char *name, ///< Name of error in the form aaa.bbb.ccc 121 psErrorCode code, ///< Error class code 122 bool new, ///< true if error originates at this location 123 const char* fmt, ///< printf style formatting statement defining error message 124 ... 125 ); 126 127 /** Create a new psErr struct 128 * 129 * Creates a new psErr struct, making a copy of the parameters. 130 * 131 * @return psErr* new psErr object 132 */ 133 psErr* psErrAlloc( 134 const char* name, ///< Name of error in the form aaa.bbb.ccc 135 psErrorCode code, ///< Error class code 136 const char* msg ///< Error message 137 ); 138 59 139 /* @} */// End of SysUtils Functions 60 140
Note:
See TracChangeset
for help on using the changeset viewer.
