Changeset 753 for trunk/archive/pslib/include/psError.h
- Timestamp:
- May 20, 2004, 6:12:37 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/archive/pslib/include/psError.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/pslib/include/psError.h
r611 r753 12 12 13 13 typedef struct { 14 psErrorCode code; // An error code15 const char *descrip; // the associated description14 psErrorCode code; ///< An error code 15 const char *descrip; ///< the associated description 16 16 } psErrorDescription; 17 17 18 18 typedef struct { 19 char *name; // category of code that caused the error20 psErrorCode code; // class of error (equivalent to errno)21 char *msg; // the message associated with the error19 char *name; ///< category of code that caused the error 20 psErrorCode code; ///< class of error (equivalent to errno) 21 char *msg; ///< the message associated with the error 22 22 } psErr; 23 24 typedef enum {25 PS_OLD_ERROR = 0, ///< This is an old error, and should append to the error stack26 PS_NEW_ERROR = 1, ///< This is a new error and should clear the error stack27 } psErrorStatus;28 23 29 24 /// Prints an error message and doesn't abort; returns code 30 25 int psError(const char *name, ///< Category of code that caused the error 31 26 psErrorCode code, ///< class of error (equivalent to errno) 32 psErrorStatus status,///< is this a new error?27 int new, ///< is this a new error? 33 28 const char *fmt, ///< Format 34 ... ///< Extra arguments to use format35 );29 ...) ///< Extra arguments to use format 30 ; 36 31 37 32 void p_psErrorRegister(const psErrorDescription *errors, ///< register a set of errors 38 int nerror); ///< number of errors 33 int nerror) ///< number of errors 34 ; 39 35 40 const psErr *psErrorGet(int which); //return specified error (or an "error" with code PS_ERR_NONE)41 const psErr *psError Last(void); // return last error (or an "error" with code PS_ERR_NONE)36 ///< return specified error (or an "error" with code PS_ERR_NONE) 37 const psErr *psErrorGet(int which); 42 38 43 void psErrorClear(void); ///< Clear the error stack 39 ///< return last error (or an "error" with code PS_ERR_NONE) 40 const psErr *psErrorLast(void); 44 41 45 const char *psErrorCodeString(psErrorCode code); ///< return the string associated with the error code 46 void psErrorStackPrint(FILE *fd, const char *fmt, ...); ///< print the errorstack to this file descriptor 47 void psErrorVStackPrint(FILE *fd, //< write to this file descriptor 48 const char *fmt,//< format for any header information; may be NULL 49 va_list ap); //< arguments for format 42 ///< Clear the error stack 43 void psErrorClear(void); 44 45 ///< return the string associated with the error code 46 const char *psErrorCodeString(psErrorCode code); 47 48 ///< print the errorstack to this file descriptor 49 void psErrorStackPrint(FILE *fd, ///< write to this file descriptor 50 const char *fmt, ///< format for any header information; may be NULL 51 ...) ///< arguments for format 52 ; 53 54 ///< print the errorstack to this file descriptor (stdargs version) 55 void psErrorStackPrintV(FILE *fd, ///< write to this file descriptor 56 const char *fmt,///< format for any header information; may be NULL 57 va_list ap) ///< arguments for format 58 ; 59 50 60 51 61 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
