[reactos.git] / posix / apps / csrterm / 00readme.txt
1 08/08/96 - John L. Miller, johnmil@cs.cmu.edu, johnmil@jprc.com
4 00readme.txt - this file
5 VT100.H - Definitions for VT-100 emulator.
6 VT100.C - Front end parsing code for VT-100 emulator
7 CONSOLE.C - Back-end code to allow VT-100 in WinNt/Win95 console
9 Many UNIX users take terminals for granted, as something you get for free
10 with the operating system. Unfortunately, this isn't the case for many
11 non-unix operating systems, especially PC-based ones. After a number of
12 projects, I decided it would be nice if there was source publicly available
13 for doing VT-100 emulation.
15 The files included with this distribution are not a complete implementation
16 of VT-100 terminal emulation, but do provide complete enough coverage to
17 use many vt-100 functions over the network. For instance, its enough to
18 use EMACS to edit, or to connect up to your favorite mud with ANSI color
19 and graphics characters.
21 The VT-100 emulator is broken into two parts. The first is the front end,
22 vt100.c and vt100.h. These files were written to be fairly device-independant,
23 though admittedly if you're running under a 16-bit operating system instead
24 of a 32-bit, you might need to change some of the 'int' values to 'long.'
25 Otherwise, it should work 'as-is'.
27 The second part is a back-end. The back-end is responsible for doing the
28 workhorse activities. The front-end parses a character stream, and decides
29 whether to clear a part of the screen, or move the cursor, or switch fonts.
30 Then it calls routines in the back-end to perform these activities.
32 The back-end functions are, for the most part, very straight forward, and
33 quite easy to implement compared to writing a vt-100 emulator from scratch.
34 CONSOLE.C is a back-end for use in console (command, dos) windows under
35 Windows 95 and Windows NT. This console vt-100 emulator is also being used
36 in my TINTIN-III port and kerberized encrypted telnet port.
41 First, it's intended to be linked directly into source code. You'll need
42 to change printf's and puts' in your source code to call vtprintf() and
43 vtputs() instead. You can add additional functions to vt100.c as you see
44 fit to handle other output functions like putchar() and write(). Another
45 routine you may want to use is vtProcessedTextOut(), which accepts a
46 buffer to output, and a count of characters in that buffer.
48 Second, you need to make sure that your source code calls vtInitVT100()
49 before it does ANYTHING else. This initializes the vt-100 emulator.
51 Third, if you want to use this VT-100 emulator with anything besides
52 Windows NT and Windows 95 consoles, you'll need to implement your own
53 back end. The list of functions you will need to supply, as well as what
54 they need to do is contained in vt100.h. The list (minus descriptions)
55 is as follows:
57 int beInitVT100Terminal();
58 int beAbsoluteCursor(int row, int col);
59 int beOffsetCursor(int row, int column);
60 int beRestoreCursor(void);
61 int beSaveCursor(void);
62 int beSetTextAttributes(int fore, int back);
63 int beRawTextOut(char *text, int len);
64 int beEraseText(int rowFrom, int colFrom, int rowTo, int colTo);
65 int beDeleteText(int rowFrom, int colFrom, int rowTo, int colTo);
66 int beInsertRow(int row);
67 int beTransmitText(char *text, int len);
68 int beAdvanceToTab(void);
69 int beClearTab(int col);
70 int beSetScrollingRows(int fromRow, int toRow);
71 int beRingBell(void);
72 int beGetTermMode();
73 int beSetTermMode(int newMode);
75 For details on what each of these does, read the descriptions of each
76 function included in vt100.h, and read over CONSOLE.C for examples. I've
77 included copious comments in all of these files to try to make them as
78 easy to use as possible.
80 In any case, it should be easier than writing a VT-100 emulator from
81 scratch.
85 o Many features of VT-100 emulation aren't implemented. This includes
86 support for graphics character set 0 and many of the
87 answerback functions.
89 Well, good luck!