[Last modified : 2006-11-30]
Contents
<assert.h>
: Diagnostics<ctype.h>
: Character Class Tests<errno.h>
: Error Codes Reported by (Some) Library Functions<float.h>
: Implementation-defined Floating-Point Limits<limits.h>
: Implementation-defined Limits<locale.h>
: Locale-specific Information<math.h>
: Mathematical Functions<setjmp.h>
: Non-local Jumps<signal.h>
: Signals<stdarg.h>
: Variable Argument Lists<stddef.h>
: Definitions of General Use<stdio.h>
: Input and Output<stdlib.h>
: Utility functions<string.h>
: String functions<time.h>
: Time and Date functions
<assert.h>
-
Macro used for internal error detection. (Ignored if
NDEBUG
is defined where<assert.h>
is included.) If expression equals zero, message printed onstderr
and abort called to terminate execution. Source filename and line number in message are from preprocessor macros__FILE__
and__LINE__
.
void assert(int expression);
[
Contents]
<ctype.h>
-
isalpha(c)
orisdigit(c)
-
isupper(c)
orislower(c)
-
is control character. In ASCII, control characters are
0x00
(NUL
) to0x1F
(US
), and0x7F
(DEL
) - is decimal digit
- is printing character other than space
- is lower-case letter
-
is printing character (including space). In ASCII, printing characters are
0x20
(' '
) to0x7E
('~'
) - is printing character other than space, letter, digit
- is space, formfeed, newline, carriage return, tab, vertical tab
- is upper-case letter
- is hexadecimal digit
- return lower-case equivalent
- return upper-case equivalent
int isalnum(int c);
int isalpha(int c);
int iscntrl(int c);
int isdigit(int c);
int isgraph(int c);
int islower(int c);
int isprint(int c);
int ispunct(int c);
int isspace(int c);
int isupper(int c);
int isxdigit(int c);
int tolower(int c);
int toupper(int c);
[
Contents]
<errno.h>
- object to which certain library functions assign specific positive values on error
- code used for domain errors
- code used for range errors
errno
EDOM
ERANGE
Notes:
- other implementation-defined error values are permitted
- to determine the value (if any) assigned to errno by a library function, a program should assign zero to errno immediately prior to the function call
[
Contents]
<float.h>
- radix of floating-point representations
- floating-point rounding mode
FLT_RADIX
FLT_ROUNDS
Where the prefix "
FLT
" pertains to type
float
, "
DBL
" to type
double
, and "
LDBL
" to type
long double
:
- precision (in decimal digits)
-
smallest number
x such that
1.0 + x != 1.0
-
number of digits, base
FLT_RADIX
, in mantissa - maximum number
-
largest positive integer exponent to which
FLT_RADIX
can be raised and remain representable - minimum normalised number
-
smallest negative integer exponent to which
FLT_RADIX
can be raised and remain representable
FLT_DIG
DBL_DIG
LDBL_DIG
FLT_EPSILON
DBL_EPSILON
LDBL_EPSILON
FLT_MANT_DIG
DBL_MANT_DIG
LDBL_MANT_DIG
FLT_MAX
DBL_MAX
LDBL_MAX
FLT_MAX_EXP
DBL_MAX_EXP
LDBL_MAX_EXP
FLT_MIN
DBL_MIN
LDBL_MIN
FLT_MIN_EXP
DBL_MIN_EXP
LDBL_MIN_EXP
[
Contents]
<limits.h>
-
number of bits in a
char
-
maximum value of type
char
-
minimum value of type
char
-
maximum value of type
signed char
-
minimum value of type
signed char
-
maximum value of type
unsigned char
-
maximum value of type
short
-
minimum value of type
short
-
maximum value of type
unsigned short
-
maximum value of type
int
-
minimum value of type
int
-
maximum value of type
unsigned int
-
maximum value of type
long
-
minimum value of type
long
-
maximum value of type
unsigned long
CHAR_BIT
CHAR_MAX
CHAR_MIN
SCHAR_MAX
SCHAR_MIN
UCHAR_MAX
SHRT_MAX
SHRT_MIN
USHRT_MAX
INT_MAX
INT_MIN
UINT_MAX
LONG_MAX
LONG_MIN
ULONG_MAX
[
Contents]
<locale.h>
-
Describes formatting of monetary and other numeric values:
- decimal point for non-monetary values
- sizes of digit groups for non-monetary values
- separator for digit groups for non-monetary values (left of "decimal point")
- currency symbol
- international currency symbol
- decimal point for monetary values
- sizes of digit groups for monetary values
- separator for digit groups for monetary values (left of "decimal point")
- negative sign for monetary values
- positive sign for monetary values
- number of digits to be displayed to right of "decimal point" for monetary values
- number of digits to be displayed to right of "decimal point" for international monetary values
-
whether currency symbol precedes (
1
) or follows (0
) negative monetary values -
whether currency symbol is (
1
) or is not (0
) separated by space from negative monetary values -
format for negative monetary values:
- parentheses surround quantity and currency symbol
- sign precedes quantity and currency symbol
- sign follows quantity and currency symbol
- sign immediately precedes currency symbol
- sign immediately follows currency symbol
0
1
2
3
4
-
whether currency symbol precedes (
1
) or follows (0
) positive monetary values -
whether currency symbol is (
1
) or is not (0
) separated by space from non-negative monetary values -
format for non-negative monetary values, with values as for
n_sign_posn
char* decimal_point;
char* grouping;
char* thousands_sep;
char* currency_symbol;
char* int_curr_symbol;
char* mon_decimal_point;
char* mon_grouping;
char* mon_thousands_sep;
char* negative_sign;
char* positive_sign;
char frac_digits;
char int_frac_digits;
char n_cs_precedes;
char n_sep_by_space;
char n_sign_posn;
char p_cs_precedes;
char p_sep_by_space;
char p_sign_posn;
decimal_point
. - returns pointer to formatting information for current locale
-
Sets components of locale according to specified
category
andlocale
. Returns string describing new locale or null on error. (Implementations are permitted to define values ofcategory
additional to those describe here.) -
category
argument for all categories -
category
for numeric formatting information -
category
for monetary formatting information -
category
for information affecting collating functions -
category
for information affecting character class tests functions -
category
for information affecting time conversions functions - null pointer constant
struct lconv
struct lconv* localeconv(void);
char* setlocale(int category, const char* locale);
LC_ALL
LC_NUMERIC
LC_MONETARY
LC_COLLATE
LC_CTYPE
LC_TIME
NULL
[
Contents]
<math.h>
On domain error, implementation-defined value returned and
errno
set to
EDOM
. On range error,
errno
set to
ERANGE
and return value is
HUGE_VAL
with correct sign for overflow, or zero for underflow. Angles are in radians.
- magnitude returned (with correct sign) on overflow error
-
exponential of
x
-
natural logarithm of
x
-
base-10 logarithm of
x
-
x
raised to powery
-
square root of
x
-
smallest integer not less than
x
-
largest integer not greater than
x
-
absolute value of
x
-
x
times 2 to the powern
-
if
x
non-zero, returns value, with absolute value in interval [1/2, 1), and assigns to*exp
integer such that product of return value and 2 raised to the power*exp
equalsx
; ifx
zero, both return value and*exp
are zero -
returns fractional part and assigns to
*ip
integral part ofx
, both with same sign asx
-
if
y
non-zero, floating-point remainder ofx/y
, with same sign asx
; ify
zero, result is implementation-defined -
sine of
x
-
cosine of
x
-
tangent of
x
-
arc-sine of
x
-
arc-cosine of
x
-
arc-tangent of
x
-
arc-tangent of
y/x
-
hyperbolic sine of
x
-
hyperbolic cosine of
x
-
hyperbolic tangent of
x
HUGE_VAL
double exp(double x);
double log(double x);
double log10(double x);
double pow(double x, double y);
double sqrt(double x);
double ceil(double x);
double floor(double x);
double fabs(double x);
double ldexp(double x, int n);
double frexp(double x, int* exp);
double modf(double x, double* ip);
double fmod(double x, double y);
double sin(double x);
double cos(double x);
double tan(double x);
double asin(double x);
double acos(double x);
double atan(double x);
double atan2(double y, double x);
double sinh(double x);
double cosh(double x);
double tanh(double x);
[
Contents]
<setjmp.h>
- type of object holding context information
-
Saves context information in
env
and returns zero. Subsequent call tolongjmp
with same env returns non-zero. -
Restores context saved by most recent call to
setjmp
with specifiedenv
. Execution resumes as a second return fromsetjmp
, with returned valueval
if specified value non-zero, or 1 otherwise.
jmp_buf
int setjmp(jmp_buf env);
void longjmp(jmp_buf env, int val);
[
Contents]
<signal.h>
- abnormal termination
- arithmetic error
- invalid execution
- (asynchronous) interactive attention
- illegal storage access
- (asynchronous) termination request
- specifies default signal handling
-
signal
return value indicating error - specifies that signal should be ignored
-
Install handler for subsequent signal
sig. If
handler
isSIG_DFL
, implementation-defined default behaviour will be used; ifSIG_IGN
, signal will be ignored; otherwise function pointed to byhandler
will be invoked with argument sig. In the last case, handling is restored to default behaviour beforehandler
is called. Ifhandler
returns, execution resumes where signal occurred.signal
returns the previous handler orSIG_ERR
on error. Initial state is implementation-defined. Implementations may may define signals additional to those listed here. -
Sends signal
sig
. Returns zero on success.
SIGABRT
SIGFPE
SIGILL
SIGINT
SIGSEGV
SIGTERM
SIG_DFL
SIG_ERR
SIG_IGN
void (*signal(int sig, void (*handler)(int)))(int);
int raise(int sig);
[
Contents]
<stdarg.h>
- type of object holding context information
-
Initialisation macro which must be called once before any unnamed argument is accessed. Stores context information in
ap
.lastarg
is the last named parameter of the function. -
Yields value of the type (
type
) and value of the next unnamed argument. - Termination macro which must be called once after argument processing and before exit from function.
va_list
void va_start(va_list ap, lastarg);
type va_arg(va_list ap, type);
void va_end(va_list ap);
[
Contents]
<stddef.h>
- Null pointer constant.
-
Offset (in bytes) of member
m
from start of structure typestype
. - Type for objects declared to store result of subtracting pointers.
-
Type for objects declared to store result of
sizeof
operator.
NULL
offsetof(stype, m)
ptrdiff_t
size_t
[
Contents]
转载于:https://blog.51cto.com/sensen/322107