intro(3)
_________________________________________________________________
intro Subroutine
introduction to subroutines and libraries
_________________________________________________________________
SYNTAX
#include <stdio.h>
#include <math.h>
DESCRIPTION
This section describes functions found in various libraries,
other than those functions that directly invoke DG/UX system
primitives, (see Chapter 2 of this manual). The functions are
identified by a number (or number and letter) following the
section title:
(3), (3C)
These functions, together with those of Chapter 2 and those
marked (3S), constitute the standard C library, which is
automatically loaded by the C compiler, cc(1). They are
sorted together in the manual. Functions marked (3C) are
in /usr/lib/libproto/libc.a, which is delivered with the
Data General compiler. Functions marked (3) are in
/usr/lib/libproto/lib3.a, which is delivered with DG/UX.
The libraries are combined at installation time, using the
libmerge utility and placed in /lib/libc.a. 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
/usr/lib/libproto/libc.a, already mentioned. Declarations
for them may be obtained from the #include file <stdio.h>.
(3M) These functions constitute the math library, libm. They
are automatically loaded as needed by the FORTRAN compiler
f77(1). They are not automatically loaded by the C
compiler, cc(1); however, the link editor searches this
library under the -lm option. Declarations for these
functions may be obtained from the #include file <math.h>.
Several generally useful mathematical constants are also
defined there (see math(5)).
NOTE: Some functions marked with (3M) in these pages are
actually in libc.a.
(3X) Various specialized libraries. The files in which these
libraries are found are given on the appropriate pages.
(3N) These functions constitute the Internet network library.
The files in which they are found are listed on the
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)
intro(3)
appropriate pages.
(3F) These functions constitute the FORTRAN intrinsic function
library, libF77. These functions are automatically
available to the FORTRAN programmer and require no special
invocation of the compiler.
DEFINITIONS
character Any bit pattern able to fit into a byte on the machine.
null character
A character with value 0, represented in the C language
as '\0'.
character array
A sequence of characters.
null-terminated character array
A sequence of characters, the last of which is the null
character.
string is a designation for a null-terminated character array.
null string
A character array containing only the null character.
NULLpointer
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 Defined as 0 in <stdio.h>; the user can include an
appropriate definition if not using <stdio.h>.
Many groups of FORTRAN intrinsic functions have generic function
names that do not require explicit or implicit type declaration.
The type of the function will be determined by the type of its
argument(s). For example, the generic function max will return
an integer value if given integer arguments (max0), a real value
if given real arguments (amax1), or a double-precision value if
given double-precision arguments (dmax1).
FILES
/usr/lib/libproto/ lib3.a Standard C library (DG/UX)
/usr/lib/libproto/liba.a Common language library (DG/UX)
/usr/lib/libproto/libc.a Standard C library
DG/UX 4.00 Page 2
Licensed material--property of copyright holder(s)
intro(3)
/usr/lib/libproto/lib.a Math library
/usr/lib/libF77.a FORTRAN 77 library (DG/UX)
/lib/libcurses.a
/lib/libtermcap.a
/lib/libPW.a
SEE ALSO
intro(2), stdio(3S), math(5).
ar(1), cc(1), f77(1), ld(1), lint(1), nm(1) in the Programmer's
Reference for the DG/UX System.
DIAGNOSTICS
Functions in the C and math Libraries (3C and 3M) may return the
conventional values 0 or +HUGE when the function is undefined for
the given arguments or when the value is not representable.
These are the largest-magnitude single-precision floating-point
numbers; HUGE is defined in the <math.h> header file. In these
cases, the external variable errno (see intro(2)) is set to the
value EDOM or ERANGE.
WARNING
Many of the functions in the libraries call and/or refer to other
functions and external variables described in this section and in
Chapter 2 (System Calls). If a program inadvertently defines a
function or external variable with the same name, the presumed
library version of the function or external variable may not be
loaded. The lint(1) program checker reports name conflicts of
this kind as multiple declarations of the names in question.
Definitions for sections 2, 3C, and 3S are checked automatically.
Other definitions can be included by using the -l option (for
example, -lm includes definitions for the math library, section
3M). Use of lint is highly recommended.
DG/UX 4.00 Page 3
Licensed material--property of copyright holder(s)