.TH "Programming COHERENT" "" "" "Overview"
.PC
.PP
The C language is the ``native language'' of \*(CO.
Most \*(CO programs are written in C.
.PP
If you are a beginner and are interested in learning something about C,
look at the tutorial
.I "The C Language"
in the first part of this manual.
.PP
The following Lexicon entries give you information you need to write or
port C programs under \*(CO:
.IP "\fBC keywords\fR"
This lists the C keywords recognized by the \*(CO implementation of C.
Each keyword, in turn, is described in full in its own Lexicon entry.
.IP "\fBC language\fR"
This summarizes the \*(CO implementation of C.
It gives the size of each data type, formatting of floating-point data,
static limits, and other information.
.IP "\fBC preprocessor\fR"
This describes the processing directives that the \*(CO preprocessor
recognizes.
Each directive is described in full in its own Lexicon entry
.IP "\fBheader files\fR"
This entry names the header files included as part of \*(CO.
Each header file is described in its own Lexicon entry.
Some of the header-file articles are of particular interest.
.IP "\fBlibraries\fR"
This describes the libraries included with \*(CO.
Almost every library function and system call has its own Lexicon entry;
the only exceptions are the routines kept in
.B libmisc.a
and
.BR libcurses.a .
Each library has its own summary entry; of particular interest are the
entries
.BR libc ,
.BR libm ,
.BR libgdbm ,
and
.BR libsocket .
.PP
If you are an experienced C programmer who is new to \*(CO, we suggest
you look first at the article for
.BR "C language" ,
to get an overview of the dialect of C that \*(CO supports.
Look at the entry for libraries, to see what libraries are available;
then look at the entry for each library to see what functions are available.
.PP
The following Lexicon entries describe the commands with which you can
compile and manage your programs:
.IP \fBar\fR
The archiver.
This turns a group of object modules into a library.
.IP \fBas\fR
The \*(CO macro-assembler.
This assembles modules written in assembly language, and builds object
modules that you can link with modules written in C or other languages.
.IP \fBcc\fR
The C compiler.
This describes the compiler itself, and its options and switches.
.IP \fBcpp\fR
The C preprocessor.
The preprocessor itself has its own options to help you control the
building of your programs.
.IP \fBdb\fR
The symbolic debugger.
With
.BR db ,
you can set breakpoints, single-step through code, hot-patch binaries,
and otherwise debug your programs.
It requires knowledge of 80386 assembly language.
.IP \fBld\fR
The linker.
This links object modules into an executable binary.
The Lexicon entry describes its switches and features.
.IP \fBmake\fR
The programming discipline.
.B make
helps you to manage the building of a complex program.
It is indespensible for managing all but the simplest programming projects.
.IP \fBnm\fR
This utility prints the contents of a program's symbol table.
.IP \fBsh\fR
The Bourne shell.
This is of the \*(CO command interpreter.
You can write large, complex programs in the shell.
These can functions, and draw on a library of prewritten functions.
The shell is one of the most powerful tools available to a \*(CO
programmer \(em and one of the most neglected.
.IP \fBstrip\fR
Strip the symbol table from a program.
This makes most programs significantly smaller, with no loss
in functionality.
.PP
Each command is described in its own Lexicon entry.
.SH "Definitions"
The following Lexicon entries give technical definitions of interest
to programmers:
.IP "\fBaddress\fR"
What an ``address'' is.
.IP "\fBalignment\fR"
What byte alignment is, and how it applies under the various machine
on which \*(CO has been implemented
.IP "\fBANSI\fR"
A brief introduction to the ANSI Standard for Programming Language C.
.IP "\fBarena\fR"
What an arena is, and how it applies to \*(CO programs.
.IP "\fBarray\fR"
What an array is, and elementary information on how to code it.
.IP "\fBASCII\fR"
The ASCII table.
.IP "\fBbit\fR"
What a bit is.
.IP "\fBbit map\fR"
What a bit map is, and how to code it under C.
.IP "\fBbuffer\fR"
What a buffer is, and how buffering affects your languages.
.IP "\fBbyte\fR"
What a byte is.
.IP "\fBbyte ordering\fR"
This describes how bytes and words are ordered on the various
machines on which \*(CO has been implemented.
.IP "\fBcalling conventions\fR"
The calling conventions for \*(CO functions.
This is particularly important if you are writing modules in
assembly language.
.IP "\fBcast\fR"
How to ``coerce'' one data type into another.
.IP "\fBcc0\fR"
The \*(CO C parser.
.IP "\fBcc1\fR"
The \*(CO C code generator.
.IP "\fBcc2\fR"
The \*(CO C optimizer.
.IP "\fBcc3\fR"
The \*(CO de-compiler.
It generates a file of assembly language for your examination.
.IP "\fBdata formats\fR"
This gives the size of the common data types on the various machines
on which \*(CO has been implemented.
.IP "\fBdata types\fR"
The data types that \*(CO C recognizes.
.IP "\fBenviron\fR"
This article introduces the argument
.BR environ ,
which by default is the third argument passed to the function
.BR main()
in a C program.
It points to image of the process's environment.
.IP "\fBerrno\fR"
This global variable holds the error status returned by a \*(CO system
call.
The article
.B errno.h
interprets the codes that can appear in this variable.
.IP "\fBexecution\fR"
This describes how each form of the system call
.B exec()
executes a program.
.IP "\fBfield\fR"
Description of what a field is, and how to address it.
.IP "\fBFILE\fR"
Description of the
.B FILE
structure used by STDIO routines.
.IP "\fBfile\fR"
What a file is.
It also goes into the ``black art'' of permissions.
.IP "\fBfile descriptor\fR"
Description of the
file descriptor used by \*(CO system calls.
.IP "\fBfunction\fR"
What a function is.
.IP "\fBGMT\fR"
A brief introduction to Greenwich Mean Time, which is the internal
time for every \*(CO system.
.IP "\fBinitialization\fR"
This describes the rules of initialization for C.
.IP "\fBinterrupt\fR"
What an interrupt is.
.IP "\fBLatin 1\fR"
The table ISO Latin 1 (ISO 8859.1).
.IP "\fBlvalue\fR"
Definition of the ``left value'' in a C expression.
.IP "\fBmacro\fR"
What a C macro is, and how \*(CO C processes them.
.IP "\fBmanifest constant\fR"
This introduces manifest constants, and lists the constants that
\*(CO defines automatically.
.IP "\fBmodulus\fR"
A definition of the modulus arithmetic operation.
.IP "\fBNUL\fR"
Definition of the NUL character.
.IP "\fBnybble\fR"
What a ``nybble'' is.
.IP "\fBobject format\fR"
Definition of an object format.
.IP "\fBoperator\fR"
A list of the C operators.
This article also gives a table of precedence for the operators.
.IP "\fBpattern\fR"
What a pattern is.
.IP "\fBpointer\fR"
What a pointer is, and tips for using pointers with \*(CO C.
.IP "\fBportability\fR"
This gives some tips on how to write portable programs.
.IP "\fBPOSIX Standard\fR"
A brief introduction to the POSIX Standard
.IP "\fBrandom access\fR"
A definition of random access.
.IP "\fBread-only memory\fR"
A definition of ROM, or ``read-only memory''.
.IP "\fBrecursion\fR"
A definition of this programming technique.
.IP "\fBrvalue\fR"
Definition of the ``right value'' in a C expression.
.IP "\fBsigname\fR"
This global array holds a string that describes the signal that
a program has received.
.IP "\fBstack\fR"
A definition of the program stack, and how to manipulate it under
\*(CO C.
.IP "\fBstandard error\fR"
Definition of the standard-error device.
.IP "\fBstandard input\fR"
Definition of the standard-input device.
.IP "\fBstandard output\fR"
Definition of the standard-output device.
.IP "\fBstderr\fR"
The file descriptor of the standard-error device.
.IP "\fBstdin\fR"
The file descriptor of the standard-input device.
.IP "\fBSTDIO\fR"
Definition of STDIO \(em i.e., ``standard input and output''.
.IP "\fBstdout\fR"
The file descriptor of the standard-output device.
.IP "\fBstorage class\fR"
This entry summarizes the classes of storage that \*(CO C recognizes.
.IP "\fBstream\fR"
Definition of a file stream.
.IP "\fBSTREAMS\fR"
This article summarizes the \*(CO implemenation of \*(ST.
.IP "\fBstructure\fR"
Definition of a structure, and basic information on how to code it.
.IP "\fBstructure assignment\fR"
This details structure assigment under \*(CO C.
.IP "\fBstty\fR"
Summary of the
.B stty
interface to terminals.
.IP "\fBtermio\fR"
Introduction to the
.B termio
terminal interface.
.IP "\fBtermios\fR"
This summarizes the \*(PX extensions to the
.B termio
terminal interface.
.IP "\fBtype checking\fR"
This details type checking under \*(CO C.
.IP "\fBtype promotion\fR"
This details type promotion under \*(CO C.
.SH "Other Languages"
\*(CO includes the following programming languages:
.IP \fBawk\fR
This interpreted language lets you write programs for text
processing.
It is especially good at processing tabular information, thus
letting you quickly write simple data-base programs.
.IP \fBbc\fR
.B bc
is a calculator program that offers infinite magnitude and infinite precision.
This is an interpreted langauge that you can program on the fly to perform
simple tasks, such as computing interest payments on the national debt.
You can also write programs that you can run repeatedly.
These can also take advantage of a library of
routines already written for you.
.IP \fBlex\fR
This program reads a set of lexical analysis rules that you write in
a standard form, and generates a C program that you can compile and run.
.IP \fByacc\fR
This program reads a set of parsing rules that you write in Backus-Naur Form,
and generates a C program that you can compile and run.
You can use with code generated by
.B lex
to write complex programs, such as compilers.
.PP
Each of these languages is described in a Lexicon article.
The front of the manual has a tutorial for each.
.SH "See Also"
.Xr "Administering COHERENT," administe
.Xr "C language," c_languag
.Xr "COHERENT," coherent
.Xr "commands," commands
.Xr "libraries," libraries
.Xr "Using COHERENT" using_coh
