ANSI C toolset reference manual
August 1990
INMOS document number: 72-TDS-225-00
396 Pages
© INMOS Limited 1990.
Preface
About this Manual
This manual contains information about the Runtime Library functions and the implementation of ANSI C.
The manual is divided into two main parts plus appendices: The two main parts are as follows:
1) Runtime Library. Details of the INMOS C runtime library including summaries of all the header files and reference information about each of the library functions listed in alphabetical order.
2) Language Reference. Reference material for the C language and its implementation in the ANSI C toolset. Contains a summary of the new features in the ANSI standard, details about language extensions, and implementation data.
The Appendices describe the syntax of the language extensions and furnish ANSI compliance data.
Host versions
The manual is designed to cover the following products which represent different host versions of the toolset:
- IMS D7214 - IBM and NEC PC running MS-DOS
- IMS D5214 - Sun 3 systems running SunOS
- IMS D4214 - Sun 4 systems running SunOS
- IMS D6214 - VAX systems running VMS
Contents
Contents overview Contents Preface
Runtime Library
1 Introduction and Runtime Library summary 1.1 Introduction 1.1.1 Reduced library 1.1.2 Accessing library functions 1.1.3 Linking libraries with programs 1.1.4 ISERVER protocols 1.1.5 Functions which require static 1.2 Header files 1.3 ANSI functions 1.3.1 Diagnostics <assert.h> 1.3.2 Character handling <ctype.h> 1.3.3 Error handling <errno.h> 1.3.4 Floating point constants <flost.h> 1.3.5 Implementation limits <limits.h> 1.3.6 Localisation <locale.h> 1.3.7 Mathematics library <math.h> 1.3.8 Non-local jumps <setjmp.h> 1.3.9 Signal handling <signal.h> 1.3.10 Variable arguments <stdarg.h> 1.3.11 Standard definitions <stddef.h> 1.3.12 Standard i/o <stdio.h> Characteristics of file handling 1.3.13 Reduced library i/o functions <stdiored.h> 1.3.14 General utilities <stdlib.h> 1.3.15 String handling <string.h> 1.3.16 Date and time <time.h> 1.4 Concurrency functions 1.4.1 Process control <process.h> 1.4.2 Channel communication <channel.h> 1.4.3 Semaphore handling <semaphor.h> 1.5 Other functions 1.5.1 I/O primitives <iocntrl.h> 1.5.2 float maths <mathf.h> 1.5.3 Host utilities <host.h> 1.5.4 DOS system functions <dos.h> 1.5.5 Miscellaneous functions <misc.h> 2 Alphabetical list of functions 2.1 Format 2.1.1 Reduced library 2.1.2 Macros 2.2 List of functions
Language Reference
3 New features in ANSI C 3.1 Summary of new features in the ANSI standard 3.2 Details of new features 3.2.1 Function declarations 3.2.2 Function prototypes 3.2.3 Declarations 3.2.4 Types and type qualifiers 3.2.5 Constants 3.2.6 Preprocessor extensions Compiler directives Predefined macros: 3.2.7 Structures and unions 3.2.8 Trigraphs Trigraph escape codes 4 Language extensions 4.1 Concurrency support 4.2 Pragmas 4.3 Predefined macros 4.4 Assembly language support 4.4.1 Directives and operations 4.4.2 size option 4.4.3 Labels 4.4.4 Notes on transputer code programming 4.4.5 Useful predefined variables 4.4.6 Transputer code examples Setting the transputer error flag Loading constants using literal operands Labels and jumps Jump tables Loading floating point registers Using align/word to return an element of a table Inserting raw machine code 5 Implementation details 5.1 Data type representation 5.1.1 Scalar types 5.1.2 Arrays 5.1.3 Structures 5.1.4 Unions 5.2 Type conversions 5.2.1 Integers 5.2.2 Floating point 5.3 Compiler diagnostics 5.4 Environment 5.4.1 Arguments to main 5.4.2 Interactive devices 5.5 Identifiers 5.6 Source and execution character sets 5.7 Integer operations 5.8 Registers 5.9 Enumeration types 5.10 Bit fields 5.11 volatile qualifier 5.12 Declarators 5.13 Switch statement 5.14 Preprocessing directives 5.15 Runtime library
Appendices
A Syntax of language extensions A.1 Notation A.2 #pragma directive A.3 __asm statement B ANSI compliance data B.1 Translation B.2 Environment B.3 Identifiers B.4 Characters B.5 Integers B.6 Floating point B.7 Arrays and pointers B.8 Registers B.9 Structures, unions, enumerations, and bit-fields B.10 Qualifiers B.11 Declarators B.12 Statements B.13 Preprocessing directives B.14 Library functions B.15 Locale-specific behaviour Index