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

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

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

revision 1001 by johnpye, Sun Dec 24 01:33:59 2006 UTC revision 1002 by johnpye, Sat Dec 30 14:27:47 2006 UTC
# Line 133  typedef void SigHandlerFn(int); Line 133  typedef void SigHandlerFn(int);
133  #ifndef ASC_JMP_INFO  #ifndef ASC_JMP_INFO
134  # define SETJMP set_jmp  # define SETJMP set_jmp
135  # define LONGJMP longjmp  # define LONGJMP longjmp
136    # define SIGNAL signal
137  typedef JMP_BUF jmp_buf  typedef JMP_BUF jmp_buf
138  #else  #else
139  # define SETJMP(ENV) (ENV.filename = __FILE__, ENV.line = __LINE__, ENV.func = __FUNCTION__, setjmp(ENV.jmp))  # define SETJMP(ENV) (\
140  # define LONGJMP(ENV,VAL) (CONSOLE_DEBUG("LONGJMP back to %s:%d (%s)",ENV.filename,ENV.line,ENV.func), longjmp(ENV.jmp, VAL))          CONSOLE_DEBUG("SETJMP at %s:%d (%s=%p)",__FILE__,__LINE__,#ENV,ENV.jmp)\
141            ,ENV.filename = __FILE__, ENV.line = __LINE__, ENV.func = __FUNCTION__\
142            ,ENV.varname = #ENV\
143            , setjmp(ENV.jmp)\
144        )
145    # define LONGJMP(ENV,VAL) (\
146            CONSOLE_DEBUG("LONGJMP to %s:%d (%s) (%s=%p)",ENV.filename,ENV.line,ENV.func,ENV.varname,ENV.jmp)\
147            , longjmp(ENV.jmp, VAL)\
148        )
149  typedef struct{  typedef struct{
150      jmp_buf jmp;      jmp_buf jmp;
151      const char *filename;      const char *filename;
152      int line;      int line;
153      const char *func;      const char *func;
154        const char *varname;
155  } asc_jmp_buf;  } asc_jmp_buf;
156  #define JMP_BUF asc_jmp_buf  #define JMP_BUF asc_jmp_buf
157    #define SIGNAL(SIG,HANDLER) (CONSOLE_DEBUG("SIGNAL(%d,%s)",SIG,#HANDLER),signal(SIG,HANDLER))
158  #endif  #endif
159    
160    
# Line 298  ASC_DLLSPEC(int ) Asc_SignalHandlerPop(i Line 309  ASC_DLLSPEC(int ) Asc_SignalHandlerPop(i
309   *        only call Asc_SignalRecover() if it matches func.   *        only call Asc_SignalRecover() if it matches func.
310   */   */
311    
312    ASC_DLLSPEC(void) Asc_SignalPrintStack(int signum);
313    
314    ASC_DLLSPEC(int) Asc_SignalStackLength(int signum);
315    
316  #endif  /* ASC_ASCSIGNAL_H */  #endif  /* ASC_ASCSIGNAL_H */
317    

Legend:
Removed from v.1001  
changed lines
  Added in v.1002

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