Download | Plain Text | No Line Numbers


  1. #ifndef _GLOBAL_H
  2. #define _GLOBAL_H 1
  3.  
  4. #include <signal.h>
  5.  
  6. /* install signal handler macro */
  7. #define INSTALL_SIGNAL(signum, act, oldact) \
  8.   sigaction(signum, NULL, &oldact); \
  9.   if (oldact.sa_handler != SIG_IGN) \
  10.   sigaction(signum, &act, NULL);
  11.  
  12. /*
  13.  * global.c stuff
  14.  */
  15. #include <stdarg.h>
  16.  
  17. /* function declarations */
  18. void vprintferr(const char *fmt, va_list ap);
  19. void printferr(const char *fmt, ...);
  20. void bailout(const char *fmt, ...);
  21.  
  22. /* global variable definitions */
  23. /* libc manual: Handlers that return normally must modify some global variable
  24.  * in order to have any effect. Typically, the variable is one that is examined
  25.  * periodically by the program during normal operation. Its data type should be
  26.  * sig_atomic_t for reasons described in Atomic Data Access.
  27.  */
  28. extern volatile sig_atomic_t error; /* error flag */
  29. extern char *me; /* name of myself (argv[0]) */
  30. extern char* charmap[128];
  31.  
  32. #endif
  33.