End of line fix for gcc 3.x, other misc fixes for 3x
[reactos.git] / rosapps / net / telnet / src / ansiprsr.h
1 #ifndef __ANSIPRSR_H
2 #define __ANSIPRSR_H
3
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <ctype.h>
7 #include <string.h>
8 #include "tnconfig.h"
9 #include "tparser.h"
10
11 // added this color table to make things go faster (Paul Branann 5/8/98)
12 enum Colors {BLACK=0, BLUE, GREEN, CYAN, RED, MAGENTA, YELLOW, WHITE};
13 static const int ANSIColors[] = {BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE};
14
15 // This should be greater than the largest conceivable window size
16 // 200 should suffice
17 #define MAX_TAB_POSITIONS 200
18
19 // Added by Frediano Ziglio 6/2/2000
20 // Include Meridian Emulator support
21 // undefine it to remove support
22 #define MTE_SUPPORT 1
23
24 // TANSIParser is now properly no longer a base class for TTelnetParser.
25 // Screen output is handled in TConsole.cpp.
26 // (Paul Brannan 6/15/98)
27 class TANSIParser : public TParser {
28 private:
29 char* ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd);
30 char* ParseANSIBuffer(char* pszBuffer, char* pszBufferEnd);
31 char* ParseEscape(char* pszBuffer, char* pszBufferEnd);
32 // Added by I.Ioannou 06/04/97
33 char* PrintBuffer(char* pszBuffer, char* pszBufferEnd);
34 char* PrintGoodChars(char * pszHead, char * pszTail);
35
36 #ifdef MTE_SUPPORT
37 // Added by Frediano Ziglio, 5/31/2000
38 char* ParseEscapeMTE(char* pszBuffer, char* pszBufferEnd);
39 short int mteRegionXF,mteRegionYF;
40 #endif
41
42 void ConSetAttribute(unsigned char wAttr);
43 char *GetTerminalID();
44 void ConSetCursorPos(int x, int y);
45 void ResetTerminal();
46 void Init();
47
48 void SaveCurX(int iX);
49 void SaveCurY(int iY);
50
51 void resetTabStops();
52
53 int iSavedCurX;
54 int iSavedCurY;
55 unsigned char iSavedAttributes;
56 FILE * dumpfile;
57
58 // Added by I.Ioannou 06 April 1997
59 FILE * printfile;
60 char InPrintMode;
61 int inGraphMode;
62
63 char last_char; // TITUS++: 2. November 98
64
65 char map_G0, map_G1;
66 int current_map;
67 bool vt52_mode;
68 bool print_ctrl;
69 bool ignore_margins;
70 bool fast_write;
71 bool newline_mode;
72
73 int tab_stops[MAX_TAB_POSITIONS];
74
75 public:
76 // Changed by Paul Brannan 5/13/98
77 TANSIParser(TConsole &Console, KeyTranslator &RefKeyTrans,
78 TScroller &RefScroller, TNetwork &NetHandler, TCharmap &RefCharmap);
79 ~TANSIParser();
80
81 char* ParseBuffer(char* pszBuffer, char* pszBufferEnd);
82 static int StripBuffer(char* pszBuffer, char* pszBufferEnd, int width);
83 };
84
85 #endif