home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / pine / ccmd / ccmdmd.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-08-19  |  2.5 KB  |  83 lines

  1. /*
  2.  Author: Andrew Lowry
  3.  
  4.  Columbia University Center for Computing Activities, July 1986.
  5.  Copyright (C) 1986, 1987, Trustees of Columbia University in the City
  6.  of New York.  Permission is granted to any individual or institution
  7.  to use, copy, or redistribute this software so long as it is not sold
  8.  for profit, provided this copyright notice is retained.
  9. */
  10. /* ccmdmd.h
  11. **
  12. ** This file contains machine-dependent macros and declarations for
  13. ** the ccmd package.  Use preprocessor conditionals to include the
  14. ** correct code, but PLEASE -- try not to nest conditionals!!
  15. **/
  16.  
  17. /* Data type that can accomodate int and all pointer data in an
  18. ** initializer.  This is how the _cmdat field of the FDB is
  19. ** declared, to ease declaration of FDB structures.
  20. **/
  21.  
  22. typedef char * pdat;
  23.  
  24. /* On Venix, one cannot pass around pointers to static functions
  25. ** because of code mapping difficulties.  Therefore, the following is
  26. ** used for functions that really should be static, but which need to
  27. ** be invoked via pointers in other modules.  Since they will not be
  28. ** static in venix implementations, they should be named so as to reduce
  29. ** chances of name conflicts.
  30. **/
  31.  
  32. #ifdef VENIX
  33. #define PASSEDSTATIC
  34. #else
  35. #define PASSEDSTATIC static
  36. #endif
  37.  
  38. /*
  39. ** cmsetrp macro - invoke at an appropriate
  40. ** reparse point, to install a handler into the CSB that will automatically
  41. ** revert execution back to this point whenever a reparse is triggered.
  42. **/
  43.  
  44. #ifdef LATTICE
  45. #define cmsetrp() \
  46.    { setjmp(&cmrpjb); cmcsb._cmrph = cmrpjmp; }
  47. #else
  48. #define cmsetrp() \
  49.    { setjmp(cmrpjb); cmcsb._cmrph = cmrpjmp; }
  50. #endif
  51.  
  52. /*
  53. ** cmseter macro - invoke just prior to issuing a prompt,
  54. ** to install a handler into the CSB that will automatically
  55. ** revert execution back to this point whenever a parse error
  56. ** is encountered.
  57. **/
  58.  
  59. #ifdef LATTICE
  60. #define cmseter() \
  61.    { setjmp(&cmerjb); cmcsb._cmerh = cmerjmp; }
  62. #else
  63. #define cmseter() \
  64.    { setjmp(cmerjb); cmcsb._cmerh = cmerjmp; }
  65. #endif
  66.  
  67. #ifdef LATTICE
  68. #define cmsetbl() \
  69.    { setjmp(&cmbljb); cmcsb._cmblh = cmbljmp; }
  70. #else
  71. #define cmsetbl() \
  72.    { setjmp(cmbljb); cmcsb._cmblh = cmbljmp; }
  73. #endif
  74. #define cmclrbl() \
  75.    { cmcsb._cmblh = NULL; }
  76.  
  77. extern jmp_buf cmrpjb;        /* global jump buffer for auto reparse */
  78. extern jmp_buf cmerjb;        /* global jump buffer for auto error */
  79. extern jmp_buf cmbljb;        /* global jump buffer for nonblocking io */
  80. extern cmrpjmp();        /* reparse handler - longjmps via cmrpjb */
  81. extern cmerjmp();        /* error handler - longjmps via cmerjb */
  82. extern cmbljmp();        /* error handler - longjmps via cmerjb */
  83.