3 /* Definitions and prototypes for signal handling */
6 Author: Jeffrey E Altman (jaltman@secure-endpoints.com),
7 Secure Endpoints Inc., New York City.
9 Copyright (C) 1985, 2009,
10 Trustees of Columbia University in the City of New York.
11 All rights reserved. See the C-Kermit COPYING.TXT file or the
12 copyright text in the ckcmai.c module for disclaimer and permissions.
16 typedef void (*ck_sigfunc)(void *);
17 typedef void (*ck_sighand)(int);
19 typedef VOID (*ck_sigfunc)();
20 typedef VOID (*ck_sighand)();
23 /* Macros for POSIX vs old-style signal handling. */
26 typedef sigjmp_buf ckjmpbuf;
28 typedef jmp_buf ckjmpbuf;
29 #endif /* CK_POSIX_SIG */
31 Suppose you want to pass the address of a jmp_buf bar to a function foo.
32 Since jmp_buf is normally defined (typedef'd) as an array, you would do
33 it like this: foo(bar), where foo = foo(jmp_buf bar). But suppose a
34 jmp_buf is (say) a struct rather than an array. Then you must do
35 foo(&bar) where foo is foo(jmp_buf * bar). This is controlled here in
36 the traditional fashion, by ifdefs. By default, we assume that jmp_buf
37 is an array. Define the symbol JBNOTARRAY if jmp_buf is not an array.
43 #endif /* JBNOTARRAY */
46 typedef ckjmpbuf * ckjptr;
47 #define ckjaddr(x) & x
48 #define ckjdref(x) * x
50 #define cksetjmp(x) sigsetjmp(x,1)
52 #define cksetjmp(x) setjmp(x,1)
53 #endif /* CK_POSIX_SIG */
54 #else /* jmp_buf is an array */
55 typedef ckjmpbuf ckjptr;
59 #define cksetjmp sigsetjmp
61 #define cksetjmp setjmp
62 #endif /* CK_POSIX_SIG */
63 #endif /* JBNOTARRAY */
65 _PROTOTYP( int cc_execute, (ckjptr, ck_sigfunc, ck_sigfunc) );
66 _PROTOTYP( int alrm_execute,
70 ck_sigfunc, ck_sigfunc) );
71 _PROTOTYP( int cc_alrm_execute,