home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / lucid / lemacs-19.6 / src / blockio.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-26  |  1.1 KB  |  43 lines

  1.  
  2. #ifndef _EMACS_BLOCKIO_H_
  3. #define _EMACS_BLOCKIO_H_
  4.  
  5. /* Nonzero during a critical section.  At such a time, an input interrupt
  6.    does nothing but set `x_pending_input'.  */
  7. extern int x_input_blocked;
  8.  
  9. #ifdef DEBUG_INPUT_BLOCKING
  10.  
  11. /* Begin critical section. */
  12. #define BLOCK_INPUT (note_block_input (__FILE__, __LINE__), x_input_blocked++)
  13.  
  14. /* End critical section. */
  15. #define UNBLOCK_INPUT {                            \
  16.               note_unblock_input (__FILE__, __LINE__); \
  17.               x_input_blocked--;       \
  18.               if (x_input_blocked < 0) \
  19.                 abort ();              \
  20.                }
  21.  
  22. #define TOTALLY_UNBLOCK_INPUT (note_totally_unblocked (__FILE__, __LINE__), x_input_blocked = 0)
  23. #define UNBLOCK_INPUT_RESIGNAL UNBLOCK_INPUT
  24.  
  25. #else
  26.  
  27. /* Begin critical section. */
  28. #define BLOCK_INPUT (x_input_blocked++)
  29.  
  30. /* End critical section. */
  31. #define UNBLOCK_INPUT {                            \
  32.               x_input_blocked--;       \
  33.               if (x_input_blocked < 0) \
  34.                 abort ();              \
  35.                }
  36.  
  37. #define TOTALLY_UNBLOCK_INPUT (x_input_blocked = 0)
  38. #define UNBLOCK_INPUT_RESIGNAL UNBLOCK_INPUT
  39.  
  40. #endif /* DEBUG_INPUT_BLOCKING */
  41.  
  42. #endif /* _EMACS_BLOCKIO_H_ */
  43.