Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

intro(3F)

math(3M)

stdio(3S)

math(5)

ar(1)

cc(1)

f77(1)

ld(1)

lint(1)

nm(1)



INTRO(3-SysV)       RISC/os Reference Manual        INTRO(3-SysV)



NAME
     intro - introduction to functions and libraries

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.

     Functions that are available for both -systype sysv and
     -systype bsd43 are also included here and in volume II of
     this book, without the designation (-SYSV) or (-BSD) follow-
     ing the section number and letter.

     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 com-
            piler, 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 pack-
            age'' [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 automatically loaded as needed by the FOR-
            TRAN 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(3M) and math(5)].

     (3X)   Various specialized libraries.  The files in which
            these libraries are found are given on the appropri-
            ate 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.  See
            intro(3F).

BERKELEY COMPATIBILITY ROUTINES
     Manual pages for Berkeley compatibility routines are in



                         Printed 1/15/91                   Page 1





INTRO(3-SysV)       RISC/os Reference Manual        INTRO(3-SysV)



     Volume II of this manual.  This library provides compatible
     implementations of a limited subset of the functions pro-
     vided by the Standard C Library in Berkeley 4.x Distribution
     of UNIX.  Include files needed for routines in this library
     are in the tree /usr/include/bsd. If different include files
     are required for the different systypes, they are dis-
     tinguished in the SYNOPSIS section under separate headings.
     It is recommended that the -I/usr/include/bsd compiler con-
     trol be supplied when compiling programs that call these
     routines.  This library is searched by the link editor when
     the -lbsd and -lsun flags are supplied.

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 an appropriate defini-
     tion 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 func-
     tion max will return an integer value if given integer argu-
     ments (max0), a real value if given real arguments (amax1),
     or a double-precision value if given double-precision argu-
     ments (dmax1).

FILES
     LIBDIR              usually /lib
     LIBDIR/libc.a
     LIBDIR/libm.a
     LIBDIR/lib77.a

SEE ALSO
     intro(3F), math(3M), stdio(3S), math(5).
     ar(1), cc(1), f77(1), ld(1), lint(1), nm(1) in the User's
     Reference Manual.

DIAGNOSTICS
     Function in the C and Math libraries (3C and 3M) may return
     +oo or NaN (Not-a-Number) when the function is undefined for
     the given arguments or when the value is not representable.



 Page 2                  Printed 1/15/91





INTRO(3-SysV)       RISC/os Reference Manual        INTRO(3-SysV)



WARNING
     Many of the functions in the libraries call and/or refer to
     other functions and external variables described in this
     section and in Section 2 (System Calls).  If a program inad-
     vertently 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 Section 3M, the Math
     Library.)  Use of lint is highly recommended.










































                         Printed 1/15/91                   Page 3



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026