%NAME: Bruce M. Corwin
%PROG: ftpterm
%CODE: ftpterm.c topLevelShell1.c
%COMP: Bruce M. Corwin
%FUNC: program
This system is a demonstration of the VT Motif widget.  This program works like
a DEC style terminal plus many other special GUI type
functions that can make a text based application look like
a full fledged Motif application.
%FUNC: main
This is the entry point for the test main routine.
%FUNC: XmVtScrollBarSetValue
This function is used to set the scroll value of the VT
widget.
%FUNC: XmVtSyncSize
This function is used before the main application is
realized to coordinate its width and height with the
VT widgets columns and rows.  This is very useful in
cases where the VT widget is the main widget in the
application and should have a specified number of
columns and rows for any given font.
%FUNC: ObtainGraphicsContexts
This function is used to find all the needed Graphics
Contexts for the widget.
%FUNC: revive
This function revives any character on the screen that
is visible.  This is done for a redisplay.
%FUNC: revive_all
This function is used when there has been a scroll or
several scrolls that have taken place during a write.
To make the widget use its time best it will only
mark all screen bytes as modified only if a scroll has
occured and it will only do this at the end of the
write.  To demonstrate, consider a buffer full of
line feeds. If the widget looped the entire screen for
each line feed there would be millions of iterations
of the marking loop while, by using revive_all, there
is only a single marking of the entire screen.
%FUNC: add_char
add_char adds one character at the current position.
It will overwrite any character in that position.
%FUNC: insert_char
insert_char inserts one character at the current position.
It will move characters out of the way to make room for
the character to be printed.
%FUNC: parse_esc
parse_esc isolates an escape sequence to be later
executed by execute_esc.
%FUNC: message
message parses an escape sequence that is sent to provide
a message to the terminal.  This message is stored in the
vt structure.
%FUNC: fre_char_2D
fre_char_2D frees all memory allocated for char 2D array.
%FUNC: alc_char_2D
alc_char_2D defines a dynamic 2 dimensional string array.
%FUNC: free_dynamic
free_dynamic frees all the dynamic varables for the
program which are global.
%FUNC: contig
This function finds a contiguous string of characters in
the screen buffer that have the same attributes and
character set.  It begins its search at a given set of
coordinates.
%FUNC: push
This function saves the top line before it is destroyed
by a scroll.  It is saved in a circular type array with
a maximum of entries defined by MAXHIST
%FUNC: pvt100
The function pvt100 is used to interface the vt100 widget
to a program running on a pseudo keyboard.  It is used for
interactive testing.
%FUNC: send_keys
Send_keys is used to send data to the input buffer
of the widget from a non-keyboard input method.
%FUNC: reset
Reset initializes all of the soft parameters for the
screen.  This includes where the cursor is and clearing
the screen as well as setting insert and attributes.
%FUNC: init_data
init_data initializes all the internal data structures
for the screen.  It allocates space sets the cursor in
places and clears the scree.
%FUNC: resize_data
resize data changes the values of the rows and columns
of the screen.  It does some dynamic memory changes
and ensures all memory is accounted for.
%FUNC: free_data
free_data frees all allocated dynamic memory associated
with the screen.
%FUNC: write_s
write_s works just like write except no file descriptor
is passed because write_s only writes to the screen.
%FUNC: right_edge
Check to see if the cursor is at the right edge, if
true move to next line.
%FUNC: speccmp
This routine is a Special string compare that works
alot like strncmp except that ; characters are removed
from the first string before the comparison is made.
This basicaly means that the ; character is ignored.
%FUNC: tab_over
Tab over to the next screen defined tab.
%FUNC: insert_blanks
Insert any number of spaces at the current cursor.
%FUNC: insert_lines
Insert any number of blank lines at the current cursor.
%FUNC: delete_lines
Delete any number of blank lines starting at the current
cursor.
%FUNC: reverse_index
Insert one line at the cursor.
%FUNC: bottom_edge
Check to see if the cursor is at the bottom edge if
true scroll up one line.
%FUNC: non_print
Execute the non printable character actions like
Carage return, line feed and escape.
%FUNC: delete_char
Delete any number of characters from the cursor forward.
%FUNC: half_scroll_up
Scroll up lower part of the screen up to the cursor.
%FUNC: scroll_up
Scroll the screen up.
%FUNC: clear_eol
Clear to end of line.
%FUNC: clear_down
Clear downward from cursor.
%FUNC: clear_all
Clear all the screen.
%FUNC: paint_data
Paint the current data to the output device.
%FUNC: strcatch
Concatenate a character to a string.
%FUNC: sync_cursor
Make sure that the screen cursor is not outside the bounds
of the screen.
%FUNC: execute_esc
Execute the commands associated with an escape sequence.
%FUNC: dputs
Debug puts.
%FUNC: sub_proc_one
Sub process an 'escape[?ParmsCode'  seqence for parameters.
Most of these will be hard coded in the execute_esc 
function.  Only those that are not being processed will
end up here.
%FUNC: sub_proc_two
Sub process an 'escape[ParmsCode'  seqence for parameters.
Some of these will be hard coded in the execute_esc
function. Several heavily used functions like relocating
the cursor are located here.
%FUNC: insert_mode
Turn on the insert mode.
%FUNC: non_insert_mode
Turn off the insert mode.
%FUNC: place_cursor
Place the cursor in a specific location. 
This is a routine called by the screen system,
and is located in the graphics subsystem.
%FUNC: remove_cursor
Remove the cursor from a specific location.
This is a routine called by the screen system,
and is located in the graphics subsystem.
%FUNC: clean
Clean an area of all graphical information.
%FUNC: plot
Plot a string in a specific location. This is
a routine called by the screen system, and is
located in the graphics subsystem.
%FUNC: beep
Produce an audible tone. This is a routine called by
the screen system, and is located in the graphics
subsystem.
%FUNC: XmVtWrite
XmVtWrite is an externaly callable routine that
is used like the write system call except it
accesses a XmVtWidget instead of a file
descriptor.
%FUNC: XmVtRead
XmVtRead is an externaly callable routine that
is used like the read system call except it
accesses a XmVtWidget instead of a file
descriptor.
%FUNC: XmVtFlush
XmVtFlush is an externaly callable routine that
is used to clear the keyboard buffer of all
characters.  This can be used if a user would
like to utilize the data in an Activate
callback structure instead of using XmVtRead.
%FUNC: XmVtSend
XmVtSend is an externaly callable routine that
is used to send characters to the keyboard
buffer manually.  When this is done the Activate
callback is called.
%FUNC: Initialize
Initialize is used to intialize the screen
data structures and other XmVtWidget data
structures.
%FUNC: GetWidthFromColumns
GetWidthFromColumns is used to obtain an equivilent
pixel width of the widget from the number of columns.
This is usualy used to try to reset this width.
%FUNC: GetHeightFromRows
GetHeightFromRows is used to obtain an equivilent
pixel height of the widget from the number of rows.
This is usualy used to try to reset this height.
%FUNC: GetColumnsFromWidth
GetColumnsFromWidth is used to obtain the number of
appropriate columns for the widget derived from the
pixel width.
%FUNC: GetRowsFromHeight
GetRowsFromHeight is used to obtain the number of
appropriate rows for the widget derived from the
pixel height.
%FUNC: Redisplay
Redisplay is used to redisplay the XmVtWidget after
being covered.
%FUNC: DrawShadow
DrawShadow redraws the shadow for the current
XmVtWidget.
%FUNC: DrawHighlight
DrawHighlight redraws the highlight for the current
XmVtWidget because of a manual resize of the
widgets window.
%FUNC: SetValues
SevValues is called whenever the user application
needs to change any resources.
%FUNC: Destroy
Destroy is used to free up the screen data and
also perform any other clean up activity.
%FUNC: SpecialCharEvent
SpecialCharEvent is used to capture three special
key events that seem to never get to the tranlation
table.  These are Escape, Return and tab I try to
keep this routine as quick as possible to prevent
wasting time.  This routine is unavoidably called
every time a key is pressed.
%FUNC: StringInput
StringInput is similar to SpecialCharEvent except
it is meant to be called as an action and it handles
all the other keystrokes besides what
SpecialCharEvent handles.  Please note that String
input specificaly ignores those keystrokes that
SpecialCharEvent handles.
%FUNC: SelectArea
SelectArea determines the cursor position and then
finds the character at that position and then places
it in the selection buffer.
%FUNC: Resize
Resize is used to reallocate the screen geometry to
the new arrangement.  It will clear any new area and
retain old area.
%FUNC: QueryGeometry
QueryGeometry is used to respond to the X server when
it asks about various geometry arrangements.
%FUNC: make_lines
make_lines takes a string of characters and converts
them to the proper line drawing characters.
%FUNC: fast_scroll_paint
fast_scroll_paint is used to paint the screen after
a scroll.  This is faster because of the high
resolution copy of all the prevous character data.
%FUNC: s_data
This function sets the data section of the screen buffer.
%FUNC: s_attr
This function sets the attribute section of the screen
buffer.
%FUNC: s_cset
This function sets the character set section of the screen
buffer.
%FUNC: s_flag
This function sets the modify flag section of the screen
buffer.
%FUNC: g_data
This function gets the data section of the screen buffer.
%FUNC: g_attr
This function gets the attribute section of the screen
buffer.
%FUNC: g_cset
This function gets the character set section of the screen
buffer.
%FUNC: g_flag
This function gets the modify flag section of the screen
buffer.
%PARM: ctw Input
Current widget
%PARM: vtw Input
Current VT widget
%PARM: top Input
Top offset
%PARM: bot Input
Bottom offset
%PARM: lf Input
Left offset
%PARM: rt Input
Right offset
%PARM: scroll_value
Value to scroll
%PARM: xcoord Input
X coordinate
%PARM: ycoord Input
Y coordinate
%PARM: xc Input
X coordinate
%PARM: yc Input
Y coordinate
%PARM: xcoo Input
X coordinate
%PARM: ycoo Input
Y coordinate
%PARM: attr Input
Type of characters
%PARM: cset Input
Character set number
%PARM: flag Input
Modified flag
%PARM: treq Input
Requested Widget
%PARM: tnew Input
New Widget
%PARM: args Input
Set of X arguments
%PARM: num_args Input
Number of X arguments
%PARM: new Input
New Widget
%PARM: cw Input
Current Widget
%PARM: w Input
Passed Widget
%PARM: event Input
X event for situation
%PARM: current
Current Widget
%PARM: request
Requested Widget
%PARM: cdat Input
Client data passed
%PARM: cont Input
Continue flag
%PARM: proposed Input
Proposed geometry
%PARM: answer Output
Response geometry
%PARM: xcoo Input
X coordinate
%PARM: ycoo Input
Y coordinate
%PARM: new_w Input
New Widget to Eval
%PARM: receiver Input
Receiving Widget
%PARM: single Input
Single chr to print
%PARM: cset Input
Character set
%PARM: where Input
From Where was paint called
%PARM: incmd Input
Input to command
%PARM: outcmd Input
Output from command
%PARM: firststr Input
First string to compare
%PARM: secondstr Input
Second string to compare
%PARM: len Input
Length of string to compare
%PARM: alen Input
Actual length of match
%PARM: row Input
Count of rows in 2D array
%PARM: strwidth Input
Actual string width of strings
%PARM: array_name Input
Array to free
%PARM: argc Input
Number of arguments passed
%PARM: argv Input
Arguments passed from UNIX
%PARM: maxx_value Input
Maximum X coord Value
%PARM: maxy_value Input
Maximum Y coord Value
%PARM: minx_value Input
Minimum X coord Value
%PARM: miny_value Input
Minimum Y coord Value
%PARM: number Input
Number of actions to take
%PARM: buffer Input
Buffer of output data
%PARM: count Input
Count of characters to write
%PARM: pos Input
Current position in buffer
%PARM: string Input
String to work on
%PARM: data Input
Data to append
%PARM: pldata Input
Plot data
%PARM: attribute Input
Type of characters
%PARM: xcoord Input
X coordinate
%PARM: ycoord Input
Y coordinate
%PARM: tw Input
VT Widget data
