Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
3.1 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. tty.h
  5. Abstract:
  6. Prototypes for functions & macros in viotty.c
  7. Author:
  8. Michael Jarus (mjarus) 28-Apr-1992
  9. Environment:
  10. User Mode Only
  11. Revision History:
  12. --*/
  13. /*
  14. * - character definitions for ANSI X3.64
  15. */
  16. #define ANSI_ESC 0x1B /* ESC - escape */
  17. #define ANSI_CUU 0x41 /* ESC[<n>A - cursor up */
  18. #define ANSI_CUD 0x42 /* ESC[<n>B - cursor down */
  19. #define ANSI_CUF 0x43 /* ESC[<n>C - cursor forward */
  20. #define ANSI_CUB 0x44 /* ESC[<n>D - cursor back */
  21. #define ANSI_CUP 0x48 /* ESC[<row>;<col>H - cursor position */
  22. #define ANSI_ED 0x4A /* ESC[2J - erase display */
  23. #define ANSI_EL 0x4B /* ESC[K - erase line */
  24. #if 0
  25. // These don't seem to be part of ANSI X3.64. -mjb
  26. #define ANSI_SCP 0x53 /* ESC[S - save cursor position */
  27. #define ANSI_RCP 0x55 /* ESC[U - restore cursor position */
  28. #endif
  29. #define ANSI_CUP1 0x66 /* ESC[<row>;<col>f - cursor position */
  30. #define ANSI_SMOD 0x68 /* ESC[=<s>h - set mode */
  31. #define ANSI_RMOD 0x6C /* ESC[=<s>l - reset mode */
  32. #define ANSI_SGR 0x6D /* ESC[<g1>;...;<gn>m - select graphic rendition */
  33. #define ANSI_ICH 0x40 /* ESC[@ insert character */
  34. #define ANSI_CNL 0x45 /* ESC[E cursor to next line */
  35. #define ANSI_CPL 0x46 /* ESC[F cursor to previous line */
  36. #define ANSI_IL 0x4C /* ESC[L insert line */
  37. #define ANSI_DL 0x4D /* ESC[M delete line */
  38. #define ANSI_DCH 0x50 /* ESC[P delete character */
  39. #define ANSI_SU 0x53 /* ESC[S scroll up */
  40. #define ANSI_SD 0x54 /* ESC[T scroll down */
  41. #define ANSI_ECH 0x58 /* ESC[X erase character */
  42. #define ANSI_CBT 0x5A /* ESC[Z backward tabulation */
  43. /* states of the finite state machine */
  44. #define NOCMD 1 /* type of crt state - most chars will go onto screen */
  45. #define ESCED 2 /* we've seen an ESC, waiting for rest of CSI */
  46. #define PARAMS 3 /* we're building the parameter list */
  47. #define MODCMD 4 /* we've seen "ESC[=" waiting for #h or #l (# in {0..7}) */
  48. #define MODDBCS 5 /* we've seen DBCS lead-in char */
  49. #define NPARMS 3 /* max # of params */
  50. COORD ansi_coord; /* current active position */
  51. COORD ansi_scp; /* CurPos for saving */
  52. USHORT ansi_param[NPARMS]; /* parameter list */
  53. USHORT ansi_pnum; /* index of parameter we're building */
  54. USHORT ansi_state; /* state of machine */
  55. WORD ansi_base; /* base colors value */
  56. USHORT ansi_reverse; /* reverse flag */
  57. USHORT ignore_next_char;
  58. COORD TTYCoord;
  59. HANDLE TTYcs;
  60. LPSTR TTYDestStr;
  61. LPSTR TTYTextPtr;
  62. DWORD TTYNumBytes;
  63. BOOL TTYCtrlCharInStr;
  64. BOOL TTYOldCtrlCharInStr;
  65. VOID clrparam(void);
  66. DWORD ansicmd(IN HANDLE __cs, IN register CHAR __c);
  67. int range(register int __val, register int __def, int __min, int __max);
  68. DWORD SetTTYAttr(IN HANDLE __cs, IN USHORT __AnsiParm);
  69. DWORD TTYFlushStr(USHORT *__newcoord, const char *__call);