Dec 192017
 
C Spot Run (CSR)-- User support C add-on library.
File CSR.ZIP from The Programmer’s Corner in
Category C Source Code
C Spot Run (CSR)– User support C add-on library.
File Name File Size Zip Size Zip Type
CSPOTRUN.DOC 269175 54174 deflated

Download File CSR.ZIP Here

Contents of the CSPOTRUN.DOC file




















C Spot Run

A User-Supported C Add-On Library

Version 3.0

July 12, 1988


Bob Pritchett
New Dimension Software

23 Pawtucket Dr.
Cherry Hill, NJ 08003


Copyright 1986, 1987, 1988 Bob Pritchett
All Rights Reserved















To Mom and Dad

Your time, effort, encouragement and advice
have been far above and beyond what any
son could dream of asking.

and to

The Memory of
Thelma M. Pritchett

Your greatest works are the lives
of everyone who knew you.














Trademarks

Microsoft C and QuickC are trademarks of Microsoft Corporation.
IBM-PC is a trademark of International Business Machines.
C Spot Run is a trademark of New Dimension Software.
Turbo C is a trademark of Borland International.


Disclaimer

This library and all of its contents are provided "AS IS."
No warranty is expressed or implied. Use of this library is at
the user's own risk, and the authors are not liable for any
damages or loss of profits resulting from the use of the library
or its documentation.
C Spot Run - Documentation



Table of Contents

Dedication............................................... 2
Trademarks............................................... 2
Disclaimer............................................... 2

1. Introduction............................................. 5
1.1. What is C Spot Run?................................. 5
1.2. Why C Spot Run?..................................... 5

2. Obtaining and Copying C Spot Run......................... 6
2.1. User Supported Software............................. 6
2.2. Ownership of C Spot Run............................. 6
2.3. Contents of C Spot Run.............................. 6
2.4. License for C Spot Run.............................. 6
2.5. Using C Spot Run in a Commercial Application........ 7

3. Using the C Spot Run Library............................. 8
3.1. Using the Library with Microsoft C v5.x / QuickC.... 8
3.2. Using the Library with Turbo C v1.5................. 8
3.3. Using the Utilities and Aids........................ 9
3.4. Using the Source Code............................... 9

4. Format of Routine/Utility Descriptions................... 10

4.1. How to Use Routine Description Pages................ 10
4.2. How to Use Utility Decription Pages................. 10

5. The Library Routine Descriptions.........................
5.1. General Descriptions of Related Routines............
5.1.1. Date Manipulation Routines...................
5.1.2. Directory Management Routines................
5.1.3. Graphics Routines............................
5.1.4. Input Routines...............................
5.1.5. Printer Operation Routines...................
5.1.6. Real Time Timers.............................
5.1.7. Sound Routines...............................
5.1.8. Window Function Library......................
5.2. Individual Routine Descriptions.....................

6. Utility and Aid Descriptions.............................

7. Header File Descriptions.................................

8. Appendix A - Updating the Library........................

9. Appendix B - Contacting Authors..........................

10. Appendix C - Submitting Routines or Utilities............

11. Appendix D - Library History and Changes.................

12. Appendix E - ASCII Table.................................

13. Appendix F - Window Border Characters....................


Page 3
C Spot Run - Documentation



14. Quick Reference Chart....................................

15. Commonly Asked Questions and Answers.....................

16. Routine/Utility Submission Form..........................

17. User Response Form.......................................

18. Order Form...............................................
















































Page 4
C Spot Run - Documentation


1. Introduction

1.1. What is C Spot Run?

C Spot Run is a library of C and Assembly routines for C
programmers. These routines supplement the standard libraries
provided with compilers, and provide tools for specialized
applications.
All routines in this library are either in the public domain
or are part of the user supported software world, as are the
accompanying utilities and programming aids.
Our goal is to provide low cost (free!) routines and
utilities for C programmers. The use of pre-written routines
greatly reduces the amount of tedious code writing in almost any
situation, and we hope that our collection will prove to do so.

1.2. Why C Spot Run?

What is probably the next question to cross your mind is
simply, why? Good question, and I hope this is a good answer.
Because. Because there are so many libraries similar to this
one. Because they all cost money, and this one doesn't. Because
as of yet there is no central distribution point for many of the
C routines floating around in .C files everywhere. We feel that
C Spot Run is filling a need, and we hope you agree with us.
We would appreciate your taking some time to let us know
what you think of the library and what directions you would like
to see it take.





























Page 5
C Spot Run - Documentation


2. Obtaining and Copying C Spot Run

2.1. User Supported Software

User supported software is software distributed at no cost
other then a small media charge with the expectation that those
who find it useful will send a donation to support the
development. In most cases those who contribute become
registered users and receive automatic updates, printed manuals,
telephone support, and/or source code.

2.2. Ownership of C Spot Run

Without a major essay on copyright laws, the routines and
utilities in this package are the property of New Dimension
Software. The few routines that were extracted from the public
domain have been modified and those contributed by other authors
have been released to NDS for inclusion in this copyrighted
package.
New Dimension Software, and thus this library and all
accompanying materials, is the property of Bob Pritchett. This
package is released for distribution under the limited license in
section 2.4.

2.3. Contents of C Spot Run

The very basic principle behind this library is user-
supported software. In addition to monetary contributions, an
even more valuable form is that of routines or utilities. Most
of the routines and utilities in this library were written by two
or three people, or are modifications of other routines in the
public domain.
We would like to build a sizable library of tools and helps
for C programmers, and whether it is a new routine you wrote, or
one that is already in the public domain world, your contribution
of code and permission to let us use it would be appreciated.
For practical purposes, however, we can only use contributions
that are public domain or are released to New Dimension Software
for inclusion in CSR under its copyright. (Credit for authorship
will be made in the documentation and source code.)

2.4. Distribution License for C Spot Run

The C Spot Run library of routines and utilities may be
freely duplicated and distributed under the following terms:


o No fee may be charged other than reasonable expenses for
media and reproduction, no more then eight dollars.

o The library MAY NOT be distrbuted by any for-profit
corporation, including, but not limited to, for-profit public
domain software companies, without the express written permission
of Bob Pritchett.



Page 6
C Spot Run - Documentation


o The routines, utilities, and documentation are not to be
distributed in a modified form.

o Credit must be given to New Dimension Software when CSR
routines are used in any distributed application, in both the
code and program documentation.

2.5. Using C Spot Run in a Commercial Application

