C standard library: Difference between revisions
Appearance
Created page with "==Header files== ;C90 *assert.h - assert macro *ctype.h - character types *errno.h - error testing *float.h - floating point *limits.h - macro constants *locale.h - localisati..." |
No edit summary |
||
Line 1: | Line 1: | ||
The '''C library''' is a system library that contains common [[C]] language subroutines for file access, string operators, character operations, memory allocation, and other functions. | |||
==Library Functions== | |||
{|class="wikitable" | |||
!Header||Function|| ||Extension | |||
|- | |||
|assert.h||assert||Diagnostic message | |||
|- | |||
|rowspan=6|complex.h|| ||Complex arithmetics||rowspan=6|C99 | |||
|- | |||
|cacos, casin, catan, ccos, csin, ctan||Trigonometric | |||
|- | |||
|cacosh, casinh, catanh, ccosh, csinh, ctanh||Hyperbolic | |||
|- | |||
|cexp, clog||Exponential and logarithmic | |||
|- | |||
|cabs, cpow, csqrt||Power and absolute value | |||
|- | |||
|carg, cproj||Manipulation | |||
|- | |||
|rowspan=4|conio.h||_cgets||Character read|| | |||
|- | |||
|_cprintf||Character print|| | |||
|- | |||
|_cputs||String write|| | |||
|- | |||
|_cscanf||Read from keyboard|| | |||
|- | |||
|rowspan=14|ctype.h||isalnum|| | |||
|- | |||
|isalpha|| | |||
|- | |||
|isblank|| | |||
|- | |||
|iscntrl|| | |||
|- | |||
|isdigit|| | |||
|- | |||
|isgraph|| | |||
|- | |||
|islower|| | |||
|- | |||
|isprint|| | |||
|- | |||
|ispunct|| | |||
|- | |||
|isspace|| | |||
|- | |||
|isupper|| | |||
|- | |||
|isxdigit|| | |||
|- | |||
|tolower|| | |||
|- | |||
|toupper|| | |||
|- | |||
|rowspan=2|direct.h||chdir||Change directory|| | |||
|- | |||
|_chdrive||Change drive|| | |||
|- | |||
|errno.h|| ||Errors | |||
|- | |||
|fenv.h|| ||Floating point environment||C99 | |||
|- | |||
|rowspan=2|iconv.h||iconv_close||Remove conversion description||XPG4 | |||
|- | |||
|iconv_close||Create conversion description||XPG4 | |||
|- | |||
|inttypes.h|| ||Integer types format conversion||C99 | |||
|- | |||
|rowspan=16|io.h||access||Access mode determination | |||
|- | |||
|chmod||Change file permission | |||
|- | |||
|_chsize||Change file length | |||
|- | |||
|close||Close file handle | |||
|- | |||
|creat||Create file | |||
|- | |||
|dup||Duplicate file handle | |||
|- | |||
|dup2||Second handle for open file | |||
|- | |||
|__eof||End of file determination | |||
|- | |||
|_filelength||File length determination | |||
|- | |||
|isatty, _isatty||Character device determination||X/Open | |||
|- | |||
|lseek||File pointer movement | |||
|- | |||
|open||File open | |||
|- | |||
|read||File read | |||
|- | |||
|_tell||File pointer position | |||
|- | |||
|umask||File permission mask setting | |||
|- | |||
|write||Write from buffer to file | |||
|- | |||
|langinfo.h||nl_langinfo||Retrieve locale info||XPG4 | |||
|- | |||
|locale.h||localeconv||Locale information from environment | |||
|- | |||
|rowspan=26|math.h||acos||Arccosine | |||
|- | |||
|asin||Arcsine | |||
|- | |||
|atan, atan2||Arctangent | |||
|- | |||
|_j0, j1, _jn<br />_y0, _y1, _yn||Bessel | |||
|- | |||
|ceil||Find integer greater or equal | |||
|- | |||
|cos||Cosine | |||
|- | |||
|cosh||Cosine hyperbolic | |||
|- | |||
|erf, erfc||Error functions | |||
|- | |||
|exp||Exponential | |||
|- | |||
|fabs||Absolute value of floating-point | |||
|- | |||
|floor||Find integer smaller or equal | |||
|- | |||
|fmod||Remainder of floating-point | |||
|- | |||
|frexp||Floating-point value separation | |||
|- | |||
|gamma||Gamma||SAA | |||
|- | |||
|hypot||Hypotenuse|| | |||
|- | |||
|ldexp||Power of 2 | |||
|- | |||
|log||Natural logarithm | |||
|- | |||
|log10||Decimal logarithm | |||
|- | |||
|_matherr||Math library error processing | |||
|- | |||
|modf||Floating-point value separation | |||
|- | |||
|pow||Power | |||
|- | |||
|sin||Sine | |||
|- | |||
|sinh||Sine hyperbolic | |||
|- | |||
|sqrt||Square root | |||
|- | |||
|tan||Tangent | |||
|- | |||
|tanh||Tangent hyperbolic | |||
|- | |||
|monetary.h||strfmon||Monetary value format||XPG4 | |||
|- | |||
|rowspan=3|nl_types.h||catclose||Message catalogue close | |||
|- | |||
|catgets||Message catalogue retrieval | |||
|- | |||
|catgets||Message catalogue open | |||
|- | |||
|rowspan=2|process.h||_cwait||Child process wait | |||
|- | |||
|execl||Child process execution | |||
|- | |||
|search.h||lfind||Find key in array | |||
|- | |||
|rowspan=21|stdio.h||clearerr||Error indicator reset | |||
|- | |||
|fclose||Stream close | |||
|- | |||
|_fcloseall||All open streams close | |||
|- | |||
|fdopen||I/O association with file | |||
|- | |||
|feof||EOF indicator test | |||
|- | |||
|ferror||Read/write error test | |||
|- | |||
|fflush||Buffer write to file | |||
|- | |||
|fgets||Byte read | |||
|- | |||
|fgetpos||File position | |||
|- | |||
|fgets||String read | |||
|- | |||
|fgetwc||Wide character read from stream | |||
|- | |||
|fgetws||Wide char string read from stream | |||
|- | |||
|fileno||File handle determination | |||
|- | |||
|_flushall||Buffers write to files | |||
|- | |||
|fopen||File open | |||
|- | |||
|fprintf||Formatted data write to stream | |||
|- | |||
|fputc||Byte write | |||
|- | |||
|fputs||String write | |||
|- | |||
|fputwc||Wide character write | |||
|- | |||
|fputws||Wide char string write | |||
|- | |||
|fread||Stream read | |||
|- | |||
|rowspan=18|stdlib.h||abort||stop | |||
|- | |||
|abs||Absolute value of integer | |||
|- | |||
|atexit||Record program termination | |||
|- | |||
|atof||Character string to float conversion | |||
|- | |||
|atoi||Character string to integer conversion | |||
|- | |||
|atol||Character string to long integer conversion | |||
|- | |||
|_atold||Character string to long double conversion | |||
|- | |||
|_beginthread||New thread creation | |||
|- | |||
|bsearch||Array search | |||
|- | |||
|calloc||Storage space reservation | |||
|- | |||
|div||Quotient and remainder | |||
|- | |||
|_ecvt||Floating-point to character conversion | |||
|- | |||
|_endthread||Thread termination | |||
|- | |||
|exit||Program exit | |||
|- | |||
|_exit||Process end | |||
|- | |||
|_fcvt||Floating-point to string conversion | |||
|- | |||
|labs||Absolute value of long integer | |||
|- | |||
|ldiv||Long division | |||
|- | |||
|rowspan=9|time.h||asctime||Time to character string conversion | |||
|- | |||
|clock||Processor time | |||
|- | |||
|ctime||Time to character string conversion | |||
|- | |||
|difftime||Time difference | |||
|- | |||
|gmtime||Time structure | |||
|- | |||
|localtime||Time conversion | |||
|- | |||
|mktime||Time conversion | |||
|- | |||
|strftime||Time conversion | |||
|- | |||
|time||Time determination | |||
|} | |||
==Header files== | ==Header files== | ||
;C90 | ;C90 | ||
Line 36: | Line 305: | ||
*threads.h - thread management | *threads.h - thread management | ||
*uchar.h - Unicode character handling | *uchar.h - Unicode character handling | ||
==Publications== | ==Publications== |
Latest revision as of 16:49, 23 February 2020
The C library is a system library that contains common C language subroutines for file access, string operators, character operations, memory allocation, and other functions.
Library Functions
Header | Function | Extension | |
---|---|---|---|
assert.h | assert | Diagnostic message | |
complex.h | Complex arithmetics | C99 | |
cacos, casin, catan, ccos, csin, ctan | Trigonometric | ||
cacosh, casinh, catanh, ccosh, csinh, ctanh | Hyperbolic | ||
cexp, clog | Exponential and logarithmic | ||
cabs, cpow, csqrt | Power and absolute value | ||
carg, cproj | Manipulation | ||
conio.h | _cgets | Character read | |
_cprintf | Character print | ||
_cputs | String write | ||
_cscanf | Read from keyboard | ||
ctype.h | isalnum | ||
isalpha | |||
isblank | |||
iscntrl | |||
isdigit | |||
isgraph | |||
islower | |||
isprint | |||
ispunct | |||
isspace | |||
isupper | |||
isxdigit | |||
tolower | |||
toupper | |||
direct.h | chdir | Change directory | |
_chdrive | Change drive | ||
errno.h | Errors | ||
fenv.h | Floating point environment | C99 | |
iconv.h | iconv_close | Remove conversion description | XPG4 |
iconv_close | Create conversion description | XPG4 | |
inttypes.h | Integer types format conversion | C99 | |
io.h | access | Access mode determination | |
chmod | Change file permission | ||
_chsize | Change file length | ||
close | Close file handle | ||
creat | Create file | ||
dup | Duplicate file handle | ||
dup2 | Second handle for open file | ||
__eof | End of file determination | ||
_filelength | File length determination | ||
isatty, _isatty | Character device determination | X/Open | |
lseek | File pointer movement | ||
open | File open | ||
read | File read | ||
_tell | File pointer position | ||
umask | File permission mask setting | ||
write | Write from buffer to file | ||
langinfo.h | nl_langinfo | Retrieve locale info | XPG4 |
locale.h | localeconv | Locale information from environment | |
math.h | acos | Arccosine | |
asin | Arcsine | ||
atan, atan2 | Arctangent | ||
_j0, j1, _jn _y0, _y1, _yn |
Bessel | ||
ceil | Find integer greater or equal | ||
cos | Cosine | ||
cosh | Cosine hyperbolic | ||
erf, erfc | Error functions | ||
exp | Exponential | ||
fabs | Absolute value of floating-point | ||
floor | Find integer smaller or equal | ||
fmod | Remainder of floating-point | ||
frexp | Floating-point value separation | ||
gamma | Gamma | SAA | |
hypot | Hypotenuse | ||
ldexp | Power of 2 | ||
log | Natural logarithm | ||
log10 | Decimal logarithm | ||
_matherr | Math library error processing | ||
modf | Floating-point value separation | ||
pow | Power | ||
sin | Sine | ||
sinh | Sine hyperbolic | ||
sqrt | Square root | ||
tan | Tangent | ||
tanh | Tangent hyperbolic | ||
monetary.h | strfmon | Monetary value format | XPG4 |
nl_types.h | catclose | Message catalogue close | |
catgets | Message catalogue retrieval | ||
catgets | Message catalogue open | ||
process.h | _cwait | Child process wait | |
execl | Child process execution | ||
search.h | lfind | Find key in array | |
stdio.h | clearerr | Error indicator reset | |
fclose | Stream close | ||
_fcloseall | All open streams close | ||
fdopen | I/O association with file | ||
feof | EOF indicator test | ||
ferror | Read/write error test | ||
fflush | Buffer write to file | ||
fgets | Byte read | ||
fgetpos | File position | ||
fgets | String read | ||
fgetwc | Wide character read from stream | ||
fgetws | Wide char string read from stream | ||
fileno | File handle determination | ||
_flushall | Buffers write to files | ||
fopen | File open | ||
fprintf | Formatted data write to stream | ||
fputc | Byte write | ||
fputs | String write | ||
fputwc | Wide character write | ||
fputws | Wide char string write | ||
fread | Stream read | ||
stdlib.h | abort | stop | |
abs | Absolute value of integer | ||
atexit | Record program termination | ||
atof | Character string to float conversion | ||
atoi | Character string to integer conversion | ||
atol | Character string to long integer conversion | ||
_atold | Character string to long double conversion | ||
_beginthread | New thread creation | ||
bsearch | Array search | ||
calloc | Storage space reservation | ||
div | Quotient and remainder | ||
_ecvt | Floating-point to character conversion | ||
_endthread | Thread termination | ||
exit | Program exit | ||
_exit | Process end | ||
_fcvt | Floating-point to string conversion | ||
labs | Absolute value of long integer | ||
ldiv | Long division | ||
time.h | asctime | Time to character string conversion | |
clock | Processor time | ||
ctime | Time to character string conversion | ||
difftime | Time difference | ||
gmtime | Time structure | ||
localtime | Time conversion | ||
mktime | Time conversion | ||
strftime | Time conversion | ||
time | Time determination |
Header files
- C90
- assert.h - assert macro
- ctype.h - character types
- errno.h - error testing
- float.h - floating point
- limits.h - macro constants
- locale.h - localisation
- math.h - mathematical
- setjmp.h - declaration of setjmp & longjmp
- signal.h - signal handling
- stdarg.h - argument handling
- stddef.h - types and macros
- stdio.h - core input/output
- stdlib.h - numeric conversion, memory allocation, process control
- string.h - string handling
- time.h - date and time handling
Normative Addendum 1
- iso646.h - ISO646 charset
- wchar.h - wide character
- wctype.h - wide character types
- C99
- complex.h - complex numbers
- fenv.h - floating-point environment
- inttypes.h - exact width integer types
- stdbool.h - boolean data type
- stdint.h -
- tgmath.h - type-generic mathematical
- C11
- stdalign.h - object alignment
- stdatomic.h - atomic operations
- stdnoreturn.h - non-returning functions
- threads.h - thread management
- uchar.h - Unicode character handling
Publications
- SAA CPI C Reference - Level 2, SC09-1308