Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-01 08:52:28

0001 /*
0002  * $Id$
0003  *
0004  * $Log$
0005  * Revision 1.3  1997/11/28 17:27:14  mclareni
0006  * Numerous mods and some new routines to get Control-C working reasonably on NT
0007  *
0008  * Revision 1.2  1997/03/14 17:16:38  mclareni
0009  * WNT mods
0010  *
0011  * Revision 1.1.1.1  1996/03/08 15:33:01  mclareni
0012  * Kuip
0013  *
0014  */
0015 /*
0016  * 1997/11/28 17:16:38  V.Fine
0017  *  Some new members have been introduced into the kc_break struct
0018  *  Macro to set the exception handler routine for diff WIN32 platform
0019  *  was done
0020  */
0021 /* ksig.h: signal and break handling */
0022 
0023 /*
0024  * Available signal handling package
0025  *
0026  *   #define SIGNAL_POSIX  ==>  sigaction()  for Unix
0027  *   #define SIGNAL_BSD    ==>  sigvec()     for VMS and NeXT
0028  *   #define SIGNAL_V7     ==>  signal()
0029  */
0030 #if (!defined(SIGNAL_BSD)) && (!defined(SIGNAL_V7))
0031 #  define SIGNAL_POSIX
0032 #elif !defined(WIN32)
0033 #  define sigjmp_buf          jmp_buf
0034 #  define sigsetjmp(buf,save) setjmp(buf)
0035 #  define siglongjmp(buf,val) longjmp(buf,val)
0036 #  ifdef vms
0037 #    define sv_flags sv_onstack
0038 #  endif
0039 #elif defined(WIN32)
0040 #  include <float.h>
0041 #  define sigjmp_buf          jmp_buf
0042    int  sigsetjmp(sigjmp_buf *buffer, int save);
0043    void siglongjmp (sigjmp_buf buffer, int val); 
0044    BOOL ConsoleSigHandler(DWORD sig);
0045 #endif
0046 
0047 EXTERN struct {
0048   int         trap_enabled;     /* flag if exceptions should be trapped */
0049   int         intr_enabled;     /* flag if ^C delivery is allowed */
0050   int         intr_pending;     /* flag if ^C happened while disabled */
0051   int         intr_count;       /* count number of consecutive ^C interrupts */
0052   int         traceback;        /* print traceback on signal */
0053 #ifdef WIN32
0054   int         fperr;            /* type of floating-point exception under Windows  */
0055   HANDLE      hdThread;         /* The real handle of the thread to jump in        */
0056   unsigned int uRetAddr;        /* return address to the subroutine calling setjmp */
0057 #endif
0058   char       *error_msg;        /* messages is handler cannot do print */
0059   int         soft_intr;        /* flag to stop at a convenient point */
0060   int         jump_set;         /* flag if stack has been setup */
0061   sigjmp_buf  stack;
0062   int         sockfd;           /* socket descriptor and routine to */
0063   void      (*piaf_sync)();     /* resynchronize Piaf communication */
0064 } kc_break;
0065 
0066 #ifdef WIN32
0067 #  if defined(_X86_)
0068 #    define PROGCTR(Context)  (Context.Eip)
0069 #  endif
0070 
0071 #  if defined(_MIPS_)
0072 #    define PROGCTR(Context)  (Context.Fir)
0073 #  endif
0074 
0075 #  if defined(_ALPHA_)
0076 #    define PROGCTR(Context)  (Context.Fir)
0077 #  endif
0078 
0079 #  if defined(_PPC_)
0080 #    define PROGCTR(Context)  (Context.Iar)
0081 #  endif
0082 
0083 #  if !defined(PROGCTR)
0084 #    error Module contains CPU-specific code; modify and recompile.
0085 #  endif
0086 #endif /* WIN32 */