This is a set of clipper functions for doing basic serial I/O.

They are called just like normal clipper functions, passing parameters and
checking the return value.  NUMBER stands for a normal clipper number and
CHARACTER stands for a normal clipper character string.

You use these functions by including them in your clipper program and then
including the COMSTUFF.LIB file in the list of libraries along with
CLIPPER and EXTEND and any other libraries that you use.  Make sure that
the CLIPPER.LIB is the first library in your library list.

If you intend to use this library, I would be grateful for a donation of
only $10.00.  You can mail it to:

Tony Pitman
15248 N. 35th Street
Phoenix, AZ  85032

If you send in your $10.00 I will send you my phone number so that you can
call me and I will help you use the product if you have trouble.  I will
also be able to continue to produce more helpful libraries like this one.

-------------------------------------------------------------------------

cs_opencom(port, baud, parity, data_len, stopbits)

port       NUMBER: 0 - COM1 / 1 - COM2 / 2 - COM3 / 3 - COM4
baud       NUMBER: 110 / 300 / 600 / 1200 / 2400 / 9600 / up to 115200
parity     NUMBER: 1 - Odd / 2 - None / 3 - Even / 4 - Mark / 5 - Space
data_len   NUMBER: 0 - Five / 1 - Six / 2 - Seven / 3 - Eight
stopbits   NUMBER: 0 - One / 1 - Two

Prepares the com port for use with the parameters given.

returns    NOTHING

-------------------------------------------------------------------------

cs_closcom()

port       NUMBER: 0 - COM1 / 1 - COM2 / 2 - COM3 / 3 - COM4

Closes the com port and removes the interupt handler from memory.

returns    NOTHING

-------------------------------------------------------------------------

cs_readb()

port       NUMBER: 0 - COM1 / 1 - COM2 / 2 - COM3 / 3 - COM4

Reads one byte from the com port buffer.

returns    NUMBER: The ASCII code for the character received.

-------------------------------------------------------------------------

cs_reads()  /* no wait string read */

port       NUMBER: 0 - COM1 / 1 - COM2 / 2 - COM3 / 3 - COM4
buffer     CHARACTER: Buffer to hold com port input.
delims     CHARACTER: Characters to stop getting input at.
maxchrs    NUMBER: Max number of characters to receive.

This routine will return characters from the com port until it hits
one of the specified delimiters up to maxchrs. If no delimiter is
found (maybe because it hasn't been transmitted yet) you will get
whatever is currently in the buffer (upto maxchars). If the com port
is empty you will get back an empty buffer.  Consider this a nowait
string read (also called a greedy read).  You must allocate at least
maxchrs + 1 characters for your target buffer.  The number of
characters read are returned in the int pointed to by maxchrs.

You must pass buffer and maxchrs with the @ designation.
 
returns    0 = delimiter found
           1 = maxchrs reached
           2 = read until buffer empty without finding a delimiter.

-------------------------------------------------------------------------

cs_writeb() /* write byte to port */

port       NUMBER: 0 - COM1 / 1 - COM2 / 2 - COM3 / 3 - COM4
char       NUMBER: ASCII code of character to output.

Outputs one character to the com port.

returns    NOTHING

-------------------------------------------------------------------------

cs_writes() /* write string to port */

port       NUMBER: 0 - COM1 / 1 - COM2 / 2 - COM3 / 3 - COM4
string     CHARACTER: String to output.

Outputs one string to the com port.

returns    NUMBER: The number of characters output.

-------------------------------------------------------------------------

cs_writesc() /* write string to port for # of chars */

port       NUMBER: 0 - COM1 / 1 - COM2 / 2 - COM3 / 3 - COM4
string     CHARACTER: String to output.
count      NUMBER: Number of characters to output.

Output only a certain number of characters in a string.

returns    NUMBER: The number of characters actual output.

-------------------------------------------------------------------------