You are free to use parts of C Spot Run in a commercial
application, on the following conditions: You must purchase a
copy of the source code to C Spot Run at the commercial license
fee ($75), becoming a registered user. You may not distribute
any part of C Spot Run in a humanly readable form. You must
include the following statement in your application source code
and documentation: "Portions of this program Copyright 1986,
1987 New Dimension Software." Additionally, New Dimension
Software must be notified of any commercial programs released
using the C Spot Run library.
These conditions are meant for my protection, curiosity, and
to assure that my work isn't used without credit. If you have a
difficulty with any of them, please contact me and we can try to
work something out. (Along the lines of my curiosity, I would
like to see how the library is put to use, and if you want to
send me a copy of the programs you write with it, I won't mind.)
































Page 7
C Spot Run - Documentation


3. Using the C Spot Run Library

3.1. Using the Library with Microsoft C v5.x / QuickC

C Spot Run works with all versions of Microsoft C and QuickC
from versions 5.0 and 1.0 up, respectively. Included in the
distribution package are both small and medium model versions of
the compiled library, in the files CSRQCS.LIB and CSRQCM.LIB.
To use CSR with a command line version of a Microsoft
compiler (CL or QCL) simply add the library name to the end of
the compile line. The following two examples compile TEST.C with
MSC 5.x in the medium memory model and with QuickC 1.x in the
small:

cl -AM test.c csrqcm.lib
qcl test.c csrqcs.lib

In order to compile an application with CSR from within the
QuickC integrated environment it is neccessary to create a make
file. This can be done from within QuickC by selecting the Set
Program List command from the File menu and adding both the
source file and library names to the .MAK file QuickC creates.
You can then compile the application using its make file from
both within and without the integrated environment. (The command
MAKE test.mak would compile the application from the DOS command
line.) When using the integrated environment please be sure to
set the compiler option to .EXE, NOT memory output. (This means
you will need to use the DOS Shell option to test your compiled
program, not the QuickC Run command.) For more information see
Chapter 6 of the Microsoft QuickC Programmer's Guide.

Both a batch and make file for the CSRDEMO program are
included with C Spot Run.

3.2. Using the Library with Turbo C v1.5

C Spot Run is provided for use with Turbo C v1.5 in the
small memory model. The library is contained in TCSCSR.LIB and
works with both the command line and integrated version of Turbo
C.
To use CSR with the command line version simply add it to
the TCC compile line, as demonstrated below:

tcc test.c tcscsr.lib

In order to use it from within the integrated environment
you must create a Project Make file containing both the
application source file names and the complete library file name.
The application can then be built from the Compile menu. For
more information consult your Turbo C User's Guide.

Both a batch and Project Make file for the CSRDEMO program
are included with C Spot Run.




Page 8
C Spot Run - Documentation


3.3. Using the Utilities and Aids

The use of utilities and programming aids should be clearly
described on their description pages. All include files should
be included at the beginning of sources that need them, and in
addition to the description page most independant utilities will
provide a short summary of their use when run with no command
line parameters.

3.4. Using the Source Code

Users who purchase the source code will additionally receive
make files to recompile the Microsoft and Borland libraries.
These make files provide for easy library maintenance when
changes are made to the source and allow for easy recompilation
for any memory model. The source code itself detects at compile
time the current compiler and memory model and uses the
preprocessor to make any neccessary changes.







































Page 9
C Spot Run - Documentation


4. Format of Routine/Utility Descriptions

4.1. How to Use the Routine Description Pages

The routine description pages are set up in such a manner
that updates to the library will not require a totally new
manual.
Each routine has its own full page regardless of how small
or large it is. The page is set up in a special order, with the
name of the routine on the upper right of the page at the top for

quick indexing, followed by a short summary of the necessary
arguments and their data types. Next is a line containing the
creation and last update dates, and then the author's name and
the name of the source code file. Following these is a list of
the files in which the code is contained, a list of other
required functions that may not be in every library, and then a
paragraph description of the function. This is followed with a
paragraph explaining the return value, a list of related
functions in the library, and a final example of how it might be
used in a portion of code.
It is recommended that you keep the complete manual in a
three ring binder, and as you receive updates simply print out
the enclosed page, and insert it in alphabetical order among the
function description pages. (This manual may seem like a waste
of paper, but this way it saves a lot in the long run.)

4.2. How to Use the Utility Description Pages

The utility description pages are similar to the routine
descriptions described above except for the layout of
information. On the utility description pages the first item is,
as with the routine descriptions, the utility name on the upper
right hand corner. Next is a summary of the utility including
the creation and last update dates, the author's name, the source
language, and then a copy of the documentation, usually an exact
duplicate of whatever documentation the author has sent.
As mentioned, the method for updating these description
pages is the same as above in section 4.1.



















Page 10



Date Manipulation Routines

This library comes with a variety of routines that can be
used to perform operations on and manipulate dates.
When calling functions that require date elements the order
of month, day, and year is used. The only exceptions to this
ordering are the get_date() and set_date() functions, which work
with the system's internal date. These routines require the
arguments to be in the order of day, month, and year.
All of the date manipulation routines are capable of
accepting years in both the two and four digit formats. (IE.
1987 is evaluated in the same manner as is 87.)
The number of days between two given dates can be calculated
directly with the dt_diff() routine, or through subtraction using
the serial numbers of each date, as calculated with date_sn().
At present the date routines do not take into account
different calendar systems, and, with the exception of the year
limited serial number routines, will assume all AD dates are in
our current system.



Directory Management Routines

With the two basic file search routines ffirst() and fnext()
any number of directories may be generated, and when combined
with the windowing routines any application can have a convenient
system for directory viewing and file selection.
The possibilities are endless, thus only a limited number of
directory viewing routines have been provided, but we trust that
they will help you design and implement whatever file management
you require. The following are some hints and suggestions:

Finding and storing all the file names before displaying
them has the benefit of allowing scrolling to take place forwards
and back, but the disadvantage of a slight delay while reading in
the information. If scrolling is needed, try saving the names as
they are read and displayed, and keep pointers allowing you to
scroll back, but not forward until the new file names are read.

If it is neccessary to divide the file name and extension
two obvious alternatives are presented. Either write a routine
to go through the string containing the name, looking for the dot
separater, and split the string into two parts, or use the
sscanf() function to read the two fields into separate strings.

Whatever you do with the provided directory routines, we'd
appreciate a copy of your routine for curiosity's sake, and if
possible, inclusion in a future version of the library.



Graphics Routines

This version of the library contains just a few simple
graphics primitives that work with the Color Graphics Adapter.
The routines provided perform simple graphics functions with no
concern for the aspect ratio of the screen, relative coordinates,
etc. All of the functions work with the exact coordinates given
and mathamaticly calculated assuming an aspect ratio of one.
(The IBM PC has a ratio of 1.2.)
The purpose of these routines is to provide a very few basic
routines for some form of graphics output. If you have a
complete graphics system, or just one that's faster than that
provided here, we would appreciate it if you would consider
submitting a copy to the library.

Considering that both Microsoft and Borland provide very
complete graphics libraries the functions in CSR are virtually
useless, except for their value as small and relatively standard
functions. The only possible future for graphics as a part of
CSR is the addition of a compiler independent interface for the
graphic libraries and/or a set of sophisticated graphic display
tools. These tools would be valuable additions, but are beyond
the current plans for NDS development.



Input Routines


The input routines are named in the following format:

[w][f]inpt[r][m][e][d]();

[w] Window. If input is in a window, use the [w]
prefix. NOTE: If the window pointer given is not to a valid
window the result is undefined.

[f] Field. Field input is input in a maximum
length field. The color and fill character for the field is
specified by fcolor() and fchar().

Type. This mandatory part of the function
name is the type of input being accepted.

[r] Range. If there is a minimum and maximum
entry this element is used in the name.

[m] Mask. This element means that an input mask
will be specified.

[e] Editing. If the field supports full editing
features, this element is used.

[d] Default. If there is to be a default entry
this element is used.


All of these elements make for a large number of possible
routines. However, only a few of these options are implemented,
and users who have source code can use these functions as bases
for new ones. For a list of which functions have been
implemented with this version, please check the quick reference
chart at the end of the manual.



Printer Operation Routines

The printer output routines included in this verson, 1.0, of
the library are intended to provide only the basics for printer
control. The routines provide for single character output,
lputchar(), string output, lprint(), and formatted string output,
lprintf().

These routines all call DOS function number 5 which means
that with the DOS MODE command etc. the output can be redirected
or reformatted.

Many libraries include an extensive set of routines to set
different attributes, fonts, and styles on printers. However,
since these routines are usually dependant on one printer make,
and generaly do little more then output two or three characters
it was thought best to provide only the generic lputchar()
function. If you would like to provide a set of printer specific
or independant routines to perform these functions, please
contact us.



Real Time Timers

The timer functions are designed to implement up to ten
different elapsed time counters. The counters are numbered from
zero to nine, each of which may be individually started, stopped,
and read. The function init_tmr() must be called before any of
the timers are used, although it needs to be called only once.

These ten counters may prove especially useful in
communications, timed input, or other 'real time' applications
due to the fact that they work with the internal system clock and
are not bus clock rate dependant. (The timer() routine, not a
part of this collection, does report in clock ticks.)

All of the timer functions, with the exception of init_tmr()
and get_timer(), require a single integer argument with a value
between zero and nine. Any other value will normalized into that
range, which is the timer to use for that specific function call.
The functions that return a time do so in tenths of seconds.
(The maximum time any timer may track is approximately 1.8
hours.)

These routines were contributed by Dave Perras who wrote
them with a Datalight C compiler. The included source code
should be easily portable to most MS-DOS C compilers.



Sound Functions

The sound functions provided with C Spot Run can be used to
make sound 'while you wait' or in an interrupt driven background
mode.
The sound() function will play the note given for the time
specified and return when complete, or, in background mode, put
the note into the sound buffer and return immediately. (If the
buffer is full, sound() will wait until there is room.)
The play() function uses the sound() function and whatever
mode it is set to.

Background mode is set by calling the sound_init() function,
and terminated by calling sound_done(). It is VERY important
that sound_done() is called before any program terminates. The
sound_quiet() and sound_left() functions can be used for
manipulation of the background sound buffer.

The spkr_() functions directly control the
speaker. A frequency can be loaded with the spkr_freq()
function, started with the spkr_on() function, and stopped by the
spkr_off() function.

NOTE: As of this release background sound is NOT supported.
Considering the importance of releasing the package ASAP and the
difficulty of rewriting the interrupt handling for the new
compilers and memory models the feature was temporarily disabled.
The sound() function behaves as noted, however it does not return
until the note is completed. All background sound functions
simply return without doing anything.

If you are interested in the restoration of background sound to
the CSR library, please make a request, otherwise the task will
retain its low priority level.

NOTE: Turbo C v1.5 has a sound() function that behaves
differently than CSR's. You should use function provided with
the compiler if you use Turbo C; the CSR sound() function has
been disabled in the Turbo C version of the library.



Window Function Library

The C Spot Run window function library is a library of
routines that perform background/foreground windowing. What this
means is that any window that is overlapped by another window,
when addressed for output, will be moved to the front of the
'stack' and become the active window.

The window library also contains a large number of support
routines to make movement of and output to windows as easy as
possible. There are routines that make pop-up menus, center
text, draw boxes, and do much more. Full color support is
available, and for speed all of the cursor and output functions
are in assembly.

All windowing functions are in the file COUTPUT.C, and
source is not distributed.

For ease of calling, in general you will find that all
window functions are preceeded by a w in the function name,
(wopen(), wclose(), etc.) and in most cases the first argument is
the window pointer.

For more information, consult the detailed function
descriptions.

I would like to thank Philip A. Mongelluzo whose Windows for
C and Window BOSS packages were of invaluable use to me in the
development of this package, not to mention the time he spent
patiently answering my questions.



beep
Summary:

void beep();

Created: 07/02/87 Last Updated: 07/12/88

Author: Bob Pritchett Source File: CSRBEEP.C

Requires: sound()

Description:

This function outputs a 'less offensive' beep than the standard
Control-G beep. Additionally you can change the tone and length,
with the setbeep() function. (Note: All 'beeping' by other CSR
functions is now done with this function.)

See Also:

setbeep() sound()

Example:

/* ... */
else /* If not acceptable input... */
beep(); /* beep to indicate error. */
/* ... */



border
Summary:

void border(color);
int color; /* Color of Border */

Created: 12/28/85 Last Updated: 07/12/88

Author: Bob Pritchett Source File: BORDER.ASM

Requires: Nothing.

Description:

This function draws sets the screen border to the specified color
using function 11 of the BIOS video interrupt.

Works in text modes only.

See Also:

ccls()

Example:

border(4); /* Red Border */



box
Summary:

void box(x,y,x2,y2,type);
int x; /* Upper Left Row */
int y; /* Upper Left Col */
int x2; /* Lower Right Row */
int y2; /* Lower Right Col */
int type; /* Style of Border */

Created: 08/ /85 Last Updated: 07/12/88

Author: Bob Pritchett Source File: BOX.C

Requires: gotoxy() putch()

Description:

The box function draws a graphic box using the upper left and
lower right corner coordinates. The border style can be a
combination of the double and single line characters of the IBM
character set, or any other printable character used all the way
around. The border is chosen with type. If type is equal to
one, an all single line border is drawn. If it is two, a double
horizontal line and single vertical line is used, if it is three
it is an all double border, if it is four a single horizontal
line and double vertical line are used. In the case of a five,
three ASCII characters, + - |, are used. Any other value in type
will cause the border to consist entirely of this character.

See Also:

cbox()

Example:

box(10,10,20,30,'*'); /* A box with a border of *'s */



cbcapt
Summary:

int cbcapt(flag);
int *flag; /* Location of Integer Flag */

Created: 10/26/86 Last Updated: 07/12/88

Author: Source File: CBRKTRAP.ASM

Requires: Nothing.

Description:

This function allows the programmer to detect and handle a
Control-C or Control-Break entered by the user. The function
must be called with the location of a static integer which will
be set positive when a Control-C or Control-Break is hit. The
program may then choose to test and handle the flag, or ignore it
totally, effectually disabling the break features.

This function is based on routines in Advanced MS-DOS and The C
Toolbox, by Ray Duncan and William Hunt.

NOTE: cbcapt() and cbrest() have not been modified for multiple
memory model support and should not be used; the control-break
functions provided by Microsoft and Borland are preferred, as
they are more functional and more widely used.

See Also:

cbrest()

Example:

main()
{
static int flag = 0;
timer();
cbcapt(&flag);
while ( flag == 0 )
printf("Waiting for Ctrl-Break.\n");
printf("Control-Break detected after %ld clock ticks.\n"
,timer());
cbrest();
exit(0);
}



cbox
Summary:

void cbox(x,y,x2,y2,type);
int x; /* Upper Left Row */
int y; /* Upper Left Col */
int x2; /* Lower Right Row */
int y2; /* Lower Right Col */
int type; /* Style of Border */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source File: CBOX.C

Requires: putchci() gotoxy()

Description:

This function is functionaly the same as box() except that the
box is drawn in the current color. It is primarily used as an
internal routine in COUTPUT.C. For independant use, use color()
or wcolor() to set the color.

See Also:

color() wcolor() box()

Example:

#include "color.h" /* Just for the colors... */

color(RED_F,WHT_B); /* Red on White */

cbox(5,5,20,60,1); /* A box with a single line border */



cbrest
Summary:

int cbrest();

Created: 10/26/86 Last Updated: 07/12/88

Author: Source File: CBRKTRAP.ASM

Requires: Nothing.

Description:

This function disables the Control-C and Control-Break trapping
turned on by cbcapt(). While it is not always neccessary to call
this function before exiting a program, it is a good practice.

See Also:

cbcapt()

Example:

main()
{
static int flag = 0;
timer();
cbcapt(&flag);
while ( flag == 0 )
printf("Waiting for Ctrl-Break.\n");
printf("Control-Break detected after %ld clock ticks.\n"
,timer());
cbrest();
exit(0);
}



ccenter
Summary:

void ccenter(row,string,color);
int row; /* Row to Center String on */
char *string; /* String to Center on Screen */
int color; /* Color to Print String in */

Created: 12/28/85 Last Updated: 07/12/88

Author: Bob Pritchett Source File: CCENTER.C

Requires: gotoxy() ccputs()

Description:

This routine is functionaly the same as center() only that the
line is displayed in the color specified.

Return Value:

Nothing is returned and there are no validity checks. Giving a
string longer then 80 characters, or a line number less then zero
or greater then 24 will produce an unknown result on screen,
while it should return cleanly.

See Also:

center() putat() cputat()

Example:

#include "color.h"

char *string;
scanf("%s",string);

ccenter(0,"This line is centered in color.",RED_F);
ccenter(2,"This one is in magenta on black, as opposed to red."
,MAG_F);
ccenter(3,"And yet another line, this time in green.",GRN_F);

ccenter(5,string,WHT_F+BLU_B);



ccls
Summary:

#include "color.h" /* For color definitions only... */

int ccls(color);
int color; /* Color of Screen */

Created: 12/28/85 Last Updated: 07/12/88

Author: Bob Pritchett Source File: CCLS.ASM

Requires: Nothing.

Description:

This function clears the screen and sets all the attributes to
the given color. The cursor is sent to the home position.

Return Value:

Nothing.

See Also:

cls()

Example:

#include "color.h"

ccls(RED_F+BLU_B); /* Attributes are red on blue. */



ccputs
Summary:

#include "color.h" /* Color definitions only */

void ccputs(string,color);
int string; /* String to Put */
int color; /* Color of String */

Created: 12/29/85 Last Updated: 07/12/88

Author: Bob Pritchett Source File: CCPUTS.C

Requires: putchci()

Description:

This function puts the given string out to the current cursor
position in the specified color, using putchci() to do BIOS
output. Any control characters in the string are sent through
the compiler supplied putch() function. Note that putch() does
not map newline ('\n') to carriage-return-line-feed, as does
printf(), but simply to line-feed.

See Also:

putchci()

Example:

#include "color.h"

ccputs("This string in red.\n\r",RED_F);
ccputs("Appear just below, this string is green.\n\r",GRN_F);



center
Summary:

void center(row,string);
int row; /* Row to Center String on */
char *string; /* String to Center on Screen */

Created: 09/ /85 Last Updated: 07/12/88

Author: Bob Pritchett Source File: CENTER.C


Requires: gotoxy() prints()

Description:

This routine will simply center string on line row. An eighty
column display is assumed, and the cursor is left at the end of
the string.

Return Value:

Nothing is returned and there are no validity checks. Giving a
string longer then 80 characters, or a line number less then zero
or greater then 24 will produce an unknown result on screen,
while it should return cleanly.

See Also:

centerf() ccenter() putat() cputat()

Example:

#include

char *string;
scanf("%s",string);

center(0,"This line is centered. Centering has a slight");
center(1,"disadvantage with constant text in that the computation is");
center(2,"done at run-time, as opposed to using putat() with a");
center(3,"precalculated center.");

center(5,string);



centerf
Summary:

void centerf(row,string[,arguments...]);
int row; /* Row to Center String on */
char *string; /* String to Center on Screen */

Created: 04/13/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CENTERF.C

Requires: gotoxy() prints()

Description:

This routine performs the exact same function as center() with
the exception that the string may contain formatting controls
which are proccessed according to the same rules as printf()
before the string is centered. Up to 15 formatting arguments may
be used per string.

Return Value:

Nothing returned, nor are coordinates checked, but be careful to
make sure the formatted string will be less then 80 characters
long.

See Also:

center() ccenter() putat() cputat()


Example:

#include

char *string;
printf("What is your name? ");
scanf("%s",string);

centerf(4,"The answer is: %04d",243);
centerf(7,"Hello, %s, nice to meet you.",string);



cfield
Summary:

int cfield(chr,clr,tms);
int chr; /* Character to Use in Field */
int clr; /* Attribute to Use for Field */
int tms; /* Length of the Field */

Created: 09/25/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CFIELD.ASM

Requires: Nothing.

Description:

This routine is a special assembly routine to create fields for
the field input routines. Given the fill character, attribute,
and length of the field it will create the field without moving
the cursor. No checking of parameters is done.

Return Value:

Nothing is returned.

See Also:

finptstr()

Example:

#include "color.h"

cfield('*',WHT_F+BLU_B,10); /* Ten character white on */
/* blue asterisk field. */



chk_date
Summary:

int chk_date(m,d,y);
int m; /* Month of Date to Check */
int d; /* Day of Date to Check */
int y; /* Year of Date to Check */

Created: 12/27/85 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRDATE.C

Requires: num_days()

Description:

This routine verifies that the day and month of the given date
are legitimate values. The year is needed in order to check for
leapyears.

Return Value:

The function evaluates true if the date is valid, false if it is
not.

See Also:

valid_date() num_days() dt_diff()

Example:

if ( chk_date(6,15,1500) ) /* Evaluates True */
function();



chline
Summary:

void chline(x,y,y2,type);
int x; /* Upper Left Row */
int y; /* Upper Left Col */
int y2; /* Lower Right Col */
int type; /* Style of Border */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CHLINE.C

Requires: putchci() gotoxy()

Description:

This function will draw a line at x,y to x,y2 using the
character(s) specified in type. Type may be any one of the five
types accepted by box(). Usually this function is used to draw
lines inside boxes, as it will use the proper side characters,
but by using an ASCII character in type an ordinary line of that
character is drawn. The line is drawn in the current color, as
specified by color().

Return Value:

Returns a zero if successful, a negative one if invalid
coordinates are passed.

See Also:

cvline() whline()

Example:

#include "color.h" /* Just for the colors... */

color(RED_F,WHT_B); /* Red on White */

cbox(5,5,20,60,1); /* A box with a single line border */

chline(5,7,60,1); /* Draws a line across the box */



clreol
Summary:

void clreol();

Created: 07/10/87 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CLREOL.C

Requires: gotoxy() putchci() cursor_read()

Description:

This function reads the current cursor position and clears, in
the color set by the color() function, the line from the cursor
to column 80. The cursor is returned to the location it was at
before the function was called.

See Also:

cls() gotoxy() cursor_read() color()

Example:

gotoxy(7,10);
clreol();



cls
Summary:

int cls();

Created: 12/28/85 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CLS.ASM

Requires: Nothing.

Description:

This function clears the screen and sends the cursor to the home
position using the video BIOS interrupt.

Return Value:

Nothing.

See Also:

ccls() wcls()

Example:

cls();



color
Summary:

#include "color.h" /* For Color Definitions Only */

int color(attr)
int attr; /* Color Attributes */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRCOLOR.C

Requires: Nothing.

Description:

This routine sets the colors to be used in all following
operations involving color in the windows package, unless
otherwise specified. In version 1.0 color() required two
arguments, the fore and background attributes. To maintain
compatibility with other color() routines, there is now only
one argument, with the attributes added together.

If color()'s argument is -1, it returns the current value for
color operations. This is useful if you wish to write windowing
functions that restore the current color attributes after opening
their own windows.

Return Value:

The color is returned.

See Also:

wcolor() mcolor()

Example:

#include "color.h"

color(RED_F+BOLD+BLU_B); /* Bold Red on Blue. */



current_page
Summary:

int current_page();

Created: 02/22/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CURSOR.C

Requires: int86()

Description:

This function returns the current active video page.

Return Value:

Number of current video page is returned, 0-3 or 0-7, depending
on monitor.

See Also:

set_page()

Example:

#include

printf("The current video display page is: %d\n",current_page());



cursor_off
Summary:

void cursor_off();

Created: 02/22/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CURSOR.C

Requires: Nothing.

Description:

This function will turn the cursor off using the technique used
by graphics modes in order to make it 'invisible.'

See Also:

cursor_on()

Example:

cursor_off();



cursor_on
Summary:

void cursor_on();

Created: 02/22/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CURSOR.C

Requires: Nothing.

Description:

Doing the opposite of the cursor_off() function this function
restores the cursor and returns the shape (scan lines) to their
default state.

See Also:

cursor_off()

Example:

cursor_off();

cursor_on();



cursor_read
Summary:

void cursor_read(row,col)
int *row; /* Location to Store Row */
int *col; /* Location to Store Col */

Created: 02/22/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CURSOR.C

Requires: Nothing.

Description:

This funciton places the current cursor positions into row and
col, using the video BIOS interrupt.

See Also:

gotoxy()

Example:

int x;
int y;
cursor_read(&x,&y);
gotoxy(x+2,y-3); /* Move diagonally down and left. */



cursor_size
Summary:

void cursor_size(start,end);
int start; /* Starting Scan Line */
int end; /* Ending Scan Line */

Created: 02/22/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CURSOR.C

Requires: Nothing.

Description:

This funciton sets the cursor scan lines to start and finish.
Specifying a larger start then finish line causes it to wrap
around and form a two part cursor.

Note that in monochrome mode there are 14 scan lines (0-13), and
in color 8 (0-7).

See Also:

cursor_on() cursor_off()

Example:

if ( get_mode() == 7 ) /* If Monochrome Display */
cursor_size(12,13); /* Two Line Underline */
else /* Else in Color Mode */
cursor_size(6,7); /* Two Line Underline */



cvline
Summary:

void cvline(y,x,x2,type);
int y; /* Upper Left Col */
int x; /* Upper Left Row */
int x2; /* Lower Right Row */
int type; /* Style of Border */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CVLINE.C

Requires: putchci() gotoxy()

Description:

This function will draw a line at x,y to x2,y using the
character(s) specified in type. Type may be any one of the five
types accepted by box(). Usually this function is used to draw
lines inside boxes, as it will use the proper top and bottom
characters, but by using an ASCII character in type an ordinary
line of that character is drawn. The line is drawn in the
current color, as specified by color().

Return Value:

Returns a zero if successful, a negative one if invalid
coordinates are passed.

See Also:

chline() wvline()

Example:

#include "color.h" /* Just for the colors... */

color(RED_F,WHT_B); /* Red on White */

cbox(5,5,20,60,1); /* A box with a single line border */

cvline(7,5,20,1); /* Draws a line down the box */



date_sn
Summary:

unsigned int date_sn(m,d,y);
int m; /* Month */
int d; /* Day */
int y; /* Year */

Created: 09/01/86 Last Updated: 07/12/88

Author: George Roukas Source in: CSRDATE.C

Requires: valid_date() day_of_year() isleap()

Description:

This function turns the given date into a single integer serial
number which it returns. This serial number is used by various
other date routines and can also be used for date arithmetic.

The serial number may not exceed 54788, the number of days
between January 1, 1900, and December 31, 2049.

Note that the year may be in either four or two digit form.

Return Value:

Returns an unsigned integer serial number.

See Also:

dt_diff() valid_date() sn_date()

Example:

int m, d, y;

printf("\nEnter your birthdate: (MM/DD/YY) ");
scanf("%d/%d/%d",m,d,y);
printf("\nYou special serial number is %d.\n",date_sn(m,d,y));



day_of_year
Summary:

int date_sn(m,d,y);
int m; /* Month */
int d; /* Day */
int y; /* Year */

Created: 09/01/86 Last Updated: 07/12/88

Author: George Roukas Source in: CSRDATE.C

Requires: isleap()

Description:

This function is similar to the day_of_year() function in K&R, pp
103-104, and returns the number of elapsed days in the given
year.

Return Value:

Elapsed days since the beginning of the year. 1/1 = 1, 1/2 = 2,
etc.

See Also:

month_day()

Example:

int m, d, y;

printf("\nEnter your birthdate: (MM/DD/YY) ");
scanf("%d/%d/%d",m,d,y);
printf("\nYou were born on the %d day of the year.\n"
,day_of_year(m,d,y));



dirwin
Summary:

void dirwin(path,name);
char *path; /* Path, With Drive */
char *name; /* Template for File Name */

Created: 04/20/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: DIRWIN.C

Requires: ffirst() fnext()

Description:

This routine opens a window in the current colors in which the
specified directory is displayed in four columns of nine file
names. When a directory exceeds thirty-six file names a key
press clears the window and displays the next thirty-six, and so
on until the last screen is displayed, after which the window is
closed.

The pathname should include the drive letter and subdirectory
path. If the root is being used at least the \ should be in
path. The title used is "[ Dir: %s\\%s ]",path,name. An
appropriate path and template might be: "A:\\","*.*".

The file names are displayed once in the order they are found on
the disk. (The same order with the DIR command at the DOS
prompt.) The filenames are left justified in their columns with
a dot separater between the name and extension.

See Also:

ffirst() fnext()

Example:

dirwin("C:\\C","*.C");



dma
Summary:

void dma(x);
int x; /* Value of DMA Flag */

Created: 05/24/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This routine sets the direct memory access flag on or off. The
flag defaults to 1, on.

See Also:

retrace()

Example:

dma(0); /* Turn off Direct Memory Access */



dt_diff
Summary:

int dt_diff(m,d,y,mn,dy,yr);
int m; /* Month of First Date */
int d; /* Day of First Date */
int y; /* Year of First Date */
int mn; /* Month of Second Date */
int dy; /* Day of Second Date */
int yr; /* Year of Second Date */

Created: 12/27/85 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRDATE.C

Requires: Nothing.

Description:

This function will return the number of days difference between
the two dates passed as parameters.

Return Value:

Returns the number of days difference.

See Also:

date_sn() sn_date() chk_date() num_days()

Example:

int m;
int d;
int y;

printf("I am %d days old as of August 17th, 1986.\n"
,dt_diff(6,15,1971,8,17,1986));
/* The above returns 5541. */

get_date(&d,&m,&y);

printf("Ronald Reagan was born %d days ago.\n"
,dt_diff(2,6,1911,m,d,y));
printf("C Spot Run Version 1.0 was released %d days ago.\n"
,dt_diff(5,5,1986,m,d,y));



fbreakon
Summary:

#include "skey.h" /* Needed Only for Key Descriptions */

void fbreakon(x);
int x; /* Special Key to Break On */


Created: 06/29/87 Last Updated: 07/12/88

Author: Bob Pritchett Source in: FINPUT.C

Requires: Nothing.

Description:

This function allows the programmer to set which special keys
will cause the finptstred() to exit. Each call to this function
adds the argument given to the list of break keys. (The #include
file SKEY.H contains easy definitions for the special keys.)
When given zero as an argument the list is cleared.

The default break keys are HOME, END, PGUP, PGDN, UARROW, DARROW,
ALTE, ALTX, and ALTQ.

See Also:

wfbreakon() finptstred()

Example:

#include "skey.h"

char temp[30];

fbreakon(0); /* Clear List */
fbreakon(ALTH); /* Alt-H Only */

if ( finptstred(10,10,25,temp,"Default") == ALTH )
help();



fchar
Summary:

int fchar(chr);
int chr; /* Character to Use in Fields */

Created: 09/25/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: FINPUT.C

Requires: Nothing.

Description:

This function sets the character to be used for the background of
field input. The default is an ASCII space, and when chr is
given as -1, at any time, the function will return the current
value of the background character. Otherwise the value of chr
will be returned.

Return Value:

Returns the argument, or in the case of the argument being -1,
the current value of the background character.

See Also:

wfchar() fcolor() ffill() finptint() finptstr()

Example:

fchar('*'); /* Set background to *'s. */

printf("The current background character is: %c.\n",fchar(-1));



fcolor
Summary:

#include "color.h" /* For Color Defintions Only */

int fcolor(clr);
int clr; /* Color to Use in Fields */

Created: 09/25/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: FINPUT.C

Requires: Nothing.

Description:

This function allows specification of the color to be used in
field input routines. If the argument clr is equal to -1 the
current color is returned, and not changed. The default is white
on black.

Return Value:

Returns the argument, or in the case of the argument being -1,
the current value of the field color.

See Also:

wfcolor() fchar() ffill() finptint() finptstr()

Example:

#include "color.h"

fcolor(BLK_F+WHT_B); /* Reverse video attribute. */



ffill
Summary:

void ffill(rw,cl,mx);
int rw; /* Row of Field */
int cl; /* Column of Field */
int mx; /* Length of Field */

Created: 12/05/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: FINPUT.C

Requires: gotoxy() cfield()

Description:

The actual input fields used by the input routines are created
when the input is performed, and remain on the screen to allow
the program to bring the user back to change the field's
contents. This arrangement means, though, that a full screen of
field input will not display all the actual fields until all the
input has been performed. This function takes the three
arguments common to any field input function call in order to
'draw' the fields before input is performed. The current field
color and character attributes are used.

See Also:

wffill() fchar() fcolor() finptint() finptstr()

Example:

ffill(10,20,10); /* At 10,20 a 10 character field. */

putat(5,10,"Num: "); /* A prompt for the next field. */
ffill(5,15,6); /* At 5,15 a 6 character field. */
gotoxy(5,15); /* Not needed, as ffill() leaves */
/* the cursor at the coordinates. */
ccputs("192",fcolor(-1)); /* Put a default value on the */
/* screen with the field color. */



ffirst
Summary:

#include "csrdos.h" /* Contains struct DIRS, for buf */

int ffirst(dir,buf,template,attr);
char *dir; /* Subdir to Use */
char *buf; /* Location to Store Data */
char *template; /* FileName/Template to Search for */
int attr; /* Attribute to Include in Search */

Created: 04/04/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: DIRSRCH.C

Requires: intdos()

Description:

Using DOS 2.0 function 0x4e (2.00 and above only) this function
begins the search for a file in the specified directory using
either a file name or template with wildcard characters ( ? * )
as the file to search for. The path must be a standard DOS path
name (without file name), using two backslashes instead of one.
If the path to search is the root, use the path string of "".

The attribute specified in attr is the attribute to use in the
search. If none is specified, then only files are reported. If
the volume attribute is used, the volume label is returned. If
the sub-directory attribute is specified, all files AND sub-
directories are returned. The same applies to the hidden and
and system attributes, but the archive and read-only attributes
can not be used in searches.

After a file is found it's data is placed in buf (consult
CSRDOS.H for the DIRS structure). The entry type may be
determined by & ing the returned attribute and the attribute you
wish to test for, as in if ( buf.attr & SUBDIR ) would be true
if the entry was a subdirectory.

Return Value:

Returns the value of the AX register, 2 for file not found, and
18 for no more files to be found.

See Also:

fnext()



ffirst




Example:

#include "csrdos.h"

struct DIRS buf;

ffirst("",&buf,"*.SYS",0); /* Find first .SYS file in root. */




fnext
Summary:

#include "csrdos.h" /* Contains struct DIRS, for buf */

int fnext(dir,buf,template,attr);
char *dir; /* Subdir to Use */
char *buf; /* Location to Store Data */
char *template; /* FileName/Template to Search for */
int attr; /* Attribute to Include in Search */

