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 your program source by a pre-processor command of the form: #include C Runtime Support Library Page 4-2 ctype Character test macros and global definitions 4.1 Character test macros and global definitions _________ ____ ______ ___ ______ ___________ ********* * ctype * ********* NAME: ctype -- Character test macros and global definitions SYNOPSIS: #include 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) /* Upper case alphabetic */ islower(c) /* Lower case alphabetic */ isalpha(c) /* Alphabetic in any case */ isdigit(c) /* Decimal digit */ isalnum(c) /* Alphabetic or digit */ isxdigit(c) /* Hexadecimal digit */ isspace(c) /* Space or tab */ ispunct(c) /* Punctuation */ isgraph(c) /* Visible character */ isprint(c) /* Printable character */ iscntrl(c) /* Control character */ isascii(c) /* 7-bit Ascii character */ _toupper(c) /* Lower case convert to Upper */ _tolower(c) /* Upper case convert to Lower */ toascii(c) /* 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: C Runtime Support Library Page 4-3 fps Bit definitions for the floating point status word 4.2 Bit definitions for the floating point status word ___ ___________ ___ ___ ________ _____ ______ ____ ******* * fps * ******* NAME: fps -- Bit definitions for the floating point status word SYNOPSIS: #include DESCRIPTION: This module defines common definitions for the FP-11 floating point status word. The following are defined: FER 0100000 Floating error (sense/reset) FID 0040000 Disable all interrupts FIUV 0004000 Interrupt on undefined variable FIU 0002000 Interrupt on underflow FIV 0001000 Interrupt on overflow FIC 0000400 Interrupt on int. conv. error FD 0000200 Double precision mode FL 0000100 Long integer mode FT 0000040 Chop mode FN 0000010 Floating negative (sense) FZ 0000004 Floating zero (sense) FV 0000002 Floating overflow (sense) FC 0000001 Floating carry (sense) C Runtime Support Library Page 4-4 initial Specify Initializers and Finalizers 4.3 Specify Initializers and Finalizers _______ ____________ ___ __________ *********** * initial * *********** NAME: initial -- Specify Initializers and Finalizers SYNOPSIS: #include 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 C Runtime Support Library Page 4-5 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. The defining module includes the calls: 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 DECUS C dsect commands; hence, very non-portable. It may be possible to provide the same C Runtime Support Library Page 4-6 initial Specify Initializers and Finalizers functionality using different techniques; if not, what's wrong with your implementation? AUTHOR: Jerry Leichter C Runtime Support Library Page 4-7 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 ... 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 year; G.TIYR year - 1900 int month; G.TIMO Jan. = 1 int day; G.TIDA int hour; G.TIHR 00 .. 23 int minute; G.TIMI 00 .. 59 int second; G.TISC 00 .. 59 int tick; G.TICT 00 .. tsec-1 int tsec; G.TICP tick/second }; BUGS: Oboslete, use time() and localtime() instead. C Runtime Support Library Page 4-8 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 DESCRIPTION: This defines the jmp_buf array that is used for the setjmp() and longjmp() functions. BUGS: C Runtime Support Library Page 4-9 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 DESCRIPTION: 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 and return pointers to objects of this type. NULL I/O routines signal "rejection" by returning a null pointer. EOF The get character routine returns this value to signal end of file. TRUE The value 1. 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 are not present in on some other C systems. If you compile with the /r switch (-r on RSX modes) or #define rsts before #include , 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 ... extern struct tm *localtime(); DESCRIPTION: This header file defines the structure of the time buffer used by the standard library localtime() function. It is defined as follows: struct tm { int tm_sec; /* Seconds */ int tm_min; /* Minutes */ int tm_hour; /* Hours */ int tm_mday; /* Day in month */ int tm_mon; /* Month */ int tm_year; /* Year */ int tm_wday; /* Weekday */ int tm_yday; /* Days since Jan 1 */ int tm_isdst; /* 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 ... extern long ftime(); DESCRIPTION: This header file defines the structure of the timeb buffer used by the standard library ftime() function. It is defined as follows: struct timeb { long time; unsigned milltim; short timezone; short 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 Convert to 7-bit Ascii isascii Test for 7-bit Ascii abort trap Abort program with a BPT abs Absolute value fabs Floating absolute value qset queue Add entries to the RT11 profile Print profile data after exit rtemt Execute a RT11 EMT after loading r0 malloc Allocate and free memory calloc memory Allocate and initialize alloc Allocate memory sbrk operating system Allocate memory from isalloc a pointer points to allocated memory Check if $$mchk Verify memory allocation pointers isalpha Test for alphabetic argument islower Test for lower-case alphabetic argument isupper Test for upper-case alphabetic argument isalnum Test for alphanumeric argument strcat a string onto another Concatenate strncat a string onto another, with Concatenate strncpy Copy one string to another, with count isalpha Test for alphabetic argument isalnum Test for alphanumeric argument iscntrl for control character argument Test isdigit Test for digit argument isgraph Test for graphic argument islower lower-case alphabetic argument Test for isprint Test for printable argument ispunct Test for punctuation argument isupper upper-case alphabetic argument Test for isspace Test for whitespace argument $$ctim $$rtim buffer to Ascii Convert r50toa Convert Radix-50 to Ascii fgetname Convert file name to Ascii itoa Convert integer to Ascii C Compiler and Library Page A-2 Library Index itoax to hexadecimal Ascii Convert integer itoa8 integer to octal Ascii Convert toascii Convert to 7-bit Ascii isascii Test for 7-bit Ascii ascr50 Convert Ascii to Radix-50 atod Convert Ascii to floating point atof Convert Ascii to floating point ctime Convert time value to ascii ctime time buffer to ascii asctime Convert ctime buffer to ascii asctime Convert time peek Peek at a location in RSTS/E ftime Compute time of day (augmented) ungetc Push back onto an input file getw file Input a binary integer from a putw Output a binary integer to a file fget Input a binary record fput Output a binary record msize Get size of a memory block zero Clear a block of memory fill character Fill a block of memory with a abort Abort program with a BPT trap localtime Build time of day buffer swabb Swap bytes in a buffer $$ctim Convert $$rtim buffer to Ascii $$utim Convert $$rtim buffer to Unix time ctime asctime Convert time buffer to ascii fflush Flush output buffers localtime Build time of day buffer swabi Byte swap an integer copy a given number of bytes Copy swabb Swap bytes in a buffer call subroutine from C Call (Fortran) callc subroutine from C Call (Fortran) $$main variables C library global $$main C main program csv$ environment C program execution $$init C program initialization error Error exit from C programs exit Normal exit from C programs csv$ restore C register save and call subroutine from C Call (Fortran) callc subroutine from C Call (Fortran) wrapup Dummy routine called on exit caller name of profiled caller Return calltr Trace path to the caller brk pointer Change top of memory ctype type table Character classification fill of memory with a character Fill a block iscntrl Test for control character argument getchar Get one character from a file index first instance of a character in a stFind the strchr first instance of a character in a stFind the inchr Find the index of a character in a string rindex last instance of a character in a stFind the C Compiler and Library Page A-3 Library Index strrchr last instance of a character in a stFind the putc Output one character to a file isalloc points to allocated memoryck if a pointer ctype table Character classification type zero Clear a block of memory clearerr flags Clear open file's error fclear flags Clear open file's error $$main $$tick -- Clock interrupt rate fclose Close an open file exit $$exst -- Exit status code exit Exit with status code iov I/O error codes $$gcmd Parse command line msg a message on the command terminal Print strcmp Compare strings strncmp count Compare strings, with $$ctim Compute day of week strlen string Compute length of a time Compute time of day tod Compute time of day ftime (augmented) Compute time of day strcat onto another Concatenate a string strncat onto another, with countoncatenate a string concat Concatenate strings envsave and restore function context Save iscntrl argument Test for control character gettty Get control terminal name setcc mode only) Trap Control/C (RSTS/E RT11 fprintf Formatted Conversion sprintf Formatted Conversion $$rtim Date and time conversion $$scan Formatted input conversion fscanf Formatted input conversion scanf Formatted input conversion sscanf Formatted input conversion $$ctim Ascii Convert $$rtim buffer to $$utim Unix time Convert $$rtim buffer to ascr50 Radix-50 Convert Ascii to atod floating point Convert Ascii to atof floating point Convert Ascii to r50toa Ascii Convert Radix-50 to fgetname Ascii Convert file name to itoa Convert integer to Ascii itoax hexadecimal Ascii Convert integer to itoa8 Ascii Convert integer to octal toupper upper-case Convert lower-case to atoi integer Convert string to atol Convert string to long ctime ascii asctime Convert time buffer to ctime ascii Convert time value to toascii Convert to 7-bit Ascii tolower lower-case Convert upper-case to copy bytes Copy a given number of strcpy Copy a string C Compiler and Library Page A-4 Library Index strncpy another, with count Copy one string to cpystr String copy strncmp Compare strings, with count strncat onto another, with countConcatenate a string strncpy to another, with count Copy one string strneq string equality, with count Test $$main $$scca -- RT-11 Ctrl/C flag profile Print profile data after exit $$rtim Date and time conversion time Compute time of day tod Compute time of day ftime Compute time of day (augmented) localtime Build time of day buffer $$ctim Compute day of week $$main $$uic -- RSX-11M default UIC $$narg Define $$narg default for RT11 startup fspool Spool file to default print queue $$narg for RT11 startup Define $$narg default iov I/O vector definition sleep of seconds Delay job a given number delete Delete a named file fmkdl Mark file for deletion kbinr read without waiting Delimiter-free terminal kbin the terminal without delimiters Read from isxdigit Test for hexadecimal digit isdigit Test for digit argument wrapup exit Dummy routine called on memdmp Dump memory or registers rstsys Execute a RSTS EMT rtemt Execute a RT11 EMT after loading r0 $$main $$vms -- Test if VMS emulation feof Test for end of file $$main $$stnd -- Stack end point qset queue Add entries to the RT11 profile $$prnl -- Profile entry per line csv$ C program execution environment streq Test strings for equality strneq Test string equality, with count error programs Error exit from C ferr Test for file error ferror Test for file error iov I/O error codes clearerr Clear open file's error flags fclear Clear open file's error flags perror Print library error message iov $$ferr -- File error value rstsys Execute a RSTS EMT rtemt loading r0 Execute a RT11 EMT after unwind Execute non-local goto setjmp longjmp -- execute non-local goto csv$ C program execution environment exit $$exst -- Exit status code exit Exit with status code wrapup routine called on exit Dummy C Compiler and Library Page A-5 Library Index profile profile data after exit Print error Error exit from C programs exit Normal exit from C programs exit $$exst -- Exit status code iov $$ferr -- File error value iov $$ferr -- File error value profile -- Profile output file $$pfil fclose Close an open file delete Delete a named file getchar one character from a file Get getw binary integer from a file Input a fopen Open or reopen a file putw a binary integer to a file Output puts Output a string to a file putc one character to a file Output ungetc back onto an input file Push fgets Read a string from a file feof Test for end of file frec if record-oriented file Test ferr Test for file error ferror Test for file error fmkdl Mark file for deletion rewind Rewind a file for re-reading ftty Test if a file is a terminal isatty Test if a file is a terminal fgetname Convert file name to Ascii fwild Wild-card file open fseek Reposition file pointer (seek) ftell subsequent seek Get file position for fspool queue Spool file to default print clearerr Clear open file's error flags fclear Clear open file's error flags fill with a character Fill a block of memory maxmin numbers Find maximum of two maxmin unsigned numbers Find maximum of two maxmin numbers Find minimum of two maxmin unsigned numbers Find minimum of two index of a character in a stringd the first instance strchr of a character in a stringd the first instance inchr character in a string Find the index of a rindex of a character in a stringd the last instance strrchr of a character in a stringd the last instance index character in aFind the first instance of a strchr character in aFind the first instance of a $$main -- RT-11 Ctrl/C flag $$scca clearerr open file's error flags Clear fclear open file's error flags Clear iov I/O system internal flags and vectors fabs Floating absolute value atod Convert Ascii to floating point atof Convert Ascii to floating point fps (FPS) Set floating point status fflush Flush output buffers fprintf Formatted Conversion C Compiler and Library Page A-6 Library Index sprintf Formatted Conversion $$scan conversion Formatted input fscanf conversion Formatted input scanf conversion Formatted input sscanf conversion Formatted input $$prnt Formatted output printf Formatted output call C Call (Fortran) subroutine from callc C Call (Fortran) subroutine from fps point status (FPS) Set floating malloc Allocate and free memory envsave Save and restore function context envsave Multi-level function return irand Random number generator rand Random number generator gettty name Get control terminal ftell subsequent seek Get file position for fileno Get logical unit number flun Get logical unit number getchar file Get one character from a msize block Get size of a memory copy Copy a given number of bytes sleep Delay job a given number of seconds $$main C library global variables unwind Execute non-local goto setjmp -- execute non-local goto longjmp isgraph Test for graphic argument traps Operating system trap handlers itoax Convert integer to hexadecimal Ascii isxdigit Test for hexadecimal digit iov I/O error codes screen Screen I/O primitives iov flags and vectors I/O system internal iov I/O vector definition $$main -- Operating system id. $$opsy $$main $$pos -- Test if P/OS (Professional) $$main $$rsts -- Test if RSTS/E $$main $$vms -- Test if VMS emulation ftty Test if a file is a terminal isatty Test if a file is a terminal isalloc allocated memory Check if a pointer points to frec Test if record-oriented file wdleng Machine independent sizeof(int) inchr a string Find the index of a character in $$init C program initialization calloc Allocate and initialize memory getw from a file Input a binary integer fget Input a binary record fread Input a record $$scan Formatted input conversion fscanf Formatted input conversion scanf Formatted input conversion sscanf Formatted input conversion ungetc Push back onto an input file C Compiler and Library Page A-7 Library Index index in a strFind the first instance of a character strchr in a strFind the first instance of a character rindex in a striFind the last instance of a character strrchr in a striFind the last instance of a character swabi Byte swap an integer atoi Convert string to integer getw Input a binary integer from a file itoa Convert integer to Ascii putw Output a binary integer to a file itoax Ascii Convert integer to hexadecimal itoa8 Convert integer to octal Ascii iov vectors I/O system internal flags and $$main $$tick -- Clock interrupt rate ftty Test if a file is a terminal isatty Test if a file is a terminal sleep seconds Delay job a given number of rindex character in aFind the last instance of a strrchr character in aFind the last instance of a strlen Compute length of a string perror Print library error message $$main C library global variables profile -- Profile entry per line $$prnl $$gcmd Parse command line gets Read a line from stdin $$link Print memory list rtemt a RT11 EMT after loading r0 Execute peek Peek at a location in RSTS/E fileno Get logical unit number flun Get logical unit number atol Convert string to long setjmp -- save state for longjmp setjmp setjmp non-local goto longjmp -- execute tolower Convert upper-case to lower-case islower argument Test for lower-case alphabetic toupper Convert lower-case to upper-case wdleng sizeof(int) Machine independent $$main C main program fmkdl Mark file for deletion maxmin Find maximum of two numbers maxmin numbers Find maximum of two unsigned alloc Allocate memory malloc Allocate and free memory calloc and initialize memory Allocate isalloc points to allocated memory Check if a pointer zero Clear a block of memory realloc Reallocate memory $$mchk pointers Verify memory allocation msize Get size of a memory block sbrk system Allocate memory from operating $$link Print memory list memdmp Dump memory or registers brk Change top of memory pointer fill Fill a block of memory with a character perror Print library error message C Compiler and Library Page A-8 Library Index msg terminal Print a message on the command maxmin Find minimum of two numbers maxmin numbers Find minimum of two unsigned setcc (RSTS/E RT11 mode only) Trap Control/C trace Profile support module (with trace) envsave return Multi-level function $$main -- RSX-11M task name $$task gettty Get control terminal name caller Return name of profiled caller fgetname Convert file name to Ascii delete Delete a named file $$narg startup Define $$narg default for RT11 unwind Execute non-local goto setjmp longjmp -- execute non-local goto exit programs Normal exit from C $$prmt Null prompt pointer fileno Get logical unit number flun Get logical unit number irand Random number generator rand Random number generator copy Copy a given number of bytes sleep Delay job a given number of seconds maxmin Find maximum of two numbers maxmin of two unsigned numbers Find maximum maxmin Find minimum of two numbers maxmin of two unsigned numbers Find minimum itoa8 Convert integer to octal Ascii getchar file Get one character from a putc Output one character to a file strncpy with count Copy one string to another, setcc (RSTS/E RT11 mode only) Trap Control/C ungetc Push back onto an input file strcat Concatenate a string onto another strncat Concatenate a string onto another, with count fopen Open or reopen a file fwild Wild-card file open fclose Close an open file clearerr Clear open file's error flags fclear Clear open file's error flags $$main $$opsy -- Operating system id. traps handlers Operating system trap sbrk Allocate memory from operating system $$main variables Operating-system unique $$main id. $$opsy -- Operating system memdmp Dump memory or registers fopen Open or reopen a file putw to a file Output a binary integer fput Output a binary record fwrite Output a record puts file Output a string to a putc a file Output one character to $$prnt Formatted output printf Formatted output fflush Flush output buffers C Compiler and Library Page A-9 Library Index profile $$pfil -- Profile output file $$main $$pos -- Test if P/OS (Professional) $$gcmd Parse command line calltr Trace path to the caller peek RSTS/E Peek at a location in profile -- Profile entry per line $$prnl profile file $$pfil -- Profile output $$main $$stnd -- Stack end point atod Ascii to floating point Convert atof Ascii to floating point Convert fps Set floating point status (FPS) brk Change top of memory pointer $$prmt Null prompt pointer fseek Reposition file pointer (seek) isalloc allocated meCheck if a pointer points to $$mchk memory allocation pointers Verify isalloc memoCheck if a pointer points to allocated $$main (Professional) $$pos -- Test if P/OS ftell seek Get file position for subsequent screen Screen I/O primitives msg command terminal Print a message on the perror message Print library error $$link Print memory list profile exit Print profile data after fspool Spool file to default print queue isprint Test for printable argument profile per line $$prnl -- Profile entry $$main -- Test if P/OS (Professional) $$pos profile $$prnl -- Profile entry per line profile $$pfil -- Profile output file trace (with trace) Profile support module profile Print profile data after exit caller Return name of profiled caller $$main C main program csv$ environment C program execution $$init C program initialization abort Abort program with a BPT trap error Error exit from C programs exit Normal exit from C programs $$prmt Null prompt pointer ispunct Test for punctuation argument ungetc file Push back onto an input qset entries to the RT11 queue Add fspool file to default print queue Spool rtemt EMT after loading r0 Execute a RT11 ascr50 Convert Ascii to Radix-50 r50toa Convert Radix-50 to Ascii irand Random number generator rand Random number generator $$main -- Clock interrupt rate $$tick rewind Rewind a file for re-reading gets Read a line from stdin fgets file Read a string from a kbin without delimiters Read from the terminal C Compiler and Library Page A-10 Library Index kbinr terminal read withouDelimiter-free realloc Reallocate memory fread Input a record fget Input a binary record fwrite Output a record fput Output a binary record frec Test if record-oriented file csv$ restore C register save and memdmp Dump memory or registers fopen Open or reopen a file fseek (seek) Reposition file pointer csv$ C register save and restore envsave Save and restore function context caller caller Return name of profiled envsave Multi-level function return rewind re-reading Rewind a file for wrapup Dummy routine called on exit rstsys Execute a RSTS EMT $$main $$rsts -- Test if RSTS/E $$main $$rsts -- Test if RSTS/E peek Peek at a location in RSTS/E setcc Trap Control/C (RSTS/E RT11 mode only) $$main $$uic -- RSX-11M default UIC $$main $$task -- RSX-11M task name $$main $$scca -- RT-11 Ctrl/C flag rtemt r0 Execute a RT11 EMT after loading setcc Control/C (RSTS/E RT11 mode only) Trap qset Add entries to the RT11 queue $$narg $$narg default for RT11 startup Define $$ctim Convert $$rtim buffer to Ascii $$utim Convert $$rtim buffer to Unix time envsave function context Save and restore csv$ C register save and restore setjmp setjmp -- save state for longjmp $$main flag $$scca -- RT-11 Ctrl/C screen Screen I/O primitives sleep job a given number of seconds Delay ftell for subsequent seek Get file position fseek file pointer (seek) Reposition fps status (FPS) Set floating point setjmp longjmp setjmp -- save state for msize Get size of a memory block wdleng Machine independent sizeof(int) fspool print queue Spool file to default $$main $$stnd -- Stack end point $$narg default for RT11 startup Define $$narg setjmp setjmp -- save state for longjmp fps Set floating point status (FPS) exit $$exst -- Exit status code exit Exit with status code gets Read a line from stdin $$main $$stnd -- Stack end point cpystr String copy strlen Compute length of a string C Compiler and Library Page A-11 Library Index strcpy Copy a string index of a character in a stFind the first instance strchr of a character in a stFind the first instance inchr of a character in a string Find the index rindex of a character in a strFind the last instance strrchr of a character in a strFind the last instance strneq count Test string equality, with fgets Read a string from a file strcat Concatenate a string onto another strncat with counConcatenate a string onto another, puts Output a string to a file strncpy count Copy one string to another, with atoi Convert string to integer atol Convert string to long strcmp Compare strings concat Concatenate strings streq Test strings for equality strncmp Compare strings, with count call Call (Fortran) subroutine from C callc Call (Fortran) subroutine from C ftell Get file position for subsequent seek trace trace) Profile support module (with swabb Swap bytes in a buffer swabi Byte swap an integer sbrk memory from operating system Allocate $$main $$opsy -- Operating system id. iov and vectors I/O system internal flags traps Operating system trap handlers ctype classification type table Character $$main name $$task -- RSX-11M task $$main $$task -- RSX-11M task name msg on the command terminal Print a message ftty Test if a file is a terminal isatty Test if a file is a terminal gettty Get control terminal name kbinr waiting Delimiter-free terminal read without kbin delimiterRead from the terminal without isascii Test for 7-bit Ascii isalpha argument Test for alphabetic isalnum argument Test for alphanumeric iscntrl character argument Test for control isdigit Test for digit argument feof Test for end of file ferr Test for file error ferror Test for file error isgraph argument Test for graphic isxdigit digit Test for hexadecimal islower alphabetic argument Test for lower-case isprint argument Test for printable ispunct argument Test for punctuation isupper alphabetic argument Test for upper-case isspace argument Test for whitespace $$main (Professional)$$pos -- Test if P/OS $$main $$rsts -- Test if RSTS/E C Compiler and Library Page A-12 Library Index $$main $$vms -- Test if VMS emulation ftty terminal Test if a file is a isatty terminal Test if a file is a frec file Test if record-oriented strneq with count Test string equality, streq equality Test strings for $$main rate $$tick -- Clock interrupt $$utim $$rtim buffer to Unix time Convert ctime asctime Convert time buffer to ascii $$rtim Date and time conversion time Compute time of day tod Compute time of day ftime Compute time of day (augmented) localtime Build time of day buffer ctime Convert time value to ascii brk Change top of memory pointer calltr Trace path to the caller trace support module (with trace) Profile setcc RT11 mode only) Trap Control/C (RSTS/E abort program with a BPT trap Abort traps Operating system trap handlers maxmin Find maximum of two numbers maxmin Find minimum of two numbers maxmin Find maximum of two unsigned numbers maxmin Find minimum of two unsigned numbers ctype classification type table Character $$main -- RSX-11M default UIC $$uic $$main UIC $$uic -- RSX-11M default $$main Operating-system unique variables fileno Get logical unit number flun Get logical unit number $$utim $$rtim buffer to Unix time Convert maxmin Find maximum of two unsigned numbers maxmin Find minimum of two unsigned numbers toupper Convert lower-case to upper-case isupper argument Test for upper-case alphabetic tolower Convert upper-case to lower-case iov $$ferr -- File error value abs Absolute value fabs Floating absolute value ctime Convert time value to ascii $$main C library global variables $$main unique variablesOperating-system iov I/O vector definition iov internal flags and vectors I/O system $$mchk pointers Verify memory allocation $$main $$vms -- Test if VMS emulation $$main emulation $$vms -- Test if VMS kbinr terminal read without waiting Delimiter-free $$ctim Compute day of week isspace Test for whitespace argument fwild Wild-card file open kbin from the terminal without delimiters Read