intro(3) DG/UX 4.30 intro(3)
NAME
intro - introduction to subroutines and libraries
DESCRIPTION
This section describes functions found in various libraries
supplied with DG/UX. 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), (3N) (Internet functions) and (3R),
constitute the standard C library, which is
automatically loaded by the C compiler, cc(1). They
are sorted together in the manual. 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)). Declarations for them 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(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)).
(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, provided in /lib/libc.a, and Network Services
library provided in /lib/libnsl_s.a.
To build an 88open BCS compliant application, set the
environment variable SDE_TARGET to m88kbcs (see sde-
target(1)). This modifies the library search algorithm of
ld to load any BCS specific libraries. Currently the only
library that must have a different version for BCS
compliance is libc.a.
In the Network Services library, netbuf is a structure used
in various Transport Interface (TI) functions to send and
receive data and information. It contains the following
members:
unsigned int maxlen;
unsigned int len;
char *buf;
Buf points to a user input and/or output buffer. Len
generally specifies the number of bytes contained in the
buffer. If the structure is used for both input and output,
Licensed material--property of copyright holder(s) Page 1
intro(3) DG/UX 4.30 intro(3)
the function will replace the user value of len on return.
Maxlen generally has significance only when buf is used to
receive output from the TI function. In this case, it
specifies the physical size of the buffer, the maximum value
of len that can be set by the function. If maxlen is not
large enough to hold the returned information, an TBUFOVFLW
error will generally result. However, certain functions may
return part of the data and not generate an error.
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.
NULL pointer
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 may include an
appropriate definition if not using <stdio.h>.
FILES
/usr/lib/libc.a Standard C library
/usr/lib/libcrypt.a Alternate encryption library
/usr/lib/libdbm.a Database access library
/lib/libcurses.a Terminal screen handling library
/usr/lib/libm.a Math library
/usr/lib/libmalloc.a Alternate memory management library
/usr/lib/libmp.a Multi-precision integer math
library
/usr/lib/libnsl_s.a Network Services library
Licensed material--property of copyright holder(s) Page 2
intro(3) DG/UX 4.30 intro(3)
/lib/libtermcap.a termcap access library
/usr/lib/libPW.a Programmer Workbench library
/usr/sde/m88kbcs/lib/* BCS version of standard libraries
above.
SEE ALSO
ar(1), cc(1), f77(1), ld(1), lint(1), nm(1), intro(2), sde-
target(1), stdio(3S), math(5).
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, 3N, 3R 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.
Licensed material--property of copyright holder(s) Page 3