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