Created: 04/04/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: DIRSRCH.C

Requires: intdos()

Description:

Using DOS 2.0 function 0x4f (2.00 and above only) this function
continues the search begun with ffirst(). This function is
dependant upon information left in the first 21 bytes of the
buffer used in ffirst, so use the same buffer, or begin a new
sequence with ffirst().

Return Value:

Returns the value of the AX register, 18 for no more files to be
found, or nothing.

See Also:

ffirst().

Example:

#include "csrdos.h"

int x;
struct DIRS buf;

ffirst("",&buf,"*.SYS",0); /* Find first .SYS file in root. */

while ( x != 18 )
{
printf("%s %ld\n",buf.name,buf.size); /* Print name & size. */
x = fnext("",&buf,"*.SYS",0); /* Find next entry. */
}



finptint
Summary:

int finptint(rw,cl,mx,x);
int rw; /* Row of Field */
int cl; /* Column of Field */
int mx; /* Length of Field */
int *x; /* Where to Put Result */

Created: 09/25/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: FINPUT.C

Requires: gotoxy() cfield()

Description:


This function will draw the field as specified by the first three
arguments, and place the cursor at the first character of this
field. (See ffill() about drawing the field.) It will then wait
for the user to input an integer number with no more than mx
characters. The funtion will not allow the user to move on
without entering an integer.

Return Value:

The integer inputted is returned.

See Also:

inptint() finptintd() wfinptint() ffill() finptstr()

Example:

int x;

putat(5,10,"Num: "); /* A prompt for the next field. */
finptint(5,15,6,&x); /* At 5,15 a 6 character input. */

printf("\n\n%d was the input.\n",x);



finptintd
Summary:

int finptintd(rw,cl,mx,x,d);
int rw; /* Row of Field */
int cl; /* Column of Field */
int mx; /* Length of Field */
int *x; /* Where to Put Result */
int d; /* Default Integer */

Created: 09/25/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: FINPUT.C

Requires: gotoxy() cfield()

Description:

This function will behave just as does finptint() with the
exception that a carriage return as the first inputted character
will cause the default variable to be returned. Any other
character as the first input will cause the default to be erased
to be replaced by the user input.

Return Value:

The integer inputted is returned, or, in the case of a carriage
return, the default.

See Also:

inptintd() finptint() wfinptintd() ffill() finptstr()

Example:

int x;

putat(5,10,"Num: "); /* A prompt for the next field. */
finptintd(5,15,4,&x,37); /* At 5,15 a 4 character input. */

if ( x == 37 )
printf("\n\nThe default, 37, was returned.\n");
else
printf("\n\n%d was the input.\n",x);



finptintr
Summary:

int finptintr(rw,cl,mx,x,lw,hg);
int rw; /* Row of Field */
int cl; /* Column of Field */
int mx; /* Length of Field */
int *x; /* Where to Put Result */
int lw; /* Minimum Acceptable Value */
int hg; /* Maximum Acceptable Value */

Created: 09/25/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: FINPUT.C

Requires: finptint()

Description:

This function waits for a user inputted integer in the displayed
field. A beep will sound and a new integer waited for if there
is no input or the inputted integer is not within the specified
range.

Return Value:

The inputted integer, within the range, is returned.

See Also:

inptintr() finptint() wfinptintd() ffill() finptstr()
finptintrd()

Example:

int x;

putat(5,10,"Num: "); /* A prompt for the next field. */
finptintr(5,15,4,&x,3,10); /* At 5,15 a 4 character input */
/* greater than 2 and less than */
/* ten. */



finptintrd
Summary:

int finptintrd(rw,cl,mx,x,lw,hg,d);
int rw; /* Row of Field */
int cl; /* Column of Field */
int mx; /* Length of Field */
int *x; /* Where to Put Result */
int lw; /* Minimum Acceptable Value */
int hg; /* Maximum Acceptable Value */
int d; /* Default Value */

Created: 09/25/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: FINPUT.C

Requires: finptintd()

Description:

This function behaves as do finptintr() and finptintd(),
combined. However no check is made to see that the default value
is within the given range. If it is not, it will not be
returnable.

Return Value:

The inputted integer, within the range, is returned, or, in the
case of a carriage return as the first inputted character, the
default value.

See Also:

inptintr() finptint() wfinptintd() ffill() finptstr()
finptintr()

Example:

int x;

putat(5,10,"Num: "); /* A prompt for the next field. */
finptintrd(5,15,4,&x,3,10,5);/* At 5,15 a 4 character input */
/* greater than 2 and less than */
/* ten, or 5. */



finptstr
Summary:

char *finptstr(rw,cl,mx,str);
int rw; /* Row of Field */
int cl; /* Column of Field */
int mx; /* Length of Field */
char *str; /* Where to Place Input */

Created: 09/25/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: FINPUT.C

Requires: gotoxy() cfield()

Description:

This function displays the field and waits for a string to be
inputted by the user. In the case that no input is made a beep
is sounded and the function continues to wait until a string is
inputted. When it is, it is placed in the variable specified,
str.

Return Value:

A pointer to a duplicate of the inputted string is returned, via
strdup().

See Also:

inptintr() finptint() wfinptintd() ffill() finptstr()
finptstrd()

Example:

char temp[80];

finptstr(10,10,25,temp);



finptstrd
Summary:

char *finptstrd(rw,cl,mx,str,def);
int rw; /* Row of Field */
int cl; /* Column of Field */
int mx; /* Length of Field */
char *str; /* Where to Place Input */
char *def; /* Default String */

Created: 09/25/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: FINPUT.C

Requires: gotoxy() cfield()

Description:

This function behaves as does finptstr() with the exception that
the specified default string is displayed and will be returned as
the input in the case of a carriage return as the first character
entered.

Return Value:

A pointer to a duplicate of the inputted string, or the default,
is returned, via strdup().

See Also:

inptintr() finptint() wfinptintd() ffill() finptstr()
finptstre()

Example:

char temp[80];

finptstrd(10,10,25,temp,"C Spot Run");



finptstre
Summary:

void finptstre(rw,cl,mx,str);
int rw; /* Row of Field */
int cl; /* Column of Field */
int mx; /* Length of Field */
char *str; /* Where to Place Input */

Created: 10/18/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: FINPUT.C

Requires: finptstred()

Description:

This function calls finptstred() with a NULL string for a
default and will not return until input has been made.

Return Value:

Nothing is returned.

See Also:

inptstr() finptint() wfinptintd() ffill() finptstr()
finptstred() finptstr()

Example:

char temp[80];

finptstre(10,10,25,temp);

printf("temp contains: >%s<\n");



finptstred
Summary:

int finptstred(rw,cl,mx,str,def);
int rw; /* Row of Field */
int cl; /* Column of Field */
int mx; /* Length of Field */
char *str; /* Where to Place Input */
char *def; /* Default String */

Created: 10/18/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: FINPUT.C

Requires: gotoxy() cfield()

Description:

This powerful function displays the field specified and places
the default string within it, and the cursor at the first
character of this string. The default string may be returned
with a carriage return as the first character, it may be editted
with the left and right arrow keys and ins and del, the field may
be erased with the Alt-X combination, and the default input can
be restored with the Alt-D combination. Editting is performed
with the ins and del keys in combination with movement by the
left and right arrow keys. The insert key will toggle insert
'mode' on and off, although the cursor will not reflect the mode
change. When in insert mode all characters to the right of the
cursor will move right (and possibly scroll out of the field)
when characters are inputted. The del key will erase the
character the cursor rests on and move everything to the right of
the cursor left one space. In order to allow for design of full
input screens the function will return with the input in the
appropriate location and the value of the key as the return value
if one of several extended function keys is entered. These
special keys are those on the break list, which is modified by
the fbreakon() function. (The list of default keys is under the
description of this routine.)

Return Value:

A zero is returned unless input was terminated by a special key,
in which case its value will be returned. (Special keys return a
null followed by an integer. The integer is returned here.)



finptstred


See Also:

inptstr() finptint() wfinptintd() ffill() finptstr()
wfinptstred() fbreakon()

Example:

char temp[80];
int x;

x = finptstred(10,10,25,temp,"C Spot Run");

if ( x ) /* Special Value */
process(x); /* Process Key */



finptyn
Summary:

int finptyn(rw,cl);
int rw; /* Row of Field */
int cl; /* Column of Field */

Created: 09/25/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: FINPUT.C

Requires: gotoxy() cfield()

Description:

This function displays a three character field at the given
coordinates and waits for either a 'Y' or an 'N' (upper or lower
case) to be inputted. Any other character will cause the
function to sound a beep and continue to wait. When a valid
character is inputted the full word will be displayed in the
field and either a one or zero returned, for 'Y' or 'N',
respectively.

Return Value:

A one or a zero for a 'Y' or an 'N'.

See Also:

inptyn() finptint() wfinptintd() ffill() finptstr() finptynd()

Example:

char temp[80];

finptyn(10,10);



finptynd
Summary:

int finptynd(rw,cl,def);
int rw; /* Row of Field */
int cl; /* Column of Field */
int def; /* Default Input */

Created: 09/25/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: FINPUT.C

Requires: gotoxy() cfield()

Description:

This function behaves exactly as finptyn() with the exception
that the default input is displayed and will be returned if a
carriage return is entered instead of a 'Y' or 'N'. The default
value needs to be in the format of the return value, a one or
zero.

Return Value:

A one or a zero for a 'Y' or an 'N', or whatever the default was.

See Also:

inptynd() finptint() wfinptintd() ffill() finptstr() finptyn()

Example:

char temp[80];

finptynd(10,10,0); /* Default to no. */



fixcolor
Summary:

void fixcolor(atrib);
int *attr; /* Attribute to Check/Modify */

Created: 12/12/86 Last Updated: 07/12/88

Author: Source in: COUTPUT.C

Requires: Nothing.

Description:

This function will, when a monochrome card, or the CGA's black
and white mode, is currently in use, modify the attribute in
order to make it compatible with monochrome attribute set. This
routine is used internally by the windowing functions.

See Also:

color() wcolor()

Example:

#include "color.h"

int x;
int y;

x = WHT_F+BLU_B;
y = RED_F+WHT_B;

fixcolor(&x); /* Modify the attribute if neccessary. * /
fixcolor(&y);

/* On a monochrome card x is now equivalent to WHT_F+BLK_B, */
/* and y to BLK_F+WHT_B. */



gback
Summary:

int gback(clr);
int clr; /* Color for Background */

Created: 10/31/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: GBACK.ASM

Requires: Nothing.

Description:

This routine initializes the graphics screen to the specified
color, one of the palette colors in the description of gpal().

See Also:

ginit() gline() gdot() gpal()

Example:

ginit();
gpal(0);
gback(1); /* Background to Green */

gdot(10,10,2); /* Red Dot at 10,10 */



gbox
Summary:

void gbox(x,y,x2,y2,clr);
int x; /* Upper Left Row */
int y; /* Upper Left Column */
int x2; /* Lower Right Row */
int y2; /* Lower Right Column */
int clr; /* Color for Box */

Created: 11/01/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: GBOX.C

Requires: gline()

Description:

This function draws a box with the coordinates given in the given
color. See gpal() and ginit() for information on valid values.

See Also:

ginit() gline() gfbox() gpal()

Example:

ginit();
gpal(0);
gback(2); /* Background to Red */

gbox(10,10,20,20,1); /* Green Box at 10,10 */



gcircle
Summary:

void gcircle(x,y,r,clr);
int x; /* Row of Center */
int y; /* Column of Center */
int r; /* Radius of Circle */
int clr; /* Color for Box */

Created: 10/31/86 Last Updated: 07/12/88

Author: Source in: GCIRCLE.C

Requires: gdot()

Description:

This routine draws a circle at the given row and column in the
specified color with the given radius. This routine assumes an
aspect ratio of 1, and consequently will generate slightly
eliptical circles on an IBM PC.

See Also:

ginit() gline() gdot() gpal()

Example:

ginit();
gpal(0);
gback(2); /* Background to Red */

gcircle(100,150,10,1); /* Green Circle with radius of 10. */



gdot
Summary:

int gdot(x,y,clr);
int x; /* Row */
int y; /* Column */
int clr; /* Color */

Created: 10/31/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: GDOT.ASM

Requires: Nothing.

Description:

This function puts a graphic dot at the row and column specified.
The color may be 0-3 in medium resulution, or 0-1 in high. See
the descriptions of gpal() and ginit() for a list of colors and
maximum coordinate values.

Return Value:

Nothing.

See Also:

ginit() gline() gback() gpal()

Example:

ginit();
gpal(0);

gdot(10,10,2);



get_date
Summary:

void get_date(dy,mn,yr);
int *dy; /* Location of Day */
int *mn; /* Location of Month */
int *yr; /* Location of Year */

Created: 03/31/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: GET_DATE.C

Requires: intdos()

Description:

This routine obtains the current date by using the DOS interrupt
0x2a, and places it into the variables specified. The day starts
with numbering with 1, and continue to a maximum of 31, the month
is numbered from 1 to 12, and the year is from 1980 to 2099.

See Also:

get_dow() set_date() get_time()

Example:

int d;
int m;
int y;

get_date(&d,&m,&y);

printf("Today is %d/%d/%d.\n",m,d,y);



get_dow
Summary:

int get_dow();

Created: 03/31/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: GET_DOW.C

Requires: intdos()

Description:

This routine returns the day of the week, 0 for sunday, 1 for
monday, etc. It is obtained with a DOS interrupt.

Return Value:

The numerical value for the current day of the week is returned.

See Also:

get_date() get_time()

Example:

printf("Today is the %d day of the week.\n",get_dow());



get_drive
Summary:

int get_drive();

Created: 04/04/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: GETDRIVE.ASM

Requires: Nothing.

Description:

This function returns a single integer representing the current
logical drive. The drives are number from 0, as in 0 = A, 1 = B,
2 = C, etc. Remember that even with only one floppy, DOS will
still have an A and B drive, with the single floppy acting as
both.

Return Value:

The current drive.

See Also:

set_drive() num_drives()

Example:

printf("Current Drive is: %c:\n",'A'+get_drive());



get_mode
Summary:

int get_mode();

Created: 04/16/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: GETMODE.ASM

Requires: Nothing.

Description:

This function returns the current video mode.

Return Value:

The current video mode.

See Also:

set_mode()

Example:

#include

printf("Current video mode is: %d\n",get_mode());



getpw
Summary:

int getpw(pass);
char *pass; /* The Password to Check Against */

Created: 04/13/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: GETPW.C

Requires: Windowing routines and getch().

Description:

This function opens a small blue and white window in the center
of the screen and inputs a password up to eighteen characters
long. As each character is inputed an asterisk is echoed.
Backspace editing is permitted. If the entered password is equal
to the specified password (case ignored) the funtion returns a
one, otherwise it returns a 0 on failure.

Return Value:

1 if the correct password is entered, 0 if not.

Example:

if ( getpw("pass") == 0 )
printf("** Access Denied **\n");



get_time
Summary:

void get_time(hr,mn,sc,hn);
int *hr; /* Location of Hour */
int *mn; /* Location of Minutes */
int *sc; /* Location of Seconds */
int *hn; /* Location of Hundredths */

Created: 03/31/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: GET_TIME.C

Requires: Nothing.

Description:

Using DOS interrupt 0x2c this routine obtains the current time,
to the hundredths, and places it in the variables specified. The
time is given in 24 hour format, and everything starts counting
at 0, 0 to 23 hours, 0 to 59 seconds etc.

See Also:

get_dow() get_date() set_time()

Example:

int h;
int m;
int s;
int hn;

get_time(&h,&m,&s,&hn);

printf("The time is %d:%d:%d.%d.\n",h,m,s,hn);



get_timer
Summary:

long get_timer();

Created: 01/03/87 Last Updated: 07/12/88

Author: Dave Perras Source in: TIMERS.C

Requires: Nothing.

Description:

This function is used by the other timer routines in order to get
the value of the real time clock. All DOS and compiler specifics
concerning the timer routines are contained in this routine.

Return Value:

A long value is returned holding the number of clock ticks from
the real time clock counter.

See Also:

start_tmr() stop_tmr() read_tmr() reset_tmr() zero_tmr() timer()
init_tmr()

Example:

long ltime;

ltime = get_timer();



gfbox
Summary:

void gfbox(x,y,x2,y2,clr);
int x; /* Upper Left Row */
int y; /* Upper Left Column */
int x2; /* Lower Right Row */
int y2; /* Lower Right Column */
int clr; /* Color for Box */

Created: 11/01/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: GFBOX.C

Requires: gline()

Description:

This function is identical to gbox() with the exception that the
box created is filled in with the specified color.

See Also:

ginit() gline() gpal() gbox()

Example:

ginit();
gpal(0);
gback(2); /* Background to Red */

gfbox(10,10,20,20,1); /* Solid Green Box at 10,10 */



ginit
Summary:

int ginit();

Created: 10/31/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: GINIT.C

Requires: Nothing.

Description:

This function sets up the screen on a CGA for medium resolution
graphics. It is the exact equivalent of set_mode(4). To set up
for high resolution graphics, use the command set_mode(6) instead
of ginit().

Return Value:

Nothing.

See Also:

set_mode() gback() gdot() gpal()

Example:

ginit(); /* Medium Resolution Screen */
gpal(0);
gback(2); /* Background to Red */

gcircle(100,150,10,1); /* Green Circle with radius of 10. */



gline
Summary:

void gline(x,y,x2,y2,clr);
int x; /* Starting Row */
int y; /* Starting Column */
int x2; /* Ending Row */
int y2; /* Ending Column */
int clr; /* Color of Line */

Created: / / Last Updated: 07/12/88

Author: Dan Rollins Source in: GLINE.C


Requires: gdot()

Description:

This routine, found in the Febuary, 1986, Dr. Dobb's Journal,
plots a line from the first to the second set of coordinates.
The first set of coordinates needn't be lower than the second.

See Also:

gcircle() gback() gdot() gpal()

Example:

ginit(); /* Medium Resolution Screen */
gpal(0);
gback(2); /* Background to Red */

gline(10,10,50,50,1); /* A Diagonal Green Line */



gotoxy
Summary:

int gotoxy(row,col);
int row; /* Screen Row */
int col; /* Screen Column */

Created: 00/00/00 Last Updated: 07/12/88

Author: Source in: GOTOXY.ASM

Requires: Nothing

Description:

The gotoxy function will set the cursor to the screen coordinates
specified in row and col, regardless of windows or other high-
level screen manipulation.

Service two of the bios video interrupt 0x10 is used.

Return Value:

This routine returns nothing, and does not check coordinate
validity.

See Also:

wgotoxy()

Example:

#include

int row;
int col;

row = 10;
col = 20;

gotoxy(row,col);

printf("I am now at Column 20 on Row 10.\n");



gpal
Summary:

int gpal(palette);
int palette; /* Color Palette to Use */

Created: 10/31/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: GPAL.ASM

Requires: Nothing.

Description:

This routine sets the current color palette for use in medium
resolution graphics. (In high resolution graphics the only
choices are on one palette, 0 for black, 1 for white.)

Palette 0: Palette 1:
(0) Background Color (0) Background Color
(1) Green (1) Cyan
(2) Red (2) Magenta
(3) Brown (3) White

Return Value:

Nothing.

See Also:

ginit() gback() gdot()

Example:

ginit(); /* Medium Resolution Screen */
gpal(0);
gback(2); /* Background to Red */

gline(10,10,50,50,3); /* A Diagonal Brown Line */



init_tmr
Summary:

unsigned init_tmr();

Created: 01/03/87 Last Updated: 07/12/88

Author: Dave Perras Source in: TIMERS.C

Requires: get_timer()

Description:

This function must be called before any of the other timer
functions are called. It tests the real time clock to ensure
that it is operating, clears the ten timers to zero and sets an
internal flag to show that the timers have been initialized.

Return Value:

This function returns the elapsed time (in tenths of seconds) for
16000 iterations of an empty "for" loop. If the real time clock
is diagnosed as not working, and error value of zero is returned.

See Also:

start_tmr() stop_tmr() read_tmr() reset_tmr() zero_tmr()
get_timer()

Example:

#include

if ( ! init_tmr() )
fprintf(stderr,"Real Time Clock Error\n");



inptint
Summary:

int inptint(prompt);
char *prompt; /* Prompt for Input */

Created: 08/16/86 Last Updated: 07/12/88


Author: Bob Pritchett Source in: INPUT.C

Requires: Nothing.

Description:

