Chapter Contents

Previous

Next
All-Resident C Programs

Library Organization

It is important to remember that many functions in the C library do not depend on transient support routines. String functions such as strcmp and math functions such as cos are examples of such functions. Complex functions or functions that interact closely and frequently with the operating system are likely to be transient. For instance, I/O functions such as fopen and signal-handling functions such as alarm are implemented as calls to transient support routines.

These library support routines do not necessarily form a one-to-one correspondence with the calling function. Often, support routines can be shared among several callers, and closely related routines can be packaged together. For example, fopen and afopen share some support routines, and all of the support routines for performing I/O to VSAM data sets are packaged as a unit.

Another important point to remember is that it is not possible to identify exactly, at link time, the smallest set of support routines required by a given program. For example, the linker can be relied upon to include the strstr function only if the program contains an external reference for the function, but it is impossible to determine that no VSAM files will be opened by examining the external reference for fopen . In many cases, even the programmer cannot predict which support routines will be required.


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.