00001 /* 00002 * Copyright 2002, 2003, 2004 PathScale, Inc. All Rights Reserved. 00003 */ 00004 00005 /* 00006 00007 Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. 00008 00009 This program is free software; you can redistribute it and/or modify it 00010 under the terms of version 2 of the GNU General Public License as 00011 published by the Free Software Foundation. 00012 00013 This program is distributed in the hope that it would be useful, but 00014 WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 00017 Further, this software is distributed without any warranty that it is 00018 free of the rightful claim of any third person regarding infringement 00019 or the like. Any license provided herein, whether implied or 00020 otherwise, applies only to this software file. Patent licenses, if 00021 any, provided herein do not apply to combinations of this program with 00022 other software, or any other product whatsoever. 00023 00024 You should have received a copy of the GNU General Public License along 00025 with this program; if not, write the Free Software Foundation, Inc., 59 00026 Temple Place - Suite 330, Boston MA 02111-1307, USA. 00027 00028 Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, 00029 Mountain View, CA 94043, or: 00030 00031 http://www.sgi.com 00032 00033 For further information regarding this notice, see: 00034 00035 http://oss.sgi.com/projects/GenInfo/NoticeExplan 00036 00037 */ 00038 00039 00040 #ifndef ERRORS_INCLUDED 00041 #define ERRORS_INCLUDED 00042 #ifndef ERRDESC_INCLUDED 00043 #include "errdesc.h" 00044 #endif 00045 00046 #ifdef __cplusplus 00047 extern "C" { 00048 #endif 00049 00050 /* ==================================================================== 00051 * ==================================================================== 00052 * 00053 * Module: errors.h 00054 * $Revision: 1.1 $ 00055 * $Date: 2005/07/27 02:17:57 $ 00056 * $Author: kevinlo $ 00057 * $Source: /depot/CVSROOT/javi/src/sw/cmplr/common/util/errors.h,v $ 00058 * 00059 * Revision history: 00060 * 21-Aug-89 - Original Version 00061 * 24-Jan-91 - Copied for TP/Muse 00062 * 25-Sep-91 - Fixed documentation, added prototypes 00063 * 13-Nov-92 - Integrated Josie/92 functionality 00064 * 00065 * Description: 00066 * 00067 * This file defines the external interface to a general-purpose error 00068 * reporting mechanism for compilers. Its objectives are: 00069 * 00070 * 1) To provide a simple error reporting in the source (i.e. minimal 00071 * code), with adequate options to fully describe the error. 00072 * 00073 * 2) To require minimal effort to modify the error's description and 00074 * handling. This implies central descriptors driving the error 00075 * handling, especially to deal with frequent reuse of error 00076 * information (e.g. "Illegal tree node"). 00077 * 00078 * 3) To keep the error handler almost completely independent of the 00079 * compiler of which it is a part, so that it can also be used in 00080 * other tools, e.g. the linker and librarian. This is achieved 00081 * by using external components for program-specific material. 00082 * 00083 * ==================================================================== 00084 * 00085 * The Error Reporting Interface 00086 * 00087 * In order to make use of an already-defined error message, the 00088 * interface defined consists of the following calls: 00089 * 00090 * void ErrMsg ( 00091 * INT Error_Code, 00092 * ... 00093 * ) 00094 * 00095 * produces the error message associated with Error_Code, with 00096 * up to six parameters. Error_Code and parameters will be 00097 * discussed further below. The error is presumed to result from 00098 * the current file and line number (discussed below), where the 00099 * current line number will generally be undefined for non-front 00100 * end passes. 00101 * 00102 * void ErrMsgLine ( 00103 * INT Error_Code, 00104 * INT line_number, 00105 * ... 00106 * ) 00107 * 00108 * is identical to ErrMsg, except that the relevant source line 00109 * number is passed. 00110 * 00111 * void ErrMsgSrcpos ( 00112 * INT Error_Code, 00113 * SRCPOS srcpos, 00114 * ... 00115 * ) 00116 * 00117 * is identical to ErrMsg, except that the relevant source position 00118 * is passed. 00119 * 00120 * void Assert ( 00121 * BOOL condition, 00122 * ( INT Error_Code, ... ) 00123 * ) 00124 * 00125 * checks for truth of the condition and, if false, invokes the 00126 * equivalent of ErrMsg to report a (presumably) compiler error 00127 * along with the compiler source file and line number. The 00128 * extra set of parentheses is necessary to allow cpp to process 00129 * the call with arbitrary parameter count -- the condition is 00130 * checked in-line. Note that we assume that calls to Assert 00131 * will be kept in production code. 00132 * 00133 * BOOL Is_True ( 00134 * BOOL condition, 00135 * ( const char *Format_String, ... ) 00136 * ) 00137 * 00138 * Similar to Assert, but performs a check expected to be removed (using 00139 * cpp) in production code. Also, notice that a format string is given 00140 * instead of an error code. Because these checks will be removed from 00141 * producetion code, we decided that consistency of error reporting was 00142 * less important than ease of use (in this case). 00143 * 00144 * void FmtAssert ( 00145 * BOOL condition, 00146 * ( const char *Format_String, ... ) 00147 * ) 00148 * 00149 * Just like Is_True, except will check in the production compiler as 00150 * well as during development. 00151 * 00152 * void DevAssert ( 00153 * BOOL condition, 00154 * ( const char *Format_String, ... ) 00155 * ) 00156 * 00157 * DevAssert is the same as IsTrue. Please use that instead. 00158 * 00159 * WARNING: The parameter lists for the above are currently are limited to 6 00160 * parameters after the error code or format string. 00161 * 00162 * void DevWarn ( const char *Format_String, ... ) 00163 * 00164 * Issue a warning to stderr only when executed in a compiler built for 00165 * development (not in MR'ed compilers). This is a good thing to use if 00166 * you have an unexpected condition from which there is a valid (though 00167 * perhaps suboptimal) recovery. For example: 00168 * 00169 * if ( Unexpected_Condition_That_Precludes_Optimization() ) { 00170 * DevWarn("Can't optimize because I was a hopeless loser"); 00171 * Generate_Code(); 00172 * } 00173 * else { 00174 * Optimize(); 00175 * Generate_Code(); 00176 * } 00177 * 00178 * The warnings are issued by default if the errors package is built with 00179 * horrible Is_True_On; otherwise, they are not issued. This behavior can 00180 * be changed with: 00181 * 00182 * void DevWarn_Toggle ( void ) 00183 * 00184 * If the current behavior of DevWarn is to print the warnings, calling 00185 * this supresses the warnings. If the current behavior is to supress 00186 * the warnings, calling this will enable printing them. 00187 * 00188 * BOOL DevWarn_Enable ( void ) 00189 * 00190 * If the current behavior of DevWarn is to print the warnings, this function 00191 * will return true, and fals else. 00192 * 00193 * Lmt_DevWarn(const UINT limit, args) 00194 * 00195 * This is a macro designed to suppress printing of DevWarn 00196 * messages that get repeated a lot. At most limit copies of the 00197 * DevWarn message will be printed; args is the parenthesized 00198 * argument list for the function DevWarn(). In the present 00199 * implementation, the position (file, line) in the compiler 00200 * source is presumed to identify the message. For example, if 00201 * you are a hopeless loser hundreds of times per compilation, 00202 * and you feel a need to tolerate this situation for a time, and 00203 * you don't wish to see hundreds of copies of the "hopeless 00204 * loser" DevWarn message every time you compile, you might use: 00205 * 00206 * if ( Unexpected_Condition_That_Precludes_Optimization() ) { 00207 * Lmt_DevWarn(5, 00208 * "Can't optimize because I was a hopeless loser"); 00209 * Generate_Code(); 00210 * } 00211 * else { 00212 * Optimize(); 00213 * Generate_Code(); 00214 * } 00215 * 00216 * In this example, you will see the "hopeless loser" DevWarn 00217 * message at most five times per compilation. 00218 * 00219 * 00220 * Note that a number of predefined error codes are available, 00221 * including one which allows arbitrary formatting. See erglob.h. 00222 * 00223 * The parameters passed to the error reporting routines must match the 00224 * message descriptor for the error code; they are used to provide 00225 * values inserted in the message. The parameters are passed in a form 00226 * which allows them to be passed further without type knowledge, with 00227 * only the assumption that standard integers and pointers are the same 00228 * size. The following possibilities are currently supported: 00229 * 00230 * ET_INT: Generic scaled integer: size of host register (INTSC). 00231 * ET_INT32: 32-bit integer. 00232 * ET_INT64: 64-bit integer. 00233 * ET_FLOAT: Pointer to a standard float number. 00234 * ET_DOUBLE: Pointer to a standard double float number. 00235 * ET_POINTER: Arbitrary pointer, printed as a hex number. 00236 * ET_STRING: Pointer to a standard C string. 00237 * ET_SYSERR: Unix error number. 00238 * ET_STRTAB: Pointer to a compiler string table entry. 00239 * ET_SYMTAB: Pointer to a compiler symbol table entry. 00240 * ET_TN: Pointer to a compiler temporary name struct. 00241 * ET_NODE: Pointer to a compiler tree node, representing its name. 00242 * 00243 * ==================================================================== 00244 * 00245 * Error Code Definition 00246 * 00247 * In order to define a new error code for use, its value must be 00248 * defined in one of the error code header files erXXX.h, and a message 00249 * descriptor added to the descriptor file erXXX.desc. For the 00250 * compiler, the possibilities for these files are: 00251 * 00252 * erglob: Global error codes, common to both compiler phases or 00253 * other tools. 00254 * erfe: Front end error codes. 00255 * ercg: Code generator error codes. 00256 * erlib: Program library error codes. 00257 * erlink: Linker/object file error codes. 00258 * 00259 * The error message descriptors provide a printf format for the 00260 * message and parameter types from the above list. They also specify 00261 * a severity level, one of: 00262 * 00263 * ES_IGNORE: To be ignored by the error message generator. 00264 * ES_ADVISORY: For user information only; not usually an 00265 * indication of a problem. 00266 * ES_WARNING: A likely problem, but not a definite error. 00267 * ES_CONFORMANCE: The program does not conform in some way to the 00268 * source language standard (not relevant to the 00269 * first implementation). 00270 * ES_ERROR: Minimum error severity level. All errors at or 00271 * above this level prevent successful completion. 00272 * ES_ERRBENIGN: Benign error: processing continues except for 00273 * code emission. 00274 * ES_ERRPHASE: Error: stop processing this source file after 00275 * the current compiler phase is complete, but 00276 * process any other source files before quitting. 00277 * ES_ERRABORT: Error: abort processing after minimal cleanup. 00278 * 00279 * The descriptor also identifies user vs. compiler errors. 00280 * See the discussion in erglob.desc for more detail. 00281 * 00282 * ==================================================================== 00283 * 00284 * Error Reporting Management 00285 * 00286 * A number of global parameters must be maintained to support the 00287 * model assumed above. 00288 * 00289 * Error database initialization should occur very early in any process 00290 * that will use the facilities. This basically points the error 00291 * library at the process' error table structures. 00292 * 00293 * Set_Error_Tables( 00294 * ERROR_DESC_TABLE *error_descriptor_table, 00295 * char *error_list ) 00296 * 00297 * To set the descript of a particular error phase: 00298 * 00299 * Set_Error_Descriptor ( 00300 * INT phase, 00301 * ERROR_DESC *descriptor) 00302 * 00303 * Errors will always be reported to stderr. In addition, they should 00304 * be reported to a default error file where they will be preserved 00305 * beyond the lifetime of a screen image. The following routine 00306 * defines the file which serves this purpose, and should be called 00307 * when initializing a new source file for processing: 00308 * 00309 * Set_Error_File ( const char *filename ); 00310 * 00311 * Note that this routine has the side effects of closing any error 00312 * file which is currently open, and removing any existing file of the 00313 * given name. However, the new error file is not created until a 00314 * reportable message occurs. Error message emission to the trace 00315 * file is disabled by setting the file descriptor to NULL. 00316 * 00317 * In addition, if tracing is enabled, it is useful to have a copy of 00318 * all error messages embedded in the trace file. This is enabled by 00319 * the call: 00320 * 00321 * Set_Error_Trace ( FILE *stream ); 00322 * 00323 * The trace file is assumed to have been opened elsewhere before any 00324 * error message is reported. Note that, if tracing is directed to 00325 * the same file as stderr (e.g. the terminal), the extra copy will 00326 * be suppressed. Error message emission to the trace file is 00327 * disabled by setting the file descriptor to NULL. 00328 * 00329 * All errors are reported with a source file name and line number. 00330 * They are maintained by calling the following routines: 00331 * 00332 * Set_Error_Source ( char *filename ); 00333 * Set_Error_Line ( INT linenum ); 00334 * Set_Error_Srcpos ( SRCPOS srcpos ); 00335 * 00336 * To suppress line number reporting, e.g. during phases where errors 00337 * cannot be attributed to particular source lines, set the current 00338 * line to ERROR_LINE_UNKNOWN. Note that ErrMsgLine uses the line 00339 * number passed by the caller instead of the current line number. 00340 * 00341 * Compiler errors (as opposed to user errors) are reported with the 00342 * compiler phase in which they occur. To support this, the following 00343 * routine should be called at the beginning of each phase: 00344 * 00345 * Set_Error_Phase ( const char *phasename ); 00346 * 00347 * To save the current error phase for temporary changes, use: 00348 * 00349 * char_variable = Get_Error_Phase (); 00350 * 00351 * Two global variables control the reporting of errors based on their 00352 * severity level: 00353 * 00354 * Min_Error_Severity: The minimum severity level errors to be 00355 * reported (ES_WARNING by default). 00356 * Conformance_Level: The severity level of conformance errors 00357 * (ES_ADVISORY by default; may be set anywhere 00358 * between ES_IGNORE and ES_ERROR to control 00359 * treatment). 00360 * 00361 * In order to determine whether compilation-terminating errors have 00362 * been detected, and in order to get an error count to report, the 00363 * following routine is used: 00364 * 00365 * BOOL Get_Error_Count ( INT *Error_Count, INT *Warning_Count ); 00366 * 00367 * This routine returns the number of errors and warnings up to this 00368 * point in its two parameters. If any errors of level ES_ERRPHASE or 00369 * above have been seen, it returns TRUE, and compilation of the 00370 * current source file should terminate. 00371 * 00372 * Prior to other processing, and between source files, the error 00373 * handler should be initialized by the following routine, which 00374 * clears error counts, closes open error files, etc. 00375 * 00376 * Init_Error_Handler ( INT Max_Allowed_Errors ); 00377 * 00378 * Finally, as early as possible during processing, signal catching 00379 * with associated cleanup may be enabled by calling: 00380 * 00381 * Handle_Signals (); 00382 * 00383 * ==================================================================== 00384 * ==================================================================== 00385 */ 00386 00387 00388 /* ==================================================================== 00389 * 00390 * Internal Assertion Checking: These routines are invoked via macros 00391 * defined below, and should not be called directly, as their 00392 * interfaces are allowed to change. 00393 * 00394 * ==================================================================== 00395 */ 00396 00397 #ifdef MONGOOSE_BE 00398 #ifndef srcpos_INCLUDED 00399 #include "srcpos.h" 00400 #endif 00401 #endif 00402 00403 extern void Abort_Compiler_Location ( 00404 const char* file_name, 00405 INT line_number 00406 ); 00407 #pragma mips_frequency_hint NEVER Abort_Compiler_Location 00408 00409 /* Simple abort report with error code: */ 00410 extern void Fail_Assertion ( INT ecode, ... ); 00411 #pragma mips_frequency_hint NEVER Fail_Assertion 00412 00413 /* Simple abort report with format instead of code: */ 00414 /*PRINTFLIKE1*/ 00415 extern void Fail_FmtAssertion ( const char *fmt, ... ); 00416 #pragma mips_frequency_hint NEVER Fail_FmtAssertion 00417 00418 /* Simple fatal error report with format instead of code: */ 00419 /*PRINTFLIKE1*/ 00420 extern void Fatal_Error ( const char *fmt, ... ); 00421 #pragma mips_frequency_hint NEVER Fatal_Error 00422 00423 /* ==================================================================== 00424 * 00425 * Error Reporting Interface 00426 * 00427 * ==================================================================== 00428 */ 00429 00430 /* Simple error report: */ 00431 extern void ErrMsg ( INT ErrCode, ... ); 00432 #pragma mips_frequency_hint NEVER ErrMsg 00433 00434 /* Error report with specified source line number: */ 00435 extern void ErrMsgLine ( INT ErrCode, INT LineNo, ... ); 00436 #pragma mips_frequency_hint NEVER ErrMsgLine 00437 00438 /* Error report with specified source position: */ 00439 #ifdef MONGOOSE_BE 00440 extern void ErrMsgSrcpos ( INT ErrCode, SRCPOS SrcPos, ... ); 00441 #pragma mips_frequency_hint NEVER ErrMsgSrcpos 00442 #endif 00443 00444 /* Unconditional assertion checking with error code: */ 00445 #define Assert(Cond,ParmList) \ 00446 ( Cond ? (void) 1 \ 00447 : ( Abort_Compiler_Location ( __FILE__, __LINE__ ), \ 00448 Fail_Assertion ParmList ) ) 00449 00450 /* Unconditional assertion checking with printf format, always fatal: */ 00451 #define FmtAssert(Cond,ParmList) \ 00452 ( Cond ? (void) 1 \ 00453 : ( Abort_Compiler_Location ( __FILE__, __LINE__ ), \ 00454 Fail_FmtAssertion ParmList) ) 00455 00456 /* Still fatal checking with printf format, but more polite: */ 00457 #define Require(Cond,ParmList) \ 00458 ( Cond ? (void) 1 \ 00459 : ( Abort_Compiler_Location ( __FILE__, __LINE__ ), \ 00460 Fatal_Error ParmList) ) 00461 00462 00463 /* Check assertion only if Insist_On flag is set: */ 00464 #ifdef Insist_On 00465 # define Insist FmtAssert 00466 #else 00467 # define Insist(a, b) ((void) 1) 00468 #endif 00469 00470 /* Check assertion only if Is_True_On flag is set: */ 00471 #ifdef Is_True_On 00472 # define Is_True FmtAssert 00473 #else 00474 # define Is_True(a, b) ((void) 1) 00475 #endif 00476 00477 /*PRINTFLIKE1*/ 00478 extern void DevWarn( const char* FormatString,... ) 00479 #ifdef __GNUC__ 00480 __attribute__((format(printf,1,2))) 00481 #endif 00482 ; 00483 #pragma mips_frequency_hint NEVER DevWarn 00484 00485 extern BOOL DevWarn_Enabled( void ); 00486 00487 extern void DevWarn_Toggle( void ); 00488 #pragma mips_frequency_hint NEVER DevWarn_Toggle 00489 00490 extern BOOL Count_Limit_DevWarn( const char *const src_fname, 00491 const UINT src_line, 00492 const UINT limit ); 00493 #pragma mips_frequency_hint NEVER Count_Limit_DevWarn 00494 00495 #define Lmt_DevWarn(limit, args) \ 00496 ( Count_Limit_DevWarn(__FILE__, __LINE__, limit) ? \ 00497 DevWarn args : \ 00498 (void) 1 ) 00499 00500 00501 /* DevAssert is just a synonym for Is_True. It's use is deprecated. 00502 * Please use Is_True instead. 00503 */ 00504 #define DevAssert Is_True 00505 #define DevAssert_On Is_True_On 00506 00507 00508 00509 /* ==================================================================== 00510 * 00511 * Error Reporting Management 00512 * 00513 * ==================================================================== 00514 */ 00515 00516 /* Define the severity levels: */ 00517 #define ES_IGNORE 0 /* Ignore completely */ 00518 #define ES_ADVISORY 1 /* Advisory only */ 00519 #define ES_WARNING 2 /* Warning - potential problem */ 00520 #define ES_CONFORMANCE 3 /* May not conform to standard */ 00521 #define ES_ERROR 4 /* Minimum error level */ 00522 #define ES_ERRBENIGN 4 /* Error: finish processing */ 00523 #define ES_ERRPHASE 5 /* Error: finish phase, other files */ 00524 #define ES_ERRABORT 6 /* Error: terminate immediately */ 00525 #define ES_MAX 6 /* Maximum severity */ 00526 00527 /* Predefined phase numbers. These are more coarse than the phases 00528 * named by calls to Set_Error_Phase, and represent the collections 00529 * of error codes into header files. All phases in use in a program 00530 * should be defined either here or in err_host.h, to avoid conflicts. 00531 * The symbol EP_LAST should also be defined in err_host.h. 00532 */ 00533 #ifndef MONGOOSE_BE 00534 #define EP_UNIX 0 /* Unix error codes */ 00535 #endif /* MONGOOSE_BE */ 00536 00537 #define EP_GLOBAL 1 /* Global, general-purpose codes */ 00538 #define EP_LIB 2 /* Program librarian codes */ 00539 00540 #ifndef MONGOOSE_BE 00541 #define EP_LINK 3 /* Linker, object file codes */ 00542 /* The following are compiler-specific, but predefined because they 00543 * are common to all phases: 00544 */ 00545 #define EP_FE 4 /* Compiler front end codes */ 00546 #endif /* MONGOOSE_BE */ 00547 00548 #define EP_BE 5 /* Compiler back end codes (not CG) */ 00549 #define EP_CG 6 /* Code generator codes */ 00550 #define EP_PREDEFINED 6 /* Last predefined phase */ 00551 00552 /* Predefined error parameter types: */ 00553 #define ET_UNKNOWN 0 /* Mistake */ 00554 #define ET_INT 1 /* Scaled integer */ 00555 #define ET_INT32 2 /* 32-bit integer */ 00556 #define ET_INT64 3 /* 64-bit integer */ 00557 #define ET_FLOAT 4 /* Pointer to float */ 00558 #define ET_DOUBLE 5 /* Pointer to double float */ 00559 #define ET_POINTER 6 /* Arbitrary pointer */ 00560 #define ET_STRING 7 /* Standard character string */ 00561 #define ET_SYSERR 8 /* Unix error code */ 00562 /* The following are predefined, but compiler specific: */ 00563 #define ET_STRTAB 9 /* Pointer to string table */ 00564 #define ET_SYMTAB 10 /* Pointer to symbol table */ 00565 #define ET_TN 11 /* Pointer to TN */ 00566 #define ET_NODE 12 /* Pointer to tree node */ 00567 #define ET_PREDEFINED 13 /* Last predefined kind */ 00568 00569 /* Include definitions specific to the host program: */ 00570 #include "err_host.h" 00571 00572 /* The following contains Unix error code after system call errors: */ 00573 #ifndef KEY 00574 extern INT errno; 00575 #else 00576 #include <errno.h> 00577 #endif 00578 00579 /* Control reporting by severity level: */ 00580 extern INT Min_Error_Severity; 00581 extern INT Conformance_Level; 00582 00583 /* Error table initialization. All users of this package must call 00584 * this routine before emitting any error messages. 00585 */ 00586 /* Incomplete type to keep ANSI happy: */ 00587 struct error_desc_table; 00588 extern void Set_Error_Tables( 00589 struct error_desc_table *edt, 00590 const char *errlist[] ); 00591 00592 extern void 00593 Set_Error_Descriptor (INT, ERROR_DESC *); 00594 00595 /* Control files to report errors to: */ 00596 extern void Set_Error_File ( 00597 const char *filename 00598 ); 00599 extern void Set_Error_Trace ( 00600 FILE *stream 00601 ); 00602 00603 /* Notify error reporter of current source file name: */ 00604 extern void Set_Error_Source ( 00605 const char *filename 00606 ); 00607 00608 /* Notify error reporter of current source file line number: */ 00609 #define ERROR_LINE_UNKNOWN 0 00610 extern void Set_Error_Line ( 00611 INT LineNo 00612 ); 00613 00614 /* Notify error reporter of current source position: */ 00615 #ifdef MONGOOSE_BE 00616 extern void Set_Error_Srcpos ( 00617 SRCPOS SrcPos 00618 ); 00619 #endif 00620 00621 /* Notify error reporter of current compiler phase: */ 00622 extern void Set_Error_Phase ( 00623 const char *phasename 00624 ); 00625 extern const char *Get_Error_Phase (void); 00626 00627 /* Determine whether compilation should terminate: */ 00628 extern BOOL Get_Error_Count ( /* Return whether to stop now */ 00629 INT *Error_Count, /* Number of errors to this point */ 00630 INT *Warning_Count /* Number of warnings to this point */ 00631 ); 00632 00633 /* Initialize the error handler: */ 00634 extern void Init_Error_Handler ( INT Max_Allowed_Errors ); 00635 00636 /* Initialize signal catching: */ 00637 extern void Handle_Signals ( void ); 00638 00639 /* ==================================================================== 00640 * 00641 * Miscellaneous 00642 * 00643 * ==================================================================== 00644 */ 00645 00646 /* Ignore bad/illegal values: */ 00647 extern void Rag_Handle_Woff_Args(char *wstring); 00648 00649 /* had any internal errors */ 00650 extern BOOL Had_Internal_Error (void); 00651 00652 #ifdef __cplusplus 00653 } 00654 #endif 00655 00656 #ifdef __cplusplus 00657 00658 class Temporary_Error_Phase 00659 { 00660 private: 00661 const char* saved_error_phase; 00662 00663 public: 00664 Temporary_Error_Phase(const char* new_error_phase) { 00665 saved_error_phase = Get_Error_Phase(); 00666 Set_Error_Phase(new_error_phase); 00667 } 00668 00669 ~Temporary_Error_Phase() { 00670 if (saved_error_phase) 00671 Set_Error_Phase(saved_error_phase); 00672 } 00673 }; 00674 00675 #endif /* __cplusplus */ 00676 00677 #endif /* ERRORS_INCLUDED */
1.5.6