gtpa2m47Application Programming

Installing Additional ISO-C Library Functions

There are several mechanisms at work to create library functions for ISO-C.

Prelinking and Linking

Function libraries are nothing more than previously compiled code that can be used by newly compiled code for some purpose. Frequently used ISO-C code can be collected into common library routines available to all ISO-C programs. System programmers may create site dependent versions of C input/output functions (like gets and puts). Similarly, extensions to ISO-C libraries can be used to enforce common programming techniques and support specific kinds of data. These libraries can be used with the libraries shipped by IBM to enhance the C programming environment.

The process of making code in libraries available to user programs is called linkage. It is performed by a linkage editor. In ISO-C, there is prelinkage before linkage.

Functions that are called in the user program are represented in the stub library. For example, the user can call for the malloc function in their program. There is a stub for malloc which consists of a library lookup for the code that actually implements the action of malloc.

The library vector (LIBVEC) consists of slots for addresses that show the location of each function in the library. The linkage editor uses the library vector and the composite object file to create the load module containing the machine code and relocation information for the user's program. The load module ultimately is loaded and run on TPF. See Figure 66 to see how the offline support of ISO-C relates to the online support.

Figure 66. ISO-C Compile, Link, and Load Process