home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR24 / BASH_112.ZIP / BASH-112.TAR / bash-1.12 / unwind_prot.h < prev    next >
Text File  |  1991-07-07  |  959b  |  31 lines

  1. /* unwind_prot.h - Macros and functions for hacking unwind protection. */
  2.  
  3. #if !defined (_UNWIND_PROT_H)
  4. #define _UNWIND_PROT_H
  5.  
  6. /* Run a function without interrupts. */
  7. void
  8.   without_interrupts (), begin_unwind_frame (), discard_unwind_frame (),
  9.   run_unwind_frame (), add_unwind_protect (), remove_unwind_protect (),
  10.   run_unwind_protects ();
  11.  
  12. /* Define for people who like their code to look a certain way. */
  13. #define end_unwind_frame()
  14.  
  15. /* How to protect an integer. */
  16. #define unwind_protect_int(X) unwind_protect_var (&(X), (X), sizeof (int))
  17.  
  18. /* How to protect a pointer to a string. */
  19. #define unwind_protect_string(X) \
  20.   unwind_protect_var (&(X), (X), sizeof (char *))
  21.  
  22. /* How to protect any old pointer. */
  23. #define unwind_protect_pointer(X) unwind_protect_string (X)
  24.  
  25. /* How to protect the contents of a jmp_buf. */
  26. #define unwind_protect_jmp_buf(X) \
  27.   unwind_protect_var ((int *)(X), (char *)(X), sizeof (jmp_buf))
  28.  
  29. #endif /* _UNWIND_PROT_H */
  30.  
  31.