home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 313_01 / term.h < prev    next >
C/C++ Source or Header  |  1990-04-22  |  5KB  |  122 lines

  1. /* $Header: /nw2/tony/src/stevie/src/RCS/term.h,v 1.7 89/08/01 17:25:18 tony Exp $
  2.  *
  3.  * System-dependent escape sequence definitions.
  4.  */
  5.  
  6. #ifdef    TERMCAP
  7.  
  8. extern char *T_EL;        /* erase the entire current line */
  9. extern char *T_IL;        /* insert one line */
  10. extern char *T_DL;        /* delete one line */
  11. extern char *T_SC;        /* save the cursor position */
  12. extern char *T_ED;        /* erase display (may optionally home cursor) */
  13. extern char *T_RC;        /* restore the cursor position */
  14. extern char *T_CI;        /* invisible cursor (very optional) */
  15. extern char *T_CV;        /* visible cursor (very optional) */
  16.  
  17. extern char *T_CM;        /* cursor motion string */
  18.  
  19. #else
  20.  
  21. /*
  22.  * This file contains the machine dependent escape sequences that
  23.  * the editor needs to perform various operations. Some of the sequences
  24.  * here are optional. Anything not available should be indicated by
  25.  * a null string. In the case of insert/delete line sequences, the
  26.  * editor checks the capability and works around the deficiency, if
  27.  * necessary.
  28.  *
  29.  * Currently, insert/delete line sequences are used for screen scrolling.
  30.  * There are lots of terminals that have 'index' and 'reverse index'
  31.  * capabilities, but no line insert/delete. For this reason, the editor
  32.  * routines s_ins() and s_del() should be modified to use 'index'
  33.  * sequences when the line to be inserted or deleted line zero.
  34.  */
  35.  
  36. /*
  37.  * The macro names here correspond (more or less) to the actual ANSI names
  38.  */
  39.  
  40. #ifdef    ATARI
  41. #ifdef    MINIX
  42.  
  43. #define    T_EL    "\033[2K"    /* erase the entire current line */
  44. #define    T_IL    "\033[L"    /* insert one line */
  45. #define    T_DL    "\033[M"    /* delete one line */
  46. #define    T_SC    "\0337"        /* save the cursor position */
  47. #define    T_ED    "\033[2J"    /* erase display (may optionally home cursor) */
  48. #define    T_RC    "\0338"        /* restore the cursor position */
  49. #define    T_CI    ""        /* invisible cursor (very optional) */
  50. #define    T_CV    ""        /* visible cursor (very optional) */
  51.  
  52. #else
  53.  
  54. #define    T_EL    "\033l"        /* erase the entire current line */
  55. #define    T_IL    "\033L"        /* insert one line */
  56. #define    T_DL    "\033M"        /* delete one line */
  57. #define    T_SC    "\033j"        /* save the cursor position */
  58. #define    T_ED    "\033E"        /* erase display (may optionally home cursor) */
  59. #define    T_RC    "\033k"        /* restore the cursor position */
  60. #define    T_CI    "\033f"        /* invisible cursor (very optional) */
  61. #define    T_CV    "\033e"        /* visible cursor (very optional) */
  62.  
  63. #endif
  64. #endif
  65.  
  66. #ifdef    UNIX
  67. /*
  68.  * The following sequences are hard-wired for ansi-like terminals. To get
  69.  * termcap support, define TERMCAP in env.h and these sequences go away.
  70.  */
  71. #define    T_EL    "\033[2K"    /* erase the entire current line */
  72. #define    T_IL    "\033[L"    /* insert one line */
  73. #define    T_DL    "\033[M"    /* delete one line */
  74. #define    T_ED    "\033[2J"    /* erase display (may optionally home cursor) */
  75. #define    T_SC    "\0337"        /* save the cursor position */
  76. #define    T_RC    "\0338"        /* restore the cursor position */
  77. #define    T_CI    ""        /* invisible cursor (very optional) */
  78. #define    T_CV    ""        /* visible cursor (very optional) */
  79. #endif
  80.  
  81. #ifdef    OS2
  82. /*
  83.  * The OS/2 ansi console driver is pretty deficient. No insert or delete line
  84.  * sequences. The erase line sequence only erases from the cursor to the end
  85.  * of the line. For our purposes that works out okay, since the only time
  86.  * T_EL is used is when the cursor is in column 0.
  87.  *
  88.  * The insert/delete line sequences marked here are actually implemented in
  89.  * the file os2.c using direct OS/2 system calls. This makes the capability
  90.  * available for the rest of the editor via appropriate escape sequences
  91.  * passed to outstr().
  92.  */
  93. #define    T_EL    "\033[K"    /* erase the entire current line */
  94. #define    T_IL    "\033[L"    /* insert one line - fake (see os2.c) */
  95. #define    T_DL    "\033[M"    /* delete one line - fake (see os2.c) */
  96. #define    T_ED    "\033[2J"    /* erase display (may optionally home cursor) */
  97. #define    T_SC    "\033[s"    /* save the cursor position */
  98. #define    T_RC    "\033[u"    /* restore the cursor position */
  99. #define    T_CI    ""        /* invisible cursor (very optional) */
  100. #define    T_CV    ""        /* visible cursor (very optional) */
  101. #endif
  102.  
  103. #ifdef    DOS
  104. /*
  105.  * DOS sequences
  106.  *
  107.  * Some of the following sequences require the use of the "nansi.sys"
  108.  * console driver. The standard "ansi.sys" driver doesn't support
  109.  * sequences for insert/delete line.
  110.  */
  111. #define    T_EL    "\033[K"    /* erase the entire current line */
  112. #define    T_IL    "\033[L"    /* insert line (requires nansi.sys driver) */
  113. #define    T_DL    "\033[M"    /* delete line (requires nansi.sys driver) */
  114. #define    T_ED    "\033[2J"    /* erase display (may optionally home cursor) */
  115. #define    T_SC    "\033[s"    /* save the cursor position */
  116. #define    T_RC    "\033[u"    /* restore the cursor position */
  117. #define    T_CI    ""        /* invisible cursor (very optional) */
  118. #define    T_CV    ""        /* visible cursor (very optional) */
  119. #endif
  120.  
  121. #endif
  122.