This function displays the prompt given at the current cursor
location using stdout and then inputs an integer. After a
carriage return (with mandatory input of an integer) the value
entered is returned.

Return Value:

The integer inputted.

See Also:

inptintd() inptintr() inptintrd()

Example:

printf("inptint() returns: %d.\n",inptint("Enter Integer:"));

/* The above function prompts "Enter Integer: " and then */
/* executes the printf statement. */



inptintd
Summary:

int inptintd(prompt,def);
char *prompt; /* Prompt for Input */
int def; /* Default Integer */

Created: 08/16/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: INPUT.C

Requires: Nothing.

Description:

This function displays the prompt given followed by the default
integer. If a carriage return is entered as the first character
the default integer will be returned. If any other valid
character is entered the default will be erased and the user may
enter an integer value.

Return Value:

The integer inputted, or the default.

See Also:

inptint() inptintr() inptintrd()

Example:

printf("inptintd() returns: %d.\n",inptintd("Enter Integer:",9));

/* The above function prompts "Enter Integer: " and then */
/* executes the printf statement. */



inptintr
Summary:

int inptintr(prompt,low,high);
char *prompt; /* Prompt for Input */
int low; /* Lowest Acceptable Input */
int high; /* Highest Acceptable Input */

Created: 08/16/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: INPUT.C

Requires: Nothing.

Description:

After displaying the prompt specified this function will input
and integer in the same manner as inptint(), only checking to
make sure that the value inputted is within the range given. If
it is not equal to or within this range the function will prompt
for another integer until a valid one is entered.

Return Value:

The integer inputted, within the specified range.

See Also:

inptint() inptintd() inptintrd()

Example:

printf("inptintr() returns: %d.\n",inptintr("Enter Integer:"
,5,62));

/* The above function prompts "Enter Integer: " and then */
/* executes the printf statement. The returned value */
/* will be greater than 4 and less than 63. */



inptintrd
Summary:

int inptintrd(prompt,low,high,def);
char *prompt; /* Prompt for Input */
int low; /* Lowest Acceptable Input */
int high; /* Highest Acceptable Input */
int def; /* Default Value */

Created: 08/16/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: INPUT.C

Requires: Nothing.

Description:

This function displays the default integer value after the prompt
and then returns either the default integer or a user inputted
value within the specified range. The input follows the same
rules as inptintd() and inptintr().

Return Value:

The integer inputted, or the default, within the specified range.

See Also:


inptint() inptintd() inptintr()

Example:

printf("inptintrd() returns: %d.\n",inptintrd("Enter Integer:"
,8,50,30));

/* The above function prompts "Enter Integer: 30" and */
/* then executes the printf statement. The returned */
/* value will be greater than 7 and less than 51. */



inptstr
Summary:

char *inptstr(prompt);
char *prompt; /* Prompt for Input */

Created: 08/25/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: INPUT.C

Requires: Nothing.

Description:

After displaying the given prompt this function waits for an
input string. Nothing longer than 80 characters will be handled
correctly, and the routine will beep at a carriage return in the
first column, making some input mandatory. For functions with
more control over input parameters, see inptstrd() and finptstr()
and related routines.

Return Value:

The character string inputted.

See Also:

inptstrd() finptstr() finptstrd() finptstre() finptstred()

Example:

printf("Hello there, %s.\n",inptstr("Your name?"));



inptstrd
Summary:

char *inptstrd(prompt,def);
char *prompt; /* Prompt for Input */
char *def; /* Default String */

Created: 08/25/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: INPUT.C

Requires: Nothing.

Description:

This function acts in the same manner as inptstr() with the
exception that a default string may be specified, and at the
choice of the user this string may be returned instead of a user
entered string. When the function is called the default string
is displayed immediately following the prompt, and the cursor is
placed at the first character of the string. If a carriage
return is entered as the first inputted character, the default
string is returned. Any other key causes the default string to
be erased and a user entered string may be inputted.

Return Value:

The character string inputted, or the default string.

See Also:

inptstr() finptstr() finptstrd() finptstre() finptstred()

Example:

printf("Hello there, %s.\n",inptstrd("Your name?","Richard"));



inptyn
Summary:

int inptyn(prompt);
char *prompt; /* Prompt for Input */

Created: 08/16/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: INPUT.C

Requires: Nothing.

Description:

This function displays the given prompt and then waits for either
a Y or an N in reply. A single character is all that is
inputted, and a Y or N must be entered. If a Y is entered a one
is returned, if an N is entered a zero is returned.

Return Value:

A one or zero, dependent on the inputted character.

See Also:

inptynd() finptyn() finptynd();

Example:

if ( inptyn("Do you program microcomputers?") )
printf("Oh, you do.");

/* Prompts 'Do you program microcomputers? (Y/N) ' */



inptynd
Summary:

int inptynd(prompt,x);
char *prompt; /* Prompt for Input */
int x; /* Default Answer */

Created: 08/16/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: INPUT.C

Requires: Nothing.

Description:

This function works just like inptyn() except that the default
response is the uppercase letter in the prompt which will be
returned if a carriage return is entered instead of a Y or N.

Return Value:

A one or zero, dependent on the inputted character, or the
default.

See Also:

inptyn() finptyn() finptynd();

Example:

if ( inptyn("Do you program microcomputers?",1) )
printf("Oh, you do.");

/* Prompts 'Do you program microcomputers? (Y/n) ' */



isleap
Summary:

int isleap(y);
int y; /* Year */

Created: 09/01/86 Last Updated: 07/12/88

Author: George Roukas Source in: CSRDATE.C

Requires: Nothing.

Description:

This function will tell if the specified year (four or two digit
format) is a leap year.

Return Value:

Returns a one if it is a leap year, zero if it is not.

Example:

int x = 1986;

if ( isleap(x) )
printf("%d is a leap year.\n");



iswild
Summary:

#include "csrmisc.h" /* Header File Containing the Macro */

int iswild(c);
int c; /* Character to Test */

Created: 12/05/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRMISC.H

Requires: Nothing.

Description:

This macro evaluates positive if the given character is a '?' or
an '*'.

Return Value:

Acts positive if the character is a wildcard, negative if not.

See Also:

istemplate()

Example:

if ( iswild('?') )
printf("This character is a wild card.\n");

/* The printf statement is executed. */



istemplate
Summary:

int istemplate(str);
char *str; /* String to Evaluate */

Created: 12/05/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WILDCARD.C

Requires: Nothing.

Description:

This function returns a one if a wildcard is encountered within
the given string. By using this function it can be determined
whether a file may be opened or if the string should be passed to
the ffirst() and fnext() routines.

Return Value:

Returns a one if a wildcard is encountered, zero if not.

See Also:

iswild()

Example:

if ( istemplate("file*.e?w") )
printf("The filename given is a template.\n");

/* The printf statement is executed. */



itofa
Summary:

char *itofa(x,str);
int x; /* Integer to Format */
char *str; /* Location to Place String */

Created: 11/07/85 Last Updated: 07/12/88

Author: Bob Pritchett Source in: ITOFA.C

Requires: Nothing.

Description:

This function takes an integer and returns a string with that
integer formatted with commas. The string is placed in str and a
pointer is returned to it.

Return Value:

Returns a pointer to the formatted string.

See Also:

ltofa()

Example:

int x = 12526;
char temp[10];

printf("There are %s people in this county.\n",itofa(x,temp));

/* Returns "12,526". */



lprint
Summary:

void lprint(string);
char *string; /* String to Print */

Created: 03/10/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: PRINT.C

Requires: lputchar()

Description:

This function simply prints the string to the printer. Nothing
other then the standard escape codes are recognized.

See Also:

wprint()

Example:

lprint("This string has no formatting at all.\n");



lprintf
Summary:

void lprintf(string[,arguments...]);
char *string; /* Format String to Print */

Created: 03/10/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: PRINT.C

Requires: Nothing.

Description:

This function is a version of the familiar printf() function that
prints directly to the printer. (Note that DOS function 5 is
used, it is not done through file pointers.) The argument
formatting should be in the same format as for printf().

See Also:

lprint() wprintf()

Example:

lprintf("This goes to the printer: %02d %5s\n",6,"Wow");



lputchar
Summary:

void lputchar(c);
int c; /* Character to Print */

Created: 03/10/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: PRINT.C

Requires: bdos()

Description:

Using the bdos call five this routine simply puts the character c
to the printer. It is called by lprint().

See Also:

lprint() lprintf()

Example:

lputchar('\r');



ltofa
Summary:

char *ltofa(x,str);
long x; /* Long to Format */
char *str; /* Location to Place String */

Created: 11/07/85 Last Updated: 07/12/88

Author: Bob Pritchett Source in: LOTFA.C

Requires: Nothing.

Description:

Performing just like itofa(), this function formats the given
number into an ASCII string with commas.

Return Value:

Returns a pointer to the formatted string.

See Also:

itofa()

Example:

long x = 2364736;
char temp[15];

printf("There are %s apples in this county.\n",ltofa(x,temp));

/* Returns "2,364,736". */



match
Summary:

int match(pat,str,start);
char pat[]; /* Pattern to Search for */
char str[]; /* String to Search in */
int start; /* Character to Start on */

Created: 11/23/85 Last Updated: 07/12/88

Author: Bob Pritchett Source in: MATCH.C

Requires: strlen()

Description:

The match() function searches the string str for the string pat,
and returns an integer value of the first place pat is found
within str. By changing the variable start from it's normal
useage as 0, you may begin the search from a certain place in
str. The following wildcards are acceptable within pat:

# Any digit from 1-9, and 0
? Any character at all
! Any upper-case letter
^ Any control character

Return Value:

Returns the first place that pat is found within str.

Example:

x = match("a?c","xyzabc",0); /* x = 3, where abc begins. */



mcolor
Summary:

#include "color.h" /* For Color Definitions Only */

void mcolor(norm,bar);
int norm; /* Color Used for Menu Options */
int bar; /* Color for Hightlight Bar */

Created: 04/16/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: POPMENU.C

Requires: Nothing.

Description:

This function sets the colors to be used by pop_menu() and it's
scrolling highlight bar. The variable norm contains the complete
attribute for each option, and bar for the highlight bar.

See Also:

color() wcolor()

Example:

#include "color.h"

mcolor(WHT_F+BLU_B,YEL_F+RED_B);



message
Summary:

int message(mess,x);
char *mess; /* Message to Display */
int x; /* Flag for Window Message */

Created: 08/09/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: MESSAGE.C

Requires: Nothing.

Description:

This function opens a small window in the current color and
displays the string specified in mess. If the variable x is set
to one, the message "[ Hit a Key ]" is displayed on the bottom of
the window. A single keystroke closes the window, and the key
value is returned.

Return Value:

The key used to close the window.

Example:

message("** Attempt to Open File Failed **",1);



month_day
Summary:

void month_day(yr,yd,m,d);
int yr; /* Year To Calculate For */
int yd; /* Number of Days Elapsed in Year */
int *m; /* Where to Store Month */
int *d; /* Where to Store Day */

Created: 09/01/86 Last Updated: 07/12/88

Author: George Roukas Source in: CSRDATE.C

Requires: isleap()

Description:

Similar to the K&R (pp 103-104) routine of the same name, this
function calculates the menth and day of the year when given the
year and number of days elapsed in that year.

See Also:

date_sn() sn_date() isleap()

Example:

int m;
int d;

month_day(1986,3,&m,&d);

printf("%02d/%02d is 3 days into 1986.\n",m,d);

/* Will output: 01/03 is.... */



num_days
Summary:

int num_days(m,y);
int m; /* Month to Get Number of Days For */
int y; /* Year */

Created: 12/27/85 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRDATE.C

Requires: isleap()

Description:

This function returns the number of days in the month specified,
leap years taken into account.

Return Value:

The number of days.

See Also:

date_sn() sn_date() isleap() chk_date()

Example:

printf("%d days in February, 1980.\n",num_days(2,1980));



num_drives
Summary:

int num_drives();

Created: 04/06/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: NUMDRVS.ASM

Requires: Nothing.

Description:

This function returns a single integer value, the number of
logical drives available. Remember that although this function
returns the number of available drives, access to these drives is
numbered from zero, so if 3 drives are reported, the highest
number that may be accessed is 2.

Return Value:

The total number of logical drives installed.

See Also:

get_drive() set_drive()

Example:

printf("%d drives installed. A: - %c:\n",num_drives(),
( 'A' + ( num_drives() - 1 ) ));



play
Summary:

int play(mstr);
char *mstr; /* Music String to Play */

Created: 02/20/86 Last Updated: 07/12/88

Author: Paul Canniff Source in: CSRPLAY.ASM

Requires: sound()

Description:

This function plays a music string using the sound() function,
meaning that fore/background mode is determined by sound().

The format for the string is the same as that of BASICA.
Summarized, the following options are available: (Lengths are 1
for whole note, 2 for half, 4 for quarter, etc.)

A-G[x][.] Play the note in the current octave. The length
can be set by x, or the default is used. The
note may be dotted.
L Sets the default length.
M Sets mode. (Normal, Legato, Staccato.)
N Plays note x. (0..84) Default values used.
O Sets the octave, from 0 to 7.
P[x][.] Pauses for a specified time.
T Sets the tempo, from 32 to 255.
< Go down one octave.
> Go up one octave.

(Note: The timing may need to be played with for your hardware.
Try adjusting the tempo.)

Return Value:

Nothing.

See Also:

sound() sound_init() sound_done()

Example:

