From 1d9d92ba957a0b8307c9a65c35867fde68e6533b Mon Sep 17 00:00:00 2001 From: solar Date: Thu, 17 Jun 2004 04:46:43 +0000 Subject: [PATCH] Re-import from Subversion. --- functions/assert.c | 12 +- functions/complex/cabs.c | 12 +- functions/complex/cacos.c | 12 +- functions/complex/cacosh.c | 12 +- functions/complex/carg.c | 12 +- functions/complex/casin.c | 12 +- functions/complex/casinh.c | 12 +- functions/complex/catan.c | 12 +- functions/complex/catanh.c | 12 +- functions/complex/cconj.c | 12 +- functions/complex/ccos.c | 12 +- functions/complex/ccosh.c | 12 +- functions/complex/cexp.c | 13 +- functions/complex/cimag.c | 12 +- functions/complex/clog.c | 12 +- functions/complex/cpow.c | 12 +- functions/complex/cproj.c | 12 +- functions/complex/creal.c | 12 +- functions/complex/csin.c | 12 +- functions/complex/csinh.c | 12 +- functions/complex/csqrt.c | 12 +- functions/complex/ctan.c | 12 +- functions/complex/ctanh.c | 12 +- functions/ctype.c | 12 +- functions/errno.c | 14 +- functions/fenv.c | 12 +- functions/inttypes.c | 15 +- functions/locale.c | 12 +- functions/math/abs.c | 12 +- functions/math/acos.c | 12 +- functions/math/acosh.c | 12 +- functions/math/asin.c | 12 +- functions/math/asinh.c | 12 +- functions/math/atan.c | 12 +- functions/math/atan2.c | 12 +- functions/math/atanh.c | 12 +- functions/math/cbrt.c | 12 +- functions/math/ceil.c | 12 +- functions/math/copysign.c | 12 +- functions/math/cos.c | 12 +- functions/math/cosh.c | 12 +- functions/math/erf.c | 12 +- functions/math/exp.c | 12 +- functions/math/fdim.c | 12 +- functions/math/floor.c | 12 +- functions/math/fma.c | 12 +- functions/math/fmax.c | 12 +- functions/math/fmin.c | 12 +- functions/math/gamma.c | 12 +- functions/math/hypot.c | 12 +- functions/math/log.c | 12 +- functions/math/mod.c | 12 +- functions/math/nan.c | 12 +- functions/math/nearbyint.c | 12 +- functions/math/nextafter.c | 12 +- functions/math/nexttoward.c | 12 +- functions/math/pow.c | 12 +- functions/math/remainder.c | 12 +- functions/math/remquo.c | 12 +- functions/math/rint.c | 12 +- functions/math/round.c | 12 +- functions/math/scalbn.c | 12 +- functions/math/sin.c | 12 +- functions/math/sinh.c | 12 +- functions/math/sqrt.c | 12 +- functions/math/tan.c | 12 +- functions/math/tanh.c | 12 +- functions/math/trunc.c | 12 +- functions/setjmp.c | 14 +- functions/signal.c | 12 +- functions/stdio/clearerr.c | 12 +- functions/stdio/fclose.c | 12 +- functions/stdio/feof.c | 12 +- functions/stdio/ferror.c | 12 +- functions/stdio/fflush.c | 12 +- functions/stdio/fgetc.c | 12 +- functions/stdio/fgetpos.c | 12 +- functions/stdio/fgets.c | 12 +- functions/stdio/fopen.c | 12 +- functions/stdio/fprintf.c | 12 +- functions/stdio/fputc.c | 12 +- functions/stdio/fputs.c | 12 +- functions/stdio/fread.c | 12 +- functions/stdio/freopen.c | 12 +- functions/stdio/fscanf.c | 12 +- functions/stdio/fseek.c | 12 +- functions/stdio/fsetpos.c | 12 +- functions/stdio/ftell.c | 12 +- functions/stdio/fwrite.c | 12 +- functions/stdio/getc.c | 12 +- functions/stdio/getchar.c | 12 +- functions/stdio/gets.c | 12 +- functions/stdio/perror.c | 12 +- functions/stdio/printf.c | 12 +- functions/stdio/putc.c | 12 +- functions/stdio/putchar.c | 12 +- functions/stdio/puts.c | 12 +- functions/stdio/remove.c | 12 +- functions/stdio/rename.c | 12 +- functions/stdio/rewind.c | 12 +- functions/stdio/scanf.c | 12 +- functions/stdio/setbuf.c | 12 +- functions/stdio/setvbuf.c | 12 +- functions/stdio/snprintf.c | 12 +- functions/stdio/sprintf.c | 12 +- functions/stdio/sscanf.c | 12 +- functions/stdio/tmpfile.c | 14 +- functions/stdio/tmpnam.c | 12 +- functions/stdio/ungetc.c | 12 +- functions/stdio/vfprintf.c | 12 +- functions/stdio/vfscanf.c | 12 +- functions/stdio/vprintf.c | 12 +- functions/stdio/vscanf.c | 13 +- functions/stdio/vsnprintf.c | 12 +- functions/stdio/vsprintf.c | 12 +- functions/stdio/vsscanf.c | 12 +- functions/stdlib/_Exit.c | 12 +- functions/stdlib/abort.c | 14 +- functions/stdlib/atexit.c | 13 +- functions/stdlib/bsearch.c | 13 +- functions/stdlib/calloc.c | 14 +- functions/stdlib/div.c | 21 +- functions/stdlib/exit.c | 12 +- functions/stdlib/free.c | 52 +- functions/stdlib/getenv.c | 12 +- functions/stdlib/malloc.c | 125 +- functions/stdlib/mblen.c | 12 +- functions/stdlib/mbstowcs.c | 12 +- functions/stdlib/mbtowc.c | 14 +- functions/stdlib/qsort.c | 17 +- functions/stdlib/rand.c | 12 +- functions/stdlib/realloc.c | 77 +- functions/stdlib/strtox.c | 12 +- functions/stdlib/system.c | 19 +- functions/stdlib/wcstombs.c | 12 +- functions/stdlib/wctomb.c | 12 +- functions/string/memchr.c | 12 +- functions/string/memcmp.c | 12 +- functions/string/memcpy.c | 12 +- functions/string/memmove.c | 12 +- functions/string/memset.c | 12 +- functions/string/strcat.c | 16 +- functions/string/strchr.c | 12 +- functions/string/strcmp.c | 12 +- functions/string/strcoll.c | 14 +- functions/string/strcpy.c | 14 +- functions/string/strcspn.c | 12 +- functions/string/strerror.c | 12 +- functions/string/strlen.c | 12 +- functions/string/strncat.c | 12 +- functions/string/strncmp.c | 12 +- functions/string/strncpy.c | 14 +- functions/string/strpbrk.c | 12 +- functions/string/strrchr.c | 12 +- functions/string/strspn.c | 12 +- functions/string/strstr.c | 12 +- functions/string/strtok.c | 22 +- functions/string/strxfrm.c | 14 +- functions/time.c | 14 +- functions/wctype.c | 12 +- includes/__NULL.h | 16 - includes/__WCHAR.h | 16 - includes/__intern.h | 45 + includes/__size_t.h | 16 - includes/__tm.h | 15 - includes/__wchar_t.h | 15 - includes/__wint_t.h | 15 - includes/assert.h | 46 +- includes/complex.h | 83 +- includes/ctype.h | 63 +- includes/errno.h | 45 +- includes/fenv.h | 66 +- includes/float.h | 28 + includes/inttypes.h | 44 +- includes/iso646.h | 29 +- includes/limits.h | 59 + includes/locale.h | 141 +- includes/math.h | 1212 +++++++++++++++-- includes/setjmp.h | 36 +- includes/signal.h | 88 +- includes/stdarg.h | 112 +- includes/stdbool.h | 40 +- includes/stddef.h | 58 +- includes/stdint.h | 143 ++ includes/stdio.h | 463 ++++--- includes/stdlib.h | 64 +- includes/string.h | 48 +- includes/tgmath.h | 30 +- includes/time.h | 59 +- includes/wchar.h | 73 +- includes/wctype.h | 48 +- personalities/__pdc_stdio.h | 22 - personalities/__personality.h | 22 - personalities/float.h | 50 - personalities/limits.h | 55 - personalities/personality.txt | 71 + personalities/stdint.h | 138 -- .../template/includes/__personality.h | 25 + personality.txt | 83 -- 199 files changed, 3560 insertions(+), 2324 deletions(-) delete mode 100644 includes/__NULL.h delete mode 100644 includes/__WCHAR.h create mode 100644 includes/__intern.h delete mode 100644 includes/__size_t.h delete mode 100644 includes/__tm.h delete mode 100644 includes/__wchar_t.h delete mode 100644 includes/__wint_t.h create mode 100644 includes/float.h create mode 100644 includes/limits.h create mode 100644 includes/stdint.h delete mode 100644 personalities/__pdc_stdio.h delete mode 100644 personalities/__personality.h delete mode 100644 personalities/float.h delete mode 100644 personalities/limits.h create mode 100644 personalities/personality.txt delete mode 100644 personalities/stdint.h create mode 100644 personalities/template/includes/__personality.h delete mode 100644 personality.txt diff --git a/functions/assert.c b/functions/assert.c index 6168ea6..3e887d9 100644 --- a/functions/assert.c +++ b/functions/assert.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ #include #include diff --git a/functions/complex/cabs.c b/functions/complex/cabs.c index e1afe40..2d74c2c 100644 --- a/functions/complex/cabs.c +++ b/functions/complex/cabs.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double cabs( double _Complex x ) { /* TODO */ }; float cabsf( float _Complex x ) { /* TODO */ }; diff --git a/functions/complex/cacos.c b/functions/complex/cacos.c index cfa5a88..9711dd3 100644 --- a/functions/complex/cacos.c +++ b/functions/complex/cacos.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double _Complex cacos( double _Complex x ) { /* TODO */ }; float _Complex cacosf( float _Complex x ) { /* TODO */ }; diff --git a/functions/complex/cacosh.c b/functions/complex/cacosh.c index 61a27d7..a1e00fb 100644 --- a/functions/complex/cacosh.c +++ b/functions/complex/cacosh.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double _Complex cacosh( double _Complex x ) { /* TODO */ }; float _Complex cacoshf( float _Complex x ) { /* TODO */ }; diff --git a/functions/complex/carg.c b/functions/complex/carg.c index a338cd0..dbb707c 100644 --- a/functions/complex/carg.c +++ b/functions/complex/carg.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double carg( double _Complex x ) { /* TODO */ }; float cargf( float _Complex x ) { /* TODO */ }; diff --git a/functions/complex/casin.c b/functions/complex/casin.c index 9ac4d75..af4a065 100644 --- a/functions/complex/casin.c +++ b/functions/complex/casin.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double _Complex casin( double _Complex x ) { /* TODO */ }; float _Complex casinf( float _Complex x ) { /* TODO */ }; diff --git a/functions/complex/casinh.c b/functions/complex/casinh.c index 763bce7..72eee57 100644 --- a/functions/complex/casinh.c +++ b/functions/complex/casinh.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double _Complex casinh( double _Complex x ) { /* TODO */ }; float _Complex casinhf( float _Complex x ) { /* TODO */ }; diff --git a/functions/complex/catan.c b/functions/complex/catan.c index c5854bd..d05f9d3 100644 --- a/functions/complex/catan.c +++ b/functions/complex/catan.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double _Complex catan( double _Complex x ) { /* TODO */ }; float _Complex catanf( float _Complex x ) { /* TODO */ }; diff --git a/functions/complex/catanh.c b/functions/complex/catanh.c index 1288262..7a25af2 100644 --- a/functions/complex/catanh.c +++ b/functions/complex/catanh.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double _Complex catanh( double _Complex x ) { /* TODO */ }; float _Complex catanhf( float _Complex x ) { /* TODO */ }; diff --git a/functions/complex/cconj.c b/functions/complex/cconj.c index 7e4d1f8..cb438a7 100644 --- a/functions/complex/cconj.c +++ b/functions/complex/cconj.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double _Complex conj( double _Complex x ) { /* TODO */ }; float _Complex conjf( float _Complex x ) { /* TODO */ }; diff --git a/functions/complex/ccos.c b/functions/complex/ccos.c index 0a61fd2..ecaee27 100644 --- a/functions/complex/ccos.c +++ b/functions/complex/ccos.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double _Complex ccos( double _Complex x ) { /* TODO */ }; float _Complex ccosf( float _Complex x ) { /* TODO */ }; diff --git a/functions/complex/ccosh.c b/functions/complex/ccosh.c index 5503333..112aaaf 100644 --- a/functions/complex/ccosh.c +++ b/functions/complex/ccosh.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double _Complex ccosh( double _Complex x ) { /* TODO */ }; float _Complex ccoshf( float _Complex x ) { /* TODO */ }; diff --git a/functions/complex/cexp.c b/functions/complex/cexp.c index acfcb27..5ebf726 100644 --- a/functions/complex/cexp.c +++ b/functions/complex/cexp.c @@ -1,11 +1,10 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double _Complex cexp( double _Complex x ) { /* TODO */ }; float _Complex cexpf( float _Complex x ) { /* TODO */ }; long double _Complex cexpl( long double _Complex x ) { /* TODO */ }; - diff --git a/functions/complex/cimag.c b/functions/complex/cimag.c index 018fd26..1a666fb 100644 --- a/functions/complex/cimag.c +++ b/functions/complex/cimag.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double cimag( double _Complex x ) { /* TODO */ }; float cimagf( float _Complex x ) { /* TODO */ }; diff --git a/functions/complex/clog.c b/functions/complex/clog.c index 94bea7d..84bfb19 100644 --- a/functions/complex/clog.c +++ b/functions/complex/clog.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double _Complex clog( double _Complex x ) { /* TODO */ }; float _Complex clogf( float _Complex x ) { /* TODO */ }; diff --git a/functions/complex/cpow.c b/functions/complex/cpow.c index 5975367..3f6313a 100644 --- a/functions/complex/cpow.c +++ b/functions/complex/cpow.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double _Complex cpow( double _Complex x, double _Complex y ) { /* TODO */ }; float _Complex cpowf( float _Complex x, float _Complex y ) { /* TODO */ }; diff --git a/functions/complex/cproj.c b/functions/complex/cproj.c index fc811d6..23f85ef 100644 --- a/functions/complex/cproj.c +++ b/functions/complex/cproj.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double _Complex cproj( double _Complex x ) { /* TODO */ }; float _Complex cprojf( float _Complex x ) { /* TODO */ }; diff --git a/functions/complex/creal.c b/functions/complex/creal.c index 4c02e35..2e532b1 100644 --- a/functions/complex/creal.c +++ b/functions/complex/creal.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double creal( double _Complex x ) { /* TODO */ }; float crealf( float _Complex x ) { /* TODO */ }; diff --git a/functions/complex/csin.c b/functions/complex/csin.c index edc45aa..e4b30f1 100644 --- a/functions/complex/csin.c +++ b/functions/complex/csin.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double _Complex csin( double _Complex x ) { /* TODO */ }; float _Complex csinf( float _Complex x ) { /* TODO */ }; diff --git a/functions/complex/csinh.c b/functions/complex/csinh.c index a40c2ff..f120593 100644 --- a/functions/complex/csinh.c +++ b/functions/complex/csinh.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double _Complex csinh( double _Complex x ) { /* TODO */ }; float _Complex csinhf( float _Complex x ) { /* TODO */ }; diff --git a/functions/complex/csqrt.c b/functions/complex/csqrt.c index af119b5..f9fa89c 100644 --- a/functions/complex/csqrt.c +++ b/functions/complex/csqrt.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double _Complex csqrt( double _Complex x ) { /* TODO */ }; float _Complex csqrtf( float _Complex x ) { /* TODO */ }; diff --git a/functions/complex/ctan.c b/functions/complex/ctan.c index 12896f2..958fba3 100644 --- a/functions/complex/ctan.c +++ b/functions/complex/ctan.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double _Complex ctan( double _Complex x ) { /* TODO */ }; float _Complex ctanf( float _Complex x ) { /* TODO */ }; diff --git a/functions/complex/ctanh.c b/functions/complex/ctanh.c index daa5a7c..c12611f 100644 --- a/functions/complex/ctanh.c +++ b/functions/complex/ctanh.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double _Complex ctanh( double _Complex x ) { /* TODO */ }; float _Complex ctanhf( float _Complex x ) { /* TODO */ }; diff --git a/functions/ctype.c b/functions/ctype.c index 14bdeda..390e39b 100644 --- a/functions/ctype.c +++ b/functions/ctype.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int isalnum( int c ) { /* TODO */ }; int isalpha( int c ) { /* TODO */ }; diff --git a/functions/errno.c b/functions/errno.c index 1768b61..843c8a9 100644 --- a/functions/errno.c +++ b/functions/errno.c @@ -1,8 +1,8 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ -int errno = 0; \ No newline at end of file +int errno = 0; diff --git a/functions/fenv.c b/functions/fenv.c index 89bc1b2..592bee2 100644 --- a/functions/fenv.c +++ b/functions/fenv.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int feclearexcept( int exceptions ) { /* TODO */ }; int fegetexceptflag( fexcept_t * flags, int exceptions ) { /* TODO */ }; diff --git a/functions/inttypes.c b/functions/inttypes.c index 6025be3..c223a2e 100644 --- a/functions/inttypes.c +++ b/functions/inttypes.c @@ -1,12 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------- -// Standard C +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ intmax_t imaxabs( intmax_t i ) { /* TODO */ }; imaxdiv_t imaxdiv( intmax_t numer, intmax_t denom ) { /* TODO */ }; diff --git a/functions/locale.c b/functions/locale.c index 757bf8e..a0eec02 100644 --- a/functions/locale.c +++ b/functions/locale.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ /* PDPC code - unreviewed static struct lconv thislocale = { diff --git a/functions/math/abs.c b/functions/math/abs.c index c455278..0dae242 100644 --- a/functions/math/abs.c +++ b/functions/math/abs.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double fabs( double x ) { /* TODO */ }; diff --git a/functions/math/acos.c b/functions/math/acos.c index fcb28bc..2661849 100644 --- a/functions/math/acos.c +++ b/functions/math/acos.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double acos( double x ) { /* TODO */ }; float acosf( float x ) { /* TODO */ }; diff --git a/functions/math/acosh.c b/functions/math/acosh.c index 81cd66b..d988aee 100644 --- a/functions/math/acosh.c +++ b/functions/math/acosh.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double acosh( double x ) { /* TODO */ }; float acoshf( float x ) { /* TODO */ }; diff --git a/functions/math/asin.c b/functions/math/asin.c index 3f2a992..6807ced 100644 --- a/functions/math/asin.c +++ b/functions/math/asin.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double asin( double x ) { /* TODO */ }; float asinf( float x ) { /* TODO */ }; diff --git a/functions/math/asinh.c b/functions/math/asinh.c index 7c0cfd6..7674db6 100644 --- a/functions/math/asinh.c +++ b/functions/math/asinh.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double asinh( double x ) { /* TODO */ }; float asinhf( float x ) { /* TODO */ }; diff --git a/functions/math/atan.c b/functions/math/atan.c index adb0a16..9798f61 100644 --- a/functions/math/atan.c +++ b/functions/math/atan.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double atan( double x ) { /* TODO */ }; float atanf( float x ) { /* TODO */ }; diff --git a/functions/math/atan2.c b/functions/math/atan2.c index 29ebc6f..7ceb789 100644 --- a/functions/math/atan2.c +++ b/functions/math/atan2.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double atan2( double y, double x ) { /* TODO */ }; float atan2f( float y, float x ) { /* TODO */ }; diff --git a/functions/math/atanh.c b/functions/math/atanh.c index 1dedd93..4566dab 100644 --- a/functions/math/atanh.c +++ b/functions/math/atanh.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double atanh( double x ) { /* TODO */ }; float atanhf( float x ) { /* TODO */ }; diff --git a/functions/math/cbrt.c b/functions/math/cbrt.c index 64185aa..12fc59e 100644 --- a/functions/math/cbrt.c +++ b/functions/math/cbrt.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double cbrt( double x ) { /* TODO */ }; diff --git a/functions/math/ceil.c b/functions/math/ceil.c index c5e6f95..4c1e7bd 100644 --- a/functions/math/ceil.c +++ b/functions/math/ceil.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double ceil( double x ) { /* TODO */ }; diff --git a/functions/math/copysign.c b/functions/math/copysign.c index 61e13dd..98622f4 100644 --- a/functions/math/copysign.c +++ b/functions/math/copysign.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double copysign( double x, double y ) { /* TODO */ }; diff --git a/functions/math/cos.c b/functions/math/cos.c index 7fd8542..333e114 100644 --- a/functions/math/cos.c +++ b/functions/math/cos.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double cos( double x ) { /* TODO */ }; float cosf( float x ) { /* TODO */ }; diff --git a/functions/math/cosh.c b/functions/math/cosh.c index 09e2223..b81ca1f 100644 --- a/functions/math/cosh.c +++ b/functions/math/cosh.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double cosh( double x ) { /* TODO */ }; float coshf( float x ) { /* TODO */ }; diff --git a/functions/math/erf.c b/functions/math/erf.c index f6227e3..bdda8dd 100644 --- a/functions/math/erf.c +++ b/functions/math/erf.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double erf( double x ) { /* TODO */ }; float erff( float x ) { /* TODO */ }; diff --git a/functions/math/exp.c b/functions/math/exp.c index 7bf8ce3..37033d2 100644 --- a/functions/math/exp.c +++ b/functions/math/exp.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double exp( double x ) { /* TODO */ }; float expf( float x ) { /* TODO */ }; diff --git a/functions/math/fdim.c b/functions/math/fdim.c index f87d1cc..5956e5f 100644 --- a/functions/math/fdim.c +++ b/functions/math/fdim.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double fdim( double x, double y ) { /* TODO */ }; diff --git a/functions/math/floor.c b/functions/math/floor.c index ea890be..7d62107 100644 --- a/functions/math/floor.c +++ b/functions/math/floor.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double floor( double x ) { /* TODO */ }; diff --git a/functions/math/fma.c b/functions/math/fma.c index 31eff28..dbfec2a 100644 --- a/functions/math/fma.c +++ b/functions/math/fma.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double fma( double x, double y, double z ) { /* TODO */ }; diff --git a/functions/math/fmax.c b/functions/math/fmax.c index 6bc8e6c..ecbfce3 100644 --- a/functions/math/fmax.c +++ b/functions/math/fmax.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double fmax( double x, double y ) { /* TODO */ }; diff --git a/functions/math/fmin.c b/functions/math/fmin.c index 22ea962..3ba9b29 100644 --- a/functions/math/fmin.c +++ b/functions/math/fmin.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double fmin( double x, double y ) { /* TODO */ }; diff --git a/functions/math/gamma.c b/functions/math/gamma.c index 7720efa..a9dab9d 100644 --- a/functions/math/gamma.c +++ b/functions/math/gamma.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double lgamma( double x ) { /* TODO */ }; float lgammaf( float x ) { /* TODO */ }; diff --git a/functions/math/hypot.c b/functions/math/hypot.c index b4412aa..83dc672 100644 --- a/functions/math/hypot.c +++ b/functions/math/hypot.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double hypot( double x, double y ) { /* TODO */ }; diff --git a/functions/math/log.c b/functions/math/log.c index fce90a7..34712a5 100644 --- a/functions/math/log.c +++ b/functions/math/log.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double log( double x ) { /* TODO */ }; float logf( float x ) { /* TODO */ }; diff --git a/functions/math/mod.c b/functions/math/mod.c index ed3a371..468f2c4 100644 --- a/functions/math/mod.c +++ b/functions/math/mod.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double fmod( double x, double y ) { /* TODO */ }; diff --git a/functions/math/nan.c b/functions/math/nan.c index 5d0526e..f13aefd 100644 --- a/functions/math/nan.c +++ b/functions/math/nan.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double nan( const char *str ) { /* TODO */ }; float nanf( const char *str ) { /* TODO */ }; diff --git a/functions/math/nearbyint.c b/functions/math/nearbyint.c index f9f7efa..3937dbe 100644 --- a/functions/math/nearbyint.c +++ b/functions/math/nearbyint.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double nearbyint( double x ) { /* TODO */ }; diff --git a/functions/math/nextafter.c b/functions/math/nextafter.c index 204caad..5b5eceb 100644 --- a/functions/math/nextafter.c +++ b/functions/math/nextafter.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double nextafter( double x, double y ) { /* TODO */ }; float nextafterf( float x, float y ) { /* TODO */ }; diff --git a/functions/math/nexttoward.c b/functions/math/nexttoward.c index 30e8d94..2f4ef29 100644 --- a/functions/math/nexttoward.c +++ b/functions/math/nexttoward.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double nexttoward( double x, long double y ) { /* TODO */ }; float nexttowardf( float x, long double y ) { /* TODO */ }; diff --git a/functions/math/pow.c b/functions/math/pow.c index 583c8f3..776b46f 100644 --- a/functions/math/pow.c +++ b/functions/math/pow.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double pow( double x, double y ) { /* TODO */ }; float powf( float x, float y ) { /* TODO */ }; diff --git a/functions/math/remainder.c b/functions/math/remainder.c index 08f167a..170cae2 100644 --- a/functions/math/remainder.c +++ b/functions/math/remainder.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double remainder( double x, double y ) { /* TODO */ }; diff --git a/functions/math/remquo.c b/functions/math/remquo.c index 59d37b0..a11e356 100644 --- a/functions/math/remquo.c +++ b/functions/math/remquo.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double remquo( double x, double y, int * pquo ) { /* TODO */ }; float remquof( float x, float y, int * pquo ) { /* TODO */ }; diff --git a/functions/math/rint.c b/functions/math/rint.c index 96bd502..1c7fe3d 100644 --- a/functions/math/rint.c +++ b/functions/math/rint.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ long long llrint( double x ) { /* TODO */ }; long long llrintf( float x ) { /* TODO */ }; diff --git a/functions/math/round.c b/functions/math/round.c index b2abcd1..d5a052b 100644 --- a/functions/math/round.c +++ b/functions/math/round.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ long long llround( double x ) { /* TODO */ }; long long llroundf( float x ) { /* TODO */ }; diff --git a/functions/math/scalbn.c b/functions/math/scalbn.c index 88d882b..cfcd5e2 100644 --- a/functions/math/scalbn.c +++ b/functions/math/scalbn.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double scalbn( double x, int ex ) { /* TODO */ }; float scalbnf( float x, int ex ) { /* TODO */ }; diff --git a/functions/math/sin.c b/functions/math/sin.c index 27ad651..98a2318 100644 --- a/functions/math/sin.c +++ b/functions/math/sin.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double sin( double x ) { /* TODO */ }; float sinf( float x ) { /* TODO */ }; diff --git a/functions/math/sinh.c b/functions/math/sinh.c index c24ee3d..3a0ef4c 100644 --- a/functions/math/sinh.c +++ b/functions/math/sinh.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double sinh( double x ) { /* TODO */ }; float sinhf( float x ) { /* TODO */ }; diff --git a/functions/math/sqrt.c b/functions/math/sqrt.c index 7dd6020..802f4ce 100644 --- a/functions/math/sqrt.c +++ b/functions/math/sqrt.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double sqrt( double x ) { /* TODO */ }; diff --git a/functions/math/tan.c b/functions/math/tan.c index 1f53933..4d2dc4e 100644 --- a/functions/math/tan.c +++ b/functions/math/tan.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double tan( double x ) { /* TODO */ }; float tanf( float x ) { /* TODO */ }; diff --git a/functions/math/tanh.c b/functions/math/tanh.c index b121620..02bb494 100644 --- a/functions/math/tanh.c +++ b/functions/math/tanh.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double tanh( double x ) { /* TODO */ }; float tanhf( float x ) { /* TODO */ }; diff --git a/functions/math/trunc.c b/functions/math/trunc.c index c018c06..752afc0 100644 --- a/functions/math/trunc.c +++ b/functions/math/trunc.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double trunc( double x ) { /* TODO */ }; diff --git a/functions/setjmp.c b/functions/setjmp.c index 762edfb..3913420 100644 --- a/functions/setjmp.c +++ b/functions/setjmp.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int setjmp(jmp_buf env) { /* TODO */ }; -void longjmp(jmp_buf env, int val) { /* TODO */ }; \ No newline at end of file +void longjmp(jmp_buf env, int val) { /* TODO */ }; diff --git a/functions/signal.c b/functions/signal.c index d0fc8b6..b9da182 100644 --- a/functions/signal.c +++ b/functions/signal.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ /* PDPC code - unreviewed static void (*handlers[6])(int) = { diff --git a/functions/stdio/clearerr.c b/functions/stdio/clearerr.c index 7fcdf8e..28a042d 100644 --- a/functions/stdio/clearerr.c +++ b/functions/stdio/clearerr.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ #ifndef __FILE_H #define __FILE_H __FILE_H diff --git a/functions/stdio/fclose.c b/functions/stdio/fclose.c index 446b8ee..f672fb0 100644 --- a/functions/stdio/fclose.c +++ b/functions/stdio/fclose.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int fclose( FILE * stream ) { /* TODO */ }; diff --git a/functions/stdio/feof.c b/functions/stdio/feof.c index 93203d0..dab3b7e 100644 --- a/functions/stdio/feof.c +++ b/functions/stdio/feof.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ #ifndef __FILE_H #define __FILE_H __FILE_H diff --git a/functions/stdio/ferror.c b/functions/stdio/ferror.c index 71bd737..cf11f4c 100644 --- a/functions/stdio/ferror.c +++ b/functions/stdio/ferror.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ #ifndef __FILE_H #define __FILE_H __FILE_H diff --git a/functions/stdio/fflush.c b/functions/stdio/fflush.c index 66e97a5..137fd49 100644 --- a/functions/stdio/fflush.c +++ b/functions/stdio/fflush.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int fflush( FILE * stream ) { /* TODO */ }; diff --git a/functions/stdio/fgetc.c b/functions/stdio/fgetc.c index c4f2993..ba7f8ff 100644 --- a/functions/stdio/fgetc.c +++ b/functions/stdio/fgetc.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int fgetc( FILE * stream ) { /* TODO */ }; diff --git a/functions/stdio/fgetpos.c b/functions/stdio/fgetpos.c index c97cf01..df80ccc 100644 --- a/functions/stdio/fgetpos.c +++ b/functions/stdio/fgetpos.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int fgetpos( FILE * restrict stream, fpos_t * restrict pos ) { /* TODO */ }; diff --git a/functions/stdio/fgets.c b/functions/stdio/fgets.c index 556e426..638bcdd 100644 --- a/functions/stdio/fgets.c +++ b/functions/stdio/fgets.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ char * fgets( char * restrict s, int n, FILE * restrict stream ) { /* TODO */ }; diff --git a/functions/stdio/fopen.c b/functions/stdio/fopen.c index 3bab83a..b088a4a 100644 --- a/functions/stdio/fopen.c +++ b/functions/stdio/fopen.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ FILE * fopen( const char * restrict filename, const char * restrict mode ) { /* TODO */ }; diff --git a/functions/stdio/fprintf.c b/functions/stdio/fprintf.c index d3d4cb6..58adaa0 100644 --- a/functions/stdio/fprintf.c +++ b/functions/stdio/fprintf.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int fprintf( FILE * restrict stream, const char * restrict format, ... ) { /* TODO */ }; diff --git a/functions/stdio/fputc.c b/functions/stdio/fputc.c index a89d298..d17c936 100644 --- a/functions/stdio/fputc.c +++ b/functions/stdio/fputc.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int fputc( int c, FILE * stream ) { /* TODO */ }; diff --git a/functions/stdio/fputs.c b/functions/stdio/fputs.c index e7a04f7..ad75cd2 100644 --- a/functions/stdio/fputs.c +++ b/functions/stdio/fputs.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int fputs( const char * restrict s, FILE * restrict stream ) { /* TODO */ }; diff --git a/functions/stdio/fread.c b/functions/stdio/fread.c index b580fe5..6f528cb 100644 --- a/functions/stdio/fread.c +++ b/functions/stdio/fread.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ size_t fread( void * restrict ptr, size_t size, size_t nelem, FILE * restrict stream ) { /* TODO */ }; diff --git a/functions/stdio/freopen.c b/functions/stdio/freopen.c index 8758814..2619eea 100644 --- a/functions/stdio/freopen.c +++ b/functions/stdio/freopen.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ FILE * freopen( const char * restrict filename, const char * restrict mode, FILE * stream ) { /* TODO */ }; diff --git a/functions/stdio/fscanf.c b/functions/stdio/fscanf.c index 2be1758..05a9a1a 100644 --- a/functions/stdio/fscanf.c +++ b/functions/stdio/fscanf.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int fscanf( FILE * restrict stream, const char * restrict format, ... ) { /* TODO */ }; diff --git a/functions/stdio/fseek.c b/functions/stdio/fseek.c index b4e76b9..61dbc4f 100644 --- a/functions/stdio/fseek.c +++ b/functions/stdio/fseek.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int fseek( FILE * stream, long offset, int mode ) { /* TODO */ }; diff --git a/functions/stdio/fsetpos.c b/functions/stdio/fsetpos.c index b771047..044c974 100644 --- a/functions/stdio/fsetpos.c +++ b/functions/stdio/fsetpos.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int fsetpos( FILE * stream, const fpos_t * pos ) { /* TODO */ }; diff --git a/functions/stdio/ftell.c b/functions/stdio/ftell.c index f4efecd..9518033 100644 --- a/functions/stdio/ftell.c +++ b/functions/stdio/ftell.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ long ftell( FILE * stream ) { /* TODO */ }; diff --git a/functions/stdio/fwrite.c b/functions/stdio/fwrite.c index 97bbbd5..d2698b8 100644 --- a/functions/stdio/fwrite.c +++ b/functions/stdio/fwrite.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ size_t fwrite( const void * restrict ptr, size_t size, size_t nelem, FILE * restrict stream ) { /* TODO */ }; diff --git a/functions/stdio/getc.c b/functions/stdio/getc.c index f2de070..e54fca3 100644 --- a/functions/stdio/getc.c +++ b/functions/stdio/getc.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int getc( FILE * stream ) { /* TODO */ }; diff --git a/functions/stdio/getchar.c b/functions/stdio/getchar.c index 0ba30fc..485a613 100644 --- a/functions/stdio/getchar.c +++ b/functions/stdio/getchar.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int getchar( void ) { /* TODO */ }; diff --git a/functions/stdio/gets.c b/functions/stdio/gets.c index ecba23f..cd2942e 100644 --- a/functions/stdio/gets.c +++ b/functions/stdio/gets.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ char * gets( char * s ) { /* TODO */ }; diff --git a/functions/stdio/perror.c b/functions/stdio/perror.c index d94746c..d85cd64 100644 --- a/functions/stdio/perror.c +++ b/functions/stdio/perror.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ void perror( const char * s ) { /* TODO */ }; diff --git a/functions/stdio/printf.c b/functions/stdio/printf.c index 440fa5f..d576994 100644 --- a/functions/stdio/printf.c +++ b/functions/stdio/printf.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int printf( const char * restrict format, ... ) { /* TODO */ }; diff --git a/functions/stdio/putc.c b/functions/stdio/putc.c index 01acfd8..4f25903 100644 --- a/functions/stdio/putc.c +++ b/functions/stdio/putc.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int putc( int c, FILE * stream ) { /* TODO */ }; diff --git a/functions/stdio/putchar.c b/functions/stdio/putchar.c index 7025698..673d86a 100644 --- a/functions/stdio/putchar.c +++ b/functions/stdio/putchar.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int putchar( int c ) { /* TODO */ }; diff --git a/functions/stdio/puts.c b/functions/stdio/puts.c index d4ec498..3c819dd 100644 --- a/functions/stdio/puts.c +++ b/functions/stdio/puts.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int puts( const char * s ) { /* TODO */ }; diff --git a/functions/stdio/remove.c b/functions/stdio/remove.c index e89b995..7985984 100644 --- a/functions/stdio/remove.c +++ b/functions/stdio/remove.c @@ -1,8 +1,8 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int remove( const char * filename ) { /* TODO */ }; diff --git a/functions/stdio/rename.c b/functions/stdio/rename.c index 5cb5665..d9b3d1f 100644 --- a/functions/stdio/rename.c +++ b/functions/stdio/rename.c @@ -1,8 +1,8 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int rename( const char * old, const char * new ) { /* TODO */ }; diff --git a/functions/stdio/rewind.c b/functions/stdio/rewind.c index fdcb430..b893086 100644 --- a/functions/stdio/rewind.c +++ b/functions/stdio/rewind.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ void rewind( FILE * stream ) { /* TODO */ }; diff --git a/functions/stdio/scanf.c b/functions/stdio/scanf.c index e4342ab..612f151 100644 --- a/functions/stdio/scanf.c +++ b/functions/stdio/scanf.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int scanf( const char * restrict format, ... ) { /* TODO */ }; diff --git a/functions/stdio/setbuf.c b/functions/stdio/setbuf.c index 85137af..163f1f5 100644 --- a/functions/stdio/setbuf.c +++ b/functions/stdio/setbuf.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ void setbuf( FILE * restrict stream, char * restrict buf ) { /* TODO */ }; diff --git a/functions/stdio/setvbuf.c b/functions/stdio/setvbuf.c index 2f9b4c4..a88a27f 100644 --- a/functions/stdio/setvbuf.c +++ b/functions/stdio/setvbuf.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int setvbuf( FILE * restrict stream, char * restrict buf, int mode, size_t size ) { /* TODO */ }; diff --git a/functions/stdio/snprintf.c b/functions/stdio/snprintf.c index f4b7ebf..dd2a972 100644 --- a/functions/stdio/snprintf.c +++ b/functions/stdio/snprintf.c @@ -1,8 +1,8 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int snprintf( char * restrict s, size_t n, const char * restrict format, ... ) { /* TODO */ }; diff --git a/functions/stdio/sprintf.c b/functions/stdio/sprintf.c index 2063e78..b992dba 100644 --- a/functions/stdio/sprintf.c +++ b/functions/stdio/sprintf.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int sprintf( char * restrict s, const char * restrict format, ... ) { /* TODO */ }; diff --git a/functions/stdio/sscanf.c b/functions/stdio/sscanf.c index 0b902ee..9103aab 100644 --- a/functions/stdio/sscanf.c +++ b/functions/stdio/sscanf.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int sscanf( const char * restrict s, const char * restrict format, ... ) { /* TODO */ }; diff --git a/functions/stdio/tmpfile.c b/functions/stdio/tmpfile.c index 1eb153d..e5b7fd8 100644 --- a/functions/stdio/tmpfile.c +++ b/functions/stdio/tmpfile.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ FILE * tmpfile( void ) { /* TODO */ }; @@ -11,4 +11,4 @@ FILE * tmpfile( void ) { /* TODO */ }; { return (fopen("ZZZZZZZA.$$$", "wb+")); } -*/ \ No newline at end of file +*/ diff --git a/functions/stdio/tmpnam.c b/functions/stdio/tmpnam.c index ad642a0..69edae7 100644 --- a/functions/stdio/tmpnam.c +++ b/functions/stdio/tmpnam.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ char * tmpnam( char * s ) { /* TODO */ }; diff --git a/functions/stdio/ungetc.c b/functions/stdio/ungetc.c index f15d8a3..1bd7323 100644 --- a/functions/stdio/ungetc.c +++ b/functions/stdio/ungetc.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int ungetc( int c, FILE * stream ) { /* TODO */ }; diff --git a/functions/stdio/vfprintf.c b/functions/stdio/vfprintf.c index 7bbc212..00de473 100644 --- a/functions/stdio/vfprintf.c +++ b/functions/stdio/vfprintf.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int vfprintf( FILE * restrict stream, const char * restrict format, va_list ap ) { /* TODO */ }; diff --git a/functions/stdio/vfscanf.c b/functions/stdio/vfscanf.c index a75870e..92b4beb 100644 --- a/functions/stdio/vfscanf.c +++ b/functions/stdio/vfscanf.c @@ -1,8 +1,8 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int vfscanf( FILE * restrict stream, const char * restrict format, va_list ap ) { /* TODO */ }; diff --git a/functions/stdio/vprintf.c b/functions/stdio/vprintf.c index 02de2e0..e55eb7c 100644 --- a/functions/stdio/vprintf.c +++ b/functions/stdio/vprintf.c @@ -1,8 +1,8 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int vprintf( const char * restrict format, va_list ap ) { /* TODO */ }; diff --git a/functions/stdio/vscanf.c b/functions/stdio/vscanf.c index 14d69f7..8287237 100644 --- a/functions/stdio/vscanf.c +++ b/functions/stdio/vscanf.c @@ -1,9 +1,8 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int vscanf( const char * restrict format, va_list ap ) { /* TODO */ }; - diff --git a/functions/stdio/vsnprintf.c b/functions/stdio/vsnprintf.c index df104ec..6fae080 100644 --- a/functions/stdio/vsnprintf.c +++ b/functions/stdio/vsnprintf.c @@ -1,8 +1,8 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int vsnprintf( char * restrict s, size_t n, const char * restrict format, va_list ap ) { /* TODO */ }; diff --git a/functions/stdio/vsprintf.c b/functions/stdio/vsprintf.c index 8e21b70..e17f6ff 100644 --- a/functions/stdio/vsprintf.c +++ b/functions/stdio/vsprintf.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int vsprintf( char * restrict s, const char * restrict format, va_list ap) { /* TODO */ }; diff --git a/functions/stdio/vsscanf.c b/functions/stdio/vsscanf.c index f29f051..97efeb2 100644 --- a/functions/stdio/vsscanf.c +++ b/functions/stdio/vsscanf.c @@ -1,8 +1,8 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int vsscanf( const char * restrict s, const char * restrict format, va_list ap ) { /* TODO */ }; diff --git a/functions/stdlib/_Exit.c b/functions/stdlib/_Exit.c index 561ab4a..15cfd54 100644 --- a/functions/stdlib/_Exit.c +++ b/functions/stdlib/_Exit.c @@ -1,8 +1,8 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ void _Exit( int status ) { /* TODO */ }; diff --git a/functions/stdlib/abort.c b/functions/stdlib/abort.c index 5f18565..1665706 100644 --- a/functions/stdlib/abort.c +++ b/functions/stdlib/abort.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ void abort( void ) { /* TODO */ }; @@ -12,4 +12,4 @@ void abort( void ) { /* TODO */ }; raise(SIGABRT); exit(EXIT_FAILURE); } -*/ \ No newline at end of file +*/ diff --git a/functions/stdlib/atexit.c b/functions/stdlib/atexit.c index 9792cad..d9f0ee9 100644 --- a/functions/stdlib/atexit.c +++ b/functions/stdlib/atexit.c @@ -1,11 +1,10 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ -// TODO: C/C++ linkages int atexit( void (*func) ( void ) ) { /* TODO */ }; /* PDPC code - unreviewed diff --git a/functions/stdlib/bsearch.c b/functions/stdlib/bsearch.c index c03cd45..fa58d0d 100644 --- a/functions/stdlib/bsearch.c +++ b/functions/stdlib/bsearch.c @@ -1,11 +1,10 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ -// TODO: C/C++ linkage void * bsearch( const void * key, const void * base, size_t nelem, size_t size, int (*cmp) ( const void * ck, const void * ce) ) { /* TODO */ }; /* PDPC code - unreviewed diff --git a/functions/stdlib/calloc.c b/functions/stdlib/calloc.c index 4169f84..a9a485f 100644 --- a/functions/stdlib/calloc.c +++ b/functions/stdlib/calloc.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ void * calloc( size_t nelem, size_t size ) { /* TODO */ }; @@ -31,4 +31,4 @@ void * calloc( size_t nelem, size_t size ) { /* TODO */ }; } return (ptr); } -*/ \ No newline at end of file +*/ diff --git a/functions/stdlib/div.c b/functions/stdlib/div.c index 4994d3d..34af223 100644 --- a/functions/stdlib/div.c +++ b/functions/stdlib/div.c @@ -1,18 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------- -// C++ - -ldiv_t div( long numer, long denom ) { /* TODO */ }; -lldiv_t div( long long numer, long long denom ) { /* TODO */ }; - -// ---------------------------------------------------------------------------- -// Standard C +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ div_t div( int numer, int denom ) { /* TODO */ }; lldiv_t lldiv( long long numer, long long denom ) { /* TODO */ }; diff --git a/functions/stdlib/exit.c b/functions/stdlib/exit.c index a0525e3..743744c 100644 --- a/functions/stdlib/exit.c +++ b/functions/stdlib/exit.c @@ -1,8 +1,8 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ void exit( int status ) { /* TODO */ }; diff --git a/functions/stdlib/free.c b/functions/stdlib/free.c index 5801248..150d7b3 100644 --- a/functions/stdlib/free.c +++ b/functions/stdlib/free.c @@ -1,8 +1,48 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ void free( void * ptr ) { /* TODO */ }; + +/* Thomas "Beyond Infinity" Kreitner's code - unchecked, unoptimized +{ + chunk_t * chunk; + chunk_t * prev_chunk; + chunk = used_mem.start; + do + { + prev_chunk = chunk; + chunk = chunk->next; + } while ( ( chunk != NULL ) && ( chunk->address != ptr ) ); + if ( chunk->address == ptr ) + { + if( used_mem.start->next->next == NULL ) + { + /* used_mem list has only one entry */ + chunk = used_mem.start->next; + used_mem.last = used_mem.start; + } + else if ( chunk == used_mem.last ) + { + /* chunk is the last element of used_mem list */ + prev_chunk->next = NULL; + used_mem.last = prev_chunk; + } + else + { + /* chunk is neither only nor last in the used_mem list */ + prev_chunk->next = prev_chunk->next->next; + } + chunk->next = NULL; + free_mem.last->next = chunk; + free_mem.last = chunk; + return chunk; + } + else + { + return NULL; + } +} diff --git a/functions/stdlib/getenv.c b/functions/stdlib/getenv.c index 2b04d51..31ce5e4 100644 --- a/functions/stdlib/getenv.c +++ b/functions/stdlib/getenv.c @@ -1,8 +1,8 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ char * getenv( const char * name ) { /* TODO */ }; diff --git a/functions/stdlib/malloc.c b/functions/stdlib/malloc.c index d1a8d5e..a563350 100644 --- a/functions/stdlib/malloc.c +++ b/functions/stdlib/malloc.c @@ -1,8 +1,121 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ + +#include <__size_t.h> void * malloc( size_t size ) { /* TODO */ }; + +/* This is a simple best-fit / first-fit implementation heavily based on + * Thomas "Beyond Infinity" Kreitner's code + */ + +/* memory list element */ +struct chunk_t +{ + void * address; + size_t size; + chunk_t * next; +}; + +struct memlist_t +{ + chunk_t * start; + chunk_t * last; +}; + +size_t heap_start = 0xa0000000; +size_t heap_used = 0x00000050; /* HEAP in use. Holds the next FREE address (?) */ +size_t heap_max = 0xfffffff; /* max. HEAP */ + +static struct memlist_t free_mem = { (struct memlist_t *) heap_start, + (struct memlist_t *) heap_start }; +/* free_mem.start->next = NULL; */ + +static struct memlist_t used_mem = { (struct memlist_t *) heap_start + sizeof( chunk_t ), + (struct memlist_t *) heap_start + sizeof( chunk_t ) }; +/* used_mem.start->next = NULL; */ + +void * malloc( size_t size ) +{ + chunk_t * chunk = 0; + chunk_t * prev_chunk; + if ( free_mem.start != free_mem.last ) + { + /* first pass: exact fit */ + chunk = free_mem.start; + while ( 1 ) + { + prev_chunk = chunk; + chunk = chunk->next; + if ( ( chunk == NULL ) || ( chunk->size == size ) ) + { + break; + } + } + } + if ( chunk == NULL ) + { + /* second pass - first fit */ + chunk = free_mem.start; + while ( 1 ) + { + prev_chunk = chunk; + chunk = chunk-> next; + if ( ( chunk == NULL ) || ( chunk->size > size ) ) + { + break; + } + } + } + if ( chunk != NULL ) + { + /* remove chunk from free_mem list */ + if ( free_mem.start->next->next == NULL ) + { + /* free_mem list has only one entry */ + free_mem.last = free_mem.start; + } + else if ( chunk == free_mem.last ) + { + /* chunk is last element of free_mem list */ + prev_chunk->next = NULL; + free_mem.last = prev_chunk; + } + else + { + /* chunk is neither only nor last in free_mem list */ + prev_chunk->next = prev_chunk->next->next; + } + /* append chunk to used_mem list */ + chunk->next = NULL; + used_mem.last->next = chunk; + used_mem.last = chunk; + } + /* append new chunk to end of used_mem list (if there's space) */ + if ( chunk == NULL ) + { + if ( ( heap_used + size ) <= heap_max ) + { + /* building the header */ + chunk = (chunk_t *) heap_start + heap_used + 1; + chunk->size = size; + chunk->next = NULL; + chunk->address = chunk + sizeof( chunk_t ); + /* push heap_used past allocated area */ + heap_used += sizeof( chunk_t ) + size; + used_mem.last->next = chunk; + used_mem.last = chunk; + } + else + { + /* allocation would exceed max. heap size - + /* demand more memory from kernel - not implemented */ + return 0; + } + } + return (void *) chunk->address; +} diff --git a/functions/stdlib/mblen.c b/functions/stdlib/mblen.c index ae90a98..3b783f4 100644 --- a/functions/stdlib/mblen.c +++ b/functions/stdlib/mblen.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int mblen( const char * s, size_t n ) { /* TODO */ }; diff --git a/functions/stdlib/mbstowcs.c b/functions/stdlib/mbstowcs.c index f4ca6d1..a7cd2a0 100644 --- a/functions/stdlib/mbstowcs.c +++ b/functions/stdlib/mbstowcs.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ size_t mbstowcs( wchar_t * restrict wcs, const char * restrict s, size_t n ) { /* TODO */ }; diff --git a/functions/stdlib/mbtowc.c b/functions/stdlib/mbtowc.c index 7163019..c022d6e 100644 --- a/functions/stdlib/mbtowc.c +++ b/functions/stdlib/mbtowc.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int mbtowc( wchar_t * restrict pwc, const char * restrict s, size_t n ) { /* TODO */ }; @@ -26,4 +26,4 @@ int mbtowc( wchar_t * restrict pwc, const char * restrict s, size_t n ) { /* TOD return (-1); } } -*/ \ No newline at end of file +*/ diff --git a/functions/stdlib/qsort.c b/functions/stdlib/qsort.c index a1f903c..66bc14b 100644 --- a/functions/stdlib/qsort.c +++ b/functions/stdlib/qsort.c @@ -1,11 +1,10 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- - -// TODO: C/C++ linkage +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ + void qsort( void * base, size_t nelem, size_t size, int (*cmp) ( const void * e1, const void * e2) ) { /* TODO */ }; /* PDPC code - unreviewed @@ -156,4 +155,4 @@ static void swap_ints(char *ap, char *bp, size_t nints) } #endif -*/ \ No newline at end of file +*/ diff --git a/functions/stdlib/rand.c b/functions/stdlib/rand.c index 967ae2f..abe58f6 100644 --- a/functions/stdlib/rand.c +++ b/functions/stdlib/rand.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int rand( void ) { /* TODO */ }; void srand( unsigned int seed ) { /* TODO */ }; diff --git a/functions/stdlib/realloc.c b/functions/stdlib/realloc.c index ae11da5..93a2aa4 100644 --- a/functions/stdlib/realloc.c +++ b/functions/stdlib/realloc.c @@ -1,32 +1,71 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ void * realloc( void * ptr, size_t size ) { /* TODO */ }; -/* PDPC code - unreviewed +/* PDPC code - assumes size_t of memory chunk at offset -4. { - char *newptr; + char * newptr; size_t oldsize; - - newptr = malloc(size); - if (newptr == NULL) + + if ( ( newptr = malloc(size) ) != NULL ) { - return (NULL); + if ( ptr != NULL ) + { + // reading size information from hidden chunk header + oldsize = * (size_t *) ( (char *) ptr - 4 ); + // correctly handle *down*sizing as well as *up*sizing + memcpy( newptr, ptr, ( oldsize < size ) ? oldsize : size ); + free( ptr ); + } } - if (ptr != NULL) + return ( newptr ); +} +*/ + +/* Thomas "Beyond Infinity" Kreitner's code - unchecked, unoptimized +{ + uint_t found = 0; + uint_t length; + chunk_t * new; + chunk_t * chunk; + // searching the block to-be-allocated + chunk = used_mem.start; + while ( ! found && ( chunk->next != NULL ) { - oldsize = *(size_t *)((char *)ptr - 4); - if (oldsize < size) + if ( chunk->address == ptr ) + { + found++; + } + else { - size = oldsize; + chunk=chunk->next; } - memcpy(newptr, ptr, size); - free(ptr); } - return (newptr); + if ( found ) + { + length = chunk->length; + // allocate new memory area + if ( ( new = (void *) malloc( size ) ) != NULL ) + { + // copy the data + memcpy( ptr, new, length ); + // release the old memory + free( ptr ); + } + else + { + new = NULL; + } + } + else + { + new = NULL; + } + return new; } */ diff --git a/functions/stdlib/strtox.c b/functions/stdlib/strtox.c index 1def161..db73952 100644 --- a/functions/stdlib/strtox.c +++ b/functions/stdlib/strtox.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ double atof( const char * s ) { /* TODO */ }; int atoi( const char * s ) { /* TODO */ }; diff --git a/functions/stdlib/system.c b/functions/stdlib/system.c index 91e0ffa..c0638e4 100644 --- a/functions/stdlib/system.c +++ b/functions/stdlib/system.c @@ -1,15 +1,8 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ -void _Exit( int status ) { /* TODO */ }; -void exit( int status ) { /* TODO */ }; -void abort( void ) { /* TODO */ }; -char * getenv( const char * name ) { /* TODO */ }; int system( const char * s ) { /* TODO */ }; - -// TODO: C/C++ linkages -int atexit( void (*func) ( void ) ) { /* TODO */ }; diff --git a/functions/stdlib/wcstombs.c b/functions/stdlib/wcstombs.c index b78ddb7..dc964f7 100644 --- a/functions/stdlib/wcstombs.c +++ b/functions/stdlib/wcstombs.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ size_t wcstombs( char * restrict s, const wchar_t * restrict wcs, size_t n ) { /* TODO */ }; diff --git a/functions/stdlib/wctomb.c b/functions/stdlib/wctomb.c index 94e6367..450b242 100644 --- a/functions/stdlib/wctomb.c +++ b/functions/stdlib/wctomb.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int wctomb( char * s, wchar_t wchar ) { /* TODO */ }; diff --git a/functions/string/memchr.c b/functions/string/memchr.c index 6a09649..1c9563c 100644 --- a/functions/string/memchr.c +++ b/functions/string/memchr.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ #include <__size_t.h> #include <__NULL.h> diff --git a/functions/string/memcmp.c b/functions/string/memcmp.c index 35def11..8491ef7 100644 --- a/functions/string/memcmp.c +++ b/functions/string/memcmp.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ #include <__size_t.h> diff --git a/functions/string/memcpy.c b/functions/string/memcpy.c index de512ae..4e7b63c 100644 --- a/functions/string/memcpy.c +++ b/functions/string/memcpy.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ #include <__size_t.h> diff --git a/functions/string/memmove.c b/functions/string/memmove.c index 06f6774..f7ed6c1 100644 --- a/functions/string/memmove.c +++ b/functions/string/memmove.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ #include <__size_t.h> diff --git a/functions/string/memset.c b/functions/string/memset.c index 48477a7..17d96f5 100644 --- a/functions/string/memset.c +++ b/functions/string/memset.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ #include <__size_t.h> diff --git a/functions/string/strcat.c b/functions/string/strcat.c index dfbc135..eab90c1 100644 --- a/functions/string/strcat.c +++ b/functions/string/strcat.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ char * strcat( char * restrict dest, const char * restrict src ) { @@ -12,12 +12,12 @@ char * strcat( char * restrict dest, const char * restrict src ) { while ( *++dest_p != '\0' ) { - // EMPTY + /* EMPTY */ } } while ( (*dest_p++ = *src++) != '\0' ) { - // EMPTY + /* EMPTY */ } return dest; } diff --git a/functions/string/strchr.c b/functions/string/strchr.c index bff8d05..960e7e4 100644 --- a/functions/string/strchr.c +++ b/functions/string/strchr.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ #include <__NULL.h> diff --git a/functions/string/strcmp.c b/functions/string/strcmp.c index e72e376..874828e 100644 --- a/functions/string/strcmp.c +++ b/functions/string/strcmp.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int strcmp( const char * src_1, const char * src_2 ) { diff --git a/functions/string/strcoll.c b/functions/string/strcoll.c index c89b8cf..3c841e5 100644 --- a/functions/string/strcoll.c +++ b/functions/string/strcoll.c @@ -1,11 +1,11 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ -// TODO: Dummy function, does not support locales. +/* TODO: Dummy function, does not support locales. */ int strcmp( const char * src_1, const char * src_2 ); diff --git a/functions/string/strcpy.c b/functions/string/strcpy.c index 94f54b4..f9b340e 100644 --- a/functions/string/strcpy.c +++ b/functions/string/strcpy.c @@ -1,16 +1,16 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ char * strcpy( char * restrict dest, const char * restrict src ) { char * tmp = dest; while ( ( *dest++ = *src++ ) != '\0' ) { - // EMPTY + /* EMPTY */ } return tmp; } diff --git a/functions/string/strcspn.c b/functions/string/strcspn.c index 70b9788..7c4d9b8 100644 --- a/functions/string/strcspn.c +++ b/functions/string/strcspn.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ #include <__size_t.h> diff --git a/functions/string/strerror.c b/functions/string/strerror.c index 2fdacdb..1cd820c 100644 --- a/functions/string/strerror.c +++ b/functions/string/strerror.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ #include diff --git a/functions/string/strlen.c b/functions/string/strlen.c index ec0c21e..05e5e3b 100644 --- a/functions/string/strlen.c +++ b/functions/string/strlen.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ #include <__size_t.h> diff --git a/functions/string/strncat.c b/functions/string/strncat.c index d168e6e..4a81991 100644 --- a/functions/string/strncat.c +++ b/functions/string/strncat.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ #include <__size_t.h> diff --git a/functions/string/strncmp.c b/functions/string/strncmp.c index b6a98ce..9e5e615 100644 --- a/functions/string/strncmp.c +++ b/functions/string/strncmp.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ #include <__size_t.h> diff --git a/functions/string/strncpy.c b/functions/string/strncpy.c index 3784df4..e89332c 100644 --- a/functions/string/strncpy.c +++ b/functions/string/strncpy.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ #include <__size_t.h> @@ -12,7 +12,7 @@ char * strncpy( char * restrict dest, const char * restrict src, size_t n ) char * tmp = dest; while ( ( n-- != 0 ) && ( ( *dest++ = *src++ ) != '\0' ) ) { - // EMPTY + /* EMPTY */ } while ( n-- != 0 ) { diff --git a/functions/string/strpbrk.c b/functions/string/strpbrk.c index 9c4fe78..1006ab6 100644 --- a/functions/string/strpbrk.c +++ b/functions/string/strpbrk.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ #include <__NULL.h> diff --git a/functions/string/strrchr.c b/functions/string/strrchr.c index 6ce1a32..4f1e2b5 100644 --- a/functions/string/strrchr.c +++ b/functions/string/strrchr.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ #include <__NULL.h> diff --git a/functions/string/strspn.c b/functions/string/strspn.c index f8f89e1..55cf29a 100644 --- a/functions/string/strspn.c +++ b/functions/string/strspn.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ #include <__size_t.h> diff --git a/functions/string/strstr.c b/functions/string/strstr.c index 55f1db6..4a60479 100644 --- a/functions/string/strstr.c +++ b/functions/string/strstr.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ #include <__NULL.h> diff --git a/functions/string/strtok.c b/functions/string/strtok.c index 69b45a7..70d2cd7 100644 --- a/functions/string/strtok.c +++ b/functions/string/strtok.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ char * strtok( char * restrict src, const char * restrict seperators ) { @@ -12,24 +12,24 @@ char * strtok( char * restrict src, const char * restrict seperators ) if ( src != NULL ) { - // new string + /* new string */ store = src; } if ( store == NULL ) { - // no old string, no new string, nothing to do + /* no old string, no new string, nothing to do */ return NULL; } - src += strspn( src, seperators ); // skipping leading seperators + src += strspn( src, seperators ); /* skipping leading seperators */ if ( strlen( src ) == 0 ) { - // no more to parse + /* no more to parse */ return ( store = NULL ); } token_length = strcspn( src, seperators ); if ( src[ token_length ] == '\0' ) { - // parsed to end of string + /* parsed to end of string */ store = NULL; return src; } diff --git a/functions/string/strxfrm.c b/functions/string/strxfrm.c index 5b0fabb..a971e38 100644 --- a/functions/string/strxfrm.c +++ b/functions/string/strxfrm.c @@ -1,13 +1,13 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ #include <__size_t.h> -// TODO: Dummy function, no locale support yet. +/* TODO: Dummy function, no locale support yet. */ size_t strlen( const char * src ); char * strncpy( char * restrict dest, const char * restrict src, size_t n ); diff --git a/functions/time.c b/functions/time.c index 7da9c4b..54dcc01 100644 --- a/functions/time.c +++ b/functions/time.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ char * asctime( const struct tm * tptr ) { /* TODO */ }; clock_t clock( void ) { /* TODO */ }; @@ -536,4 +536,4 @@ static void strfmt(char *str, const char *fmt, ...) *str = '\0'; va_end(vp); } -*/ \ No newline at end of file +*/ diff --git a/functions/wctype.c b/functions/wctype.c index 9d50564..922cdd6 100644 --- a/functions/wctype.c +++ b/functions/wctype.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ int iswalnum( wint_t c ) { /* TODO */ }; int iswalpha( wint_t c ) { /* TODO */ }; diff --git a/includes/__NULL.h b/includes/__NULL.h deleted file mode 100644 index 7c8cc77..0000000 --- a/includes/__NULL.h +++ /dev/null @@ -1,16 +0,0 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Definition of NULL shared by locale.h, stddef.h, stdio.h, stdlib.h, -// string.h, wchar.h, and time.h -// ---------------------------------------------------------------------------- - -#ifndef __NULL_H -#define __NULL_H __NULL_H - -#define NULL 0 - -#endif // __NULL_H diff --git a/includes/__WCHAR.h b/includes/__WCHAR.h deleted file mode 100644 index cb1a181..0000000 --- a/includes/__WCHAR.h +++ /dev/null @@ -1,16 +0,0 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Definition of WCHAR_MIN and WCHAR_MAX, shared by stdint.h and wchar.h -// ---------------------------------------------------------------------------- - -#ifndef __WCHAR_H -#define __WCHAR_H __WCHAR_H - -#define WCHAR_MIN // TODO - personality? -#define WCHAR_MAX // TODO - personality? - -#endif // __WCHAR_H diff --git a/includes/__intern.h b/includes/__intern.h new file mode 100644 index 0000000..937b948 --- /dev/null +++ b/includes/__intern.h @@ -0,0 +1,45 @@ +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Internally used values (struct tm, _NULL, __size_t, __wchar_t, __wint_t, + * _WCHAR_MIN, _WCHAR_MAX). + * ---------------------------------------------------------------------------- + * Note that this file does not have a header guard. It is advised to check for + * _NULL defore including it. (The idea is to avoid redundant opening of this + * file during preprocessing.) + * --------------------------------------------------------------------------*/ + +/* This should work on any environment. */ +#define _NULL 0 + +#define _WCHAR_MAX /* TODO */ +#define _WCHAR_MIN /* TODO */ + +#define _WEOF /* TODO */ + +#define _EDOM /* TODO */ +#define _EILSEQ /* TODO */ +#define _ERANGE /* TODO */ + +#define _SIGABRT /* TODO */ +#define _SIGFPE /* TODO */ +#define _SIGILL /* TODO */ +#define _SIGINT /* TODO */ +#define _SIGSEGV /* TODO */ +#define _SIGTERM /* TODO */ +#define _SIG_DFL /* TODO */ +#define _SIG_ERR /* TODO */ +#define _SIG_IGN /* TODO */ + +typedef __size_t; /* TODO */ +typedef __wchar_t; /* TODO */ +typedef __wint_t; /* TODO */ +typedef __sig_atomic_t; /* TODO */ + +/* Including personality module so it can override generic settings, and set + * the values that cannot be set generically. + */ +#include "__personality.h" diff --git a/includes/__size_t.h b/includes/__size_t.h deleted file mode 100644 index 50d7d33..0000000 --- a/includes/__size_t.h +++ /dev/null @@ -1,16 +0,0 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// size_t typedef shared by stddef.h, stdio.h, stdlib.h, string.h, time.h, and -// wchar.h -// ---------------------------------------------------------------------------- - -#ifndef __SIZE_T_H -#define __SIZE_T_H __SIZE_T_H - -typedef size_t; // TODO - personality? - -#endif // __SIZE_T_H diff --git a/includes/__tm.h b/includes/__tm.h deleted file mode 100644 index 7b6aaaa..0000000 --- a/includes/__tm.h +++ /dev/null @@ -1,15 +0,0 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// struct tm definition shared by time.h and wchar.h -// ---------------------------------------------------------------------------- - -#ifndef __TM_H -#define __TM_H __TM_H - -struct tm; // TODO - personality? - -#endif // __TM_H diff --git a/includes/__wchar_t.h b/includes/__wchar_t.h deleted file mode 100644 index 029cb2e..0000000 --- a/includes/__wchar_t.h +++ /dev/null @@ -1,15 +0,0 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// wchar_t typedef shared by stddef.h, stdlib.h, and wchar.h -// ---------------------------------------------------------------------------- - -#ifndef __WCHAR_T_H -#define __WCHAR_T_H __WCHAR_T_H - -typedef wchar_t; // TODO - personality? - -#endif // __WCHAR_T_H diff --git a/includes/__wint_t.h b/includes/__wint_t.h deleted file mode 100644 index 38c8457..0000000 --- a/includes/__wint_t.h +++ /dev/null @@ -1,15 +0,0 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// wint_t typedef shared by wchar.h and wctype.h -// ---------------------------------------------------------------------------- - -#ifndef __WINT_T_H -#define __WINT_T_H __WINT_T_H - -typedef wint_t; // TODO - personality? - -#endif // __WINT_T_H diff --git a/includes/assert.h b/includes/assert.h index ebf4d8c..7bd6e41 100644 --- a/includes/assert.h +++ b/includes/assert.h @@ -1,28 +1,32 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Diagnostics -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Diagnostics + * --------------------------------------------------------------------------*/ -#ifndef __ASSERT_H -#define __ASSERT_H __ASSERT_H +#ifndef _ASSERT_H +#define _ASSERT_H _ASSERT_H -// ---------------------------------------------------------------------------- -// AUXILIARY +/* ---------------------------------------------------------------------------- + * AUXILIARY + * --------------------------------------------------------------------------*/ -// Helper function doing the print to stderr and call to abort(). -void __assert( char const * const expression, // the tested expression - char const * const file, // name of source file - char const * const function, // name of function - int const line ); // number of source file line +/* Helper function doing the print to stderr and call to abort(). */ +void __assert( char const * const expression, /* the tested expression */ + char const * const file, /* name of source file */ + char const * const function, /* name of function */ + int const line ); /* number of source file line */ -// ---------------------------------------------------------------------------- -// DEFINES +#endif /* _ASSERT_H - note that the header guard ends here on purpose. The + assert macro is redefined upon each inclusion, in + dependence of NDEBUG. */ -// TODO: Check the macro for if-compatibility. +/* ---------------------------------------------------------------------------- + * DEFINES + * --------------------------------------------------------------------------*/ #undef assert #if defined NDEBUG @@ -31,5 +35,3 @@ void __assert( char const * const expression, // the tested expression #define assert( x ) ( x ) ? ( (void) 0 ) \ : __assert( #x, __FILE__, __func__, __LINE__ ) #endif - -#endif // __ASSERT_H diff --git a/includes/complex.h b/includes/complex.h index 59fe73c..ea6d35d 100644 --- a/includes/complex.h +++ b/includes/complex.h @@ -1,19 +1,23 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Complex arithmetic -// ---------------------------------------------------------------------------- - -#ifndef __COMPLEX_H -#define __COMPLEX_H __COMPLEX_H - +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Complex arithmetic + * --------------------------------------------------------------------------*/ + +#ifndef _COMPLEX_H +#define _COMPLEX_H _COMPLEX_H + +#ifndef _PERSONALITY +#define _PERSONALITY _PERSONALITY #include "__personality.h" +#endif /* _PERSONALITY */ -// ---------------------------------------------------------------------------- -// DEFINES +/* ---------------------------------------------------------------------------- + * DEFINES + * --------------------------------------------------------------------------*/ #ifndef __cplusplus #define complex _Complex @@ -35,117 +39,118 @@ #define I _Complex_I #endif -// ---------------------------------------------------------------------------- -// FUNCTIONS +/* ---------------------------------------------------------------------------- + * FUNCTIONS + * --------------------------------------------------------------------------*/ -// These functions return the absolute value (magnitude) of their parameter. +/* These functions return the absolute value (magnitude) of their parameter. */ double cabs( double _Complex x ); float cabsf( float _Complex x ); long double cabsl( long double _Complex x ); -// These functions return the sine of their parameter. +/* These functions return the sine of their parameter. */ double _Complex csin( double _Complex x ); float _Complex csinf( float _Complex x ); long double _Complex csinl( long double _Complex x ); -// These functions return the hyperbolic sine of their parameter. +/* These functions return the hyperbolic sine of their parameter. */ double _Complex csinh( double _Complex x ); float _Complex csinhf( float _Complex x ); long double _Complex csinhl( long double _Complex x ); -// These functions return the arcsine of their parameter. +/* These functions return the arcsine of their parameter. */ double _Complex casin( double _Complex x ); float _Complex casinf( float _Complex x ); long double _Complex casinl( long double _Complex x ); -// These functions return the hyperbolic arcsine of their parameter. +/* These functions return the hyperbolic arcsine of their parameter. */ double _Complex casinh( double _Complex x ); float _Complex casinhf( float _Complex x ); long double _Complex casinhl( long double _Complex x ); -// These functions return the cosine of their parameter. +/* These functions return the cosine of their parameter. */ double _Complex ccos( double _Complex x ); float _Complex ccosf( float _Complex x ); long double _Complex ccosl( long double _Complex x ); -// These functions return the hyperbolic cosine of their parameter. +/* These functions return the hyperbolic cosine of their parameter. */ double _Complex ccosh( double _Complex x ); float _Complex ccoshf( float _Complex x ); long double _Complex ccoshl( long double _Complex x ); -// These functions return the arccosine of their parameter. +/* These functions return the arccosine of their parameter. */ double _Complex cacos( double _Complex x ); float _Complex cacosf( float _Complex x ); long double _Complex cacosl( long double _Complex x ); -// These functions return the hyperbolic arccosine of their parameter. +/* These functions return the hyperbolic arccosine of their parameter. */ double _Complex cacosh( double _Complex x ); float _Complex cacoshf( float _Complex x ); long double _Complex cacoshl( long double _Complex x ); -// These functions return the tangent of their parameter. +/* These functions return the tangent of their parameter. */ double _Complex ctan( double _Complex x ); float _Complex ctanf( float _Complex x ); long double _Complex ctanl( long double _Complex x ); -// These functions return the hyperbolic tangent of their parameter. +/* These functions return the hyperbolic tangent of their parameter. */ double _Complex ctanh( double _Complex x ); float _Complex ctanhf( float _Complex x ); long double _Complex ctanhl( long double _Complex x ); -// These functions return the arctangent of their parameter. +/* These functions return the arctangent of their parameter. */ double _Complex catan( double _Complex x ); float _Complex catanf( float _Complex x ); long double _Complex catanl( long double _Complex x ); -// These functions return the hyperbolic arctangent of their parameter. +/* These functions return the hyperbolic arctangent of their parameter. */ double _Complex catanh( double _Complex x ); float _Complex catanhf( float _Complex x ); long double _Complex catanhl( long double _Complex x ); -// These functions return the imaginary part of their parameter. +/* These functions return the imaginary part of their parameter. */ double cimag( double _Complex x ); float cimagf( float _Complex x ); long double cimagl( long double _Complex x ); -// These functions return the real part of their parameter. +/* These functions return the real part of their parameter. */ double creal( double _Complex x ); float crealf( float _Complex x ); long double creall( long double _Complex x ); -// These functions return x^y. +/* These functions return x^y. */ double _Complex cpow( double _Complex x, double _Complex y ); float _Complex cpowf( float _Complex x, float _Complex y ); long double _Complex cpowl( long double _Complex x, long double _Complex y ); -// These functions return the square root of their parameter. +/* These functions return the square root of their parameter. */ double _Complex csqrt( double _Complex x ); float _Complex csqrtf( float _Complex x ); long double _Complex csqrtl( long double _Complex x ); -// These functions return the exponential of their parameter. +/* These functions return the exponential of their parameter. */ double _Complex cexp( double _Complex x ); float _Complex cexpf( float _Complex x ); long double _Complex cexpl( long double _Complex x ); -// These functions return the logarithm of their parameter. +/* These functions return the logarithm of their parameter. */ double _Complex clog( double _Complex x ); float _Complex clogf( float _Complex x ); long double _Complex clogl( long double _Complex x ); -// These functions return the phase angle of their value. +/* These functions return the phase angle of their value. */ double carg( double _Complex x ); float cargf( float _Complex x ); long double cargl( long double _Complex x ); -// These functions return the conjugate of their parameter. +/* These functions return the conjugate of their parameter. */ double _Complex conj( double _Complex x ); float _Complex conjf( float _Complex x ); long double _Complex conjl( long double _Complex x ); -// These functions return the projection of their parameter. +/* These functions return the projection of their parameter. */ double _Complex cproj( double _Complex x ); float _Complex cprojf( float _Complex x ); long double _Complex cprojl( long double _Complex x ); -#endif // __COMPLEX_H +#endif /* _COMPLEX_H */ diff --git a/includes/ctype.h b/includes/ctype.h index 86ca13c..96f288c 100644 --- a/includes/ctype.h +++ b/includes/ctype.h @@ -1,59 +1,60 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Character handling -// ---------------------------------------------------------------------------- - -#ifndef __CTYPE_H -#define __CTYPE_H __CTYPE_H - -// ---------------------------------------------------------------------------- -// FUNCTIONS - -// returns nonzero if c is alphanumeric in the locale. +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Character handling + * --------------------------------------------------------------------------*/ + +#ifndef _CTYPE_H +#define _CTYPE_H _CTYPE_H + +/* ---------------------------------------------------------------------------- + * FUNCTIONS + * --------------------------------------------------------------------------*/ + +/* returns nonzero if c is alphanumeric in the locale. */ int isalnum( int c ); -// returns nonzero if c is alphabetic character in the locale. +/* returns nonzero if c is alphabetic character in the locale. */ int isalpha( int c ); -// returns nonzero if c is a horizontal blank in the locale. +/* returns nonzero if c is a horizontal blank in the locale. */ int isblank( int c ); -// returns nonzero if c is a control character in the locale. +/* returns nonzero if c is a control character in the locale. */ int iscntrl( int c ); -// returns nonzero if c is a digit in the locale. +/* returns nonzero if c is a digit in the locale. */ int isdigit( int c ); -// returns nonzero if c is alphanumeric or a punctuation in the locale. +/* returns nonzero if c is alphanumeric or a punctuation in the locale. */ int isgraph( int c ); -// returns nonzero if c is a lowercase alphabetic character in the locale. +/* returns nonzero if c is a lowercase alphabetic character in the locale. */ int islower( int c ); -// returns nonzero if c is a printable character ( isgraph() or isblank() ) in -// the locale. +/* returns nonzero if c is a printable character ( isgraph() or isblank() ) in + * the locale. */ int isprint( int c ); -// returns nonzero if c is a punctuation in the locale. +/* returns nonzero if c is a punctuation in the locale. */ int ispunct( int c ); -// returns nonzero if c is a whitespace in the locale. +/* returns nonzero if c is a whitespace in the locale. */ int isspace( int c ); -// returns nonzero if c is an uppercase alphabetical character in the locale. +/* returns nonzero if c is an uppercase alphabetical character in the locale. */ int isupper( int c ); -// returns nonzero if c is a hexedecimal digit in the locale. +/* returns nonzero if c is a hexedecimal digit in the locale. */ int isxdigit( int c ); -// returns lowercase equivalent for c in locale. +/* returns lowercase equivalent for c in locale. */ int tolower( int c ); -// returns uppercase equivalent for c in locale. +/* returns uppercase equivalent for c in locale. */ int toupper( int c ); -#endif // __CTYPE_H +#endif /* _CTYPE_H */ diff --git a/includes/errno.h b/includes/errno.h index e85d302..5bd397d 100644 --- a/includes/errno.h +++ b/includes/errno.h @@ -1,27 +1,34 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Errors -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Errors + * --------------------------------------------------------------------------*/ -#ifndef __ERRNO_H -#define __ERRNO_H __ERRNO_H +#ifndef _ERRNO_H +#define _ERRNO_H _ERRNO_H -// TODO: Documentation +#ifndef _PERSONALITY +#define _PERSONALITY _PERSONALITY +#include "__personality.h" +#endif /* _PERSONALITY */ -// ---------------------------------------------------------------------------- -// DECLARATIONS +/* TODO: Documentation */ + +/* ---------------------------------------------------------------------------- + * DECLARATIONS + * --------------------------------------------------------------------------*/ extern int errno; -// ---------------------------------------------------------------------------- -// DEFINES +/* ---------------------------------------------------------------------------- + * DEFINES + * --------------------------------------------------------------------------*/ -#define EDOM 1 // domain error -#define EILSEQ 2 // illegal (multibyte) sequence -#define ERANGE 3 // range error +#define EDOM _EDOM /* domain error */ +#define EILSEQ _EILSEQ /* illegal (multibyte) sequence */ +#define ERANGE _ERANGE /* range error */ -#endif // __ERRNO_H +#endif /* _ERRNO_H */ diff --git a/includes/fenv.h b/includes/fenv.h index b6c11a0..7a0d9f3 100644 --- a/includes/fenv.h +++ b/includes/fenv.h @@ -1,43 +1,45 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Floating-point environment -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Floating-point environment + * --------------------------------------------------------------------------*/ -#ifndef __FENV_H -#define __FENV_H __FENV_H +#ifndef _FENV_H +#define _FENV_H _FENV_H -// TODO: Documentation, checking for personality +/* TODO: Documentation */ -// ---------------------------------------------------------------------------- -// MACROS +/* ---------------------------------------------------------------------------- + * MACROS + * --------------------------------------------------------------------------*/ -// Used -#define FE_DIVBYZERO // TODO -#define FE_INEXACT // TODO -#define FE_INVALID // TODO -#define FE_OVERFLOW // TODO -#define FE_UNDERFLOW // TODO -#define FE_ALL_EXCEPT // TODO +#define FE_DIVBYZERO /* TODO - to __intern.h / __personality.h? */ +#define FE_INEXACT /* TODO - to __intern.h / __personality.h? */ +#define FE_INVALID /* TODO - to __intern.h / __personality.h? */ +#define FE_OVERFLOW /* TODO - to __intern.h / __personality.h? */ +#define FE_UNDERFLOW /* TODO - to __intern.h / __personality.h? */ +#define FE_ALL_EXCEPT /* TODO - to __intern.h / __personality.h? */ -#define FE_DOWNWARD // TODO -#define FE_TONEAREST // TODO -#define FE_TOWARDZERO // TODO -#define FE_UPWARD // TODO +#define FE_DOWNWARD /* TODO - to __intern.h / __personality.h? */ +#define FE_TONEAREST /* TODO - to __intern.h / __personality.h? */ +#define FE_TOWARDZERO /* TODO - to __intern.h / __personality.h? */ +#define FE_UPWARD /* TODO - to __intern.h / __personality.h? */ -#define FE_DFL_ENV // TODO +#define FE_DFL_ENV /* TODO - to __intern.h / __personality.h? */ -// ---------------------------------------------------------------------------- -// TYPEDEFS +/* ---------------------------------------------------------------------------- + * TYPEDEFS + * --------------------------------------------------------------------------*/ -typedef fenv_t; // TODO -typedef fexcept_t; // TODO +typedef fenv_t; /* TODO - to __intern.h / __personality.h? */ +typedef fexcept_t; /* TODO - to __intern.h / __personality.h? */ -// ---------------------------------------------------------------------------- -// FUNCTIONS +/* ---------------------------------------------------------------------------- + * FUNCTIONS + * --------------------------------------------------------------------------*/ int feclearexcept( int exceptions ); int fegetexceptflag( fexcept_t * flags, int exceptions ); @@ -53,4 +55,4 @@ int feholdexcept( fenv_t * environment ); int fesetenv( const fenv_t * environment ); int feupdateenv( const fenv_t * environment ); -#endif // __FENV_H +#endif /* _FENV_H */ diff --git a/includes/float.h b/includes/float.h new file mode 100644 index 0000000..d9696ac --- /dev/null +++ b/includes/float.h @@ -0,0 +1,28 @@ +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Characteristics of floating types + * ---------------------------------------------------------------------------- + * This header is part of a freestanding implementation + * --------------------------------------------------------------------------*/ + +#ifndef _FLOAT_H +#define _FLOAT_H _FLOAT_H + +/* This file is part of the platform personality, and is commonly generated + using the enquire utility (included). */ + +/* Defines: + * FLT_RADIX, FLT_ROUNDS, FLT_EVAL_METHOD, DECIMAL_DIG, + * DBL_DIG, DBL_EPSILON, DBL_MANT_DIG, DBL_MAX, DBL_MAX_10_EXP, DBL_MAX_EXP, + * DBL_MIN, DBL_MIN_10_EXP, DBL_MIN_EXP, + * FLT_DIG, FLT_EPSILON, FLT_MANT_DIG, FLT_MAX, FLT_MAX_10_EXP, FLT_MAX_EXP, + * FLT_MIN, FLT_MIN_10_EXP, FLT_MIN_EXP, + * LDBL_DIG, LDBL_EPSILON, LDBL_MANT_DIG, LDBL_MAX, LDBL_MAX_10_EXP, + * LDBL_MAX_EXP, LDBL_MIN, LDBL_MIN_10_EXP, LDBL_MIN_EXP + */ + +#endif /* _FLOAT_H */ diff --git a/includes/inttypes.h b/includes/inttypes.h index cc81b98..944793a 100644 --- a/includes/inttypes.h +++ b/includes/inttypes.h @@ -1,19 +1,20 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Format conversion of integer types -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Format conversion of integer types + * --------------------------------------------------------------------------*/ -#ifndef __INTTYPES_H -#define __INTTYPES_H __INTTYPES_H +#ifndef _INTTYPES_H +#define _INTTYPES_H _INTTYPES_H -// TODO: Documentation +/* TODO: Documentation */ -// ---------------------------------------------------------------------------- -// TYPEDEFS +/* ---------------------------------------------------------------------------- + * TYPEDEFS + * --------------------------------------------------------------------------*/ typedef struct { @@ -22,8 +23,9 @@ typedef struct } imaxdiv_t; -// ---------------------------------------------------------------------------- -// FUNCTIONS +/* ---------------------------------------------------------------------------- + * FUNCTIONS + * --------------------------------------------------------------------------*/ intmax_t imaxabs( intmax_t i ); imaxdiv_t imaxdiv( intmax_t numer, intmax_t denom ); @@ -33,8 +35,9 @@ uintmax_t strtoumax( const char * restrict s, char * * restrict endptr, int base intmax_t wcstoimax( const wchar_t * restrict s, wchar_t * * restrict endptr, int base ); uintmax_t wcstoumax( const wchar_t * restrict s, wchar_t * * restrict endptr, int base ); -// ---------------------------------------------------------------------------- -// MACROS (PRINT) +/* ---------------------------------------------------------------------------- + * MACROS (PRINT) + * --------------------------------------------------------------------------*/ #define PRId8 #define PRId16 @@ -144,8 +147,9 @@ uintmax_t wcstoumax( const wchar_t * restrict s, wchar_t * * restrict endptr, in #define PRIXMAX #define PRIXPTR -// ---------------------------------------------------------------------------- -// MACROS (SCAN) +/* ---------------------------------------------------------------------------- + * MACROS (SCAN) + * --------------------------------------------------------------------------*/ #define SCNd8 #define SCNd16 @@ -255,4 +259,4 @@ uintmax_t wcstoumax( const wchar_t * restrict s, wchar_t * * restrict endptr, in #define SCNXMAX #define SCNXPTR -#endif // __INTTYPES_H +#endif /* _INTTYPES_H */ diff --git a/includes/iso646.h b/includes/iso646.h index 632dcef..61d84ed 100644 --- a/includes/iso646.h +++ b/includes/iso646.h @@ -1,17 +1,20 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Alternative spellings -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Alternative spellings + * ---------------------------------------------------------------------------- + * This header is part of a freestanding implementation + * --------------------------------------------------------------------------*/ -#ifndef __ISO646_H -#define __ISO646_H __ISO646_H +#ifndef _ISO646_H +#define _ISO646_H _ISO646_H -// ---------------------------------------------------------------------------- -// DEFINES +/* ---------------------------------------------------------------------------- + * DEFINES + * --------------------------------------------------------------------------*/ #define and && #define and_eq &= @@ -25,4 +28,4 @@ #define xor ^ #define xor_eq ^= -#endif // __ISO646_H +#endif /* _ISO646_H */ diff --git a/includes/limits.h b/includes/limits.h new file mode 100644 index 0000000..0d35495 --- /dev/null +++ b/includes/limits.h @@ -0,0 +1,59 @@ +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Sizes of integer types + * ---------------------------------------------------------------------------- + * This header is part of a freestanding implementation + * --------------------------------------------------------------------------*/ + +#ifndef _LIMITS_H +#define _LIMITS_H _LIMITS_H + +/* ISO/IEC 9899:1999, ยง5.2.4.2.1 + * The values given below shall be replaced by constant expressions suitable + * for use in #if preprocessing directives. Moreover, except for CHAR_BIT and + * MB_LEN_MAX, the following shall be replaced by expressions that have the + * same type as would an expression that is an object of the corresponding type + * converted according to the integer promotions. Their implementation-defined + * values shall be equal or greater in magnitude (absolute value) to those + * shown, with the same sign. + */ + +/* This file is part of the platform personality, and is commonly generated + using the enquire utility (included). */ + +/* Limits of type 'char' */ +#define CHAR_BIT /* 8 */ +#define CHAR_MAX /* SCHAR_MAX / UCHAR_MAX */ +#define CHAR_MIN /* SCHAR_MIN / 0 */ +#define SCHAR_MAX /* +127 */ +#define SCHAR_MIN /* -127 */ +#define UCHAR_MAX /* 255 (2^CHAR_BIT - 1) */ + +/* Multibyte characters */ +#define MB_LEN_MAX /* 1 */ + +/* Limits of type 'short int' */ +#define SHRT_MAX /* +32767 */ +#define SHRT_MIN /* -32767 */ +#define USHRT_MAX /* 65535 */ + +/* Limits of type 'int' */ +#define INT_MAX /* +32767 */ +#define INT_MIN /* -32767 */ +#define UINT_MAX /* 65535 */ + +/* Limits of type 'long int' */ +#define LONG_MAX /* +2147483647 */ +#define LONG_MIN /* -2147483647 */ +#define ULONG_MAX /* 4294967295 */ + +/* Limits of type 'long long int' */ +#define LLONG_MAX /* +9223372036854775807 */ +#define LLONG_MIN /* -9223372036854775807 */ +#define ULLONG_MAX /* 18446744073709551615 */ + +#endif /* _LIMITS_H */ diff --git a/includes/locale.h b/includes/locale.h index 566fa5d..f9dd659 100644 --- a/includes/locale.h +++ b/includes/locale.h @@ -1,84 +1,93 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Localization -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Localization + * --------------------------------------------------------------------------*/ -#ifndef __LOCALE_H -#define __LOCALE_H __LOCALE_H +#ifndef _LOCALE_H +#define _LOCALE_H _LOCALE_H -// ---------------------------------------------------------------------------- -// DEFINES +#ifndef _NULL +#include "__intern.h" +#endif /* _NULL */ -#include "__NULL.h" +/* ---------------------------------------------------------------------------- + * DEFINES + * --------------------------------------------------------------------------*/ -// Locale categories -#define LC_COLLATE 1 // affects strcoll() and strxfrm() -#define LC_CTYPE 2 // affects ctype.h -#define LC_MONETARY 4 // affects monetary aspect of localeconv() -#define LC_NUMERIC 8 // affects numeric aspect of localeconv() -#define LC_TIME 16 // affects strftime() -#define LC_ALL 31 // affects all of the above +#define NULL _NULL -// ---------------------------------------------------------------------------- -// TYPEDEFS +/* Locale categories */ +#define LC_COLLATE 1 /* affects strcoll() and strxfrm() */ +#define LC_CTYPE 2 /* affects ctype.h */ +#define LC_MONETARY 4 /* affects monetary aspect of localeconv() */ +#define LC_NUMERIC 8 /* affects numeric aspect of localeconv() */ +#define LC_TIME 16 /* affects strftime() */ +#define LC_ALL 31 /* affects all of the above */ -// TODO: Detailed documentation of grouping formats and field values +/* ---------------------------------------------------------------------------- + * TYPEDEFS + * --------------------------------------------------------------------------*/ + +/* TODO: Detailed documentation of grouping formats and field values */ struct lconv { - // LC_NUMERIC - char * decimal_point; // decimal point - char * grouping; // grouping - char * thousands_sep; // grouping string + /* LC_NUMERIC */ + char * decimal_point; /* decimal point */ + char * grouping; /* grouping */ + char * thousands_sep; /* grouping string */ - // LC_MONETARY - char * mon_decimal_point; // decimal point - char * mon_grouping; // grouping - char * mon_thousands_sep; // grouping string - char * negative_sign; // negative sign - char * positive_sign; // positive sign - char * currency_symbol; // currency symbol - char frac_digits; // after-point digits - // negative values - char n_cs_precedes; // currency symbol preceding value? - char n_sep_by_space; // currency symbol seperated by space? - char n_sign_posn; // sign position - // positive values - char p_cs_precedes; // currency symbol preceding value? - char p_sep_by_space; // currency symbol seperated by space? - char p_sign_posn; // sign position? + /* LC_MONETARY */ + char * mon_decimal_point; /* decimal point */ + char * mon_grouping; /* grouping */ + char * mon_thousands_sep; /* grouping string */ + char * negative_sign; /* negative sign */ + char * positive_sign; /* positive sign */ + char * currency_symbol; /* currency symbol */ + char frac_digits; /* after-point digits */ + /* negative values */ + char n_cs_precedes; /* currency symbol preceding value? */ + char n_sep_by_space; /* currency symbol seperated by space? */ + char n_sign_posn; /* sign position */ + /* positive values */ + char p_cs_precedes; /* currency symbol preceding value? */ + char p_sep_by_space; /* currency symbol seperated by space? */ + char p_sign_posn; /* sign position? */ - // for international monetary values - char * int_curr_symbol; // international currency symbol (ISO 4217) - char int_frac_digits; // after-point digits - // negative values - char int_n_cs_precedes; // currency symbol preceding value? - char int_n_sep_by_space; // currency symbol seperated by space? - char int_n_sign_posn; // sign position? - // positive values - char int_p_cs_precedes; // currency symbol preceding value? - char int_p_sep_by_space; // currency symbol seperated by space? - char int_p_sign_posn; // sign position? + /* for international monetary values */ + char * int_curr_symbol; /* international currency symbol (ISO 4217) */ + char int_frac_digits; /* after-point digits */ + /* negative values */ + char int_n_cs_precedes; /* currency symbol preceding value? */ + char int_n_sep_by_space; /* currency symbol seperated by space? */ + char int_n_sign_posn; /* sign position? */ + /* positive values */ + char int_p_cs_precedes; /* currency symbol preceding value? */ + char int_p_sep_by_space; /* currency symbol seperated by space? */ + char int_p_sign_posn; /* sign position? */ }; -// ---------------------------------------------------------------------------- -// FUNCTIONS +/* ---------------------------------------------------------------------------- + * FUNCTIONS + * --------------------------------------------------------------------------*/ -// Returns a (pointer to a) lconv structure holding the values for the current -// locale. The structure must not be changed; values might become outdated with -// later calls to setlocale() changing LC_NUMERIC, LC_MONETARY or LC_ALL. +/** Returns a (pointer to a) lconv structure holding the values for the current + * locale. The structure must not be changed; values might become outdated with + * later calls to setlocale() changing LC_NUMERIC, LC_MONETARY or LC_ALL. + */ struct lconv * localeconv( void ); -// Categories are selected by OR'ing the LC_* defines from this header. The -// function sets the current locale to that defined by locale_name, and returns -// the name of the new locale (if it was set successfully) or a null pointer -// (if unsuccessful). At startup, the current locale is "C" by default. A null -// pointer as locale_name leaves the locale unchanged, an empty string sets it -// to the "native" locale. +/** Categories are selected by OR'ing the LC_* defines from this header. The + * function sets the current locale to that defined by locale_name, and returns + * the name of the new locale (if it was set successfully) or a null pointer + * (if unsuccessful). At startup, the current locale is "C" by default. A null + * pointer as locale_name leaves the locale unchanged, an empty string sets it + * to the "native" locale. + */ char * setlocale( int categories, const char * locale_name ); -#endif // __LOCALE_H +#endif /* _LOCALE_H */ diff --git a/includes/math.h b/includes/math.h index ef80c92..9070284 100644 --- a/includes/math.h +++ b/includes/math.h @@ -1,271 +1,1239 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Mathematics -// ---------------------------------------------------------------------------- - -#ifndef __MATH_H -#define __MATH_H __MATH_H - -// TODO: Documentation - -// ---------------------------------------------------------------------------- -// DEFINES - -#define HUGE_VAL // TODO - personality? -#define HUGE_VALF // TODO - personality? -#define HUGE_VALL // TODO - personality? - -#define INFINITY // TODO - personality? -#define NAN // TODO - personality? - -#define FP_FAST_FMA // TODO - personality? -#define FP_FAST_FMAF // TODO - personality? -#define FP_FAST_FMAL // TODO - personality? - -#define FP_INFINITE // TODO - personality? -#define FP_NAN // TODO - personality? -#define FP_NORMAL // TODO - personality? -#define FP_SUBNORMAL // TODO - personality? -#define FP_ZERO // TODO - personality? - -#define FP_ILOGB0 // TODO - personality? -#define FP_ILOGBNAN // TODO - personality? - -#define MATH_ERRNO 1 // personality? -#define MATH_ERREXCEPT 2 // personality? -#define math_errhandling // TODO - personality? - -// -------------------------------------------------------------------------- -// TYPEDEFS - -typedef double_t; // TODO - personality? -typedef float_t; // TODO - personality? - -// -------------------------------------------------------------------------- -// MACROS - -#define isgreater( x, y ) // TODO -#define isgreaterequal( x, y ) // TODO -#define isless( x, y ) // TODO -#define islessequal( x, y ) // TODO -#define islessgreater( x, y ) // TODO -#define isunordered( x, y ) // TODO -#define fpclassify( x ) // TODO -#define isfinite( x ) // TODO - -#define isinf( x ) // TODO -#define isnan( x ) // TODO -#define isnormal( x ) // TODO -#define signbit( x ) // TODO - -// ---------------------------------------------------------------------------- -// FUNCTIONS - -// These functions return the magnitude of their parameter. +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Mathematics + * --------------------------------------------------------------------------*/ + +#ifndef _MATH_H +#define _MATH_H _MATH_H + +/* TODO: Documentation */ + +/* ---------------------------------------------------------------------------- + * DEFINES + * --------------------------------------------------------------------------*/ + +#define HUGE_VAL ((double)0x7FF0000000000000) /* TODO */ +#define HUGE_VALF ((float)0x7F800000) /* TODO */ +#define HUGE_VALL ((long double)0x7FFF8000000000000000) /* TODO */ + +#define INFINITY ((float)0x7F800000) /* TODO */ +#define NAN ((float)0x7F800001) /* TODO */ + +/* The following values are platform dependant, must be personality. */ +#if 0 +#define FP_FAST_FMA /* TODO */ +#define FP_FAST_FMAF /* TODO */ +#define FP_FAST_FMAL /* TODO */ +#endif + +/* These values are used instead of constants to classify numbers. */ +#define FP_UNDEFINED 0 +#define FP_INFINITE 1 +#define FP_NAN 2 +#define FP_NORMAL 3 +#define FP_SUBNORMAL 4 +#define FP_ZERO 5 + +#define FP_ILOGB0 /* TODO */ +#define FP_ILOGBNAN /* TODO */ + +#define MATH_ERRNO 1 +#define MATH_ERREXCEPT 2 + +/* should be MATH_ERRNO | MATH_ERREXCEPT if we do exceptions. Do we? It's + * nice if this is implementation-wide the same. + */ +#define math_errhandling ((int)MATH_ERRNO) + +/* ---------------------------------------------------------------------------- + * TYPEDEFS + * --------------------------------------------------------------------------*/ + +typedef double_t +#if FLT_EVAL_METHOD == 0 + double +#elif FLT_EVAL_METHOD == 1 + double +#elif FLT_EVAL_METHOD == 2 + long double +#else + /* TODO - this is implementation defined and cpu dependant */ +#endif +; + +typedef float_t +#if FLT_EVAL_METHOD == 0 + float +#elif FLT_EVAL_METHOD == 1 + double +#elif FLT_EVAL_METHOD == 2 + long double +#else + /* TODO - this is implementation defined and cpu dependant */ +#endif +; + +/* ---------------------------------------------------------------------------- + * MACROS + * --------------------------------------------------------------------------*/ + +#define isgreater( x, y ) /* TODO */ +#define isgreaterequal( x, y ) /* TODO */ +#define isless( x, y ) /* TODO */ +#define islessequal( x, y ) /* TODO */ +#define islessgreater( x, y ) /* TODO */ +#define isunordered( x, y ) /* TODO */ + +/* Could somebody clean this macro up? It uses 7 other definitions (below). + * Also, I suspect this macro to be personality-dependant. Somebody confirm + * or deny? + */ +#define fp_mef 0x7F800000 +#define fp_mff 0x007FFFFF +#define fp_med 0x7FF0000000000000 +#define fp_mfd 0x000FFFFFFFFFFFFF +#define fp_mel 0x7FFF8000000000000000 +#define fp_mjl 0x00004000000000000000 // the j-bit mask +#define fp_mfl 0x00003FFFFFFFFFFFFFFF + +#define fpclassify( x ) ((sizeof(x) == sizeof(float)) ? ( \ + (((x) & fp_mef) == (fp_mef)) ? ( \ + (((x) & fp_mff) == (0)) ? ( \ + FP_INFINITY \ + ) : ( \ + FP_NAN \ + ) \ + ) : ( \ + (((x) & fp_mef) == (0)) ? ( \ + (((x) & fp_mff) == (0)) ? ( \ + FP_ZERO \ + ) : ( \ + FP_DENORMAL \ + ) \ + ) : ( \ + FP_NORMAL \ + ) \ + ) \ + ) : ( + (sizeof(x) == sizeof(double)) ? ( \ + (((x) & fp_med) == (fp_med)) ? ( \ + (((x) & fp_mfd) == (0)) ? ( \ + FP_INFINITY \ + ) : ( \ + FP_NAN \ + ) \ + ) : ( \ + (((x) & fp_med) == (0)) ? ( \ + (((x) & fp_mfd) == (0)) ? ( \ + FP_ZERO \ + ) : ( \ + FP_DENORMAL \ + ) \ + ) : ( \ + FP_NORMAL \ + ) \ + ) \ + ) : ( \ + (((x) & fp_mel) == (fp_mel)) ? ( \ + (((x) & fp_mjl) == (fp_mjl)) ? ( \ + FP_UNSUPPORTED \ + ) : ( \ + (((x) & fp_mfl) == (fp_mfl)) ? ( \ + FP_NAN \ + ) : ( \ + FP_INFINITY \ + ) \ + ) \ + ) : ( \ + (((x) & fp_mel) == (0)) ? ( \ + (((x) & fp_mjl) == (fp_mjl)) ? ( \ + FP_NORMAL \ // or actually, pseudo-denormal + ) : ( \ + (((x) & fp_mfl) == (fp_mfl)) ? ( \ + FP_DENORMAL \ + ) : ( \ + FP_ZERO \ + ) \ + ) \ + ) : ( \ + (((x) & fp_mjl) == (fp_mjl)) ? ( \ + FP_NORMAL \ + ) : ( \ + FP_UNDEFINED \ + ) \ + ) \ + ) \ + ) \ + ) \ + ) + +#define isfinite( x ) ((sizeof(x) == sizeof(float)) ? ( \ + (((x) & fp_mef) == (fp_mef)) ? ( \ + 0 \ + ) : ( \ + 1 \ + ) \ + ) : ( + (sizeof(x) == sizeof(double)) ? ( \ + (((x) & fp_med) == (fp_med)) ? ( \ + 0 \ + ) : ( \ + 1 \ + ) \ + ) : ( \ + (((x) & fp_mel) == (fp_mel)) ? ( \ + 0 \ + ) : ( \ + (((x) & fp_mel) == (0)) ? ( \ + (((x) & fp_mjl) == (fp_mjl)) ? ( \ + 1 \ + ) : ( \ + 0 \ + ) \ + ) : ( \ + (((x) & fp_mjl) == (fp_mjl)) ? ( \ + 1 \ + ) : ( \ + 0 \ + ) \ + ) \ + ) \ + ) \ + ) \ + ) + +#define isinf( x ) ((sizeof(x) == sizeof(float)) ? ( \ + (((x) & fp_mef) == (fp_mef)) ? ( \ + (((x) & fp_mff) == (0)) ? ( \ + 1 \ + ) : ( \ + 0 \ + ) \ + ) : ( \ + 0 \ + ) \ + ) : ((sizeof(x) == sizeof(double)) ? ( \ + (((x) & fp_med) == (fp_med)) ? ( \ + (((x) & fp_mfd) == (0)) ? ( \ + 1 \ + ) : ( \ + 0 \ + ) \ + ) : ( \ + 0 \ + ) \ + ) : ( \ + (((x) & fp_mel) == (fp_mel)) ? ( \ + (((x) & fp_mjl) == (0)) ? ( \ + (((x) & fp_mfl) == (fp_mfl)) ? ( \ + 0 \ + ) : ( \ + 1 \ + ) \ + ) : ( \ + 0 \ + ) \ + ) : ( \ + 0 \ + ) \ + ) \ + ) \ + ) + +#define isnan( x ) ((sizeof(x) == sizeof(float)) ? ( \ + (((x) & fp_mef) == (fp_mef)) ? ( \ + (((x) & fp_mff) == (0)) ? ( \ + 0 \ + ) : ( \ + 1 \ + ) \ + ) : ( \ + 0 \ + ) \ + ) : ((sizeof(x) == sizeof(double)) ? ( \ + (((x) & fp_med) == (fp_med)) ? ( \ + (((x) & fp_mfd) == (0)) ? ( \ + 0 \ + ) : ( \ + 1 \ + ) \ + ) : ( \ + 0 \ + ) \ + ) : ( \ + (((x) & fp_mel) == (fp_mel)) ? ( \ + (((x) & fp_mjl) == (0)) ? ( \ + (((x) & fp_mfl) == (fp_mfl)) ? ( \ + 1 \ + ) : ( \ + 0 \ + ) \ + ) : ( \ + 0 \ + ) \ + ) : ( \ + 0 \ + ) \ + ) \ + ) \ + ) + +#define isnormal( x ) ((sizeof(x) == sizeof(float)) ? ( \ + (((x) & fp_mef) == (fp_mef)) ? ( \ + 0 \ + ) : ( \ + (((x) & fp_mef) == (0)) ? ( \ + 0 \ + ) : ( \ + 1 \ + ) \ + ) \ + ) : ((sizeof(x) == sizeof(double)) ? ( \ + (((x) & fp_med) == (fp_med)) ? ( \ + 0 \ + ) : ( \ + (((x) & fp_med) == (0)) ? ( \ + 0 \ + ) : ( \ + 1 \ + ) \ + ) \ + ) : ( \ + (((x) & fp_mel) == (fp_mel)) ? ( \ + 0 \ + ) : ( \ + (((x) & fp_mel) == (0)) ? ( \ + (((x) & fp_mjl) == (fp_mjl)) ? ( \ + 1 \ + ) : ( \ + 0 \ + ) \ + ) : ( \ + (((x) & fp_mjl) == (fp_mjl)) ? ( \ + 1 \ + ) : ( \ + 0 \ + ) \ + ) \ + ) \ + ) \ + ) \ + ) + +#define signbit( x ) ((sizeof(x) == sizeof(float)) ? ( \ + (((x) & 0x80000000) == (0)) ? ( \ + 0 \ + ) : ( \ + 1 \ + ) \ + ) : ((sizeof(x) == sizeof(double)) ? ( \ + (((x) & 0x8000000000000000) == (0)) ? ( \ + 0 \ + ) : ( \ + 1 \ + ) \ + ) : ( \ + (((x) & 0x80000000000000000000) == (0)) ? ( \ + 0 \ + ) : ( \ + 1 \ + ) \ + ) \ + ) \ + ) + +/* ---------------------------------------------------------------------------- + * FUNCTIONS + * --------------------------------------------------------------------------*/ + +/** These functions return the magnitude of x. + * @param x The value to find the absolute value of. + * @return The absolute value of x. + * @see fabsl() + * @see fabsf() + */ double fabs( double x ); + +/** These functions return the magnitude of x. + * @param x The value to find the absolute value of. + * @return The absolute value of x. + * @see fabsl() + * @see fabs() + */ float fabsf( float x ); + +/** These functions return the magnitude of x. + * @param x The value to find the absolute value of. + * @return The absolute value of x. + * @see fabs() + * @see fabsf() + */ long double fabsl( long double x ); -// These functions compute the sine of x (measured in radians). +/** These functions compute the sine of x (measured in radians). + * @param x The value to compute the sine of. + * @return The sine of x. + * @see sinf() + * @see sinl() + * @see cos() + * @see tan() + * @see sinh() + * @see asin() + */ double sin( double x ); + +/** These functions compute the sine of x (measured in radians). + * @param x The value to compute the sine of. + * @return The sine of x. + * @see sin() + * @see sinl() + * @see cosf() + * @see tanf() + * @see sinhf() + * @see asinf() + */ float sinf( float x ); + +/** These functions compute the sine of x (measured in radians). + * @param x The value to compute the sine of. + * @return The sine of x. + * @see sinf() + * @see sin() + * @see cosl() + * @see tanl() + * @see sinhl() + * @see asinl() + */ long double sinl( long double x ); -// These functions return the hyperbolic cosine of their parameter. +/** These functions compute the hyperbolic sine of x (measured in radians). + * @param x The value to compute the hyperbolic sine of. + * @return The hyperbolic sine of x. + * @see sinhf() + * @see sinhl() + * @see sin() + * @see cosh() + * @see tanh() + * @see asinh() + */ double sinh( double x ); + +/** These functions compute the hyperbolic sine of x (measured in radians). + * @param x The value to compute the hyperbolic sine of. + * @return The hyperbolic sine of x. + * @see sinh() + * @see sinhl() + * @see sinf() + * @see coshf() + * @see tanhf() + * @see asinhf() + */ float sinhf( float x ); + +/** These functions compute the hyperbolic sine of x (measured in radians). + * @param x The value to compute the hyperbolic sine of. + * @return The hyperbolic sine of x. + * @see sinh() + * @see sinhf() + * @see sinl() + * @see coshl() + * @see tanhl() + * @see asinhl() + */ long double sinhl( long double x ); -// These functions return the arcsine of their parameter. +/** These functions compute the arcsine of x (measured in radians). + * @param x The value to compute the arcsine of. + * @return The arcsine of x. + * @see asinf() + * @see asinl() + * @see sin() + * @see acos() + * @see atan() + * @see asinh() + */ double asin( double x ); + +/** These functions compute the arcsine of x (measured in radians). + * @param x The value to compute the arcsine of. + * @return The arcsine of x. + * @see asin() + * @see asinl() + * @see sinf() + * @see acosf() + * @see atanf() + * @see asinhf() + */ float asinf( float x ); + +/** These functions compute the arcsine of x (measured in radians). + * @param x The value to compute the arcsine of. + * @return The arcsine of x. + * @see asin() + * @see asinf() + * @see sinl() + * @see acosl() + * @see atanl() + * @see asinhl() + */ long double asinl( long double x ); -// These functions return the hyperbolic arcsine of their parameter. +/** These functions compute the hyperbolic arcsine of x (measured in radians). + * @param x The value to compute the hyperbolic arcsine of. + * @return The hyperbolic arcsine of x. + * @see asinhf() + * @see asinhl() + * @see asin() + * @see acosh() + * @see atanh() + * @see sinh() + */ double asinh( double x ); + +/** These functions compute the hyperbolic arcsine of x (measured in radians). + * @param x The value to compute the hyperbolic arcsine of. + * @return The hyperbolic arcsine of x. + * @see asinh() + * @see asinhl() + * @see asinf() + * @see acoshf() + * @see atanhf() + * @see sinhf() + */ float asinhf( float x ); + +/** These functions compute the hyperbolic arcsine of x (measured in radians). + * @param x The value to compute the hyperbolic arcsine of. + * @return The hyperbolic arcsine of x. + * @see asinh() + * @see asinhf() + * @see asinl() + * @see acoshl() + * @see atanhl() + * @see sinhl() + */ long double asinhl( long double x ); -// These functions compute the cosine of x (measured in radians). +/** These functions compute the cosine of x (measured in radians). + * @param x The value to compute the cosine of. + * @return The cosine of x. + * @see cosf() + * @see cosl() + * @see sin() + * @see cosh() + * @see tan() + * @see acos() + */ double cos( double x ); + +/** These functions compute the cosine of x (measured in radians). + * @param x The value to compute the cosine of. + * @return The cosine of x. + * @see cos() + * @see cosl() + * @see sinf() + * @see coshf() + * @see tanf() + * @see acosf() + */ float cosf( float x ); + +/** These functions compute the cosine of x (measured in radians). + * @param x The value to compute the cosine of. + * @return The cosine of x. + * @see cos() + * @see cosf() + * @see sinl() + * @see coshl() + * @see tanl() + * @see acosl() + */ long double cosl( long double x ); -// These functions return the hyperbolic cosine of their parameter. +/** These functions compute the hyperbolic cosine of x (measured in radians). + * @param x The value to compute the hyperbolic cosine of. + * @return The hyperbolic cosine of x. + * @see coshf() + * @see coshl() + * @see sinh() + * @see cos() + * @see tanh() + * @see acosh() + */ double cosh( double x ); + +/** These functions compute the hyperbolic cosine of x (measured in radians). + * @param x The value to compute the hyperbolic cosine of. + * @return The hyperbolic cosine of x. + * @see cosh() + * @see coshl() + * @see sinhf() + * @see cosf() + * @see tanhf() + * @see acoshf() + */ float coshf( float x ); + +/** These functions compute the hyperbolic cosine of x (measured in radians). + * @param x The value to compute the hyperbolic cosine of. + * @return The hyperbolic cosine of x. + * @see cosh() + * @see coshf() + * @see sinhl() + * @see cosl() + * @see tanhl() + * @see acoshl() + */ long double coshl( long double x ); -// These functions return the arccosine of their parameter. +/** These functions compute the arccosine of x (measured in radians). + * @param x The value to compute the arccosine of. + * @return The arccosine of x. + * @see acosf() + * @see acosl() + * @see asin() + * @see cos() + * @see atan() + * @see acosh() + */ double acos( double x ); + +/** These functions compute the arccosine of x (measured in radians). + * @param x The value to compute the arccosine of. + * @return The arccosine of x. + * @see acos() + * @see acosl() + * @see asinf() + * @see cosf() + * @see atanf() + * @see acoshf() + */ float acosf( float x ); + +/** These functions compute the arccosine of x (measured in radians). + * @param x The value to compute the arccosine of. + * @return The arccosine of x. + * @see acos() + * @see acosf() + * @see asinl() + * @see cosl() + * @see atanl() + * @see acoshl() + */ long double acosl( long double x ); -// These functions return the hyperbolic arccosine of their parameter. +/** These functions compute the hyperbolic arccosine of x (measured in radians). + * @param x The value to compute the hyperbolic arccosine of. + * @return The hyperbolic arccosine of x. + * @see acoshf() + * @see acoshl() + * @see asinh() + * @see cosh() + * @see atanh() + * @see acos() + */ double acosh( double x ); + +/** These functions compute the hyperbolic arccosine of x (measured in radians). + * @param x The value to compute the hyperbolic arccosine of. + * @return The hyperbolic arccosine of x. + * @see acosh() + * @see acoshl() + * @see asinhf() + * @see coshf() + * @see atanhf() + * @see acosf() + */ float acoshf( float x ); + +/** These functions compute the hyperbolic arccosine of x (measured in radians). + * @param x The value to compute the hyperbolic arccosine of. + * @return The hyperbolic arccosine of x. + * @see acosh() + * @see acoshf() + * @see asinhl() + * @see coshl() + * @see atanhl() + * @see acosl() + */ long double acoshl( long double x ); -// These functions return the tangent of x. +/** These functions compute the tangent of x (measured in radians). + * @param x The value to compute the tangent of. + * @return The tangent of x. + * @see tanf() + * @see tanl() + * @see sin() + * @see cos() + * @see tanh() + * @see atan() + */ double tan( double x ); + +/** These functions compute the tangent of x (measured in radians). + * @param x The value to compute the tangent of. + * @return The tangent of x. + * @see tan() + * @see tanl() + * @see sinf() + * @see cosf() + * @see tanhf() + * @see atanf() + */ float tanf( float x ); + +/** These functions compute the tangent of x (measured in radians). + * @param x The value to compute the tangent of. + * @return The tangent of x. + * @see tan() + * @see tanf() + * @see sinl() + * @see cosl() + * @see tanhl() + * @see atanl() + */ long double tanl( long double x ); -// These functions return the hyperbolic tangent of their parameter. +/** These functions compute the hyperbolic tangent of x (measured in radians). + * @param x The value to compute the hyperbolic tangent of. + * @return The hyperbolic tangent of x. + * @see tanhf() + * @see tanhl() + * @see sinh() + * @see cosh() + * @see tan() + * @see atanh() + */ double tanh( double x ); + +/** These functions compute the hyperbolic tangent of x (measured in radians). + * @param x The value to compute the hyperbolic tangent of. + * @return The hyperbolic tangent of x. + * @see tanh() + * @see tanhl() + * @see sinhf() + * @see coshf() + * @see tanf() + * @see atanhf() + */ float tanhf( float x ); + +/** These functions compute the hyperbolic tangent of x (measured in radians). + * @param x The value to compute the hyperbolic tangent of. + * @return The hyperbolic tangent of x. + * @see tanh() + * @see tanhf() + * @see sinhl() + * @see coshl() + * @see tanl() + * @see atanhl() + */ long double tanhl( long double x ); -// These functions compute the arctangent of x. +/** These functions compute the arctangent of x (measured in radians). + * @param x The value to compute the arctangent of. + * @return The arctangent of x. + * @see atanf() + * @see atanl() + * @see atan2() + * @see asin() + * @see acos() + * @see tan() + * @see atanh() + */ double atan( double x ); + +/** These functions compute the arctangent of x (measured in radians). + * @param x The value to compute the arctangent of. + * @return The arctangent of x. + * @see atan() + * @see atanl() + * @see atan2f() + * @see asinf() + * @see acosf() + * @see tanf() + * @see atanhf() + */ float atanf( float x ); + +/** These functions compute the arctangent of x (measured in radians). + * @param x The value to compute the arctangent of. + * @return The arctangent of x. + * @see atan() + * @see atanf() + * @see atan2l() + * @see asinl() + * @see acosl() + * @see tanl() + * @see atanhl() + */ long double atanl( long double x ); -// These functions return the hyperbolic arctangent of their parameter. +/** These functions compute the hyperbolic arctangent of x (measured in radians). + * @param x The value to compute the hyperbolic arctangent of. + * @return The hyperbolic arctangent of x. + * @see atanhf() + * @see atanhl() + * @see asinh() + * @see acosh() + * @see tanh() + * @see atan() + */ double atanh( double x ); + +/** These functions compute the hyperbolic arctangent of x (measured in radians). + * @param x The value to compute the hyperbolic arctangent of. + * @return The hyperbolic arctangent of x. + * @see atanh() + * @see atanhl() + * @see asinhf() + * @see acoshf() + * @see tanhf() + * @see atanf() + */ float atanhf( float x ); + +/** These functions compute the hyperbolic arctangent of x (measured in radians). + * @param x The value to compute the hyperbolic arctangent of. + * @return The hyperbolic arctangent of x. + * @see atanh() + * @see atanhf() + * @see asinhl() + * @see acoshl() + * @see tanhl() + * @see atanl() + */ long double atanhl( long double x ); -// TODO +/** These functions compute the hyperbolic arctangent of x / y (measured in radians). + * They return their answer between pi and -pi. + * @param y The first side of the triangle. + * @param x The second side of the triangle. + * @return The angle between the first and the second side. + * @see atan2f() + * @see atan2l() + * @see atan() + * @see asin() + * @see acos() + * @see atanh() + * @see tanh() + */ double atan2( double y, double x ); + +/** These functions compute the hyperbolic arctangent of x / y (measured in radians). + * They return their answer between pi and -pi. + * @param y The first side of the triangle. + * @param x The second side of the triangle. + * @return The angle between the first and the second side. + * @see atan2f() + * @see atan2l() + * @see atanf() + * @see asinf() + * @see acosf() + * @see atanhf() + * @see tanhf() + */ float atan2f( float y, float x ); + +/** These functions compute the hyperbolic arctangent of x / y (measured in radians). + * They return their answer between pi and -pi. + * @param y The first side of the triangle. + * @param x The second side of the triangle. + * @return The angle between the first and the second side. + * @see atan2f() + * @see atan2l() + * @see atanl() + * @see asinl() + * @see acosl() + * @see atanhl() + * @see tanhl() + */ long double atan2l( long double y, long double x ); -// These functions return sqrt(x^2 + y^2 ). +/** These functions compute the hypotenuse of a straight triangle. + * @param x The length of one side of the triangle. + * @param y The length of the other side of the triangle. + * @return The length of the hypotenuse, according to h = sqrt(x*x+y*y). + * @see hypotf() + * @see hypotl() + */ double hypot( double x, double y ); + +/** These functions compute the hypotenuse of a straight triangle. + * @param x The length of one side of the triangle. + * @param y The length of the other side of the triangle. + * @return The length of the hypotenuse, according to h = sqrt(x*x+y*y). + * @see hypot() + * @see hypotl() + */ float hypotf( float x, float y ); + +/** These functions compute the hypotenuse of a straight triangle. + * @param x The length of one side of the triangle. + * @param y The length of the other side of the triangle. + * @return The length of the hypotenuse, according to h = sqrt(x*x+y*y). + * @see hypot() + * @see hypotf() + */ long double hypotl( long double x, long double y ); -// These functions return their parameter x, raised to the power y. +/** These functions compute x raised to the power y. + * @param x The base of the power. + * @param y The exponent of the power. + * @return The base raised to the power of the exponent. + * @see powf() + * @see powl() + */ double pow( double x, double y ); + +/** These functions compute x raised to the power y. + * @param x The base of the power. + * @param y The exponent of the power. + * @return The base raised to the power of the exponent. + * @see pow() + * @see powl() + */ float powf( float x, float y ); + +/** These functions compute x raised to the power y. + * @param x The base of the power. + * @pa am y The exponent of the power. + * @return The base raised to the power of the exponent. + * @see pow() + * @see powf() + */ long double powl( long double x, long double y ); -// These functions return the square root of their parameter. +/** These functions compute the square root of x. + * @param x The value to take the square root of. + * @return The square root of x. + * @see sqrtf() + * @see sqrtl() + */ double sqrt( double x ); + +/** These functions compute the square root of x. + * @param x The value to take the square root of. + * @return The square root of x. + * @see sqrt() + * @see sqrtl() + */ float sqrtf( float x ); + +/** These functions compute the square root of x. + * @param x The value to take the square root of. + * @return The square root of x. + * @see sqrt() + * @see sqrtf() + */ long double sqrtl( long double x ); -// TODO +/* TODO */ double cbrt( double x ); float cbrtf( float x ); long double cbrtl( long double x ); -// TODO +/* TODO */ double exp( double x ); float expf( float x ); long double expl( long double x ); -// TODO +/* TODO */ double exp2( double x ); float exp2f( float x ); long double exp2l( long double x ); -// TODO +/* TODO */ double expm1( double x ); float expm1f( float x ); long double expm1l( long double x ); -// TODO +/* TODO */ double frexp( double x, int * exp ); float frexpf( float x, int * exp ); long double frexpl( long double x, int * exp ); -// TODO +/* TODO */ double ldexp( double x, int exp ); float ldexpf( float x, int exp ); long double ldexpl( long double x, int exp ); -// These functions return the natural logarithm of their parameter. +/** These functions compute the logarithm (base e) of x. + * @param x The value to take the logarithm of. + * @return The logarithm of x. + * @see logf() + * @see logl() + * @todo is this really the natural logarithm? wouldn't it be ln()? + */ double log( double x ); + +/** These functions compute the logarithm (base e) of x. + * @param x The value to take the logarithm of. + * @return The logarithm of x. + * @see log() + * @see logl() + * @todo is this really the natural logarithm? wouldn't it be ln()? + */ float logf( float x ); + +/** These functions compute the logarithm (base e) of x. + * @param x The value to take the logarithm of. + * @return The logarithm of x. + * @see log() + * @see logf() + * @todo is this really the natural logarithm? wouldn't it be ln()? + */ long double logl( long double x ); -// These functions return the logarithm (base 10 ) of their parameter. +/** These functions compute the logarithm (base 10) of x. + * @param x The value to take the logarithm of. + * @return The logarithm of x. + * @see log10f() + * @see log10l() + */ double log10( double x ); + +/** These functions compute the logarithm (base 10) of x. + * @param x The value to take the logarithm of. + * @return The logarithm of x. + * @see log10() + * @see log10l() + */ float log10f( float x ); + +/** These functions compute the logarithm (base 10) of x. + * @param x The value to take the logarithm of. + * @return The logarithm of x. + * @see log10() + * @see log10f() + */ long double log10l( long double x ); -// These functions return the logarithm (base 2 ) of their parameter. +/** These functions compute the logarithm (base 2) of x. + * @param x The value to take the logarithm of. + * @return The logarithm of x. + * @see log2f() + * @see log2l() + */ double log2( double x ); + +/** These functions compute the logarithm (base 2) of x. + * @param x The value to take the logarithm of. + * @return The logarithm of x. + * @see log2() + * @see log2l() + */ float log2f( float x ); + +/** These functions compute the logarithm (base 2) of x. + * @param x The value to take the logarithm of. + * @return The logarithm of x. + * @see log2() + * @see log2f() + */ long double log2l( long double x ); -// TODO +/* TODO */ double logb( double x ); float logbf( float x ); long double logbl( long double x ); -// TODO +/* TODO */ int ilogb( double x ); int ilogbf( float x ); int ilogbl( long double x ); -// TODO +/* TODO */ double log1p( double x ); float log1pf( float x ); long double log1pl( long double x ); -// These functions return the smallest integer no smaller than value. +/** These functions increase x to the next whole number. + * @param x The value to increase. + * @return The next whole number after x. + * @see ceilf() + * @see ceill() + */ double ceil( double x ); + +/** These functions increase x to the next whole number. + * @param x The value to increase. + * @return The next whole number after x. + * @see ceil() + * @see ceill() + */ float ceilf( float x ); + +/** These functions increase x to the next whole number. + * @param x The value to increase. + * @return The next whole number after x. + * @see ceil() + * @see ceilf() + */ long double ceill( long double x ); -// These functions return the largest integer no larger than their parameter. +/** These functions decrease x to the previous whole number. + * @param x The value to decrease. + * @return The previous whole number before x. + * @see floorf() + * @see floorl() + */ double floor( double x ); + +/** These functions decrease x to the previous whole number. + * @param x The value to decrease. + * @return The previous whole number before x. + * @see floor() + * @see floorl() + */ float floorf( float x ); + +/** These functions decrease x to the previous whole number. + * @param x The value to decrease. + * @return The previous whole number before x. + * @see floor() + * @see floorf() + */ long double floorl( long double x ); -// TODO +/** These functions compute the modulus of x and y. + * @param x The value to take the modulus of. + * @param y The modulus. + * @return The value of x modulus y. + * @see fmodf() + * @see fmodl() + */ double fmod( double x, double y ); + +/** These functions compute the modulus of x and y. + * @param x The value to take the modulus of. + * @param y The modulus. + * @return The value of x modulus y. + * @see fmod() + * @see fmodl() + */ float fmodf( float x, float y ); + +/** These functions compute the modulus of x and y. + * @param x The value to take the modulus of. + * @param y The modulus. + * @return The value of x modulus y. + * @see fmod() + * @see fmodf() + */ long double fmodl( long double x, long double y ); -// TODO +/* TODO */ double modf( double x, double * integer ); float modff( float x, float * integer ); long double modfl( long double x, long double * integer ); -// These functions return their parameter x, with the sign of parameter y. +/** These functions return x with the sign of y. + * @param x The value to set the sign of. + * @param y The value from which to read the sign. + * @return The magnitude of x with the sign of y. + * @see copysignf() + * @see copysignl() + */ double copysign( double x, double y ); + +/** These functions return x with the sign of y. + * @param x The value to set the sign of. + * @param y The value from which to read the sign. + * @return The magnitude of x with the sign of y. + * @see copysign() + * @see copysignl() + */ float copysignf( float x, float y ); + +/** These functions return x with the sign of y. + * @param x The value to set the sign of. + * @param y The value from which to read the sign. + * @return The magnitude of x with the sign of y. + * @see copysign() + * @see copysignf() + */ long double copysignl( long double x, long double y ); -// TODO +/* TODO */ double erf( double x ); float erff( float x ); long double erfl( long double x ); -// TODO +/* TODO */ double erfc( double x ); float erfcf( float x ); long double erfcl( long double x ); -// TODO +/* TODO */ double fdim( double x, double y ); float fdimf( float x, float y ); long double fdiml( long double x, long double y ); -// TODO +/* TODO */ double fma( double x, double y, double z ); float fmaf( float x, float y, float z ); long double fmal( long double x, long double y, long double z ); -// These functions return the larger of their parameters. +/** These functions return the largest of the parameters. + * @param x The first candidate. + * @param y The second candidate. + * @return The largest of x and y. + * @see fmaxf() + * @see fmaxl() + */ double fmax( double x, double y ); + +/** These functions return the largest of the parameters. + * @param x The first candidate. + * @param y The second candidate. + * @return The largest of x and y. + * @see fmax() + * @see fmaxl() + */ float fmaxf( float x, float y ); + +/** These functions return the largest of the parameters. + * @param x The first candidate. + * @param y The second candidate. + * @return The largest of x and y. + * @see fmax() + * @see fmaxf() + */ long double fmaxl( long double x, long double y ); -// These functions return the smaller of their parameters. +/** These functions return the smallest of the parameters. + * @param x The first candidate. + * @param y The second candidate. + * @return The smallest of x and y. + * @see fminf() + * @see fminl() + */ double fmin( double x, double y ); + +/** These functions return the smallest of the parameters. + * @param x The first candidate. + * @param y The second candidate. + * @return The smallest of x and y. + * @see fmin() + * @see fminl() + */ float fminf( float x, float y ); + +/** These functions return the smallest of the parameters. + * @param x The first candidate. + * @param y The second candidate. + * @return The smallest of x and y. + * @see fmin() + * @see fminf() + */ long double fminl( long double x, long double y ); -// TODO +/* TODO */ long long llrint( double x ); long long llrintf( float x ); long long llrintl( long double x ); @@ -276,7 +1244,9 @@ double rint( double x ); float rintf( float x ); long double rintl( long double x ); -// TODO +/* TODO - These functions return their parameter correctly rounded according + * to the current rounding settings. + */ long long llround( double x ); long long llroundf( float x ); long long llroundl( long double x ); @@ -287,7 +1257,9 @@ double round( double x ); float roundf( float x ); long double roundl( long double x ); -// TODO +/* TODO - These functions return their parameter with its decimal part + * truncated. + */ double trunc( double x ); float truncf( float x ); long double truncl( long double x ); @@ -300,44 +1272,46 @@ double nextafter( double x, double y ); float nextafterf( float x, float y ); long double nextafterl( long double x, long double y ); -// TODO +/* TODO */ double nexttoward( double x, long double y ); float nexttowardf( float x, long double y ); long double nexttowardl( long double x, long double y ); -// TODO +/* TODO - These functions divide parameter x by parameter y and return the + * remainder. + */ double remainder( double x, double y ); float remainderf( float x, float y ); long double remainderl( long double x, long double y ); -// TODO +/* TODO */ double remquo( double x, double y, int * pquo ); float remquof( float x, float y, int * pquo ); long double remquol( long double x, long double y, int * pquo ); -// TODO +/* TODO */ double scalbn( double x, int ex ); float scalbnf( float x, int ex ); long double scalbnl( long double x, int ex ); -// TODO +/* TODO */ double scalbln( double x, long ex ); float scalblnf( float x, long ex ); long double scalblnl( long double x, long ex ); -// TODO +/* TODO */ double lgamma( double x ); float lgammaf( float x ); long double lgammal( long double x ); -// TODO +/* TODO */ double tgamma( double x ); float tgammaf( float x ); long double tgammal( long double x ); -// TODO +/* TODO */ double nan( const char *str ); float nanf( const char *str ); long double nanl( const char *str ); -#endif // __MATH_H +#endif /* _MATH_H */ diff --git a/includes/setjmp.h b/includes/setjmp.h index cb938a9..8afef14 100644 --- a/includes/setjmp.h +++ b/includes/setjmp.h @@ -1,26 +1,28 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Nonlocal jumps -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Nonlocal jumps + * --------------------------------------------------------------------------*/ -#ifndef __SETJMP_H -#define __SETJMP_H __SETJMP_H +#ifndef _SETJMP_H +#define _SETJMP_H _SETJMP_H -// TODO: Documentation +/* TODO: Documentation */ -// ---------------------------------------------------------------------------- -// TYPEDEFS +/* ---------------------------------------------------------------------------- + * TYPEDEFS + * --------------------------------------------------------------------------*/ -struct jmp_buf[1]; // TODO +struct jmp_buf[1]; /* TODO */ -// ---------------------------------------------------------------------------- -// FUNCTIONS +/* ---------------------------------------------------------------------------- + * FUNCTIONS + * --------------------------------------------------------------------------*/ int setjmp( jmp_buf env ); void longjmp( jmp_buf env, int val ); -#endif // __SETJMP_H +#endif /* _SETJMP_H */ diff --git a/includes/signal.h b/includes/signal.h index 3f51685..170851c 100644 --- a/includes/signal.h +++ b/includes/signal.h @@ -1,39 +1,49 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Signal handling -// ---------------------------------------------------------------------------- - -#ifndef __SIGNAL_H -#define __SIGNAL_H __SIGNAL_H - -// TODO: Documentation - -// ---------------------------------------------------------------------------- -// MACROS - -#define SIGABRT // TODO - personality? -#define SIGFPE // TODO - personality? -#define SIGILL // TODO - personality? -#define SIGINT // TODO - personality? -#define SIGSEGV // TODO - personality? -#define SIGTERM // TODO - personality? -#define SIG_DFL // TODO - personality? -#define SIG_ERR // TODO - personality? -#define SIG_IGN // TODO - personality? - -// ---------------------------------------------------------------------------- -// TYPEDEFS - -typedef sig_atomic_t; // TODO - personality? - -// ---------------------------------------------------------------------------- -// FUNCTIONS - -int raise( int sig ); // TODO -void ( * signal( int sig, void ( *func )( int ) ) ) ( int ); // TODO - -#endif // __SIGNAL_H +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Signal handling + * --------------------------------------------------------------------------*/ + +#ifndef _SIGNAL_H +#define _SIGNAL_H _SIGNAL_H + +#ifndef _NULL +#include "__intern.h" +#endif + +/* TODO: Documentation */ + +/* ---------------------------------------------------------------------------- + * MACROS + * --------------------------------------------------------------------------*/ + +#define SIGABRT _SIGABRT +#define SIGFPE _SIGFPE +#define SIGILL _SIGILL +#define SIGINT _SIGINT +#define SIGSEGV _SIGSEGV +#define SIGTERM _SIGTERM +#define SIG_DFL _SIG_DFL +#define SIG_ERR _SIG_ERR +#define SIG_IGN _SIG_IGN + +/* ---------------------------------------------------------------------------- + * TYPEDEFS + * --------------------------------------------------------------------------*/ + +#ifndef _SIG_ATOMIC_T +#define _SIG_ATOMIC_T _SIG_ATOMIC_T +typedef __sig_atomic_t sig_atomic_t; +#endif /* _SIG_ATOMIC_T + +/* ---------------------------------------------------------------------------- + * FUNCTIONS + * --------------------------------------------------------------------------*/ + +int raise( int sig ); /* TODO */ +void ( * signal( int sig, void ( *func )( int ) ) ) ( int ); /* TODO */ + +#endif /* _SIGNAL_H */ diff --git a/includes/stdarg.h b/includes/stdarg.h index 5d22705..62d0e40 100644 --- a/includes/stdarg.h +++ b/includes/stdarg.h @@ -1,32 +1,80 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Variable arguments -// ---------------------------------------------------------------------------- - -#ifndef __STDARG_H -#define __STDARG_H __STDARG_H - -// ---------------------------------------------------------------------------- -// TYPEDEFS - -typedef do-type va_list; // TODO - -// ---------------------------------------------------------------------------- -// MACROS - -#define va_arg( va_list ap, Ty ) // TODO -#define va_copy( va_list dest, va_list src ) // TODO -#define va_end( va_list ap ) // TODO -#define va_start( va_list ap, last-par ) // TODO - -/* PDPC code - unreviewed -#define va_start(ap, parmN) ap = (char *)&parmN + 4 -#define va_arg(ap, type) *(type *)(ap += sizeof(type), ap - sizeof(type)) -#define va_end(ap) ap = 0 -*/ - -#endif // __STDARG_H +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Variable arguments + * ---------------------------------------------------------------------------- + * This header is part of a freestanding implementation + * --------------------------------------------------------------------------*/ + +#ifndef _STDARG_H +#define _STDARG_H _STDARG_H + +/* TODO: This code was contributed by Michael Moody, who added: + * "As always with my code it's not guaranteed bug-free (In fact I know for a + * fact it won't work properly on certain archs)." + * Code assumes that: + * - arguments are passed on the stack; + * - arguments are alligned to pointer size. + */ + +/* ---------------------------------------------------------------------------- + * TYPEDEFS + * --------------------------------------------------------------------------*/ + +typedef char * va_list; + +/* ---------------------------------------------------------------------------- + * MACROS + * --------------------------------------------------------------------------*/ + +/** Returns the size of 'type' rounded up to the nearest multiple of the size + * of a pointer. This macro is just here for clarity. + */ +#define __va_round(type) \ + ( \ + (sizeof(type) + sizeof(void *) - 1) & ~(sizeof(void *) - 1) \ + ) + +/** Initialises ap for use by va_arg by setting ap to point at the first + * argument in the ellipsis. parmN is the last known parameter in the function + * definition (ie the one before the ellipsis). + */ +#define va_start(ap, parmN) \ + ( \ + (ap) = (char *)&parmN + (__va_round(parmN)) \ + , \ + (void)0 \ + ) + +/** Returns the next argument, assumed variable type is 'type', in the + * ellipsis. + */ +#define va_arg(ap, type) \ + ( \ + (ap) += (__va_round(type)) \ + , \ + (*(type*)((ap) - (__va_round(type)))) \ + ) + +/** Cleans up ap. + */ +#define va_end(ap) \ + ( \ + (ap) = (void *)0 \ + , \ + (void)0 \ + ) + +/** Makes the va_list dest be a copy of the va_list src. + */ +#define va_copy(dest, src) \ + ( \ + (dest) = (src) \ + , \ + (void)0 \ + ) + +#endif /* _STDARG_H */ diff --git a/includes/stdbool.h b/includes/stdbool.h index 0e1c2a5..6e9c83f 100644 --- a/includes/stdbool.h +++ b/includes/stdbool.h @@ -1,17 +1,20 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Boolean type and values -// ---------------------------------------------------------------------------- - -#ifndef __STDBOOL_H -#define __STDBOOL_H __STDBOOL_H - -// ---------------------------------------------------------------------------- -// MACROS +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Boolean type and values + * ---------------------------------------------------------------------------- + * This header is part of a freestanding implementation + * --------------------------------------------------------------------------*/ + +#ifndef _STDBOOL_H +#define _STDBOOL_H _STDBOOL_H + +/* ---------------------------------------------------------------------------- + * MACROS + * --------------------------------------------------------------------------*/ #define __bool_true_false_are_defined 1 @@ -21,11 +24,12 @@ #define false 0 #define true 1 -// ---------------------------------------------------------------------------- -// TYPEDEFS +/* ---------------------------------------------------------------------------- + * TYPEDEFS + * --------------------------------------------------------------------------*/ typedef int bool; -#endif // __cplusplus +#endif /* __cplusplus */ -#endif // __STDBOOL_H +#endif /* _STDBOOL_H */ diff --git a/includes/stddef.h b/includes/stddef.h index 3c6955b..cec8dfb 100644 --- a/includes/stddef.h +++ b/includes/stddef.h @@ -1,30 +1,46 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Common definitions -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Common definitions + * ---------------------------------------------------------------------------- + * This header is part of a freestanding implementation + * --------------------------------------------------------------------------*/ -#ifndef __STDDEF_H -#define __STDDEF_H __STDDEF_H +#ifndef _STDDEF_H +#define _STDDEF_H _STDDEF_H -// TODO: Documentation +#ifndef _NULL +#include "__intern.h" +#endif -// ---------------------------------------------------------------------------- -// MACROS +/* TODO: Documentation */ -#include "__NULL.h" +/* ---------------------------------------------------------------------------- + * MACROS + * --------------------------------------------------------------------------*/ -#define offsetof( s-type, mbr ) // TODO - personality? +#define NULL _NULL -// ---------------------------------------------------------------------------- -// TYPEDEFS +#define offsetof( s-type, mbr ) /* TODO - to __intern.h / __personality.h? */ -#include "__size_t.h" -#include "__wchar_t.h" +/* ---------------------------------------------------------------------------- + * TYPEDEFS + * --------------------------------------------------------------------------*/ -typedef ptrdiff_t; // TODO - personality? +#ifndef _SIZE_T +#define _SIZE_T _SIZE_T +typedef __size_t size_t; +#endif /* _SIZE_T */ -#endif // __STDDEF_H +#ifndef _WCHAR_T +#define _WCHAR_T _WCHAR_T +typedef __wchar_t wchar_t; +#endif /* _WCHAR_T */ + +/* Look this up in the C Standard Rationale, which has example code on this. */ +typedef ptrdiff_t; /* TODO - to __intern.h / __personality.h? */ + +#endif /* _STDDEF_H */ diff --git a/includes/stdint.h b/includes/stdint.h new file mode 100644 index 0000000..7ba5c70 --- /dev/null +++ b/includes/stdint.h @@ -0,0 +1,143 @@ +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Integer types + * ---------------------------------------------------------------------------- + * This header is part of a freestanding implementation + * --------------------------------------------------------------------------*/ + +#ifndef _STDINT_H +#define _STDINT_H _STDINT_H + +/* This file is part of the platform personality (see personality.txt). */ +#ifndef _NULL +#include "__intern.h" +#endif + +/* TODO: Documentation */ + +/* ---------------------------------------------------------------------------- + * TYPEDEFS + * --------------------------------------------------------------------------*/ + +typedef int8_t; /* TODO */ +typedef int16_t; /* TODO */ +typedef int32_t; /* TODO */ +typedef int64_t; /* TODO */ + +typedef uint8_t; /* TODO */ +typedef uint16_t; /* TODO */ +typedef uint32_t; /* TODO */ +typedef uint64_t; /* TODO */ + +typedef int_least8_t; /* TODO */ +typedef int_least16_t; /* TODO */ +typedef int_least32_t; /* TODO */ +typedef int_least64_t; /* TODO */ + +typedef uint_least8_t; /* TODO */ +typedef uint_least16_t; /* TODO */ +typedef uint_least32_t; /* TODO */ +typedef uint_least64_t; /* TODO */ + +typedef int_fast8_t; /* TODO */ +typedef int_fast16_t; /* TODO */ +typedef int_fast32_t; /* TODO */ +typedef int_fast64_t; /* TODO */ + +typedef uint_fast8_t; /* TODO */ +typedef uint_fast16_t; /* TODO */ +typedef uint_fast32_t; /* TODO */ +typedef uint_fast64_t; /* TODO */ + +typedef intptr_t; /* TODO */ +typedef uintptr_t; /* TODO */ + +typedef intmax_t; /* TODO */ +typedef uintmax_t; /* TODO */ + +/* ---------------------------------------------------------------------------- + * MACROS + * --------------------------------------------------------------------------*/ + +#define INT8_MIN /* TODO */ +#define INT16_MIN /* TODO */ +#define INT32_MIN /* TODO */ +#define INT64_MIN /* TODO */ + +#define INT8_MAX 0x7f +#define INT16_MAX 0x7fff +#define INT32_MAX 0x7fffffff +#define INT64_MAX 0x7fffffffffffffff + +#define UINT8_MAX 0xff +#define UINT16_MAX 0xffff +#define UINT32_MAX 0xffffffff +#define UINT64_MAX 0xffffffffffffffff + +#define INT_LEAST8_MIN /* TODO */ +#define INT_LEAST16_MIN /* TODO */ +#define INT_LEAST32_MIN /* TODO */ +#define INT_LEAST64_MIN /* TODO */ + +#define INT_LEAST8_MAX /* TODO */ +#define INT_LEAST16_MAX /* TODO */ +#define INT_LEAST32_MAX /* TODO */ +#define INT_LEAST64_MAX /* TODO */ + +#define UINT_LEAST8_MAX /* TODO */ +#define UINT_LEAST16_MAX /* TODO */ +#define UINT_LEAST32_MAX /* TODO */ +#define UINT_LEAST64_MAX /* TODO */ + +#define INT_FAST8_MIN /* TODO */ +#define INT_FAST16_MIN /* TODO */ +#define INT_FAST32_MIN /* TODO */ +#define INT_FAST64_MIN /* TODO */ + +#define INT_FAST8_MAX /* TODO */ +#define INT_FAST16_MAX /* TODO */ +#define INT_FAST32_MAX /* TODO */ +#define INT_FAST64_MAX /* TODO */ + +#define UINT_FAST8_MAX /* TODO */ +#define UINT_FAST16_MAX /* TODO */ +#define UINT_FAST32_MAX /* TODO */ +#define UINT_FAST64_MAX /* TODO */ + +#define INTPTR_MIN /* TODO */ +#define INTPTR_MAX /* TODO */ +#define UINTPTR_MAX /* TODO */ + +#define INT8_C(x) /* TODO */ +#define INT16_C(x) /* TODO */ +#define INT32_C(x) /* TODO */ +#define INT64_C(x) /* TODO */ + +#define UINT8_C(x) /* TODO */ +#define UINT16_C(x) /* TODO */ +#define UINT32_C(x) /* TODO */ +#define UINT64_C(x) /* TODO */ + +#define INTMAX_C(x) /* TODO */ +#define UINTMAX_C(x) /* TODO */ + +#define PTRDIFF_MIN /* TODO */ +#define PTRDIFF_MAX /* TODO */ + +#define SIG_ATOMIC_MIN /* TODO */ +#define SIG_ATOMIC_MAX /* TODO */ + +#define SIZE_MAX /* TODO */ + +#define WCHAR_MIN _WCHAR_MIN +#define WCHAR_MAX _WCHAR_MAX + +#define INTMAX_MIN /* TODO */ +#define INTMAX_MAX /* TODO */ +#define UINTMAX_MAX /* TODO */ + +#endif // _STDINT_H diff --git a/includes/stdio.h b/includes/stdio.h index de9a491..ddf7d98 100644 --- a/includes/stdio.h +++ b/includes/stdio.h @@ -1,20 +1,24 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Input/output -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Input/output + * --------------------------------------------------------------------------*/ -#ifndef __STDIO_H -#define __STDIO_H __STDIO_H +#ifndef _STDIO_H +#define _STDIO_H _STDIO_H -// ---------------------------------------------------------------------------- -// MACROS +#ifndef _NULL +#include "__intern.h" +#endif /* _NULL */ -#include "__NULL.h" -#include "__pdc_stdio.h" +/* ---------------------------------------------------------------------------- + * MACROS + * --------------------------------------------------------------------------*/ + +#define NULL _NULL #define _IOFBF 0 // @see setvbuf() #define _IOLBF 1 // @see setvbuf() @@ -26,21 +30,28 @@ #define EOF -1 -// ---------------------------------------------------------------------------- -// TYPEDEFS +/* ---------------------------------------------------------------------------- + * TYPEDEFS + * --------------------------------------------------------------------------*/ + +#ifndef _SIZE_T +#define _SIZE_T _SIZE_T +typedef __size_t size_t +#endif /* _SIZE_T */ -#include "__size_t.h" +/* file position, buffer pointer, ErrorIndicator, EOFIndicator, HostRC */ +typedef FILE; /* TODO */ -typedef FILE; // file position, buffer pointer, ErrorIndicator, EOFIndicator, - // HostRC -typedef fpos_t; // file position +/* file position */ +typedef fpos_t; /* TODO */ extern FILE * stdin; extern FILE * stdout; extern FILE * stderr; -// ---------------------------------------------------------------------------- -// FUNCTIONS +/* ---------------------------------------------------------------------------- + * FUNCTIONS + * --------------------------------------------------------------------------*/ /* TABLE OF CONTENTS (in order of appearance) * @@ -115,402 +126,402 @@ extern FILE * stderr; */ /** File OPEN. Opens a file. - @param filename Name of the file. - @param mode One of r, w, a, rb, wb, ab, r+, w+, a+, rb+, wb+, ab+, - specifying which mode to open the file in. - @return A file handle associated with the opened file, NULL if failed. + * @param filename Name of the file. + * @param mode One of r, w, a, rb, wb, ab, r+, w+, a+, rb+, wb+, ab+, + * specifying which mode to open the file in. + * @return A file handle associated with the opened file, NULL if failed. */ FILE * fopen( const char * restrict filename, const char * restrict mode ); /** File REOPEN. Opens the file specified by the given name, associating it - with the given file handle. If filename is NULL, it is attempted to change - the mode of the already opened file associated with the given file handle. - (This function can e.g. be used to reassociate stdin / stdout / stderr with - a filename.) - @param filename Name of the file to be opened. - @param mode One of r, w, a, rb, wb, ab, r+, w+, a+, rb+, wb+, ab+, - specifying which mode to open the file in. - @param fh The file handle to associate with the opened file. - @return fh if successful, NULL if failed. + * with the given file handle. If filename is NULL, it is attempted to change + * the mode of the already opened file associated with the given file handle. + * (This function can e.g. be used to reassociate stdin / stdout / stderr with + * a filename.) + * @param filename Name of the file to be opened. + * @param mode One of r, w, a, rb, wb, ab, r+, w+, a+, rb+, wb+, ab+, + * specifying which mode to open the file in. + * @param fh The file handle to associate with the opened file. + * @return fh if successful, NULL if failed. */ FILE * freopen( const char * restrict filename, const char * restrict mode, FILE * fh ); /** File FLUSH. Flushes any output buffers of a file. If parameter is NULL, - flushes output buffers for all file handles. The function is undefined for - input streams or update streams when the last operation was input. - @param fh The file handle. - @return 0 if successful, EOF on write error (setting error indicator). + * flushes output buffers for all file handles. The function is undefined for + * input streams or update streams when the last operation was input. + * @param fh The file handle. + * @return 0 if successful, EOF on write error (setting error indicator). */ int fflush( FILE * fh ); /** File EOF. Tests whether EOF is set for a given file. - @param fh The file handle. - @return 0 if EOF is not set, non-zero if EOF is set. + * @param fh The file handle. + * @return 0 if EOF is not set, non-zero if EOF is set. */ int feof( FILE * fh ); /** File ERROR. Tests whether error indicator is set for a given file. - @param fh The file handle. - @return 0 if error indicator is not set, non-zero if set. + * @param fh The file handle. + * @return 0 if error indicator is not set, non-zero if set. */ int ferror( FILE * fh ); /** CLEAR ERRor. Clears EOF and error indicator of a FILE handle. - @param fh The file handle. + * @param fh The file handle. */ void clearerr( FILE * fh ); /** File CLOSE. Flushes any output buffers, closes the file, frees internal - buffers, and discards the file handle. - @param fh The file handle. - @return 0 if successful, non-zero if failed. (In any case, the file handle - is invalid afterwards.) + * buffers, and discards the file handle. + * @param fh The file handle. + * @return 0 if successful, non-zero if failed. (In any case, the file handle + * is invalid afterwards.) */ int fclose( FILE * fh ); -// ---------------------------------------------------------------------------- +/* ------------------------------------------------------------------------- */ /** RENAME file. Causes a file to be no longer accessible under a given name, - but a new name instead. - @param filename Name of the file. - @param newname New file name. - @return 0 if successful, non-zero if failed. (This implementation: INT_MAX - if newname already exists; INT_MIN if filename could not be found; - EOF if filename is a currently open file.) + * but a new name instead. + * @param filename Name of the file. + * @param newname New file name. + * @return 0 if successful, non-zero if failed. (This implementation: INT_MAX + * if newname already exists; INT_MIN if filename could not be found; + * EOF if filename is a currently open file.) */ int rename( const char * filename, const char * newname ); /** REMOVE file. Causes a file to be no longer accessible under a given name. - @param filename Name of the file. - @return 0 if successful, non-zero if failed. (This implementation: INT_MAX - if the file is currently open.) + * @param filename Name of the file. + * @return 0 if successful, non-zero if failed. (This implementation: INT_MAX + * if the file is currently open.) */ int remove( const char * filename ); -// ---------------------------------------------------------------------------- +/* ------------------------------------------------------------------------- */ /** TeMPorary FILE. Opens a previously non-existend file in "wb+" mode that - will be automatically deleted when closed, or when the program terminates. - (This implementation: If program terminates abnormally, file is not - deleted.) - @return A file handle for the temporary file. (NULL if opening failed.) + * will be automatically deleted when closed, or when the program terminates. + * (This implementation: If program terminates abnormally, file is not + * deleted.) + * @return A file handle for the temporary file. (NULL if opening failed.) */ FILE * tmpfile( void ) /** TeMPorary NAMe. Generates a file name that does not yet exist in the file - system, and is different from the last call to the function. Note that a - file generated with this name is not "temporary", and must be remove()d - normally. - @param filename NULL, or a char[ L_tmpnam ] array. (Beware, calling this - function with a NULL parameter is not thread-safe.) - @return If 'filename' is NULL, a pointer to an internal static buffer - holding the generated name. If 'filename' is not null, the - generated name is stored in 'filename', and 'filename' is returned. - If the filename generation fails, function returns NULL. + * system, and is different from the last call to the function. Note that a + * file generated with this name is not "temporary", and must be remove()d + * normally. + * @param filename NULL, or a char[ L_tmpnam ] array. (Beware, calling this + * function with a NULL parameter is not thread-safe.) + * @return If 'filename' is NULL, a pointer to an internal static buffer + * holding the generated name. If 'filename' is not null, the + * generated name is stored in 'filename', and 'filename' is returned. + * If the filename generation fails, function returns NULL. */ char * tmpnam( char * filename ); -// ---------------------------------------------------------------------------- +/* ------------------------------------------------------------------------- */ /** File SEEK. Sets the current position in a file to the values specified by - start and offset. - @param fh The file handle. - @param offset The offset from 'start' to position to. - @param start The starting point from which to calculate the offset. May be - one of SEEK_SET, SEEK_CUR, SEEK_END. - @return 0 if successful, non-zero if error encountered. + * start and offset. + * @param fh The file handle. + * @param offset The offset from 'start' to position to. + * @param start The starting point from which to calculate the offset. May be + * one of SEEK_SET, SEEK_CUR, SEEK_END. + * @return 0 if successful, non-zero if error encountered. */ int fseek( FILE * fh, long offset, int start ); /** REWIND file. Equivalent to (void) fseek( fh, 0, SEEK_SET ). - @param fh The file handle. + * @param fh The file handle. */ void rewind( FILE * fh ); /** File TELL position. Tells the current offset into a given file. - @param fh The file handle. - @return The offset into the file. + * @param fh The file handle. + * @return The offset into the file. */ long ftell( FILE * fh ); /** File GET POSition. Stores the current state and position in a file. - @param fh The file handle. - @param pos The object to store the current state in. - @return 0 if successful, non-zero if error encountered. + * @param fh The file handle. + * @param pos The object to store the current state in. + * @return 0 if successful, non-zero if error encountered. */ int fgetpos( FILE * restrict fh, fpos_t * restrict pos ); /** File SET POSition. Sets the current file position to the value stored in a - given fpos_t object. - @param fh The file handle. - @param pos The fpos_t object. - @return 0 if successful, non-zero if error encountered. + * given fpos_t object. + * @param fh The file handle. + * @param pos The fpos_t object. + * @return 0 if successful, non-zero if error encountered. */ int fsetpos( FILE * fh, const fpos_t * pos ); -// ---------------------------------------------------------------------------- +/* ------------------------------------------------------------------------- */ /** File GET Character. Reads a character from file. - @param fh The file handle. - @return The next character in the file, as unsigned char converted to int, - or EOF if end of file is reached. + * @param fh The file handle. + * @return The next character in the file, as unsigned char converted to int, + * or EOF if end of file is reached. */ int fgetc( FILE * fh ); /** GET Character. Equivalent to fgetc(), but may be implemented as macro, and - is allowed to evaluate its parameter more than once. - @param fh The file handle. - @return The character read, or EOF if end of file / error encountered. + * is allowed to evaluate its parameter more than once. + * @param fh The file handle. + * @return The character read, or EOF if end of file / error encountered. */ int getc( FILE * fh ); /** GET CHARacter. Equivalent to getc( stdin ). - @return The character read, or EOF if end of file / error encountered. + * @return The character read, or EOF if end of file / error encountered. */ int getchar( void ); /** UN-GET Character. Puts a character back into an input stream. - @param c The character to put back. - @param fh The file handle. - @return The character put back, EOF if error encountered. + * @param c The character to put back. + * @param fh The file handle. + * @return The character put back, EOF if error encountered. */ int ungetc( int c, FILE * fh ); /** File GET String. Reads a line (terminated by newline character) from file, - but reading no more than n characters. - @param dest The char array to write into. - @param n The maximum number of characters to read. - @param fh The file handle. - @return 'dest', or NULL if an error occurred. + * but reading no more than n characters. + * @param dest The char array to write into. + * @param n The maximum number of characters to read. + * @param fh The file handle. + * @return 'dest', or NULL if an error occurred. */ char * fgets( char * restrict dest, int n, FILE * restrict fh ); /** GET String. Equivalent to fgets( dest, stdin ). - @param dest The character array to write to. - @return 'dest', or NULL if an error occurred. + * @param dest The character array to write to. + * @return 'dest', or NULL if an error occurred. */ char * gets( char * dest ); -// ---------------------------------------------------------------------------- +/* ------------------------------------------------------------------------- */ /** File PUT Character. Writes a character to file. - @param c The character (when converted to unsigned char) to write. - @param fh The file handle. - @return 'c', or EOF if an error occurred. + * @param c The character (when converted to unsigned char) to write. + * @param fh The file handle. + * @return 'c', or EOF if an error occurred. */ int fputc( int c, FILE * fh ); /** PUT Character. Equivalent to fputc( c, stdout ), but may be implemented as - a macro, and may evaluate the file handle more than once. - @param c The character to write. - @param fh The file handle. - @return The character written, or EOF if error encountered. + * a macro, and may evaluate the file handle more than once. + * @param c The character to write. + * @param fh The file handle. + * @return The character written, or EOF if error encountered. */ int putc( int c, FILE * fh ); /** PUT CHARacter. Equivalent to putc( c, stdout ). - @param c The character to write. - @return The character written, or EOF if error encountered. + * @param c The character to write. + * @return The character written, or EOF if error encountered. */ int putchar( int c ); /** File PUT String. Writes a C string to file. - @param src The string to write. - @param fh The file handle. - @return >= 0 if successful, or EOF if an error occurred. + * @param src The string to write. + * @param fh The file handle. + * @return >= 0 if successful, or EOF if an error occurred. */ int fputs( const char * restrict src, FILE * restrict fh ); /** PUT String. Write a C string to stdout. - @param src The C string to write. - @return >= 0 if successful, EOF if error encountered. + * @param src The C string to write. + * @return >= 0 if successful, EOF if error encountered. */ int puts( const char * src ); -// ---------------------------------------------------------------------------- +/* ------------------------------------------------------------------------- */ /** File SCAN Formatted. Reads from given file handle, under control of a - formatting string, the values of variables pointed to by 0..n pointers. - @param fh The file handle. - @param format The formatting string. - @param ... A list of 0..n pointers corresponding to placeholders in - 'format'. - @return EOF if failed, number of values successfully assigned otherwise. + * formatting string, the values of variables pointed to by 0..n pointers. + * @param fh The file handle. + * @param format The formatting string. + * @param ... A list of 0..n pointers corresponding to placeholders in + * 'format'. + * @return EOF if failed, number of values successfully assigned otherwise. */ int fscanf( FILE * restrict fh, const char * restrict format, ... ); /** SCAN Formatted. Equivalent to fscanf( stdin, format, ... ) - @param format The formatting string. - @param ... A list of 0..n pointers corresponding to placeholders in - 'format'. - @return EOF if failed, number of values successfully assigned otherwise. + * @param format The formatting string. + * @param ... A list of 0..n pointers corresponding to placeholders in + * 'format'. + * @return EOF if failed, number of values successfully assigned otherwise. */ int scanf( const char * restrict format, ... ); /** String SCAN Formatted. Equivalent to scanf( format, ... ), but using a C - string instead of a file handle for input. - @param src The input string. - @param format The formatting string. - @param ... A list of 0..n pointers corresponding to placeholders in - 'format'. - @return EOF if failed, number of values successfully assigned otherwise. + * string instead of a file handle for input. + * @param src The input string. + * @param format The formatting string. + * @param ... A list of 0..n pointers corresponding to placeholders in + * 'format'. + * @return EOF if failed, number of values successfully assigned otherwise. */ int sscanf( const char * restrict src, const char * restrict format, ... ); /** Variable File SCAN Formatted. Equivalent to fscanf( fh, format, ... ), - with the variable-length parameter list replaced by a va_list, created by - the va_start macro. - @param fh The file handle. - @param format The formatting string. - @param args The argument list created by the va_start macro. - @return Number of characters printed. + * with the variable-length parameter list replaced by a va_list, created by + * the va_start macro. + * @param fh The file handle. + * @param format The formatting string. + * @param args The argument list created by the va_start macro. + * @return Number of characters printed. */ int vfscanf( FILE * restrict fh, const char * restrict format, va_list args ); /** Variable SCAN Formatted. Equivalent to vfscanf( stdin, format, args ). - @param format The formatting string. - @param args The argument list created by the va_start macro. - @return Number of characters printed. + * @param format The formatting string. + * @param args The argument list created by the va_start macro. + * @return Number of characters printed. */ int vscanf( const char * restrict format, va_list args ); /** Variable String SCAN Formatted. Equivalent to vscanf( format, args ), but - reading from a C string instead of stdin. - @param src The C string to read from. - @param format The formatting string. - @param args The argument list created by the va_start macro. - @return Number of characters printed. + * reading from a C string instead of stdin. + * @param src The C string to read from. + * @param format The formatting string. + * @param args The argument list created by the va_start macro. + * @return Number of characters printed. */ int vsscanf( const char * restrict src, const char * restrict format, va_list ap ); -// ---------------------------------------------------------------------------- +/* ------------------------------------------------------------------------- */ /** File PRINT Formatted. Prints to given file handle, under control of a - formatting string, the values of 0..n variables. - @param fh The file handle. - @param format The formatting string. - @param ... A list of 0..n variables corresponding to placeholders in - 'format'. - @return Number of characters printed, negative value if error occurred. + * formatting string, the values of 0..n variables. + * @param fh The file handle. + * @param format The formatting string. + * @param ... A list of 0..n variables corresponding to placeholders in + * 'format'. + * @return Number of characters printed, negative value if error occurred. */ int fprintf( FILE * restrict fh, const char * restrict format, ... ); /** PRINT Formatted. Equivalent to fprintf( stdout, format, ... ). - @param format The formatting string. - @param ... A list of 0..n variables corresponding to placeholders in - 'format'. - @return Number of characters printed. + * @param format The formatting string. + * @param ... A list of 0..n variables corresponding to placeholders in + * 'format'. + * @return Number of characters printed. */ int printf( const char * restrict format, ... ); /** String PRINT Formatted. Equivalent to printf( format, ... ), but writing - to a char array instead of stdout. - @param dest The char array to write to. - @param format The formatting string. - @param ... A list of 0..n variables corresponding to placeholders in - 'format'. - @return Number of characters printed. + * to a char array instead of stdout. + * @param dest The char array to write to. + * @param format The formatting string. + * @param ... A list of 0..n variables corresponding to placeholders in + * 'format'. + * @return Number of characters printed. */ int sprintf( char * restrict dest, const char * restrict format, ... ); /** String N PRINT Formatted. Equivalent to sprintf( dest, format, ... ), but - will not write more than n characters. - @param dest The char array to write to. - @param n The maximum number of characters to write. - @param format The formatting string. - @param ... A list of 0..n variables corresponding to placeholders in - 'format'. - @return Number of characters printed. + * will not write more than n characters. + * @param dest The char array to write to. + * @param n The maximum number of characters to write. + * @param format The formatting string. + * @param ... A list of 0..n variables corresponding to placeholders in + * 'format'. + * @return Number of characters printed. */ int snprintf( char * restrict s, size_t n, const char * restrict format, ... ); /** Variable File PRINT Formatted. Equivalent to fprintf( fh, format, ... ), - with the variable-length parameter list replaced by a va_list, created by - the va_start macro. - @param fh The file handle. - @param format The formatting string. - @param args The argument list created by the va_start macro. - @return Number of characters printed. + * with the variable-length parameter list replaced by a va_list, created by + * the va_start macro. + * @param fh The file handle. + * @param format The formatting string. + * @param args The argument list created by the va_start macro. + * @return Number of characters printed. */ int vfprintf( FILE * restrict fh, const char * restrict format, va_list args ); /** Variable PRINT Formatted. Equivalent to vfprintf( stdout, format, args ). - @param format The formatting string. - @param args The argument list created by the va_start macro. - @return Number of characters printed. + * @param format The formatting string. + * @param args The argument list created by the va_start macro. + * @return Number of characters printed. */ int vprintf( const char * restrict format, va_list args ); /** Variable String PRINT Formatted. Equivalent to vprintf( format, args ), but - writing to a char array instead to stdout. - @param dest The char array to write to. - @param format The formatting string. - @param args The argument list created by the va_start macro. - @return Number of characters printed. + * writing to a char array instead to stdout. + * @param dest The char array to write to. + * @param format The formatting string. + * @param args The argument list created by the va_start macro. + * @return Number of characters printed. */ int vsprintf( char * restrict s, const char * restrict format, va_list ap); /** Variable String N PRINT Formatted. Equivalent to vsprintf( dest, format, - args ), but will not write more than n characters. - @param dest The char array to write to. - @param n Maximum number of characters to write. - @param format The formatting string. - @param args The argument list created by the va_start macro. - @return Number of characters printed. + * args ), but will not write more than n characters. + * @param dest The char array to write to. + * @param n Maximum number of characters to write. + * @param format The formatting string. + * @param args The argument list created by the va_start macro. + * @return Number of characters printed. */ int vsnprintf( char * restrict dest, size_t n, const char * restrict format, va_list ap ); -// ---------------------------------------------------------------------------- +/* ------------------------------------------------------------------------- */ /** Print ERROR. - Equivalent to fprintf( stderr, "%s: %s\n", text, strerror( errno ) ). - @param test Text to prepend the error message with. + * Equivalent to fprintf( stderr, "%s: %s\n", text, strerror( errno ) ). + * @param test Text to prepend the error message with. */ void perror( const char * text ); -// ---------------------------------------------------------------------------- +/* ------------------------------------------------------------------------- */ /** File READ. Reads a number of objects of a given size from file, and into - a memory area. - @param dest The memory area to write into. - @param size The size of one object. - @param n The number of objects to read. - @param fh The file handle. - @return The number of objects successfully read. + * a memory area. + * @param dest The memory area to write into. + * @param size The size of one object. + * @param n The number of objects to read. + * @param fh The file handle. + * @return The number of objects successfully read. */ size_t fread( void * restrict dest, size_t size, size_t n, FILE * restrict fh ); /** File WRITE. Writes a number of objects from a memory area to file. - @param src The memory area to write from. - @param size The size of a single object. - @param n The number of objects to write. - @param fh The file handle. - @return The number of objects successfully written. + * @param src The memory area to write from. + * @param size The size of a single object. + * @param n The number of objects to write. + * @param fh The file handle. + * @return The number of objects successfully written. */ size_t fwrite( const void * restrict src, size_t size, size_t n, FILE * restrict fh ); -// ---------------------------------------------------------------------------- +/* ------------------------------------------------------------------------- */ /** SET Virtual BUFfer. Sets buffering mode and (optionally) the memory used - for buffering, for a given file handle. - This function must only be called immediately after associating the file - handle with a file, before any operations are called on the file handle. - @param fh The file handle. - @param buf A pointer to the memory area to use for buffering, or NULL to - use internally assigned buffer memory. - @param mode One of _IOFBF, _IOLBF, _IONBF. - @param size Size of the memory area to be used for buffering. + * for buffering, for a given file handle. + * This function must only be called immediately after associating the file + * handle with a file, before any operations are called on the file handle. + * @param fh The file handle. + * @param buf A pointer to the memory area to use for buffering, or NULL to + * use internally assigned buffer memory. + * @param mode One of _IOFBF, _IOLBF, _IONBF. + * @param size Size of the memory area to be used for buffering. */ int setvbuf( FILE * restrict fh, char * restrict buf, int mode, size_t size ); /** SET BUFfer. Equivalent to (void) setvbuf( fh, buf, _IOFBF, BUFSIZ ), or - (void) setvbuf( fh, NULL, _IONBF, BUFSIZ ) if buf == NULL. - @param fh The file handle to be passed to setvbuf(). - @param buf The buffer pointer to be passed to setvbuf(). + * (void) setvbuf( fh, NULL, _IONBF, BUFSIZ ) if buf == NULL. + * @param fh The file handle to be passed to setvbuf(). + * @param buf The buffer pointer to be passed to setvbuf(). */ void setbuf( FILE * restrict fh, char * restrict buf ); -// ---------------------------------------------------------------------------- +/* ------------------------------------------------------------------------- */ /* PDPC code - unreviewed /* @@ -571,4 +582,4 @@ typedef struct int theirBuffer; /* Is the buffer supplied by them? */ } FILE; -#endif // __STDIO_H +#endif /* _STDIO_H */ diff --git a/includes/stdlib.h b/includes/stdlib.h index 500060c..2724dcf 100644 --- a/includes/stdlib.h +++ b/includes/stdlib.h @@ -1,29 +1,35 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// General utilities -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * General utilities + * --------------------------------------------------------------------------*/ -#ifndef __STDLIB_H -#define __STDLIB_H __STDLIB_H +#ifndef _STDLIB_H +#define _STDLIB_H _STDLIB_H -// TODO: Documentation +#ifndef _NULL +#include "__intern.h" +#endif /* _NULL */ -// ---------------------------------------------------------------------------- -// MACROS +/* TODO: Documentation */ -#include "__NULL.h" +/* ---------------------------------------------------------------------------- + * MACROS + * --------------------------------------------------------------------------*/ -#define EXIT_FAILURE // TODO -#define EXIT_SUCCESS // TODO -#define MB_CUR_MAX // TODO -#define RAND_MAX // TODO +#define NULL _NULL -// ---------------------------------------------------------------------------- -// TYPEDEFS +#define EXIT_FAILURE /* TODO */ +#define EXIT_SUCCESS /* TODO */ +#define MB_CUR_MAX /* TODO */ +#define RAND_MAX /* TODO */ + +/* ---------------------------------------------------------------------------- + * TYPEDEFS + * --------------------------------------------------------------------------*/ typedef struct { @@ -42,11 +48,19 @@ typedef struct long long remainder; } lldiv_t; -#include "__size_t.h" -#include "__wchar_t.h" +#ifndef _SIZE_T +#define _SIZE_T _SIZE_T +typedef __size_t size_t +#endif /* _SIZE_T */ + +#ifndef _WCHAR_T +#define _WCHAR_T _WCHAR_T +typedef __wchar_t wchar_t +#endif /* _WCHAR_T */ -// ---------------------------------------------------------------------------- -// FUNCTIONS +/* ---------------------------------------------------------------------------- + * FUNCTIONS + * --------------------------------------------------------------------------*/ int abs( int i ); long long llabs( long long i ); @@ -95,4 +109,4 @@ int atexit( void (*func) ( void ) ); void * bsearch( const void * key, const void * base, size_t nelem, size_t size, int (*cmp) ( const void * ck, const void * ce) ); void qsort( void * base, size_t nelem, size_t size, int (*cmp) ( const void * e1, const void * e2) ); -#endif // __STDLIB_H +#endif /* _STDLIB_H */ diff --git a/includes/string.h b/includes/string.h index e7e6921..9d2a517 100644 --- a/includes/string.h +++ b/includes/string.h @@ -1,27 +1,37 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// String handling -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * String handling + * --------------------------------------------------------------------------*/ -#ifndef __STRING_H -#define __STRING_H __STRING_H +#ifndef _STRING_H +#define _STRING_H _STRING_H -// ---------------------------------------------------------------------------- -// MACROS +#ifndef _NULL +#include "__intern.h" +#endif /* _NULL */ -#include "__NULL.h" +/* ---------------------------------------------------------------------------- + * MACROS + * --------------------------------------------------------------------------*/ -// ---------------------------------------------------------------------------- -// TYPEDEFS +#define NULL _NULL -#include "__size_t.h" +/* ---------------------------------------------------------------------------- + * TYPEDEFS + * --------------------------------------------------------------------------*/ -// ---------------------------------------------------------------------------- -// FUNCTIONS +#ifndef _SIZE_T +#define _SIZE_T _SIZE_T +typedef __size_t size_t +#endif /* _SIZE_T */ + +/* ---------------------------------------------------------------------------- + * FUNCTIONS + * --------------------------------------------------------------------------*/ /** MEMory search for CHaRacter. Searches a memory area for a character. * @param src The memory area. @@ -269,4 +279,4 @@ char * strrchr( const char * src, int c ); */ char * strstr( const char * src_1, const char * src_2 ); -#endif // __STRING_H +#endif /* _STRING_H */ diff --git a/includes/tgmath.h b/includes/tgmath.h index 3ba73b0..df1d2b8 100644 --- a/includes/tgmath.h +++ b/includes/tgmath.h @@ -1,18 +1,18 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Type-generic math -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Type-generic math + * --------------------------------------------------------------------------*/ -#ifndef __TGMATH_H -#define __TGMATH_H __TGMATH_H +#ifndef _TGMATH_H +#define _TGMATH_H _TGMATH_H -// TODO: Generics support +/* Generics, despite necessary for implementing tgmath.h, are not part of the + * C language proper; it is - to my knowledge - not possible to implement this + * header in any implementation-independent way. + */ -#include -#include - -#endif // __TGMATH_H +#endif /* _TGMATH_H */ diff --git a/includes/time.h b/includes/time.h index c527cc3..b707a31 100644 --- a/includes/time.h +++ b/includes/time.h @@ -1,35 +1,46 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Date and time -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Date and time + * --------------------------------------------------------------------------*/ -#ifndef __TIME_H -#define __TIME_H __TIME_H +#ifndef _TIME_H +#define _TIME_H _TIME_H -// TODO: Documentation. +#ifndef _NULL +#include "__intern.h" +#endif -// ---------------------------------------------------------------------------- -// MACROS +/* TODO: Documentation. */ -#include "__NULL.h" +/* ---------------------------------------------------------------------------- + * MACROS + * --------------------------------------------------------------------------*/ -#define CLOCKS_PER_SEC // TODO - personality? +#define NULL _NULL -// ---------------------------------------------------------------------------- -// TYPES +#define CLOCKS_PER_SEC /* TODO - to __intern.h / __personality.h? */ -#include "__size_t.h" -#include "__tm.h" +/* ---------------------------------------------------------------------------- + * TYPES + * --------------------------------------------------------------------------*/ -typedef clock_t; // TODO - personality? -typedef time_t; // TODO - personality? +/* TODO: Get struct tm into __intern.h */ -// ---------------------------------------------------------------------------- -// FUNCTIONS +#ifndef _SIZE_T +#define _SIZE_T _SIZE_T +typedef __size_t size_t; +#endif /* _SIZE_T */ + +typedef clock_t; /* TODO - to __intern.h / __personality.h? */ +typedef time_t; /* TODO - to __intern.h / __personality.h? */ + +/* ---------------------------------------------------------------------------- + * FUNCTIONS + * --------------------------------------------------------------------------*/ char * asctime( const struct tm * tptr ); clock_t clock( void ); @@ -42,4 +53,4 @@ size_t strftime( char * restrict s, size_t n, const char * restrict format, const struct tm * restrict tptr ); time_t time( time_t * tod ); -#endif // __TIME_H +#endif /* _TIME_H */ diff --git a/includes/wchar.h b/includes/wchar.h index 2af2155..1be74dc 100644 --- a/includes/wchar.h +++ b/includes/wchar.h @@ -1,39 +1,56 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Extended multibyte and wide character utilities -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Extended multibyte and wide character utilities + * --------------------------------------------------------------------------*/ -#ifndef __WCHAR_H -#define __WCHAR_H __WCHAR_H +#ifndef _WCHAR_H +#define _WCHAR_H _CHAR_H -// TODO: Documentation +#ifndef _NULL +#include "__intern.h" +#endif -// ---------------------------------------------------------------------------- -// MACROS +/* TODO: Documentation */ -#include "__NULL.h" -#include "__WCHAR.h" +/* ---------------------------------------------------------------------------- + * MACROS + * --------------------------------------------------------------------------*/ -#define WEOF // TODO - personality? +#define NULL _NULL +#define WCHAR_MAX _WCHAR_MAX +#define WCHAR_MIN _WCHAR_MIN +#define WEOF _WEOF -// ---------------------------------------------------------------------------- -// TYPEDEFS +/* ---------------------------------------------------------------------------- + * TYPEDEFS + * --------------------------------------------------------------------------*/ -#include "__tm.h" -#include "__size_t.h" -#include "__wchar_t.h" -#include "__wint_t.h" +/* TODO: Get struct tm into __intern.h */ -typedef mbstate_t; // TODO - personality? -typedef size_t; // TODO - personality? -typedef wint_t; // TODO - personality? +#ifndef _SIZE_T +#define _SIZE_T _SIZE_T +typedef __size_t size_t; +#endif /* _SIZE_T */ -// ---------------------------------------------------------------------------- -// FUNCTIONS +#ifndef _WCHAR_T +#define _WCHAR_T _WCHAR_T +typedef __wchar_t wchar_t; +#endif /* _WCHAR_T */ + +#ifndef _WINT_T +#define _WINT_T _WINT_T +typedef __wint_t wint_t; +#endif /* _WINT_T */ + +typedef mbstate_t; /* TODO - to __intern.h / __personality.h? */ + +/* ---------------------------------------------------------------------------- + * FUNCTIONS + * --------------------------------------------------------------------------*/ wint_t fgetwc( FILE * stream ); wchar_t * fgetws( wchar_t * restrict s, int n, FILE * restrict stream ); @@ -101,4 +118,4 @@ wchar_t * wcsrchr( const wchar_t * s, wchar_t c ); wchar_t * wcsstr( const wchar_t * s1, const wchar_t * s2 ); wchar_t * wmemchr( const wchar_t * s, wchar_t c, size_t n); -#endif // __WCHAR_H +#endif /* _WCHAR_H */ diff --git a/includes/wctype.h b/includes/wctype.h index 6401284..3b3e211 100644 --- a/includes/wctype.h +++ b/includes/wctype.h @@ -1,27 +1,37 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Wide character classification and mapping utilities -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Wide character classification and mapping utilities + * --------------------------------------------------------------------------*/ -#ifndef __WCTYPE_H -#define __WCTYPE_H __WCTYPE_H +#ifndef _WCTYPE_H +#define _WCTYPE_H _WCTYPE_H -// TODO: Documentation +#ifndef _NULL +#define _NULL _NULL +#include "__intern.h" +#endif /* _NULL */ -// ---------------------------------------------------------------------------- -// TYPEDEFS +/* TODO: Documentation */ -#include "__wint_t.h" +/* ---------------------------------------------------------------------------- + * TYPEDEFS + * --------------------------------------------------------------------------*/ -typedef wctrans_t; // TODO - personality? -typedef wctype_t; // TODO - personality? +#ifndef _WINT_T +#define _WINT_T _WINT_T +typedef __wint_t wint_t +#endif /* _WINT_T */ -// ---------------------------------------------------------------------------- -// FUNCTIONS +typedef wctrans_t; /* TODO - to __intern.h / __personality.h? */ +typedef wctype_t; /* TODO - to __intern.h / __personality.h? */ + +/* ---------------------------------------------------------------------------- + * FUNCTIONS + * --------------------------------------------------------------------------*/ int iswalnum( wint_t c ); int iswalpha( wint_t c ); @@ -44,4 +54,4 @@ wint_t towupper( wint_t c ); wctrans_t wctrans( const char * property ); wctype_t wctype( const char * property ); -#endif // __WCTYPE_H +#endif /* _WCTYPE_H */ diff --git a/personalities/__pdc_stdio.h b/personalities/__pdc_stdio.h deleted file mode 100644 index 54719ad..0000000 --- a/personalities/__pdc_stdio.h +++ /dev/null @@ -1,22 +0,0 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Input/output - personality -// ---------------------------------------------------------------------------- - -#define BUFSIZ // buffer size (see setvbuf()), >= 256 -#define FOPEN_MAX // supported number of simultaneously open files, >= 8 -#define FILENAME_MAX // supported length of filenames -#define L_tmpnam // length of filenames generated by tmpnam() including \0 -#define TMP_MAX // number of unique filenames generateable by tmpnam(), - // during a program run; >= 25 - -#define stderr // FILE * -#define stdin // FILE * -#define stdout // FILE * - -// storing return code in fh->HostRC -void __pdc_fclose( FILE * fh ); diff --git a/personalities/__personality.h b/personalities/__personality.h deleted file mode 100644 index e5da670..0000000 --- a/personalities/__personality.h +++ /dev/null @@ -1,22 +0,0 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Personality #define's (see personality.txt) -// ---------------------------------------------------------------------------- - -#ifndef __PDCLIB_PERSONALITY_H -#define __PDCLIB_PERSONALITY_H __PDCLIB_PERSONALITY_H - -// This structure is required by time.h and wchar.h. -struct tm; - -// This type is required by wchar.h and wctype.h. -typedef wint_t; - -// #undef this if environment does not support _Imaginary. -#define __PERSONALITY_SUPPORTS_IMAGINARY - -#endif // __PDCLIB_PERSONALITY_H diff --git a/personalities/float.h b/personalities/float.h deleted file mode 100644 index 2a5a836..0000000 --- a/personalities/float.h +++ /dev/null @@ -1,50 +0,0 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Characteristics of floating types -// ---------------------------------------------------------------------------- - -#ifndef __FLOAT_H -#define __FLOAT_H __FLOAT_H - -// This file is part of the platform personality (see personality.txt). - -#define FLT_RADIX // TODO -#define FLT_ROUNDS // TODO -#define FLT_EVAL_METHOD // TODO -#define DECIMAL_DIG // TODO - -#define DBL_DIG // TODO -#define DBL_EPSILON // TODO -#define DBL_MANT_DIG // TODO -#define DBL_MAX // TODO -#define DBL_MAX_10_EXP // TODO -#define DBL_MAX_EXP // TODO -#define DBL_MIN // TODO -#define DBL_MIN_10_EXP // TODO -#define DBL_MIN_EXP // TODO - -#define FLT_DIG // TODO -#define FLT_EPSILON // TODO -#define FLT_MANT_DIG // TODO -#define FLT_MAX // TODO -#define FLT_MAX_10_EXP // TODO -#define FLT_MAX_EXP // TODO -#define FLT_MIN // TODO -#define FLT_MIN_10_EXP // TODO -#define FLT_MIN_EXP // TODO - -#define LDBL_DIG // TODO -#define LDBL_EPSILON // TODO -#define LDBL_MANT_DIG // TODO -#define LDBL_MAX // TODO -#define LDBL_MAX_10_EXP // TODO -#define LDBL_MAX_EXP // TODO -#define LDBL_MIN // TODO -#define LDBL_MIN_10_EXP // TODO -#define LDBL_MIN_EXP // TODO - -#endif // __FLOAT_H diff --git a/personalities/limits.h b/personalities/limits.h deleted file mode 100644 index 7d14a93..0000000 --- a/personalities/limits.h +++ /dev/null @@ -1,55 +0,0 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Sizes of integer types -// ---------------------------------------------------------------------------- - -#ifndef __LIMITS_H -#define __LIMITS_H __LIMITS_H - -// ISO/IEC 9899:1999, ยง5.2.4.2.1 -// The values given below shall be replaced by constant expressions suitable -// for use in #if preprocessing directives. Moreover, except for CHAR_BIT and -// MB_LEN_MAX, the following shall be replaced by expressions that have the -// same type as would an expression that is an object of the corresponding type -// converted according to the integer promotions. Their implementation-defined -// values shall be equal or greater in magnitude (absolute value) to those -// shown, with the same sign. - -// This file is part of the platform personality (see personality.txt). - -// Limits of type 'char' -#define CHAR_BIT // 8 -#define CHAR_MAX // SCHAR_MAX / UCHAR_MAX -#define CHAR_MIN // SCHAR_MIN / 0 -#define SCHAR_MAX // +127 -#define SCHAR_MIN // -127 -#define UCHAR_MAX // 255 (2^CHAR_BIT - 1) - -// Multibyte characters -#define MB_LEN_MAX // 1 - -// Limits of type 'short int' -#define SHRT_MAX // +32767 -#define SHRT_MIN // -32767 -#define USHRT_MAX // 65535 - -// Limits of type 'int' -#define INT_MAX // +32767 -#define INT_MIN // -32767 -#define UINT_MAX // 65535 - -// Limits of type 'long int' -#define LONG_MAX // +2147483647 -#define LONG_MIN // -2147483647 -#define ULONG_MAX // 4294967295 - -// Limits of type 'long long int' -#define LLONG_MAX // +9223372036854775807 -#define LLONG_MIN // -9223372036854775807 -#define ULLONG_MAX // 18446744073709551615 - -#endif // __LIMITS_H diff --git a/personalities/personality.txt b/personalities/personality.txt new file mode 100644 index 0000000..d5bc2ba --- /dev/null +++ b/personalities/personality.txt @@ -0,0 +1,71 @@ +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Description of the personality concept + * --------------------------------------------------------------------------*/ + +The PDCLib is aimed at providing a fully conforming implementation of the C +standard library (ISO/IEC 9899) for diverse environments. + +To faciliate adaption to new environments, platform-specific parts of the +library have been seperated from the generic parts (e.g. the string functions, +or the parsing of format strings in stdio.h). + +The generic part is found in includes/ and functions/. It should be compilable +on any platform given a compliant compiler. + +The "personalized" part implements, for each supported environment, the non- +generic parts of the library. Each supported environment is represented by a +subdirectory (dubbed "personality module") in personalities/. Such a module +usually requires a specific compiler on a specific hardware. + +The concept of personality modules was favored over the traditional approach +of '#ifdef', 'configure', and complex makefiles, because it isolates the +environment dependencies in a limited number of files in a seperate directory, instead of spreading the dependency handling all over the code base. This +approach also minimizes dependencies on the compilation environment, so that +very minimalistic environments (which could e.g. not run a 'configure' script) +could still compile the PDCLib. + +A personality module consists of: + +* standard '#define's and 'typedef's that are environment dependent (e.g. those + defined in stdint.h and float.h); + +* "abstract" '#define's that specify whether certain optional features are + available in the environment or not (e.g. whether the environment supports + the optional '_Imaginary' keyword, required in 'complex.h'); + +* "glue code", which binds standard library functions to support functions of + the environment (e.g. the code actually allocating the memory passed out by + malloc()). + +* a (compiler-specific) solution for the type-generic math functions declared + in tgmath.h. + +In any case, it is sufficient to copy the contents of a personality module +(consisting of the subdirectories functions/ and includes/) into the main +directories of the same name. Your personalized copy of the PDCLib is now +ready to be compiled. + +/* ------------------------------------------------------------------------- */ + +ADDING A NEW ENVIRONMENT + +In the personalities/ subdirectory, you will find a module named "template". In +this module, you will find a complete description of all '#define's, 'typedef's +and glue code functions that are required to build a new personality module. + +A new personality module could be kept in our repository, or in the repository +of the environment it refers to. + +If you are an OS developer opting to use the PDCLib as your standard library, +you would be well-advised to keep the personality module in your own repository +since you have direct access there, and can make necessary changes yourself. +If you are not an OS developer, or your OS can be considered stable and active +enough to warrant its own personality module in the PDCLib repository, you are +free to submit it; but keep two things in mind: Any code contributed to this +project must be Public Domain, and any contribution must be reviewed by the +maintainers first. Please double-check your code before submitting. diff --git a/personalities/stdint.h b/personalities/stdint.h deleted file mode 100644 index d92753a..0000000 --- a/personalities/stdint.h +++ /dev/null @@ -1,138 +0,0 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Integer types -// ---------------------------------------------------------------------------- - -#ifndef __STDINT_H -#define __STDINT_H __STDINT_H - -// This file is part of the platform personality (see personality.txt). - -// TODO: Documentation - -// ---------------------------------------------------------------------------- -// TYPEDEFS - -typedef int8_t; // TODO -typedef int16_t; // TODO -typedef int32_t; // TODO -typedef int64_t; // TODO - -typedef uint8_t; // TODO -typedef uint16_t; // TODO -typedef uint32_t; // TODO -typedef uint64_t; // TODO - -typedef int_least8_t; // TODO -typedef int_least16_t; // TODO -typedef int_least32_t; // TODO -typedef int_least64_t; // TODO - -typedef uint_least8_t; // TODO -typedef uint_least16_t; // TODO -typedef uint_least32_t; // TODO -typedef uint_least64_t; // TODO - -typedef int_fast8_t; // TODO -typedef int_fast16_t; // TODO -typedef int_fast32_t; // TODO -typedef int_fast64_t; // TODO - -typedef uint_fast8_t; // TODO -typedef uint_fast16_t; // TODO -typedef uint_fast32_t; // TODO -typedef uint_fast64_t; // TODO - -typedef intptr_t; // TODO -typedef uintptr_t; // TODO - -typedef intmax_t; // TODO -typedef uintmax_t; // TODO - -// ---------------------------------------------------------------------------- -// MACROS - -#define INT8_MIN // TODO -#define INT16_MIN // TODO -#define INT32_MIN // TODO -#define INT64_MIN // TODO - -#define INT8_MAX 0x7f -#define INT16_MAX 0x7fff -#define INT32_MAX 0x7fffffff -#define INT64_MAX 0x7fffffffffffffff - -#define UINT8_MAX 0xff -#define UINT16_MAX 0xffff -#define UINT32_MAX 0xffffffff -#define UINT64_MAX 0xffffffffffffffff - -#define INT_LEAST8_MIN // TODO -#define INT_LEAST16_MIN // TODO -#define INT_LEAST32_MIN // TODO -#define INT_LEAST64_MIN // TODO - -#define INT_LEAST8_MAX // TODO -#define INT_LEAST16_MAX // TODO -#define INT_LEAST32_MAX // TODO -#define INT_LEAST64_MAX // TODO - -#define UINT_LEAST8_MAX // TODO -#define UINT_LEAST16_MAX // TODO -#define UINT_LEAST32_MAX // TODO -#define UINT_LEAST64_MAX // TODO - -#define INT_FAST8_MIN // TODO -#define INT_FAST16_MIN // TODO -#define INT_FAST32_MIN // TODO -#define INT_FAST64_MIN // TODO - -#define INT_FAST8_MAX // TODO -#define INT_FAST16_MAX // TODO -#define INT_FAST32_MAX // TODO -#define INT_FAST64_MAX // TODO - -#define UINT_FAST8_MAX // TODO -#define UINT_FAST16_MAX // TODO -#define UINT_FAST32_MAX // TODO -#define UINT_FAST64_MAX // TODO - -#define INTPTR_MIN // TODO -#define INTPTR_MAX // TODO -#define UINTPTR_MAX // TODO - -#define INT8_C(x) // TODO -#define INT16_C(x) // TODO -#define INT32_C(x) // TODO -#define INT64_C(x) // TODO - -#define UINT8_C(x) // TODO -#define UINT16_C(x) // TODO -#define UINT32_C(x) // TODO -#define UINT64_C(x) // TODO - -#define INTMAX_C(x) // TODO -#define UINTMAX_C(x) // TODO - -#define PTRDIFF_MIN // TODO -#define PTRDIFF_MAX // TODO - -#define SIG_ATOMIC_MIN // TODO -#define SIG_ATOMIC_MAX // TODO - -#define SIZE_MAX // TODO - -#define WCHAR_MIN // TODO -#define WCHAR_MAX // TODO - -#include "__WCHAR.h" - -#define INTMAX_MIN // TODO -#define INTMAX_MAX // TODO -#define UINTMAX_MAX // TODO - -#endif // __STDINT_H diff --git a/personalities/template/includes/__personality.h b/personalities/template/includes/__personality.h new file mode 100644 index 0000000..2a3cb62 --- /dev/null +++ b/personalities/template/includes/__personality.h @@ -0,0 +1,25 @@ +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Personality #define's (see personality.txt) + * --------------------------------------------------------------------------*/ + +/* No header guard - including file is expected to check this (improves + * performance) + */ + +#define _PERSONALITY + +/* This structure is required by time.h and wchar.h. */ +struct tm; + +/* This type is required by wchar.h and wctype.h. */ +typedef __wint_t; + +/* #undef this if environment does not support _Imaginary. */ +#define __PERSONALITY_SUPPORTS_IMAGINARY + +#endif /* _PERSONALITY */ diff --git a/personality.txt b/personality.txt deleted file mode 100644 index 6f35088..0000000 --- a/personality.txt +++ /dev/null @@ -1,83 +0,0 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Description of the personality concept -// ---------------------------------------------------------------------------- - -The pdclib is aimed at providing a fully conforming implementation of the C99 -standard library, with a focus on adaptability to diverse environments. - -That means, an effort was made to make this library useful to you, no matter if -you are looking for a replacement for the CLib provided by your system vendor, -for a basic CLib to develop your own operating system on / with, or for a "bare -bones" CLib to test your software against a strict "standard only" library. - -The traditional way of providing this kind of cross-platform support is the -preprocessor directive '#ifdef'. However, careless use of this feature can make -source code next to intelligible and hard to maintain. Hence, an effort was -made to encapsule such platform dependencies, by the concept of "personality -modules". - -A personality module consists of three parts: drop-ins, glue code, and the -header file "__personality.h", in an appropriately named subdirectory of -pdclib/personalities. - -// ---------------------------------------------------------------------------- -// DROP-INS - -The standard includes limits.h and stdint.h define various intrinsics of the -integer types of a platform. The standard include float.h does the same for the -floating point types. Throughout pdclib, these defines have been put to maximum -use. - -Each personality module must provide those three include files, so that pdclib -"knows" about the data type intrinsics of the platform in question. The files -are simply "dropped" into the pdclib/includes subdirectory prior to building -pdclib. - -// ---------------------------------------------------------------------------- -// GLUE CODE - -Most functions of pdclib could be implemented generically - i.e., any supported -platform uses identical source code for them. Some functions, however, interact -closely with the operating system at one point or another. pdclib implements -the "top half" of those functions, where possible. The "bottom half" has to be -provided by the operating system. - -If pdclib is used on a host OS, as replacement for a vendor-supplied CLib, the -personality module should contain the "glue code" necessary to match the OS -provided services to pdclib's top/bottom interface (see below). - -When a new operating system uses pdclib as "native" C standard library, the -documentation of the top/bottom interfaces (see below) should help in bringing -OS and pdclib together. In this case, no dedicated "glue code" is necessary. - -// ---------------------------------------------------------------------------- -// __PERSONALITY.H - -At some points within the library, information about the environment is needed -which cannot be derived from the drop-ins. In those places, "__personality.h" -is included; this file defines a couple of symbols specifying those environment -options for the personality module. A template for __personality.h can be found -in the pdclib/personalities directory. - -The symbols defined in personality.h are all named __PERSONALITY_*, with "*" -being replaced with a service or feature provded or not provided. Never is the -name of an OS, compiler, or hardware used in such symbols - later generations -of either might provide a service that older ones did not, and it is also more -self-explanatory if the symbol reads "__PERSONALITY_SUPPORTS_XYZ" instead of -"__PERSONALITY_MyOS", which basically leaves the reader clueless as to what -makes MyOS special in this case - information that might be outdated already -without anyone being the wiser. - -If a new, exotic personality is added that requires a new symbol to be added to personality.h, that symbol is always worded in a way that the old personality -modules need not be changed. The default goes without saying, so to speak. - -// ---------------------------------------------------------------------------- -// TOP/BOTTOM INTERFACE - -What follows is a documentation of the "bottom half" functions required by -pdclib, with an exact description of interface, required functionality, etc. -- 2.40.0