1 /* bashjmp.h -- wrapper for setjmp.h with necessary bash definitions. */
8 /* This *must* be included *after* config.h */
10 #if defined (HAVE_POSIX_SIGSETJMP)
11 # define procenv_t sigjmp_buf
13 # define setjmp(x) sigsetjmp((x), 1)
15 # define longjmp(x, n) siglongjmp((x), (n))
17 # define procenv_t jmp_buf
20 extern procenv_t top_level;
21 extern procenv_t subshell_top_level;
22 extern procenv_t return_catch; /* used by `return' builtin */
24 #define SHFUNC_RETURN() longjmp (return_catch, 1)
26 #define COPY_PROCENV(old, save) \
27 xbcopy ((char *)old, (char *)save, sizeof (procenv_t));
29 /* Values for the second argument to longjmp/siglongjmp. */
30 #define NOT_JUMPED 0 /* Not returning from a longjmp. */
31 #define FORCE_EOF 1 /* We want to stop parsing. */
32 #define DISCARD 2 /* Discard current command. */
33 #define EXITPROG 3 /* Unconditionally exit the program now. */
35 #endif /* _BASHJMP_H_ */