Chapter Contents |
Previous |
Next |
Introduction to the SAS/C Library |
Header File Organization |
The SAS/C library defines a strict separation of functions into three parts:
Functions
defined by the ISO/ANSI standard are declared in the header file mandated
by the standard. For example, the
fopen
function is declared in
<stdio.h>
.
The names of the standard header files are
<assert.h>
|
<setjmp.h>
|
<ctype.h>
|
<signal.h>
|
<errno.h>
|
<stdarg.h>
|
<float.h>
|
<stddef.h>
|
<limits.h>
|
<stdio.h>
|
<local.h>
|
<stdlib.h>
|
<math.h>
|
<string.h>
|
<time.h>
|
Functions which are not defined
by the ISO/ANSI Standard but which are related to standard functions are declared
in separate header files. These header filenames are similar to the Standard
names but have the prefix
lc
. For example,
the function
afopen
is declared in
<lcio.h>
. The names of these header files
are
<lcdef.h>
|
<lcmath.h>
|
<lcio.h>
|
<lcsignal.h>
|
<lcjmp.h>
|
<lcstring.h>
|
<lclib.h>
|
<lctype.h>
|
If you include the
lc-
header file, you do not need to include the standard header file. In all
cases, the
lc-
prefixed header contains
a
#include
statement for the standard header
file. For example, the header file
<lcstring.h>
contains the statement
#include <string.h>
. (It is not an error to explicitly include both files.) The SAS/C
library contains many nonstandard functions and header files that are not
associated with standard features. For details on nonstandard functions and
header files that are not associated with standard features, see
SAS/C Library Reference, Volume 2.
SAS/C supports the following feature test macros. To
enable a feature, you must define the macro before including any header file,
either by using a
#define
statement or
by using the
define
compiler option.
_SASC_POSIX_SOURCE
_SASC_POSIX_SOURCE
has no
effect on non-ISO/ANSI header files.
_POSIX_SOURCE
_POSIX_SOURCE
should be defined only for
programs which are intended to be POSIX-conforming and which do not use any
non-ISO/ANSI or non-POSIX library features.
_POSIX1_SOURCE
_POSIX_SOURCE
.
If this macro is defined as 2, symbols sanctioned by the POSIX.1a draft standard
related to features implemented by USS OS/390 will also be made visible. Like
_POSIX_SOURCE
,
_POSIX1_SOURCE
should not be defined in any program that uses non-ISO/ANSI non-POSIX
features.
_POSIX_C_SOURCE
_POSIX_SOURCE
, plus
making visible symbols sanctioned by the POSIX.2 draft standard related to
features implemented by SAS/C. If
_POSIX_C_SOURCE
is defined to any other value, it has the same effect as defining
_POSIX_SOURCE
. Like
_POSIX_SOURCE
,
_POSIX_C_SOURCE
should
not be defined in any program that uses non-ISO/ANSI non-POSIX features.
If you use the POSIX compiler option, the feature test
macro
_SASC_POSIX_SOURCE
is automatically
defined. This does not ensure that your program is POSIX compliant; it only
makes visible POSIX symbols in ISO/ANSI standard header files.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.