DECUS C LANGUAGE SYSTEM Runtime Support Library Reference Manual

DECUS C LANGUAGE SYSTEM Runtime Support Library Reference Manual
DECUS C LANGUAGE SYSTEM
Runtime Support Library
Reference Manual
by
Martin Minow
Edited by
Robert B.
Denny
This document describes the RSX/VMS/RSTS/RT11 DECUS C language
system runtime support library.
DECUS Structured Languages SIG
Version of 11-Nov-83
NOTE
This software is made available without any support
whatsoever.
The
person
responsible
for
an
implementation of this system should expect to have to
understand and modify the source code if any problems
are encountered in implementing or maintaining the
compiler or its
run-time
library.
The
DECUS
'Structured Languages Special Interest Group' is the
primary focus for communication among users of this
software.
UNIX is a trademark of Bell Telephone Laboratories. RSX,
RSTS/E, RT11 and VMS are trademarks of Digital Equipment
Corporation.
CHAPTER 1
INTRODUCTION
The C support library contains three major groups of functions:
o
Functions called by the compiler to perform certain
mathematical operations (such as floating-point multiply
or function entrance) that are not performed in-line.
o
Functions that may be called by C programs to perform
operations, such as copying a string, that are more
efficiently performed by optimized assembly language
subroutines.
o
An implementation
library.
of
(most
of) the Unix Standard I/O
CHAPTER 2
THE STANDARD LIBRARY
WARNING
This version of the library is somewhat incompatible
with previous versions of the Decus C compiler.
This
incompatibility allows greater compatibility with Unix
Version 7, and the capability of generating global
references and definitions containing the radix-50 '$'
and '.' characters.
All C programs should be linked together with the run-time
support library.
On systems that support logical
device
descriptors, this will generally be stored in the C: logical
device/account. On RSX-11M, the library will be found in
LB:[1,1]. To link a C program, proceed as follows:
RSX
TKB
TKB> task/CP,map=objects,LB:C/LB
TKB> /
ENTER OPTIONS:
TKB> STACK=2000
TKB> //
RT11
R LINK
*save,map=objects,C:SUPORT,C:CLIB/B:2000
*^C
Note that, on RSX-11M, the task should be built checkpointable.
This is automatic on RSTS/E and VMS emulated modes.
On native
RSX-11M, the task-builder may be rebuilt with '/CP' as the
default. If the '/CP' switch is not given, the task may abort
(no
memory) when started.
Stack extension is needed if
subroutines locally allocate large amounts of data.
On RT11, note that the '/B' (bottom) switch must be given to
increase the size of the run-time stack.
This is needed as
local variables are allocated on the stack. If the stack size
[[
Page 2-2
C Runtime Support Library]]
Reference Manual
is not increased,
message.
the
program
may
abort
without
any
error
The
standard
I/O interface header file is in C:STDIO.H
(LB:[1,1]STDIO.H on native RSX-11M implementations) and should
be included in all C programs as follows:
#include <stdio.h>
2.1 Introduction to Unix-style Stream I/O
____________ __ __________ ______ ___
This
section presents an overview of the 'standard' I/O
interface for C programs. These routines have proven easy to
use and, while they do not provide the full functionality of RSX
or RMS, they give the programer essentially all that is needed
for everyday use. The discussion includes the following:
- Opening and closing files
- Reading data from files
- Writing data to files
Note that this file system is limited: files are sequential
with only a limited amount of random-access capability.
Also,
little of the power of RMS/FCS is available. On the other hand,
the limitations make C programs easily transportable to other
operating systems.
When a
opened:
C
program
stdin
stdout
stderr
is
started, three files are predefined and
The 'standard' input file
The 'standard' output file
The 'standard' error file
Stderr is always assigned to the command terminal. Stdin and
stdout are normally assigned to the command terminal, but may be
reassigned or closed when the program starts.
2.2
Opening and Closing Files
_______ ___ _______
_____
The fopen and fclose functions control access to files.
are normally used as follows:
#include <stdio.h>
/* Define standard I/O
*/
They
FILE
*ioptr;
/* Pointer to file area */
...
if ((ioptr = fopen("filename", "mode")) == NULL)
error("Can't open file");
All information about an open file is stored in a buffer whose
address is returned by fopen().
The buffer is dynamically
[[
Page 2-3
C Runtime Support Library]]
Reference Manual
allocated when the file is opened and deallocated when the file
is closed. Its format is described under the heading IOV.
The
mode string contains flags defining how the file is to be
accessed:
r
w
a
Read only
Write new file
Append to existing file (or write new)
(Doesn't work on RT11 modes).
It also defines some record-control information:
n
u
No newlines mode ('binary' files)
RSX: The user program allocates record buffers
RT11: Console output is done using .ttyout
If mode 'n' is specified, the RSX I/O routines do not interpret
the end of a RMS logical record as defining the end of a
human-readable line.
This is necessary to process 'binary'
information.
On RT11, the I/O routines
do
not
remove
carriage-returns
from
input
files,
nor do they insert
carriage-returns when newlines are output.
Mode 'u' is treated differently on RSX and RT11. If specified
on RSX the user maintains the file's record buffer. The program
may only call the fget() and fput() routines. Each such call
will be translated directly to an RMS/FCS GET$ or PUT$ call.
(In RT11 mode, fput() may be used to write binary records which
are subsequently read by fget(). The file should be opened with
'n' mode.)
If mode 'u' is specified on RT11 mode when opening the console
terminal, single character output will be performed (using the
RT11 monitor routine .ttyout). If not specified, output will be
one line at a time (using the monitor routine .print).
The
library initialization process opens stderr in mode 'u' and
stdout in normal mode. This means that mixing I/O to both units
will
result
in
synchronization
problems.
To
obtain
single-character output on stdout, the program need simply
execute:
if (freopen("tt:", "wu", stdout) == NULL) error("");
The program calls fclose(ioptr) to terminate processing on a
file. This closes the file and reclaims system-controlled
buffer space. fmkdl(ioptr) may be called to close and delete an
open file.
[[
Page 2-4
C Runtime Support Library]]
Reference Manual
2.3
Reading Data from a File
_______ ____ ____ _
____
The simplest way to read a file is to call the getchar() or
getc() routines which read the next character from a file.
For
example, the following program counts the number of characters
in a file:
#include <stdio.h>
main()
{
register int
ccount;
register int
lcount;
register int
c;
FILE
*ioptr;
if ((ioptr = fopen("foo.bar", "r")) == NULL)
error("Cannot open file");
ccount = 0;
lcount = 0;
while ((c = getc(ioptr)) != EOF) {
ccount++;
if (c == '\n') lcount++;
}
printf("%d characters, %d lines.\n",
ccount, lcount);
}
Other input routines include:
gets
fgets
fgetss
ungetc
fseek
Read a line from the standard input
Read a line from a file
Read a line from a file, remove terminator
Push one character back on a file
Position the file to a specific record
These routines are used together with the ferr() and feof()
functions which allow testing for error and end of file
conditions, respectively.
The package assumes that all error
conditions are lethal and force end of file.
2.4
Writing Data to a File
_______ ____ __ _ ____
There are several routines for data output which are directly
analagous to the data input routines:
putchar Write a character to standard output
putc
Write a character to a specified file
puts
Write a string to the standard outpt
fputs
fputss
ftell
Write a string to a specified file
Write a record to a specified file
Return record location (for fseek)
In addition, the printf() or fprintf() routine is used to format
and print data (as was shown in the previous example). Printf()
[[
Page 2-5
C Runtime Support Library]]
Reference Manual
is flexible, powerful, and easy to use; and is perhaps the
single most important routine in the file system.
2.5 Interaction with the Operating System
___________ ____ ___ _________ ______
The support library attempts to provide a consistant operating
system interface on several implementations of quite different
operating systems. The possiblities include:
o
Native RT11
o
Native RSX-11M or IAS
o
RT11
o
RSX-11M emulated on RSTS/E
o
RSX-11M emulated on VAX/VMS
emulated on RSTS/E
This section mentions the inconsistencies and random bugs that
are more or less intentionally present.
2.5.1
Logical Unit Numbers
_______ ____ _______
RT11, RSTS/E, and RSX-11M use small integers to number all I/O
channels. Unfortunately, the numbering is not consistent and
channel usage differs among the various systems. This has
resulted in several quirks:
o
On RT11, console terminal interaction uses the .ttyout
and .print monitor functions. While no device is opened
by the fopen() function, a channel number is reserved.
o
On RSX-11M, a channel must be allocated to the console
terminal.
When a C program starts, the
'command
terminal' is opened on logical unit 1 and assigned to
stderr. This is not done using the fopen() routine
(although the stderr IOV structure is defined as if
fopen() were called).
Also, fclose() cannot close
stderr.
In addition to the standard I/O routines, there are two
routines, msg() and regdmp(), that direct output to
logical unit 1. These routines were used to debug the
library, and are otherwise useful for disasters.
On
RT11,
msg()
function.
o
and
regdmp()
use
the
.print
monitor
On both systems, the first true files are stdin and
stdout. These are opened on logical units 0 and 1
(RT11) or 2 and 3 (RSX). Code in fclose() double-checks
[[
Page 2-6
C Runtime Support Library]]
Reference Manual
that the logical unit number of the file being closed
corresponds to the proper slot in the logical unit
table.
o
Since the standard I/O routines know little about the
operating system, they do not deal with certain special
features.
For example, on RT11, the 'user service routine' (USR)
is used to open files. The file open routine does not
attempt to locate IOV areas so that the USR does not
swap over them. This can be a problem for very large
programs.
On RSX, logical unit numbers are assigned dynamically.
This means that 'LUN assignment' cannot be reliably
performed
by
task-build
control
files (or task
initiation).
2.5.2
Wild-Card Files
The fwild() and fnext()
'wild-card' files.
_________ _____
routines
can
be
used
to
process
On RSX-11M and VMS/RSX emulation, the file name, extension,
and/or file version may be expressed as '*' to indicate
wild-card support.
Due to restrictions in the RSX-11 Files-11
structure (ODS1), the ' ', ';0' and ';-1' version numbers will
NOT function properly on native RSX-11. This means that '*.MAC'
will not work, for instance. The algorithm in fwild() depends
on the directory being sorted, as in the ODS2 file structure
used on VAX/VMS. If you sort the directory to be used in an
fwild() operation (use the SRD program available from DECUS with
the /WB switch) in order of decreasing file version numbers,
then the " ", ";0", and ";-1" versions will work.
Wild-card devices, units, or UIC codes are not supported. Note
that, on RSX11 emulated on VMS, the ';-1' (earliest version)
requires special processing by the user program, as noted in the
description of fwild().
On RSX-11M emulated on RSTS/E, the file name and/or extension
may contain '*' or '?' wild-cards. Wild-card devices, units, or
UIC (PPN) codes are not supported.
On RT-11, the file name and/or extension may contain '*', '%' or
'?' wild cards. The '?' wild-card is synonymous with '%'.
Wild-card devices, or units are not supported. Since wild-card
support is not an RT-11 system service, the file specification
parsing and directory operations are handled by the C library
fwild() and fnext() functions. The fwild/fnext module requires
about 480 words of storage. Also, a file opened by wild-card
[[
Page 2-7
C Runtime Support Library]]
Reference Manual
uses a 1024 byte buffer, twice the normal size, which is
between data and directory operations.
2.5.3
Memory allocation
shared
______ __________
Memory is allocated using the malloc() function. It works
correctly on all operating systems, expanding memory on RSX and
RT11/RSTS.
On 'native' RT11, all available memory is allocated
by invoking the monitor .settop function with a '-2' argument.
Neither library supports extended memory (PLAS) directives.
The sbreak() routine may be used for permanent allocation of
memory. Once memory has been allocated using sbreak(), it
cannot be freed.
2.5.4
Global symbols
______ _______
Global symbols defined or referenced by C programs may cause
unexpected parts of the operating-system support library to be
loaded,
with undesirable consequences.
There are several
aspects to this problem:
o
A symbol refered to by a C program which is not resolved
by the object modules or libraries may cause some part
of the system library to be loaded. For example, if a C
program refers to the sqrt() function (which is not
present in the standard library), the linker may attempt
to load the function from the Fortran library.
Since
the Fortran sqrt() function contains a reference to the
Fortran run-time error message routine, the load map may
contain many strange global symbols.
o
Another problem occurs when a C program defines a global
symbol that duplicates a global in the system library.
This may prevent loading some necessary part of the
system library, causing the link to fail with unresolved
global symbols.
For example, on RSX-11M emulated on
RSTS/E V7.0, the following will fail:
int eof;
main () {
}
/* Global
*/
CHAPTER 3
LIBRARY FUNCTION DESCRIPTIONS
This chapter contains descriptions
runtime library functions.
of each of the C-callable
In most cases the I/O functions match those of UNIX V7 closely,
with differences normally called out.
For more information,
consult "The C Programming Language" by Brian Kernighan and
Dennis
Ritchie
(Englewood
Cliffs,
NJ:
Prentice-Hall,
ISBN 0-13-110163-3).
[[
Page 3-2
C Runtime Support Library]]
$$rtim
3.1
.lm -16
.lm -16
___ ___
**********
* $$rtim *
**********
DIAGNOSTICS:
Usage ...
Illegal options cause an extensive "help" message to be
printed.
Bad (width | offset) ...
An illegal or out-of-range number
parameter to a '-w' or '-t' option.
was
given
as
a
Can't open exclude file
Illegal exclusion
An exclude file text line began with a non-printing
character. The line is ignored.
Out of space in saveexclude
[[
Page 3-3
C Runtime Support Library]]
$$utim
3.2
.lm -16
.lm -16
___ ___
**********
* $$utim *
**********
DIAGNOSTICS:
Usage ...
Illegal options cause an extensive "help" message to be
printed.
Bad (width | offset) ...
An illegal or out-of-range number
parameter to a '-w' or '-t' option.
was
given
as
a
Can't open exclude file
Illegal exclusion
An exclude file text line began with a non-printing
character. The line is ignored.
Out of space in saveexclude
[[
Page 3-4
C Runtime Support Library]]
abs
3.3
text file archiver
text file archiver
____ ____ ________
*******
* abs *
*******
NAME:
arch -- text file archiver
SYNOPSIS:
arch [-options] [-z logfile] archive_name file[s]
DESCRIPTION:
Arch manages archives (libraries) of source files,
allowing a large number of small files to be stored
without using excessive system resources. The following
options may be specified:
c
Force creation of new archive
d
Delete file from archive.
i
Insert, same as update
p
Print files on standard output
r
Replace, same as update
l
List archive contents (directory)
u
Update, same as replace
x
Extract named files
v
Verbose
z
Write verbose log to indicated file
The
file name arguments may contain '*' and '?'
wildcards, where '*' matches any string of characters,
and '?' matches one character. ('%' may be used as a
synonym for '?'.) There is a slight,
but
suble
difference in the way wild cards are processed for the
various commands:
directory, delete, and extract
Match ('*' and '?') against the files in the
archive, performing the operation on all files
that match.
Except for delete, "no argument"
matches all files in the archive.
[[
Page 3-5
C Runtime Support Library]]
abs
text file archiver
insert, replace, and update
Expand the wild-card arguments against the files
stored on the operating system -- eliminating
all
wild
cards.
Then, match against the
archived files. Those that match are replaced
by the file on the operating system. After
replacement, any additional files are appended
to the archive. Files in the archive that are
not in the directory are unchanged.
Currently, insert, replace, and update work the
same. If it seems reasonable, the program may
be extended as follows:
insert
Add files new only
Adds new files (not present in the
archive) but does not modify
files
currently in the archive. It would be
an error to try modifying a currently
archived file.
replace Modify existing files only
Modify files present in the archive, but
do not add new files to the archive.
update
Modify existing, add new
This is simple to do, but would seem to be a
rich source of user error.
NOTE:
Arch has been superseded by the much simpler, but
functionally identical, archi and archx programs.
ARCHIVE FILE FORMAT:
Archive files are standard text files. Each archive
element is preceeded by a line of the format:
-h-
file.name
date
true_name
Note that there is no line or byte count. To prevent
problems, a '-' at the beginning of a record within a
user file or embedded archive will be "quoted" by
doubling it. The date and true filename fields are
ignored.
On Dec operating systems, file.name is forced
to lowercase.
DIAGNOSTICS:
[[
Page 3-6
C Runtime Support Library]]
abs
text file archiver
Diagnostic messages should be self-explanatory
AUTHOR:
Martin Minow
BUGS:
Arch used to be called ar. The name was changed to
avoid conflict with the Unix tool.
[[
Page 3-7
C Runtime Support Library]]
cpystr
$(INCLUDE) definitions.
Most of the capabilities of
3.4 $(INCLUDE) definitions. Most of the capabilities of
__________ ____________ ____ __ ___ ____________ __
**********
* cpystr *
**********
make (and build) are unavailable. This file will probably have
to be edited before it can be used.
When specifing an operating system, a non-ambiguous string is required.
Thus,
"rstsrt11" may be abbreviated to "rstsrt".
For example, note the following examples:
build -l c:cu -s src: *.c >vxcubl.com
build *.c -x rt11 >ttool.com
The first builds the utility library for the current operating system,
while the
second builds tools for rt11 native mode.
HEADER AND TRAILER FILE FORMAT:
These files are written to the output file before (header) and after
(trailer)
the generated command files.
They may be used to establish
compilation
defaults.
C SOURCE FILE FORMAT:
To generate the command file, build reads each source file,
searching for a
build command. This appears as a comment (beginning in column
the C
source:
1)
in
/*)BUILD
arguments
*/
If a library is being built, build searches for "/*)LIBRARY".
libraries
and programs may coexist in the same directory.
Thus
Note that "/*)BUILD" or "/*)LIBRARY" must appear in upper-case at the
beginning
of a line. Also, the terminating "*/" must be the first non
white-space
characters on a line.
A '#' outside of a model argument will cause the rest of the source
line to be
ignored, allowing comments in model strings.
If no build arguments are given, the current file will be compiled.
Arguments may be given to override model (or built-in) definitions.
format
for an argument is as follows:
The
[[
Page 3-8
C Runtime Support Library]]
cpystr
$(INCLUDE) definitions.
Most of the capabilities of
$X = Y
where X may be either a single letter or a string enclosed in either
parentheses
or braces and Y may be either a single word or a string (which may
contain
blanks, newlines, etc.) bounded by braces. For example:
/*)BUILD
$(PROGRAM) = kwik
$(STACK) = 2000
$(FILES) = { kwik sortc }
*/
Within model definitions, the '$' character
if it is
doubled "$$" or followed by a blank "$ ".
may
appear as itself
The following may be specified in build arguments or model files:
$(DTOA)
This
program
requires
the
floating-point
double-to-Ascii conversion routine. This should be written as:
$(DTOA) = 1
$(DTOA) is ignored if unix or vax-native output is desired.
$(ATOF)
This
program
requires
the
floating-point
Ascii-to-double conversion routine. This should be written as:
$(ATOF) = 1
$(ATOF) is ingored if unix or vax-native output is desired.
$(SRC)
The
account
overrides any -s option value.
$(BIN)
where
the
sources
are.
This
The account where the image goes.
$(FILES)
The
list
of files to be built.
specified, the current file name is used.
$(FILES)
specified for programs and libraries.
$(MP)
To preprocess program
macro pre-processor, define this as:
source
If not
may be
files by the MP
$(MP) = 1
As
the
MP
preprocessor
does not have a default filetype, the
build command will append ".C" to any source file that does not
have an explicit filetype. This may be overridden by providing
the filetype in the $(FILES) command:
$(FILES) = { prog.txt }
$(INCLUDE)
The
list
of
files
to
be
included.
If not
[[
Page 3-9
C Runtime Support Library]]
cpystr
$(INCLUDE) definitions.
Most of the capabilities of
specified, no include files will be copied.
The copy is
supressed
if neither $(SRC) nor $(COPYINCLUDE) have been
redefined as the file would be copied from the
current
disk/account to itself.
These files are not deleted after
compilation, even if they were copied.
$(INCLUDE) may be
specified for programs or libraries.
$(PROGRAM)
The name of the program image to be generated.
$(STACK)
A value for the RT11 /B[OTTOM] link specifier.
If not specified, "$(STACK) = 2000" will be used. Note that the
RSX task-builder STACK option is specified by the $(TKBOPTIONS)
specifier below.
$(TKBOPTIONS)
RSX task builder options (stack, units, task
name, etc.) are specified by this argument as follows:
$(TKBOPTIONS) = {
STACK
= 1500
TASK
= ...FOO
; ... etc
}
$(OBJS)
A string naming the actual object files. If
specified, it overrides the default use of the files just
compiled.
$(LIBS)
A string naming additional libraries
searched (before searching the C runtime library).
$(UTLIB)
A user-specified utility library;
all link strings, but unspecified by BUILD.
to
be
appended to
$(DECUS_LIB)
On native Vax-11C, the library "C:VAXLIB/LIB"
which contains interface routines for Decus-C tools.
$(SUPORT)
The
"C:SUPORT.OBJ".
$(??LIB)
RT11
runtime
support
routine:
The C runtime library:
$(VXLIB)
The VAX/VMS
"SYS$LIBRARY:VAXCRTLIB/LIB"
native runtime library, by default
$(RXLIB)
The RSX runtime library. The default depends on
the operating system: on VAX/VMS and RSTS, it is "C:C/LB",
while on native RSX-11M, it is "LB:[1,1]C/LB".
$(RTLIB)
The
RT11
runtime
library.
The
default
is
"C:SUPORT,C:CLIB".
$(ODL) = {...} An RSX
temporary file will be
containing a configured
overlay description. If specified, a
created (and subsequently deleted)
overlay file.
Note that you should
[[
C Runtime Support Library]]
Page 3-10
cpystr $(INCLUDE) definitions.
Most of the capabilities of
reference the run-time library by using $(RXLIB) to obtain the
correct library designation. If $(ODL) is specified, $(OBJS) is
ignored and $(LIBS) and $(RXLIB) will be processed only if
present in the $(ODL) model. For example:
$(ODL) = {
.ROOT MAIN1-MAIN2-$(RXLIB)-*(OV1,OV2)
;
OV1:
.FCTR
SUB1-SUB1L
$(RXLIB):FWILD:FGETNA:RTIME ;
OV2:
.FCTR
.FCTR $(RXLIB):ASL$$LI # (asl$li) ;
.END
}
SUB1L:
SUB2-SUB2L
.FCTR
SUB2L:
Note the use of $(RXLIB):XXX to select modules from the C
library and the doubling of '$' in referencing subroutine
ASL$LI.
$(OVR) = {...} An RT11 overlay
$(OBJS) is ignored. For example:
description.
If specified,
$(OVR) = {
root1,root2,$(SUPORT),$(RTLIB)
over1/o:1
over2/o:2
}
$(COMMENT)
A string that
the target operating system.
will comment a command line for
$(PREFIX)
This model is expanded at the start of every
compilation. The default is a comment in a format suitable for
the particular operating system.
$(POSTFIX)
This model is expanded after every program
build. On VAX/VMS, the default defines the program as an
external command. On other systems, the default does nothing.
$(FIRST)
This model is expanded before the first program
is built. By default, it does nothing. It may be defined by a
user-specified model file.
$(LAST)
This model is expanded after the last program is
built. By default, it does nothing. It may be defined by a
user-specified model file.
For example,
/*)BUILD
*/
This is a "normal" build for e.g., grep or echo, signalling build that
this file
is a program, rather than a subroutine.
/*)BUILD
[[
C Runtime Support Library]]
Page 3-11
cpystr $(INCLUDE) definitions.
Most of the capabilities of
$(PROGRAM)
= xrf
$(INCLUDE)
= xrf.h
$(FILES)
=
{ xrf0 xrf1 xrf2 xrf3 xrfi xrfd }
$(TKBOPTIONS)
= {
TASK
= ...XRF
}
$(ODL)
= {
.ROOT
XRF0-XRF2-XRFD-$(RXLIB)-*(X1,X2,X3)
;
X1:
.FCTR
XRFI-X1L
X1L:
.FCTR
$(RXLIB):CONCAT:CTIME:FWILD
;
X2:
.FCTR
XRF1-X2L
X2L:
.FCTR
$(RXLIB):ASL$$I
;
X3:
.FCTR
XRF3-X3L
X3L:
.FCTR
$(RXLIB):CPYSTR
.END
}
$(OVR)
= {
xrf0,xrf2,xrfd,c:suport,c:clib
xrfi,c:clib/o:1
xrf1,c:clib/o:1
xrf3,c:clib/o:1
}
*/
This slightly more complex build shows specification of an include
file, the
creation of a program whose name is different from its component
files,
task-builder options, and overlay files, including library module
selection.
/*)LIBRARY
$(INCLUDE) = chrtab.h
*/
This library build file shows the naming of an include file.
MODEL FILE FORMAT:
Model files consist of strings of macros and their definitions. Each
definition
is separated by one or more blanks, tabs, or newlines. Definitions are
in the
same format as their )BUILD parameter counterparts. A model will
(re)define
defaults for the entire build.
For example, the model file:
$(SRC) = DK1:[6,1]
$(BIN) = SY:[1,3]
# source files
# image output
Causes all program source to be taken from DK1:[6,1] and all compiled
programs
to be written to SY:[1,3].
Model file definitions replace operating-system specific defaults.
Anything
more elaborate than redefinition of, say, $(SRC) or $(BIN), will
probably
require understanding of the inner logic of the build program. You
should be
[[
C Runtime Support Library]]
Page 3-12
cpystr $(INCLUDE) definitions.
Most of the capabilities of
especially cautious of changing a link or library build string.
BUGS:
It will never replace make. It's not supposed to, anyways. The
problem that
build was written to solve is the extraordinary proliferation of tiny
files -each tool program requiring five or six command files: one or two
for each
operating system.
AUTHOR:
Martin Minow
[[
C Runtime Support Library]]
Page 3-13
fgetname
.s.i -8;No : type
3.5
.s.i -8;No :
type
____ _____ _
____
************
* fgetname *
************
A colon was followed by an unknown modifier.
Class terminates badly
A character class "[...]" was
example, "[A-]" is incorrect.
incorrectly
terminated.
Unterminated class
For
Character classes must be terminated by ']'.
Class too large
An internal buffer filled.
Empty class
A character class must designate something:
Pattern too complex
An internal buffer filled.
AUTHOR:
David Conroy, Martin Minow.
BUGS:
"[]" is illegal.
[[
C Runtime Support Library]]
Page 3-14
gets
...
3.6
...
___
********
* gets *
********
sort_f = "myfile.tmp";
}
DIAGNOSTICS:
SORTS-E-cannot create temp.
file "filename"
The required file cannot be created in the current directory.
SORTS-E-out of main memory.
The program ran out of main memory. Sorts may be optionally
compiled to dump internal tables (run tables) on this error.
SORTS-E-Error writing temp.
file
An occurred when writing the temp.
of space on the disk".
SORTS-F-Can't reopen temp.
file.
It is probably "out
file
SORTS-F-Empty run
SORTS-F-Unexpected eof
All error are fatal. "-E" errors are probably correctable by the user.
"-F" errors are serious problems. If the user program defined its own
comparison function, that should be checked for consistancy.
AUTHOR:
David Conroy, Martin Minow
Revised by Bob Denny and Tim Coad
BUGS:
[[
C Runtime Support Library]]
Page 3-15
index
} */.fill.s.f:This slightly more co
3.7
} */.fill.s.f:This slightly more co
________________ ________ ____ __
*********
* index *
*********
_
[[
C Runtime Support Library]]
Page 3-16
msg
left hand column. The kwik'ed
_______
3.8 left hand column.
___ _______
The kwik'ed
*******
* msg *
*******
____ ____
[[
C Runtime Support Library]]
Page 3-17
perror .s.i -8;Bad (width | offset) ...
3.9 .s.i -8;Bad (width | offset) ...
______ _ _______ ___
____ ______
**********
* perror *
**********
An illegal or out-of-range number was given as a parameter to a
'-w' or '-t' option.
Can't open exclude file
Illegal exclusion
An exclude file text line began with a non-printing character.
The line is ignored.
Out of space in saveexclude
[[
C Runtime Support Library]]
Page 3-18
printf .lm -16
3.10
.lm -16
___ ___
**********
* printf *
**********
DIAGNOSTICS:
Usage ...
Illegal options cause an extensive "help" message to be
printed.
Bad (width | offset) ...
An illegal or out-of-range number
parameter to a '-w' or '-t' option.
was
given
as
a
Can't open exclude file
Illegal exclusion
An exclude file text line began with a non-printing
character. The line is ignored.
Out of space in saveexclude
[[
C Runtime Support Library]]
Page 3-19
profile .lm -16
3.11
.lm -16
___ ___
***********
* profile *
***********
DIAGNOSTICS:
Usage ...
Illegal options cause an extensive "help" message to be
printed.
Bad (width | offset) ...
An illegal or out-of-range number
parameter to a '-w' or '-t' option.
was
given
as
a
Can't open exclude file
Illegal exclusion
An exclude file text line began with a non-printing
character. The line is ignored.
Out of space in saveexclude
[[
C Runtime Support Library]]
Page 3-20
putc
.lm -16
3.12
.lm -16
___ ___
********
* putc *
********
DIAGNOSTICS:
Usage ...
Illegal options cause an extensive "help" message to be
printed.
Bad (width | offset) ...
An illegal or out-of-range number
parameter to a '-w' or '-t' option.
was
given
as
a
Can't open exclude file
Illegal exclusion
An exclude file text line began with a non-printing
character. The line is ignored.
Out of space in saveexclude
[[
C Runtime Support Library]]
Page 3-21
strncat Martin Minow
3.13
Martin Minow
______ _____
***********
* strncat *
***********
[[
C Runtime Support Library]]
Page 3-22
strneq .nf
3.14
.nf
___
**********
* strneq *
**********
.t Anything (or .t ########Anything)
Getrno will change it to:
.t [[Anything]]
and fixdoc.c will look for same for post processing.
C SOURCE FILE FORMAT:
C source must have the following format:
#ifdef DOCUMENTATION
title
tool_name
header_text
index
index text
section_head
text for the section
#endif
Note that the comment leadin must be
#ifdef<tab>DOCUMENTATION
In order to define a uniform environment, getrno will insert the
following commands at the beginning of the output file:
.no autosubtitle .style headers 3,0,0
.pg.uc.ps 58,80.lm 8.rm 72
.hd
.hd mixed
.head mixed
(Various flavors of runoff will flag
commands as errors, none of them fatal.)
one
or more of these
Getrno inserts the following commands between the data from each
pair of files scanned:
.lm 8.rm 72.nhy
Within
the body of the documentation, lines are handled
depending on what column their text starts in (i.e.
where the
first non-<space>, non-<tab> character falls);
a <tab> is
always assumed to put the next character at column 8. (And you
thought card images were dead!)
[[
C Runtime Support Library]]
Page 3-23
strneq .nf
An empty line becomes a .space command.
Section heads begin in column 1. They will be left-justified
and printed in upper case with a trailing ":". The only section
heads with any special meaning to getrno are "title", "index",
and "internal";
they are recognized regardless of
case.
"Title" and "index" must come first, as shown in the example.
"Internal" flags the beginning of data that is output only if
the -w switch was used; the next section head ends the "wizards
only" data. However, if "internal" appears before any other
section head (not counting "index"), nothing at all will be
output for this file unless -w appears.
Normal text starts in column 8 with a character other than a
<tab> or <space>; it will be justified and filled, and will
start in column 16 on the paper. The <space>'s and <tab>'s that
filled the first 7 columns are stripped.
A line that has a <space> or <tab> in column 8 will be output
with the <space>'s and <tab>'s that filled the first 7 columns
stripped, and with runoff set to nofill mode.
A line that starts with a <space> but has a non-blank before
column 8 will have the leading <space>'s stripped and will be
output with a leading ".i -8;". Lines of this form are normally
used between ".lm +8"/".lm -8" pairs, as shown in the example
below.
A line whose first character AFTER stripping leading blanks as
defined above is a "." has leading runoff commands. It is your
responsibility
to
maintain
alignment
and
to
quote
runoff-specific characters on such lines; in all other cases,
getrno will do it for you. For example:
diagnostics
.lm +8
.s.i-8;bad file _& other stuff
.s.i-8;something else
.lm -8
.s
author
etc...
Avoid manipulating fill mode directly. Getrno keeps track of
whether it has set runoff to fill or nofill mode, and can get
confused if you shift modes on it. Hence, the results may then
not be as you expect.
Note that the above example can be more easily handled as:
[[
C Runtime Support Library]]
Page 3-24
strneq .nf
diagnostics
.lm +8
bad file & other stuff
something else
.lm -8
author
etc...
MACRO SOURCE FILE FORMAT:
The Macro input must have the following syntax:
.title name
Title line
;
;+
(Start of commentary)
;
; Index
Short description for kwik index
; Index
(Another short description)
;
; Usage
(Start of usage information)
;
;
Usage information, output, starting in column 1
;
exactly as it is written (rno .nf mode). The
;
leading semicolon is not output, but the tab (or
;
spaces) is.
;
; Description
;
;
Description, output, starting in column 8 in
;
runoff .fill mode, except that any line starting
;
with ";<tab><TAB or SPACE>" will be output in
;
.no fill mode. The leading ";<tab>" will not be
;
output.
;
;
A line consisting of just ";" will generate a
;
runoff .space while a line consisting of
;
";<SPACE>text" will generate ".indent -8 ;text".
;
;(End of commentary)
If the wizard flag (-w) is not given, a Macro source line of the
format:
;
Internal
may be used to signal the start of package-internal information.
If "Internal" preceeds "Usage", no information will be output
for this file.
If it follows "Usage" or "Description", text
following (up to the next section initiator) will not be output.
HEADER FILE FORMAT:
[[
C Runtime Support Library]]
Page 3-25
strneq .nf
The header file
start as follows:
is assumed to be in runoff format.
It should
.comment Set top-of-form at 4 lines
.comment below perforation.
.ps 58,80
! 58 lines per page, 80 columns.
.lm 8
! left margin at 8
.rm 72
! right margin at 72
.hd Mixed
! Mixed case headings
Because the left margin is set to 8, titles and subtitles should
be written as:
.t ########Title
.st ########Subtitle
The wizard flag may be used to select parts of the header file:
.comment wizard
*** For wizards only ***
.comment else
*** For non-wizards only ***
.comment mundane
*** Exit wizard section ***
A line indicating the date on which the documentation was built,
and optionally some other information, can be inserted by:
.comment date[ info]
The optional info will be included on the date line, which is
centered. A single <space> must appear after "date" if info
appears;
it is not part of info. The format of the date line
is:
Document compiled <today's date><space>[info]
The date inserted is in the format returned by ctime() (so it's
actually the date and time).
The
format
of
all
the
comments
".comment<space>argument" - one space only.
is
EXACTLY
WORKFILE FORMAT:
Each file builds one or more records (lines) in the workfile.
The first has the title line, (information following .title).
To allow building an index, this should be in the format:
name<tab>Title information
Following this are lines containing .rno text. The last line is
followed by a record containing "!!" in the first two bytes.
[[
C Runtime Support Library]]
Page 3-26
strneq .nf
Records with "!" in the first byte may be used to communicate
information between passes: they are not written to the output.
This allows writing Usage information as a separate file.
Note that there is a bug in the RSTS RNO (as distributed with
Version 7.0). Consequently, if your runoff source has chapter
headings, you should not have explicit titles, or have page
numbers.
BUGS:
Getrno was written to aid in documenting the Decus C libraries.
(I.e., getrno and the library documentation are interdependent.)
An attempt has been made to make the C-style processing
generally useful; the Macro-style processing is more closely
tied to the library documentation and is probably of less
general interest. Further, the program, particularly in Macro
mode, is very sensitive to the exact format of the input; minor
variations can produce unexpected results.
Some attempt has
been made to avoid this in C-style processing; in Macro mode,
you are on your own.
Due to the size of the files involved, the usage option (-u) is
no longer used in building library documentation, and is not
supported in C-mode. Perhaps it should be.
There should be a way to pass a "#" through to runoff within a
line that is otherwise processed normally.
All files are processed in the same mode. It might be useful to
allow mixed-mode processing so that libraries consisting of both
Macro and C modules could be handled.
DIAGNOSTICS:
A warning message
documentation.
is
printed
if
a
file
does not have any
There are many other messages, hopefully self-explanatory.
AUTHOR:
Martin Minow
[[
C Runtime Support Library]]
Page 3-27
ungetc .s
3.15
.s
__
**********
* ungetc *
**********
If no input_spec is present, the line is copied to the output
with no changes other than substitution for the model string.
Within a pattern, the following strings have special meaning:
?
Replaced by the last model string
*.*
Replaced by the filename + extension
*
Replaced by the filename only
Note that the disk and [UIC,PPN] is never output.
Unflagged arguments are wild-card file specifications.
For example:
[[
C Runtime Support Library]]
Page 3-28
wdleng diagnostics
3.16
diagnostics
___________
**********
* wdleng *
**********
.lm +8
.s.i-8;something else
author
etc...
.s.i-8;bad file _& other stuff
.lm -8
.s
Avoid manipulating fill mode directly. Getrno keeps track of
whether it has set runoff to fill or nofill mode, and can get
confused if you shift modes on it. Hence, the results may then
not be as you expect.
Note that the above example can be more easily handled as:
diagnostics
.lm +8
bad file & other stuff
something else
.lm -8
author
etc...
MACRO SOURCE FILE FORMAT:
The Macro input must have the following syntax:
.title name
Title line
;
;+
(Start of commentary)
;
; Index
Short description for kwik index
; Index
(Another short description)
;
; Usage
(Start of usage information)
;
;
Usage information, output, starting in column 1
;
exactly as it is written (rno .nf mode). The
;
leading semicolon is not output, but the tab (or
;
spaces) is.
;
; Description
;
;
Description, output, starting in column 8 in
;
runoff .fill mode, except that any line starting
;
with ";<tab><TAB or SPACE>" will be output in
[[
C Runtime Support Library]]
Page 3-29
wdleng diagnostics
;
;
;
;
;
;
;
;-
.no fill mode.
output.
The leading ";<tab>" will not be
A line consisting of just ";" will generate a
runoff .space while a line consisting of
";<SPACE>text" will generate ".indent -8 ;text".
(End of commentary)
If the wizard flag (-w) is not given, a Macro source line of the
format:
;
Internal
may be used to signal the start of package-internal information.
If "Internal" preceeds "Usage", no information will be output
for this file.
If it follows "Usage" or "Description", text
following (up to the next section initiator) will not be output.
HEADER FILE FORMAT:
The header file
start as follows:
is assumed to be in runoff format.
It should
.comment Set top-of-form at 4 lines
.comment below perforation.
.ps 58,80
! 58 lines per page, 80 columns.
.lm 8
! left margin at 8
.rm 72
! right margin at 72
.hd Mixed
! Mixed case headings
Because the left margin is set to 8, titles and subtitles should
be written as:
.t ########Title
.st ########Subtitle
The wizard flag may be used to select parts of the header file:
.comment wizard
*** For wizards only ***
.comment else
*** For non-wizards only ***
.comment mundane
*** Exit wizard section ***
A line indicating the date on which the documentation was built,
and optionally some other information, can be inserted by:
.comment date[ info]
The optional info will be included on the date line, which is
centered. A single <space> must appear after "date" if info
appears;
it is not part of info. The format of the date line
[[
C Runtime Support Library]]
Page 3-30
wdleng diagnostics
is:
Document compiled <today's date><space>[info]
The date inserted is in the format returned by ctime() (so it's
actually the date and time).
The
format
of
all
the
comments
".comment<space>argument" - one space only.
is
EXACTLY
WORKFILE FORMAT:
Each file builds one or more records (lines) in the workfile.
The first has the title line, (information following .title).
To allow building an index, this should be in the format:
name<tab>Title information
Following this are lines containing .rno text. The last line is
followed by a record containing "!!" in the first two bytes.
Records with "!" in the first byte may be used to communicate
information between passes: they are not written to the output.
This allows writing Usage information as a separate file.
Note that there is a bug in the RSTS RNO (as distributed with
Version 7.0). Consequently, if your runoff source has chapter
headings, you should not have explicit titles, or have page
numbers.
BUGS:
Getrno was written to aid in documenting the Decus C libraries.
(I.e., getrno and the library documentation are interdependent.)
An attempt has been made to make the C-style processing
generally useful; the Macro-style processing is more closely
tied to the library documentation and is probably of less
general interest. Further, the program, particularly in Macro
mode, is very sensitive to the exact format of the input; minor
variations can produce unexpected results.
Some attempt has
been made to avoid this in C-style processing; in Macro mode,
you are on your own.
Due to the size of the files involved, the usage option (-u) is
no longer used in building library documentation, and is not
supported in C-mode. Perhaps it should be.
There should be a way to pass a "#" through to runoff within a
line that is otherwise processed normally.
All files are processed in the same mode. It might be useful to
allow mixed-mode processing so that libraries consisting of both
Macro and C modules could be handled.
[[
C Runtime Support Library]]
Page 3-31
wdleng diagnostics
DIAGNOSTICS:
A warning message
documentation.
is
printed
if
a
file
does not have any
There are many other messages, hopefully self-explanatory.
AUTHOR:
Martin Minow
CHAPTER 4
LIBRARY HEADER FILES
This chapter contains descriptions of the standard header files
that are used by C programs and libraries.
These
files
are
included in
pre-processor command of the form:
#include <filename.h>
your
program
source
by
a
[[
Page 4-2
C Runtime Support Library]]
Reference Manual
4.1 Character test macros and global definitions
_________ ____ ______ ___ ______ ___________
*********
* ctype *
*********
NAME:
ctype -- Character test macros and global definitions
SYNOPSIS:
#include <ctype.h>
DESCRIPTION:
This
module defines a set of character test and
manipulation macros (or, on Decus C, functions) that
allow
classification
and
modification
of
Ascii
characters. If the C compiler supports macros with
arguments, the following are defined:
isupper(c)
islower(c)
isalpha(c)
isdigit(c)
isalnum(c)
isxdigit(c)
isspace(c)
ispunct(c)
isgraph(c)
isprint(c)
iscntrl(c)
isascii(c)
_toupper(c)
_tolower(c)
toascii(c)
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
Upper case alphabetic
Lower case alphabetic
Alphabetic in any case
Decimal digit
Alphabetic or digit
Hexadecimal digit
Space or tab
Punctuation
Visible character
Printable character
Control character
7-bit Ascii character
Lower case convert to Upper
Upper case convert to Lower
Remove eighth (parity) bit
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
Note that _toupper() and _tolower() must not be used
with arguments that have side effects, such as
_toupper(*ptr++);
Use the functions toupper() and tolower() instead.
BUGS:
[[
Page 4-3
C Runtime Support Library]]
fps
Bit definitions for the floating point status word
4.2 Bit definitions for the floating point status word
___ ___________ ___ ___ ________ _____ ______ ____
*******
* fps *
*******
NAME:
fps -word
Bit
definitions
for the floating point status
SYNOPSIS:
#include <fps.h>
DESCRIPTION:
This module defines common definitions for the FP-11
floating point status word. The following are defined:
FER
FID
FIUV
FIU
FIV
FIC
FD
FL
FT
FN
FZ
FV
FC
0100000
0040000
0004000
0002000
0001000
0000400
0000200
0000100
0000040
0000010
0000004
0000002
0000001
Floating error (sense/reset)
Disable all interrupts
Interrupt on undefined variable
Interrupt on underflow
Interrupt on overflow
Interrupt on int. conv. error
Double precision mode
Long integer mode
Chop mode
Floating negative (sense)
Floating zero
(sense)
Floating overflow (sense)
Floating carry
(sense)
[[
Page 4-4
C Runtime Support Library]]
initial Specify Initializers and Finalizers
4.3 Specify Initializers and Finalizers
____________ ___ __________
_______
***********
* initial *
***********
NAME:
initial -- Specify Initializers and Finalizers
SYNOPSIS:
#include <initia.h>
INITIAL
{ initial-code-block };
FINAL
{ final-code-block };
DESCRIPTION:
The macros defined in this module provide a facility for
module-specific initialization and finalization code.
The code in the initial-code-block is called as a normal
C
function
before
main()
is
called;
the
final-code-block is called on exit, just after wrapup().
Neither call passes any arguments.
Any number of modules in an image may independently
declare initializers or finalizers; all of them will be
called at startup or exit. However, it is impossible to
predict what order the calls will be made in, and
programs should not rely on any particular ordering.
A typical use of initializers and finalizers is the
following: Suppose you have a package that supports
access to some on-disk data base; a user of the package
will call a lookup and an update function.
The file
containing the data base must be opened before any
operations on it can take place, and it should be closed
when the program is finished. (Assume that the package
maintains some sort of resident buffer which it must
flush.) There are two conventional approaches to solving
this problem: Have the lookup and update functions
check the file on each call, and open it if necessary which could be quite expensive if they are very small
functions, and in any case does not solve the problem of
properly closing the file - or have the main program
call an initialization and finalization function at the
proper time. The problem with this latter approach is
[[
Page 4-5
C Runtime Support Library]]
initial Specify Initializers and Finalizers
lack of modularity - the main program ought not to have
to know that the module needs
initialization
or
finalization.
The solution using these macros is straightforward.
defining module includes the calls:
The
INITIAL
{ open-the-data-base };
FINAL
{ flush-buffers-and-close-the-data-base };
The
wrapup() function is treated like a built-in
finalizer; however, it is guaranteed to execute before
any other finalizers. (The module defining wrapup() may
declare an initializer or finalizer if it wishes;
it
will be treated just like all other initializers and
finalizers.)
If any finalizer (or wrapup()) calls exit(), the program
exits immediately.
Notes:
Using INITIAL will declare a static function
named $init$(), and a (char *) named $init_; similarly,
FINAL will declare $finl$() and $finl_. Also, both
INITIAL and FINAL generate dsect commands.
Since C
provides no way to "remember" the current dsect, both
macros issue a dsect "" command when they are done,
restoring the C default dsect.
While it is a poor idea to write code that depends on
the order in which initializers and finalizers are
executed, this can be useful information to have for
debugging. Execution is always in the order that the
modules involved were examined by the task builder or
linker. When the modules are named explicitly, this
will just be the order in which they were named. When
the modules come from a library, it will be extremely
difficult to predict the order in which they will be
extracted and linked in.
Warning: While initializers and finalizers provide some
modularity to package initialization and finalization,
they are not a panacea. For example, if package A calls
routines in package B from within its initializers, and
package
B also declares initializers, the correct
functioning of a program that includes both - hence, of
any program using package A - will be problematical.
BUGS:
Requires the
non-portable.
DECUS C dsect commands;
hence,
It may be possible to provide the
very
same
[[
Page 4-6
C Runtime Support Library]]
initial Specify Initializers and Finalizers
functionality
using different techniques;
what's wrong with your implementation?
AUTHOR:
Jerry Leichter
if
not,
[[
Page 4-7
C Runtime Support Library]]
rtime
Define time buffer structure for $$rtime()
4.4 Define time buffer structure for $$rtime()
______ ____ ______ _________ ___ _________
*********
* rtime *
*********
NAME:
rtime -- Define time buffer structure for $$rtime()
SYNOPSIS:
#include <rtime.h>
...
struct TIME buffer;
DESCRIPTION:
This header file defines the structure of the time
buffer used by the standard library $$rtime() function
(which is unique to Decus C). It is defined as follows:
struct TIME {
int
int
int
int
int
int
int
int
};
year;
month;
day;
hour;
minute;
second;
tick;
tsec;
G.TIYR
G.TIMO
G.TIDA
G.TIHR
G.TIMI
G.TISC
G.TICT
G.TICP
year - 1900
Jan. = 1
00 .. 23
00 .. 59
00 .. 59
00 .. tsec-1
tick/second
BUGS:
Oboslete, use time() and localtime() instead.
[[
Page 4-8
C Runtime Support Library]]
setjmp
Define buffer for setjump() and longjump()
4.5 Define buffer for setjump() and longjump()
______ ______ ___ _________ ___ __________
**********
* setjmp *
**********
NAME:
setjmp -- Define buffer for setjump() and longjump()
SYNOPSIS:
#include <setjmp.h>
DESCRIPTION:
This defines the jmp_buf array
setjmp() and longjmp() functions.
BUGS:
that is used for the
[[
Page 4-9
C Runtime Support Library]]
stdio
Definitions for standard i/o library
4.6 Definitions for standard i/o library
___________ ___ ________ ___ _______
*********
* stdio *
*********
NAME:
stdio -- Definitions for standard i/o library
SYNOPSIS:
#include <stdio.h>
DESCRIPTION:
<stdio.h> should be included in the assembly of all C
programs that use the standard i/o library (fopen(),
getc(), printf(), etc.)
It defines the following:
FILE
The i/o routines use
objects of this type.
and
return pointers to
NULL
I/O routines signal "rejection" by
null pointer.
EOF
The get character routine returns this value
signal end of file.
TRUE
The value 1.
returning
a
to
FALSE The value 0.
EOS
The "end of string" marker: '\0'.
IO_SUCCESS Normal exit to operating system.
IO_WARNING "Warning error" exit to operating system.
IO_ERROR
"Error" exit to operating system.
IO_FATAL
"Severe error" exit to operating system.
stdin
The "standard" input file.
Normally the user's
terminal; it may be redirected.
stdout
The "standard" output file. Normally the user's
terminal; it may be redirected.
stderr
The "error" output file.
It will always write
[[
C Runtime Support Library]]
Page 4-10
stdio
Definitions for standard i/o library
to the user's terminal.
DIFFERENCES FROM UNIX:
FILE is defined as a "typedef struc", rather than a
#define. The i/o structure is considerably different
from Unix. It is, however, arranged so that reasonable
compatibility may be attained.
Specifically, things
which have the same name are used for the same purpose,
and located in the same place within the I/O structure.
ACCESSING THE FDB ON RSX MODES:
The FDB (file data block) is the primary means of
communication between the C I/O library and the RSX file
control services modules. It contains file and record
format information as well as pointers and counters for
accessing data in the file. It is highly recommended
that you do not access this information directly.
Should you need to do so, the following may be done:
extern char *F_RTYP; /* F.RTYP (char) in fdb */
extern char *F_SEQN; /* F.SEQN (int) in fdb */
...
fd = fopen("file.nam", "r");
/*
* Set rtyp to the record type, stored as a
* byte at offset F.RTYP
*/
rtyp = fd->io_fdb[(int) &F_RTYP] & 0377;
/*
* set seqn to the sequence number (printfile
* fixed header), stored as an integer at
* offset F.SEQN.
*/
seqn = *((int *) &fd->io_fdb[(int) &F_SEQN]);
The somewhat messy use of casts and addressing allows
the program to use the value of F.xxx stored in the RSX
system library.
BUGS:
TRUE, FALSE, and EOS
some other C systems.
are not present in <stdio.h> on
If you compile with the /r switch (-r on RSX modes) or
#define rsts before #include <stdio.h>, a native RSTS/E
I/O vector will be defined which is neither fully
supported nor fully implemented.
[[
C Runtime Support Library]]
Page 4-11
time
Define time buffer structure for localtime()
4.7 Define time buffer structure for localtime()
______ ____ ______ _________ ___ ___________
********
* time *
********
NAME:
time -- Define time buffer structure for localtime()
SYNOPSIS:
#include <time.h>
...
extern struct tm *localtime();
DESCRIPTION:
This header file defines the structure
buffer used by the
standard
library
function. It is defined as follows:
struct tm {
int
tm_sec;
int
tm_min;
int
tm_hour;
int
tm_mday;
int
tm_mon;
int
tm_year;
int
tm_wday;
int
tm_yday;
int
tm_isdst;
};
/*
/*
/*
/*
/*
/*
/*
/*
/*
of the time
localtime()
Seconds
Minutes
Hours
Day in month
Month
Year
Weekday
Days since Jan 1
Daylight Savings = 1
*/
*/
*/
*/
*/
*/
*/
*/
*/
extern struct tm *localtime();
BUGS:
Unix V7 changed the tm_isday to tm_isdst.
Thanks guys.
[[
C Runtime Support Library]]
Page 4-12
timeb
Define timeb buffer structure for ftime()
4.8 Define timeb buffer structure for ftime()
______ _____ ______ _________ ___ _______
*********
* timeb *
*********
NAME:
timeb -- Define timeb buffer structure for ftime()
SYNOPSIS:
#include <timeb.h>
...
extern long ftime();
DESCRIPTION:
This header file defines
buffer used by the standard
It is defined as follows:
struct timeb {
long
unsigned
short
short
};
the structure of the timeb
library ftime() function.
time;
milltim;
timezone;
dstflag;
The time value is identical to the value returned by the
time() function. Milltim is the number of milliseconds
in the current second. Timezone indicates the number of
minutes past GMT in the current time zone (zero for
Decus C) and dstflag is set if Daylight Savings Time is
in effect.
APPENDIX A
LIBRARY INDEX
The following is a keyword in context index to the standard
library. The entry in the left-hand column is the title of the
routine in the main library documentation.
toascii
isascii
abort
abs
fabs
qset
profile
rtemt
malloc
calloc
alloc
sbrk
isalloc
$$mchk
isalpha
islower
isupper
isalnum
strcat
strncat
strncpy
isalpha
isalnum
iscntrl
isdigit
isgraph
islower
isprint
ispunct
isupper
isspace
$$ctim
Convert to 7-bit Ascii
Test for 7-bit Ascii
trap
Abort program with a BPT
Absolute value
Floating absolute value
queue
Add entries to the RT11
Print profile data after exit
Execute a RT11 EMT after loading r0
Allocate and free memory
memory
Allocate and initialize
Allocate memory
operating system
Allocate memory from
a pointer points to allocated memory Check if
Verify memory allocation pointers
Test for alphabetic argument
Test for lower-case alphabetic argument
Test for upper-case alphabetic argument
Test for alphanumeric argument
a string onto another
Concatenate
a string onto another, with Concatenate
Copy one string to another, with count
Test for alphabetic argument
Test for alphanumeric argument
for control character argument
Test
Test for digit argument
Test for graphic argument
lower-case alphabetic argument
Test for
Test for printable argument
Test for punctuation argument
upper-case alphabetic argument
Test for
Test for whitespace argument
$$rtim buffer to Ascii
Convert
r50toa
fgetname
itoa
Convert Radix-50 to Ascii
Convert file name to Ascii
Convert integer to Ascii
C Compiler and Library
Page A-2
Library Index
itoax
itoa8
toascii
isascii
ascr50
atod
atof
ctime
ctime
ctime
ftime
ungetc
getw
putw
fget
fput
msize
zero
fill
abort
localtime
swabb
$$ctim
$$utim
ctime
fflush
localtime
swabi
copy
swabb
call
callc
$$main
$$main
csv$
$$init
error
exit
csv$
call
callc
wrapup
caller
calltr
floor
floor
brk
ctype
fill
to hexadecimal Ascii
Convert integer
integer to octal Ascii
Convert
Convert to 7-bit Ascii
Test for 7-bit Ascii
Convert Ascii to Radix-50
Convert Ascii to floating point
Convert Ascii to floating point
Convert time value to ascii
time buffer to ascii
asctime Convert
buffer to ascii
asctime Convert time
Compute time of day (augmented)
Push back onto an input file
file
Input a binary integer from a
Output a binary integer to a file
Input a binary record
Output a binary record
Get size of a memory block
Clear a block of memory
character
Fill a block of memory with a
Abort program with a BPT trap
Build time of day buffer
Swap bytes in a buffer
Convert $$rtim buffer to Ascii
Convert $$rtim buffer to Unix time
asctime Convert time buffer to ascii
Flush output buffers
Build time of day buffer
Byte swap an integer
a given number of bytes
Copy
Swap bytes in a buffer
subroutine from C
Call (Fortran)
subroutine from C
Call (Fortran)
variables
C library global
C main program
environment
C program execution
C program initialization
Error exit from C programs
Normal exit from C programs
restore
C register save and
subroutine from C
Call (Fortran)
subroutine from C
Call (Fortran)
Dummy routine called on exit
name of profiled caller
Return
Trace path to the caller
>= x
ceil(x) smallest value
Functions
Floor and Ceiling Floating Point
pointer
Change top of memory
type table
Character classification
of memory with a character
Fill a block
iscntrl
getchar
index
strchr
inchr
Test for control
Get one
first instance of a
first instance of a
Find the index of a
character
character
character
character
character
argument
from a file
in a stFind the
in a stFind the
in a string
C Compiler and Library
Page A-3
Library Index
rindex
strrchr
putc
isalloc
ctype
zero
clearerr
fclear
$$main
fclose
exit
exit
iov
$$gcmd
msg
strcmp
strncmp
$$ctim
strlen
time
tod
ftime
strcat
strncat
concat
envsave
iscntrl
gettty
setcc
fprintf
sprintf
$$rtim
$$scan
fscanf
scanf
sscanf
$$ctim
$$utim
ascr50
atod
atof
r50toa
fgetname
itoa
itoax
itoa8
toupper
atoi
atol
last instance of a character in a stFind the
last instance of a character in a stFind the
Output one character to a file
points to allocated memoryck if a pointer
table
Character classification type
Clear a block of memory
flags
Clear open file's error
flags
Clear open file's error
$$tick -- Clock interrupt rate
Close an open file
$$exst -- Exit status code
Exit with status code
I/O error codes
Parse command line
a message on the command terminal
Print
Compare strings
count
Compare strings, with
Compute day of week
string
Compute length of a
Compute time of day
Compute time of day
(augmented)
Compute time of day
onto another
Concatenate a string
onto another, with countoncatenate a string
Concatenate strings
and restore function context
Save
argument
Test for control character
Get control terminal name
Trap Control/C
Formatted Conversion
Formatted Conversion
Date and time conversion
Formatted input conversion
Formatted input conversion
Formatted input conversion
Formatted input conversion
Ascii
Convert $$rtim buffer to
Unix time
Convert $$rtim buffer to
Radix-50
Convert Ascii to
floating point
Convert Ascii to
floating point
Convert Ascii to
Ascii
Convert Radix-50 to
Ascii
Convert file name to
Convert integer to Ascii
hexadecimal Ascii
Convert integer to
Ascii
Convert integer to octal
upper-case
Convert lower-case to
integer
Convert string to
Convert string to long
ctime
ctime
toascii
tolower
copy
ascii
ascii
lower-case
bytes
asctime Convert time buffer to
Convert time value to
Convert to 7-bit Ascii
Convert upper-case to
Copy a given number of
C Compiler and Library
Page A-4
Library Index
strcpy
strncpy
cpystr
strncmp
strncat
strncpy
strneq
$$main
profile
$$rtim
time
tod
ftime
localtime
$$ctim
$$main
$$narg
fspool
$$narg
iov
sleep
delete
fmkdl
kbinr
kbin
isxdigit
isdigit
wrapup
memdmp
rstsys
rtemt
$$main
feof
$$main
qset
profile
csv$
streq
strneq
error
ferr
ferror
iov
clearerr
fclear
perror
iov
rstsys
rtemt
another, with count
String
Compare strings, with
onto another, with
to another, with
string equality, with
$$scca -- RT-11
Print profile
Compute
Compute
Compute
Build
time of
time of
time of
time of
Compute
$$uic -- RSX-11M
Define $$narg
Spool file to
for RT11 startup
I/O vector
of seconds
Mark file for
read without waiting
the terminal without
Test for hexadecimal
Test for
exit
Execute a RSTS
Execute a RT11
$$vms -- Test if VMS
Test for
$$stnd -- Stack
queue
Add
$$prnl -- Profile
C program execution
Test strings for
Test string
programs
Test for file
Test for file
I/O
Clear open file's
Clear open file's
Print library
$$ferr -- File
loading r0
Copy a string
Copy one string to
copy
count
countConcatenate a string
count
Copy one string
count
Test
Ctrl/C flag
data after exit
Date and time conversion
day
day
day (augmented)
day buffer
day of week
default UIC
default for RT11 startup
default print queue
Define $$narg default
definition
Delay job a given number
Delete a named file
deletion
Delimiter-free terminal
delimiters
Read from
digit
digit argument
Dummy routine called on
Dump memory or registers
EMT
EMT after loading r0
emulation
end of file
end point
entries to the RT11
entry per line
environment
equality
equality, with count
Error exit from C
error
error
error codes
error flags
error flags
error message
error value
Execute a RSTS EMT
Execute a RT11 EMT after
unwind
setjmp
csv$
exit
exit
Execute non-local goto
longjmp -- execute non-local goto
C program execution environment
$$exst -- Exit status code
Exit with status code
C Compiler and Library
Page A-5
Library Index
wrapup
profile
error
exit
exit
iov
iov
profile
fclose
delete
getchar
getw
fopen
putw
puts
putc
ungetc
fgets
feof
frec
ferr
ferror
fmkdl
rewind
ftty
isatty
fgetname
fwild
fseek
ftell
fspool
clearerr
fclear
fill
maxmin
maxmin
maxmin
maxmin
index
strchr
inchr
rindex
strrchr
index
strchr
$$main
clearerr
fclear
iov
routine called on exit
Dummy
profile data after exit
Print
Error exit from C programs
Normal exit from C programs
$$exst -- Exit status code
$$ferr -- File error value
$$ferr -- File error value
-- Profile output file
$$pfil
Close an open file
Delete a named file
one character from a file
Get
binary integer from a file
Input a
Open or reopen a file
a binary integer to a file
Output
Output a string to a file
one character to a file
Output
back onto an input file
Push
Read a string from a file
Test for end of file
if record-oriented file
Test
Test for file error
Test for file error
Mark file for deletion
Rewind a file for re-reading
Test if a file is a terminal
Test if a file is a terminal
Convert file name to Ascii
Wild-card file open
Reposition file pointer (seek)
subsequent seek
Get file position for
queue
Spool file to default print
Clear open file's error flags
Clear open file's error flags
with a character
Fill a block of memory
numbers
Find maximum of two
unsigned numbers
Find maximum of two
numbers
Find minimum of two
unsigned numbers
Find minimum of two
of a character in a stringd the first instance
of a character in a stringd the first instance
character in a string Find the index of a
of a character in a stringd the last instance
of a character in a stringd the last instance
character in aFind the first instance of a
character in aFind the first instance of a
-- RT-11 Ctrl/C flag
$$scca
open file's error flags
Clear
open file's error flags
Clear
I/O system internal flags and vectors
floor
fabs
fmod
atod
atof
Floor and Ceiling Floating
Floating
Floating
Convert Ascii to floating
Convert Ascii to floating
Point Functions
absolute value
modulus
point
point
C Compiler and Library
Page A-6
Library Index
fps
floor
floor
fflush
fprintf
sprintf
$$scan
fscanf
scanf
sscanf
$$prnt
printf
call
callc
fps
malloc
envsave
envsave
floor
irand
rand
gettty
ftell
fileno
flun
getchar
msize
copy
sleep
$$main
unwind
setjmp
isgraph
traps
itoax
isxdigit
iov
screen
iov
iov
$$main
$$main
$$main
$$main
ftty
isatty
isalloc
frec
wdleng
(FPS)
Set floating point status
Floating Point Functionsloor and Ceiling
<= x
floor(x) largest value
Flush output buffers
Formatted Conversion
Formatted Conversion
conversion
Formatted input
conversion
Formatted input
conversion
Formatted input
conversion
Formatted input
Formatted output
Formatted output
C
Call (Fortran) subroutine from
C
Call (Fortran) subroutine from
point status (FPS)
Set floating
Allocate and free memory
Save and restore function context
Multi-level function return
Floating Point FunctionFloor and Ceiling
Random number generator
Random number generator
name
Get control terminal
subsequent seek
Get file position for
Get logical unit number
Get logical unit number
file
Get one character from a
block
Get size of a memory
Copy a given number of bytes
Delay job a given number of seconds
C library global variables
Execute non-local goto
-- execute non-local goto
longjmp
Test for graphic argument
Operating system trap handlers
Convert integer to hexadecimal Ascii
Test for hexadecimal digit
I/O error codes
Screen I/O primitives
flags and vectors
I/O system internal
I/O vector definition
-- Operating system id.
$$opsy
$$pos -- Test if P/OS (Professional)
$$rsts -- Test if RSTS/E
$$vms -- Test if VMS emulation
Test if a file is a terminal
Test if a file is a terminal
allocated memory Check if a pointer points to
Test if record-oriented file
Machine independent sizeof(int)
inchr
$$init
calloc
getw
fget
a string
Find the
C program
Allocate and
from a file
index of a character in
initialization
initialize memory
Input a binary integer
Input a binary record
C Compiler and Library
Page A-7
Library Index
fread
$$scan
fscanf
scanf
sscanf
ungetc
index
strchr
rindex
strrchr
swabi
atoi
getw
itoa
putw
itoax
itoa8
iov
$$main
ftty
isatty
sleep
floor
rindex
strrchr
strlen
perror
$$main
profile
$$gcmd
gets
$$link
rtemt
peek
fileno
flun
atol
setjmp
setjmp
tolower
islower
toupper
wdleng
$$main
fmkdl
maxmin
maxmin
alloc
malloc
Formatted
Formatted
Formatted
Formatted
Push back onto an
in a strFind the first
in a strFind the first
in a striFind the last
in a striFind the last
Byte swap an
Convert string to
Input a binary
Convert
Output a binary
Ascii
Convert
Convert
vectors
I/O system
$$tick -- Clock
Test if a file
Test if a file
seconds
Delay
floor(x)
character in aFind the
character in aFind the
Compute
Print
C
-- Profile entry per
Parse command
Read a
Print memory
a RT11 EMT after
Peek at a
Get
Get
Convert string to
-- save state for
non-local goto
Convert upper-case to
argument
Test for
Convert
sizeof(int)
C
Find
Find
Allocate
Allocate and free
numbers
Input a record
input conversion
input conversion
input conversion
input conversion
input file
instance of a character
instance of a character
instance of a character
instance of a character
integer
integer
integer from a file
integer to Ascii
integer to a file
integer to hexadecimal
integer to octal Ascii
internal flags and
interrupt rate
is a terminal
is a terminal
job a given number of
largest value <= x
last instance of a
last instance of a
length of a string
library error message
library global variables
line
$$prnl
line
line from stdin
list
loading r0
Execute
location in RSTS/E
logical unit number
logical unit number
long
longjmp
setjmp
longjmp -- execute
lower-case
lower-case alphabetic
lower-case to upper-case
Machine independent
main program
Mark file for deletion
maximum of two numbers
maximum of two unsigned
memory
memory
calloc
isalloc
zero
realloc
$$mchk
and initialize
points to allocated
Clear a block of
Reallocate
pointers
Verify
memory
Allocate
memory Check if a pointer
memory
memory
memory allocation
C Compiler and Library
Page A-8
Library Index
msize
sbrk
$$link
memdmp
brk
fill
perror
msg
maxmin
maxmin
trace
fmod
envsave
$$main
gettty
caller
fgetname
delete
$$narg
unwind
setjmp
exit
$$prmt
fileno
flun
irand
rand
copy
sleep
maxmin
maxmin
maxmin
maxmin
itoa8
getchar
putc
strncpy
ungetc
strcat
strncat
fopen
fwild
fclose
clearerr
fclear
$$main
traps
sbrk
$$main
Get size of a memory block
Allocate memory from operating
Print memory list
Dump memory or registers
Change top of memory pointer
Fill a block of memory with a character
Print library error message
terminal
Print a message on the command
Find minimum of two numbers
numbers
Find minimum of two unsigned
Profile support module (with trace)
Floating modulus
return
Multi-level function
-- RSX-11M task name
$$task
Get control terminal name
Return name of profiled caller
Convert file name to Ascii
Delete a named file
startup
Define $$narg default for RT11
Execute non-local goto
longjmp -- execute non-local goto
programs
Normal exit from C
Null prompt pointer
Get logical unit number
Get logical unit number
Random number generator
Random number generator
Copy a given number of bytes
Delay job a given number of seconds
Find maximum of two numbers
of two unsigned numbers
Find maximum
Find minimum of two numbers
of two unsigned numbers
Find minimum
Convert integer to octal Ascii
file
Get one character from a
Output one character to a file
with count
Copy one string to another,
Push back onto an input file
Concatenate a string onto another
Concatenate a string onto another, with count
Open or reopen a file
Wild-card file open
Close an open file
Clear open file's error flags
Clear open file's error flags
$$opsy -- Operating system id.
handlers
Operating system trap
Allocate memory from operating system
variables
Operating-system unique
system
$$main
memdmp
fopen
putw
fput
id.
to a file
$$opsy -- Operating system
Dump memory or registers
Open or reopen a file
Output a binary integer
Output a binary record
C Compiler and Library
Page A-9
Library Index
fwrite
puts
putc
$$prnt
printf
fflush
profile
$$main
$$gcmd
calltr
peek
profile
profile
floor
$$main
atod
atof
fps
brk
$$prmt
fseek
isalloc
$$mchk
isalloc
$$main
ftell
screen
msg
perror
$$link
profile
fspool
isprint
profile
$$main
profile
profile
trace
profile
caller
$$main
csv$
$$init
abort
error
exit
$$prmt
ispunct
ungetc
Output a record
Output a string to a
Output one character to
Formatted output
Formatted output
Flush output buffers
$$pfil -- Profile output file
$$pos -- Test if P/OS (Professional)
Parse command line
Trace path to the caller
RSTS/E
Peek at a location in
-- Profile entry per line
$$prnl
file
$$pfil -- Profile output
and Ceiling Floating Point Functions
Floor
$$stnd -- Stack end point
Ascii to floating point
Convert
Ascii to floating point
Convert
Set floating point status (FPS)
Change top of memory pointer
Null prompt pointer
Reposition file pointer (seek)
allocated meCheck if a pointer points to
memory allocation pointers
Verify
memoCheck if a pointer points to allocated
(Professional)
$$pos -- Test if P/OS
seek
Get file position for subsequent
Screen I/O primitives
command terminal
Print a message on the
message
Print library error
Print memory list
exit
Print profile data after
Spool file to default print queue
Test for printable argument
per line
$$prnl -- Profile entry
-- Test if P/OS (Professional)
$$pos
$$prnl -- Profile entry per line
$$pfil -- Profile output file
(with trace)
Profile support module
Print profile data after exit
Return name of profiled caller
C main program
environment
C program execution
C program initialization
Abort program with a BPT trap
Error exit from C programs
Normal exit from C programs
Null prompt pointer
Test for punctuation argument
file
Push back onto an input
file
a file
qset
fspool
rtemt
ascr50
r50toa
entries to the RT11
file to default print
EMT after loading
Convert Ascii to
Convert
queue
Add
queue
Spool
r0
Execute a RT11
Radix-50
Radix-50 to Ascii
C Compiler and Library
Page A-10
Library Index
irand
rand
$$main
rewind
gets
fgets
kbin
kbinr
realloc
fread
fget
fwrite
fput
frec
csv$
memdmp
fopen
fseek
csv$
envsave
caller
envsave
rewind
wrapup
rstsys
$$main
$$main
peek
$$main
$$main
$$main
rtemt
qset
$$narg
$$ctim
$$utim
envsave
csv$
setjmp
$$main
screen
sleep
ftell
fseek
fps
setjmp
msize
wdleng
floor
Random number generator
Random number generator
-- Clock interrupt rate
$$tick
Rewind a file for re-reading
Read a line from stdin
file
Read a string from a
without delimiters
Read from the terminal
terminal read withouDelimiter-free
Reallocate memory
Input a record
Input a binary record
Output a record
Output a binary record
Test if record-oriented file
restore
C register save and
Dump memory or registers
Open or reopen a file
(seek)
Reposition file pointer
C register save and restore
Save and restore function context
caller
Return name of profiled
Multi-level function return
re-reading
Rewind a file for
Dummy routine called on exit
Execute a RSTS EMT
$$rsts -- Test if RSTS/E
$$rsts -- Test if RSTS/E
Peek at a location in RSTS/E
$$uic -- RSX-11M default UIC
$$task -- RSX-11M task name
$$scca -- RT-11 Ctrl/C flag
r0
Execute a RT11 EMT after loading
Add entries to the RT11 queue
$$narg default for RT11 startup
Define
Convert $$rtim buffer to Ascii
Convert $$rtim buffer to Unix time
function context
Save and restore
C register save and restore
setjmp -- save state for longjmp
flag
$$scca -- RT-11 Ctrl/C
Screen I/O primitives
job a given number of seconds
Delay
for subsequent seek
Get file position
file pointer (seek)
Reposition
status (FPS)
Set floating point
longjmp
setjmp -- save state for
Get size of a memory block
Machine independent sizeof(int)
ceil(x) smallest value >= x
fspool
$$main
$$narg
setjmp
fps
print queue
$$stnd -default for RT11
setjmp -- save
Set floating point
Spool file to default
Stack end point
startup
Define $$narg
state for longjmp
status (FPS)
C Compiler and Library
Page A-11
Library Index
exit
exit
gets
$$main
cpystr
strlen
strcpy
index
strchr
inchr
rindex
strrchr
strneq
fgets
strcat
strncat
puts
strncpy
atoi
atol
strcmp
concat
streq
strncmp
call
callc
ftell
trace
swabb
swabi
sbrk
$$main
iov
traps
ctype
$$main
$$main
msg
ftty
isatty
gettty
kbinr
kbin
isascii
isalpha
isalnum
iscntrl
isdigit
feof
$$exst -- Exit status code
Exit with status code
Read a line from stdin
$$stnd -- Stack end point
String copy
Compute length of a string
Copy a string
of a character in a stFind the first instance
of a character in a stFind the first instance
of a character in a string
Find the index
of a character in a strFind the last instance
of a character in a strFind the last instance
count
Test string equality, with
Read a string from a file
Concatenate a string onto another
with counConcatenate a string onto another,
Output a string to a file
count
Copy one string to another, with
Convert string to integer
Convert string to long
Compare strings
Concatenate strings
Test strings for equality
Compare strings, with count
Call (Fortran) subroutine from C
Call (Fortran) subroutine from C
Get file position for subsequent seek
trace)
Profile support module (with
Swap bytes in a buffer
Byte swap an integer
memory from operating system
Allocate
$$opsy -- Operating system id.
and vectors
I/O system internal flags
Operating system trap handlers
classification type table
Character
name
$$task -- RSX-11M task
$$task -- RSX-11M task name
on the command terminal Print a message
Test if a file is a terminal
Test if a file is a terminal
Get control terminal name
waiting Delimiter-free terminal read without
delimiterRead from the terminal without
Test for 7-bit Ascii
argument
Test for alphabetic
argument
Test for alphanumeric
character argument
Test for control
Test for digit argument
Test for end of file
ferr
ferror
isgraph
isxdigit
islower
argument
digit
alphabetic argument
Test
Test
Test
Test
Test
for
for
for
for
for
file error
file error
graphic
hexadecimal
lower-case
C Compiler and Library
Page A-12
Library Index
isprint
ispunct
isupper
isspace
$$main
$$main
$$main
ftty
isatty
frec
strneq
streq
$$main
$$utim
ctime
$$rtim
time
tod
ftime
localtime
ctime
brk
calltr
trace
setcc
abort
traps
maxmin
maxmin
maxmin
maxmin
ctype
$$main
$$main
$$main
fileno
flun
$$utim
maxmin
maxmin
toupper
isupper
tolower
iov
abs
fabs
floor
floor
ctime
argument
Test for printable
argument
Test for punctuation
alphabetic argument
Test for upper-case
argument
Test for whitespace
(Professional)$$pos -- Test if P/OS
$$rsts -- Test if RSTS/E
$$vms -- Test if VMS emulation
terminal
Test if a file is a
terminal
Test if a file is a
file
Test if record-oriented
with count
Test string equality,
equality
Test strings for
rate
$$tick -- Clock interrupt
$$rtim buffer to Unix time
Convert
asctime Convert time buffer to ascii
Date and time conversion
Compute time of day
Compute time of day
Compute time of day (augmented)
Build time of day buffer
Convert time value to ascii
Change top of memory pointer
Trace path to the caller
support module (with trace)
Profile
Trap Control/C
program with a BPT trap
Abort
Operating system trap handlers
Find maximum of two numbers
Find minimum of two numbers
Find maximum of two unsigned numbers
Find minimum of two unsigned numbers
classification type table
Character
-- RSX-11M default UIC
$$uic
UIC
$$uic -- RSX-11M default
Operating-system unique variables
Get logical unit number
Get logical unit number
$$rtim buffer to Unix time
Convert
Find maximum of two unsigned numbers
Find minimum of two unsigned numbers
Convert lower-case to upper-case
argument
Test for upper-case alphabetic
Convert upper-case to lower-case
$$ferr -- File error value
Absolute value
Floating absolute value
floor(x) largest value <= x
ceil(x) smallest value >= x
Convert time value to ascii
$$main
$$main
iov
iov
$$mchk
C library global
unique
I/O
internal flags and
pointers
variables
variablesOperating-system
vector definition
vectors
I/O system
Verify memory allocation
C Compiler and Library
Page A-13
Library Index
$$main
$$main
kbinr
$$ctim
isspace
fwild
kbin
kbinr
floor
$$vms -- Test if VMS emulation
emulation
$$vms -- Test if VMS
terminal read without waiting
Delimiter-free
Compute day of week
Test for whitespace argument
Wild-card file open
from the terminal without delimiters
Read
terminal read without waiDelimiter-free
smallest value >= x
ceil(x)
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement