/[ascend]/trunk/base/generic/utilities/ascPanic.h
ViewVC logotype

Diff of /trunk/base/generic/utilities/ascPanic.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 777 by johnpye, Wed Jun 28 16:28:57 2006 UTC revision 778 by johnpye, Tue Jul 18 05:10:03 2006 UTC
# Line 43  Line 43 
43          "Assertion failed in %s:%d:  '%s'", __FILE__, __LINE__, #cond))          "Assertion failed in %s:%d:  '%s'", __FILE__, __LINE__, #cond))
44  #endif  #endif
45    
46  ASC_DLLSPEC(void ) Asc_Panic(CONST int status, CONST char *function,  NORETURN ASC_DLLSPEC(void) Asc_Panic(
47                        CONST char *format, ...) NORETURN;          CONST int status, CONST char *function,
48            CONST char *format, ...
49    );
50  /**< Print fatal error message, run callback function & (usually) exit the program.  /**< Print fatal error message, run callback function & (usually) exit the program.
51    
52      @param status   Status code passed by the calling function.      @param status   Status code passed by the calling function.
# Line 58  ASC_DLLSPEC(void ) Asc_Panic(CONST int s Line 60  ASC_DLLSPEC(void ) Asc_Panic(CONST int s
60      followed by the variables & format passed as arguments.  ASCERR      followed by the variables & format passed as arguments.  ASCERR
61      should have been initialized to a valid file stream or else the      should have been initialized to a valid file stream or else the
62      message will not be printed (checked by assertion). @par      message will not be printed (checked by assertion). @par
63        
64      If a valid file name has been previously set using      If a valid file name has been previously set using
65      Asc_PanicSetOutfile(), the message is printed to this file also.      Asc_PanicSetOutfile(), the message is printed to this file also.
66      Under Windows, a MessageBox will also be displayed with the      Under Windows, a MessageBox will also be displayed with the
67      message. @par      message. @par
68        
69      If a callback has been set using Asc_PanicSetCallback(), the      If a callback has been set using Asc_PanicSetCallback(), the
70      registered function will be called with the specified status.      registered function will be called with the specified status.
71      If the callback returns non-NULL, then exit() is called to end      If the callback returns non-NULL, then exit() is called to end
72      the program.  This is the default behavior.  If the callback      the program.  This is the default behavior.  If the callback
73      is able to resolve the problem, then it should return zero and      is able to resolve the problem, then it should return zero and
74      Asc_Panic() will just return.  This will be useful mostly for      Asc_Panic() will just return.  This will be useful mostly for
75      testing purposes, and should be used with caution.        testing purposes, and should be used with caution.
76  */  */
77    
78  ASC_DLLSPEC(void ) Asc_PanicSetOutfile(CONST char *filename);  ASC_DLLSPEC(void ) Asc_PanicSetOutfile(CONST char *filename);
# Line 90  typedef int (*PanicCallbackFunc)(int); Line 92  typedef int (*PanicCallbackFunc)(int);
92    
93      @param the status code passed to Asc_Panic() by the original caller.      @param the status code passed to Asc_Panic() by the original caller.
94      @return nonzero if ASCEND should exit, 0 if Asc_Panic should just return.      @return nonzero if ASCEND should exit, 0 if Asc_Panic should just return.
95        
96      This functionality is provided primarily for internal testing      This functionality is provided primarily for internal testing
97      purposes.  It should be used with extreme caution in release      purposes.  It should be used with extreme caution in release
98      code.  Asc_Panic() is called from all over ASCEND for many      code.  Asc_Panic() is called from all over ASCEND for many
# Line 105  ASC_DLLSPEC(PanicCallbackFunc ) Asc_Pani Line 107  ASC_DLLSPEC(PanicCallbackFunc ) Asc_Pani
107          if none was registered.          if none was registered.
108    
109      This allows the user to specify a cleanup function to be      This allows the user to specify a cleanup function to be
110      called during a fatal error.        called during a fatal error.
111    
112      @see PanicCallbackFunc for the form this callback function takes.      @see PanicCallbackFunc for the form this callback function takes.
113  */  */

Legend:
Removed from v.777  
changed lines
  Added in v.778

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22