From: solar Date: Sun, 14 Nov 2004 13:02:28 +0000 (+0000) Subject: Removed old files. X-Git-Tag: v0.1~10 X-Git-Url: https://pd.if.org/git/?p=pdclib;a=commitdiff_plain;h=a1f747e81dad0bb9897cb11c652403bb7bbf084c Removed old files. --- diff --git a/functions/assert.c b/functions/assert.c deleted file mode 100644 index 3e887d9..0000000 --- a/functions/assert.c +++ /dev/null @@ -1,17 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $Id$ - * ---------------------------------------------------------------------------- - * Public Domain C Library - http://pdclib.sourceforge.net - * This code is Public Domain. Use, modify, and redistribute at will. - * --------------------------------------------------------------------------*/ - -#include -#include - -__assert( char const * const expression, char const * const file, - char const * const function, int const line ) -{ - fprintf(stderr, "Assertion failed: %s, function %s, file %s, line %d.\n", - expression, function, file, line ); - abort(); -} diff --git a/functions/complex/cabs.c b/functions/complex/cabs.c deleted file mode 100644 index 2d74c2c..0000000 --- a/functions/complex/cabs.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double cabsl( long double _Complex x ) { /* TODO */ }; diff --git a/functions/complex/cacos.c b/functions/complex/cacos.c deleted file mode 100644 index 9711dd3..0000000 --- a/functions/complex/cacos.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double _Complex cacosl( long double _Complex x ) { /* TODO */ }; diff --git a/functions/complex/cacosh.c b/functions/complex/cacosh.c deleted file mode 100644 index a1e00fb..0000000 --- a/functions/complex/cacosh.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double _Complex cacoshl( long double _Complex x ) { /* TODO */ }; diff --git a/functions/complex/carg.c b/functions/complex/carg.c deleted file mode 100644 index dbb707c..0000000 --- a/functions/complex/carg.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double cargl( long double _Complex x ) { /* TODO */ }; diff --git a/functions/complex/casin.c b/functions/complex/casin.c deleted file mode 100644 index af4a065..0000000 --- a/functions/complex/casin.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double _Complex casinl( long double _Complex x ) { /* TODO */ }; diff --git a/functions/complex/casinh.c b/functions/complex/casinh.c deleted file mode 100644 index 72eee57..0000000 --- a/functions/complex/casinh.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double _Complex casinhl( long double _Complex x ) { /* TODO */ }; diff --git a/functions/complex/catan.c b/functions/complex/catan.c deleted file mode 100644 index d05f9d3..0000000 --- a/functions/complex/catan.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double _Complex catanl( long double _Complex x ) { /* TODO */ }; diff --git a/functions/complex/catanh.c b/functions/complex/catanh.c deleted file mode 100644 index 7a25af2..0000000 --- a/functions/complex/catanh.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double _Complex catanhl( long double _Complex x ) { /* TODO */ }; diff --git a/functions/complex/cconj.c b/functions/complex/cconj.c deleted file mode 100644 index cb438a7..0000000 --- a/functions/complex/cconj.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double _Complex conjl( long double _Complex x ) { /* TODO */ }; diff --git a/functions/complex/ccos.c b/functions/complex/ccos.c deleted file mode 100644 index ecaee27..0000000 --- a/functions/complex/ccos.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double _Complex ccosl( long double _Complex x ) { /* TODO */ }; diff --git a/functions/complex/ccosh.c b/functions/complex/ccosh.c deleted file mode 100644 index 112aaaf..0000000 --- a/functions/complex/ccosh.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double _Complex ccoshl( long double _Complex x ) { /* TODO */ }; diff --git a/functions/complex/cexp.c b/functions/complex/cexp.c deleted file mode 100644 index 5ebf726..0000000 --- a/functions/complex/cexp.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 deleted file mode 100644 index 1a666fb..0000000 --- a/functions/complex/cimag.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double cimagl( long double _Complex x ) { /* TODO */ }; diff --git a/functions/complex/clog.c b/functions/complex/clog.c deleted file mode 100644 index 84bfb19..0000000 --- a/functions/complex/clog.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double _Complex clogl( long double _Complex x ) { /* TODO */ }; diff --git a/functions/complex/cpow.c b/functions/complex/cpow.c deleted file mode 100644 index 3f6313a..0000000 --- a/functions/complex/cpow.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double _Complex cpowl( long double _Complex x, long double _Complex y ) { /* TODO */ }; diff --git a/functions/complex/cproj.c b/functions/complex/cproj.c deleted file mode 100644 index 23f85ef..0000000 --- a/functions/complex/cproj.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double _Complex cprojl( long double _Complex x ) { /* TODO */ }; diff --git a/functions/complex/creal.c b/functions/complex/creal.c deleted file mode 100644 index 2e532b1..0000000 --- a/functions/complex/creal.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double creall( long double _Complex x ) { /* TODO */ }; diff --git a/functions/complex/csin.c b/functions/complex/csin.c deleted file mode 100644 index e4b30f1..0000000 --- a/functions/complex/csin.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double _Complex csinl( long double _Complex x ) { /* TODO */ }; diff --git a/functions/complex/csinh.c b/functions/complex/csinh.c deleted file mode 100644 index f120593..0000000 --- a/functions/complex/csinh.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double _Complex csinhl( long double _Complex x ) { /* TODO */ }; diff --git a/functions/complex/csqrt.c b/functions/complex/csqrt.c deleted file mode 100644 index f9fa89c..0000000 --- a/functions/complex/csqrt.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double _Complex csqrtl( long double _Complex x ) { /* TODO */ }; diff --git a/functions/complex/ctan.c b/functions/complex/ctan.c deleted file mode 100644 index 958fba3..0000000 --- a/functions/complex/ctan.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double _Complex ctanl( long double _Complex x ) { /* TODO */ }; diff --git a/functions/complex/ctanh.c b/functions/complex/ctanh.c deleted file mode 100644 index c12611f..0000000 --- a/functions/complex/ctanh.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double _Complex ctanhl( long double _Complex x ) { /* TODO */ }; diff --git a/functions/ctype.c b/functions/ctype.c deleted file mode 100644 index 390e39b..0000000 --- a/functions/ctype.c +++ /dev/null @@ -1,21 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -int isblank( int c ) { /* TODO */ }; -int iscntrl( int c ) { /* TODO */ }; -int isdigit( int c ) { /* TODO */ }; -int isgraph( int c ) { /* TODO */ }; -int islower( int c ) { /* TODO */ }; -int isprint( int c ) { /* TODO */ }; -int ispunct( int c ) { /* TODO */ }; -int isspace( int c ) { /* TODO */ }; -int isupper( int c ) { /* TODO */ }; -int isxdigit( int c ) { /* TODO */ }; -int tolower( int c ) { /* TODO */ }; -int toupper( int c ) { /* TODO */ }; diff --git a/functions/errno.c b/functions/errno.c deleted file mode 100644 index 843c8a9..0000000 --- a/functions/errno.c +++ /dev/null @@ -1,8 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $Id$ - * ---------------------------------------------------------------------------- - * Public Domain C Library - http://pdclib.sourceforge.net - * This code is Public Domain. Use, modify, and redistribute at will. - * --------------------------------------------------------------------------*/ - -int errno = 0; diff --git a/functions/fenv.c b/functions/fenv.c deleted file mode 100644 index 592bee2..0000000 --- a/functions/fenv.c +++ /dev/null @@ -1,20 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -int feraiseexcept( int exceptions ) { /* TODO */ }; -int fesetexceptflag( const fexcept_t * flags, int exceptions ) { /* TODO */ }; -int fetestexcept( int exceptions ) { /* TODO */ }; - -int fegetround( void ) { /* TODO */ }; -int fesetround( int mode ) { /* TODO */ }; - -int fegetenv( fenv_t * environment ) { /* TODO */ }; -int feholdexcept( fenv_t * environment ) { /* TODO */ }; -int fesetenv( const fenv_t * environment ) { /* TODO */ }; -int feupdateenv( const fenv_t * environment ) { /* TODO */ }; diff --git a/functions/inttypes.c b/functions/inttypes.c deleted file mode 100644 index c223a2e..0000000 --- a/functions/inttypes.c +++ /dev/null @@ -1,14 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -intmax_t strtoimax( const char * restrict s, char * * restrict endptr, int base ) { /* TODO */ }; -uintmax_t strtoumax( const char * restrict s, char * * restrict endptr, int base ) { /* TODO */ }; -intmax_t wcstoimax( const wchar_t * restrict s, wchar_t * * restrict endptr, int base ) { /* TODO */ }; -uintmax_t wcstoumax( const wchar_t * restrict s, wchar_t * * restrict endptr, int base ) { /* TODO */ }; diff --git a/functions/locale.c b/functions/locale.c deleted file mode 100644 index a0eec02..0000000 --- a/functions/locale.c +++ /dev/null @@ -1,58 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 = { - ".", - "", - "", - "", - "", - "", - "", - "", - "", - "", - CHAR_MAX, - CHAR_MAX, - CHAR_MAX, - CHAR_MAX, - CHAR_MAX, - CHAR_MAX, - CHAR_MAX, - CHAR_MAX -}; -*/ - -char * setlocale( int categories, const char * locale_name ) { /* TODO */ }; - -/* PDPC code - unreviewed -{ - (void)category; - if (locale == NULL) - { - return ("C"); - } - else if ((strcmp(locale, "C") == 0) - || (strcmp(locale, "") == 0)) - { - return ("C"); - } - else - { - return (NULL); - } -} -*/ - -struct lconv * localeconv( void ) { /* TODO */ }; - -/* PDPC code - unreviewed -{ - return (&thislocale); -} -*/ diff --git a/functions/math/abs.c b/functions/math/abs.c deleted file mode 100644 index 0dae242..0000000 --- a/functions/math/abs.c +++ /dev/null @@ -1,31 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* Therx code -{ - return ( x < 0 ) ? -x : x; -} -*/ - -/* PDPC code - unreviewed -{ - if (x < 0.0) - { - x = -x; - } - return (x); -} -*/ - -float fabsf( float x ) { /* TODO */ }; -long double fabsl( long double x ) { /* TODO */ }; - -int abs( int i ) { /* TODO */ }; -long long llabs( long long i ) { /* TODO */ }; -long labs( long i ) { /* TODO */ }; diff --git a/functions/math/acos.c b/functions/math/acos.c deleted file mode 100644 index 2661849..0000000 --- a/functions/math/acos.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double acosl( long double x ) { /* TODO */ }; diff --git a/functions/math/acosh.c b/functions/math/acosh.c deleted file mode 100644 index d988aee..0000000 --- a/functions/math/acosh.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double acoshl( long double x ) { /* TODO */ }; diff --git a/functions/math/asin.c b/functions/math/asin.c deleted file mode 100644 index 6807ced..0000000 --- a/functions/math/asin.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double asinl( long double x ) { /* TODO */ }; diff --git a/functions/math/asinh.c b/functions/math/asinh.c deleted file mode 100644 index 7674db6..0000000 --- a/functions/math/asinh.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double asinhl( long double x ) { /* TODO */ }; diff --git a/functions/math/atan.c b/functions/math/atan.c deleted file mode 100644 index 9798f61..0000000 --- a/functions/math/atan.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double atanl( long double x ) { /* TODO */ }; diff --git a/functions/math/atan2.c b/functions/math/atan2.c deleted file mode 100644 index 7ceb789..0000000 --- a/functions/math/atan2.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double atan2l( long double y, long double x ) { /* TODO */ }; diff --git a/functions/math/atanh.c b/functions/math/atanh.c deleted file mode 100644 index 4566dab..0000000 --- a/functions/math/atanh.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double atanhl( long double x ) { /* TODO */ }; diff --git a/functions/math/cbrt.c b/functions/math/cbrt.c deleted file mode 100644 index 12fc59e..0000000 --- a/functions/math/cbrt.c +++ /dev/null @@ -1,23 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* Therx code -{ - double i = x / 4; - // (15 DP) HOW GET MORE? - while ( ( fabs( i - ( x / i / i ) ) / i ) > 0.00000000000001 ) - { - i = ( i + ( x / i / i ) + i ) / 3; - } - return i; -} -*/ - -float cbrtf( float x ) { /* TODO */ }; -long double cbrtl( long double x ) { /* TODO */ }; diff --git a/functions/math/ceil.c b/functions/math/ceil.c deleted file mode 100644 index 4c1e7bd..0000000 --- a/functions/math/ceil.c +++ /dev/null @@ -1,30 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* Therx code -{ - return ( x < 0 ) ? (int) x : ( (int) x ) + 1; -} -*/ - -/* PDPC code - unreviewed -{ - int y; - - y = (int)x; - if ((double)y < x) - { - y++; - } - return ((double)y); -} -*/ - -float ceilf( float x ) { /* TODO */ }; -long double ceill( long double x ) { /* TODO */ }; diff --git a/functions/math/copysign.c b/functions/math/copysign.c deleted file mode 100644 index 98622f4..0000000 --- a/functions/math/copysign.c +++ /dev/null @@ -1,23 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* Own code -{ - if ( y < 0 ) - { - return ( x < 0 ) ? x : -x; - } - else - { - return ( x < 0 ) ? -x : x; - } -} - -float copysignf( float x, float y ) { /* TODO */ }; -long double copysignl( long double x, long double y ) { /* TODO */ }; diff --git a/functions/math/cos.c b/functions/math/cos.c deleted file mode 100644 index 333e114..0000000 --- a/functions/math/cos.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double cosl( long double x ) { /* TODO */ }; diff --git a/functions/math/cosh.c b/functions/math/cosh.c deleted file mode 100644 index b81ca1f..0000000 --- a/functions/math/cosh.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double coshl( long double x ) { /* TODO */ }; diff --git a/functions/math/erf.c b/functions/math/erf.c deleted file mode 100644 index bdda8dd..0000000 --- a/functions/math/erf.c +++ /dev/null @@ -1,14 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double erfl( long double x ) { /* TODO */ }; - -double erfc( double x ) { /* TODO */ }; -float erfcf( float x ) { /* TODO */ }; -long double erfcl( long double x ) { /* TODO */ }; diff --git a/functions/math/exp.c b/functions/math/exp.c deleted file mode 100644 index 37033d2..0000000 --- a/functions/math/exp.c +++ /dev/null @@ -1,38 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double expl( long double x ) { /* TODO */ }; - -double exp2( double x ) { /* TODO */ }; - -/* Therx code -{ - double value = 1; - for( int i = 1; i <= x; i++ ) - { - value *= 2; - } - return value; -} -*/ - -float exp2f( float x ) { /* TODO */ }; -long double exp2l( long double x ) { /* TODO */ }; - -double expm1( double x ) { /* TODO */ }; -float expm1f( float x ) { /* TODO */ }; -long double expm1l( long double x ) { /* TODO */ }; - -double frexp( double x, int * exp ) { /* TODO */ }; -float frexpf( float x, int * exp ) { /* TODO */ }; -long double frexpl( long double x, int * exp ) { /* TODO */ }; - -double ldexp( double x, int exp ) { /* TODO */ }; -float ldexpf( float x, int exp ) { /* TODO */ }; -long double ldexpl( long double x, int exp ) { /* TODO */ }; diff --git a/functions/math/fdim.c b/functions/math/fdim.c deleted file mode 100644 index 5956e5f..0000000 --- a/functions/math/fdim.c +++ /dev/null @@ -1,17 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* Therx code -{ - return ( ( x - y ) < 1 ) ? 0 : x - y; -} -*/ - -float fdimf( float x, float y ) { /* TODO */ }; -long double fdiml( long double x, long double y ) { /* TODO */ }; diff --git a/functions/math/floor.c b/functions/math/floor.c deleted file mode 100644 index 7d62107..0000000 --- a/functions/math/floor.c +++ /dev/null @@ -1,37 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* Therx code -{ - return ( x > 0 ) ? (int) x : (int) ( x - 0.9999999999999999 ); -} -*/ - -/* PDPC code - unreviewed -{ - int y; - - if (x < 0.0) - { - y = (int)fabs(x); - if ((double)y != x) - { - y--; - } - } - else - { - y = (int)x; - } - return ((double)x); -} -*/ - -float floorf( float x ) { /* TODO */ }; -long double floorl( long double x ) { /* TODO */ }; diff --git a/functions/math/fma.c b/functions/math/fma.c deleted file mode 100644 index dbfec2a..0000000 --- a/functions/math/fma.c +++ /dev/null @@ -1,17 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* Therx code -{ - return (int) ( ( x * y ) + z + 0.5 ); -} -*/ - -float fmaf( float x, float y, float z ) { /* TODO */ }; -long double fmal( long double x, long double y, long double z ) { /* TODO */ }; diff --git a/functions/math/fmax.c b/functions/math/fmax.c deleted file mode 100644 index ecbfce3..0000000 --- a/functions/math/fmax.c +++ /dev/null @@ -1,17 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* Therx code -{ - return ( x > y ) ? x : y; -} -*/ - -float fmaxf( float x, float y ) { /* TODO */ }; -long double fmaxl( long double x, long double y ) { /* TODO */ }; diff --git a/functions/math/fmin.c b/functions/math/fmin.c deleted file mode 100644 index 3ba9b29..0000000 --- a/functions/math/fmin.c +++ /dev/null @@ -1,17 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* Therx code -{ - return ( x < y ) ? x : y; -} -*/ - -float fminf( float x, float y ) { /* TODO */ }; -long double fminl( long double x, long double y ) { /* TODO */ }; diff --git a/functions/math/gamma.c b/functions/math/gamma.c deleted file mode 100644 index a9dab9d..0000000 --- a/functions/math/gamma.c +++ /dev/null @@ -1,14 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double lgammal( long double x ) { /* TODO */ }; - -double tgamma( double x ) { /* TODO */ }; -float tgammaf( float x ) { /* TODO */ }; -long double tgammal( long double x ) { /* TODO */ }; diff --git a/functions/math/hypot.c b/functions/math/hypot.c deleted file mode 100644 index 83dc672..0000000 --- a/functions/math/hypot.c +++ /dev/null @@ -1,17 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* Therx code -{ - return sqrt( x * x + y * y ); -} -*/ - -float hypotf( float x, float y ) { /* TODO */ }; -long double hypotl( long double x, long double y ) { /* TODO */ }; diff --git a/functions/math/log.c b/functions/math/log.c deleted file mode 100644 index 34712a5..0000000 --- a/functions/math/log.c +++ /dev/null @@ -1,30 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double logl( long double x ) { /* TODO */ }; - -double log10( double x ) { /* TODO */ }; -float log10f( float x ) { /* TODO */ }; -long double log10l( long double x ) { /* TODO */ }; - -double log2( double x ) { /* TODO */ }; -float log2f( float x ) { /* TODO */ }; -long double log2l( long double x ) { /* TODO */ }; - -double logb( double x ) { /* TODO */ }; -float logbf( float x ) { /* TODO */ }; -long double logbl( long double x ) { /* TODO */ }; - -int ilogb( double x ) { /* TODO */ }; -int ilogbf( float x ) { /* TODO */ }; -int ilogbl( long double x ) { /* TODO */ }; - -double log1p( double x ) { /* TODO */ }; -float log1pf( float x ) { /* TODO */ }; -long double log1pl( long double x ) { /* TODO */ }; diff --git a/functions/math/mod.c b/functions/math/mod.c deleted file mode 100644 index 468f2c4..0000000 --- a/functions/math/mod.c +++ /dev/null @@ -1,27 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* Therx code -{ - return (int) ( ( ( ( x / y ) - ( (int) ( x / y ) ) ) * y ) + 0.5 ); -} -*/ - -/* PDPC code - unreviewed -{ - return (x / y); -} -*/ - -float fmodf( float x, float y ) { /* TODO */ }; -long double fmodl( long double x, long double y ) { /* TODO */ }; - -double modf( double x, double * integer ) { /* TODO */ }; -float modff( float x, float * integer ) { /* TODO */ }; -long double modfl( long double x, long double * integer ) { /* TODO */ }; diff --git a/functions/math/nan.c b/functions/math/nan.c deleted file mode 100644 index f13aefd..0000000 --- a/functions/math/nan.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double nanl( const char *str ) { /* TODO */ }; diff --git a/functions/math/nearbyint.c b/functions/math/nearbyint.c deleted file mode 100644 index 3937dbe..0000000 --- a/functions/math/nearbyint.c +++ /dev/null @@ -1,17 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* Therx code -{ - return round( x ); -} -*/ - -float nearbyintf( float x ) { /* TODO */ }; -long double nearbyintl( long double x ) { /* TODO */ }; diff --git a/functions/math/nextafter.c b/functions/math/nextafter.c deleted file mode 100644 index 5b5eceb..0000000 --- a/functions/math/nextafter.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double nextafterl( long double x, long double y ) { /* TODO */ }; diff --git a/functions/math/nexttoward.c b/functions/math/nexttoward.c deleted file mode 100644 index 2f4ef29..0000000 --- a/functions/math/nexttoward.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double nexttowardl( long double x, long double y ) { /* TODO */ }; diff --git a/functions/math/pow.c b/functions/math/pow.c deleted file mode 100644 index 776b46f..0000000 --- a/functions/math/pow.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double powl( long double x, long double y ) { /* TODO */ }; diff --git a/functions/math/remainder.c b/functions/math/remainder.c deleted file mode 100644 index 170cae2..0000000 --- a/functions/math/remainder.c +++ /dev/null @@ -1,17 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* Therx code -{ - return fmod( x, y ); -} -*/ - -float remainderf( float x, float y ) { /* TODO */ }; -long double remainderl( long double x, long double y ) { /* TODO */ }; diff --git a/functions/math/remquo.c b/functions/math/remquo.c deleted file mode 100644 index a11e356..0000000 --- a/functions/math/remquo.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double remquol( long double x, long double y, int * pquo ) { /* TODO */ }; diff --git a/functions/math/rint.c b/functions/math/rint.c deleted file mode 100644 index 1c7fe3d..0000000 --- a/functions/math/rint.c +++ /dev/null @@ -1,23 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long long llrintl( long double x ) { /* TODO */ }; -long lrint( double x ) { /* TODO */ }; -long lrintf( float x ) { /* TODO */ }; -long lrintl( long double x ) { /* TODO */ }; -double rint( double x ) { /* TODO */ }; - -/* Therx code -{ - return round( x ); -} -*/ - -float rintf( float x ) { /* TODO */ }; -long double rintl( long double x ) { /* TODO */ }; diff --git a/functions/math/round.c b/functions/math/round.c deleted file mode 100644 index d5a052b..0000000 --- a/functions/math/round.c +++ /dev/null @@ -1,23 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long long llroundl( long double x ) { /* TODO */ }; -long lround( double x ) { /* TODO */ }; -long lroundf( float x ) { /* TODO */ }; -long lroundl( long double x ) { /* TODO */ }; -double round( double x ) { /* TODO */ }; - -/* Therx code -{ - return (int) ( x + 0.5 ); -} -*/ - -float roundf( float x ) { /* TODO */ }; -long double roundl( long double x ) { /* TODO */ }; diff --git a/functions/math/scalbn.c b/functions/math/scalbn.c deleted file mode 100644 index cfcd5e2..0000000 --- a/functions/math/scalbn.c +++ /dev/null @@ -1,14 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double scalbnl( long double x, int ex ) { /* TODO */ }; - -double scalbln( double x, long ex ) { /* TODO */ }; -float scalblnf( float x, long ex ) { /* TODO */ }; -long double scalblnl( long double x, long ex ) { /* TODO */ }; diff --git a/functions/math/sin.c b/functions/math/sin.c deleted file mode 100644 index 98a2318..0000000 --- a/functions/math/sin.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double sinl( long double x ) { /* TODO */ }; diff --git a/functions/math/sinh.c b/functions/math/sinh.c deleted file mode 100644 index 3a0ef4c..0000000 --- a/functions/math/sinh.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double sinhl( long double x ) { /* TODO */ }; diff --git a/functions/math/sqrt.c b/functions/math/sqrt.c deleted file mode 100644 index 802f4ce..0000000 --- a/functions/math/sqrt.c +++ /dev/null @@ -1,27 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* Therx code -{ - double i = x / 2; - if ( x < 0 ) - { - return 0; - } - // (15 DP) HOW GET MORE? - while ( ( fabs( i - ( x / i ) ) / i ) > 0.000000000000001) - { - i = ( i + ( x / i ) ) / 2; - } - return i; -} -*/ - -float sqrtf( float x ) { /* TODO */ }; -long double sqrtl( long double x ) { /* TODO */ }; diff --git a/functions/math/tan.c b/functions/math/tan.c deleted file mode 100644 index 4d2dc4e..0000000 --- a/functions/math/tan.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double tanl( long double x ) { /* TODO */ }; diff --git a/functions/math/tanh.c b/functions/math/tanh.c deleted file mode 100644 index 02bb494..0000000 --- a/functions/math/tanh.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long double tanhl( long double x ) { /* TODO */ }; diff --git a/functions/math/trunc.c b/functions/math/trunc.c deleted file mode 100644 index 752afc0..0000000 --- a/functions/math/trunc.c +++ /dev/null @@ -1,17 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* Therx code -{ - return (int) x; -} -*/ - -float truncf( float x ) { /* TODO */ }; -long double truncl( long double x ) { /* TODO */ }; diff --git a/functions/setjmp.c b/functions/setjmp.c deleted file mode 100644 index 3913420..0000000 --- a/functions/setjmp.c +++ /dev/null @@ -1,9 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; diff --git a/functions/signal.c b/functions/signal.c deleted file mode 100644 index b9da182..0000000 --- a/functions/signal.c +++ /dev/null @@ -1,67 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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) = { - __sigdfl, - __sigdfl, - __sigdfl, - __sigdfl, - __sigdfl, - __sigdfl }; - -void __sigdfl(int sig) -{ - handlers[sig] = SIG_DFL; - if (sig == SIGABRT) - { - exit(EXIT_FAILURE); - } - return; -} - -void __sigerr(int sig) -{ - (void)sig; - return; -} - -void __sigign(int sig) -{ - (void)sig; - return; -} - -#define SIG_DFL __sigdfl -#define SIG_ERR __sigerr -#define SIG_IGN __sigign - -#define SIGABRT 1 -#define SIGFPE 2 -#define SIGILL 3 -#define SIGINT 4 -#define SIGSEGV 5 -#define SIGTERM 6 -*/ - -int raise( int sig ) { /* TODO */ }; - -/* PDPC code - unreviewed -{ - (handlers[sig])(sig); - return (0); -} -*/ - -void ( * signal( int sig, void ( *func )( int ) ) ) ( int ) { /* TODO */ }; - -/* PDPC code - unreviewed -{ - handlers[sig] = func; - return (func); -} -*/ diff --git a/functions/stdio/clearerr.c b/functions/stdio/clearerr.c deleted file mode 100644 index 28a042d..0000000 --- a/functions/stdio/clearerr.c +++ /dev/null @@ -1,18 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 -#include <__FILE.h> -#endif // __FILE_H - -void clearerr( FILE * fh ) -{ - fh->ErrorIndicator = 0; - fh->EOFIndicator = 0; - return; -} diff --git a/functions/stdio/fclose.c b/functions/stdio/fclose.c deleted file mode 100644 index f672fb0..0000000 --- a/functions/stdio/fclose.c +++ /dev/null @@ -1,43 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed. -Read the note in fopen.c. -int fclose(FILE *stream) -{ -#ifdef __OS2__ - APIRET rc; -#endif - - fflush(stream); -#ifdef __OS2__ - rc = DosClose(stream->hfile); -#endif -#ifdef __MSDOS__ - __close(stream->hfile); -#endif -#ifdef __MVS__ - __aclose(stream->hfile); -#endif - __userFiles[stream->intFno] = NULL; - if (!stream->theirBuffer) - { - free(stream->intBuffer); - } - free(stream); -#ifdef __OS2__ - if (rc != 0) - { - errno = rc; - return (EOF); - } -#endif - return (0); -} -*/ diff --git a/functions/stdio/feof.c b/functions/stdio/feof.c deleted file mode 100644 index dab3b7e..0000000 --- a/functions/stdio/feof.c +++ /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. - * --------------------------------------------------------------------------*/ - -#ifndef __FILE_H -#define __FILE_H __FILE_H -#include <__FILE.h> -#endif // __FILE_H - -int feof( FILE * fh ) -{ - return fh->EOFIndicator; -} diff --git a/functions/stdio/ferror.c b/functions/stdio/ferror.c deleted file mode 100644 index cf11f4c..0000000 --- a/functions/stdio/ferror.c +++ /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. - * --------------------------------------------------------------------------*/ - -#ifndef __FILE_H -#define __FILE_H __FILE_H -#include <__FILE.h> -#endif // __FILE_H - -int ferror( FILE * fh ) -{ - return fh->ErrorIndicator; -} diff --git a/functions/stdio/fflush.c b/functions/stdio/fflush.c deleted file mode 100644 index 137fd49..0000000 --- a/functions/stdio/fflush.c +++ /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. - * --------------------------------------------------------------------------*/ - -int fflush( FILE * stream ) { /* TODO */ }; - -/* PDPC code - unreviewed -Read the note in fopen.c. -{ -#ifdef __OS2__ - APIRET rc; - ULONG actualWritten; -#endif -#ifdef __MSDOS__ - int errind; - size_t actualWritten; -#endif - - if ((stream->upto != stream->fbuf) && (stream->mode == __WRITE_MODE)) - { -#ifdef __OS2__ - rc = DosWrite(stream->hfile, - (VOID *)stream->fbuf, - (size_t)(stream->upto - stream->fbuf), - &actualWritten); - if (rc != 0) - { - stream->errorInd = 1; - errno = rc; - return (EOF); - } -#endif -#ifdef __MSDOS__ - actualWritten = __write(stream->hfile, - stream->fbuf, - (size_t)(stream->upto - stream->fbuf), - &errind); - if (errind) - { - stream->errorInd = 1; - errno = actualWritten; - return (EOF); - } -#endif -#ifndef __MVS__ - stream->bufStartR += actualWritten; - stream->upto = stream->fbuf; -#endif - } - return (0); -} -*/ diff --git a/functions/stdio/fgetc.c b/functions/stdio/fgetc.c deleted file mode 100644 index ba7f8ff..0000000 --- a/functions/stdio/fgetc.c +++ /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. - * --------------------------------------------------------------------------*/ - -int fgetc( FILE * stream ) { /* TODO */ }; - -/* PDPC code - unreviewed -{ - unsigned char x[1]; - size_t ret; - - ret = fread(x, 1, 1, stream); - if (ret == 0) - { - return (EOF); - } - return ((int)x[0]); -} -*/ diff --git a/functions/stdio/fgetpos.c b/functions/stdio/fgetpos.c deleted file mode 100644 index df80ccc..0000000 --- a/functions/stdio/fgetpos.c +++ /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. - * --------------------------------------------------------------------------*/ - -int fgetpos( FILE * restrict stream, fpos_t * restrict pos ) { /* TODO */ }; - -/* PDPC code - unreviewed -{ - *pos = ftell(stream); - return (0); -} -*/ diff --git a/functions/stdio/fgets.c b/functions/stdio/fgets.c deleted file mode 100644 index 638bcdd..0000000 --- a/functions/stdio/fgets.c +++ /dev/null @@ -1,300 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -/* - -In fgets, we have the following possibilites... - -1. we found a genuine '\n' that terminated the search. -2. we hit the '\n' at the endbuf. -3. we hit the '\n' sentinel. - -*/ -#ifndef __MVS__ -char *fgets(char *s, int n, FILE *stream) -{ - char *p; - register char *t; - register char *u = s; - int c; - int processed; -#ifdef __OS2__ - ULONG actualRead; - APIRET rc; -#endif -#ifdef __MSDOS__ - size_t actualRead; - int errind; -#endif - - if (stream->quickText) - { - p = stream->upto + n - 1; - t = stream->upto; - if (p < stream->endbuf) - { - c = *p; - *p = '\n'; -#ifdef __OS2__ - if (n < 8) - { -#endif - while ((*u++ = *t++) != '\n') ; /* tight inner loop */ -#ifdef __OS2__ - } - else - { - register unsigned int *i1; - register unsigned int *i2; - register unsigned int z; - - i1 = (unsigned int *)t; - i2 = (unsigned int *)u; - while (1) - { - z = *i1; - if ((z & 0xffU) == '\n') break; - z >>= 8; - if ((z & 0xffU) == '\n') break; - z >>= 8; - if ((z & 0xffU) == '\n') break; - z >>= 8; - if ((z & 0xffU) == '\n') break; - *i2++ = *i1++; - } - t = (char *)i1; - u = (char *)i2; - while ((*u++ = *t++) != '\n') ; - } -#endif - *p = (char)c; - if (t <= p) - { - if (*(t - 2) == '\r') /* t is protected, u isn't */ - { - *(u - 2) = '\n'; - *(u - 1) = '\0'; - } - else - { - *u = '\0'; - } - stream->upto = t; - return (s); - } - else - { - processed = (int)(t - stream->upto) - 1; - stream->upto = t - 1; - u--; - } - } - else - { - while ((*u++ = *t++) != '\n') ; /* tight inner loop */ - if (t <= stream->endbuf) - { - if (*(t - 2) == '\r') /* t is protected, u isn't */ - { - *(u - 2) = '\n'; - *(u - 1) = '\0'; - } - else - { - *u = '\0'; - } - stream->upto = t; - return (s); - } - else - { - processed = (int)(t - stream->upto) - 1; - stream->upto = t - 1; - u--; - } - } - } - else - { - processed = 0; - } - - if (n < 1) - { - return (NULL); - } - if (n < 2) - { - *u = '\0'; - return (s); - } - if (stream->ungetCh != -1) - { - processed++; - *u++ = (char)stream->ungetCh; - stream->ungetCh = -1; - } - while (1) - { - t = stream->upto; - p = stream->upto + (n - processed) - 1; - if (p < stream->endbuf) - { - c = *p; - *p = '\n'; - } - if (stream->noNl) - { - while (((*u++ = *t) != '\n') && (*t++ != '\r')) ; - if (*(u - 1) == '\n') - { - t++; - } - else - { - u--; - while ((*u++ = *t++) != '\n') ; - } - } - else - { - while ((*u++ = *t++) != '\n') ; /* tight inner loop */ - } - if (p < stream->endbuf) - { - *p = (char)c; - } - if (((t <= p) && (p < stream->endbuf)) - || ((t <= stream->endbuf) && (p >= stream->endbuf))) - { - if (stream->textMode) - { - if (stream->noNl) - { - if ((*(t - 1) == '\r') || (*(t - 1) == '\n')) - { - *(u - 1) = '\0'; - } - else - { - *u = '\0'; - } - } - else if (*(t - 2) == '\r') /* t is protected, u isn't */ - { - *(u - 2) = '\n'; - *(u - 1) = '\0'; - } - else - { - *u = '\0'; - } - } - stream->upto = t; - if (stream->textMode) - { - stream->quickText = 1; - } - return (s); - } - else if (((t > p) && (p < stream->endbuf)) - || ((t > stream->endbuf) && (p >= stream->endbuf))) - { - int leave = 1; - - if (stream->textMode) - { - if (t > stream->endbuf) - { - if ((t - stream->upto) > 1) - { - if (*(t - 2) == '\r') /* t is protected, u isn't */ - { - processed -= 1; /* preparation for add */ - } - } - leave = 0; - } - else - { - if ((*(t - 2) == '\r') && (*(t - 1) == '\n')) - { - *(u - 2) = '\n'; - *(u - 1) = '\0'; - } - else - { - t--; - *(u - 1) = '\0'; - } - } - } - else if (t > stream->endbuf) - { - leave = 0; - } - else - { - *u = '\0'; - } - if (leave) - { - stream->upto = t; - if (stream->textMode) - { - stream->quickText = 1; - } - return (s); - } - } - processed += (int)(t - stream->upto) - 1; - u--; - stream->bufStartR += (stream->endbuf - stream->fbuf); -#ifdef __OS2__ - rc = DosRead(stream->hfile, stream->fbuf, stream->szfbuf, &actualRead); - if (rc != 0) - { - actualRead = 0; - stream->errorInd = 1; - errno = rc; - } -#endif -#ifdef __MSDOS__ - actualRead = __read(stream->hfile, - stream->fbuf, - stream->szfbuf, - &errind); - if (errind) - { - errno = actualRead; - actualRead = 0; - stream->errorInd = 1; - } -#endif - stream->endbuf = stream->fbuf + actualRead; - *stream->endbuf = '\n'; - if (actualRead == 0) - { - *u = '\0'; - if ((u - s) <= 1) - { - stream->eofInd = 1; - return (NULL); - } - else - { - return (s); - } - } - stream->upto = stream->fbuf; - } -} -#endif -*/ diff --git a/functions/stdio/fopen.c b/functions/stdio/fopen.c deleted file mode 100644 index b088a4a..0000000 --- a/functions/stdio/fopen.c +++ /dev/null @@ -1,399 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed, verbatim. -NOTE THAT PDPC WAS MEANT TO RUN ON A HOST OS. -I thought the approach to "osfopen()" was close enough to what we have in mind -for pdclib to include the code here. - -{ - fnm = filename; - modus = mode; - err = 0; - findSpareSpot(); - if (!err) - { - myfile = malloc(sizeof(FILE)); - if (myfile == NULL) - { - err = 1; - } - else - { - fopen2(); - if (err) - { - free(myfile); - } - } - } - if (err) - { - myfile = NULL; - } - return (myfile); -} - -static void fopen2(void) -{ - checkMode(); - if (!err) - { - osfopen(); - if (!err) - { - __userFiles[spareSpot] = myfile; - myfile->intFno = spareSpot; - fopen3(); - } - } - return; -} - -static void fopen3(void) -{ - myfile->intBuffer = malloc(BUFSIZ + 8); - if (myfile->intBuffer == NULL) - { - err = 1; - } - else - { - myfile->theirBuffer = 0; - myfile->fbuf = myfile->intBuffer + 2; - *myfile->fbuf++ = '\0'; - *myfile->fbuf++ = '\0'; - myfile->szfbuf = BUFSIZ; -#ifndef __MVS__ - myfile->quickText = 0; -#endif - myfile->noNl = 0; - myfile->endbuf = myfile->fbuf + myfile->szfbuf; - *myfile->endbuf = '\n'; -#ifdef __MVS__ - myfile->upto = myfile->fbuf; - myfile->szfbuf = myfile->lrecl; -#else - myfile->upto = myfile->endbuf; -#endif - myfile->bufStartR = -(long)myfile->szfbuf; - myfile->errorInd = 0; - myfile->eofInd = 0; - myfile->ungetCh = -1; - myfile->update = 0; -#ifndef __MVS__ - if (!myfile->textMode) - { - myfile->quickBin = 1; - } - else - { - myfile->quickBin = 0; - } -#endif - myfile->mode = __READ_MODE; - switch (modeType) - { - case 2: - case 3: - case 5: - case 6: - case 8: - case 9: - case 11: - case 12: - myfile->bufStartR = 0; - myfile->upto = myfile->fbuf; - myfile->mode = __WRITE_MODE; - break; - } - switch (modeType) - { - case 7: - case 8: - case 10: - case 11: - case 12: - myfile->update = 1; - break; - } - } - return; -} - -static void findSpareSpot(void) -{ - int x; - - for (x = 0; x < __NFILE; x++) - { - if (__userFiles[x] == NULL) - { - break; - } - } - if (x == __NFILE) - { - err = 1; - } - else - { - spareSpot = x; - } - return; -} - -/* checkMode - interpret mode string */ -/* r = 1 */ -/* w = 2 */ -/* a = 3 */ -/* rb = 4 */ -/* wb = 5 */ -/* ab = 6 */ -/* r+ = 7 */ -/* w+ = 8 */ -/* a+ = 9 */ -/* r+b or rb+ = 10 */ -/* w+b or wb+ = 11 */ -/* a+b or ab+ = 12 */ - -static void checkMode(void) -{ - if (strncmp(modus, "r+b", 3) == 0) - { - modeType = 10; - } - else if (strncmp(modus, "rb+", 3) == 0) - { - modeType = 10; - } - else if (strncmp(modus, "w+b", 3) == 0) - { - modeType = 11; - } - else if (strncmp(modus, "wb+", 3) == 0) - { - modeType = 11; - } - else if (strncmp(modus, "a+b", 3) == 0) - { - modeType = 12; - } - else if (strncmp(modus, "ab+", 3) == 0) - { - modeType = 12; - } - else if (strncmp(modus, "r+", 2) == 0) - { - modeType = 7; - } - else if (strncmp(modus, "w+", 2) == 0) - { - modeType = 8; - } - else if (strncmp(modus, "a+", 2) == 0) - { - modeType = 9; - } - else if (strncmp(modus, "rb", 2) == 0) - { - modeType = 4; - } - else if (strncmp(modus, "wb", 2) == 0) - { - modeType = 5; - } - else if (strncmp(modus, "ab", 2) == 0) - { - modeType = 6; - } - else if (strncmp(modus, "r", 1) == 0) - { - modeType = 1; - } - else if (strncmp(modus, "w", 1) == 0) - { - modeType = 2; - } - else if (strncmp(modus, "a", 1) == 0) - { - modeType = 3; - } - else - { - err = 1; - return; - } - if ((modeType == 4) - || (modeType == 5) - || (modeType == 6) - || (modeType == 10) - || (modeType == 11) - || (modeType == 12)) - { - myfile->textMode = 0; - } - else - { - myfile->textMode = 1; - } - return; -} - -static void osfopen(void) -{ -#ifdef __OS2__ - APIRET rc; - ULONG action; - ULONG newsize = 0; - ULONG fileAttr = 0; - ULONG openAction = 0; - ULONG openMode = 0; - - if ((modeType == 1) || (modeType == 4) || (modeType == 7) - || (modeType == 10)) - { - openAction |= OPEN_ACTION_FAIL_IF_NEW; - openAction |= OPEN_ACTION_OPEN_IF_EXISTS; - } - else if ((modeType == 2) || (modeType == 5) || (modeType == 8) - || (modeType == 11)) - { - openAction |= OPEN_ACTION_CREATE_IF_NEW; - openAction |= OPEN_ACTION_REPLACE_IF_EXISTS; - } - else if ((modeType == 3) || (modeType == 6) || (modeType == 9) - || (modeType == 12)) - { - openAction |= OPEN_ACTION_CREATE_IF_NEW; - openAction |= OPEN_ACTION_OPEN_IF_EXISTS; - } - openMode |= OPEN_SHARE_DENYWRITE; - if ((modeType == 1) || (modeType == 4)) - { - openMode |= OPEN_ACCESS_READONLY; - } - else if ((modeType == 2) || (modeType == 3) || (modeType == 5) - || (modeType == 6)) - { - openMode |= OPEN_ACCESS_WRITEONLY; - } - else - { - openMode |= OPEN_ACCESS_READWRITE; - } - if ((strlen(fnm) == 2) - && (fnm[1] == ':') - && (openMode == OPEN_ACCESS_READONLY)) - { - openMode |= OPEN_FLAGS_DASD; - } - rc = DosOpen((PSZ)fnm, - &myfile->hfile, - &action, - newsize, - fileAttr, - openAction, - openMode, - NULL); - if (rc != 0) - { - err = 1; - errno = rc; - } -#endif -#ifdef __MSDOS__ - int mode; - int errind; - - if ((modeType == 1) || (modeType == 4)) - { - mode = 0; - } - else if ((modeType == 2) || (modeType == 5)) - { - mode = 1; - } - else - { - mode = 2; - } - myfile->hfile = __open(fnm, mode, &errind); - if (errind) - { - err = 1; - errno = myfile->hfile; - } -#endif -#ifdef __MVS__ - int mode; - char *p; - int len; - - if ((modeType == 1) || (modeType == 4)) - { - mode = 0; - } - else if ((modeType == 2) || (modeType == 5)) - { - mode = 1; - } - else - { - mode = 2; - } - p = strchr(fnm, ':'); - if ((p != NULL) && (strncmp(fnm, "dd", 2) == 0)) - { - p++; - } - else - { - p = (char *)fnm; - } - strcpy(myfile->ddname, " "); - len = strlen(p); - if (len > 8) - { - len = 8; - } - memcpy(myfile->ddname, p, len); - p = myfile->ddname; - while (*p != '\0') - { - *p = toupper(*p); - p++; - } - myfile->hfile = - __aopen(myfile->ddname, mode, &myfile->recfm, &myfile->lrecl); - if ((modeType == 4) || (modeType == 5)) - { - myfile->style = 0; /* binary */ - } - else - { - myfile->style = 2; /* text */ - } - myfile->style += myfile->recfm; - if (myfile->style == VARIABLE_TEXT) - { - myfile->quickText = 1; - } - if (myfile->style == FIXED_BINARY) - { - myfile->quickBin = 1; - } - else - { - myfile->quickBin = 0; - } -#endif - return; -} -*/ diff --git a/functions/stdio/fprintf.c b/functions/stdio/fprintf.c deleted file mode 100644 index 58adaa0..0000000 --- a/functions/stdio/fprintf.c +++ /dev/null @@ -1,20 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - va_list arg; - int ret; - - va_start(arg, format); - ret = vfprintf(stream, format, arg); - va_end(arg); - return (ret); -} -*/ diff --git a/functions/stdio/fputc.c b/functions/stdio/fputc.c deleted file mode 100644 index d17c936..0000000 --- a/functions/stdio/fputc.c +++ /dev/null @@ -1,58 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - char buf[1]; - -#ifndef __MVS__ - stream->quickBin = 0; - if ((stream->upto < (stream->endbuf - 2)) - && (stream->bufTech != _IONBF)) - { - if (stream->textMode) - { - if (c == '\n') - { - if (stream->bufTech == _IOFBF) - { - *stream->upto++ = '\r'; - *stream->upto++ = '\n'; - } - else - { - buf[0] = (char)c; - if (fwrite(buf, 1, 1, stream) != 1) - { - return (EOF); - } - } - } - else - { - *stream->upto++ = (char)c; - } - } - else - { - *stream->upto++ = (char)c; - } - } - else -#endif - { - buf[0] = (char)c; - if (fwrite(buf, 1, 1, stream) != 1) - { - return (EOF); - } - } - return (c); -} -*/ diff --git a/functions/stdio/fputs.c b/functions/stdio/fputs.c deleted file mode 100644 index ad75cd2..0000000 --- a/functions/stdio/fputs.c +++ /dev/null @@ -1,21 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -#ifndef __MVS__ -int fputs(const char *s, FILE *stream) -{ - size_t len; - - len = strlen(s); - fwrite(s, len, 1, stream); - return (0); -} -#endif -*/ diff --git a/functions/stdio/fread.c b/functions/stdio/fread.c deleted file mode 100644 index 6f528cb..0000000 --- a/functions/stdio/fread.c +++ /dev/null @@ -1,357 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed, verbatim. -Read the note in fopen.c. -{ - size_t toread; - size_t elemRead; - size_t actualRead; -#ifdef __OS2__ - APIRET rc; - ULONG tempRead; -#endif -#ifdef __MSDOS__ - int errind; - size_t tempRead; -#endif - - if (nmemb == 1) - { - toread = size; - } - else if (size == 1) - { - toread = nmemb; - } - else - { - toread = size * nmemb; - } - if (toread < stream->szfbuf) - { - stream->quickBin = 0; - } - if (!stream->quickBin) - { - if (stream->textMode) - { - freadSlowT(ptr, stream, toread, &actualRead); - } - else - { - if (toread <= (stream->endbuf - stream->upto)) - { - memcpy(ptr, stream->upto, toread); - actualRead = toread; - stream->upto += toread; - } - else - { - freadSlowB(ptr, stream, toread, &actualRead); - } - } - if (nmemb == 1) - { - if (actualRead == size) - { - elemRead = 1; - } - else - { - elemRead = 0; - } - } - else if (size == 1) - { - elemRead = actualRead; - } - else - { - elemRead = actualRead / size; - } - return (elemRead); - } - else - { -#ifdef __OS2__ - rc = DosRead(stream->hfile, ptr, toread, &tempRead); - if (rc != 0) - { - actualRead = 0; - stream->errorInd = 1; - errno = rc; - } - else - { - actualRead = tempRead; - } -#endif -#ifdef __MSDOS__ - tempRead = __read(stream->hfile, ptr, toread, &errind); - if (errind) - { - errno = tempRead; - actualRead = 0; - stream->errorInd = 1; - } - else - { - actualRead = tempRead; - } -#endif - if (nmemb == 1) - { - if (actualRead == size) - { - elemRead = 1; - } - else - { - elemRead = 0; - stream->eofInd = 1; - } - } - else if (size == 1) - { - elemRead = actualRead; - if (nmemb != actualRead) - { - stream->eofInd = 1; - } - } - else - { - elemRead = actualRead / size; - if (toread != actualRead) - { - stream->eofInd = 1; - } - } - stream->bufStartR += actualRead; - return (elemRead); - } -} - - -/* -while toread has not been satisfied -{ - scan stuff out of buffer, replenishing buffer as required -} -*/ - -static void freadSlowT(void *ptr, - FILE *stream, - size_t toread, - size_t *actualRead) -{ - int finReading = 0; - size_t avail; - size_t need; - char *p; - size_t got; -#ifdef __OS2__ - ULONG tempRead; - APIRET rc; -#endif -#ifdef __MSDOS__ - size_t tempRead; - int errind; -#endif - - *actualRead = 0; - while (!finReading) - { - if (stream->upto == stream->endbuf) - { - stream->bufStartR += (stream->upto - stream->fbuf); -#ifdef __OS2__ - rc = DosRead(stream->hfile, - stream->fbuf, - stream->szfbuf, - &tempRead); - if (rc != 0) - { - tempRead = 0; - stream->errorInd = 1; - errno = rc; - } -#endif -#ifdef __MSDOS__ - tempRead = __read(stream->hfile, - stream->fbuf, - stream->szfbuf, - &errind); - if (errind) - { - errno = tempRead; - tempRead = 0; - stream->errorInd = 1; - } -#endif - if (tempRead == 0) - { - stream->eofInd = 1; - break; - } - stream->endbuf = stream->fbuf + tempRead; - *stream->endbuf = '\n'; - stream->upto = stream->fbuf; - } - avail = (size_t)(stream->endbuf - stream->upto) + 1; - need = toread - *actualRead; - p = memchr(stream->upto, '\n', avail); - got = (size_t)(p - stream->upto); - if (need < got) - { - memcpy((char *)ptr + *actualRead, stream->upto, need); - stream->upto += need; - *actualRead += need; - } - else - { - memcpy((char *)ptr + *actualRead, stream->upto, got); - stream->upto += got; - *actualRead += got; - if (p != stream->endbuf) - { - if (*(stream->upto - 1) == '\r') - { - *((char *)ptr + *actualRead - 1) = '\n'; - } - else - { - *((char *)ptr + *actualRead) = '\n'; - *actualRead += 1; - } - stream->upto++; - } - else - { - if (*(stream->upto - 1) == '\r') - { - *actualRead -= 1; - } - } - } - if (*actualRead == toread) - { - finReading = 1; - } - } - return; -} - -static void freadSlowB(void *ptr, - FILE *stream, - size_t toread, - size_t *actualRead) -{ - size_t avail; -#ifdef __OS2__ - ULONG tempRead; - APIRET rc; -#endif -#ifdef __MSDOS__ - size_t tempRead; - int errind; -#endif - - avail = (size_t)(stream->endbuf - stream->upto); - memcpy(ptr, stream->upto, avail); - *actualRead = avail; - stream->bufStartR += (stream->endbuf - stream->fbuf); - if (toread >= stream->szfbuf) - { - stream->upto = stream->endbuf; - stream->quickBin = 1; -#ifdef __OS2__ - rc = DosRead(stream->hfile, - (char *)ptr + *actualRead, - toread - *actualRead, - &tempRead); - if (rc != 0) - { - tempRead = 0; - stream->errorInd = 1; - errno = rc; - } -#endif -#ifdef __MSDOS__ - tempRead = __read(stream->hfile, - (char *)ptr + *actualRead, - toread - *actualRead, - &errind); - if (errind) - { - errno = tempRead; - tempRead = 0; - stream->errorInd = 1; - } -#endif - else if (tempRead != (toread - *actualRead)) - { - stream->eofInd = 1; - } - *actualRead += tempRead; - stream->bufStartR += tempRead; - } - else - { - size_t left; - - stream->upto = stream->fbuf; -#ifdef __OS2__ - rc = DosRead(stream->hfile, - stream->fbuf, - stream->szfbuf, - &tempRead); - left = toread - *actualRead; - if (rc != 0) - { - tempRead = 0; - stream->errorInd = 1; - errno = rc; - } -#endif -#ifdef __MSDOS__ - tempRead = __read(stream->hfile, - stream->fbuf, - stream->szfbuf, - &errind); - left = toread - *actualRead; - if (errind) - { - errno = tempRead; - tempRead = 0; - stream->errorInd = 1; - } -#endif - else if (tempRead < left) - { - stream->eofInd = 1; - } - stream->endbuf = stream->fbuf + tempRead; - *stream->endbuf = '\n'; - avail = (size_t)(stream->endbuf - stream->upto); - if (avail > left) - { - avail = left; - } - memcpy((char *)ptr + *actualRead, - stream->upto, - avail); - stream->upto += avail; - *actualRead += avail; - } - return; -} -#endif -*/ diff --git a/functions/stdio/freopen.c b/functions/stdio/freopen.c deleted file mode 100644 index 2619eea..0000000 --- a/functions/stdio/freopen.c +++ /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. - * --------------------------------------------------------------------------*/ - -FILE * freopen( const char * restrict filename, const char * restrict mode, FILE * stream ) { /* TODO */ }; - -/* PDPC code - unreviewed -{ - fclose(stream); - return (fopen(filename, mode)); -} -*/ diff --git a/functions/stdio/fscanf.c b/functions/stdio/fscanf.c deleted file mode 100644 index 05a9a1a..0000000 --- a/functions/stdio/fscanf.c +++ /dev/null @@ -1,85 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - va_list arg; - int ret; - - va_start(arg, format); - ret = vvscanf(format, arg, stream, NULL); - va_end(arg); - return (ret); -} - -static int vvscanf(const char *format, va_list arg, FILE *fp, const char *s) -{ - int ch; - int fin = 0; - int cnt = 0; - char *cptr; - int *iptr; - - inch(); - while (!fin) - { - if (*format == '\0') - { - fin = 1; - } - else if (*format == '%') - { - format++; - if (*format == '%') - { - if (ch != '%') return (cnt); - inch(); - } - else if (*format == 's') - { - cptr = va_arg(arg, char *); - *cptr++ = (char)ch; - inch(); - while ((ch >= 0) && (!isspace(ch))) - { - *cptr++ = (char)ch; - inch(); - } - *cptr = '\0'; - if (ch < 0) - { - fin = 1; - } - } - else if (*format == 'd') - { - iptr = va_arg(arg, int *); - if (!isdigit(ch)) return (cnt); - *iptr = ch - '0'; - inch(); - while ((ch >= 0) && (isdigit(ch))) - { - *iptr = *iptr * 10 + (ch - '0'); - inch(); - } - if (ch < 0) - { - fin = 1; - } - } - } - else - { - if (ch != *format) return (cnt); - inch(); - } - } - return (cnt); -} -*/ diff --git a/functions/stdio/fseek.c b/functions/stdio/fseek.c deleted file mode 100644 index 61dbc4f..0000000 --- a/functions/stdio/fseek.c +++ /dev/null @@ -1,65 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -Read the note in fopen.c. -{ - long newpos; -#ifdef __OS2__ - ULONG retpos; - APIRET rc; -#endif - - if (stream->mode == __WRITE_MODE) - { - fflush(stream); - } - if (whence == SEEK_SET) - { - newpos = offset; - } - else if (whence == SEEK_CUR) - { - newpos = offset + stream->bufStartR + (stream->upto - stream->fbuf); - } - if ((newpos > stream->bufStartR) - && (newpos < (stream->bufStartR + (stream->endbuf - stream->fbuf))) - && stream->update) - { - stream->upto = stream->fbuf + (size_t)(newpos - stream->bufStartR); - } - else - { -#ifdef __OS2__ - rc = DosSetFilePtr(stream->hfile, newpos, FILE_BEGIN, &retpos); - if ((rc != 0) || (retpos != newpos)) - { - errno = rc; - return (-1); - } - else - { - stream->endbuf = stream->fbuf + stream->szfbuf; - stream->upto = stream->endbuf; - stream->bufStartR = newpos - stream->szfbuf; - } -#endif -#ifdef __MSDOS - __seek(stream->hfile, newpos, whence); - stream->endbuf = stream->fbuf + stream->szfbuf; - stream->upto = stream->endbuf; - stream->bufStartR = newpos - stream->szfbuf; -#endif - } - stream->quickBin = 0; - stream->quickText = 0; - stream->ungetCh = -1; - return (0); -} -*/ diff --git a/functions/stdio/fsetpos.c b/functions/stdio/fsetpos.c deleted file mode 100644 index 044c974..0000000 --- a/functions/stdio/fsetpos.c +++ /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. - * --------------------------------------------------------------------------*/ - -int fsetpos( FILE * stream, const fpos_t * pos ) { /* TODO */ }; - -/* PDPC code - unreviewed -{ - fseek(stream, *pos, SEEK_SET); - return (0); -} -*/ diff --git a/functions/stdio/ftell.c b/functions/stdio/ftell.c deleted file mode 100644 index 9518033..0000000 --- a/functions/stdio/ftell.c +++ /dev/null @@ -1,14 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - return (stream->bufStartR + (stream->upto - stream->fbuf)); -} -*/ diff --git a/functions/stdio/fwrite.c b/functions/stdio/fwrite.c deleted file mode 100644 index d2698b8..0000000 --- a/functions/stdio/fwrite.c +++ /dev/null @@ -1,482 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed, verbatim. -Read the note in fopen.c. -#ifndef __MVS__ -size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) -{ - size_t towrite; - size_t elemWritten; -#ifdef __OS2__ - ULONG actualWritten; - APIRET rc; -#endif -#ifdef __MSDOS__ - size_t actualWritten; - int errind; -#endif - - if (nmemb == 1) - { - towrite = size; - } - else if (size == 1) - { - towrite = nmemb; - } - else - { - towrite = size * nmemb; - } - if (towrite < stream->szfbuf) - { - stream->quickBin = 0; - if ((stream->bufTech == _IONBF) && !stream->textMode) - { - stream->quickBin = 1; - } - } - if (!stream->quickBin) - { - fwriteSlow(ptr, size, nmemb, stream, towrite, &elemWritten); - return (elemWritten); - } - else - { -#ifdef __OS2__ - rc = DosWrite(stream->hfile, (VOID *)ptr, towrite, &actualWritten); - if (rc != 0) - { - stream->errorInd = 1; - actualWritten = 0; - errno = rc; - } -#endif -#ifdef __MSDOS__ - actualWritten = __write(stream->hfile, - ptr, - towrite, - &errind); - if (errind) - { - stream->errorInd = 1; - actualWritten = 0; - errno = actualWritten; - } -#endif - if (nmemb == 1) - { - if (actualWritten == size) - { - elemWritten = 1; - } - else - { - elemWritten = 0; - } - } - else if (size == 1) - { - elemWritten = actualWritten; - } - else - { - elemWritten = actualWritten / size; - } - stream->bufStartR += actualWritten; - return (elemWritten); - } -} - -static void fwriteSlow(const void *ptr, - size_t size, - size_t nmemb, - FILE *stream, - size_t towrite, - size_t *elemWritten) -{ - size_t actualWritten; - - /* Normally, on output, there will never be a situation where - the write buffer is full, but it hasn't been written out. - If we find this to be the case, then it is because we have - done an fseek, and didn't know whether we were going to do - a read or a write after it, so now that we know, we switch - the buffer to being set up for write. We could use a flag, - but I thought it would be better to just put some magic - code in with a comment */ - if (stream->upto == stream->endbuf) - { - stream->bufStartR += (stream->endbuf - stream->fbuf); - stream->upto = stream->fbuf; - stream->mode = __WRITE_MODE; - } - if ((stream->textMode) || (stream->bufTech == _IOLBF)) - { - fwriteSlowT(ptr, stream, towrite, &actualWritten); - } - else - { - fwriteSlowB(ptr, stream, towrite, &actualWritten); - } - if (nmemb == 1) - { - if (actualWritten == size) - { - *elemWritten = 1; - } - else - { - *elemWritten = 0; - } - } - else if (size == 1) - { - *elemWritten = actualWritten; - } - else - { - *elemWritten = actualWritten / size; - } - return; -} - - -/* can still be called on binary files, if the binary file is - line buffered */ - -static void fwriteSlowT(const void *ptr, - FILE *stream, - size_t towrite, - size_t *actualWritten) -{ - char *p; - char *tptr; - char *oldp; - size_t diffp; - size_t rem; - int fin; -#ifdef __OS2__ - ULONG tempWritten; - APIRET rc; -#endif -#ifdef __MSDOS__ - size_t tempWritten; - int errind; -#endif - - *actualWritten = 0; - tptr = (char *)ptr; - p = tptr; - oldp = p; - p = (char *)memchr(oldp, '\n', towrite - (size_t)(oldp - tptr)); - while (p != NULL) - { - diffp = (size_t)(p - oldp); - fin = 0; - while (!fin) - { - rem = (size_t)(stream->endbuf - stream->upto); - if (diffp < rem) - { - memcpy(stream->upto, oldp, diffp); - stream->upto += diffp; - *actualWritten += diffp; - fin = 1; - } - else - { - memcpy(stream->upto, oldp, rem); - oldp += rem; - diffp -= rem; -#ifdef __OS2__ - rc = DosWrite(stream->hfile, - stream->fbuf, - stream->szfbuf, - &tempWritten); - if (rc != 0) - { - stream->errorInd = 1; - return; - } -#endif -#ifdef __MSDOS__ - tempWritten = __write(stream->hfile, - stream->fbuf, - stream->szfbuf, - &errind); - if (errind) - { - stream->errorInd = 1; - return; - } -#endif - else - { - *actualWritten += rem; - stream->upto = stream->fbuf; - stream->bufStartR += tempWritten; - } - } - } - rem = (size_t)(stream->endbuf - stream->upto); - if (rem < 2) - { -#ifdef __OS2__ - rc = DosWrite(stream->hfile, - stream->fbuf, - (size_t)(stream->upto - stream->fbuf), - &tempWritten); - if (rc != 0) - { - stream->errorInd = 1; - errno = rc; - return; - } -#endif -#ifdef __MSDOS__ - tempWritten = __write(stream->hfile, - stream->fbuf, - (size_t)(stream->upto - stream->fbuf), - &errind); - if (errind) - { - stream->errorInd = 1; - errno = tempWritten; - return; - } -#endif - stream->upto = stream->fbuf; - stream->bufStartR += tempWritten; - } - if (stream->textMode) - { - memcpy(stream->upto, "\r\n", 2); - stream->upto += 2; - } - else - { - memcpy(stream->upto, "\n", 1); - stream->upto += 1; - } - *actualWritten += 1; - oldp = p + 1; - p = (char *)memchr(oldp, '\n', towrite - (size_t)(oldp - tptr)); - } - - if ((stream->bufTech == _IOLBF) - && (stream->upto != stream->fbuf) - && (oldp != tptr)) - { -#ifdef __OS2__ - rc = DosWrite(stream->hfile, - stream->fbuf, - (size_t)(stream->upto - stream->fbuf), - &tempWritten); - if (rc != 0) - { - stream->errorInd = 1; - errno = rc; - return; - } -#endif -#ifdef __MSDOS__ - tempWritten = __write(stream->hfile, - stream->fbuf, - (size_t)(stream->upto - stream->fbuf), - &errind); - if (errind) - { - stream->errorInd = 1; - errno = tempWritten; - return; - } -#endif - stream->upto = stream->fbuf; - stream->bufStartR += tempWritten; - } - - diffp = towrite - *actualWritten; - while (diffp != 0) - { - rem = (size_t)(stream->endbuf - stream->upto); - if (diffp < rem) - { - memcpy(stream->upto, oldp, diffp); - stream->upto += diffp; - *actualWritten += diffp; - } - else - { - memcpy(stream->upto, oldp, rem); -#ifdef __OS2__ - rc = DosWrite(stream->hfile, - stream->fbuf, - stream->szfbuf, - &tempWritten); - if (rc != 0) - { - stream->errorInd = 1; - errno = rc; - return; - } -#endif -#ifdef __MSDOS__ - tempWritten = __write(stream->hfile, - stream->fbuf, - stream->szfbuf, - &errind); - if (errind) - { - stream->errorInd = 1; - errno = tempWritten; - return; - } -#endif - else - { - *actualWritten += rem; - stream->upto = stream->fbuf; - } - stream->bufStartR += tempWritten; - oldp += rem; - } - diffp = towrite - *actualWritten; - } - if ((stream->bufTech == _IONBF) - && (stream->upto != stream->fbuf)) - { -#ifdef __OS2__ - rc = DosWrite(stream->hfile, - stream->fbuf, - (size_t)(stream->upto - stream->fbuf), - &tempWritten); - if (rc != 0) - { - stream->errorInd = 1; - errno = rc; - return; - } -#endif -#ifdef __MSDOS__ - tempWritten = __write(stream->hfile, - stream->fbuf, - (size_t)(stream->upto - stream->fbuf), - &errind); - if (errind) - { - stream->errorInd = 1; - errno = tempWritten; - return; - } -#endif - stream->upto = stream->fbuf; - stream->bufStartR += tempWritten; - } - return; -} - -/* whilst write requests are smaller than a buffer, we do not turn - on quickbin */ - -static void fwriteSlowB(const void *ptr, - FILE *stream, - size_t towrite, - size_t *actualWritten) -{ - size_t spare; -#ifdef __OS2__ - ULONG tempWritten; - APIRET rc; -#endif -#ifdef __MSDOS__ - size_t tempWritten; - int errind; -#endif - - spare = (size_t)(stream->endbuf - stream->upto); - if (towrite < spare) - { - memcpy(stream->upto, ptr, towrite); - *actualWritten = towrite; - stream->upto += towrite; - return; - } - memcpy(stream->upto, ptr, spare); -#ifdef __OS2__ - rc = DosWrite(stream->hfile, - stream->fbuf, - stream->szfbuf, - &tempWritten); - if (rc != 0) - { - stream->errorInd = 1; - errno = rc; - return; - } -#endif -#ifdef __MSDOS__ - tempWritten = __write(stream->hfile, - stream->fbuf, - stream->szfbuf, - &errind); - if (errind) - { - stream->errorInd = 1; - errno = tempWritten; - return; - } -#endif - *actualWritten = spare; - stream->upto = stream->fbuf; - stream->bufStartR += tempWritten; - if (towrite > stream->szfbuf) - { - stream->quickBin = 1; -#ifdef __OS2__ - rc = DosWrite(stream->hfile, - (char *)ptr + *actualWritten, - towrite - *actualWritten, - &tempWritten); - if (rc != 0) - { - stream->errorInd = 1; - errno = rc; - return; - } -#endif -#ifdef __MSDOS__ - tempWritten = __write(stream->hfile, - (char *)ptr + *actualWritten, - towrite - *actualWritten, - &errind); - if (errind) - { - stream->errorInd = 1; - errno = tempWritten; - return; - } -#endif - *actualWritten += tempWritten; - stream->bufStartR += tempWritten; - } - else - { - memcpy(stream->fbuf, - (char *)ptr + *actualWritten, - towrite - *actualWritten); - stream->upto += (towrite - *actualWritten); - *actualWritten = towrite; - } - stream->bufStartR += *actualWritten; - return; -} -#endif -*/ diff --git a/functions/stdio/getc.c b/functions/stdio/getc.c deleted file mode 100644 index e54fca3..0000000 --- a/functions/stdio/getc.c +++ /dev/null @@ -1,14 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - return (fgetc(stream)); -} -*/ diff --git a/functions/stdio/getchar.c b/functions/stdio/getchar.c deleted file mode 100644 index 485a613..0000000 --- a/functions/stdio/getchar.c +++ /dev/null @@ -1,14 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $Id$ - * ---------------------------------------------------------------------------- - * Public Domain C Library - http://pdclib.sourceforge.net - * This code is Public Domain. Use, modify, and redistribute at will. - * --------------------------------------------------------------------------*/ - -int getchar( void ) { /* TODO */ }; - -/* PDPC code - unreviewed -{ - return (getc(stdin)); -} -*/ diff --git a/functions/stdio/gets.c b/functions/stdio/gets.c deleted file mode 100644 index cd2942e..0000000 --- a/functions/stdio/gets.c +++ /dev/null @@ -1,21 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - char *ret; - - stdin->quickText = 0; - stdin->noNl = 1; - ret = fgets(s, INT_MAX, stdin); - stdin->noNl = 0; - stdin->quickText = 1; - return (ret); -} -*/ diff --git a/functions/stdio/perror.c b/functions/stdio/perror.c deleted file mode 100644 index d85cd64..0000000 --- a/functions/stdio/perror.c +++ /dev/null @@ -1,26 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - if ((s != NULL) && (*s != '\0')) - { - printf("%s: "); - } - if (errno == 0) - { - printf("No error has occurred\n"); - } - else - { - printf("An error has occurred\n"); - } - return; -} -*/ diff --git a/functions/stdio/printf.c b/functions/stdio/printf.c deleted file mode 100644 index d576994..0000000 --- a/functions/stdio/printf.c +++ /dev/null @@ -1,20 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - va_list arg; - int ret; - - va_start(arg, format); - ret = vfprintf(stdout, format, arg); - va_end(arg); - return (ret); -} -*/ diff --git a/functions/stdio/putc.c b/functions/stdio/putc.c deleted file mode 100644 index 4f25903..0000000 --- a/functions/stdio/putc.c +++ /dev/null @@ -1,14 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - return (fputc(c, stream)); -} -*/ diff --git a/functions/stdio/putchar.c b/functions/stdio/putchar.c deleted file mode 100644 index 673d86a..0000000 --- a/functions/stdio/putchar.c +++ /dev/null @@ -1,14 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - return (putc(c, stdout)); -} -*/ diff --git a/functions/stdio/puts.c b/functions/stdio/puts.c deleted file mode 100644 index 3c819dd..0000000 --- a/functions/stdio/puts.c +++ /dev/null @@ -1,21 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - int ret; - - ret = fputs(s, stdout); - if (ret == EOF) - { - return (ret); - } - return (putc('\n', stdout)); -} -*/ diff --git a/functions/stdio/remove.c b/functions/stdio/remove.c deleted file mode 100644 index 7985984..0000000 --- a/functions/stdio/remove.c +++ /dev/null @@ -1,8 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 deleted file mode 100644 index d9b3d1f..0000000 --- a/functions/stdio/rename.c +++ /dev/null @@ -1,8 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 deleted file mode 100644 index b893086..0000000 --- a/functions/stdio/rewind.c +++ /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. - * --------------------------------------------------------------------------*/ - -void rewind( FILE * stream ) { /* TODO */ }; - -/* PDPC code - unreviewed -{ - fseek(stream, 0L, SEEK_SET); - return; -} -*/ diff --git a/functions/stdio/scanf.c b/functions/stdio/scanf.c deleted file mode 100644 index 612f151..0000000 --- a/functions/stdio/scanf.c +++ /dev/null @@ -1,20 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - va_list arg; - int ret; - - va_start(arg, format); - ret = vvscanf(format, arg, stdin, NULL); - va_end(arg); - return (ret); -} -*/ diff --git a/functions/stdio/setbuf.c b/functions/stdio/setbuf.c deleted file mode 100644 index 163f1f5..0000000 --- a/functions/stdio/setbuf.c +++ /dev/null @@ -1,24 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - int ret; - - if (buf == NULL) - { - ret = setvbuf(stream, NULL, _IONBF, 0); - } - else - { - ret = setvbuf(stream, buf, _IOFBF, BUFSIZ); - } - return (ret); -} -*/ diff --git a/functions/stdio/setvbuf.c b/functions/stdio/setvbuf.c deleted file mode 100644 index a88a27f..0000000 --- a/functions/stdio/setvbuf.c +++ /dev/null @@ -1,67 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -/* -NULL + F = allocate, setup -NULL + L = allocate, setup -NULL + N = ignore, return success -buf + F = setup -buf + L = setup -buf + N = ignore, return success -*/ - -int setvbuf(FILE *stream, char *buf, int mode, size_t size) -{ - char *mybuf; - - if (mode == _IONBF) - { - stream->bufTech = mode; - return (0); - } - if (buf == NULL) - { - if (size < 2) - { - return (-1); - } - mybuf = malloc(size + 8); - if (mybuf == NULL) - { - return (-1); - } - } - else - { - if (size < 10) - { - return (-1); - } - mybuf = buf; - stream->theirBuffer = 1; - size -= 8; - } - free(stream->intBuffer); - stream->intBuffer = mybuf; - stream->fbuf = stream->intBuffer + 2; - *stream->fbuf++ = '\0'; - *stream->fbuf++ = '\0'; - stream->szfbuf = size; - stream->endbuf = stream->fbuf + stream->szfbuf; - *stream->endbuf = '\n'; - stream->upto = stream->endbuf; - stream->bufTech = mode; - if (!stream->textMode && (stream->bufTech == _IOLBF)) - { - stream->quickBin = 0; - } - return (0); -} -*/ diff --git a/functions/stdio/snprintf.c b/functions/stdio/snprintf.c deleted file mode 100644 index dd2a972..0000000 --- a/functions/stdio/snprintf.c +++ /dev/null @@ -1,8 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 deleted file mode 100644 index b992dba..0000000 --- a/functions/stdio/sprintf.c +++ /dev/null @@ -1,20 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - va_list arg; - int ret; - - va_start(arg, format); - ret = vsprintf(s, format, arg); - va_end(arg); - return (ret); -} -*/ diff --git a/functions/stdio/sscanf.c b/functions/stdio/sscanf.c deleted file mode 100644 index 9103aab..0000000 --- a/functions/stdio/sscanf.c +++ /dev/null @@ -1,20 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - va_list arg; - int ret; - - va_start(arg, format); - ret = vvscanf(format, arg, NULL, s); - va_end(arg); - return (ret); -} -*/ diff --git a/functions/stdio/tmpfile.c b/functions/stdio/tmpfile.c deleted file mode 100644 index e5b7fd8..0000000 --- a/functions/stdio/tmpfile.c +++ /dev/null @@ -1,14 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $Id$ - * ---------------------------------------------------------------------------- - * Public Domain C Library - http://pdclib.sourceforge.net - * This code is Public Domain. Use, modify, and redistribute at will. - * --------------------------------------------------------------------------*/ - -FILE * tmpfile( void ) { /* TODO */ }; - -/* PDPC code - unreviewed -{ - return (fopen("ZZZZZZZA.$$$", "wb+")); -} -*/ diff --git a/functions/stdio/tmpnam.c b/functions/stdio/tmpnam.c deleted file mode 100644 index 69edae7..0000000 --- a/functions/stdio/tmpnam.c +++ /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. - * --------------------------------------------------------------------------*/ - -char * tmpnam( char * s ) { /* TODO */ }; - -/* PDPC code - unreviewed -{ - static char buf[] = "ZZZZZZZA.$$$"; - - buf[7]++; - if (s == NULL) - { - return (buf); - } - strcpy(s, buf); - return (s); -} -*/ diff --git a/functions/stdio/ungetc.c b/functions/stdio/ungetc.c deleted file mode 100644 index 1bd7323..0000000 --- a/functions/stdio/ungetc.c +++ /dev/null @@ -1,20 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - if ((stream->ungetCh != -1) || (c == EOF)) - { - return (EOF); - } - stream->ungetCh = (unsigned char)c; - stream->quickText = 0; - return ((unsigned char)c); -} -*/ diff --git a/functions/stdio/vfprintf.c b/functions/stdio/vfprintf.c deleted file mode 100644 index 00de473..0000000 --- a/functions/stdio/vfprintf.c +++ /dev/null @@ -1,409 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - int ret; - - ret = vvprintf(format, arg, stream, NULL); - return (ret); -} - -{ - int fin = 0; - int vint; - char *vcptr; - int chcount = 0; - size_t len; - char numbuf[50]; - char *nptr; - - while (!fin) - { - if (*format == '\0') - { - fin = 1; - } - else if (*format == '%') - { - format++; - if (*format == 'd') - { - int neg = 0; - - vint = va_arg(arg, int); - if (vint < 0) - { - neg = 1; - vint = -vint; - } - nptr = numbuf; - do - { - *nptr++ = (char)('0' + vint % 10); - vint /= 10; - } while (vint > 0); - if (neg) - { - *nptr++ = '-'; - } - do - { - nptr--; - outch(*nptr); - chcount++; - } while (nptr != numbuf); - } - else if (*format == 's') - { - vcptr = va_arg(arg, char *); - if (fq == NULL) - { - len = strlen(vcptr); - memcpy(s, vcptr, len); - s += len; - chcount += len; - } - else - { - fputs(vcptr, fq); - chcount += strlen(vcptr); - } - } - else if (*format == 'c') - { - vint = va_arg(arg, int); - outch(vint); - chcount++; - } - else if (*format == '%') - { - outch('%'); - chcount++; - } - else - { - int extraCh; - - extraCh = examine(&format, fq, s, &arg, chcount); - chcount += extraCh; - if (s != NULL) - { - s += extraCh; - } - } - } - else - { - outch(*format); - chcount++; - } - format++; - } - return (chcount); -} - -static int examine(const char **formt, FILE *fq, char *s, va_list *arg, - int chcount) -{ - int extraCh = 0; - int flagMinus = 0; - int flagPlus = 0; - int flagSpace = 0; - int flagHash = 0; - int flagZero = 0; - int width = 0; - int precision = -1; - int half = 0; - int lng = 0; - int specifier = 0; - int fin; - long lvalue; - unsigned long ulvalue; - char *svalue; - char work[50]; - int x; - int y; - int rem; - const char *format; - int base; - int fillCh; - int neg; - int length; - - unused(chcount); - format = *formt; - /* processing flags */ - fin = 0; - while (!fin) - { - switch (*format) - { - case '-': flagMinus = 1; - break; - case '+': flagPlus = 1; - break; - case ' ': flagSpace = 1; - break; - case '#': flagHash = 1; - break; - case '0': flagZero = 1; - break; - default: fin = 1; - break; - } - if (!fin) - { - format++; - } - else - { - if (flagSpace && flagPlus) - { - flagSpace = 0; - } - if (flagMinus) - { - flagZero = 0; - } - } - } - - /* processing width */ - if (isdigit((unsigned char)*format)) - { - while (isdigit((unsigned char)*format)) - { - width = width * 10 + (*format - '0'); - format++; - } - } - - /* processing precision */ - if (*format == '.') - { - format++; - precision = 0; - while (isdigit((unsigned char)*format)) - { - precision = precision * 10 + (*format - '0'); - format++; - } - } - - /* processing h/l/L */ - if (*format == 'h') - { - half = 1; - } - else if (*format == 'l') - { - lng = 1; - } - else if (*format == 'L') - { - lng = 1; - } - else - { - format--; - } - format++; - - if (precision < 0) - { - precision = 1; - } - /* processing specifier */ - specifier = *format; - - if (strchr("dxXuiop", specifier) != NULL) - { -#if defined(__MSDOS__) && !defined(__PDOS__) - if (specifier == 'p') - { - lng = 1; - } -#endif - if (lng) - { - lvalue = va_arg(*arg, long); - } - else if (half) - { - lvalue = va_arg(*arg, short); - } - else - { - lvalue = va_arg(*arg, int); - } - ulvalue = (unsigned long)lvalue; - if ((lvalue < 0) && ((specifier == 'd') || (specifier == 'i'))) - { - neg = 1; - ulvalue = -lvalue; - } - else - { - neg = 0; - } - if ((specifier == 'X') || (specifier == 'x') || (specifier == 'p')) - { - base = 16; - } - else if (specifier == 'o') - { - base = 8; - } - else - { - base = 10; - } - if (specifier == 'p') - { -#if defined(__OS2__) || defined(__PDOS__) - precision = 8; -#endif -#if defined(__MSDOS__) && !defined(__PDOS__) - precision = 9; -#endif - } - x = 0; - while (ulvalue > 0) - { - rem = (int)(ulvalue % base); - if (rem < 10) - { - work[x] = (char)('0' + rem); - } - else - { - if ((specifier == 'X') || (specifier == 'p')) - { - work[x] = (char)('A' + (rem - 10)); - } - else - { - work[x] = (char)('a' + (rem - 10)); - } - } - x++; -#if defined(__MSDOS__) && !defined(__PDOS__) - if ((x == 4) && (specifier == 'p')) - { - work[x] = ':'; - x++; - } -#endif - ulvalue = ulvalue / base; - } - while (x < precision) - { - work[x] = '0'; - x++; - } - if (neg) - { - work[x++] = '-'; - } - if (flagZero) - { - fillCh = '0'; - } - else - { - fillCh = ' '; - } - y = x; - if (!flagMinus) - { - while (y < width) - { - outch(fillCh); - extraCh++; - y++; - } - } - if (flagHash && (toupper(specifier) == 'X')) - { - outch('0'); - outch('x'); - extraCh += 2; - } - x--; - while (x >= 0) - { - outch(work[x]); - extraCh++; - x--; - } - if (flagMinus) - { - while (y < width) - { - outch(fillCh); - extraCh++; - y++; - } - } - } - else if (specifier == 's') - { - svalue = va_arg(*arg, char *); - fillCh = ' '; - if (precision > 1) - { - char *p; - - p = memchr(svalue, '\0', precision); - if (p != NULL) - { - length = (int)(p - svalue); - } - else - { - length = precision; - } - } - else - { - length = strlen(svalue); - } - if (!flagMinus) - { - if (length < width) - { - extraCh += (width - length); - for (x = 0; x < (width - length); x++) - { - outch(fillCh); - } - } - } - for (x = 0; x < length; x++) - { - outch(svalue[x]); - } - extraCh += length; - if (flagMinus) - { - if (length < width) - { - extraCh += (width - length); - for (x = 0; x < (width - length); x++) - { - outch(fillCh); - } - } - } - } - *formt = format; - return (extraCh); -} -*/ diff --git a/functions/stdio/vfscanf.c b/functions/stdio/vfscanf.c deleted file mode 100644 index 92b4beb..0000000 --- a/functions/stdio/vfscanf.c +++ /dev/null @@ -1,8 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 deleted file mode 100644 index e55eb7c..0000000 --- a/functions/stdio/vprintf.c +++ /dev/null @@ -1,8 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 deleted file mode 100644 index 8287237..0000000 --- a/functions/stdio/vscanf.c +++ /dev/null @@ -1,8 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 deleted file mode 100644 index 6fae080..0000000 --- a/functions/stdio/vsnprintf.c +++ /dev/null @@ -1,8 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 deleted file mode 100644 index e17f6ff..0000000 --- a/functions/stdio/vsprintf.c +++ /dev/null @@ -1,21 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - int ret; - - ret = vvprintf(format, arg, NULL, s); - if (ret >= 0) - { - *(s + ret) = '\0'; - } - return (ret); -} -*/ diff --git a/functions/stdio/vsscanf.c b/functions/stdio/vsscanf.c deleted file mode 100644 index 97efeb2..0000000 --- a/functions/stdio/vsscanf.c +++ /dev/null @@ -1,8 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 deleted file mode 100644 index 15cfd54..0000000 --- a/functions/stdlib/_Exit.c +++ /dev/null @@ -1,8 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 deleted file mode 100644 index 1665706..0000000 --- a/functions/stdlib/abort.c +++ /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. - * --------------------------------------------------------------------------*/ - -void abort( void ) { /* TODO */ }; - -/* PDPC code - unreviewed -{ - raise(SIGABRT); - exit(EXIT_FAILURE); -} -*/ diff --git a/functions/stdlib/atexit.c b/functions/stdlib/atexit.c deleted file mode 100644 index d9f0ee9..0000000 --- a/functions/stdlib/atexit.c +++ /dev/null @@ -1,24 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $Id$ - * ---------------------------------------------------------------------------- - * Public Domain C Library - http://pdclib.sourceforge.net - * This code is Public Domain. Use, modify, and redistribute at will. - * --------------------------------------------------------------------------*/ - -int atexit( void (*func) ( void ) ) { /* TODO */ }; - -/* PDPC code - unreviewed -{ - int x; - - for (x = 0; x < __NATEXIT; x++) - { - if (__userExit[x] == 0) - { - __userExit[x] = func; - return (0); - } - } - return (-1); -} -*/ diff --git a/functions/stdlib/bsearch.c b/functions/stdlib/bsearch.c deleted file mode 100644 index fa58d0d..0000000 --- a/functions/stdlib/bsearch.c +++ /dev/null @@ -1,37 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $Id$ - * ---------------------------------------------------------------------------- - * Public Domain C Library - http://pdclib.sourceforge.net - * This code is Public Domain. Use, modify, and redistribute at will. - * --------------------------------------------------------------------------*/ - -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 -{ - size_t try; - int res; - const void *ptr; - - while (nmemb > 0) - { - try = nmemb / 2; - ptr = (void *)((char *)base + try * size); - res = compar(ptr, key); - if (res == 0) - { - return ((void *)ptr); - } - else if (res < 0) - { - nmemb = nmemb - try - 1; - base = (const void *)((const char *)ptr + size); - } - else - { - nmemb = try; - } - } - return (NULL); -} -*/ diff --git a/functions/stdlib/calloc.c b/functions/stdlib/calloc.c deleted file mode 100644 index a9a485f..0000000 --- a/functions/stdlib/calloc.c +++ /dev/null @@ -1,34 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - void *ptr; - size_t total; - - if (nmemb == 1) - { - total = size; - } - else if (size == 1) - { - total = nmemb; - } - else - { - total = nmemb * size; - } - ptr = malloc(total); - if (ptr != NULL) - { - memset(ptr, '\0', total); - } - return (ptr); -} -*/ diff --git a/functions/stdlib/div.c b/functions/stdlib/div.c deleted file mode 100644 index 34af223..0000000 --- a/functions/stdlib/div.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -ldiv_t ldiv( long numer, long denom ) { /* TODO */ }; diff --git a/functions/stdlib/exit.c b/functions/stdlib/exit.c deleted file mode 100644 index 743744c..0000000 --- a/functions/stdlib/exit.c +++ /dev/null @@ -1,8 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 deleted file mode 100644 index 150d7b3..0000000 --- a/functions/stdlib/free.c +++ /dev/null @@ -1,48 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 deleted file mode 100644 index 31ce5e4..0000000 --- a/functions/stdlib/getenv.c +++ /dev/null @@ -1,8 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 deleted file mode 100644 index a563350..0000000 --- a/functions/stdlib/malloc.c +++ /dev/null @@ -1,121 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 deleted file mode 100644 index 3b783f4..0000000 --- a/functions/stdlib/mblen.c +++ /dev/null @@ -1,25 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - if (s == NULL) - { - return (0); - } - if (n == 1) - { - return (1); - } - else - { - return (-1); - } -} -*/ diff --git a/functions/stdlib/mbstowcs.c b/functions/stdlib/mbstowcs.c deleted file mode 100644 index a7cd2a0..0000000 --- a/functions/stdlib/mbstowcs.c +++ /dev/null @@ -1,19 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - strncpy((char *)pwcs, s, n); - if (strlen(s) >= n) - { - return (n); - } - return (strlen((char *)pwcs)); -} -*/ diff --git a/functions/stdlib/mbtowc.c b/functions/stdlib/mbtowc.c deleted file mode 100644 index c022d6e..0000000 --- a/functions/stdlib/mbtowc.c +++ /dev/null @@ -1,29 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - if (s == NULL) - { - return (0); - } - if (n == 1) - { - if (pwc != NULL) - { - *pwc = *s; - } - return (1); - } - else - { - return (-1); - } -} -*/ diff --git a/functions/stdlib/qsort.c b/functions/stdlib/qsort.c deleted file mode 100644 index 66bc14b..0000000 --- a/functions/stdlib/qsort.c +++ /dev/null @@ -1,158 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 -/******************************************************************/ -/* qsort.c -- Non-Recursive ISO C qsort() function */ -/* */ -/* Public domain by Raymond Gardner, Englewood CO February 1991 */ -/* Minor mods by Paul Edwards also public domain */ -/* */ -/* Usage: */ -/* qsort(base, nbr_elements, width_bytes, compare_function); */ -/* void *base; */ -/* size_t nbr_elements, width_bytes; */ -/* int (*compare_function)(const void *, const void *); */ -/* */ -/* Sorts an array starting at base, of length nbr_elements, each */ -/* element of size width_bytes, ordered via compare_function, */ -/* which is called as (*compare_function)(ptr_to_element1, */ -/* ptr_to_element2) and returns < 0 if element1 < element2, */ -/* 0 if element1 = element2, > 0 if element1 > element2. */ -/* Most refinements are due to R. Sedgewick. See "Implementing */ -/* Quicksort Programs", Comm. ACM, Oct. 1978, and Corrigendum, */ -/* Comm. ACM, June 1979. */ -/******************************************************************/ - -/* prototypes */ -static void swap_chars(char *, char *, size_t); - -/* -** Compile with -DSWAP_INTS if your machine can access an int at an -** arbitrary location with reasonable efficiency. (Some machines -** cannot access an int at an odd address at all, so be careful.) -*/ - -#ifdef SWAP_INTS - void swap_ints(char *, char *, size_t); - #define SWAP(a, b) (swap_func((char *)(a), (char *)(b), width)) -#else - #define SWAP(a, b) (swap_chars((char *)(a), (char *)(b), size)) -#endif - -#define COMP(a, b) ((*comp)((void *)(a), (void *)(b))) - -#define T 7 /* subfiles of T or fewer elements will */ - /* be sorted by a simple insertion sort */ - /* Note! T must be at least 3 */ - -void qsort(void *basep, size_t nelems, size_t size, - int (*comp)(const void *, const void *)) -{ - char *stack[40], **sp; /* stack and stack pointer */ - char *i, *j, *limit; /* scan and limit pointers */ - size_t thresh; /* size of T elements in bytes */ - char *base; /* base pointer as char * */ - -#ifdef SWAP_INTS - size_t width; /* width of array element */ - void (*swap_func)(char *, char *, size_t); /* swap func pointer*/ - - width = size; /* save size for swap routine */ - swap_func = swap_chars; /* choose swap function */ - if ( size % sizeof(int) == 0 ) { /* size is multiple of ints */ - width /= sizeof(int); /* set width in ints */ - swap_func = swap_ints; /* use int swap function */ - } -#endif - - base = (char *)basep; /* set up char * base pointer */ - thresh = T * size; /* init threshold */ - sp = stack; /* init stack pointer */ - limit = base + nelems * size;/* pointer past end of array */ - for ( ;; ) { /* repeat until break... */ - if ( limit - base > thresh ) { /* if more than T elements */ - /* swap base with middle */ - SWAP(((((size_t)(limit-base))/size)/2)*size+base, base); - i = base + size; /* i scans left to right */ - j = limit - size; /* j scans right to left */ - if ( COMP(i, j) > 0 ) /* Sedgewick's */ - SWAP(i, j); /* three-element sort */ - if ( COMP(base, j) > 0 ) /* sets things up */ - SWAP(base, j); /* so that */ - if ( COMP(i, base) > 0 ) /* *i <= *base <= *j */ - SWAP(i, base); /* *base is pivot element */ - for ( ;; ) { /* loop until break */ - do /* move i right */ - i += size; /* until *i >= pivot */ - while ( COMP(i, base) < 0 ); - do /* move j left */ - j -= size; /* until *j <= pivot */ - while ( COMP(j, base) > 0 ); - if ( i > j ) /* if pointers crossed */ - break; /* break loop */ - SWAP(i, j); /* else swap elements, keep scanning*/ - } - SWAP(base, j); /* move pivot into correct place */ - if ( j - base > limit - i ) { /* if left subfile larger */ - sp[0] = base; /* stack left subfile base */ - sp[1] = j; /* and limit */ - base = i; /* sort the right subfile */ - } else { /* else right subfile larger*/ - sp[0] = i; /* stack right subfile base */ - sp[1] = limit; /* and limit */ - limit = j; /* sort the left subfile */ - } - sp += 2; /* increment stack pointer */ - } else { /* else subfile is small, use insertion sort */ - for ( j = base, i = j+size; i < limit; j = i, i += size ) - for ( ; COMP(j, j+size) > 0; j -= size ) { - SWAP(j, j+size); - if ( j == base ) - break; - } - if ( sp != stack ) { /* if any entries on stack */ - sp -= 2; /* pop the base and limit */ - base = sp[0]; - limit = sp[1]; - } else /* else stack empty, done */ - break; - } - } -} - -/* -** swap nbytes between a and b -*/ - -static void swap_chars(char *a, char *b, size_t nbytes) -{ - char tmp; - do { - tmp = *a; *a++ = *b; *b++ = tmp; - } while ( --nbytes ); -} - -#ifdef SWAP_INTS - -/* -** swap nints between a and b -*/ - -static void swap_ints(char *ap, char *bp, size_t nints) -{ - int *a = (int *)ap, *b = (int *)bp; - int tmp; - do { - tmp = *a; *a++ = *b; *b++ = tmp; - } while ( --nints ); -} - -#endif -*/ diff --git a/functions/stdlib/rand.c b/functions/stdlib/rand.c deleted file mode 100644 index abe58f6..0000000 --- a/functions/stdlib/rand.c +++ /dev/null @@ -1,28 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -static unsigned long myseed = 1; - -void srand(unsigned int seed) -{ - myseed = seed; - return; -} - -int rand(void) -{ - int ret; - - myseed = myseed * 1103515245UL + 12345; - ret = (int)((myseed >> 16) & 0x8fff); - return (ret); -} -*/ diff --git a/functions/stdlib/realloc.c b/functions/stdlib/realloc.c deleted file mode 100644 index 93a2aa4..0000000 --- a/functions/stdlib/realloc.c +++ /dev/null @@ -1,71 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 - assumes size_t of memory chunk at offset -4. -{ - char * newptr; - size_t oldsize; - - if ( ( newptr = malloc(size) ) != 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 ); - } - } - 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 ) - { - if ( chunk->address == ptr ) - { - found++; - } - else - { - chunk=chunk->next; - } - } - 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 deleted file mode 100644 index db73952..0000000 --- a/functions/stdlib/strtox.c +++ /dev/null @@ -1,149 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -long atol( const char * s ) { /* TODO */ }; -long long atoll( const char * s) { /* TODO */ }; - -double strtod( const char * restrict s, char * * restrict endptr ) { /* TODO */ }; -float strtof( const char * restrict s, char * * restrict endptr ) { /* TODO */ }; -long double strtold( const char * restrict s, char * * restrict endptr ) { /* TODO */ }; - -long long strtoll( const char * restrict s, char * * restrict endptr, int base ) { /* TODO */ }; -unsigned long long strtoull( const char * restrict s, char * * restrict endptr, int base) { /* TODO */ }; - -long strtol( const char * restrict s, char * * restrict endptr, int base ) { /* TODO */ }; -unsigned long strtoul( const char * restrict s, char * * restrict endptr, int base) { /* TODO */ }; - -/* PDPC code - unreviewed, verbatim -double atof(const char *nptr) -{ - return (strtod(nptr, (char **)NULL)); -} - -double strtod(const char *nptr, char **endptr) -{ - double x = 0.0; - - while (1) - { - if (isdigit(*nptr)) - { - x = x * 10 + (*nptr - '0'); - } - else - { - if (endptr != NULL) - { - *endptr = (char *)nptr; - } - break; - } - nptr++; - } - return (x); -} - -int atoi(const char *nptr) -{ - return ((int)strtol(nptr, (char **)NULL, 10)); -} - -long int atol(const char *nptr) -{ - return (strtol(nptr, (char **)NULL, 10)); -} - -long int strtol(const char *nptr, char **endptr, int base) -{ - long x = 0; - int undecided = 0; - - if (base == 0) - { - undecided = 1; - } - while (1) - { - if (isdigit(*nptr)) - { - if (base == 0) - { - if (*nptr == '0') - { - base = 8; - } - else - { - base = 10; - undecided = 0; - } - } - x = x * base + (*nptr - '0'); - nptr++; - } - else if (isalpha(*nptr)) - { - if ((*nptr == 'X') || (*nptr == 'x')) - { - if ((base == 0) || ((base == 8) && undecided)) - { - base = 16; - undecided = 0; - } - else - { - break; - } - } - else - { - x = x * base + (toupper((unsigned char)*nptr) - 'A') + 10; - nptr++; - } - } - else - { - break; - } - } - if (endptr != NULL) - { - *endptr = (char *)nptr; - } - return (x); -} - -unsigned long int strtoul(const char *nptr, char **endptr, int base) -{ - unsigned long x = 0; - - while (1) - { - if (isdigit(*nptr)) - { - x = x * base + (*nptr - '0'); - nptr++; - } - else if (isalpha(*nptr) && (base > 10)) - { - x = x * base + (toupper((unsigned char)*nptr) - 'A') + 10; - nptr++; - } - else - { - break; - } - } - if (endptr != NULL) - { - *endptr = (char *)nptr; - } - return (x); -} -*/ diff --git a/functions/stdlib/system.c b/functions/stdlib/system.c deleted file mode 100644 index c0638e4..0000000 --- a/functions/stdlib/system.c +++ /dev/null @@ -1,8 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $Id$ - * ---------------------------------------------------------------------------- - * Public Domain C Library - http://pdclib.sourceforge.net - * This code is Public Domain. Use, modify, and redistribute at will. - * --------------------------------------------------------------------------*/ - -int system( const char * s ) { /* TODO */ }; diff --git a/functions/stdlib/wcstombs.c b/functions/stdlib/wcstombs.c deleted file mode 100644 index dc964f7..0000000 --- a/functions/stdlib/wcstombs.c +++ /dev/null @@ -1,19 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; - -/* PDPC code - unreviewed -{ - strncpy(s, (const char *)pwcs, n); - if (strlen((const char *)pwcs) >= n) - { - return (n); - } - return (strlen(s)); -} -*/ diff --git a/functions/stdlib/wctomb.c b/functions/stdlib/wctomb.c deleted file mode 100644 index 450b242..0000000 --- a/functions/stdlib/wctomb.c +++ /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. - * --------------------------------------------------------------------------*/ - -int wctomb( char * s, wchar_t wchar ) { /* TODO */ }; - -/* PDPC code - unreviewed -{ - if (s != NULL) - { - *s = wchar; - return (1); - } - else - { - return (0); - } -} -*/ diff --git a/functions/string/memchr.c b/functions/string/memchr.c deleted file mode 100644 index 1c9563c..0000000 --- a/functions/string/memchr.c +++ /dev/null @@ -1,23 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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> - -void * memchr( const void * src, int c, size_t n ) -{ - const unsigned char * p = (const unsigned char *) src; - while ( n-- ) - { - if ( *p == (unsigned char) c ) - { - return (void *) p; - } - ++p; - } - return NULL; -} diff --git a/functions/string/memcmp.c b/functions/string/memcmp.c deleted file mode 100644 index 8491ef7..0000000 --- a/functions/string/memcmp.c +++ /dev/null @@ -1,24 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $Id$ - * ---------------------------------------------------------------------------- - * Public Domain C Library - http://pdclib.sourceforge.net - * This code is Public Domain. Use, modify, and redistribute at will. - * --------------------------------------------------------------------------*/ - -#include <__size_t.h> - -int memcmp( const void * src_1, const void * src_2, size_t n ) -{ - const unsigned char * p1 = (const unsigned char *) src_1; - const unsigned char * p2 = (const unsigned char *) src_2; - while ( n-- ) - { - if ( *p1 != *p2 ) - { - return *p2 - *p1; - } - ++p1; - ++p2; - } - return 0; -} diff --git a/functions/string/memcpy.c b/functions/string/memcpy.c deleted file mode 100644 index 4e7b63c..0000000 --- a/functions/string/memcpy.c +++ /dev/null @@ -1,59 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 * memcpy( void * restrict dest, const void * restrict src, size_t n ) -{ - const char * src_p = (const char *) src; - char * dest_p = (char *) dest; - while ( n-- ) - { - *dest_p++ = *src_p++; - } - return dest; -} - -/* TODO: This is code from PDPC, optimizing for word access. - -void *memcpy(void *s1, const void *s2, size_t n) -{ - register unsigned int *p = (unsigned int *)s1; - register unsigned int *cs2 = (unsigned int *)s2; - register unsigned int *endi; - - endi = (unsigned int *)((char *)p + (n & ~0x03)); - while (p != endi) - { - *p++ = *cs2++; - } - switch (n & 0x03) - { - case 0: - break; - case 1: - *(char *)p = *(char *)cs2; - break; - case 2: - *(char *)p = *(char *)cs2; - p = (unsigned int *)((char *)p + 1); - cs2 = (unsigned int *)((char *)cs2 + 1); - *(char *)p = *(char *)cs2; - break; - case 3: - *(char *)p = *(char *)cs2; - p = (unsigned int *)((char *)p + 1); - cs2 = (unsigned int *)((char *)cs2 + 1); - *(char *)p = *(char *)cs2; - p = (unsigned int *)((char *)p + 1); - cs2 = (unsigned int *)((char *)cs2 + 1); - *(char *)p = *(char *)cs2; - break; - } - return (s1); -} -*/ diff --git a/functions/string/memmove.c b/functions/string/memmove.c deleted file mode 100644 index f7ed6c1..0000000 --- a/functions/string/memmove.c +++ /dev/null @@ -1,31 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 * memmove( void * dest, const void * src, size_t n ) -{ - const char * src_p = (const char *) src; - char * dest_p = (char *) dest; - if ( dest_p < src_p ) - { - while ( n-- ) - { - *dest_p++ = *src_p++; - } - } - else - { - src_p += n; - dest_p += n; - while ( n-- ) - { - *dest_p-- = *src_p--; - } - } - return dest; -} diff --git a/functions/string/memset.c b/functions/string/memset.c deleted file mode 100644 index 17d96f5..0000000 --- a/functions/string/memset.c +++ /dev/null @@ -1,19 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 * memset( void * dest, int c, size_t n ) -{ - unsigned char ch = (unsigned char) c; - unsigned char * dest_p = (unsigned char *) dest; - while ( n-- ) - { - *dest_p++ = ch; - } - return dest; -} diff --git a/functions/string/strcat.c b/functions/string/strcat.c deleted file mode 100644 index eab90c1..0000000 --- a/functions/string/strcat.c +++ /dev/null @@ -1,23 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 ) -{ - char * dest_p = dest; - if ( *dest_p != '\0' ) - { - while ( *++dest_p != '\0' ) - { - /* EMPTY */ - } - } - while ( (*dest_p++ = *src++) != '\0' ) - { - /* EMPTY */ - } - return dest; -} diff --git a/functions/string/strchr.c b/functions/string/strchr.c deleted file mode 100644 index 960e7e4..0000000 --- a/functions/string/strchr.c +++ /dev/null @@ -1,21 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $Id$ - * ---------------------------------------------------------------------------- - * Public Domain C Library - http://pdclib.sourceforge.net - * This code is Public Domain. Use, modify, and redistribute at will. - * --------------------------------------------------------------------------*/ - -#include <__NULL.h> - -char * strchr( const char * src, int c ) -{ - while ( *src != '\0' ) - { - if ( *src == (const char) c ) - { - return (char *) src; - } - ++src; - } - return NULL; -} diff --git a/functions/string/strcmp.c b/functions/string/strcmp.c deleted file mode 100644 index 874828e..0000000 --- a/functions/string/strcmp.c +++ /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. - * --------------------------------------------------------------------------*/ - -int strcmp( const char * src_1, const char * src_2 ) -{ - while ( ( *src_1 != '\0' ) && ( *src_1 == *src_2 ) ) - { - ++src_1; - ++src_2; - } - return ( *src_1 - *src_2 ); -} diff --git a/functions/string/strcoll.c b/functions/string/strcoll.c deleted file mode 100644 index 3c841e5..0000000 --- a/functions/string/strcoll.c +++ /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. - * --------------------------------------------------------------------------*/ - -/* TODO: Dummy function, does not support locales. */ - -int strcmp( const char * src_1, const char * src_2 ); - -int strcoll( const char * src_1, const char * src_2 ) -{ - return strcmp( src_1, src_2 ); -} diff --git a/functions/string/strcpy.c b/functions/string/strcpy.c deleted file mode 100644 index f9b340e..0000000 --- a/functions/string/strcpy.c +++ /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. - * --------------------------------------------------------------------------*/ - -char * strcpy( char * restrict dest, const char * restrict src ) -{ - char * tmp = dest; - while ( ( *dest++ = *src++ ) != '\0' ) - { - /* EMPTY */ - } - return tmp; -} diff --git a/functions/string/strcspn.c b/functions/string/strcspn.c deleted file mode 100644 index 7c4d9b8..0000000 --- a/functions/string/strcspn.c +++ /dev/null @@ -1,27 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $Id$ - * ---------------------------------------------------------------------------- - * Public Domain C Library - http://pdclib.sourceforge.net - * This code is Public Domain. Use, modify, and redistribute at will. - * --------------------------------------------------------------------------*/ - -#include <__size_t.h> - -size_t strcspn( const char * src_1, const char * src_2 ) -{ - size_t len = 0; - const char * src_p; - while ( src_1[len] != '\0' ) - { - src_p = src_2; - while ( *src_p != '\0' ) - { - if ( src_1[len] == *src_p++ ) - { - return len; - } - } - ++len; - } - return len; -} diff --git a/functions/string/strerror.c b/functions/string/strerror.c deleted file mode 100644 index 1cd820c..0000000 --- a/functions/string/strerror.c +++ /dev/null @@ -1,30 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $Id$ - * ---------------------------------------------------------------------------- - * Public Domain C Library - http://pdclib.sourceforge.net - * This code is Public Domain. Use, modify, and redistribute at will. - * --------------------------------------------------------------------------*/ - -#include - -char * strerror( int errcode ) -{ - switch ( errcode ) - { - case 0: - return "no error"; - break; - case EDOM: - return "domain error"; - break; - case EILSEQ: - return "illegal sequence"; - break; - case ERANGE: - return "range error"; - break; - default: - return "unknown error"; - break; - } -} diff --git a/functions/string/strlen.c b/functions/string/strlen.c deleted file mode 100644 index 05e5e3b..0000000 --- a/functions/string/strlen.c +++ /dev/null @@ -1,18 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $Id$ - * ---------------------------------------------------------------------------- - * Public Domain C Library - http://pdclib.sourceforge.net - * This code is Public Domain. Use, modify, and redistribute at will. - * --------------------------------------------------------------------------*/ - -#include <__size_t.h> - -size_t strlen( const char * src ) -{ - size_t len = 0; - while ( src[len] != '\0' ) - { - ++len; - } - return len; -} diff --git a/functions/string/strncat.c b/functions/string/strncat.c deleted file mode 100644 index 4a81991..0000000 --- a/functions/string/strncat.c +++ /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. - * --------------------------------------------------------------------------*/ - -#include <__size_t.h> - -char * strncat( char * restrict dest, const char * restrict src, size_t n ) -{ - char * tmp = dest; - while ( *dest != '\0' ) - { - ++dest; - } - while ( ( n-- > 0 ) && ( *src != '\0' ) ) - { - *dest++ = *src++; - } - return tmp; -} diff --git a/functions/string/strncmp.c b/functions/string/strncmp.c deleted file mode 100644 index 9e5e615..0000000 --- a/functions/string/strncmp.c +++ /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. - * --------------------------------------------------------------------------*/ - -#include <__size_t.h> - -int strncmp( const char * src_1, const char * src_2, size_t n ) -{ - while ( ( n-- != 0 ) && ( *src_1 == *src_2 ) ) - { - ++src_1; - ++src_2; - } - if ( ( n == 0 ) ) - { - return 0; - } - return ( *src_1 - *src_2 ); -} diff --git a/functions/string/strncpy.c b/functions/string/strncpy.c deleted file mode 100644 index e89332c..0000000 --- a/functions/string/strncpy.c +++ /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. - * --------------------------------------------------------------------------*/ - -#include <__size_t.h> - -char * strncpy( char * restrict dest, const char * restrict src, size_t n ) -{ - char * tmp = dest; - while ( ( n-- != 0 ) && ( ( *dest++ = *src++ ) != '\0' ) ) - { - /* EMPTY */ - } - while ( n-- != 0 ) - { - *dest++ = '\0'; - } - return tmp; -} diff --git a/functions/string/strpbrk.c b/functions/string/strpbrk.c deleted file mode 100644 index 1006ab6..0000000 --- a/functions/string/strpbrk.c +++ /dev/null @@ -1,27 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $Id$ - * ---------------------------------------------------------------------------- - * Public Domain C Library - http://pdclib.sourceforge.net - * This code is Public Domain. Use, modify, and redistribute at will. - * --------------------------------------------------------------------------*/ - -#include <__NULL.h> - -char * strpbrk( const char *src_1, const char * src_2 ) -{ - const char * p1 = src_1; - const char * p2; - while ( *p1 != '\0' ) - { - p2 = src_2; - while ( *p2 != '\0' ) - { - if ( *p1 == *p2++ ) - { - return (char *) p1; - } - } - ++p1; - } - return NULL; -} diff --git a/functions/string/strrchr.c b/functions/string/strrchr.c deleted file mode 100644 index 4f1e2b5..0000000 --- a/functions/string/strrchr.c +++ /dev/null @@ -1,26 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $Id$ - * ---------------------------------------------------------------------------- - * Public Domain C Library - http://pdclib.sourceforge.net - * This code is Public Domain. Use, modify, and redistribute at will. - * --------------------------------------------------------------------------*/ - -#include <__NULL.h> - -char * strrchr( const char * src, int c ) -{ - const char * p = src; - while ( *p != '\0' ) - { - ++p; - } - while ( p >= src ) - { - if ( *p == (char) c ) - { - return (char *) p; - } - --p; - } - return NULL; -} diff --git a/functions/string/strspn.c b/functions/string/strspn.c deleted file mode 100644 index 55cf29a..0000000 --- a/functions/string/strspn.c +++ /dev/null @@ -1,32 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $Id$ - * ---------------------------------------------------------------------------- - * Public Domain C Library - http://pdclib.sourceforge.net - * This code is Public Domain. Use, modify, and redistribute at will. - * --------------------------------------------------------------------------*/ - -#include <__size_t.h> - -size_t strspn( const char * src_1, const char * src_2 ) -{ - size_t len = 0; - const char * p; - while ( src_1[ len ] != '\0' ) - { - p = src_2; - while ( *p != '\0' ) - { - if ( *src_1 == *p ) - { - break; - } - ++p; - } - if ( *p == '\0' ) - { - return len; - } - ++len; - } - return len; -} diff --git a/functions/string/strstr.c b/functions/string/strstr.c deleted file mode 100644 index 4a60479..0000000 --- a/functions/string/strstr.c +++ /dev/null @@ -1,30 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $Id$ - * ---------------------------------------------------------------------------- - * Public Domain C Library - http://pdclib.sourceforge.net - * This code is Public Domain. Use, modify, and redistribute at will. - * --------------------------------------------------------------------------*/ - -#include <__NULL.h> - -char * strstr( const char * src_1, const char * src_2 ) -{ - const char * p1 = src_1; - const char * p2; - while ( *src_1 != '\0' ) - { - p2 = src_2; - while ( ( *p2 != '\0' ) && ( *p1 == *p2 ) ) - { - ++p1; - ++p2; - } - if ( *p2 == '\0' ) - { - return (char *) src_1; - } - ++src_1; - p1 = src_1; - } - return NULL; -} diff --git a/functions/string/strtok.c b/functions/string/strtok.c deleted file mode 100644 index 70d2cd7..0000000 --- a/functions/string/strtok.c +++ /dev/null @@ -1,39 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 ) -{ - static char * store = NULL; - size_t token_length; - - if ( src != NULL ) - { - /* new string */ - store = src; - } - if ( store == NULL ) - { - /* no old string, no new string, nothing to do */ - return NULL; - } - src += strspn( src, seperators ); /* skipping leading seperators */ - if ( strlen( src ) == 0 ) - { - /* no more to parse */ - return ( store = NULL ); - } - token_length = strcspn( src, seperators ); - if ( src[ token_length ] == '\0' ) - { - /* parsed to end of string */ - store = NULL; - return src; - } - src[ token_length ] = '\0'; - store = src + token_length + 1; - return src; -} diff --git a/functions/string/strxfrm.c b/functions/string/strxfrm.c deleted file mode 100644 index a971e38..0000000 --- a/functions/string/strxfrm.c +++ /dev/null @@ -1,23 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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. */ - -size_t strlen( const char * src ); -char * strncpy( char * restrict dest, const char * restrict src, size_t n ); - -size_t strxfrm( char * restrict dest, const char * restrict src, size_t n ) -{ - size_t len = strlen( src ); - if ( len < n ) - { - strncpy( dest, src, len ); - } - return len; -} diff --git a/functions/time.c b/functions/time.c deleted file mode 100644 index 54dcc01..0000000 --- a/functions/time.c +++ /dev/null @@ -1,539 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -char * ctime( const time_t * tod ) { /* TODO */ }; -double difftime( time_t t1, time_t t0 ) { /* TODO */ }; -struct tm * gmtime( const time_t * tod ) { /* TODO */ }; -struct tm * localtime( const time_t * tod ) { /* TODO */ }; -time_t mktime( struct tm * tptr ) { /* TODO */ }; -size_t strftime( char * restrict s, size_t n, const char * restrict format, - const struct tm * restrict tptr ) { /* TODO */ }; -time_t time( time_t * tod ) { /* TODO */ }; - -/* PDPC code - unreviewed, verbatim -/* scalar date routines -- public domain by Ray Gardner -** These will work over the range 1-01-01 thru 14699-12-31 -** The functions written by Ray are isleap, months_to_days, -** years_to_days, ymd_to_scalar, scalar_to_ymd. -** modified slightly by Paul Edwards -*/ - -static int isleap(unsigned yr) -{ - return yr % 400 == 0 || (yr % 4 == 0 && yr % 100 != 0); -} - -static unsigned months_to_days(unsigned month) -{ - return (month * 3057 - 3007) / 100; -} - -static long years_to_days (unsigned yr) -{ - return yr * 365L + yr / 4 - yr / 100 + yr / 400; -} - -static long ymd_to_scalar(unsigned yr, unsigned mo, unsigned day) -{ - long scalar; - - scalar = day + months_to_days(mo); - if ( mo > 2 ) /* adjust if past February */ - scalar -= isleap(yr) ? 1 : 2; - yr--; - scalar += years_to_days(yr); - return (scalar); -} - -static void scalar_to_ymd(long scalar, - unsigned *pyr, - unsigned *pmo, - unsigned *pday) -{ - unsigned n; /* compute inverse of years_to_days() */ - - n = (unsigned)((scalar * 400L) / 146097L); - while (years_to_days(n) < scalar) - { - n++; - } - for ( n = (unsigned)((scalar * 400L) / 146097L); years_to_days(n) < scalar; ) - n++; /* 146097 == years_to_days(400) */ - *pyr = n; - n = (unsigned)(scalar - years_to_days(n-1)); - if ( n > 59 ) { /* adjust if past February */ - n += 2; - if ( isleap(*pyr) ) - n -= n > 62 ? 1 : 2; - } - *pmo = (n * 100 + 3007) / 3057; /* inverse of months_to_days() */ - *pday = n - months_to_days(*pmo); - return; -} - -time_t time(time_t *timer) -{ - time_t tt; -#ifdef __OS2__ - DATETIME dt; - APIRET rc; -#endif -#if (defined(__MSDOS__) || defined(__MVS__)) - struct { - int year; - int month; - int day; - int hours; - int minutes; - int seconds; - int hundredths; - } dt; -#endif -#ifdef __MVS__ - unsigned int clk[2]; -#endif - -#ifdef __OS2__ - rc = DosGetDateTime(&dt); - if (rc != 0) - { - tt = (time_t)-1; - } - else -#endif -#ifdef __MSDOS__ - __datetime(&dt); -#endif -#ifdef __MVS__ - tt = __getclk(clk); -#else - - { - tt = ymd_to_scalar(dt.year, dt.month, dt.day) - - ymd_to_scalar(1970, 1, 1); - tt = tt * 24 + dt.hours; - tt = tt * 60 + dt.minutes; - tt = tt * 60 + dt.seconds; - } -#endif - if (timer != NULL) - { - *timer = tt; - } - return (tt); -} - -clock_t clock(void) -{ - return ((clock_t)-1); -} - -double difftime(time_t time1, time_t time0) -{ - return ((double)(time1 - time0)); -} - -time_t mktime(struct tm *timeptr) -{ - time_t tt; - - if ((timeptr->tm_year < 70) || (timeptr->tm_year > 120)) - { - tt = (time_t)-1; - } - else - { - tt = ymd_to_scalar(timeptr->tm_year + 1900, - timeptr->tm_mon, - timeptr->tm_mday) - - ymd_to_scalar(1970, 1, 1); - tt = tt * 24 + timeptr->tm_hour; - tt = tt * 60 + timeptr->tm_min; - tt = tt * 60 + timeptr->tm_sec; - } - return (tt); -} - -char *asctime(const struct tm *timeptr) -{ - static const char wday_name[7][3] = { - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" - }; - static const char mon_name[12][3] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" - }; - static char result[26]; - - sprintf(result, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n", - wday_name[timeptr->tm_wday], - mon_name[timeptr->tm_mon], - timeptr->tm_mday, timeptr->tm_hour, - timeptr->tm_min, timeptr->tm_sec, - 1900 + timeptr->tm_year); - return result; -} - -char *ctime(const time_t *timer) -{ - return (asctime(localtime(timer))); -} - -struct tm *gmtime(const time_t *timer) -{ - return (localtime(timer)); -} - -/* dow - written by Paul Edwards, 1993-01-31 */ -/* Released to the Public Domain */ -/* This routine will work over the range 1-01-01 to 32767-12-31. - It assumes the current calendar system has always been in - place in that time. If you pass 0 or negative years, then - it produces results on the assumption that there is a year - 0. It should always produce a value in the range of 0..6 - if a valid month and day have been passed, no matter what - the year is. However, it has not been tested for negative - years, because the results are meaningless anyway. It is - mainly to stop people playing silly buggers and causing - the macro to crash on negative years. */ - -/* Modified 1994-08-26 by Paul Edwards to make it return - 0..6 for Sunday..Saturday instead of Monday..Sunday */ -/* change the "(d) + 1" to "(d) + 0" to get it back to Monday - to Sunday if you want */ - -#define dow(y,m,d) \ - ((((((m)+9)%12+1)<<4)%27 + (d) + 1 + \ - ((y)%400+400) + ((y)%400+400)/4 - ((y)%400+400)/100 + \ - (((m)<=2) ? ( \ - (((((y)%4)==0) && (((y)%100)!=0)) || (((y)%400)==0)) \ - ? 5 : 6) : 0)) % 7) - -static struct tm tms; - -struct tm *localtime(const time_t *timer) -{ - unsigned yr, mo, da; - unsigned long secs; - unsigned long days; - - days = *timer / (60L*60*24); - secs = *timer % (60L*60*24); - scalar_to_ymd(days + ymd_to_scalar(1970, 1, 1), &yr, &mo, &da); - tms.tm_year = yr - 1900; - tms.tm_mon = mo - 1; - tms.tm_mday = da; - tms.tm_yday = (int)(ymd_to_scalar(tms.tm_year + 1900, 1, 1) - - ymd_to_scalar(tms.tm_year + 1900, mo, da)); - tms.tm_wday = dow(tms.tm_year + 1900, mo, da); - tms.tm_isdst = -1; - tms.tm_sec = (int)(secs % 60); - secs /= 60; - tms.tm_min = (int)(secs % 60); - secs /= 60; - tms.tm_hour = (int)secs; - return (&tms); -} - -/* - * strftime.c - * - * implements the iso c function strftime() - * - * written 1989-09-06 by jim nutt - * released into the public domain by jim nutt - * - * modified 1989-10-21 by Rob Duff - * - * modified 1994-08-26 by Paul Edwards - */ - -static char *aday[] = { - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" -}; - -static char *day[] = { - "Sunday", "Monday", "Tuesday", "Wednesday", - "Thursday", "Friday", "Saturday" -}; - -static char *amonth[] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" -}; - -static char *month[] = { - "January", "February", "March", "April", "May", "June", - "July", "August", "September", "October", "November", "December" -}; - -static char *__tzname[2] = { "" "" }; -static char buf[26]; - -static void strfmt(char *str, const char *fmt, ...); - -/** - * - * size_t strftime(char *str, - * size_t maxs, - * const char *fmt, - * const struct tm *t) - * - * this functions acts much like a sprintf for time/date output. - * given a pointer to an output buffer, a format string and a - * time, it copies the time to the output buffer formatted in - * accordance with the format string. the parameters are used - * as follows: - * - * str is a pointer to the output buffer, there should - * be at least maxs characters available at the address - * pointed to by str. - * - * maxs is the maximum number of characters to be copied - * into the output buffer, included the '\0' terminator - * - * fmt is the format string. a percent sign (%) is used - * to indicate that the following character is a special - * format character. the following are valid format - * characters: - * - * %A full weekday name (Monday) - * %a abbreviated weekday name (Mon) - * %B full month name (January) - * %b abbreviated month name (Jan) - * %c standard date and time representation - * %d day-of-month (01-31) - * %H hour (24 hour clock) (00-23) - * %I hour (12 hour clock) (01-12) - * %j day-of-year (001-366) - * %M minute (00-59) - * %m month (01-12) - * %p local equivalent of AM or PM - * %S second (00-59) - * %U week-of-year, first day sunday (00-53) - * %W week-of-year, first day monday (00-53) - * %w weekday (0-6, sunday is 0) - * %X standard time representation - * %x standard date representation - * %Y year with century - * %y year without century (00-99) - * %Z timezone name - * %% percent sign - * - * the standard date string is equivalent to: - * - * %a %b %d %Y - * - * the standard time string is equivalent to: - * - * %H:%M:%S - * - * the standard date and time string is equivalent to: - * - * %a %b %d %H:%M:%S %Y - * - * strftime returns the number of characters placed in the - * buffer, not including the terminating \0, or zero if more - * than maxs characters were produced. - * -**/ - -size_t strftime(char *s, size_t maxs, const char *f, const struct tm *t) -{ - int w; - char *p, *q, *r; - - p = s; - q = s + maxs - 1; - while ((*f != '\0')) - { - if (*f++ == '%') - { - r = buf; - switch (*f++) - { - case '%' : - r = "%"; - break; - - case 'a' : - r = aday[t->tm_wday]; - break; - - case 'A' : - r = day[t->tm_wday]; - break; - - case 'b' : - r = amonth[t->tm_mon]; - break; - - case 'B' : - r = month[t->tm_mon]; - break; - - case 'c' : - strfmt(r, "%0 %0 %2 %2:%2:%2 %4", - aday[t->tm_wday], amonth[t->tm_mon], - t->tm_mday,t->tm_hour, t->tm_min, - t->tm_sec, t->tm_year+1900); - break; - - case 'd' : - strfmt(r,"%2",t->tm_mday); - break; - - case 'H' : - strfmt(r,"%2",t->tm_hour); - break; - - case 'I' : - strfmt(r,"%2",(t->tm_hour%12)?t->tm_hour%12:12); - break; - - case 'j' : - strfmt(r,"%3",t->tm_yday+1); - break; - - case 'm' : - strfmt(r,"%2",t->tm_mon+1); - break; - - case 'M' : - strfmt(r,"%2",t->tm_min); - break; - - case 'p' : - r = (t->tm_hour>11)?"PM":"AM"; - break; - - case 'S' : - strfmt(r,"%2",t->tm_sec); - break; - - case 'U' : - w = t->tm_yday/7; - if (t->tm_yday%7 > t->tm_wday) - w++; - strfmt(r, "%2", w); - break; - - case 'W' : - w = t->tm_yday/7; - if (t->tm_yday%7 > (t->tm_wday+6)%7) - w++; - strfmt(r, "%2", w); - break; - - case 'w' : - strfmt(r,"%1",t->tm_wday); - break; - - case 'x' : - strfmt(r, "%3s %3s %2 %4", aday[t->tm_wday], - amonth[t->tm_mon], t->tm_mday, t->tm_year+1900); - break; - - case 'X' : - strfmt(r, "%2:%2:%2", t->tm_hour, - t->tm_min, t->tm_sec); - break; - - case 'y' : - strfmt(r,"%2",t->tm_year%100); - break; - - case 'Y' : - strfmt(r,"%4",t->tm_year+1900); - break; - - case 'Z' : - r = (t->tm_isdst) ? __tzname[1] : __tzname[0]; - break; - - default: - buf[0] = '%'; /* reconstruct the format */ - buf[1] = f[-1]; - buf[2] = '\0'; - if (buf[1] == 0) - f--; /* back up if at end of string */ - } - while (*r) - { - if (p == q) - { - *q = '\0'; - return 0; - } - *p++ = *r++; - } - } - else - { - if (p == q) - { - *q = '\0'; - return 0; - } - *p++ = f[-1]; - } - } - *p = '\0'; - return (size_t)(p - s); -} - -static int pow[5] = { 1, 10, 100, 1000, 10000 }; - -/** - * static void strfmt(char *str, char *fmt); - * - * simple sprintf for strftime - * - * each format descriptor is of the form %n - * where n goes from zero to four - * - * 0 -- string %s - * 1..4 -- int %?.?d - * -**/ - -static void strfmt(char *str, const char *fmt, ...) -{ - int ival, ilen; - char *sval; - va_list vp; - - va_start(vp, fmt); - while (*fmt) - { - if (*fmt++ == '%') - { - ilen = *fmt++ - '0'; - if (ilen == 0) /* zero means string arg */ - { - sval = va_arg(vp, char*); - while (*sval) - *str++ = *sval++; - } - else /* always leading zeros */ - { - ival = va_arg(vp, int); - while (ilen) - { - ival %= pow[ilen--]; - *str++ = (char)('0' + ival / pow[ilen]); - } - } - } - else *str++ = fmt[-1]; - } - *str = '\0'; - va_end(vp); -} -*/ diff --git a/functions/wctype.c b/functions/wctype.c deleted file mode 100644 index 922cdd6..0000000 --- a/functions/wctype.c +++ /dev/null @@ -1,27 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 */ }; -int iswblank( wint_t c ) { /* TODO */ }; -int iswcntrl( wint_t c ) { /* TODO */ }; -int iswctype( wint_t c, wctype_t category ) { /* TODO */ }; -int iswdigit( wint_t c ) { /* TODO */ }; -int iswgraph( wint_t c ) { /* TODO */ }; -int iswlower( wint_t c ) { /* TODO */ }; -int iswprint( wint_t c ) { /* TODO */ }; -int iswpunct( wint_t c ) { /* TODO */ }; -int iswspace( wint_t c ) { /* TODO */ }; -int iswupper( wint_t c ) { /* TODO */ }; -int iswxdigit( wint_t c ) { /* TODO */ }; - -wint_t towctrans( wint_t c, wctrans_t category ) { /* TODO */ }; -wint_t towlower( wint_t c ) { /* TODO */ }; -wint_t towupper( wint_t c ) { /* TODO */ }; - -wctrans_t wctrans( const char * property ) { /* TODO */ }; -wctype_t wctype( const char * property ) { /* TODO */ }; diff --git a/includes/__intern.h b/includes/__intern.h deleted file mode 100644 index 937b948..0000000 --- a/includes/__intern.h +++ /dev/null @@ -1,45 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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/complex.h b/includes/complex.h deleted file mode 100644 index ea6d35d..0000000 --- a/includes/complex.h +++ /dev/null @@ -1,156 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 - * --------------------------------------------------------------------------*/ - -#ifndef __cplusplus -#define complex _Complex -#endif - -#define _Complex_I ( const float _Complex ) { 0, 1 } - -#ifdef __PERSONALITY_SUPPORTS_IMAGINARY -#define imaginary _Imaginary -#endif // __PERSONALITY_SUPPORTS_IMAGINARY - -#ifdef imaginary -#define _Imaginary_I ( ( const float _Imaginary ) 1 ) -#endif - -#ifdef imaginary -#define I _Imaginary_I -#else -#define I _Complex_I -#endif - -/* ---------------------------------------------------------------------------- - * FUNCTIONS - * --------------------------------------------------------------------------*/ - -/* 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. */ -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. */ -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. */ -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. */ -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. */ -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. */ -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. */ -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. */ -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. */ -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. */ -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. */ -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. */ -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. */ -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. */ -double creal( double _Complex x ); -float crealf( float _Complex x ); -long double creall( long double _Complex x ); - -/* 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. */ -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. */ -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. */ -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. */ -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. */ -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. */ -double _Complex cproj( double _Complex x ); -float _Complex cprojf( float _Complex x ); -long double _Complex cprojl( long double _Complex x ); - -#endif /* _COMPLEX_H */ diff --git a/includes/errno.h b/includes/errno.h deleted file mode 100644 index 5bd397d..0000000 --- a/includes/errno.h +++ /dev/null @@ -1,34 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 _PERSONALITY -#define _PERSONALITY _PERSONALITY -#include "__personality.h" -#endif /* _PERSONALITY */ - -/* TODO: Documentation */ - -/* ---------------------------------------------------------------------------- - * DECLARATIONS - * --------------------------------------------------------------------------*/ - -extern int errno; - -/* ---------------------------------------------------------------------------- - * DEFINES - * --------------------------------------------------------------------------*/ - -#define EDOM _EDOM /* domain error */ -#define EILSEQ _EILSEQ /* illegal (multibyte) sequence */ -#define ERANGE _ERANGE /* range error */ - -#endif /* _ERRNO_H */ diff --git a/includes/float.h b/includes/float.h deleted file mode 100644 index d9696ac..0000000 --- a/includes/float.h +++ /dev/null @@ -1,28 +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 - * ---------------------------------------------------------------------------- - * 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/iso646.h b/includes/iso646.h deleted file mode 100644 index 61d84ed..0000000 --- a/includes/iso646.h +++ /dev/null @@ -1,31 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 - -/* ---------------------------------------------------------------------------- - * DEFINES - * --------------------------------------------------------------------------*/ - -#define and && -#define and_eq &= -#define bitand & -#define bitor | -#define compl ~ -#define not ! -#define not_eq != -#define or || -#define or_eq |= -#define xor ^ -#define xor_eq ^= - -#endif /* _ISO646_H */ diff --git a/includes/locale.h b/includes/locale.h deleted file mode 100644 index f9dd659..0000000 --- a/includes/locale.h +++ /dev/null @@ -1,93 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 _NULL -#include "__intern.h" -#endif /* _NULL */ - -/* ---------------------------------------------------------------------------- - * DEFINES - * --------------------------------------------------------------------------*/ - -#define NULL _NULL - -/* 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 */ - -/* ---------------------------------------------------------------------------- - * 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_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? */ -}; - -/* ---------------------------------------------------------------------------- - * 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. - */ -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. - */ -char * setlocale( int categories, const char * locale_name ); - -#endif /* _LOCALE_H */ diff --git a/includes/setjmp.h b/includes/setjmp.h deleted file mode 100644 index 8afef14..0000000 --- a/includes/setjmp.h +++ /dev/null @@ -1,28 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 - -/* TODO: Documentation */ - -/* ---------------------------------------------------------------------------- - * TYPEDEFS - * --------------------------------------------------------------------------*/ - -struct jmp_buf[1]; /* TODO */ - -/* ---------------------------------------------------------------------------- - * FUNCTIONS - * --------------------------------------------------------------------------*/ - -int setjmp( jmp_buf env ); -void longjmp( jmp_buf env, int val ); - -#endif /* _SETJMP_H */ diff --git a/includes/stdarg.h b/includes/stdarg.h deleted file mode 100644 index 62d0e40..0000000 --- a/includes/stdarg.h +++ /dev/null @@ -1,80 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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/stddef.h b/includes/stddef.h deleted file mode 100644 index cec8dfb..0000000 --- a/includes/stddef.h +++ /dev/null @@ -1,46 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 _NULL -#include "__intern.h" -#endif - -/* TODO: Documentation */ - -/* ---------------------------------------------------------------------------- - * MACROS - * --------------------------------------------------------------------------*/ - -#define NULL _NULL - -#define offsetof( s-type, mbr ) /* TODO - to __intern.h / __personality.h? */ - -/* ---------------------------------------------------------------------------- - * TYPEDEFS - * --------------------------------------------------------------------------*/ - -#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 */ - -/* 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/stdio.h b/includes/stdio.h deleted file mode 100644 index ddf7d98..0000000 --- a/includes/stdio.h +++ /dev/null @@ -1,585 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 _NULL -#include "__intern.h" -#endif /* _NULL */ - -/* ---------------------------------------------------------------------------- - * MACROS - * --------------------------------------------------------------------------*/ - -#define NULL _NULL - -#define _IOFBF 0 // @see setvbuf() -#define _IOLBF 1 // @see setvbuf() -#define _IONBF 2 // @see setvbuf() - -#define SEEK_SET 0 // @see fseek() -#define SEEK_CUR 1 // @see fseek() -#define SEEK_END 2 // @see fseek() - -#define EOF -1 - -/* ---------------------------------------------------------------------------- - * TYPEDEFS - * --------------------------------------------------------------------------*/ - -#ifndef _SIZE_T -#define _SIZE_T _SIZE_T -typedef __size_t size_t -#endif /* _SIZE_T */ - -/* file position, buffer pointer, ErrorIndicator, EOFIndicator, HostRC */ -typedef FILE; /* TODO */ - -/* file position */ -typedef fpos_t; /* TODO */ - -extern FILE * stdin; -extern FILE * stdout; -extern FILE * stderr; - -/* ---------------------------------------------------------------------------- - * FUNCTIONS - * --------------------------------------------------------------------------*/ - -/* TABLE OF CONTENTS (in order of appearance) - * - * General File Handling - * * fopen() - * * freopen() - * * fflush() - * * feof() - * * ferror() - * * clearerr() - * * fclose() - * - * Rename / Remove - * * rename() - * * remove() - * - * Temporary Files - * * tmpfile() - * * tmpnam() - * - * File Positioning - * * fseek() - * * rewind() - * * ftell() - * * fgetpos() - * * fsetpos() - * - * Reading - * * fgetc() - * * getc() - * * getchar() - * * ungetc() - * * fgets() - * * gets() - * - * Writing - * * fputc() - * * putc() - * * putchar() - * * fputs() - * * puts() - * - * Formatted Reading - * * fscanf() - * * scanf() - * * sscanf() - * * vfscanf() - * * vscanf() - * * vsscanf() - * - * Formatted Writing - * * fprintf() - * * printf() - * * sprintf() - * * snprintf() - * * vfprintf() - * * vprintf() - * * vsprintf() - * * vsnprintf() - * - * Special - * * perror() - * - * Binary Read / Write - * * fread() - * * fwrite() - * - * Buffer Handling - * * setvbuf() - * * setbuf() - * - */ - -/** 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. - */ -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. - */ -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). - */ -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. - */ -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. - */ -int ferror( FILE * fh ); - -/** CLEAR ERRor. Clears EOF and error indicator of a 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.) - */ -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.) - */ -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.) - */ -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.) - */ -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. - */ -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. - */ -int fseek( FILE * fh, long offset, int start ); - -/** REWIND file. Equivalent to (void) fseek( fh, 0, SEEK_SET ). - * @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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -int getc( FILE * fh ); - -/** GET CHARacter. Equivalent to getc( stdin ). - * @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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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. - */ -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 setbuf( FILE * restrict fh, char * restrict buf ); - -/* ------------------------------------------------------------------------- */ - -/* PDPC code - unreviewed -/* - What we have is an internal buffer, which is 8 characters - longer than the actually used buffer. E.g. say BUFSIZ is - 512 bytes, then we actually allocate 520 bytes. The first - 2 characters will be junk, the next 2 characters set to NUL, - for protection against some backward-compares. The fourth-last - character is set to '\n', to protect against overscan. The - last 3 characters will be junk, to protect against memory - violation. intBuffer is the internal buffer, but everyone refers - to fbuf, which is actually set to the &intBuffer[4]. Also, - szfbuf is the size of the "visible" buffer, not the internal - buffer. The reason for the 2 junk characters at the beginning - is to align the buffer on a 4-byte boundary. -*/ - -typedef struct -{ -#if (defined(__OS2__) || defined(__32BIT__)) - unsigned long hfile; /* OS/2 file handle */ -#endif -#if (defined(__MSDOS__) || defined(__DOS__) || defined(__POWERC)) - int hfile; /* dos file handle */ -#endif -#if (defined(__MVS__)) - void *hfile; - int recfm; - int style; - int lrecl; - char ddname[9]; -#endif - int quickBin; /* 1 = do DosRead NOW!!!! */ - int quickText; /* 1 = quick text mode */ - int textMode; /* 1 = text mode, 0 = binary mode */ - int intFno; /* internal file number */ - unsigned long bufStartR; /* buffer start represents, e.g. if we - have read in 3 buffers, each of 512 bytes, and we are - currently reading from the 3rd buffer, then the first - character in the buffer would be 1024, so that is what is - put in bufStartR. */ - char *fbuf; /* file buffer - this is what all the routines - look at. */ - size_t szfbuf; /* size of file buffer (the one that the routines - see, and the user allocates, and what is actually - read in from disk) */ - char *upto; /* what character is next to read from buffer */ - char *endbuf; /* pointer PAST last character in buffer, ie it - points to the '\n' in the internal buffer */ - int errorInd; /* whether an error has occurred on this file */ - int eofInd; /* whether EOF has been reached on this file */ - int ungetCh; /* character pushed back, -1 if none */ - int bufTech; /* buffering technique, _IOFBF etc */ - char *intBuffer; /* internal buffer */ - int noNl; /* When doing gets, we don't copy NL */ - int mode; /* __WRITE_MODE or __READ_MODE */ - int update; /* Is file update (read + write)? */ - int theirBuffer; /* Is the buffer supplied by them? */ -} FILE; - -#endif /* _STDIO_H */ diff --git a/includes/string.h b/includes/string.h deleted file mode 100644 index 9d2a517..0000000 --- a/includes/string.h +++ /dev/null @@ -1,282 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 _NULL -#include "__intern.h" -#endif /* _NULL */ - -/* ---------------------------------------------------------------------------- - * MACROS - * --------------------------------------------------------------------------*/ - -#define NULL _NULL - -/* ---------------------------------------------------------------------------- - * TYPEDEFS - * --------------------------------------------------------------------------*/ - -#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. - * @param c The character to look for. - * @param n Number of characters to search. - * @return A pointer to the first occurrence of c in src, or NULL if no match - * found. - * @see strchr() - */ -void * memchr( const void * src, int c, size_t n ); - -/** MEMory CoMPare. Compares two memory areas until a difference is found. - * This implementation actually returns the difference of the first differing - * byte. - * This behaviour is implementation-defined and should not be relied upon to - * keep your code portable across implementations. - * @param src_1 The first memory area. - * @param src_2 The second memory area. - * @param n Number of bytes to compare. - * @return 0, if both areas are identical. If a difference is found, returns a - * value < 0 if the byte from memory area src_1 is smaller than that - * from src_2, or > 0 if otherwise. - * @see strncmp() - */ -int memcmp( const void * src_1, const void * src_2, size_t n ); - -/** MEMory CoPY. Copies a source memory area of size n into a destination - * memory area. - * Should the memory areas pointed to by dest and src overlap, behaviour is - * undefined. - * @param dest The destination memory area. - * @param src The source memory area. - * @param n The size of the source memory area. - * @return A pointer to the destination memory area. - * @see strncpy() - */ -void * memcpy( void * restrict dest, const void * restrict src, size_t n ); - -/** MEMory CoPY. Moves a source memory area of size n into a destination - * memory area. The memory areas may overlap. - * @param dest The destination memory area. - * @param src The source memory area. - * @param n The size of the source memory area. - * @return A pointer to the destination memory area. - * @see strncpy() - */ -void * memmove( void * dest, const void * src, size_t n ); - -/** MEMory SET. Fills a memory area with a given character. - * @param dest The destination memory area. - * @param c The character to be written to dest. - * @param n The number of characters to be written to dest. - * @return A pointer to the destination memory area. - */ -void * memset( void * dest, int c, size_t n ); - -/** STRing conCATenation. Appends a C string to another. If the memory area - * pointed to by 'dest' is not large enough to hold both 'dest' and 'src', - * behaviour is undefined. - * @param dest The destination string. - * @param src The source string. - * @return A pointer to the destination string. - * @see strncat() - */ -char * strcat( char * restrict dest, const char * restrict src ); - -/** STRing search for CHaRacter. Searches a C string (including terminating \0) - * for a character. If the string is not properly terminated, behaviour is - * undefined. - * @param src The source string. - * @param c The character to look for. - * @return A pointer to the first occurrence of c in src, or NULL if no match - * found. - */ -char * strchr( const char * src, int c ); - -/** STRing CoMPare. Compares two C strings until two differing characters are - * found, or both strings end. If the input strings are not correctly - * teminated with \0, behaviour is undefined. - * This implementation actually returns the difference of the two characters. - * This behaviour is implementation-defined and should not be relied upon to - * keep your code portable across implementations. - * @param src_1 The first string to be compared. - * @param src_2 The second string to be compared. - * @return 0, if both strings are identical. If two differing characters are - * found, returns a value < 0 if the character from src_1 is smaller - * than that from src_2, or > 0 if otherwise. - * @see strncmp() - */ -int strcmp( const char * src_1, const char * src_2 ); - -/** STRing COLLate. Compares two C strings until two differing characters are - * found, honoring the current locale. - * This implementation actually returns the difference of the two characters. - * This behaviour is implementation-defined and should not be relied upon to - * keep your code portable across implementations. - * @param src_1 The first string to be compared. - * @param src_2 The second string to be compared. - * @return 0, if both strings are identical. If two differing characters are - * found, returns a value < 0 if the character from src_1 is smaller - * than that from src_2, or > 0 if otherwise. - * @see locale.h - */ -int strcoll( const char * src_1, const char * src_2 ); - -/** STRing CoPY. Copies a source string (including terminating \0) into a - * destination string. If the memory area pointed to by dest is not large - * enough to hold src, behaviour is undefined. Should the memory areas pointed - * to by dest and src overlap, behavious is undefined. - * @param dest The destination string. - * @param src The source string. - * @return A pointer to the destination string. - * @see strncpy() - */ -char * strcpy( char * restrict dest, const char * restrict src ); - -/** STRing Character SPaN. Compares two C strings, determining the length of - * the substring not containing any character from the second string. - * @param src_1 The string to be searched. - * @param src_2 The string containing the characters to be searched for. - * @return The length of the src_1 substring not containing any character - * from src_2. - */ -size_t strcspn( const char * src_1, const char * src_2 ); - -/** STRing ERROR. Returns the error message corresponding to an error code. - * @param errorcode The error code. - * @return The plaintext error message corresponding to the error code. - * @see errno.h - * @see fenv.h - */ -char * strerror( int errorcode ); - -/** STRing LENgth. Returns the number of characters in a C string, not counting - * the terminating \0. - * @param src The source string. - * @return The number of characters in the string, not counting the - * terminating \0. - */ -size_t strlen( const char * src ); - -/** STRing N conCATenate. Appends a C string to another, setting a limit on the - * number of characters copied. - * @param dest The destination string. - * @param src The source string. - * @param n The maximum number of characters to be copied. - * @return A pointer to the destination string. - * @see strcat() - */ -char * strncat( char * restrict dest, const char * restrict src, size_t n ); - -/** STRing N CoMPare. Compares two C strings until two differing characters are - * found, both strings end, or a maximum number of characters has been - * compared. - * This implementation actually returns the difference of the two characters. - * This behaviour is implementation-defined and should not be relied upon to - * keep your code portable across implementations. - * @param src_1 The first string to be compared. - * @param src_2 The second string to be compared. - * @param n The maximum number of characters to be compared. - * @return 0, if both strings are identical. If two differing characters are - * found, returns a value < 0 if the character from src_1 is smaller - * than that from src_2, or > 0 if otherwise. - * @see strcmp() - */ -int strncmp( const char * src_1, const char * src_2, size_t n ); - -/** STRing CoPY. Copies a source string (including terminating \0) into a - * destination string, setting a limit on the number of characters copied. - * Should the memory areas pointed to by dest and src overlap, behaviour is - * undefined. - * @param dest The destination string. - * @param src The source string. - * @param n The maximum number of characters to be copied. - * @return A pointer to the destination string. - * @see strcpy() - */ -char * strncpy( char * restrict dest, const char * restrict src, size_t n ); - -/** STRing SPaN. Compares two C strings, determining the length of the - * substring containing only characters from the second string. - * @param src_1 The first string to be compared. - * @param src_2 The second string to be compared. - * @return The length of the identical substring. - */ -size_t strspn( const char * src_1, const char * src_2 ); - -/** STRing TOKenizer. This (complex and not thread-safe) function allows, by - * subsequent calls, to parse a string for tokens. The first parameter to the - * function is the C string to be parsed, the second parameter a C string - * containing a collection of seperating characters. On first call to the - * function, strtok() skips leading seperators, sets the first seperator after - * the token to \0, and returns a pointer to the token. Subsequent calls to - * strtok() with NULL as the first parameter return pointers to subsequent - * tokens, or NULL when all tokens have been parsed. - * Beware, this function is not thread-safe. - * @param src The string to be parsed (on first call), or NULL (to parse - * subsequent tokens). - * @param seperators The string containing the seperator(s). - * @return The next token parsed, or NULL if parse completed. - */ -char * strtok( char * restrict src, const char * restrict seperators ); - -/** STRing X FRoM. This function transforms a C string into another using a - * transformation rule depending on the current locale. - * @param dest The destination, where the transformed string should be written - * to. - * @param src The source string to be transformed. - * @param n The maximum number of characters to be written to dest. If this - * parameter is zero, 'dest' can be a NULL pointer (to determine the - * required space before doing the actual transformation). - * @return The length of the string after transformation. If return value > n, - * the transformed string has not been written, and the contents of - * 'dest' are undefined. - * @see locale.h - * @see strcoll() - */ -size_t strxfrm( char * restrict dest, const char * restrict src, size_t n ); - -/** STRing search, return Pointer to BReaK. Searches a C string (including - * terminating \0) for any character contained in a second string. If the - * first string is not properly terminated, behaviour is undefined. - * @param src_1 The string to be seached. - * @param src_2 The string containing the characters to be searched. - * @return A pointer into src_1 pointing to the first occurrence of any - * character from src_2, or NULL if no match found. - */ -char * strpbrk( const char * src_1, const char * src_2 ); - -/** STRing Reverse search for CHaRacter. Searches a C string (including - * terminating \0) for a character. If the string is not properly terminated, - * behaviour is undefined. - * @param src The source string. - * @param c The character to look for. - * @return A pointer to the last occurrence of c in src, or NULL if no match - * found. - */ -char * strrchr( const char * src, int c ); - -/** STRing search for STRing. Searches a C string for a substring. - * @param src_1 The string to be searched in. - * @param src_2 The substring to be searched for. - * @return A pointer to the first occurrence of src_2 in src_1, or NULL if no - * match found. - */ -char * strstr( const char * src_1, const char * src_2 ); - -#endif /* _STRING_H */ diff --git a/includes/time.h b/includes/time.h deleted file mode 100644 index b707a31..0000000 --- a/includes/time.h +++ /dev/null @@ -1,56 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 _NULL -#include "__intern.h" -#endif - -/* TODO: Documentation. */ - -/* ---------------------------------------------------------------------------- - * MACROS - * --------------------------------------------------------------------------*/ - -#define NULL _NULL - -#define CLOCKS_PER_SEC /* TODO - to __intern.h / __personality.h? */ - -/* ---------------------------------------------------------------------------- - * TYPES - * --------------------------------------------------------------------------*/ - -/* TODO: Get struct tm into __intern.h */ - -#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 ); -char * ctime( const time_t * tod ); -double difftime( time_t t1, time_t t0 ); -struct tm * gmtime( const time_t * tod ); -struct tm * localtime( const time_t * tod ); -time_t mktime( struct tm * tptr ); -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 */ diff --git a/includes/wctype.h b/includes/wctype.h deleted file mode 100644 index 3b3e211..0000000 --- a/includes/wctype.h +++ /dev/null @@ -1,57 +0,0 @@ -/* ---------------------------------------------------------------------------- - * $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 _NULL -#define _NULL _NULL -#include "__intern.h" -#endif /* _NULL */ - -/* TODO: Documentation */ - -/* ---------------------------------------------------------------------------- - * TYPEDEFS - * --------------------------------------------------------------------------*/ - -#ifndef _WINT_T -#define _WINT_T _WINT_T -typedef __wint_t wint_t -#endif /* _WINT_T */ - -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 ); -int iswblank( wint_t c ); -int iswcntrl( wint_t c ); -int iswctype( wint_t c, wctype_t category ); -int iswdigit( wint_t c ); -int iswgraph( wint_t c ); -int iswlower( wint_t c ); -int iswprint( wint_t c ); -int iswpunct( wint_t c ); -int iswspace( wint_t c ); -int iswupper( wint_t c ); -int iswxdigit( wint_t c ); - -wint_t towctrans( wint_t c, wctrans_t category ); -wint_t towlower( wint_t c ); -wint_t towupper( wint_t c ); - -wctrans_t wctrans( const char * property ); -wctype_t wctype( const char * property ); - -#endif /* _WCTYPE_H */ diff --git a/personalities/personality.txt b/personalities/personality.txt deleted file mode 100644 index d5bc2ba..0000000 --- a/personalities/personality.txt +++ /dev/null @@ -1,71 +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 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/template/includes/__personality.h b/personalities/template/includes/__personality.h deleted file mode 100644 index 2a3cb62..0000000 --- a/personalities/template/includes/__personality.h +++ /dev/null @@ -1,25 +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) - * --------------------------------------------------------------------------*/ - -/* 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 */