Chapter 1. Introduction

Table of Contents
1.1. Program Startup
1.2. Program Termination
1.3. Standard Headers
1.4. Errors <errno.h>
1.5. Limits <float.h> and <limits.h>
1.6. Common definitions <stddef.h>

XGC is a conforming free standing implementation of ANSI C as specified in Section 4 of the ANSI C Standard. This means there is no host environment and the means for starting a program, the effect of program termination and the library facilities are implementation defined.

The standard header files <float.h>, <limits.h>, <stdarg.h> and <stddef.h> are supported as defined by ANSI C.

The remaining standard header files <assert.h> , <ctype.h> , <errno.h> , <locale.h> , <math.h> , <setjmp.h>, <signal.h>, <stdio.h> , <stdlib.h> , <string.h> and <time.h> are also supported, but only to the extent that makes sense for a program running on an embedded target computer. In particular, the functions from <stdio.h> that work with files other than the standard files, are not supported.

The XGC run-time system and libraries comprise the following components:

The library is written in C, using assembly language where appropriate. Programs written in other languages, such as Ada 95 may also use the libraries by including the appropriate interface definitions or bindings.

1.1. Program Startup

The entry point is in the run-time system module crt0, which initializes the processor and the high level language environment before executing any static constructors and calling the application program main function.

The function main can be defined with no parameters, as follows:

Example 1-1. Function main

int
main (void) 
{ 
  /* ... */ 
}

It may also be defined with two parameters referred to here as argc and argv, though any names may be used, as they are local to the function in which they are declared.

Example 1-2. Function main with arguments

int
main (int argc, char *argv []) 
{ 
  /* ... */ 
}

The main function is always called with argc = 0. The value of argv is therefore undefined.