2000-02-18 03:39:52 +08:00
|
|
|
@node Stdlib
|
|
|
|
@chapter Standard Utility Functions (@file{stdlib.h})
|
|
|
|
|
|
|
|
This chapter groups utility functions useful in a variety of programs.
|
|
|
|
The corresponding declarations are in the header file @file{stdlib.h}.
|
|
|
|
|
|
|
|
@menu
|
|
|
|
* abort:: Abnormal termination of a program
|
|
|
|
* abs:: Integer absolute value (magnitude)
|
|
|
|
* assert:: Macro for Debugging Diagnostics
|
|
|
|
* atexit:: Request execution of functions at program exit
|
|
|
|
* atof:: String to double or float
|
|
|
|
* atoi:: String to integer
|
|
|
|
* bsearch:: Binary search
|
|
|
|
* calloc:: Allocate space for arrays
|
|
|
|
* div:: Divide two integers
|
|
|
|
* ecvtbuf:: Double or float to string of digits
|
|
|
|
* ecvt:: Double or float to string of digits (malloc result)
|
|
|
|
* __env_lock:: Lock environment list for getenv and setenv
|
|
|
|
* gvcvt:: Format double or float as string
|
|
|
|
* exit:: End program execution
|
|
|
|
* getenv:: Look up environment variable
|
|
|
|
* labs:: Long integer absolute value (magnitude)
|
|
|
|
* ldiv:: Divide two long integers
|
|
|
|
* malloc:: Allocate and manage memory (malloc, realloc, free)
|
|
|
|
* mallinfo:: Get information about allocated memory
|
|
|
|
* __malloc_lock:: Lock memory pool for malloc and free
|
|
|
|
* mbstowcs:: Minimal multibyte string to wide string converter
|
|
|
|
* mblen:: Minimal multibyte length
|
|
|
|
* mbtowc:: Minimal multibyte to wide character converter
|
|
|
|
* qsort:: Sort an array
|
|
|
|
* rand:: Pseudo-random numbers
|
2001-02-14 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
* libc/include/stdlib.h: Add declarations of rand48 functions and
their reentrant versions.
* libc/include/sys/reent.h: Move macros from rand48.h. Add
struct _rand48 for shared parameters of rand48 functions.
(struct _reent): Add a variable _r48 of struct _rand48.
(_REENT_INIT): Add _r48 initialization.
* libc/stdlib/Makefile.am (lib_a_SOURCES): Add rand48 functions.
(CHEWOUT_FILES): Add rand48.def.
* libc/stdlib/Makefile.am: Add dependencies for rand48 functions.
* libc/stdlib/Makefile.in: Regenerated.
* libc/stdlib/drand48.c (drand48, _drand48_r): Derived from the
NetBSD C library.
* libc/stdlib/erand48.c (erand48, _erand48_r): Ditto.
* libc/stdlib/jrand48.c (jrand48, _jrand48_r): Ditto.
* libc/stdlib/lcong48.c (lcong48, _lcong48_r): Ditto.
* libc/stdlib/lrand48.c (lrand48, _lrand48_r): Ditto.
* libc/stdlib/mrand48.c (mrand48, _mrand48_r): Ditto.
* libc/stdlib/nrand48.c (nrand48, _nrand48_r): Ditto.
* libc/stdlib/seed48.c (seed48, _seed48_r): Ditto.
* libc/stdlib/srand48.c (srand48, _srand48_r): Ditto.
* libc/stdlib/rand48.c (__dorand48): Ditto.
* libc/stdlib/rand48.h: Ditto, and modify declarations of global
parameters into macros referring them in the reentrant structure.
2001-02-15 10:04:55 +08:00
|
|
|
* rand48:: Uniformaly distributed pseudo-random numbers
|
2000-02-18 03:39:52 +08:00
|
|
|
* strtod:: String to double or float
|
|
|
|
* strtol:: String to long
|
|
|
|
* strtoul:: String to unsigned long
|
|
|
|
* system:: Execute command string
|
|
|
|
* wcstombs:: Minimal wide string to multibyte string converter
|
|
|
|
* wctomb:: Minimal wide character to multibyte converter
|
|
|
|
@end menu
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/abort.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/abs.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/assert.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/atexit.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/atof.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/atoi.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/bsearch.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/calloc.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/div.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/efgcvt.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/ecvtbuf.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/envlock.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/exit.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/getenv.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/labs.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/ldiv.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/malloc.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/mstats.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/mlock.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/mblen.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/mbstowcs.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/mbtowc.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/qsort.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/rand.def
|
|
|
|
|
2001-02-14 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
* libc/include/stdlib.h: Add declarations of rand48 functions and
their reentrant versions.
* libc/include/sys/reent.h: Move macros from rand48.h. Add
struct _rand48 for shared parameters of rand48 functions.
(struct _reent): Add a variable _r48 of struct _rand48.
(_REENT_INIT): Add _r48 initialization.
* libc/stdlib/Makefile.am (lib_a_SOURCES): Add rand48 functions.
(CHEWOUT_FILES): Add rand48.def.
* libc/stdlib/Makefile.am: Add dependencies for rand48 functions.
* libc/stdlib/Makefile.in: Regenerated.
* libc/stdlib/drand48.c (drand48, _drand48_r): Derived from the
NetBSD C library.
* libc/stdlib/erand48.c (erand48, _erand48_r): Ditto.
* libc/stdlib/jrand48.c (jrand48, _jrand48_r): Ditto.
* libc/stdlib/lcong48.c (lcong48, _lcong48_r): Ditto.
* libc/stdlib/lrand48.c (lrand48, _lrand48_r): Ditto.
* libc/stdlib/mrand48.c (mrand48, _mrand48_r): Ditto.
* libc/stdlib/nrand48.c (nrand48, _nrand48_r): Ditto.
* libc/stdlib/seed48.c (seed48, _seed48_r): Ditto.
* libc/stdlib/srand48.c (srand48, _srand48_r): Ditto.
* libc/stdlib/rand48.c (__dorand48): Ditto.
* libc/stdlib/rand48.h: Ditto, and modify declarations of global
parameters into macros referring them in the reentrant structure.
2001-02-15 10:04:55 +08:00
|
|
|
@page
|
|
|
|
@include stdlib/rand48.def
|
|
|
|
|
2000-02-18 03:39:52 +08:00
|
|
|
@page
|
|
|
|
@include stdlib/strtod.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/strtol.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/strtoul.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/system.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/wcstombs.def
|
|
|
|
|
|
|
|
@page
|
|
|
|
@include stdlib/wctomb.def
|
|
|
|
|