play("MLc2.d ab>cd /* See CSRDEMO.C for a real example. */



pmclose
Summary:

void pmclose(mn);
int mnu; /* Menu to Close */

Created: 07/02/87 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRMENU.C

Requires: Nothing.

Description:

This function will close the window associated with the mnu
pointer and free any memory allocated for it.

See Also:

pmopen() pmrun() pmenu() pop_menu()

Example:

char *stuff[3] =
{
"Option 1",
"Second Option",
"Your Third Choice"
};

main()
{
int m;
int x;
m = pmopen(10,10,"[ Menu ]",3,stuff,1);
x = pmrun(m);
pmclose(m);
printf("\nMenu Choice %d Chosen.\n");
}



pmcolor
Summary:

void pmcolor(nm,bd,br);
int nm; /* Menu's Inside Color */
int bd; /* Menu's Border Color */
int br; /* Highlight Bar Color */

Created: 07/05/87 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRMENU.C

Requires: Nothing.

Description:

This function sets the colors used for by menu's created with
pmopen() and run with pmrun().

See Also:

pmopen() pmrun()

Example:

char *stuff[3] =
{
"Option 1",
"Second Option",
"Your Third Choice"
};

main()
{
int m;
int x;
pmcolor(RED_F,WHT_F,RED_F+WHT_B);
m = pmopen(10,10,"[ Menu ]",3,stuff,1);
x = pmrun(m);
pmclose(m);
printf("\nMenu Choice %d Chosen.\n");
}



pmenu
Summary:

#include "csrmenu.h" /* Contains MENU typedef */

int pmenu(menu);
MENU menu; /* Pointer to Menu Structure */

Created: 08/08/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: MENU.C

Requires: Nothing.

Description:

This function will display a pop up menu and allow for selection
of an item with the arrow keys, or the space and backspace keys.
The differences between pmenu() and pop_menu() are mostly in the
calling method. By using a data element of the MENU type as the
only argument, the number of parameters specifiable is increased,
allowing for better control of the menu, while the number of
function arguments is reduced to one for cleaner coding.

If the first character in an item name is a hyphen, the item will
be a horizontal line of the border color and type. If the return
value of an element is a negative one, the item is non
selectable.

Note, unlike pop_menu(), pmenu() will center the text of each
entry to the width of the largest entry. If you place a space on
each side of only the largest (widest) entry in a menu structure,
all menu options will have at least one space on each side.

For information on specification of menus, read the description
of CSRMENU.H.

Return Value:

The value of the menu item selected or a -1 for failure.

See Also:

pop_menu()



pmenu




Example:

#include
#include "color.h"

MENU mnu;

main()
{
int x;
strcpy(mnu->title,"Menu");
mnu->type = 3;
mnu->border = WHT_F+BLU_B;
mnu->normal = RED_F+WHT_B;
mnu->bar = WHT_F+RED_B;
mnu->row = 6;
mnu->col = 20;
mnu->num = 4;
strcpy(mnu->entry[0].text,"Help");
mnu->entry[0].value = 1;
strcpy(mnu->entry[1].text,"Exit");
mnu->entry[1].value = 2;
strcpy(mnu->entry[2].text,"-");
mnu->entry[2].value = -1;
strcpy(mnu->entry[3].text," Static ");
mnu->entry[3].value = -1;
x = pmenu(mnu);
if ( x == -1 )
exit(1);
else if ( x == 1 )
help();
else
exit(0);
.
.
.
}



pmfunc
Summary:

void pmfunc(func);
int (*func)(); /* Function to be Called */

Created: 07/03/87 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRMENU.C

Requires: Nothing.

Description:

This function will set the name of a function to be called while
pmrun() is waiting for a keystroke. This function must run
continuously until a keystroke is hit. (It should contain
something like a 'while ( ! kbhit() )' statement.)

A suggested use would be to update the time and date on the
screen.

See Also:

pmopen() pmrun()



pmfunc




Example:

int dtw;

char *stuff[3] =
{
"Option 1",
"Second Option",
"Your Third Choice"
};

main()
{
int m;
int x;
int update();
dtw = wopen(1,61,4,78,1);
pmfunc(update);
m = pmopen(10,10,"[ Menu ]",3,stuff,1);
x = pmrun(m);
pmclose(m);
printf("\nMenu Choice %d Chosen.\n");
}

update()
{
int d,mn,y;
int h,m,s,hs;
while ( ! kbhit() )
{
get_date(&d,&mn,&y);
get_time(&h,&m,&s,&hs);
whome(dtw);
wprintf(dtw," Date: %02d/%02d/%d\n",mn,d,(y-1900));
wprintf(dtw," Time: %02d:%02d:%02d",h,m,s);
}
}



pmopen
Summary:

int pmopen(r,c,title,argc,argv,type);
int r; /* Upper Left Corner Row */
int c; /* Upper Left Corner Column */
char *title; /* Title of Menu */
int argc; /* Option Count */
char *argv[]; /* Options */
int type; /* Border Type of Menu */

Created: 07/02/87 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRMENU.C

Requires: Nothing.

Description:

This function opens a menu and sets up the internal data without
allowing the user to use the menu. The options are centered
according to the length of the longest one plus two. (Left and
right justified menus can be created by left or right justifying
the options before calling pmopen().)

Options preceded by a '#' are static, meaning that they are not
selectable. Those preceded by a '-' will be replaced with a line
on the display.

The integer value returned is a pointer to the menu for use with
pmrun() or pmclose(). There are eight available pointers, and
each menu can have as many as fifteen options.

Return Value:

The menu pointer.

See Also:

pmclose() pmrun() pmenu() pop_menu()



pmopen




Example:

int dtw;

char *stuff[5] =
{
"Option 1",
"-This is a line."
"Second Option",
"#Unselectable",
"Your Third Choice"
};

main()
{
int m;
int x;
int update();
dtw = wopen(1,61,4,78,1);
pmfunc(update);
m = pmopen(10,10,"[ Menu ]",5,stuff,1);
x = pmrun(m);
pmclose(m);
printf("\nMenu Choice %d Chosen.\n");
}

update()
{
int d,mn,y;
int h,m,s,hs;
while ( ! kbhit() )
{
get_date(&d,&mn,&y);
get_time(&h,&m,&s,&hs);
whome(dtw);
wprintf(dtw," Date: %02d/%02d/%d\n",mn,d,(y-1900));
wprintf(dtw," Time: %02d:%02d:%02d",h,m,s);
}
}



pmrun
Summary:

int pmrun(mnu);
int mnu; /* Menu to Run */

Created: 07/03/87 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRMENU.C

Requires: Nothing.

Description:

This function will 'run' the specified menu, assuming that is has
already been opened with the pmopen() function.

If a function has been specified by the pmfunc() function it will
be run until a key is hit, at which time pmrun() processes it.
Up and down arrows scroll the highlight bar through the menu, as
do space and backspace. Hitting the enter key causes pmrun() to
return the number of the option currently highlighted, and
entering the first letter of an option will cause it to return
the number of the FIRST option beginning with that letter. The
ESCape key causes pmrun() to return a -1.

Note that pmrun() always highlights the first menu option, and
does not close the menu before returning the selected value.

Return Value:

The number of the option selected, or -1 in the case of the
escape key.

See Also:

pmclose() pmopen() pmenu() pop_menu()



pmrun




Example:

char *stuff[5] =
{
"Option 1",
"-This is a line."
"Second Option",
"#Unselectable",
"Your Third Choice"
};

main()
{
int m;
int x;
m = pmopen(10,10,"[ Menu ]",5,stuff,1);
while ( 1 )
{
x = pmrun(m);
if ( x == -1 )
break;
switch(x)
{
case 0:
opt_one();
break;
case 2:
opt_two();
break;
case 4:
opt_three();
break;
default:
break;
}
}
pmclose(m);
printf("\nMenu Choice %d Chosen.\n");
}



pop_menu
Summary:

int pop_menu(x,y,num,args,title,type);
int x; /* Row to Start on */
int y; /* Col to Start on */
int num; /* Number of Options */
char *args[]; /* Function Names */
char *title; /* Menu Title */
int type; /* Window Type */

Created: 03/09/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: POPMENU.C

Requires: wopen() wclose() wtitle()

Description:

This function opens a window at x,y titled with the string
pointed to by title, of type border style, and with num options
stored in args[]. The window's width is the size of the maximum
length option. The options are printed as sent to the routine,
but for a clean highligh bar, and better performance all the
options should be centered previously in a string. See the demo
programs for more examples of this. Also note, after an option
is selected with the highlight bar, the it's number is returned,
and the window closed. You must reopen the menu, this preferably
done in a loop[ structure that opens the menu, processes the
resulting code, and then reopens the menu. This system is a
simple building block for more advanced menu design.

Return Value:

The number of the option selected with the highlight bar, or a -1
signifying the user aborted the menu with the ESC key.

See Also:

mcolor()



pop_menu




Example:

#include "color.h"

static char *array[] =
{
" Option 1 ",
" Option 2 ",
" Quit "
};

main()
{
int x;
cls();

while ( 1 )
{

/* Inside doesn't matter, mcolor() does that, so we use wcolor
only to set our border. Then mcolor() will set our menu
colors. (Color definition in loop in case other routines
change them.) */

wcolor(BLK_F,BLU_F+WHT_B);
mcolor(YEL_F+RED_B,WHT_F+BLU_B);

x = pop_menu(9,27,3,array," Menu ",3);
if ( x == 0 )
opt1();
else if ( x == 1 )
opt2();
else if ( x == 2 || x == -1 )
exit(0);
}
}



print_screen
Summary:

void print_screen();

Created: 03/10/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: PRINT.C

Requires: int86()

Description:

Performing the exact same feature as if you had hit the PrtSc key
while holding the shift key down, this routine prints the screen
with the bios interrupt five.

Example:

print_screen();



prtrns
Summary:

int prtrns(c);
int c; /* Character to translate */

Created: 02/22/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: PRTRNS.C

Requires: Nothing.

Description:

This function is a simple one that takes c as an argument, and if
it is a special box drawing character form the extended character
set it is translated into an equivalent in the lower 127 ASCII
range. Possibly useful in writing a screen or text dump that
originally contained special characters.

Return Value:

Returns the character, translated if neccessary.

Example:

#include

int c = 179;

c = prtrns(c); /* Would return |, replacing 179. */

putc(c,stdprn);



putat
Summary:

void putat(x,y,string);
int x; /* Row to Put At */
int y; /* Col to Put At */
char *string; /* String to Put */

Created: 12/28/85 Last Updated: 07/12/88

Author: Bob Pritchett Source in: PUTAT.C

Requires: ccputs() putchci()

Description:

This function places the specified string at x,y on the global
screen using the global color set by color().

See Also:

putatf() wputat() wputatf()

Example:

putat(10,25,"+ The plus is at 10,25.");



putatf
Summary:

void putatf(x,y,string,args...);
int x; /* Row to Put At */
int y; /* Col to Put At */
char *string; /* Formatted String to Put */
args... /* Formatting Arguments */

Created: 05/01/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: PUTATF.C

Requires: ccputs() putchci()

Description:

This performs the same function as putat() with the addition of
up to 15 formatting arguments in the same format as printf().

See Also:

putat() wputat() wputatf()

Example:

putatf(10,25,"+ The plus %s at %d,%d.","is",10,25);



putchc
Summary:

int putchc(c,color);
int c; /* Character to Print */
int color; /* Attribute to Use */

Created: 09/25/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: PUTCHC.ASM

Requires: Nothing.

Description:

This function simply outputs the character and attribute without
incrementing the cursor.

Return Value:

Nothing.

See Also:

putchci() wputchar()

Example:

#include "color.h"

putchc('C',GRN_F+BLK_B); /* Put out a C in green. */



putchci
Summary:

int putchci(c,color);
int c; /* Character to Print */
int color; /* Attribute to Use */

Created: 12/28/85 Last Updated: 07/12/88

Author: Bob Pritchett Source in: PUTCHCI.ASM

Requires: Nothing.

Description:

This simply outputs the character c, using the color in color, to
the video memory, and then increments the cursor.

Return Value:

Nothing.

See Also:

wputchar()

Example:

#include "color.h"

putchci('A',RED_F+BLK_B); /* Put out an A in red. */



read_tmr
Summary:

unsigned read_tmr(x);
int x; /* The Number of the Counter to Use */

Created: 01/03/87 Last Updated: 07/12/88

Author: Dave Perras Source in: TIMERS.C

Requires: get_timer()

Description:

This function reads the specified timer and returns, in tenths of
seconds, the difference between the stored time and the current.

Return Value:

An unsigned value representing the tenths of seconds which have
elapsed since the start_tmr() function was called for this timer.
If the specified timer has not been initialized or has not been
started an error value of zero is returned.

See Also:

get_timer() start_tmr() stop_tmr() reset_tmr() zero_tmr() timer()
init_tmr()

Example:

init_tmr(); /* Initialize Timers */

start_tmr(5); /* Start timer number 5. */

printf("%d seconds have elapsed.\n",10 * read_tmr(5));
/* The above statement does not stop the timer. */



reset_tmr
Summary:

void reset_tmr(x);
int x; /* The Number of the Counter to Use */

Created: 01/03/87 Last Updated: 07/12/88

Author: Dave Perras Source in: TIMERS.C

Requires: Nothing.

Description:

This function zeros the specified timer and clears its active
flag.

See Also:

get_timer() start_tmr() stop_tmr() read_tmr() zero_tmr() timer()
init_tmr()

Example:

init_tmr(); /* Initialize Timers */

start_tmr(5); /* Start timer number 5. */

printf("%d seconds have elapsed.\n",10 * read_tmr(5));
/* The above statement does not stop the timer. */

reset_tmr(5); /* Stop and reset timer 5. */



restore
Summary:

void restore(x,y,x2,y2,array);
int x; /* Upper Left Row */
int y; /* Upper Left Col */
int x2; /* Lower Right Row */
int y2; /* Lower Right Col */
char *array; /* Array to Store Screen In */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This function restores the portion of the screen previously saved
by save() in array at the coordinates which are specified, which
don't have to be the same as those at which it was saved.

See Also:

save() restore_screen()

Example:

char *temp;
temp = malloc(4000); /* Size of screen and attributes. */

save(0,0,24,79,temp); /* Save whole screen. */

restore(0,0,24,79,temp); /* Restore screen. */



restore_cursor
Summary:

void restore_cursor(x);
int x; /* Cursor to Restore */

Created: 02/22/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CURSOR.C

Requires: int86()

Description:

This function restores the cursor to the position give in the one
byte argument, which contains both the row and column position as
returned by save_cursor().

A cursor position of 0 restores the cursor to the last saved
position, not the home position. (This is in order to retain
some compatibility with CSR v2.1.)

See Also:

save_cursor() restore_screen()

Example:

int x;
int y;

gotoxy(8,8);
x = save_cursor();
gotoxy(10,10);
y = save_cursor();

restore_cursor(x); /* Return to 8,8 */
restore_cursor(y); /* Return to 10,10 */



restore_screen
Summary:

void restore_screen();

Created: 03/09/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: SRSCREEN.C

Requires: restore()

Description:

This function restores the screen saved with save_screen().
Useful for restoring the screen present when a program was
invoked after it finishes executing.

See Also:

save_screen() restore_cursor()

Example:

main()
{
save_screen();

/* Etc... */

restore_screen();
exit(0);
}



retrace
Summary:

void retrace(x);
int x; /* Type of Retrace to Test For */

Created: 06/06/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This routine determines which retrace to move data into video
memory under. The value can be 1, (FAST) which represents data
movement during the horizontal retrace, or 8, (SLOW) which causes
data to be moved during the vertical retrace. The fast/slow
adjectives have little to do with the data movement due to the
number of screen repaints per second. The default is vertical
retrace, 8, and the main purpose of this function is to allow
an alternate method if desirable on some monitors.

See Also:

dma()

Example:

retrace(8);
/* Change to data movement during vertical retrace. */



save
Summary:

void save(x,y,x2,y2,array);
int x; /* Upper Left Row */
int y; /* Upper Left Col */
int x2; /* Lower Right Row */
int y2; /* Lower Right Col */
char *array; /* Array to Store Screen In */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This function saves the portion of the screen specified by the
four coordinates into array. No other action is taken, and the
screen is not erased within that area.

See Also:

restore() save_screen()

Example:

char *temp;
temp = malloc(4000); /* Size of screen and attributes. */

save(0,0,24,79,temp); /* Save whole screen. */

restore(0,0,24,79,temp); /* Restore screen. */



save_cursor
Summary:

int save_cursor();

Created: 02/22/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CURSOR.C

Requires: int86()

Description:

This function saves the current cursor position and returns a
single byte representation of that value. This must be used with
the restore_cursor() function to put the cursor back. The most
recently save cursor position is also stored internally and is
restored when restore_cursor() is called with 0 as an argument.

Return Value:

A single byte representation of the cursor position.

See Also:

restore_cursor()

Example:

int x;

x = save_cursor();

printf("This is a string of text...");

restore_cursor(x); /* To the beginning of the line... */



save_screen
Summary:

void save_screen();

Created: 03/09/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: SRSCREEN.C

Requires: save()

Description:

This function saves the current screen and attributes for later
restoration with the restore_screen() function.

See Also:

save_cursor() restore_screen()

Example:

main()
{
save_screen();

/* Etc... */

restore_screen();
exit(0);
}



scroll
Summary:

void scroll(x,y,x2,y2,dir,num,color);
int x; /* Upper Left Row */
int y; /* Upper Left Col */
int x2; /* Lower Right Row */
int y2; /* Lower Right Col */
int dir; /* 0 - Up / 1 - Down */
int num; /* Number of Lines */
int color; /* Color To Clear To */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: SCROLL.C

Requires: int86()

Description:

This function scrolls the area inside and including the specified
coordinates in the specified window. The number of lines
scrolled is determined by the value of num and setting num to 0
and the direction 0, up, will cause the window to clear
completly.

See Also:

wscroll()

Example:

#include "csr.h" /* For Scroll Command #defines */

scroll(0,0,24,80,SCROLL_UP,0,7); /* Clear the whole screen to */
/* White-on-Black Attribute */



setbeep
Summary:

void setbeep(tone,length);
int tone; /* Tone for Beep */
int length; /* Length in Milliseconds */

Created: 07/02/87 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRBEEP.C

Requires: Nothing.

Description:

This function sets the tone and duration of the beep produced by
beep(). The default values are 450 and 125.

See Also:

beep() setbeep()

Example:

setbeep(800,300); /* Long and High */

beep(); /* Output Beep */



set_date
Summary:

int set_date(dy,mn,yr);
int dy; /* Day */
int mn; /* Month */
int yr; /* Year */

Created: 03/31/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: SET_DATE.ASM

Requires: intdos()

Description:

Using the DOS interrupts this routine sets the date as specified
in the three parameters. For more information see the
description of get_date();

Return Value:

Nothing.

See Also:

get_dow() get_date() set_time()

Example:

int d = 4;
int m = 7;
int y = 1987;

set_date(d,m,y); /* Fourth of July, 1987. */



set_drive
Summary:

void set_drive(x);
int x; /* Drive Numer to Set to */

Created: 04/06/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: SETDRIVE.ASM

Requires: Nothing.

Description:

This function sets the current drive to the number specified by
x. For an explanation of numbering conventions, see get_drive().

See Also:

get_drive() num_drives()

Example:

if ( num_drives() != 1 ) /* If we have more then 2 logical */
set_drive(2); /* Make the current the first HD, C: */
else
set_drive(0); /* Else make it A: */



set_mode
Summary:

#include "csrmodes.h" /* For Declarations Only */

void set_mode(x);
int x; /* Video Mode to Set to */

Created: 05/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: SETMODE.ASM

Requires: Nothing.

Description:

This function sets the video mode as specified in x. Please see
CSRMODES.H for a description of these modes.

See Also:

get_mode()

Example:

#include

set_mode(CO80); /* 80 Columns - Color */



set_time
Summary:

void set_time(hr,mn,sc,hn);
int hr; /* Hour */
int mn; /* Minutes */
int sc; /* Seconds */
int hn; /* Hundredths */

Created: 03/31/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: SET_TIME.C

Requires: intdos()

Description:

This routine uses DOS to set the current time as specified. For
more information see the description of get_time().

See Also:

get_dow() set_date() get_time()

Example:

int h = 3;
int m = 15;
int s = 0;
int hn = 0;

set_time(h,m,s,hn); /* Set the time to 3:15am. */



sn_date
Summary:

unsigned int sn_date(sn,m,d,y);
unsigned int sn; /* Serial Number to Convert to Date */
int *m; /* Location to Store Month */
int *d; /* Location to Store Day */
int *y; /* Location to Store Year */

Created: 09/01/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRDATE.C

Requires: isleap()

Description:

This routine will turn serial numbers created by date_sn() into
dates.

Return Value:

Returns a zero if the serial number is invalid, else returns a
one.

See Also:

date_sn() valid_date() isleap() dt_diff()

Example:

int m;
int d;
int y;
int sn;

sn = date_sn(12,25,86); /* Convert to serial number. */

/* . . . Modify/Manipulate Serial Number . . . */

sn_date(sn,&m,&d,&y); /* Convert back to date. */



sndout
Summary:

void sndout(void);

Created: 07/02/87 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRSOUND.C

Requires: Nothing.

Description:

This is the function used internally to process the timer
interrupt for background sound when it is trapped by sndsetint().
It increments a timer tick count and decides whether or not to
start or stop a note as it is playing.

There is no need to use it apart from its related routines.

See Also:

sound() sndsetint() sndrstint()

Example:

/**** Internal Use Only ****/



sndsetint
Summary:

void sndsetint(void);

Created: 07/02/87 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRSHND.ASM

Requires: Nothing.

Description:

This function stores the current timer interrupt handler and sets
it to an internal routine that calls sndout() and then the old
handler. No initialization of the background sound routines is
done.

See Also:

sound() sndout() sndrstint()

Example:

/**** Internal Use Only ****/



sndrstint
Summary:

void sndrstint(void);

Created: 07/02/87 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRSHND.ASM

Requires: Nothing.

Description:

This function removes from the chain of timer interrupt handlers
CSR's background sound routines and replaces the previous
handler. This function MUST be called before a program exits.
(The sound_done() function calls this function in addition to
cleaning up internal variables. One of these two must be
called. It is recommended that a control-break handler is
installed to either call this function or one that will.)

See Also:

sound() sndout() sndsetint() sound_done()

Example:

static int cbflag = 0;

cbcapt(&cbflag); /* Set Flag for Ctrl-Break */

sound_init(); /* Initialize Sound */

while ( 1 )
{
/* Run Program Code - Break When Done */
if ( cbflag ) /* If Control-Break Occured */
{
sndrstint(); /* Restore Timer Handler */
exit(1); /* Exit Program */
}
}
sndrstint(); /* Restore After Execution */
exit(0); /* Program Exits Normally */



sound
Summary:

#include "csrsound.h"

void sound(tone,duration);
long tone; /* Frequency in MegaHertz x 100 */
long duration; /* Length in Milliseconds */

Created: 05/12/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRSOUND.C

Requires: Nothing.

Description:

This function will put the specified note into the buffer and
return, when in background mode, or play the note and return.
(See the 'Sound' description of related routines in the beginning
of this documentation.) If sound is in background mode and the
buffer is full it will wait until there is room before placing
the note in the buffer.

The tone variable must hold the frequency to be output multiplied
by 100. (Previous versions of sound worked with the actual
frequency.) The duration is the length of the note in
milliseconds, and should be reasonably accurate on all processors
and in both modes.

See Also:

sound_init() play() beep() setbeep()

Example:

#include

sound(C,5000L);
sound(D,2500L);
sound(E,1250L);



sound_done
Summary:

void sound_done(void);

Created: 07/02/87 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRSOUND.C

Requires: sndrstint() spkr_off()

Description:

This function calls sndrstint() to restore the timer interrupt
(which MUST be done before any program using background sound
exits) and turns off the speaker in case it was left on.

See Also:

sound() sound_init() sndsetint() sndrstint() play()

Example:

sound_init();
/* Play something.... */
sound_done();



sound_init
Summary:

void sound_init(void);

Created: 07/02/87 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRSOUND.C

Requires: sndsetint()

Description:

This function calls sndsetint() to trap the timer interrupt and
sets up the sound routine to play notes in the background. When
this function is called all subsequent calls to sound() will
cause the notes to be played in background.

NOTE: This function has been disabled in Version 3.0 of C Spot
Run. Foreground sound is the only type currently supported.

See Also:

sound() sound_done() sndsetint() sndrstint() play()

Example:

sound_init();
/* Play something.... */
sound_done();



sound_left
Summary:

int sound_left(void);

Created: 07/02/87 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRSOUND.C

Requires: Nothing.

Description:

This function returns the number of notes remaining in the
background sound buffer.

Return Value:

The number of notes in the background sound buffer.

See Also:

sound() sound_init() sound_quiet() play() sound_done()

Example:

sound_init();
/* Play something.... */
wait_hs(500); /* Wait 5 Seconds */
if ( sound_left() ) /* If Sound Remains */
sound_quiet(); /* Kill It */
/* Go on with program.... */
sound_done();



sound_quiet
Summary:

void sound_quiet(void);

Created: 07/02/87 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRSOUND.C

Requires: spkr_off()

Description:

This function aborts all of the sound in the buffer, resets the
internal values, and turns off the speaker, but leaves the sound
in background mode.

See Also:

sound() sound_init() sound_left() play() sound_done()

Example:

sound_init();
/* Play something.... */
wait_hs(500); /* Wait 5 Seconds */
sound_quiet(); /* Kill Whatever is Left */
/* Go on with program.... */
sound_done();



soundex
Summary:

int soundex(name,code);
char *name; /* Name to Process */
char *code; /* String to Hold Code */

Created: 00/00/00 Last Updated: 07/12/88

Author: David Lovelock Source in: SOUNDEX.C

Requires: Nothing.

Description:

This routine will, for any given name of up to 40 characters in
length, return a code value representing it. This code value
will be the same as values for similar sounding names. The code
consists of the first letter of the name, followed by three
digits and a NULL.

Return Value:

If the string is to long or there is an error -1 is returned,
otherwise 0 is returned.

Example:

/* All should return an identical code. */

char code[5];

soundex("MacHew",code);
printf("MacHew: %s.\n",code);

soundex("MacKew",code);
printf("MacKew: %s.\n",code);

soundex("McQue",code);
printf("McQue: %s.\n",code);



spkr_freq
Summary:

void spkr_freq(tone);
long tone; /* Frequency x 100 to Set Speaker To */

Created: 07/02/87 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRSOUND.C

Requires: Nothing.

Description:

This function sets up the speaker for a frequency but does not
play the frequency. The spkr_on() function initiates the actual
sound.

See Also:

sound() sound_init() sndout() spkr_on() spkr_off()

Example:

/***** Used Internally by sndout() *****/



spkr_off
Summary:

void spkr_off(void);

Created: 07/02/87 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRSOUND.C

Requires: Nothing.

Description:

This function simply turns off the speaker, cutting short any
sound currently being made.

See Also:

sound() sound_init() sndout() spkr_on() spkr_freq()

Example:

/***** Used Internally by sndout() *****/



spkr_on
Summary:

void spkr_on(void);

Created: 07/02/87 Last Updated: 07/12/88

Author: Bob Pritchett Source in: CSRSOUND.C

Requires: Nothing.

Description:

This function turns on the speaker, causing it to play whatever
frequency it has loaded. (See spkr_freq().) The sound will
continue until spkr_off() is called.

See Also:

sound() sound_init() sndout() spkr_off() spkr_freq()

Example:

/***** Used Internally by sndout() *****/



start_tmr
Summary:

void start_tmr(x);
int x; /* The Number of the Counter to Use */

Created: 01/03/87 Last Updated: 07/12/88

Author: Dave Perras Source in: TIMERS.C TIMERS.C

Requires: get_timer()

Description:

This function will begin tracking the elapsed time using the
timer number given. This is done by reading and storing the
value of the real time clock.

See Also:

get_timer() stop_tmr() read_tmr() reset_tmr() zero_tmr() timer()
init_tmr()

Example:

init_tmr(); /* Initialize Timers */

start_tmr(2); /* Start timer number 2. */



stop_tmr
Summary:

unsigned stop_tmr(x);
int x; /* The Number of the Counter to Use */

Created: 01/03/87 Last Updated: 07/12/88

Author: Dave Perras Source in: TIMERS.C TIMERS.C

Requires: get_timer()

Description:

This function will first read the current setting of the real
time clock, determine the difference in tenths of seconds between
the stored and current time, and then zero the specified timer
and reset its active flag.

Return Value:

An unsigned value representing the tenths of seconds which have
elapsed since the start_tmr() function was called for this timer.
The maximum interval over which the timer is accurate is
determined by the size of an unsigned int, which for most
compilers results in an approximate limit of 1.8 hours.

See Also:

get_timer() start_tmr() read_tmr() reset_tmr() zero_tmr() timer()
init_tmr()

Example:

init_tmr(); /* Initialize Timers */

start_tmr(5); /* Start timer number 5. */

printf("%d seconds have elapsed.\n",10 * stop_tmr(5));



strcen
Summary:

char *strcen(string,result,width);
char *string; /* String to Center */
char *result; /* Where to Put It */
int width; /* Width to Center on */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: STRCEN.C

Requires: strtrm()

Description:

This routine places string into result with the appropriate
amount of preceding and trailing spaces. The length of result
will be width. Note that the string is trimmed (See strtrm().)
before it is centered, and that an uneven number of spaces on
each side results in the extra space being tagged to the end.

Return Value:

A pointer to the centered string is returned.

See Also:

strtrm() strlft() strght() center()

Example:

char temp[25];

strcen(" Centered ",temp,20);
printf("Centered String:\n 12345678901234567890\n>%s<\n",temp);

/* Results in > Centered < */



strght
Summary:

char *strght(string,result,width);
char *string; /* String to Right Justify */
char *result; /* Where to Put It */
int width; /* Width to Justify in */

Created: 09/07/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: STRGHT.C

Requires: strtrm()

Description:

This routine will right justify the given string, placing the
result in the specified variable. The string will be trimmed
with strtrm() before the justification.

Return Value:

A pointer to the justified string will be returned.

See Also:

strcen() strlft() strtrm()

Example:

char temp[25];

strght(" Right Just. ",temp,20);
printf("Justified String:\n 12345678901234567890\n>%s<\n",temp);

/* Results in > Right Just.< */



strlft
Summary:

char *strlft(string,result,width);
char *string; /* String to Left Justify */
char *result; /* Where to Put It */
int width; /* Width to Justify in */

Created: 09/07/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: STRLFT.C

Requires: strtrm()

Description:

This routine will left justify the given string, placing the
result in the specified variable. The string will be trimmed
with strtrm() before the justification.

Return Value:

A pointer to the justified string will be returned.

See Also:

strcen() strght() strtrm()

Example:

char temp[25];

strght(" Left Just. ",temp,20);
printf("Justified String:\n 12345678901234567890\n>%s<\n",temp);

/* Results in >Left Just. < */



strtrm
Summary:

int strtrm(string,result);
char *string; /* String to Trim */
char *result; /* Where to Put It */

Created: 09/07/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: STRTRM.C

Requires: Nothing.

Description:

This routine trims all preceding and trailing spaces from a
string, while preserving spaces inside the string.

Return Value:

The length of the new string.

See Also:

strcen() strght() strlft()

Example:

char temp[25];

strtrm(" Trim This. ",temp);
printf("Trimmed String:\n>%s<\n",temp);

/* Results in >Trim This.< */



timer
Summary:


int timer();

Created: 04/14/86 Last Updated: 07/12/88

Author: Unknown Source in: TIMER.C

Requires: int86()

Description:

This routine will return an integer representing the number of
clock ticks since the last call. Remember that there are about
18.2 ticks per second.

Return Value:

The number of ticks since last call.

Example:

timer(); /* Start count... */
routine();
printf("routine() took %d ticks to execute.\n",timer());



valid_date
Summary:

unsigned int valid_date(m,d,y);
int m; /* Month to Check */
int d; /* Day to Check */
int y; /* Year to Check */

Created: 09/01/86 Last Updated: 07/12/88

Author: George Roukas Source in: CSRDATE.C


Requires: isleap()

Description:

This function performs in a manner similar to that of chk_date()
with the exception that it verifies that the year is between 1900
and 2050, in order to be compatible with date_sn() and sn_date().

Return Value:

Evaluates as true if the date is valid, false if it is not.

See Also:

chk_date() date_sn() sn_date() isleap()

Example:

if ( valid_date(6,15,1791) ) /* Evaluates as False */
function();

if ( valid_date(6,15,1971) ) /* Evaluates as True */
otherwise();



vidblt
Summary:

int vidblt(ss,so,ds,do,x);
int ss; /* Segment Address of Source */
int so; /* Segment Offset of Source */
int ds; /* Segment Address of Destination */
int do; /* Segment Offset of Destination */
int x; /* Number of Bytes to Move */

Created: 00/00/85 Last Updated: 07/12/88

Author: Philip A. Mongelluzzo Source in: SNOWLESS.ASM

Requires: Uses _csrbit in COUTPUT.C to determine retrace mode.

Description:

This routine is similar to Microsoft's movedata() except that it
is used for moving data (with the same parameters) to and from
the color monitor memory without causing snow or flicker.

Return Value:

No return value.

Example:

/* Contact Bob Pritchett if you need to use it independantly. */



wactivate
Summary:

int wactivate(wind);
int wind; /* Pointer to Window to Activate */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This function activates the specified window. If the window is
overlayed by other windows it is brought out from behind and
becomes the active window, on top of the other and uncovered.

Return Value:

0 if successful, -1 if an invalid window pointer is specified.

See Also:

wclose() wopen()

Example:

wactivate(w3); /* Activate an opened window */



wait_hs
Summary:

int wait_hs(time);
int time; /* Hundredths of Seconds to Wait */

Created: 06/18/87 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WAIT_HS.C

Requires: get_time()

Description:

This function simply sits and waits for as many hundredths of a
second as specified. It is accurate to within the time it takes
get_time() to run. (If a key is hit during the delay, the delay
is aborted and the keystroke returned.)

Return Value:

Any key hit during the delay, or -1 if full delay endured.

Example:

if ( ( c = wait_hs(200) ) == -1 ) /* Wait 2 Seconds */
{
printf("Please Enter a Key!\n");
c = getch();
}



wblank
Summary:

void wblank(wind,row);
int wind; /* Pointer to Window to Use */
int row; /* Row to Clear */

Created: 04/30/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This function will erase the specified row within the specified
window by deleting then inserting that row. The cursor is place
at column 0 in this row.

See Also:


winsert() wdelete()

Example:

wblank(win,3);



wborder
Summary:

int wborder(num,type);
int num; /* Number of Window to Use */
int type; /* Type of Window Border to Use */

Created: 04/25/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This function redraws the border of a window, using whatever type
is specified, and the colors stored for this window. The most
useful purpose is to 'erase' wtitle() and wmessage() messages,
and to change the style of the border.

Return Value:

0 if successful, -1 if an invalid window is specified.

See Also:

wcolor()

Example:

wborder(win,4);



wcenter
Summary:

void wcenter(win,x,str);
int win; /* Window to Use */
int x; /* Line to Center on */
char *str; /* String to Center */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WCENTER.C

Requires: wgotoxy() wprint()

Description:

This routine is functionally the same as center() except that x
is a line within the specified window, and the string is centered
in window coordinates, not global. The window's inside color is
used.

See Also:

wcenterf() center()

Example:

wcenter(w3,5,"This is centered in window 3.");



wcenterf
Summary:

void wcenterf(win,x,str[,arguments...]);
int win; /* Window to Use */
int x; /* Line to Center on */
char *str; /* String to Center */

Created: 04/13/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WCENTERF.C

Requires: wgotoxy() wprint()

Description:

Just like centerf() only in the specified window.

See Also:

center() centerf() wcenter()

Example:

wcenterf(w3,5,"This is %s in window 3.","centered");



wclose
Summary:

int wclose(wind);
int wind; /* Pointer to Window to Close */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This function closes a video window previously opened with
wopen(). The portion of the screen that was covered with the
window is restored. NOTE: You may close a window other then the
active one, it will be acitivated and properly closed.

Return Value:

0 if successful, -1 if an invalid window is specified.

See Also:

wcloseall() wopen() wactivate()

Example:

int w;

w = wopen(10,10,20,70,2); /* Open a large window */

wclose(w); /* Restore covered screen area */



wcloseall
Summary:

void wcloseall();

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This function closes all the open windows by repeatedly calling
wclose(). The active window is closed first, and so on all the
way down the stack.

See Also:

wclose() wopen() wactivate()

Example:

int w;
int w2;


w = wopen(10,10,20,70,2); /* Open a large window */
w2 = wopen(5,5,17,54,3);

wcloseall(); /* Restore covered screen area */



wcls
Summary:

void wcls(num);
int num; /* Number of Window to Clear */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This routine will clear the specified window with it's current
interior attributes. If not active the cleared window will
become the foremost window.

See Also:

cls() ccls()

Example:

wcls(win); /* Clear window win. */



wcol
Summary:

int wcol(wind);
int wind; /* Pointer to Window to Use */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This function returns the number of the highest col in a window.
If a window has siz columns, numbered zero to five, wcol() will
return a five. Mostly an internal routine.

Return Value:

The number of the highest column in the window.

See Also:

wrow()

Example:

x = wcol(w3); /* Returns the number of highest row */



wcolor
Summary:

void wcolor(insd,bord);
int insd; /* Color For Window Interior */
int bord; /* Color For Window Border */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This routine sets the current colors for the inside and outside
of windows. These are the defaults used when a window is
created. The difference between color() and wcolor() primarily
is that color has two arguments, the fore and background colors,
and wcolor makes you add the fore and back into one number for
both the inside and border colors. Also, the color() function
sets both border and inside attributes to be the same, while
wcolor() allows them to be set to different values.

See Also:

color()

Example:

wcolor(WHT_F+BLU_B,BLU_F+WHT_F);
/* Inside is white on blue, border is blue on white. */



wdelete
Summary:

int wdelete(num,row,tms)
int num; /* Pointer to Window to Use */
int row; /* Row to Delete Line Before */
int tms; /* Number of Lines to Delete */

Created: 04/30/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This routine deletes tms lines starting with the line number in
row, and moves all lower lines up, making blanks at the bottom of
the window.

Return Value:

0 if successful, -1 if an invalid argument is given.

See Also:

winsert() wblank()

Example:

wdelete(win,2,4); /* Delete 4 line starting with line 2,
so line 6 becomes line 2 etc. */



wfbreakon
Summary:

#include "skey.h" /* Needed Only for Key Descriptions */

void wfbreakon(x);
int x; /* Special Key to Break On */

Created: 06/29/87 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WFINPUT.C

Requires: Nothing.

Description:

This function allows the programmer to set which special keys
will cause the wfinptstred() to exit. Each call to this function
adds the argument given to the list of break keys. (The #include
file SKEY.H contains easy definitions for the special keys.)
When given zero as an argument the list is cleared.

The default break keys are HOME, END, PGUP, PGDN, UARROW, DARROW,
ALTE, ALTX, and ALTQ.

See Also:

fbreakon() wfinptstred()

Example:

#include "skey.h"

char temp[30];

wfbreakon(0); /* Clear List */
wfbreakon(ALTH); /* Alt-H Only */

if ( wfinptstred(10,10,25,temp,"Default") == ALTH )
help();



wfchar
Summary:

int wfchar(chr);
int chr; /* Character to Use in Fields */

Created: 10/19/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WFINPUT.C

Requires: Nothing.

Description:

Behaving in a manner almost identical to that of fchar(), this
function will set the background character for window field
input, or, given an argument of -1, return the current value in
use. Note that this value is independant of the one used by
fchar(), although they both use the same default of the space
character.

Return Value:

Returns the argument, or in the case of the argument being -1,
the current value of the window field background character.

See Also:

fchar() wfcolor() wffill() finptint() finptstr()

Example:

int w;

wfchar('*'); /* Set background to *'s. */

w = wopen(10,0,20,79,3);

wprintf(w,"The current background character is: %c.\n"
,wfchar(-1));



wfcolor
Summary:

#include "color.h" /* For Color Defintions Only */

int wfcolor(clr);
int clr; /* Color to Use in Window Fields */

Created: 10/19/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WFINPUT.C

Requires: Nothing.

Description:

Behaving as does fcolor(), wfcolor() will set the field color for
window field input routines. This value is independant of the
one used by normal field routines, and the current value will be
returned if the argument is -1.

Return Value:

Returns the argument, or in the case of the argument being -1,
the current value of the window field color.

See Also:

fcolor() wfchar() wffill() wfinptint() wfinptstr()

Example:

#include "color.h"

wfcolor(BLU_F+WHT_B); /* Blue on white. */



wffill
Summary:

void wffill(w,rw,cl,mx);
int w; /* Window in Which to Draw Field */
int rw; /* Row of Field (Within Window) */
int cl; /* Column of Field (Within Window) */
int mx; /* Length of Field */

Created: 12/05/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WFINPUT.C

Requires: wgotoxy() cfield()

Description:

This function behaves similarly to ffill(), under whose heading
more information on the purpose of wffill() can be found.
Simply, the function uses the current window character and color
values to draw an input field in the specified window at the
coordinates given. (The row and column values are within the
window, not global.)

See Also:

ffill() wfchar() wfcolor() wfinptint() wfinptstr()

Example:

int w;

w = wopen(5,10,10,70,1);

wffill(w,10,20,10); /* At 10,20 a 10 character field. */

wputat(w,5,9,"Chrs: "); /* A prompt for the next field. */
wffill(w,5,15,6); /* At 5,15 a 6 character field. */
wgotoxy(w,5,15); /* Not needed, as wffill() leaves */
/* the cursor at the coordinates. */
ccputs("abc",fcolor(-1)); /* Put a default value on the */
/* screen with the field color. */



wfinptint
Summary:

int wfinptint(w,rw,cl,mx,x);
int w; /* Window to Use */
int rw; /* Row of Field */
int cl; /* Column of Field */
int mx; /* Length of Field */
int *x; /* Where to Put Result */

Created: 10/19/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WFINPUT.C

Requires: wgotoxy() cfield()

Description:

This function displays the specified field and then waits for
input of an integer just as does finptint(), under whose heading
a complete description can be found.

Return Value:

The integer inputted is returned.

See Also:

inptint() wfinptintd() finptint() wffill() wfinptstr()

Example:

int x;
int w;

w = wopen(2,2,20,78,3);

wputat(w,5,10,"Num: "); /* A prompt for the next field. */
wfinptint(w,5,15,6,&x); /* At 5,15 a 6 character input. */

wprintf(w,"\n\n%d was the input.\n",x);



wfinptintd
Summary:

int wfinptintd(w,rw,cl,mx,x,d);
int w; /* Window to Use */
int rw; /* Row of Field */
int cl; /* Column of Field */
int mx; /* Length of Field */
int *x; /* Where to Put Result */
int d; /* Default Integer */

Created: 10/19/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WFINPUT.C

Requires: wgotoxy() cfield()

Description:

This function, which waits for input in a window field after
displaying a default value, behaves like finptintd(), where more
information can be found on its operation.

Return Value:

The integer inputted is returned, or, in the case of a carriage
return, the default.

See Also:

inptintd() wfinptint() finptintd() wffill() wfinptstr()

Example:

int x;
int w;

w = wopen(3,3,22,77,'*');

wputat(w,5,10,"Num: "); /* A prompt for the next field. */
wfinptintd(w,5,15,4,&x,37); /* At 5,15 a 4 character input. */

if ( x == 37 )
wprintf(w,"\n\nThe default, 37, was returned.\n");
else
wprintf(w,"\n\n%d was the input.\n",x);



wfinptintr
Summary:

int wfinptintr(w,rw,cl,mx,x,lw,hg);
int w; /* Window to Use */
int rw; /* Row of Field */
int cl; /* Column of Field */
int mx; /* Length of Field */
int *x; /* Where to Put Result */
int lw; /* Minimum Acceptable Value */
int hg; /* Maximum Acceptable Value */

Created: 10/19/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WFINPUT.C

Requires: wfinptint()

Description:

This function, with the exception that it works within windows,
will act like finptintr(), waiting for an integer within its
specified range. All other input will cause the function to beep
and wait.

Return Value:

The inputted integer, within the range, is returned.

See Also:

inptintr() wfinptint() finptintr() wffill() wfinptstr()
wfinptintrd()

Example:

int x;
int w;

w = wopen(1,1,23,78,'#');

wputat(w,5,10,"Num: "); /* A prompt for the next field. */
wfinptintr(w,5,15,4,&x,3,10);/* At 5,15 a 4 character input */
/* greater than 2 and less than */
/* ten. */



wfinptintrd
Summary:

int wfinptintrd(w,rw,cl,mx,x,lw,hg,d);
int w; /* Window to Use */
int rw; /* Row of Field */
int cl; /* Column of Field */
int mx; /* Length of Field */
int *x; /* Where to Put Result */
int lw; /* Minimum Acceptable Value */
int hg; /* Maximum Acceptable Value */
int d; /* Default Value */

Created: 10/19/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WFINPUT.C

Requires: wfinptintd()

Description:

This function behaves as does finptintrd(), only within the
specified window. Remember that the function makes no check to
see if the default is within the specified range, and if it is
not it will not be returnable.

Return Value:

The inputted integer, within the range, is returned, or, in the
case of a carriage return as the first inputted character, the
default value.

See Also:

inptintr() wfinptintr() finptintrd() wffill() wfinptstr()
finptintr()

Example:

int x;
int w;

w = wopen(2,2,20,78,2);

wputat(w,5,10,"Num: "); /* A prompt for the next field. */
wfinptintrd(w,5,15,4,&x,3,10,5); /* At 5,15 a 4 character */
/* input greater than 2 and less */
/* than ten, or 5. */



wfinptstr
Summary:

char *wfinptstr(w,rw,cl,mx,str);
int w; /* Window to Use */
int rw; /* Row of Field */
int cl; /* Column of Field */
int mx; /* Length of Field */
char *str; /* Where to Place Input */

Created: 10/19/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WFINPUT.C

Requires: wgotoxy() cfield()

Description:

This function is the windowing equivalent of finptstr() and
performs just like it. See the description of finptstr() for
more information on this routine.

Return Value:

A pointer to a duplicate of the inputted string is returned, via
strdup().

See Also:

inptstr() finptstr() wfinptint() wffill() wfinptstr()
wfinptstrd()

Example:

char temp[80];
int w;

w = wopen(1,1,20,78,1);

wfinptstr(w,10,10,25,temp);



wfinptstrd
Summary:

char *wfinptstrd(w,rw,cl,mx,str,def);
int w; /* Window to Use */
int rw; /* Row of Field */
int cl; /* Column of Field */
int mx; /* Length of Field */
char *str; /* Where to Place Input */
char *def; /* Default String */

Created: 10/19/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WFINPUT.C

Requires: wgotoxy() cfield()

Description:

This function displays the specified field in the window along
with the default string. A string may be inputted or the default
returned in the same manner as with finptstrd().

Return Value:

A pointer to a duplicate of the inputted string, or the default,
is returned, via strdup().

See Also:

inptstrd() wfinptint() wfinptstred() ffill() finptstrd()
wfinptstre()

Example:

char temp[80];
int w;

w = wopen(10,10,20,70,4);

wfinptstrd(w,5,5,25,temp,"C Spot Run");



wfinptstre
Summary:

void wfinptstre(w,rw,cl,mx,str);
int w; /* Window to Use */
int rw; /* Row of Field */
int cl; /* Column of Field */
int mx; /* Length of Field */
char *str; /* Where to Place Input */

Created: 10/19/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WFINPUT.C

Requires: wfinptstred()

Description:

This function calls wfinptstred() with a null string as the
default argument. It will continue to do so until an input is
made.

See Also:

inptstr() finptstr() wfinptint() wffill() wfinptstr()
wfinptstred() finptstre()

Example:

char temp[80];
int w;

w = wopen(2,2,20,78,5);

wfinptstre(w,10,10,25,temp);

wprintf(w,"temp contains: >%s<\n");



wfinptstred
Summary:

int wfinptstred(w,rw,cl,mx,str,def);
int w; /* Window to Use */
int rw; /* Row of Field */
int cl; /* Column of Field */
int mx; /* Length of Field */
char *str; /* Where to Place Input */
char *def; /* Default String */

Created: 10/19/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WFINPUT.C

Requires: wgotoxy() cfield()

Description:

This function behaves as does finptstred() with the exception
that it works within a window. Due to the complexity of this
routine and the fact that it is functionally identical to
finptstred() the complete description is not repeated here.

Return Value:

A one is returned unless input was terminated by a special key,
in which case its value will be returned. (Special keys return a
null followed by an integer. The integer is returned here.)

See Also:

inptstr() wfinptint() wfinptstred() wffill() wfinptstr()
finptstred() wfbreakon()

Example:

char temp[80];
int x;
int w;

w = wopen(4,4,20,70,5);

x = wfinptstred(w,10,10,25,temp,"C Spot Run");

if ( x != 1 ) /* Special Value */
process(x); /* Process Key */



wfinptyn
Summary:

int wfinptyn(w,rw,cl);
int w; /* Window to Use */
int rw; /* Row of Field */
int cl; /* Column of Field */

Created: 10/19/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WFINPUT.C

Requires: wgotoxy() cfield()

Description:

This function behaves as does finptyn(), only within a window. A
description of how it functions is available under the finptyn()
heading.

Return Value:

A one or a zero for a 'Y' or an 'N'.

See Also:

inptyn() finptyn() wfinptint() wffill() wfinptstr() wfinptynd()

Example:

char temp[80];
int w;

w = wopen(1,1,23,78,' ');

wfinptyn(w,10,10);



wfinptynd
Summary:

int wfinptynd(w,rw,cl,def);
int w; /* Window to Use */
int rw; /* Row of Field */
int cl; /* Column of Field */
int def; /* Default Input */

Created: 10/19/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WFINPUT.C

Requires: wgotoxy() cfield()

Description:

This function behaves within a window in a manner similar to that
of finptynd(), where a complete description of the both functions
can be found.

Return Value:

A one or a zero for a 'Y' or an 'N', or whatever the default was.

See Also:

inptynd() finptynd() wfinptint() wffill() wfinptstr() wfinptyn()

Example:

char temp[80];
int w;

w = wopen(12,12,20,70,'+');

wfinptynd(w,10,10,1); /* Default to Yes */



wfreeze
Summary:

void wfreeze(num,top,bot);
int num; /* Pointer to Window to Use */
int top; /* First Scrollable Line */
int bot; /* Last Scrollable Line */

Created: 04/16/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This routine allows you to set the scrollable lines within a
window. When text a newline is printed on the last line inside a
window, the text scrolls up. This routine allows you to 'freeze'
a number of lines at the top and bottom of the window. The
numbers specified are the first and last scrollable lines, and
the default, full window, values are 0 and wrow(num).

No error checking is performed on the values.

The wcls() routine will only clear scrollable lines, and whome()
will home the cursor to the first character on the first
scrollable line. Reset the wfreeze() values to 0 and wrow(num)
to clear an entire window.

Example:

wfreeze(w2,2,wrow(w2)-3); /* Freeze lines 0-1 at top, and the
bottom three lines. */



wgotoxy
Summary:

void wgotoxy(num,row,col);
int num; /* Pointer to Window to Use */
int row; /* Row In Window to Go To */
int col; /* Col In Window to Go To */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This routine perfomrs the same function as gotoxy() within window
coordinates. Remember that as on the screen, window coordinates
start numbering at 0,0.

See Also:

gotoxy() whome()

Example:

wgotoxy(w1,2,4); /* Put cursor at 2,4 in window 1. */



whline
Summary:

void whline(wind,row);
int wind; /* Window to Draw in */
int row; /* Row to Draw Line on */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: chline()

Description:

This function calls chline() with the correct parameters to draw
a horizontal line in the specified window. The correct colors
and border styles are used.

See Also:

chline() wvline()

Example:

#include "color.h" /* Just for the colors... */

int w;

w = wopen(5,5,20,60,1); /* A box with a single line border */

whline(w,7); /* Draws a line across the box */



whome
Summary:

void whome(num);
int num; /* Pointer to Window to Use */

Created: 04/20/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This routine homes the cursor to the same coordinates as would be
used in a window clear with wcls(), the upper left scrollable
character in the specified window.

See Also:

gotoxy() wgotoxy()

Example:

wfreeze(w,3,wrow(num)); /* First three lines frozen. (0-2) */
whome(w); /* Cursor goes to 3,0. */



winptint
Summary:

int winptint(w,prompt);
int w; /* Window to Input Within */
char *prompt; /* Prompt for Input */

Created: 08/16/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WINPUT.C

Requires: Nothing.

Description:

This function performs the same function as inptint() only within
the specified window.

Return Value:

The integer inputted.

See Also:

inptint() winptintd() winptintr() winptintrd()

Example:

int w;

w = wopen(2,5,10,76,3);

wprintf(w,"winptint() returns: %d.\n"
,winptint(w,"Enter Integer:"));

/* The above function prompts "Enter Integer: " and then */
/* executes the wprintf statement. */



winptintd
Summary:

int winptintd(w,prompt,def);
int w; /* Window to Input Within */
char *prompt; /* Prompt for Input */
int def; /* Default Integer */

Created: 08/16/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WINPUT.C

Requires: Nothing.

Description:

This functions prompts and waits for an integer, or a carriage
return, in which case it returns the default integer. Refer to
inptintd() for details.

Return Value:

The integer inputted, or the default.

See Also:

inptintd() winptint() winptintr() winptintrd()

Example:

int w;

w = wopen(4,1,8,78,2);

wprintf(w,"winptintd() returns: %d.\n"
,winptintd(w,"Enter Integer:",7));

/* The above function prompts "Enter Integer: " and then */
/* executes the wprintf statement. */



winptintr
Summary:

int winptintr(w,prompt,low,high);
int w; /* Window to Input Within */
char *prompt; /* Prompt for Input */
int low; /* Lowest Acceptable Input */
int high; /* Highest Acceptable Input */

Created: 08/16/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WINPUT.C

Requires: Nothing.

Description:

Performing in the same manner as inptintr() this function prompts
for an integer within a range and waits until a valid one is
received. For details refer to inptintr().

Return Value:

The integer inputted, within the specified range.

See Also:

inptintr() winptint() winptintd() winptintrd()

Example:

int w;

w = wopen(1,1,20,78,1);

wprintf(w,"winptintr() returns: %d.\n",winptintr(w
,"Enter Integer:",5,62));

/* The above function prompts "Enter Integer: " and then */
/* executes the wprintf statement. The returned value */
/* will be greater than 4 and less than 63. */



winptintrd
Summary:

int winptintrd(w,prompt,low,high,def);
int w; /* Window to Input Within */
char *prompt; /* Prompt for Input */
int low; /* Lowest Acceptable Input */
int high; /* Highest Acceptable Input */
int def; /* Default Value */

Created: 08/16/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WINPUT.C

Requires: Nothing.

Description:

Behaving as does inptintrd() this function prompts within the
specified window with the default integer and waits until a
carriage return is hit, in which case the default is returned, or
an integer within the specified range is entered.

Return Value:

The integer inputted, or the default, within the specified range.

See Also:

inptintrd() winptint() winptintd() winptintr()

Example:

int w;

w = wopen(2,2,10,70,5);

wprintf(w,"winptintrd() returns: %d.\n"
,winptintrd(w,"Enter Integer:",8,50,30));

/* The above function prompts "Enter Integer: 30" and */
/* then executes the wprintf statement. The returned */
/* value will be greater than 7 and less than 51. */



winptstr
Summary:

char *winptstr(prompt);
int w; /* Window to Input Within */
char *prompt; /* Prompt for Input */

Created: 08/25/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WINPUT.C

Requires: Nothing.

Description:

This function is the window equivalent of inptstr(). It
functions in an identical manner with the exception that the
prompt and input are within the window.

Return Value:

The character string inputted.

See Also:

inptstr() winptstrd() wfinptstr() wfinptstrd() wfinptstre()
wfinptstred()

Example:

int w;

w = wopen(2,2,20,78,'*'); /* Border of *'s. */

wprintf(w,"Hello there, %s.\n",winptstr(w,"Your name?"));



winptstrd
Summary:

char *winptstrd(win,prompt,def);
int win; /* Window to Input Within */
char *prompt; /* Prompt for Input */
char *def; /* Default String */

Created: 08/25/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WINPUT.C

Requires: Nothing.

Description:

This function performs like winptstr() with the exception that it
prompts with a default string that is returned if a carriage
return is entered as the first keystroke. For more information
see inptstrd().

Return Value:

The character string inputted, or the default string.

See Also:

inptstrd() winptstr() wfinptstr() wfinptstrd() wfinptstre()
wfinptstred()

Example:

int w;

w = wopen(4,2,10,76,2);

wprintf(w,"Hello there, %s.\n"
,winptstrd(w,"Your name?","Robert"));



winptyn
Summary:

int winptyn(win,prompt);
int win; /* Window to Prompt Within */
char *prompt; /* Prompt for Input */

Created: 08/16/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WINPUT.C

Requires: Nothing.

Description:

This function behaves in the same manner as inptyn(), prompting
and waiting for a yes or no response.

Return Value:

A one or zero, dependent on the inputted character.

See Also:

inptyn() winptynd() wfinptyn() wfinptynd()

Example:

if ( winptyn(w,"Do you program microcomputers?") )
wprintf(w,"Oh, you do.");

/* Prompts 'Do you program microcomputers? (Y/N) ' */



winptynd
Summary:

int winptynd(win,prompt,x);
int win; /* Window to Input Within */
char *prompt; /* Prompt for Input */
int x; /* Default Answer */

Created: 08/16/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WINPUT.C

Requires: Nothing.

Description:

This function performs identically to winptyn() except that the
default response is the capital letter, and is returned if a
carriage return is entered.

Return Value:

A one or zero, dependent on the inputted character, or the
default.

See Also:

inptynd() winptyn() wfinptyn() wfinptynd()

Example:

if ( winptyn(w,"Do you program microcomputers?",1) )
wprintf(w,"Oh, you do.");

/* Prompts 'Do you program microcomputers? (Y/n) ' */



winsert
Summary:

int winsert(num,row,tms)
int num; /* Pointer to Window to Use */
int row; /* Row to Insert Line Before */
int tms; /* Number of Lines to Insert */

Created: 04/30/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This routine inserts tms lines before the specified line in the
specified window, scrolling all lines below down tms. The cursor
goes to the first column in the first new line.

Return Value:

0 if successful, -1 if an invalid argument is passed.

See Also:

wdelete() wblank()

Example:

winsert(win,3,2); /* Insert two lines before line 3,
new lines become 3 and 4, 3 becomes
line 5. */



wjump
Summary:

void wjump(wind,x,y);
int wind; /* Pointer to Window to Jump */
int x; /* Upper Right Row */
int y; /* Upper Right Col */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This function activates and moves the specified window to the x,y
coordinates given. The window instantly 'jumps', placing it's
upper right hand corner at x,y.

See Also:

wmove()

Example:

wjump(w2,10,10); /* Jumps window w2 to 10,10 */



wmessage
Summary:

void wmessage(win,str,val);
int win; /* Window to Use */
char *str; /* Message to Use */
int val; /* Message Location */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: wprint()

Description:

Using the window's border attribute, this function prints a
message to the user on the bottom border. For more information
see the description of wtitle().

See Also:

wtitle()

Example:

wmessage(w,"< Press a Key >",0);



wmove
Summary:

#include "csr.h" /* For Direction #defines */

void wmove(wind,dir);
int wind; /* Pointer to Window to Move */
int dir; /* Direction to Move Window */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This function will activate and move the specified window one
space in the direction given in dir. The dir value is a number
from one to four, up, right, down, and left, respectively.

See Also:

wjump()

Example:

#include "csr.h"

wmove(w2,WM_UP); /* Moves window w2 up one character */



wopen
Summary:

int wopen(x,y,x2,y2,type);
int x; /* Upper Left Row */
int y; /* Upper Left Col */
int x2; /* Lower Right Row */
int y2; /* Lower Right Col */
int type; /* Type of Border */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: cbox()

Description:

This function opens a video window. The current video attributes
are used, the portion of the screen covered is saved, and then
blanked with the interior color. The argument type may be of any
one of the valid types used by box() and cbox(), or it may be
zero, in which case the window is borderless.

Return Value:

Returns a type int value needed to reference the window at a
later time.

See Also:

wclose() wactivate()

Example:

int w;

w = wopen(10,10,20,70,2); /* Open a large window */



wprint
Summary:

int wprint(win,str);
int win; /* Window to Use */
char *str; /* String to Print */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: putchci()

Description:

Using the window's inside attributes, the string is printed at
the current cursor position within the specified window, which is
activated if it is not already so. The following escape
characters may be used:

\n Newline
\t Tab
\r Return
\f Form-Feed, clear window

Return Value:

0 if successful, -1 if an invalid window is specified.

See Also:

wprintf()

Example:

wprint(w3,"This line is outputted where the cursor is.\n");



wprintc
Summary:

void wprintc(win,str,clr);
int win; /* Window to Use */
char *str; /* String to Print */
int clr; /* Color to Print With */

Created: 07/09/87 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WPRINTC.C

Requires: wscolor() wprint()

Description:

This function sets the specified window's inside and border
colors to clr and prints the string. The colors are not reset.

See Also:

wprintf() wprint() wscolor()

Example:

wprintc(w3,"This line is output in red on white.\n",RED_F+WHT_B);



wprintf
Summary:

void wprintf(win,str,args...);
int win; /* Window to Use */
char *str; /* Formatted String to Print */
args... /* Formatting Arguments */

Created: 03/09/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WPRINTF.C

Requires: wprint()

Description:

This function supports the full formatting capabilities of the
regular printf() function, only it prints to the specified
window. A maximum of 15 formatting arguments may be included, it
is unlikely more should be needed.

See Also:

wprint()

Example:

wprintf(w2,"This is formatting... %03d %s.\n",38,"times");



wputat
Summary:

void wputat(win,x,y,string);
int win; /* Window to Use */
int x; /* Row to Print on */
int y; /* Column to Print at */
char *string; /* String to Print */

Created: 03/09/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WPUTAT.C

Requires: wgotoxy() wprint()

Description:

This routine will place the string in the window specified at the
coordinates specified. If not active the specified window will
be activated.

See Also:

putat()

Example:

wputat(win,4,5,"+ The plus sign is at 4,5 in window win.");



wputatf
Summary:

void wputatf(num,row,col,string,args...)
int num; /* Pointer to Window to Use */
int row; /* Row Coordinate */
int col; /* Col Coordinate */
char *string; /* Format String */
args... /* Formatting Arguments */

Created: 05/01/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: WPUTATF.C

Requires: Nothing.

Description:

This routine performs the same function as putatf() only within
the specified window.

See Also:

putatf() wputat() putat()

Example:

wputatf(win,4,6,"This line at %d,%d.",4,6);



wputchar
Summary:

void wputchar(num,c);
int num; /* Number of Window to Use */
int c; /* Character to Output in Window */

Created: 04/25/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This function simply outputs the character at the current
position of the specified window.

See Also:

wprint() wprintf()

Example:

wputchar(win,'\n');



wrow
Summary:

int wrow(wind);
int wind; /* Pointer to Window to Use */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This function returns the number of the highest row in a window.
If a window has four lines, numbered zero to three, wrow() will
return a three. Mostly an internal routine.

Return Value:

Returns the number of the highest row in the window.

See Also:

wcol()

Example:

x = wrow(w3); /* Returns the number of highest row */



wscolor
Summary:

#include "color.h" /* For Color Defintitions Only */

void wscolor(wind,insd,bord);
int wind; /* Pointer to Window to Use */
int insd; /* New Color For Window Insides */
int bord; /* New Color For Window Border */

Created: 09/14/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This function is the equivalent of wcolor() except that it has an
affect only on the specified window. It does not change the
current color of the windows, but rather all subsequent output in
that window.

See Also:

wcolor() wcolor()

Example:

#include "color.h"

int w;

wcolor(RED_F,BLU_F);

w = wopen(10,10,20,20,1);
wprint(w,"This is some output.\n"); /* In red. */
wscolor(w,GRN_F,WHT_F);
wprint(w,"This text is in green, and any border manipualtion\n");
wprint(w,"will be in white from now on, in this window.\n");



wscroll
Summary:

void wscroll(num,dir,tms)
int num; /* Number of Window to Use */
int dir; /* Direction to Scroll in */
int tms; /* Number of Lines to Scroll */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: Nothing.

Description:

This function will scroll the specified window tms lines in the
specified window. The direction is 0 for up, or 1 for down.
Specifying 0 lines will clear the window.

See Also:

scroll()

Example:

wscroll(win,0,1);



wtitle
Summary:

void wtitle(win,str,val);
int win; /* Window to Use */
char *str; /* Title to Use */
int val; /* Title Location */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: wprint()

Description:

This routine will place a string along the top border of the
specified window in either the center, on the left, or on the
right. To specify the location, val is 0, center, 1, left, or 2,
right. The window's border attribute is used.

See Also:

wmessage()

Example:

wtitle(w,"[ Window 1 ]",1);



wvline
Summary:

void wvline(wind,col);
int wind; /* Window to Use */
int col; /* Column for the Line */

Created: 03/03/86 Last Updated: 07/12/88

Author: Bob Pritchett Source in: COUTPUT.C

Requires: cvline() putchci() gotoxy()

Description:

This function calls cvline() with the correct parameters to draw
a vertical line in the specified window. The correct colors and
border styles are used.

See Also:

cvline() whline()

Example:

#include "color.h" /* Just for the colors... */

int w;

w = wopen(5,5,20,60,1); /* A box with a single line border */


wvline(w,10); /* Draws a line down the box */



zero_tmr
Summary:

void zero_tmr(x);
int x; /* The Number of the Counter to Use */

Created: 01/03/87 Last Updated: 07/12/88

Author: Dave Perras Source in: TIMERS.C

Requires: get_timer()

Description:

This function sets the specified timer to the current value of
the real time clock, effectively 'zeroing' the counter.

Return Value:

Nothing is returned.

See Also:

get_timer() start_tmr() stop_tmr() read_tmr() reset_tmr() timer()
init_tmr()

Example:

init_tmr(); /* Initialize Timers */

start_tmr(5); /* Start timer number 5. */

printf("%d seconds have elapsed.\n",10 * read_tmr(5));
/* The above statement does not stop the timer. */

zero_tmr(5); /* Zero the timer to the current */
/* time. */



CheckC
Summary:

Created: 12/25/85 Last Updated: 07/12/88

Author: Bob Pritchett Source: C

Syntax: CheckC [/A] [...]

Documentation:

CheckC

A Small C Code Checker.

Copyright 1985, 1986 Bob Pritchett
New Dimension Software

Version 2.1 - Documentation

CheckC has come quite some distance since version 1.3 was
released with the first version of C Spot Run. It now supports
an analysis mode with full error recovery, and is better
implemented over all.
CheckC started as a simple bracket counter type program,
checking to make sure brackets, quotes, etc, all were present in
even numbers. And the present time it can analyze a file and
report syntactical errors to, on average, within two lines, and
then recover in order to find any subsequent errors, assuming the
one just found was corrected.
CheckC may be invoked with as many file names as DOS allows,
and will check each one in order for matching pairs of all
relevant characters, quotes, and comments. The real power is
displayed when it is invoked with a /A as the first argument,
followed by the file names. In this case a rather comprehensive
(for a character oriented program) syntax check will be executed,
with errors and problem spots reported in the format of line
number followed by error description.
CheckC knows when to and when not to be checking syntax.
While in comments, everything but an end of comment is ignored.
(NOTE! CheckC does NOT allow for nested comments, in accordance
with K&R.) The same applies to quoted strings, with the added
contitions that CheckC is aware of when to ignore quotes (as in
escape sequences), and when they may be missing. (When a newline
is found in a quoted string a warning is generated indicating
that further analysis may be incorrect.) Single quotes are
processed under the rule that only one character is allowed
between them, the maximum physical characters being two in the
case of an escape sequence.
CheckC's analysis will sometimes refer to errors concerning
functions or blocks. CheckC refers to any code one bracket level
deep as a function, and any code several brackets deep as a
block. Unfortunatly, as you may open a virtually unlimited
number of blocks, a missing open bracket can only be detected
when the number of closing brackets exceeds the number of opening



ones. In such a case an error is noted, the missing character
assumed, and analysis continued. By noting funtion vs. block in
the error, and tracing structured code up from the line number,
the missing (or extra) bracket can easily be found.
Another way of finding mismatched characters as soon as
possible is looking for semicolons within them. Anytime a
semicolon is found within a set of parenthesis or square
brackets, chances are that there is a missing closing character
within a few lines of it. (Semicolons within for() statements
will not cause this error flag.)
If a comment is left open, causing the rest of the file to
go un-analyzed, a line number will be reported with the error at
when end of file is reached. This is the line on which last
found comment was opened, and from there the error should be
obvious.
On the whole, CheckC's errors are self explanatory, and in
all testing so far it has been perfectly accurate. It is much
more likely to report a few extra errors when recovery is not
complete then to miss any. Without the analysis mode it is
severly crippled, and it is recommended that you use the /A flag
with everything unless your code varies from K&R enough to cause
false errors.
I'd appreciate it if you could report any bugs or
suggestions, and let me know how you like it. Good luck!



FLine
Summary:

Created: 03/02/86 Last Updated: 07/12/88

Author: Bob Pritchett Source: C

Syntax: FLine

Documentation:

FLine

A Structured Programming Utility

Copyright 1986 Bob Pritchett
New Dimension Software

Version 1.1 - Documentation

FLine is a programming tool that goes through source code
and places all lines beginning with a non-whitespace character
into the specified output file. This creates a useful reference
file containing a list of all function declarations, including
arguments, global variables, comments, and pre-processor
directives. (This assumes, of course that you indent the actual
code within your source file.)
FLine is called as:

FLine

Where is the source code to process and is
the name of the file to place the output in. Note that whatever
is in is erased and replaced with FLine's output.



CSRSHELL.ASM
Summary:

Created: 09/10/86 Last Updated: 07/12/88

Author: Various

Documentation:

CSRShell.ASM is a small file that contains a complete shell
for writing assembly interfaces to Microsoft C. (In the planning
stages are additions for conditional assembly for other
compilers.) Things such as large and small model assembly,
argument reading, stack setup and more are included and
explained.
To make use of the shell, copy it into another appropriately
named file, insert the correct function name over _shell
(remember to preserve the underscore, MSC needs it), replace the
two dummy argument reads with your assembly source, and place
your data in the appropriate place.



COLOR.H
Summary:

Created: 04/14/86 Last Updated: 07/12/88

Author: Bob Pritchett

Description:

This include file contains the define statements for all the
color attributes possible in text. The colors are listed with a
three letter name followed by a _ and F or B signifying fore or
background attribute. To get a full attribute, add a fore and
background color. (BLU_F+RED_B)

Also included are definitions for BOLD (which is added to an
attribute to intensify it), NORMAL (white on black), and several
others. (NOTE: Some of the attriutes are for monochrome
displays only, for example, UNDERLINE shows as blue on a color
screen, and REVERSE as black on white.)

For a list of all the colors and their abbreviations look at the
header file.



CSR.H
Summary:

Created: 06/28/88 Last Updated: 07/12/88

Author: Bob Pritchett

Description:

This header file contains #defines to ease the use of certain
functions, such as scroll() and wmove(), by replacing numeric
arguments with readable values. (I.E. SCROLL_UP or WM_LEFT)

Additionally it autodetects the compiler and memory model,
mapping the Microsoft inp() and outp() to inportp() and
outportp() for Turbo C, and defining LARGE to 1 for the compact
and large memory models.

The CSRMENU.H file is included, and all of the C Spot Run
functions are prototyped to provide more reliable syntax checking
at compile time.



CSRDOS.H
Summary:

Created: 04/04/86 Last Updated: 07/12/88

Author: Bob Pritchett and Alan Losoff

Description:

This header file contains structures and #define statements
needed by functions accessing DOS 2.0 functions.



CSRMENU.H
Summary:

Created: 08/08/86 Last Updated: 07/12/88

Author: Bob Pritchett

Description:

This header file contains the typdef statement to create the MENU
data type needed for the function pmenu(). The structure is as
follows:

typedef struct _mnu
{
char title[23]; /* Title of the menu */
int type; /* Style of the border */
int border; /* Window's border color */
int normal; /* Color for unhighlighted items */
int bar; /* Color for the highlight bar */
int row; /* Upper left window row */
int col; /* Upper left window column */
int num; /* Number of enteries */
struct _ent
{
char text[25]; /* Item's name */
int value; /* Return value for item / -1 Static */
} entry[MAX_ENTRIES];
} *MENU;



CSRMISC.H
Summary:

Created: 04/20/86 Last Updated: 07/12/88

Author: Bob Pritchett

Description:

This header file contains dummy(), iswild(), and the defintions
for the min() and max() macros which were ommitted from
Microsoft's standard library.



CSRMODES.H
Summary:

Created: 05/05/86 Last Updated: 07/12/88

Author: Bob Pritchett

Description:

This header file contains define statements for the different
video modes. It is intended to be used with set_mode().



CSRSOUND.H
Summary:

Created: 08/07/86 Last Updated: 07/12/88

Author: Bob Pritchett (Data from Norton's Book.)

This header file contains note definitions for use with the
sound() routine in CSRSOUND.C.



CSRTIME.H
Summary:

Created: 05/05/86 Last Updated: 07/12/88

Author: Bob Pritchett

This file contains two static char * arrays containing the names
of the days of the week and the days of the month. The days of
the week start with Sunday, the months start with a null and then
January as the second entry, element one, to allow compatibility
with the way DOS returns the date.



ERRORS.H
Summary:

Created: 05/05/86 Last Updated: 07/12/88

Author: Bob Pritchett (Data from Norton's Book.)

This file contains a static char * array containing the DOS
errors returned in AX after a DOS function call. These errors
are for DOS 2.X alone, and do not apply to DOS 3.X extended error
codes. Error descriptions start with element one.



SKEY.H
Summary:

Created: 02/22/86 Last Updated: 07/12/88

Author: Bob Pritchett (Data from Norton's Book.)

Description:

This header file contains #define statements for all of the
special keys and combinations on the keyboard. These values are
those returned as extened codes, after a null is read. They are
in the basic format of KEY1KEY2, or simply Fx for function keys.
(Note: Function keys are numbered through 40, 1-10 are normal
keys, 11-20 are shift keys, 21-30 are ctrl keys, and 31-40 are
alt keys. As in: Shift-F2 returns F12.)
C Spot Run - Documentation


Appendix A - Updating the Library

The C Spot Run routine library is constantly being added to
as we receive contributions and write more routines ourselves.
In the interest of saving time and space, library updates will
come in one of two forms.
First, small collections of new routines, or single
routines, will be placed in archives along with a single page of
documentation and distributed via BBSs. Registered users will
receive information about new updates or a copy of those updates.
When you receive an update archive you simply place the files
into your library or linking directory and print out the
documentation page, which is then inserted in alphabetical order
into the library description section of this manual. (This is
why those pages are not numbered and we recommend storing your
manual in a three ring binder.)
Second, major updates to the entire library will be
distributed in archives containing all the routines, and a
totally new version of the complete manual. These updates will
be on new version numbers.
To keep on top of changes to the library it is suggested
that you read issues of the NDS News Newsletter as it is
released, and make an occasional call to the support BBS where
the latest version of the library and newsletter are always
available.
C Spot Run - Documentation


Appendix B - Contacting the Author

Please feel free to contact me regarding C Spot Run or other
NDS products. As a shareware author I enjoy hearing from users
and am happy to try and assist you with any problems that you may
encounter when using CSR.

If you should need to contact the author of a particular
routine or function please leave a message to me on the BBS or
call voice and I can help put you in touch with him or her.

Bob Pritchett (609) 424-2595 - Voice
23 Pawtucket Drive (609) 354-9259 - Data (300-2400B)
Cherry Hill, NJ 08003 SEAdog/FidoNet: 107/414
C Spot Run - Documentation


Appendix C - Submitting Routines or Utilities

All submissions to the routine library or utility collection
should be made using the Routine/Utility Submission Form, and
should be sent to the address on that form. Please do not make
additions to the library or utility collection on your own, this
creates a problem and complicates the distribution.
In addition to the following form please enclose a
description of the routine or utility, preferably on an IBM PC
disk (360K or 1.2Meg). Please make this description in the
appropriate format as specified in sections 4.1 and 4.2 of this
manual.
C Spot Run - Documentation


Appendix D - History of Versions and Changes

07/12/88 - Version 3.0 released with support for the
Microsoft QuickC 1.01, MSC 5.1, and Borland Turbo C 1.5
compilers. Volume 3 Number 1 of the NDS News distributed to users
and the NDS Mailing List.

07/12/87 - Version 2.1 released with bug fixes, new
routines, Turbo C support, and a new version of the newsletter.
Available complete (CSR21.ARC) and as an update to Version 2.0.
(CSRUPDT2.ARC)

06/02/87 - Preliminary Version 2.0 support for Turbo C
released.

01/15/87 - Version 2.0A replaces 2.0, which was missing
CheckC and FLine programs.

01/10/87 - Version 2.0 of the library released with new
features and a new newsletter.

10/13/86 - Limited release of version 1.1 of the library to
some registered users. Most bugs fixed, manual updated, new
routines.

06/27/86 - First issue of the newsletter released.

05/05/86 - Version 1.0 of the library released.

03/03/86 - Coding of Windowing routines begun.
C Spot Run - Documentation


Appendix E - ASCII Table

Dec Hex Chr Dec Hex Chr Dec Hex Chr
--- --- --- --- --- --- --- --- ---
0 00 NUL 43 2B + 86 56 V
1 01 SOH 44 2C , 87 57 W
2 02 STX 45 2D - 88 58 X
3 03 ETX 46 2E . 89 59 Y
4 04 EOT 47 2F / 90 5A Z
5 05 ENQ 48 30 0 91 5B [
6 06 ACK 49 31 1 92 5C \
7 07 BEL 50 32 2 93 5D ]
8 08 BS 51 33 3 94 5E ^
9 09 HT 52 34 4 95 5F _
10 0A LF 53 35 5 96 60 `
11 0B VT 54 36 6 97 61 a
12 0C FF 55 37 7 98 62 b
13 0D CR 56 38 8 99 63 c
14 0E SO 57 39 9 100 64 d
15 0F SI 58 3A : 101 65 e
16 10 DLE 59 3B ; 102 66 f
17 11 DC1 60 3C < 103 67 g
18 12 DC2 61 3D = 104 68 h
19 13 DC3 62 3E > 105 69 i
20 14 DC4 63 3F ? 106 6A j
21 15 NAK 64 40 @ 107 6B k
22 16 SYN 65 41 A 108 6C l
23 17 ETB 66 42 B 109 6D m
24 18 CAN 67 43 C 110 6E n
25 19 EM 68 44 D 111 6F o
26 1A SUB 69 45 E 112 70 p
27 1B ESC 70 46 F 113 71 q
28 1C FS 71 47 G 114 72 r
29 1D GS 72 48 H 115 73 s
30 1E RS 73 49 I 116 74 t
31 1F US 74 4A J 117 75 u
32 20 75 4B K 118 76 v
33 21 ! 76 4C L 119 77 w
34 22 " 77 4D M 120 78 x
35 23 # 78 4E N 121 79 y
36 24 $ 79 4F O 122 7A z
37 25 % 80 50 P 123 7B {
38 26 & 81 51 Q 124 7C |
39 27 ' 82 52 R 125 7D }
40 28 ( 83 53 S 126 7E ~
41 29 ) 84 54 T 127 7F DEL
42 2A * 85 55 U
C Spot Run - Documentation


Appendix F - Window Border Styles


Type 0

Borderless window.

Type 1 Type 2

+--------+ +========+
| | | |
+--------+ :========:
| | | |
+--------+ +========+


Type 3 Type 4

++======++ ++------++
|| || || ||
|:======:| |+------+|
|| || || ||
++======++ ++------++


Type 5

The actual plus and minus characters will
be used, resulting in a display identical to
the non graphic representation of type number 1.


Any Other Character

If any other character is used as the type
argument, that character will be used for the border.
C Spot Run - Documentation


Quick Reference Chart

Control-Break Routines
----------------------------------------
cbcapt() cbrest()

Cursor Control Routines
----------------------------------------
current_page() cursor_off() cursor_on() cursor_read()
cursor_size() gotoxy() restore_cursor()
save_cursor()

Date Manipulation Routines
----------------------------------------
chk_date() date_sn() day_of_year() dt_diff()
isleap() month_day() sn_date() valid_date()

Disk Drive Routines
----------------------------------------
dirwin() ffirst() fnext() get_drive()
num_drives() set_drive()

Field Input Routines
----------------------------------------
cfield() fbreakon() fchar() fcolor()
ffill() finptint() finptintd() finptintr()
finptintrd() finptstr() finptstrd() finptstre()
finptstred() finptyn() finptynd()

Graphics Routines
----------------------------------------
gback() gbox() gcircle() gdot()
gfbox() ginit() gline() gpal()

Input Routines
----------------------------------------
inptint() inptintd() inptintr() inptintrd()
inptstr() inptstrd() inptyn() inptynd()

Menu Routines
----------------------------------------
pmclose() pmcolor() pmfunc() pmopen()
pmrun()

Miscellaneous Routines
----------------------------------------
beep() dosver() getpw() istemplate()
itofa() ltofa() mcolor() setbeep()
soundex() wait_hs()

Printer Routines
----------------------------------------
lprint() lprintf() lputchar() print_screen()
prtrns()
C Spot Run - Documentation


Screen Control and Output Routines
----------------------------------------
border() box() cbox() ccenter()
ccls() ccputs() center() centerf()
cfield() chline() clreol() cls()
cvline() message() mscroll() pmenu()
pop_menu() putat() putatf() putchc()
putchci() restore() restore_screen()
save() save_screen() scroll() set_mode()
vidblt()

Sound Routines
----------------------------------------
play() sndout() sndrstint() sndsetint()
sound() sound_done() sound_init() sound_left()
sound_quiet() spkr_freq() spkr_off() spkr_on()

String Routines
----------------------------------------
match() soundex() strcen() strght()
strlft() strtrm()

System Clock Routines
----------------------------------------
get_date() get_dow() get_time() set_date()
set_time()

Timer Routines
----------------------------------------
get_timer() init_tmr() read_tmr() reset_tmr()
start_tmr() stop_tmr() timer() zero_tmr()

Window Routines
----------------------------------------
cmenu() color() dma() fixcolor()
retrace() wactivate() wblank() wborder()
wcenter() wcenterf() wclose() wcloseall()
wcls() wcol() wcolor() wdelete()
wfreeze() wgotoxy() whline() whome()
winsert() wjump() wmessage() wmove()
wopen() wprint() wprintc() wprintf()
wputat() wputatf() wputchar() wrow()
wscolor() wscroll() wtitle() wvline()

Window Field Input Routines
----------------------------------------
wfbreakon() wfchar() wfcolor() wffill()
wfinptint() wfinptintd() wfinptintr() wfinptintrd()
wfinptstr() wfinptstrd() wfinptstre() wfinptstred()
wfinptyn() wfinptynd()

Window Input Routines
----------------------------------------
winptint() winptintd() winptintr() winptintrd()
winptstr() winptstrd() winptyn() winptynd()
C Spot Run - Documentation


Commonly Asked Questions and Answers

What follows is a collection of some of the most commonly
asked questions and their answers. If you don't find the answer
to your particular problem here, please feel free to call.

Q: I want to use C Spot Run in an application I'm writing
to sell commercially. What do I need to do?

A: You need to obtain a commercial license for C Spot Run,
which costs $75, and comply with the simple terms in the CSR
commercial usage license. (Section 2.5 of this manual.)


Q: I want to use C Spot Run for an internal project at my
company. Does this constitute commercial use?

A: Yes. Any use by a commercial organization whether for a
marketed product or an internal project constitutes commercial
use. Individuals and non-profit organizations are the only users
who qualify for a personal license.


Q: I need a large model version of the library. Where can
I get it?

A: The source code comes with a make file that allows users
to quickly recompile the source code for any memory model with
both Microsoft C/QuickC and Turbo C.


Q: I use another C compiler; is there a CSR version for it?

A: C Spot Run currently supports only the Microsoft and
Borland compilers. However you may find that your compiler links
with Microsoft or Borland libraries, or you may wish to purchase
the source code and recompile the library. (The source code is
very compiler independent.) If enough requests are made on the
behalf of a particular compiler CSR support may be extended to
it.



Routine/Utility Submission Form


Name of Routine/Utility: ___________________________________

Form(s) of Submission (C/ASM/OBJ/LIB/EXE/COM): _____________


Are you releasing this routine/utility to the Pubic Domain

or under another program? (PD/Program): ___________________


If this release is under a voluntary contribution program,

what is the suggested contribution? ($): ___________________


May we put your address in the author directory? (Y/N): ____

Your phone number? (Y/N): ____

Your data address? (Y/N): ____


Name: _________________________________

Address: _________________________________

City: _____________________ State: ____ ZIP: _________

Phone: ( ) - Hours: ____________________

Source ID: _______________ CompuServe ID: _________________

Data #: ( ) - Hours: ____________________

Fido Net: ____ /_____ Baud: ____________________

In submitting this form you place your routine or utility
into the C Spot Run C Add-on and Utility Library, and give
permission for it's use as specified in Appendix C and
sections one and two of this manual.

Please send this form via US Mail to the following address,
or via modem to the accompanying FidoNet address.

Don't forget the description sheets, and of course the files
you are submitting!

C Spot Run
New Dimension Software FidoNet 107/414
23 Pawtucket Drive Data: (609) 354-9259
Cherry Hill, NJ 08003



User Response Form - V3.0


We would like to hear from you, and would appreciate any
comments, suggestions, and/or donations. Even if you are not
making a donation or contributing to the library, we would
appreciate some input, and it helps us to know if the library is
serving it's intended purpose, and gives us some information on
our users. Of course this is voluntary, but we hope you will
take the time to fill out and mail this form.

How did you obtain your copy of C Spot Run? ________________

____________________________________________________________


What, in your opinion, are the most useful routines and

utilities? _________________________________________________


What do you think of the documentation? ____________________

____________________________________________________________


Are you enclosing a contribution, and if so, how much and

why? _______________________________________________________


Do you have any comments and/or suggestions? _______________

____________________________________________________________

____________________________________________________________


Would you like to be on the NDS mailing list? (Y/N) _____


Name: ________________________________________

Company: ________________________________________

Address: ________________________________________

City: _____________________ State: ____ ZIP: _________

Phone: ( ) - Hours: ____________________

Data #: ( ) - Hours: ____________________

Baud: ____________________




Thank you, we hope you find the C Spot Run library of use.

Please send this form via US Mail to the following address,
or via modem to the accompanying FidoNet address.


C Spot Run
New Dimension Software FidoNet 107/414
23 Pawtucket Drive Data: (609) 354-9259
Cherry Hill, NJ 08003



Order Form - V3.0

NOTE: Users who receive source code may not redistribute
it. The code is for your use only, and the right to redistribute
is not included in the purchase. If two or more people will be
using the source, rather then ordering just one copy please
contact the author about a discount on several copies.
(International Users: Please make payment in U.S. dollars.)


( ) I would like to register as a C Spot Run User, receive
complete source code on disk, update notifications, and be placed
on whatever mailing list may be formed. I am enclosing $50.

( ) I would like to register as a C Spot Run user with a
commercial license, receiving all the benefits of full
registration with permission to use C Spot Run commercially under
the conditions set forth in section 2.5. I am enclosing $75.

( ) I would like to register as a C Spot Run User and
receive all the benfits of such status with the exception of the
source code. I am enclosing $15.


Name: ________________________________________

Company: ________________________________________

Address: ________________________________________

City: _____________________ State: ____ ZIP: _________

Phone: ( ) - Hours: ____________________

Data #: ( ) - Hours: ____________________

Baud: ____________________


C Spot Run
New Dimension Software Voice: (609) 424-2595
23 Pawtucket Drive Data: (609) 354-9259
Cherry Hill, NJ 08003



+-------------------- NDS USE ONLY --------------------+
| |
| Recieved: ____ /____ /____ Sent: ____ /____ /____ |
| |
| Serial Number: ________________ |
| |
+--------------------------------------------------------+




 December 19, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)