home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_100
/
178_01
/
tvx_refb.doc
< prev
next >
Wrap
Text File
|
1986-01-27
|
34KB
|
1,125 lines
TVX Reference Manual 11/27/85
the mistake, all the edit commands before the last '^B' as well as the
'^B' should be removed from the log file before applying it to the
previous version since '^B' created a backup copy of the file. This
means that all the editing commands entered before the '^B' will
already be saved, and thus should not be restored. Failure to take
this into account will result in a randomly edited file!!!
The other case involves the '^Y' yank external file command. The
external file read as a part of the '^Y' command is read using the
same I/O channel as the backup log file input, and thus both cannot be
used at the same time. If the backup log file contains any '^Y'
commands (displayed in the log file as '@Y'), you must remove them.
Obviously, this will alter the order of the commands in the file, and
you will need to use a special procedure. Suppose, for example, that
the backup log file contained one '^Y' command. Make two copies of
the backup log file. Edit the first, and remove all commands
following the '^Y' command, including the '^Y' command. Then edit the
other copy, and remove all commands before the '^Y', including the
'^Y'. Then, edit the backup copy of the original file. First, apply
the first backup log file. This will get you to the point right
before the '^Y'. Then without changing the cursor position, manually
enter the '^Y' command and file name. Finally, apply the second copy
of the backup log file.
It is also possible to write log command files of your own to
carry out specific commands. This allows the creation of "macros"
that can be executed as needed. When creating log files of your own,
you should remember that control characters and backspaces must appear
as encoded characters. The '@' is the encoding character. Control
characters will appear as '@' followed by the appropriate letter: '^I'
= '@I', enter = '@M', etc. An '@' itself is '@@', and backspace is
'@H', although you should never need a backspace in your own files
(use -K).
-18-
TVX Reference Manual 11/27/85
*** USER CUSTOMIZATION of TVX ***
A program called TVCONFIG is also provided with most versions of
TVX. It allows you to customize TVX to a great extent. The program
generates a file called CONFIG.TVX. When TVX is started with a
command line of the form: 'TVX filename -c=config.tvx", the values
defined in CONFIG.TVX will be used instead of the defaults. (Warning:
TVCONFIG is may not be implemented for all systems. Specifically, the
default Unix distribution does not provide TVCONFIG capabilities.)
TVCONFIG is mostly self explanatory. It allows you to change the
following:
1. Commands. All of the approximately 50 commands can be redefined.
There are some restrictions: all commands must be a single letter, and
case is ignored. The '@', ESCAPE, and '<>' commands cannot be
changed. Commands cannot be a number, including a '-'.
2. Synonyms. You may define some synonyms, such as space for right,
or RETURN for down. You cannot duplicate previously defined
commands.
3. Function Keys. Up to 50 function keys may be defined to be
equivalent to any command (in fact any letter or character). When a
function key is pressed, TVX will translate it to the character you
specify. If your function keys use an ESCAPE as a prefix character,
you will have to redefine a function key to be ESCAPE!
4. Parameters. You may change the default for any of the ':'
parameters.
After you have built a suitable working version of CONFIG.TVX,
another program called TVPATCH has been provided (for MS-DOS systems
only) to allow TVX.EXE (or TVX.COM) to be permanently patched with the
options set by TVCONFIG. This means you won't have keep track of the
CONFIG.TVX file any more, and won't need the '-c' switch.
-19-
TVX Reference Manual 11/27/85
*** Error Messages ***
*** Abort, are you sure?
This message is displayed after the "abort" command has been
entered. A reply of y or Y will cause the session to be terminated.
*** Bad O= switch
An incorrect format was specified for the O= switch.
*** Bad @ name
An invalid file name was specified. Re-enter.
*** Bad command: x
The command is not a valid TVX command.
*** Bad file name
An invalid file name was specified. Re-enter.
*** Bad output file: filename
An invalid output file was specified.
*** Bad par (val | name)
An invalid value or parameter name was specified.
*** Bad switch
An invalid switch was specified. Re-enter file name and
switches.
*** buffer empty
Information message. Displayed after a new file has been
created, or when the write buffer command is executed and the text
buffer is empty.
*** Can't create new name
TVX was unable to create a new name for the output file. Free
some disk space, rename the file, try again.
*** Can't insert that
There are three values that TVX uses internally, and thus are not
valid as user inserted characters in the text buffer.
*** Compacting buffer
Information message. Displayed when TVX is compacting the
buffer. The compaction process may take several seconds.
*** Compacting done
Information. The compaction is complete.
*** Compactor lost: quit now!
An internal error has been discovered. Exit TVX immediately, and
preserve the backup copy. Try the session again.
*** Create? (y/n)
The file name specified does not exist. A y answer will cause
the file to be created. A n answer will allow the file name to be
respecified.
-20-
TVX Reference Manual 11/27/85
*** Error reopening
Something has gone wrong with the 'File beginning' command.
Exit, and try editing the file again. Be careful since an empty file
may have been created.
*** File only part read
There was not enough room in the save buffer to hold the entire
external file specified in the 'merge' command. Try re-editing using
the 's' big buffer switch.
*** lines filled
TVX has run out of room to add more lines. Use the 'write
buffer' or 'file beginning' command to get more space for new lines.
*** no get room
There is not enough room in the text buffer to insert all the
text in the save buffer. Use the 'file begin' or 'write buffer'
commands, and try again. The '-^W' command is often useful.
*** no more lines for insert
See "lines filled".
*** no nesting
TVX does not allow nested repeat loops: "<<..>>".
*** no save room
There is not enough room left to save any more text in the save
buffer. Try saving smaller blocks, or use the 'file begin' command to
get more space.
*** No! buffer empty
Many TVX commands are not allowed on an empty buffer. Sometimes,
just inserting a blank line will allow the desired command to be
used.
*** No: read only
'File beginning' command invalid when the 'r' read only switch
was used.
*** not found
The current find pattern was not found.
*** Not last line!
TVX will allow you to save the last line of the file only once.
*** reading file...
Displayed while TVX is reading in the file.
*** rename fails
Something has gone wrong with the 'File beginning' or 'quit'
commands. On timeshared systems, this may mean you didn't have write
capability for the file. The work file will probably be retained, and
can be manually renamed or copied using standard operating system
commands.
*** search fails
-21-
TVX Reference Manual 11/27/85
A cross-buffer search has failed to find pattern.
*** writing buffer
Displayed when the buffer is being written out.
*** writing partial buffer
Partial buffer only, as caused by the '-^W' command.
*** Yank filename:
Enter the name of the file you want to read into the save
buffer.
*** 100 chars only
At most, 100 characters are allowed in each find pattern and each
repeat loop.
*** <> not complete
The repeat loop has terminated before the specified number times
have been executed. This is usually what you wanted, and can be
caused by failing to find a pattern, or reaching the end of the
buffer. An invalid command or other error will also cause a repeat
loop to terminate.
-22-
TVX Reference Manual 11/27/85
*** TTY MODE ***
Normally, TVX is used as a full screen editor. It will work on
dumb crt terminals or on hard copy terminals, however. The alternate
mode of operation is called tty mode. Tty mode is also useful for
terminals hooked up with slow baud rates. Almost all TVX commands are
supported in tty mode. The main difference is that the editor no
longer operates in a what you see is what you get mode.
When TVX is first started in tty mode (either by the -t command
line switch, or using 1:t), it will display a 'tvx>' prompt. The
normal mnemonic commands are then entered on the input line. The
input line is terminated by a <return> (which is not sent as a
command). Each letter on the input line will be interpreted as a TVX
command. Thus, entering a line: 'dddr' would move the cursor 3 lines
down and one character right. The result of the commands will not be
displayed however.
The 'V' verify command operates specially for tty mode, and is
used to type out lines of the file. The normal procedure, then is to
enter commands on the command input line, then enter appropriate 'V'
commands to display relevant lines of the buffer.
As long as normal TVX commands are entered, the command line
prompt is 'tvx>', and the terminating <return> sends commands to TVX
to execute. In insert, find, and repeat, the prompt will change to
'+'. All text entered, including <return>'s is entered into the text,
the find pattern, or the repeat loop buffer. An Escape ends the
command, and an additional <return> sends the line to TVX.
-23-
TVX Reference Manual 11/27/85
*** INSTALLATION OF TVX ***
If you have the C source code of TVX, this section has some notes
you should find useful if you recompile the code to customize TVX for
your system. It should also be helpful if you are installing TVX on a
new system. If you are just a user, then you can ignore this
section.
*** General Comments ***
TVX has been designed to be portable. It has had versions
running under CP/M-80, MS-DOS, RT-11, RSX-11, VMS, and Unix BSD 4.2.
The heart of TVX portability is the terminal driver. For dedicated
systems, the control codes used by a specific terminal are hard wired
into a C global variables and a terminal specific version is
compiled. It has been customary to give a unique name to each
different version such as TVV for a VT-52 version, TVT for a televideo
version, etc. The Unix version of TVX has been written to take
advantage of the TERMCAP library usually provided, and is thus
terminal independent.
Since terminals differ widely, TVX tries to update the screen as
best as possible using the control codes available. The minimum set
of control sequences required by TVX include direct x-y cursor
positioning, and erase from cursor to the end of the current line.
Almost all terminals have at least these two controls. The only known
terminal widely available that does not have both of these is the
ADM-3a. Thus, TVX will NOT work on ADM-3a's. Another desirable
control sequence is the ability to insert a blank line at the top of
the screen (reverse scroll). This allows TVX to scroll rather than
jump from one screen to the next. However, TVX will perform
adequately even on terminals with only x-y and erase to end of line.
*** Source Files Supplied ***
The following files are included in most distributions:
TVX_1.C - main part of code (part 1)
TVX_2.C - main part of code (part 2)
These two files are mostly os and terminal independent.
TVX_LEX.C - defaults, some os dependent stuff in here. Major
changes in defaults can be fixed by recompiling this file.
TVX_IO.C - almost all I/O, including screen, confined to this file.
TVX_LIB.C - misc library routines needed by TVX.
TVX_IBM.C - IBM-PC specific code, specifically the screen driver
(TVX_IBM.ASM - hand optimized version of TVX_IBM.C)
TVX_UNIX.C - contains unix specific code, including termcap driver
TVX_DEFS.IC - #define's for version, os, terminal, defaults
TVX_GLBL.IC - global data structures
TVX_TERM.IC - definitions for various terminals and systems
TVCONFIG.C - used to build CONFIG.TVX file for -c switch
TVPATCH.C - MS-DOS versions only - used to permanently apply
config settings to TVX.EXE.
-24-
TVX Reference Manual 11/27/85
TVX_MAKE.BAT - MS-DOS Batch file to build TVX using cii c-86.
TVX_MAKE.UNX - Unix Makefile to make on unix.
TVX_REF.DOC - This file, preformatted for printing on a "standard"
printer - 80 columns by 66 lines.
*** Screen Driver and Control Sequences ***
The actual codes used by TVX to update the screen are global
variables in the 'tvx_glbl.ic' file. Using the '#ifdef EXTERN' trick
described in that file, the screen variables (plus most other relevant
global variables) are included as external references. The actual
definitions for a given terminal are included in a file called
'tvx_term.ic'. Several sample definitions are included in the
distribution code. A description of each relevant variable follows:
** X-Y Cursor Addressing
int addx - amount to add to internal x position get terminal's x
value. Terminals typically encode x-y as a single printable
character, thus requiring the addition of a blank to make x-y
printable. Since TVX uses a 1,1 origin, this value will commonly be
31.
int addy - same as addx, but for y position.
char cxychr - true (1) if convert xy binary representation to ascii
string.
char cxy1st - 'l' if line coordinate first, 'c' if column first.
char cxybeg[8], char cxymid[8], char cxyend[8] - The x-y cursor
control sequence usually takes one of two forms: <control><x><y> or
<control><x><middle><y><end>. The x and y may be reversed. These
three arrays are used to send the proper control sequence for xy
positioning.
*** Other control sequences
char cversn[12] - a version string to identify terminal.
char cerrbg[8], char cerred[8] - sequences sent when an error message
sent to terminal's last line. Note that cerrbe is sent BEFORE the
cursor is moved to the last line, and cerred is sent before the cursor
is returned to the original position. Some terminals give problems if
a highlight sequence is sent before a cursor positioning sequence. A
bell is usually safe for most versions.
char ctopb[8] - This sequence should insert a blank line when the
cursor is at the top left corner. It is often called reverse line
feed. A command to insert a line usually performs the same function,
but some terminals don't have both.
-25-
TVX Reference Manual 11/27/85
char cinit[20], char cendit[20] - these sequences are sent to
initialize and reset the terminal.
char cbotb[8] - this sequence scrolls the screen up one line when the
cursor is on the last line. Line feed works for any terminal
encountered to date.
char celin[8] - Erase from cursor to end of line. This sequence is
required for operation of TVX.
char cescr[8] - Erase from cursor to end of screen. If the terminal
doesn't have this, it is simulated using multiple celins.
char ccsrcm[8], char ccsrin[8] - These are used to change the cursor
from command mode to insert mode. Many terminals do not support a
method of changing the cursor shape. These have been also been used
to change the screen from normal to reverse video an back.
char ciline[8] - Insert a blank line. A blank line is inserted on the
line the cursor is on. If available, it can be used for ctopb, too.
char ckline[8] - Kill a line. The line the cursor is on is deleted,
and the following text scrolled up.
char cundlb[8], cundle[8] - TVX has the capability to optionally
support bold and underline for some text processors. For example, a
^U can be used to toggle underscore. This is only useful for a text
formatter that can recognize such a sequence.
char cboldb[8], char cbolde[8] - Similar to undlb, but boldface.
*** Default settings
int ddline - default display line. This sets which line is the
default home display line. For scrolling versions (dscrl != 0), right
in the middle is a good place. For fixed cursor line versions,
something below the middle seems better (like 16 for 24 line
screens).
int dscrl - default scroll lines. If this is non-zero, the cursor
will move up and down lines on the screen with cursor movement
commands. This requires a bit less screen update overhead, and is
better for slower time shared systems. If it is zero, the cursor will
remain fixed on ddline, and text will scroll on and off the screen as
needed. Both these are resettable with the : command.
int dxcase - default search case. 0 means find is case insensitive, 1
means find must match exact case.
int usecz - MS-DOS versions only. If 1, TVX will put a Control-Z end
of file mark in the file (this is CP/M compatible). If 0, TVX uses
MS-DOS end of file conventions.
int autoin - TRUE (1) if auto indent, FALSE (0) otherwise.
-26-
TVX Reference Manual 11/27/85
int logdef - Create backup log file by default? 0->no, 1-> yes.
char wildch - The character used as a wild card in finds.
char delkey - the delete character key, usually backspace.
int tvhardlines - number of physical lines on screen.
int tvlins - number of lines on virtual screen. Initially should be
same value as tvhardlines.
int tvcols - number of columns on screen. If the terminal wraps new
text to the next line rather than discarding characters after the last
column, then tvcols must be set to 1 less than the true width of the
terminal.
int isibmpc - TRUE (1) if this version uses the custom IBM-PC screen
driver. FALSE (0) if uses regular terminal output code.
char synofr[20], char synoto[20] - These are used to map commands.
The synofr contains commands to be aliased to the corresponding
command in the synoto table. For example, the '[' and '{' keys are
often reversed on some terminals. Making '[' in synofr a synonym to
'{' in synoto will make the two commands the same.
char funkey - If the terminal has function keys, they can be supported
by TVX by setting this variable to the first code sent by the function
key, usually ESCAPE. TVX supports only two code sequences for
function keys.
char funchar[50] - this is the second code sent by a function key.
char funcmd[50] - this is the equivalent command a given function key
will be mapped to. Similar to synofr and synoto.
*** #define options
The file 'tvx_defs.ic' has many #define statements that can be
used to customize TVX for particular installations. Ideally, the
source for TVX should be maintained as one set, and differences
between versions handled by #defines. Most #defines are explained in
the source code, but a few deserve a few extra comments, and are
summarized below.
#define VERSION " - TVX (7/1/85) - " - This defines the version of
TVX. Any time a modification is made, the VERSION define should be
updated.
#define VB - whether or not to create backup log version or not. This
does NOT imply the file "backup.log" will be used automatically (see
variable logdef), simply that the code is included.
#define ULBD - If defined, TVX supports underline, bold in ^U, ^B
format.
-27-
TVX Reference Manual 11/27/85
#define BACKUPNAME - This defines the name of the backup log file, if
used.
#define BUFFLIMIT - This defines how much space is saved in the text
buffer when reading in a file. This determines how much space is
reserved for saving text with the 'S' command, and how much is left
over for new inserts. Smaller values allow more text from the file to
be read, larger values allow more text to be saved. The '-s' switch
at runtime increases this value.
#define FILEREAD, #define FILEWRITE - These define the string used for
file mode in the fopen() calls. Unix and MS-DOS versions are not
typically exactly compatible, as most MS-DOS C's allow a different
mode to handle the CR/LF problem.
#define FNAMESIZE - maximum length of file names.
#define INT16 - If #defined, then the normal C int is 16 bits long.
This changes the way memory status is displayed.
#define LINELIMIT - Like BUFFLIMIT, only number of lines. #define
MAXBUFF - Defines maximum number of characters allocated to text
buffer. Malloc() is used to get the space from the runtime system.
It is possible less than MAXBUFF will be available. The maximum
allowed for any given system must be less than the maximum value
represented by an unsigned int. If MAXBUFF is very large, there get
to be a noticeable initialization delay.
#define MAXLINE - This determines the maximum number of lines
allocated per buffer. It is related to MAXBUFF.
#define REPEATBUFS - defines how many repeat buffers are allocated.
If space is a problem, allocate fewer repeat buffers.
#define USELF - This symbol should be defined if the terminal needs a
line feed character after each carriage return. Almost always true.
#define FILELF - This symbol is defined if text files use a CR/LF
combination. It causes a NEWLINE/LF to be written to files.
#define NEWLINE - This defines the actual character used as a new line
in files. On CR/LF systems, it should be a CR (13). On systems like
Unix with a single new line separator, it should be that character
(LF).
#define USECTRLZ - defined if the code for handling a Control-Z and
end of file mark should be used.
#define NEEDTVLIB - define this if the standard C library provided
doesn't have the routine in TVX_LIB.
#define HELP - Define this if help should be supported. The help
routine uses significant space, which can be saved if help isn't
compiled in.
#define CONFIGFILE - define this if support for the '-c' switch is
-28-
TVX Reference Manual 11/27/85
desired.
**** MS-DOS Notes ***
TVX can be built as a generic MS-DOS version and as an IBM-PC
specific version. The MS-DOS version uses the standard DOS character
output routines. Thus, it could use the ANSI.SYS driver, but it would
run very slowly then. The IBM-PC version has a custom screen driver
that calls the ROM BIOS directly, and is very fast. A special hand
optimized version of the driver is also included in the source (valid
for cii c-86 only!). The definitions for and IBMPC included in
"tvx_term.ic" also define the keypad keys to work in a predictable
manner.
*** Unix Notes ***
The usual Unix version will be the TERMCAP version. That version
works very well, but is not in all cases optimal for a given
terminal. It might be desirable to build a specific version for the
terminal you use most often. Most notably, the TERMCAP version does
not know about cursor shapes or other control sequences to distinguish
command mode from insert mode. Also, it sets tvcols to one less than
the true value to avoid wrapping problems. The termcap version also
only sends a bell for the error message.
-29-
TVX Reference Manual 11/27/85
*** TVX File Usage ***
TVX uses four logical files: the original file, the destination
file, a work file, and the source file. The original file and the
destination file are not touched until a normal exit from TVX.
The source file is the current copy of the file providing text to
be entered. When TVX is first started, the source file and the
original file are the same. The work file is used to hold the edited
output file.
When the '^B' file beginning command is issued, the remainder of
the source input file is written to the work output file. The work
file then becomes the new source file, and a new work file is
created. Thus, it is possible to have four copies of a file around:
The .BAK backup copy of the original file, the original copy of the
file, the copy of the source file, and the (partially written) work
file. Under normal operation, there will only be two copies: the
source file (which is really the original file) and the possibly
partially written work file. Only by using the '^B' commands can 3
copies of the file exist.
When you issue the normal '^X' exit command, the following
actions take place: Any old .BAK files are deleted. The original file
is renamed to be the new .BAK version. If the source file is
different than the original file, it will be deleted. The work file
is then renamed to be the destination file. If you don't have write
access to the directory with the original file, then the original file
and the work file will not be renamed. A message to that effect will
be printed. The normal operating system copy and rename commands can
be used to recover the work file, which contains the edits made to
date.
-30-
TVX Reference Manual 11/27/85
*** Quick Reference Summary ***
TVX Commands (n => count allowed)
nA Append lines B Buffer beginning
^B File beginning nC Change chars
nD Down line n^D Down column
E Buffer end n^E Edit repeat buffer
nF Find pattern ^F Find across buffs
G Get save buffer ^G Unkill last line
nH Half page nI Insert (till $)
J Jump back nK Kill character
n^K Kill line nL Left
M Memory status nN Note location
n^N Reset location nO Open blank line
^O Operating system nP Page
^P Print screen nR Right
^R Restore edited buffer nS Save lines
nT Tidy (fill text) ^T Abort session
nU Up n^U Up column
V Verify n^W Write buff
^X Exit, end session n^Y Yank to(-n)/from(+n) file
nBS Delete prev. char. n; Find again
/ Delete last thing = Change last thing
' Del to line beginning " Delete to line end
, Line beginning . Line end
nTAB Word right n{ Word left
n<>$$ Repeat loop n& Repeat again
n#k Execute repeat buffer k n times
? Help @ Invoke cmd file
* Insert pattern found last
$ Escape - end insert, find, repeat
n:p Set parameter p
Possible parameters:
A - Autoindent (1=y,0=n) D - display line
E - Expand tabs to n spaces F - find case (0=exact,1=any)
M - Match wild cards O - set output file name
S - scroll window R - repeat buffer to use
T - tty mode U - define user wild card set
V - virtual window W - autowrap width
Usage: tvx filename [-b -i -l -o=f -r -s -t -w -# {-z -c=f}]
-[no]b : backup file -[no]i : autoindent
-[no]l : make command log file -t : tty mode
-o=outputfile -r : read only
-s : big save buff -[no]w : word processing mode
-# : set virtual window lines to #
On MS-DOS versions:
-[no]z : use control-z for end of file
-31-
TVX Reference Manual 11/27/85
-c=configfile -c : use /bin/config.tvx
-32-
TVX Reference Manual 11/27/85
*** INDEX ***
TVX Reference Manual
abort - 10
append - 4, 10
auto wrap - 16
autoindent - 15
backspace - 2, 12, 17, 18
backup file - 3, 4, 10, 17
beginning of file - 4, 6, 17
buffer - 2, 4, 5, 6, 8, 9, 11
buffer beginning - 4
change - 4
commands - 2, 4
cursor - 2
cursor character - 3
default source settings - 26
define options - 27
delete last thing - 12
delete line front - 13
delete line tail - 13
delete previous character - 12
down - 4, 10
down in column - 4
end buffer - 5
end session - 11
Error Messages - 20
escape - 3, 4, 5, 7, 17
exit - 11
external file - 12
find - 5, 6, 12, 15
find case - 15
get - 6
get killed line - 7
half page - 7
home display line - 15
insert - 7, 8
Insert find pattern - 13
Installation - 24
Installation - MS-DOS - 29
Installation - Unix - 29
invoke command file - 15
jump - 7
kill characters - 7
kill lines - 8
-33-
TVX Reference Manual 11/27/85
left - 8
line beginning - 13
line end - 13
log file - 3, 12, 15, 17
memory - 8
mode - 3, 4, 7, 8, 12
note - 8
open line - 8
operating system - 8
other control sequences - 25
output file - 15
page - 7, 9
parameters - 15
print - 9
Quick Reference Summary - 31
quit - 4
repeat buffer - 9
repeat loop - 5, 13, 16
right - 9
save buffer - 4, 7, 9, 12
scroll lines - 16
search - 5
skip over words - 13
source code - 24
starting up - 1
status - 8
switches - 1
tab expansion - 15
terminate - 10
tidy - 10
tty mode - 16, 23
TVX File Usage - 30
unkill - 7
up - 11
up in column - 11
user customization - 19
verify - 11
virtual window - 16
wild card - 6, 15
word - 13
write buffer - 11
-Y Cursor Addressing - 25
yank external file - 12
-34-