INTRO(3) — Silicon Graphics
NAME
intro − introduction to subroutines and libraries
SYNOPSIS
#include <stdio.h>
#include <math.h>
#include <device.h>
#include <get.h>
#include <gl.h>
DESCRIPTION
This section describes functions found in various libraries, other than those functions that directly invoke UNIX system primitives, which are described in Section 2 of this volume. Certain major collections are identified by a letter after the section number:
(3C) These functions, together with those of Section 2 and those marked (3S), constitute the Standard C Library libc, which is automatically loaded by the C compiler, cc(1). The link editor ld(1) searches this library under the −lc option. Declarations for some of these functions may be obtained from #include files indicated on the appropriate pages.
(3S) These functions constitute the “standard I/O package” (see stdio(3S)). These functions are in the library libc, already mentioned. Declarations for these functions may be obtained from the #include file <stdio.h>.
(3M) These functions constitute the Math Library, libm. They are not automatically loaded by the C compiler, cc; however, the link editor searches this library under the −lm option. Declarations for these functions may be obtained from the #include file <math.h>.
(3G) These functions constitute the IRIS Graphics Library which are documented in the IRIS User’s Guide. If the −Zg flag is specified, the C compiler searches this library. Declarations for these functions may be obtained from the #include file <gl.h>. Other constants used by the Graphics Library are defined in <device.h> and <get.h>.
(3B) Berkeley compatibility routines. This library provides compatible implementations of a limited subset of the functions provided by the Standard C Library in the Berkeley 4.3 Distribution of UNIX. Include files needed for routines in this library are in the tree /usr/include/bsd. To compile and link a program that calls (3B) routines, use a compile command of the form:
cc −I/usr/include/bsd prog.c −lbsd
(3N) These functions constitute the internet network library. Compiling instructions are the same as for (3B) routines.
(3R) RPC support routines and Yellow Pages (YP) routines. This library contains routines that implement the RPC protocol and routines that provide a programmatic interface to Sun’s YP distributed lookup service. The library also contains YP versions of standard routines like getpwent(3C) that are different in a YP environment. To compile and link a program that calls (3R) routines, use a compile command of the form:
cc −I/usr/include/sun −I/usr/include/bsd prog.c −lsun −lbsd
The −I/usr/include/bsd and −lbsd are required because routines in the (3R) library call routines in the (3B) library. Note that the order of the libraries must be as given in order for the references to be resolved. This library is provided as part of the NFS option package, so it may not be present on all systems.
(3X) Various specialized routines. The libraries in which these routines are found are given on the appropriate pages.
DEFINITIONS
A character is any bit pattern able to fit into a byte on the machine. The null character is a character with value 0, represented in the C language as ’\0’. A character array is a sequence of characters. A null-terminated character array is a sequence of characters, the last of which is the null character. A string is a designation for a null-terminated character array. The null string is a character array containing only the null character. A NULL pointer is the value that is obtained by casting 0 into a pointer. The C language guarantees that this value will not match that of any legitimate pointer, so many functions that return pointers return it to indicate an error. NULL is defined as 0 in <stdio.h>; the user can include his own definition if he is not using <stdio.h>.
FILES
/lib/libc.a
/usr/lib/libm.a
/usr/lib/libgl.a
/usr/lib/libbsd.a
/usr/lib/libsun.a
SEE ALSO
IRIS User’s Guide
IRIS Workstation Guide
ar(1), cc(1), ld(1), nm(1), intro(2), stdio(3S).
Version 3.6 — December 20, 1987