home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / mm / ccmd / ccmdmd.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-18  |  2.6 KB  |  94 lines

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