-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
#include <stdlib.h>
#include <stdio.h>
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double cabs( double _Complex x ) { /* TODO */ };
float cabsf( float _Complex x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double _Complex cacos( double _Complex x ) { /* TODO */ };
float _Complex cacosf( float _Complex x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double _Complex cacosh( double _Complex x ) { /* TODO */ };
float _Complex cacoshf( float _Complex x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double carg( double _Complex x ) { /* TODO */ };
float cargf( float _Complex x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double _Complex casin( double _Complex x ) { /* TODO */ };
float _Complex casinf( float _Complex x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double _Complex casinh( double _Complex x ) { /* TODO */ };
float _Complex casinhf( float _Complex x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double _Complex catan( double _Complex x ) { /* TODO */ };
float _Complex catanf( float _Complex x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double _Complex catanh( double _Complex x ) { /* TODO */ };
float _Complex catanhf( float _Complex x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double _Complex conj( double _Complex x ) { /* TODO */ };
float _Complex conjf( float _Complex x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double _Complex ccos( double _Complex x ) { /* TODO */ };
float _Complex ccosf( float _Complex x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double _Complex ccosh( double _Complex x ) { /* TODO */ };
float _Complex ccoshf( float _Complex x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double _Complex cexp( double _Complex x ) { /* TODO */ };
float _Complex cexpf( float _Complex x ) { /* TODO */ };
long double _Complex cexpl( long double _Complex x ) { /* TODO */ };
-
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double cimag( double _Complex x ) { /* TODO */ };
float cimagf( float _Complex x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double _Complex clog( double _Complex x ) { /* TODO */ };
float _Complex clogf( float _Complex x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double _Complex cpow( double _Complex x, double _Complex y ) { /* TODO */ };
float _Complex cpowf( float _Complex x, float _Complex y ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double _Complex cproj( double _Complex x ) { /* TODO */ };
float _Complex cprojf( float _Complex x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double creal( double _Complex x ) { /* TODO */ };
float crealf( float _Complex x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double _Complex csin( double _Complex x ) { /* TODO */ };
float _Complex csinf( float _Complex x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double _Complex csinh( double _Complex x ) { /* TODO */ };
float _Complex csinhf( float _Complex x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double _Complex csqrt( double _Complex x ) { /* TODO */ };
float _Complex csqrtf( float _Complex x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double _Complex ctan( double _Complex x ) { /* TODO */ };
float _Complex ctanf( float _Complex x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double _Complex ctanh( double _Complex x ) { /* TODO */ };
float _Complex ctanhf( float _Complex x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int isalnum( int c ) { /* TODO */ };
int isalpha( int c ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
-int errno = 0;
\ No newline at end of file
+int errno = 0;
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int feclearexcept( int exceptions ) { /* TODO */ };
int fegetexceptflag( fexcept_t * flags, int exceptions ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-
-// ----------------------------------------------------------------------------
-// Standard C
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
intmax_t imaxabs( intmax_t i ) { /* TODO */ };
imaxdiv_t imaxdiv( intmax_t numer, intmax_t denom ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
/* PDPC code - unreviewed
static struct lconv thislocale = {
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double fabs( double x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double acos( double x ) { /* TODO */ };
float acosf( float x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double acosh( double x ) { /* TODO */ };
float acoshf( float x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double asin( double x ) { /* TODO */ };
float asinf( float x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double asinh( double x ) { /* TODO */ };
float asinhf( float x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double atan( double x ) { /* TODO */ };
float atanf( float x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double atan2( double y, double x ) { /* TODO */ };
float atan2f( float y, float x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double atanh( double x ) { /* TODO */ };
float atanhf( float x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double cbrt( double x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double ceil( double x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double copysign( double x, double y ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double cos( double x ) { /* TODO */ };
float cosf( float x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double cosh( double x ) { /* TODO */ };
float coshf( float x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double erf( double x ) { /* TODO */ };
float erff( float x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double exp( double x ) { /* TODO */ };
float expf( float x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double fdim( double x, double y ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double floor( double x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double fma( double x, double y, double z ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double fmax( double x, double y ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double fmin( double x, double y ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double lgamma( double x ) { /* TODO */ };
float lgammaf( float x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double hypot( double x, double y ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double log( double x ) { /* TODO */ };
float logf( float x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double fmod( double x, double y ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double nan( const char *str ) { /* TODO */ };
float nanf( const char *str ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double nearbyint( double x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double nextafter( double x, double y ) { /* TODO */ };
float nextafterf( float x, float y ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double nexttoward( double x, long double y ) { /* TODO */ };
float nexttowardf( float x, long double y ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double pow( double x, double y ) { /* TODO */ };
float powf( float x, float y ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double remainder( double x, double y ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double remquo( double x, double y, int * pquo ) { /* TODO */ };
float remquof( float x, float y, int * pquo ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
long long llrint( double x ) { /* TODO */ };
long long llrintf( float x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
long long llround( double x ) { /* TODO */ };
long long llroundf( float x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double scalbn( double x, int ex ) { /* TODO */ };
float scalbnf( float x, int ex ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double sin( double x ) { /* TODO */ };
float sinf( float x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double sinh( double x ) { /* TODO */ };
float sinhf( float x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double sqrt( double x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double tan( double x ) { /* TODO */ };
float tanf( float x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double tanh( double x ) { /* TODO */ };
float tanhf( float x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double trunc( double x ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int setjmp(jmp_buf env) { /* TODO */ };
-void longjmp(jmp_buf env, int val) { /* TODO */ };
\ No newline at end of file
+void longjmp(jmp_buf env, int val) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
/* PDPC code - unreviewed
static void (*handlers[6])(int) = {
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
#ifndef __FILE_H
#define __FILE_H __FILE_H
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int fclose( FILE * stream ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
#ifndef __FILE_H
#define __FILE_H __FILE_H
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
#ifndef __FILE_H
#define __FILE_H __FILE_H
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int fflush( FILE * stream ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int fgetc( FILE * stream ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int fgetpos( FILE * restrict stream, fpos_t * restrict pos ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
char * fgets( char * restrict s, int n, FILE * restrict stream ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
FILE * fopen( const char * restrict filename, const char * restrict mode ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int fprintf( FILE * restrict stream, const char * restrict format, ... ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int fputc( int c, FILE * stream ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int fputs( const char * restrict s, FILE * restrict stream ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
size_t fread( void * restrict ptr, size_t size, size_t nelem, FILE * restrict stream ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
FILE * freopen( const char * restrict filename, const char * restrict mode, FILE * stream ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int fscanf( FILE * restrict stream, const char * restrict format, ... ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int fseek( FILE * stream, long offset, int mode ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int fsetpos( FILE * stream, const fpos_t * pos ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
long ftell( FILE * stream ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
size_t fwrite( const void * restrict ptr, size_t size, size_t nelem, FILE * restrict stream ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int getc( FILE * stream ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int getchar( void ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
char * gets( char * s ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
void perror( const char * s ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int printf( const char * restrict format, ... ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int putc( int c, FILE * stream ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int putchar( int c ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int puts( const char * s ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int remove( const char * filename ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int rename( const char * old, const char * new ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
void rewind( FILE * stream ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int scanf( const char * restrict format, ... ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
void setbuf( FILE * restrict stream, char * restrict buf ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int setvbuf( FILE * restrict stream, char * restrict buf, int mode, size_t size ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int snprintf( char * restrict s, size_t n, const char * restrict format, ... ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int sprintf( char * restrict s, const char * restrict format, ... ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int sscanf( const char * restrict s, const char * restrict format, ... ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
FILE * tmpfile( void ) { /* TODO */ };
{
return (fopen("ZZZZZZZA.$$$", "wb+"));
}
-*/
\ No newline at end of file
+*/
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
char * tmpnam( char * s ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int ungetc( int c, FILE * stream ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int vfprintf( FILE * restrict stream, const char * restrict format, va_list ap ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int vfscanf( FILE * restrict stream, const char * restrict format, va_list ap ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int vprintf( const char * restrict format, va_list ap ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int vscanf( const char * restrict format, va_list ap ) { /* TODO */ };
-
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int vsnprintf( char * restrict s, size_t n, const char * restrict format, va_list ap ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int vsprintf( char * restrict s, const char * restrict format, va_list ap) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int vsscanf( const char * restrict s, const char * restrict format, va_list ap ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
void _Exit( int status ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
void abort( void ) { /* TODO */ };
raise(SIGABRT);
exit(EXIT_FAILURE);
}
-*/
\ No newline at end of file
+*/
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
-// TODO: C/C++ linkages
int atexit( void (*func) ( void ) ) { /* TODO */ };
/* PDPC code - unreviewed
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
-// TODO: C/C++ linkage
void * bsearch( const void * key, const void * base, size_t nelem, size_t size, int (*cmp) ( const void * ck, const void * ce) ) { /* TODO */ };
/* PDPC code - unreviewed
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
void * calloc( size_t nelem, size_t size ) { /* TODO */ };
}
return (ptr);
}
-*/
\ No newline at end of file
+*/
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-
-// ----------------------------------------------------------------------------
-// C++
-
-ldiv_t div( long numer, long denom ) { /* TODO */ };
-lldiv_t div( long long numer, long long denom ) { /* TODO */ };
-
-// ----------------------------------------------------------------------------
-// Standard C
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
div_t div( int numer, int denom ) { /* TODO */ };
lldiv_t lldiv( long long numer, long long denom ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
void exit( int status ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
void free( void * ptr ) { /* TODO */ };
+
+/* Thomas "Beyond Infinity" Kreitner's code - unchecked, unoptimized
+{
+ chunk_t * chunk;
+ chunk_t * prev_chunk;
+ chunk = used_mem.start;
+ do
+ {
+ prev_chunk = chunk;
+ chunk = chunk->next;
+ } while ( ( chunk != NULL ) && ( chunk->address != ptr ) );
+ if ( chunk->address == ptr )
+ {
+ if( used_mem.start->next->next == NULL )
+ {
+ /* used_mem list has only one entry */
+ chunk = used_mem.start->next;
+ used_mem.last = used_mem.start;
+ }
+ else if ( chunk == used_mem.last )
+ {
+ /* chunk is the last element of used_mem list */
+ prev_chunk->next = NULL;
+ used_mem.last = prev_chunk;
+ }
+ else
+ {
+ /* chunk is neither only nor last in the used_mem list */
+ prev_chunk->next = prev_chunk->next->next;
+ }
+ chunk->next = NULL;
+ free_mem.last->next = chunk;
+ free_mem.last = chunk;
+ return chunk;
+ }
+ else
+ {
+ return NULL;
+ }
+}
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
char * getenv( const char * name ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
+
+#include <__size_t.h>
void * malloc( size_t size ) { /* TODO */ };
+
+/* This is a simple best-fit / first-fit implementation heavily based on
+ * Thomas "Beyond Infinity" Kreitner's code
+ */
+
+/* memory list element */
+struct chunk_t
+{
+ void * address;
+ size_t size;
+ chunk_t * next;
+};
+
+struct memlist_t
+{
+ chunk_t * start;
+ chunk_t * last;
+};
+
+size_t heap_start = 0xa0000000;
+size_t heap_used = 0x00000050; /* HEAP in use. Holds the next FREE address (?) */
+size_t heap_max = 0xfffffff; /* max. HEAP */
+
+static struct memlist_t free_mem = { (struct memlist_t *) heap_start,
+ (struct memlist_t *) heap_start };
+/* free_mem.start->next = NULL; */
+
+static struct memlist_t used_mem = { (struct memlist_t *) heap_start + sizeof( chunk_t ),
+ (struct memlist_t *) heap_start + sizeof( chunk_t ) };
+/* used_mem.start->next = NULL; */
+
+void * malloc( size_t size )
+{
+ chunk_t * chunk = 0;
+ chunk_t * prev_chunk;
+ if ( free_mem.start != free_mem.last )
+ {
+ /* first pass: exact fit */
+ chunk = free_mem.start;
+ while ( 1 )
+ {
+ prev_chunk = chunk;
+ chunk = chunk->next;
+ if ( ( chunk == NULL ) || ( chunk->size == size ) )
+ {
+ break;
+ }
+ }
+ }
+ if ( chunk == NULL )
+ {
+ /* second pass - first fit */
+ chunk = free_mem.start;
+ while ( 1 )
+ {
+ prev_chunk = chunk;
+ chunk = chunk-> next;
+ if ( ( chunk == NULL ) || ( chunk->size > size ) )
+ {
+ break;
+ }
+ }
+ }
+ if ( chunk != NULL )
+ {
+ /* remove chunk from free_mem list */
+ if ( free_mem.start->next->next == NULL )
+ {
+ /* free_mem list has only one entry */
+ free_mem.last = free_mem.start;
+ }
+ else if ( chunk == free_mem.last )
+ {
+ /* chunk is last element of free_mem list */
+ prev_chunk->next = NULL;
+ free_mem.last = prev_chunk;
+ }
+ else
+ {
+ /* chunk is neither only nor last in free_mem list */
+ prev_chunk->next = prev_chunk->next->next;
+ }
+ /* append chunk to used_mem list */
+ chunk->next = NULL;
+ used_mem.last->next = chunk;
+ used_mem.last = chunk;
+ }
+ /* append new chunk to end of used_mem list (if there's space) */
+ if ( chunk == NULL )
+ {
+ if ( ( heap_used + size ) <= heap_max )
+ {
+ /* building the header */
+ chunk = (chunk_t *) heap_start + heap_used + 1;
+ chunk->size = size;
+ chunk->next = NULL;
+ chunk->address = chunk + sizeof( chunk_t );
+ /* push heap_used past allocated area */
+ heap_used += sizeof( chunk_t ) + size;
+ used_mem.last->next = chunk;
+ used_mem.last = chunk;
+ }
+ else
+ {
+ /* allocation would exceed max. heap size -
+ /* demand more memory from kernel - not implemented */
+ return 0;
+ }
+ }
+ return (void *) chunk->address;
+}
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int mblen( const char * s, size_t n ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
size_t mbstowcs( wchar_t * restrict wcs, const char * restrict s, size_t n ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int mbtowc( wchar_t * restrict pwc, const char * restrict s, size_t n ) { /* TODO */ };
return (-1);
}
}
-*/
\ No newline at end of file
+*/
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-
-// TODO: C/C++ linkage
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
+
void qsort( void * base, size_t nelem, size_t size, int (*cmp) ( const void * e1, const void * e2) ) { /* TODO */ };
/* PDPC code - unreviewed
}
#endif
-*/
\ No newline at end of file
+*/
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int rand( void ) { /* TODO */ };
void srand( unsigned int seed ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
void * realloc( void * ptr, size_t size ) { /* TODO */ };
-/* PDPC code - unreviewed
+/* PDPC code - assumes size_t of memory chunk at offset -4.
{
- char *newptr;
+ char * newptr;
size_t oldsize;
-
- newptr = malloc(size);
- if (newptr == NULL)
+
+ if ( ( newptr = malloc(size) ) != NULL )
{
- return (NULL);
+ if ( ptr != NULL )
+ {
+ // reading size information from hidden chunk header
+ oldsize = * (size_t *) ( (char *) ptr - 4 );
+ // correctly handle *down*sizing as well as *up*sizing
+ memcpy( newptr, ptr, ( oldsize < size ) ? oldsize : size );
+ free( ptr );
+ }
}
- if (ptr != NULL)
+ return ( newptr );
+}
+*/
+
+/* Thomas "Beyond Infinity" Kreitner's code - unchecked, unoptimized
+{
+ uint_t found = 0;
+ uint_t length;
+ chunk_t * new;
+ chunk_t * chunk;
+ // searching the block to-be-allocated
+ chunk = used_mem.start;
+ while ( ! found && ( chunk->next != NULL )
{
- oldsize = *(size_t *)((char *)ptr - 4);
- if (oldsize < size)
+ if ( chunk->address == ptr )
+ {
+ found++;
+ }
+ else
{
- size = oldsize;
+ chunk=chunk->next;
}
- memcpy(newptr, ptr, size);
- free(ptr);
}
- return (newptr);
+ if ( found )
+ {
+ length = chunk->length;
+ // allocate new memory area
+ if ( ( new = (void *) malloc( size ) ) != NULL )
+ {
+ // copy the data
+ memcpy( ptr, new, length );
+ // release the old memory
+ free( ptr );
+ }
+ else
+ {
+ new = NULL;
+ }
+ }
+ else
+ {
+ new = NULL;
+ }
+ return new;
}
*/
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
double atof( const char * s ) { /* TODO */ };
int atoi( const char * s ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
-void _Exit( int status ) { /* TODO */ };
-void exit( int status ) { /* TODO */ };
-void abort( void ) { /* TODO */ };
-char * getenv( const char * name ) { /* TODO */ };
int system( const char * s ) { /* TODO */ };
-
-// TODO: C/C++ linkages
-int atexit( void (*func) ( void ) ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
size_t wcstombs( char * restrict s, const wchar_t * restrict wcs, size_t n ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int wctomb( char * s, wchar_t wchar ) { /* TODO */ };
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
#include <__size_t.h>
#include <__NULL.h>
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
#include <__size_t.h>
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
#include <__size_t.h>
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
#include <__size_t.h>
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
#include <__size_t.h>
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
char * strcat( char * restrict dest, const char * restrict src )
{
{
while ( *++dest_p != '\0' )
{
- // EMPTY
+ /* EMPTY */
}
}
while ( (*dest_p++ = *src++) != '\0' )
{
- // EMPTY
+ /* EMPTY */
}
return dest;
}
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
#include <__NULL.h>
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int strcmp( const char * src_1, const char * src_2 )
{
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
-// TODO: Dummy function, does not support locales.
+/* TODO: Dummy function, does not support locales. */
int strcmp( const char * src_1, const char * src_2 );
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
char * strcpy( char * restrict dest, const char * restrict src )
{
char * tmp = dest;
while ( ( *dest++ = *src++ ) != '\0' )
{
- // EMPTY
+ /* EMPTY */
}
return tmp;
}
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
#include <__size_t.h>
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
#include <errno.h>
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
#include <__size_t.h>
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
#include <__size_t.h>
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
#include <__size_t.h>
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
#include <__size_t.h>
char * tmp = dest;
while ( ( n-- != 0 ) && ( ( *dest++ = *src++ ) != '\0' ) )
{
- // EMPTY
+ /* EMPTY */
}
while ( n-- != 0 )
{
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
#include <__NULL.h>
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
#include <__NULL.h>
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
#include <__size_t.h>
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
#include <__NULL.h>
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
char * strtok( char * restrict src, const char * restrict seperators )
{
if ( src != NULL )
{
- // new string
+ /* new string */
store = src;
}
if ( store == NULL )
{
- // no old string, no new string, nothing to do
+ /* no old string, no new string, nothing to do */
return NULL;
}
- src += strspn( src, seperators ); // skipping leading seperators
+ src += strspn( src, seperators ); /* skipping leading seperators */
if ( strlen( src ) == 0 )
{
- // no more to parse
+ /* no more to parse */
return ( store = NULL );
}
token_length = strcspn( src, seperators );
if ( src[ token_length ] == '\0' )
{
- // parsed to end of string
+ /* parsed to end of string */
store = NULL;
return src;
}
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
#include <__size_t.h>
-// TODO: Dummy function, no locale support yet.
+/* TODO: Dummy function, no locale support yet. */
size_t strlen( const char * src );
char * strncpy( char * restrict dest, const char * restrict src, size_t n );
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
char * asctime( const struct tm * tptr ) { /* TODO */ };
clock_t clock( void ) { /* TODO */ };
*str = '\0';
va_end(vp);
}
-*/
\ No newline at end of file
+*/
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
int iswalnum( wint_t c ) { /* TODO */ };
int iswalpha( wint_t c ) { /* TODO */ };
+++ /dev/null
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Definition of NULL shared by locale.h, stddef.h, stdio.h, stdlib.h,
-// string.h, wchar.h, and time.h
-// ----------------------------------------------------------------------------
-
-#ifndef __NULL_H
-#define __NULL_H __NULL_H
-
-#define NULL 0
-
-#endif // __NULL_H
+++ /dev/null
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Definition of WCHAR_MIN and WCHAR_MAX, shared by stdint.h and wchar.h
-// ----------------------------------------------------------------------------
-
-#ifndef __WCHAR_H
-#define __WCHAR_H __WCHAR_H
-
-#define WCHAR_MIN // TODO - personality?
-#define WCHAR_MAX // TODO - personality?
-
-#endif // __WCHAR_H
--- /dev/null
+/* ----------------------------------------------------------------------------
+ * $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"
+++ /dev/null
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// size_t typedef shared by stddef.h, stdio.h, stdlib.h, string.h, time.h, and
-// wchar.h
-// ----------------------------------------------------------------------------
-
-#ifndef __SIZE_T_H
-#define __SIZE_T_H __SIZE_T_H
-
-typedef size_t; // TODO - personality?
-
-#endif // __SIZE_T_H
+++ /dev/null
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// struct tm definition shared by time.h and wchar.h
-// ----------------------------------------------------------------------------
-
-#ifndef __TM_H
-#define __TM_H __TM_H
-
-struct tm; // TODO - personality?
-
-#endif // __TM_H
+++ /dev/null
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// wchar_t typedef shared by stddef.h, stdlib.h, and wchar.h
-// ----------------------------------------------------------------------------
-
-#ifndef __WCHAR_T_H
-#define __WCHAR_T_H __WCHAR_T_H
-
-typedef wchar_t; // TODO - personality?
-
-#endif // __WCHAR_T_H
+++ /dev/null
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// wint_t typedef shared by wchar.h and wctype.h
-// ----------------------------------------------------------------------------
-
-#ifndef __WINT_T_H
-#define __WINT_T_H __WINT_T_H
-
-typedef wint_t; // TODO - personality?
-
-#endif // __WINT_T_H
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Diagnostics
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Diagnostics
+ * --------------------------------------------------------------------------*/
-#ifndef __ASSERT_H
-#define __ASSERT_H __ASSERT_H
+#ifndef _ASSERT_H
+#define _ASSERT_H _ASSERT_H
-// ----------------------------------------------------------------------------
-// AUXILIARY
+/* ----------------------------------------------------------------------------
+ * AUXILIARY
+ * --------------------------------------------------------------------------*/
-// Helper function doing the print to stderr and call to abort().
-void __assert( char const * const expression, // the tested expression
- char const * const file, // name of source file
- char const * const function, // name of function
- int const line ); // number of source file line
+/* Helper function doing the print to stderr and call to abort(). */
+void __assert( char const * const expression, /* the tested expression */
+ char const * const file, /* name of source file */
+ char const * const function, /* name of function */
+ int const line ); /* number of source file line */
-// ----------------------------------------------------------------------------
-// DEFINES
+#endif /* _ASSERT_H - note that the header guard ends here on purpose. The
+ assert macro is redefined upon each inclusion, in
+ dependence of NDEBUG. */
-// TODO: Check the macro for if-compatibility.
+/* ----------------------------------------------------------------------------
+ * DEFINES
+ * --------------------------------------------------------------------------*/
#undef assert
#if defined NDEBUG
#define assert( x ) ( x ) ? ( (void) 0 ) \
: __assert( #x, __FILE__, __func__, __LINE__ )
#endif
-
-#endif // __ASSERT_H
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Complex arithmetic
-// ----------------------------------------------------------------------------
-
-#ifndef __COMPLEX_H
-#define __COMPLEX_H __COMPLEX_H
-
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Complex arithmetic
+ * --------------------------------------------------------------------------*/
+
+#ifndef _COMPLEX_H
+#define _COMPLEX_H _COMPLEX_H
+
+#ifndef _PERSONALITY
+#define _PERSONALITY _PERSONALITY
#include "__personality.h"
+#endif /* _PERSONALITY */
-// ----------------------------------------------------------------------------
-// DEFINES
+/* ----------------------------------------------------------------------------
+ * DEFINES
+ * --------------------------------------------------------------------------*/
#ifndef __cplusplus
#define complex _Complex
#define I _Complex_I
#endif
-// ----------------------------------------------------------------------------
-// FUNCTIONS
+/* ----------------------------------------------------------------------------
+ * FUNCTIONS
+ * --------------------------------------------------------------------------*/
-// These functions return the absolute value (magnitude) of their parameter.
+/* These functions return the absolute value (magnitude) of their parameter. */
double cabs( double _Complex x );
float cabsf( float _Complex x );
long double cabsl( long double _Complex x );
-// These functions return the sine of their parameter.
+/* These functions return the sine of their parameter. */
double _Complex csin( double _Complex x );
float _Complex csinf( float _Complex x );
long double _Complex csinl( long double _Complex x );
-// These functions return the hyperbolic sine of their parameter.
+/* These functions return the hyperbolic sine of their parameter. */
double _Complex csinh( double _Complex x );
float _Complex csinhf( float _Complex x );
long double _Complex csinhl( long double _Complex x );
-// These functions return the arcsine of their parameter.
+/* These functions return the arcsine of their parameter. */
double _Complex casin( double _Complex x );
float _Complex casinf( float _Complex x );
long double _Complex casinl( long double _Complex x );
-// These functions return the hyperbolic arcsine of their parameter.
+/* These functions return the hyperbolic arcsine of their parameter. */
double _Complex casinh( double _Complex x );
float _Complex casinhf( float _Complex x );
long double _Complex casinhl( long double _Complex x );
-// These functions return the cosine of their parameter.
+/* These functions return the cosine of their parameter. */
double _Complex ccos( double _Complex x );
float _Complex ccosf( float _Complex x );
long double _Complex ccosl( long double _Complex x );
-// These functions return the hyperbolic cosine of their parameter.
+/* These functions return the hyperbolic cosine of their parameter. */
double _Complex ccosh( double _Complex x );
float _Complex ccoshf( float _Complex x );
long double _Complex ccoshl( long double _Complex x );
-// These functions return the arccosine of their parameter.
+/* These functions return the arccosine of their parameter. */
double _Complex cacos( double _Complex x );
float _Complex cacosf( float _Complex x );
long double _Complex cacosl( long double _Complex x );
-// These functions return the hyperbolic arccosine of their parameter.
+/* These functions return the hyperbolic arccosine of their parameter. */
double _Complex cacosh( double _Complex x );
float _Complex cacoshf( float _Complex x );
long double _Complex cacoshl( long double _Complex x );
-// These functions return the tangent of their parameter.
+/* These functions return the tangent of their parameter. */
double _Complex ctan( double _Complex x );
float _Complex ctanf( float _Complex x );
long double _Complex ctanl( long double _Complex x );
-// These functions return the hyperbolic tangent of their parameter.
+/* These functions return the hyperbolic tangent of their parameter. */
double _Complex ctanh( double _Complex x );
float _Complex ctanhf( float _Complex x );
long double _Complex ctanhl( long double _Complex x );
-// These functions return the arctangent of their parameter.
+/* These functions return the arctangent of their parameter. */
double _Complex catan( double _Complex x );
float _Complex catanf( float _Complex x );
long double _Complex catanl( long double _Complex x );
-// These functions return the hyperbolic arctangent of their parameter.
+/* These functions return the hyperbolic arctangent of their parameter. */
double _Complex catanh( double _Complex x );
float _Complex catanhf( float _Complex x );
long double _Complex catanhl( long double _Complex x );
-// These functions return the imaginary part of their parameter.
+/* These functions return the imaginary part of their parameter. */
double cimag( double _Complex x );
float cimagf( float _Complex x );
long double cimagl( long double _Complex x );
-// These functions return the real part of their parameter.
+/* These functions return the real part of their parameter. */
double creal( double _Complex x );
float crealf( float _Complex x );
long double creall( long double _Complex x );
-// These functions return x^y.
+/* These functions return x^y. */
double _Complex cpow( double _Complex x, double _Complex y );
float _Complex cpowf( float _Complex x, float _Complex y );
long double _Complex cpowl( long double _Complex x, long double _Complex y );
-// These functions return the square root of their parameter.
+/* These functions return the square root of their parameter. */
double _Complex csqrt( double _Complex x );
float _Complex csqrtf( float _Complex x );
long double _Complex csqrtl( long double _Complex x );
-// These functions return the exponential of their parameter.
+/* These functions return the exponential of their parameter. */
double _Complex cexp( double _Complex x );
float _Complex cexpf( float _Complex x );
long double _Complex cexpl( long double _Complex x );
-// These functions return the logarithm of their parameter.
+/* These functions return the logarithm of their parameter. */
double _Complex clog( double _Complex x );
float _Complex clogf( float _Complex x );
long double _Complex clogl( long double _Complex x );
-// These functions return the phase angle of their value.
+/* These functions return the phase angle of their value. */
double carg( double _Complex x );
float cargf( float _Complex x );
long double cargl( long double _Complex x );
-// These functions return the conjugate of their parameter.
+/* These functions return the conjugate of their parameter. */
double _Complex conj( double _Complex x );
float _Complex conjf( float _Complex x );
long double _Complex conjl( long double _Complex x );
-// These functions return the projection of their parameter.
+/* These functions return the projection of their parameter. */
double _Complex cproj( double _Complex x );
float _Complex cprojf( float _Complex x );
long double _Complex cprojl( long double _Complex x );
-#endif // __COMPLEX_H
+#endif /* _COMPLEX_H */
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Character handling
-// ----------------------------------------------------------------------------
-
-#ifndef __CTYPE_H
-#define __CTYPE_H __CTYPE_H
-
-// ----------------------------------------------------------------------------
-// FUNCTIONS
-
-// returns nonzero if c is alphanumeric in the locale.
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Character handling
+ * --------------------------------------------------------------------------*/
+
+#ifndef _CTYPE_H
+#define _CTYPE_H _CTYPE_H
+
+/* ----------------------------------------------------------------------------
+ * FUNCTIONS
+ * --------------------------------------------------------------------------*/
+
+/* returns nonzero if c is alphanumeric in the locale. */
int isalnum( int c );
-// returns nonzero if c is alphabetic character in the locale.
+/* returns nonzero if c is alphabetic character in the locale. */
int isalpha( int c );
-// returns nonzero if c is a horizontal blank in the locale.
+/* returns nonzero if c is a horizontal blank in the locale. */
int isblank( int c );
-// returns nonzero if c is a control character in the locale.
+/* returns nonzero if c is a control character in the locale. */
int iscntrl( int c );
-// returns nonzero if c is a digit in the locale.
+/* returns nonzero if c is a digit in the locale. */
int isdigit( int c );
-// returns nonzero if c is alphanumeric or a punctuation in the locale.
+/* returns nonzero if c is alphanumeric or a punctuation in the locale. */
int isgraph( int c );
-// returns nonzero if c is a lowercase alphabetic character in the locale.
+/* returns nonzero if c is a lowercase alphabetic character in the locale. */
int islower( int c );
-// returns nonzero if c is a printable character ( isgraph() or isblank() ) in
-// the locale.
+/* returns nonzero if c is a printable character ( isgraph() or isblank() ) in
+ * the locale. */
int isprint( int c );
-// returns nonzero if c is a punctuation in the locale.
+/* returns nonzero if c is a punctuation in the locale. */
int ispunct( int c );
-// returns nonzero if c is a whitespace in the locale.
+/* returns nonzero if c is a whitespace in the locale. */
int isspace( int c );
-// returns nonzero if c is an uppercase alphabetical character in the locale.
+/* returns nonzero if c is an uppercase alphabetical character in the locale. */
int isupper( int c );
-// returns nonzero if c is a hexedecimal digit in the locale.
+/* returns nonzero if c is a hexedecimal digit in the locale. */
int isxdigit( int c );
-// returns lowercase equivalent for c in locale.
+/* returns lowercase equivalent for c in locale. */
int tolower( int c );
-// returns uppercase equivalent for c in locale.
+/* returns uppercase equivalent for c in locale. */
int toupper( int c );
-#endif // __CTYPE_H
+#endif /* _CTYPE_H */
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Errors
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Errors
+ * --------------------------------------------------------------------------*/
-#ifndef __ERRNO_H
-#define __ERRNO_H __ERRNO_H
+#ifndef _ERRNO_H
+#define _ERRNO_H _ERRNO_H
-// TODO: Documentation
+#ifndef _PERSONALITY
+#define _PERSONALITY _PERSONALITY
+#include "__personality.h"
+#endif /* _PERSONALITY */
-// ----------------------------------------------------------------------------
-// DECLARATIONS
+/* TODO: Documentation */
+
+/* ----------------------------------------------------------------------------
+ * DECLARATIONS
+ * --------------------------------------------------------------------------*/
extern int errno;
-// ----------------------------------------------------------------------------
-// DEFINES
+/* ----------------------------------------------------------------------------
+ * DEFINES
+ * --------------------------------------------------------------------------*/
-#define EDOM 1 // domain error
-#define EILSEQ 2 // illegal (multibyte) sequence
-#define ERANGE 3 // range error
+#define EDOM _EDOM /* domain error */
+#define EILSEQ _EILSEQ /* illegal (multibyte) sequence */
+#define ERANGE _ERANGE /* range error */
-#endif // __ERRNO_H
+#endif /* _ERRNO_H */
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Floating-point environment
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Floating-point environment
+ * --------------------------------------------------------------------------*/
-#ifndef __FENV_H
-#define __FENV_H __FENV_H
+#ifndef _FENV_H
+#define _FENV_H _FENV_H
-// TODO: Documentation, checking for personality
+/* TODO: Documentation */
-// ----------------------------------------------------------------------------
-// MACROS
+/* ----------------------------------------------------------------------------
+ * MACROS
+ * --------------------------------------------------------------------------*/
-// Used
-#define FE_DIVBYZERO // TODO
-#define FE_INEXACT // TODO
-#define FE_INVALID // TODO
-#define FE_OVERFLOW // TODO
-#define FE_UNDERFLOW // TODO
-#define FE_ALL_EXCEPT // TODO
+#define FE_DIVBYZERO /* TODO - to __intern.h / __personality.h? */
+#define FE_INEXACT /* TODO - to __intern.h / __personality.h? */
+#define FE_INVALID /* TODO - to __intern.h / __personality.h? */
+#define FE_OVERFLOW /* TODO - to __intern.h / __personality.h? */
+#define FE_UNDERFLOW /* TODO - to __intern.h / __personality.h? */
+#define FE_ALL_EXCEPT /* TODO - to __intern.h / __personality.h? */
-#define FE_DOWNWARD // TODO
-#define FE_TONEAREST // TODO
-#define FE_TOWARDZERO // TODO
-#define FE_UPWARD // TODO
+#define FE_DOWNWARD /* TODO - to __intern.h / __personality.h? */
+#define FE_TONEAREST /* TODO - to __intern.h / __personality.h? */
+#define FE_TOWARDZERO /* TODO - to __intern.h / __personality.h? */
+#define FE_UPWARD /* TODO - to __intern.h / __personality.h? */
-#define FE_DFL_ENV // TODO
+#define FE_DFL_ENV /* TODO - to __intern.h / __personality.h? */
-// ----------------------------------------------------------------------------
-// TYPEDEFS
+/* ----------------------------------------------------------------------------
+ * TYPEDEFS
+ * --------------------------------------------------------------------------*/
-typedef fenv_t; // TODO
-typedef fexcept_t; // TODO
+typedef fenv_t; /* TODO - to __intern.h / __personality.h? */
+typedef fexcept_t; /* TODO - to __intern.h / __personality.h? */
-// ----------------------------------------------------------------------------
-// FUNCTIONS
+/* ----------------------------------------------------------------------------
+ * FUNCTIONS
+ * --------------------------------------------------------------------------*/
int feclearexcept( int exceptions );
int fegetexceptflag( fexcept_t * flags, int exceptions );
int fesetenv( const fenv_t * environment );
int feupdateenv( const fenv_t * environment );
-#endif // __FENV_H
+#endif /* _FENV_H */
--- /dev/null
+/* ----------------------------------------------------------------------------
+ * $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 */
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Format conversion of integer types
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Format conversion of integer types
+ * --------------------------------------------------------------------------*/
-#ifndef __INTTYPES_H
-#define __INTTYPES_H __INTTYPES_H
+#ifndef _INTTYPES_H
+#define _INTTYPES_H _INTTYPES_H
-// TODO: Documentation
+/* TODO: Documentation */
-// ----------------------------------------------------------------------------
-// TYPEDEFS
+/* ----------------------------------------------------------------------------
+ * TYPEDEFS
+ * --------------------------------------------------------------------------*/
typedef struct
{
}
imaxdiv_t;
-// ----------------------------------------------------------------------------
-// FUNCTIONS
+/* ----------------------------------------------------------------------------
+ * FUNCTIONS
+ * --------------------------------------------------------------------------*/
intmax_t imaxabs( intmax_t i );
imaxdiv_t imaxdiv( intmax_t numer, intmax_t denom );
intmax_t wcstoimax( const wchar_t * restrict s, wchar_t * * restrict endptr, int base );
uintmax_t wcstoumax( const wchar_t * restrict s, wchar_t * * restrict endptr, int base );
-// ----------------------------------------------------------------------------
-// MACROS (PRINT)
+/* ----------------------------------------------------------------------------
+ * MACROS (PRINT)
+ * --------------------------------------------------------------------------*/
#define PRId8
#define PRId16
#define PRIXMAX
#define PRIXPTR
-// ----------------------------------------------------------------------------
-// MACROS (SCAN)
+/* ----------------------------------------------------------------------------
+ * MACROS (SCAN)
+ * --------------------------------------------------------------------------*/
#define SCNd8
#define SCNd16
#define SCNXMAX
#define SCNXPTR
-#endif // __INTTYPES_H
+#endif /* _INTTYPES_H */
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Alternative spellings
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Alternative spellings
+ * ----------------------------------------------------------------------------
+ * This header is part of a freestanding implementation
+ * --------------------------------------------------------------------------*/
-#ifndef __ISO646_H
-#define __ISO646_H __ISO646_H
+#ifndef _ISO646_H
+#define _ISO646_H _ISO646_H
-// ----------------------------------------------------------------------------
-// DEFINES
+/* ----------------------------------------------------------------------------
+ * DEFINES
+ * --------------------------------------------------------------------------*/
#define and &&
#define and_eq &=
#define xor ^
#define xor_eq ^=
-#endif // __ISO646_H
+#endif /* _ISO646_H */
--- /dev/null
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Sizes of integer types
+ * ----------------------------------------------------------------------------
+ * This header is part of a freestanding implementation
+ * --------------------------------------------------------------------------*/
+
+#ifndef _LIMITS_H
+#define _LIMITS_H _LIMITS_H
+
+/* ISO/IEC 9899:1999, ยง5.2.4.2.1
+ * The values given below shall be replaced by constant expressions suitable
+ * for use in #if preprocessing directives. Moreover, except for CHAR_BIT and
+ * MB_LEN_MAX, the following shall be replaced by expressions that have the
+ * same type as would an expression that is an object of the corresponding type
+ * converted according to the integer promotions. Their implementation-defined
+ * values shall be equal or greater in magnitude (absolute value) to those
+ * shown, with the same sign.
+ */
+
+/* This file is part of the platform personality, and is commonly generated
+ using the enquire utility (included). */
+
+/* Limits of type 'char' */
+#define CHAR_BIT /* 8 */
+#define CHAR_MAX /* SCHAR_MAX / UCHAR_MAX */
+#define CHAR_MIN /* SCHAR_MIN / 0 */
+#define SCHAR_MAX /* +127 */
+#define SCHAR_MIN /* -127 */
+#define UCHAR_MAX /* 255 (2^CHAR_BIT - 1) */
+
+/* Multibyte characters */
+#define MB_LEN_MAX /* 1 */
+
+/* Limits of type 'short int' */
+#define SHRT_MAX /* +32767 */
+#define SHRT_MIN /* -32767 */
+#define USHRT_MAX /* 65535 */
+
+/* Limits of type 'int' */
+#define INT_MAX /* +32767 */
+#define INT_MIN /* -32767 */
+#define UINT_MAX /* 65535 */
+
+/* Limits of type 'long int' */
+#define LONG_MAX /* +2147483647 */
+#define LONG_MIN /* -2147483647 */
+#define ULONG_MAX /* 4294967295 */
+
+/* Limits of type 'long long int' */
+#define LLONG_MAX /* +9223372036854775807 */
+#define LLONG_MIN /* -9223372036854775807 */
+#define ULLONG_MAX /* 18446744073709551615 */
+
+#endif /* _LIMITS_H */
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Localization
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Localization
+ * --------------------------------------------------------------------------*/
-#ifndef __LOCALE_H
-#define __LOCALE_H __LOCALE_H
+#ifndef _LOCALE_H
+#define _LOCALE_H _LOCALE_H
-// ----------------------------------------------------------------------------
-// DEFINES
+#ifndef _NULL
+#include "__intern.h"
+#endif /* _NULL */
-#include "__NULL.h"
+/* ----------------------------------------------------------------------------
+ * DEFINES
+ * --------------------------------------------------------------------------*/
-// Locale categories
-#define LC_COLLATE 1 // affects strcoll() and strxfrm()
-#define LC_CTYPE 2 // affects ctype.h
-#define LC_MONETARY 4 // affects monetary aspect of localeconv()
-#define LC_NUMERIC 8 // affects numeric aspect of localeconv()
-#define LC_TIME 16 // affects strftime()
-#define LC_ALL 31 // affects all of the above
+#define NULL _NULL
-// ----------------------------------------------------------------------------
-// TYPEDEFS
+/* Locale categories */
+#define LC_COLLATE 1 /* affects strcoll() and strxfrm() */
+#define LC_CTYPE 2 /* affects ctype.h */
+#define LC_MONETARY 4 /* affects monetary aspect of localeconv() */
+#define LC_NUMERIC 8 /* affects numeric aspect of localeconv() */
+#define LC_TIME 16 /* affects strftime() */
+#define LC_ALL 31 /* affects all of the above */
-// TODO: Detailed documentation of grouping formats and field values
+/* ----------------------------------------------------------------------------
+ * TYPEDEFS
+ * --------------------------------------------------------------------------*/
+
+/* TODO: Detailed documentation of grouping formats and field values */
struct lconv
{
- // LC_NUMERIC
- char * decimal_point; // decimal point
- char * grouping; // grouping
- char * thousands_sep; // grouping string
+ /* LC_NUMERIC */
+ char * decimal_point; /* decimal point */
+ char * grouping; /* grouping */
+ char * thousands_sep; /* grouping string */
- // LC_MONETARY
- char * mon_decimal_point; // decimal point
- char * mon_grouping; // grouping
- char * mon_thousands_sep; // grouping string
- char * negative_sign; // negative sign
- char * positive_sign; // positive sign
- char * currency_symbol; // currency symbol
- char frac_digits; // after-point digits
- // negative values
- char n_cs_precedes; // currency symbol preceding value?
- char n_sep_by_space; // currency symbol seperated by space?
- char n_sign_posn; // sign position
- // positive values
- char p_cs_precedes; // currency symbol preceding value?
- char p_sep_by_space; // currency symbol seperated by space?
- char p_sign_posn; // sign position?
+ /* LC_MONETARY */
+ char * mon_decimal_point; /* decimal point */
+ char * mon_grouping; /* grouping */
+ char * mon_thousands_sep; /* grouping string */
+ char * negative_sign; /* negative sign */
+ char * positive_sign; /* positive sign */
+ char * currency_symbol; /* currency symbol */
+ char frac_digits; /* after-point digits */
+ /* negative values */
+ char n_cs_precedes; /* currency symbol preceding value? */
+ char n_sep_by_space; /* currency symbol seperated by space? */
+ char n_sign_posn; /* sign position */
+ /* positive values */
+ char p_cs_precedes; /* currency symbol preceding value? */
+ char p_sep_by_space; /* currency symbol seperated by space? */
+ char p_sign_posn; /* sign position? */
- // for international monetary values
- char * int_curr_symbol; // international currency symbol (ISO 4217)
- char int_frac_digits; // after-point digits
- // negative values
- char int_n_cs_precedes; // currency symbol preceding value?
- char int_n_sep_by_space; // currency symbol seperated by space?
- char int_n_sign_posn; // sign position?
- // positive values
- char int_p_cs_precedes; // currency symbol preceding value?
- char int_p_sep_by_space; // currency symbol seperated by space?
- char int_p_sign_posn; // sign position?
+ /* for international monetary values */
+ char * int_curr_symbol; /* international currency symbol (ISO 4217) */
+ char int_frac_digits; /* after-point digits */
+ /* negative values */
+ char int_n_cs_precedes; /* currency symbol preceding value? */
+ char int_n_sep_by_space; /* currency symbol seperated by space? */
+ char int_n_sign_posn; /* sign position? */
+ /* positive values */
+ char int_p_cs_precedes; /* currency symbol preceding value? */
+ char int_p_sep_by_space; /* currency symbol seperated by space? */
+ char int_p_sign_posn; /* sign position? */
};
-// ----------------------------------------------------------------------------
-// FUNCTIONS
+/* ----------------------------------------------------------------------------
+ * FUNCTIONS
+ * --------------------------------------------------------------------------*/
-// Returns a (pointer to a) lconv structure holding the values for the current
-// locale. The structure must not be changed; values might become outdated with
-// later calls to setlocale() changing LC_NUMERIC, LC_MONETARY or LC_ALL.
+/** Returns a (pointer to a) lconv structure holding the values for the current
+ * locale. The structure must not be changed; values might become outdated with
+ * later calls to setlocale() changing LC_NUMERIC, LC_MONETARY or LC_ALL.
+ */
struct lconv * localeconv( void );
-// Categories are selected by OR'ing the LC_* defines from this header. The
-// function sets the current locale to that defined by locale_name, and returns
-// the name of the new locale (if it was set successfully) or a null pointer
-// (if unsuccessful). At startup, the current locale is "C" by default. A null
-// pointer as locale_name leaves the locale unchanged, an empty string sets it
-// to the "native" locale.
+/** Categories are selected by OR'ing the LC_* defines from this header. The
+ * function sets the current locale to that defined by locale_name, and returns
+ * the name of the new locale (if it was set successfully) or a null pointer
+ * (if unsuccessful). At startup, the current locale is "C" by default. A null
+ * pointer as locale_name leaves the locale unchanged, an empty string sets it
+ * to the "native" locale.
+ */
char * setlocale( int categories, const char * locale_name );
-#endif // __LOCALE_H
+#endif /* _LOCALE_H */
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Mathematics
-// ----------------------------------------------------------------------------
-
-#ifndef __MATH_H
-#define __MATH_H __MATH_H
-
-// TODO: Documentation
-
-// ----------------------------------------------------------------------------
-// DEFINES
-
-#define HUGE_VAL // TODO - personality?
-#define HUGE_VALF // TODO - personality?
-#define HUGE_VALL // TODO - personality?
-
-#define INFINITY // TODO - personality?
-#define NAN // TODO - personality?
-
-#define FP_FAST_FMA // TODO - personality?
-#define FP_FAST_FMAF // TODO - personality?
-#define FP_FAST_FMAL // TODO - personality?
-
-#define FP_INFINITE // TODO - personality?
-#define FP_NAN // TODO - personality?
-#define FP_NORMAL // TODO - personality?
-#define FP_SUBNORMAL // TODO - personality?
-#define FP_ZERO // TODO - personality?
-
-#define FP_ILOGB0 // TODO - personality?
-#define FP_ILOGBNAN // TODO - personality?
-
-#define MATH_ERRNO 1 // personality?
-#define MATH_ERREXCEPT 2 // personality?
-#define math_errhandling // TODO - personality?
-
-// --------------------------------------------------------------------------
-// TYPEDEFS
-
-typedef double_t; // TODO - personality?
-typedef float_t; // TODO - personality?
-
-// --------------------------------------------------------------------------
-// MACROS
-
-#define isgreater( x, y ) // TODO
-#define isgreaterequal( x, y ) // TODO
-#define isless( x, y ) // TODO
-#define islessequal( x, y ) // TODO
-#define islessgreater( x, y ) // TODO
-#define isunordered( x, y ) // TODO
-#define fpclassify( x ) // TODO
-#define isfinite( x ) // TODO
-
-#define isinf( x ) // TODO
-#define isnan( x ) // TODO
-#define isnormal( x ) // TODO
-#define signbit( x ) // TODO
-
-// ----------------------------------------------------------------------------
-// FUNCTIONS
-
-// These functions return the magnitude of their parameter.
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Mathematics
+ * --------------------------------------------------------------------------*/
+
+#ifndef _MATH_H
+#define _MATH_H _MATH_H
+
+/* TODO: Documentation */
+
+/* ----------------------------------------------------------------------------
+ * DEFINES
+ * --------------------------------------------------------------------------*/
+
+#define HUGE_VAL ((double)0x7FF0000000000000) /* TODO */
+#define HUGE_VALF ((float)0x7F800000) /* TODO */
+#define HUGE_VALL ((long double)0x7FFF8000000000000000) /* TODO */
+
+#define INFINITY ((float)0x7F800000) /* TODO */
+#define NAN ((float)0x7F800001) /* TODO */
+
+/* The following values are platform dependant, must be personality. */
+#if 0
+#define FP_FAST_FMA /* TODO */
+#define FP_FAST_FMAF /* TODO */
+#define FP_FAST_FMAL /* TODO */
+#endif
+
+/* These values are used instead of constants to classify numbers. */
+#define FP_UNDEFINED 0
+#define FP_INFINITE 1
+#define FP_NAN 2
+#define FP_NORMAL 3
+#define FP_SUBNORMAL 4
+#define FP_ZERO 5
+
+#define FP_ILOGB0 /* TODO */
+#define FP_ILOGBNAN /* TODO */
+
+#define MATH_ERRNO 1
+#define MATH_ERREXCEPT 2
+
+/* should be MATH_ERRNO | MATH_ERREXCEPT if we do exceptions. Do we? It's
+ * nice if this is implementation-wide the same.
+ */
+#define math_errhandling ((int)MATH_ERRNO)
+
+/* ----------------------------------------------------------------------------
+ * TYPEDEFS
+ * --------------------------------------------------------------------------*/
+
+typedef double_t
+#if FLT_EVAL_METHOD == 0
+ double
+#elif FLT_EVAL_METHOD == 1
+ double
+#elif FLT_EVAL_METHOD == 2
+ long double
+#else
+ /* TODO - this is implementation defined and cpu dependant */
+#endif
+;
+
+typedef float_t
+#if FLT_EVAL_METHOD == 0
+ float
+#elif FLT_EVAL_METHOD == 1
+ double
+#elif FLT_EVAL_METHOD == 2
+ long double
+#else
+ /* TODO - this is implementation defined and cpu dependant */
+#endif
+;
+
+/* ----------------------------------------------------------------------------
+ * MACROS
+ * --------------------------------------------------------------------------*/
+
+#define isgreater( x, y ) /* TODO */
+#define isgreaterequal( x, y ) /* TODO */
+#define isless( x, y ) /* TODO */
+#define islessequal( x, y ) /* TODO */
+#define islessgreater( x, y ) /* TODO */
+#define isunordered( x, y ) /* TODO */
+
+/* Could somebody clean this macro up? It uses 7 other definitions (below).
+ * Also, I suspect this macro to be personality-dependant. Somebody confirm
+ * or deny?
+ */
+#define fp_mef 0x7F800000
+#define fp_mff 0x007FFFFF
+#define fp_med 0x7FF0000000000000
+#define fp_mfd 0x000FFFFFFFFFFFFF
+#define fp_mel 0x7FFF8000000000000000
+#define fp_mjl 0x00004000000000000000 // the j-bit mask
+#define fp_mfl 0x00003FFFFFFFFFFFFFFF
+
+#define fpclassify( x ) ((sizeof(x) == sizeof(float)) ? ( \
+ (((x) & fp_mef) == (fp_mef)) ? ( \
+ (((x) & fp_mff) == (0)) ? ( \
+ FP_INFINITY \
+ ) : ( \
+ FP_NAN \
+ ) \
+ ) : ( \
+ (((x) & fp_mef) == (0)) ? ( \
+ (((x) & fp_mff) == (0)) ? ( \
+ FP_ZERO \
+ ) : ( \
+ FP_DENORMAL \
+ ) \
+ ) : ( \
+ FP_NORMAL \
+ ) \
+ ) \
+ ) : (
+ (sizeof(x) == sizeof(double)) ? ( \
+ (((x) & fp_med) == (fp_med)) ? ( \
+ (((x) & fp_mfd) == (0)) ? ( \
+ FP_INFINITY \
+ ) : ( \
+ FP_NAN \
+ ) \
+ ) : ( \
+ (((x) & fp_med) == (0)) ? ( \
+ (((x) & fp_mfd) == (0)) ? ( \
+ FP_ZERO \
+ ) : ( \
+ FP_DENORMAL \
+ ) \
+ ) : ( \
+ FP_NORMAL \
+ ) \
+ ) \
+ ) : ( \
+ (((x) & fp_mel) == (fp_mel)) ? ( \
+ (((x) & fp_mjl) == (fp_mjl)) ? ( \
+ FP_UNSUPPORTED \
+ ) : ( \
+ (((x) & fp_mfl) == (fp_mfl)) ? ( \
+ FP_NAN \
+ ) : ( \
+ FP_INFINITY \
+ ) \
+ ) \
+ ) : ( \
+ (((x) & fp_mel) == (0)) ? ( \
+ (((x) & fp_mjl) == (fp_mjl)) ? ( \
+ FP_NORMAL \ // or actually, pseudo-denormal
+ ) : ( \
+ (((x) & fp_mfl) == (fp_mfl)) ? ( \
+ FP_DENORMAL \
+ ) : ( \
+ FP_ZERO \
+ ) \
+ ) \
+ ) : ( \
+ (((x) & fp_mjl) == (fp_mjl)) ? ( \
+ FP_NORMAL \
+ ) : ( \
+ FP_UNDEFINED \
+ ) \
+ ) \
+ ) \
+ ) \
+ ) \
+ )
+
+#define isfinite( x ) ((sizeof(x) == sizeof(float)) ? ( \
+ (((x) & fp_mef) == (fp_mef)) ? ( \
+ 0 \
+ ) : ( \
+ 1 \
+ ) \
+ ) : (
+ (sizeof(x) == sizeof(double)) ? ( \
+ (((x) & fp_med) == (fp_med)) ? ( \
+ 0 \
+ ) : ( \
+ 1 \
+ ) \
+ ) : ( \
+ (((x) & fp_mel) == (fp_mel)) ? ( \
+ 0 \
+ ) : ( \
+ (((x) & fp_mel) == (0)) ? ( \
+ (((x) & fp_mjl) == (fp_mjl)) ? ( \
+ 1 \
+ ) : ( \
+ 0 \
+ ) \
+ ) : ( \
+ (((x) & fp_mjl) == (fp_mjl)) ? ( \
+ 1 \
+ ) : ( \
+ 0 \
+ ) \
+ ) \
+ ) \
+ ) \
+ ) \
+ )
+
+#define isinf( x ) ((sizeof(x) == sizeof(float)) ? ( \
+ (((x) & fp_mef) == (fp_mef)) ? ( \
+ (((x) & fp_mff) == (0)) ? ( \
+ 1 \
+ ) : ( \
+ 0 \
+ ) \
+ ) : ( \
+ 0 \
+ ) \
+ ) : ((sizeof(x) == sizeof(double)) ? ( \
+ (((x) & fp_med) == (fp_med)) ? ( \
+ (((x) & fp_mfd) == (0)) ? ( \
+ 1 \
+ ) : ( \
+ 0 \
+ ) \
+ ) : ( \
+ 0 \
+ ) \
+ ) : ( \
+ (((x) & fp_mel) == (fp_mel)) ? ( \
+ (((x) & fp_mjl) == (0)) ? ( \
+ (((x) & fp_mfl) == (fp_mfl)) ? ( \
+ 0 \
+ ) : ( \
+ 1 \
+ ) \
+ ) : ( \
+ 0 \
+ ) \
+ ) : ( \
+ 0 \
+ ) \
+ ) \
+ ) \
+ )
+
+#define isnan( x ) ((sizeof(x) == sizeof(float)) ? ( \
+ (((x) & fp_mef) == (fp_mef)) ? ( \
+ (((x) & fp_mff) == (0)) ? ( \
+ 0 \
+ ) : ( \
+ 1 \
+ ) \
+ ) : ( \
+ 0 \
+ ) \
+ ) : ((sizeof(x) == sizeof(double)) ? ( \
+ (((x) & fp_med) == (fp_med)) ? ( \
+ (((x) & fp_mfd) == (0)) ? ( \
+ 0 \
+ ) : ( \
+ 1 \
+ ) \
+ ) : ( \
+ 0 \
+ ) \
+ ) : ( \
+ (((x) & fp_mel) == (fp_mel)) ? ( \
+ (((x) & fp_mjl) == (0)) ? ( \
+ (((x) & fp_mfl) == (fp_mfl)) ? ( \
+ 1 \
+ ) : ( \
+ 0 \
+ ) \
+ ) : ( \
+ 0 \
+ ) \
+ ) : ( \
+ 0 \
+ ) \
+ ) \
+ ) \
+ )
+
+#define isnormal( x ) ((sizeof(x) == sizeof(float)) ? ( \
+ (((x) & fp_mef) == (fp_mef)) ? ( \
+ 0 \
+ ) : ( \
+ (((x) & fp_mef) == (0)) ? ( \
+ 0 \
+ ) : ( \
+ 1 \
+ ) \
+ ) \
+ ) : ((sizeof(x) == sizeof(double)) ? ( \
+ (((x) & fp_med) == (fp_med)) ? ( \
+ 0 \
+ ) : ( \
+ (((x) & fp_med) == (0)) ? ( \
+ 0 \
+ ) : ( \
+ 1 \
+ ) \
+ ) \
+ ) : ( \
+ (((x) & fp_mel) == (fp_mel)) ? ( \
+ 0 \
+ ) : ( \
+ (((x) & fp_mel) == (0)) ? ( \
+ (((x) & fp_mjl) == (fp_mjl)) ? ( \
+ 1 \
+ ) : ( \
+ 0 \
+ ) \
+ ) : ( \
+ (((x) & fp_mjl) == (fp_mjl)) ? ( \
+ 1 \
+ ) : ( \
+ 0 \
+ ) \
+ ) \
+ ) \
+ ) \
+ ) \
+ )
+
+#define signbit( x ) ((sizeof(x) == sizeof(float)) ? ( \
+ (((x) & 0x80000000) == (0)) ? ( \
+ 0 \
+ ) : ( \
+ 1 \
+ ) \
+ ) : ((sizeof(x) == sizeof(double)) ? ( \
+ (((x) & 0x8000000000000000) == (0)) ? ( \
+ 0 \
+ ) : ( \
+ 1 \
+ ) \
+ ) : ( \
+ (((x) & 0x80000000000000000000) == (0)) ? ( \
+ 0 \
+ ) : ( \
+ 1 \
+ ) \
+ ) \
+ ) \
+ )
+
+/* ----------------------------------------------------------------------------
+ * FUNCTIONS
+ * --------------------------------------------------------------------------*/
+
+/** These functions return the magnitude of x.
+ * @param x The value to find the absolute value of.
+ * @return The absolute value of x.
+ * @see fabsl()
+ * @see fabsf()
+ */
double fabs( double x );
+
+/** These functions return the magnitude of x.
+ * @param x The value to find the absolute value of.
+ * @return The absolute value of x.
+ * @see fabsl()
+ * @see fabs()
+ */
float fabsf( float x );
+
+/** These functions return the magnitude of x.
+ * @param x The value to find the absolute value of.
+ * @return The absolute value of x.
+ * @see fabs()
+ * @see fabsf()
+ */
long double fabsl( long double x );
-// These functions compute the sine of x (measured in radians).
+/** These functions compute the sine of x (measured in radians).
+ * @param x The value to compute the sine of.
+ * @return The sine of x.
+ * @see sinf()
+ * @see sinl()
+ * @see cos()
+ * @see tan()
+ * @see sinh()
+ * @see asin()
+ */
double sin( double x );
+
+/** These functions compute the sine of x (measured in radians).
+ * @param x The value to compute the sine of.
+ * @return The sine of x.
+ * @see sin()
+ * @see sinl()
+ * @see cosf()
+ * @see tanf()
+ * @see sinhf()
+ * @see asinf()
+ */
float sinf( float x );
+
+/** These functions compute the sine of x (measured in radians).
+ * @param x The value to compute the sine of.
+ * @return The sine of x.
+ * @see sinf()
+ * @see sin()
+ * @see cosl()
+ * @see tanl()
+ * @see sinhl()
+ * @see asinl()
+ */
long double sinl( long double x );
-// These functions return the hyperbolic cosine of their parameter.
+/** These functions compute the hyperbolic sine of x (measured in radians).
+ * @param x The value to compute the hyperbolic sine of.
+ * @return The hyperbolic sine of x.
+ * @see sinhf()
+ * @see sinhl()
+ * @see sin()
+ * @see cosh()
+ * @see tanh()
+ * @see asinh()
+ */
double sinh( double x );
+
+/** These functions compute the hyperbolic sine of x (measured in radians).
+ * @param x The value to compute the hyperbolic sine of.
+ * @return The hyperbolic sine of x.
+ * @see sinh()
+ * @see sinhl()
+ * @see sinf()
+ * @see coshf()
+ * @see tanhf()
+ * @see asinhf()
+ */
float sinhf( float x );
+
+/** These functions compute the hyperbolic sine of x (measured in radians).
+ * @param x The value to compute the hyperbolic sine of.
+ * @return The hyperbolic sine of x.
+ * @see sinh()
+ * @see sinhf()
+ * @see sinl()
+ * @see coshl()
+ * @see tanhl()
+ * @see asinhl()
+ */
long double sinhl( long double x );
-// These functions return the arcsine of their parameter.
+/** These functions compute the arcsine of x (measured in radians).
+ * @param x The value to compute the arcsine of.
+ * @return The arcsine of x.
+ * @see asinf()
+ * @see asinl()
+ * @see sin()
+ * @see acos()
+ * @see atan()
+ * @see asinh()
+ */
double asin( double x );
+
+/** These functions compute the arcsine of x (measured in radians).
+ * @param x The value to compute the arcsine of.
+ * @return The arcsine of x.
+ * @see asin()
+ * @see asinl()
+ * @see sinf()
+ * @see acosf()
+ * @see atanf()
+ * @see asinhf()
+ */
float asinf( float x );
+
+/** These functions compute the arcsine of x (measured in radians).
+ * @param x The value to compute the arcsine of.
+ * @return The arcsine of x.
+ * @see asin()
+ * @see asinf()
+ * @see sinl()
+ * @see acosl()
+ * @see atanl()
+ * @see asinhl()
+ */
long double asinl( long double x );
-// These functions return the hyperbolic arcsine of their parameter.
+/** These functions compute the hyperbolic arcsine of x (measured in radians).
+ * @param x The value to compute the hyperbolic arcsine of.
+ * @return The hyperbolic arcsine of x.
+ * @see asinhf()
+ * @see asinhl()
+ * @see asin()
+ * @see acosh()
+ * @see atanh()
+ * @see sinh()
+ */
double asinh( double x );
+
+/** These functions compute the hyperbolic arcsine of x (measured in radians).
+ * @param x The value to compute the hyperbolic arcsine of.
+ * @return The hyperbolic arcsine of x.
+ * @see asinh()
+ * @see asinhl()
+ * @see asinf()
+ * @see acoshf()
+ * @see atanhf()
+ * @see sinhf()
+ */
float asinhf( float x );
+
+/** These functions compute the hyperbolic arcsine of x (measured in radians).
+ * @param x The value to compute the hyperbolic arcsine of.
+ * @return The hyperbolic arcsine of x.
+ * @see asinh()
+ * @see asinhf()
+ * @see asinl()
+ * @see acoshl()
+ * @see atanhl()
+ * @see sinhl()
+ */
long double asinhl( long double x );
-// These functions compute the cosine of x (measured in radians).
+/** These functions compute the cosine of x (measured in radians).
+ * @param x The value to compute the cosine of.
+ * @return The cosine of x.
+ * @see cosf()
+ * @see cosl()
+ * @see sin()
+ * @see cosh()
+ * @see tan()
+ * @see acos()
+ */
double cos( double x );
+
+/** These functions compute the cosine of x (measured in radians).
+ * @param x The value to compute the cosine of.
+ * @return The cosine of x.
+ * @see cos()
+ * @see cosl()
+ * @see sinf()
+ * @see coshf()
+ * @see tanf()
+ * @see acosf()
+ */
float cosf( float x );
+
+/** These functions compute the cosine of x (measured in radians).
+ * @param x The value to compute the cosine of.
+ * @return The cosine of x.
+ * @see cos()
+ * @see cosf()
+ * @see sinl()
+ * @see coshl()
+ * @see tanl()
+ * @see acosl()
+ */
long double cosl( long double x );
-// These functions return the hyperbolic cosine of their parameter.
+/** These functions compute the hyperbolic cosine of x (measured in radians).
+ * @param x The value to compute the hyperbolic cosine of.
+ * @return The hyperbolic cosine of x.
+ * @see coshf()
+ * @see coshl()
+ * @see sinh()
+ * @see cos()
+ * @see tanh()
+ * @see acosh()
+ */
double cosh( double x );
+
+/** These functions compute the hyperbolic cosine of x (measured in radians).
+ * @param x The value to compute the hyperbolic cosine of.
+ * @return The hyperbolic cosine of x.
+ * @see cosh()
+ * @see coshl()
+ * @see sinhf()
+ * @see cosf()
+ * @see tanhf()
+ * @see acoshf()
+ */
float coshf( float x );
+
+/** These functions compute the hyperbolic cosine of x (measured in radians).
+ * @param x The value to compute the hyperbolic cosine of.
+ * @return The hyperbolic cosine of x.
+ * @see cosh()
+ * @see coshf()
+ * @see sinhl()
+ * @see cosl()
+ * @see tanhl()
+ * @see acoshl()
+ */
long double coshl( long double x );
-// These functions return the arccosine of their parameter.
+/** These functions compute the arccosine of x (measured in radians).
+ * @param x The value to compute the arccosine of.
+ * @return The arccosine of x.
+ * @see acosf()
+ * @see acosl()
+ * @see asin()
+ * @see cos()
+ * @see atan()
+ * @see acosh()
+ */
double acos( double x );
+
+/** These functions compute the arccosine of x (measured in radians).
+ * @param x The value to compute the arccosine of.
+ * @return The arccosine of x.
+ * @see acos()
+ * @see acosl()
+ * @see asinf()
+ * @see cosf()
+ * @see atanf()
+ * @see acoshf()
+ */
float acosf( float x );
+
+/** These functions compute the arccosine of x (measured in radians).
+ * @param x The value to compute the arccosine of.
+ * @return The arccosine of x.
+ * @see acos()
+ * @see acosf()
+ * @see asinl()
+ * @see cosl()
+ * @see atanl()
+ * @see acoshl()
+ */
long double acosl( long double x );
-// These functions return the hyperbolic arccosine of their parameter.
+/** These functions compute the hyperbolic arccosine of x (measured in radians).
+ * @param x The value to compute the hyperbolic arccosine of.
+ * @return The hyperbolic arccosine of x.
+ * @see acoshf()
+ * @see acoshl()
+ * @see asinh()
+ * @see cosh()
+ * @see atanh()
+ * @see acos()
+ */
double acosh( double x );
+
+/** These functions compute the hyperbolic arccosine of x (measured in radians).
+ * @param x The value to compute the hyperbolic arccosine of.
+ * @return The hyperbolic arccosine of x.
+ * @see acosh()
+ * @see acoshl()
+ * @see asinhf()
+ * @see coshf()
+ * @see atanhf()
+ * @see acosf()
+ */
float acoshf( float x );
+
+/** These functions compute the hyperbolic arccosine of x (measured in radians).
+ * @param x The value to compute the hyperbolic arccosine of.
+ * @return The hyperbolic arccosine of x.
+ * @see acosh()
+ * @see acoshf()
+ * @see asinhl()
+ * @see coshl()
+ * @see atanhl()
+ * @see acosl()
+ */
long double acoshl( long double x );
-// These functions return the tangent of x.
+/** These functions compute the tangent of x (measured in radians).
+ * @param x The value to compute the tangent of.
+ * @return The tangent of x.
+ * @see tanf()
+ * @see tanl()
+ * @see sin()
+ * @see cos()
+ * @see tanh()
+ * @see atan()
+ */
double tan( double x );
+
+/** These functions compute the tangent of x (measured in radians).
+ * @param x The value to compute the tangent of.
+ * @return The tangent of x.
+ * @see tan()
+ * @see tanl()
+ * @see sinf()
+ * @see cosf()
+ * @see tanhf()
+ * @see atanf()
+ */
float tanf( float x );
+
+/** These functions compute the tangent of x (measured in radians).
+ * @param x The value to compute the tangent of.
+ * @return The tangent of x.
+ * @see tan()
+ * @see tanf()
+ * @see sinl()
+ * @see cosl()
+ * @see tanhl()
+ * @see atanl()
+ */
long double tanl( long double x );
-// These functions return the hyperbolic tangent of their parameter.
+/** These functions compute the hyperbolic tangent of x (measured in radians).
+ * @param x The value to compute the hyperbolic tangent of.
+ * @return The hyperbolic tangent of x.
+ * @see tanhf()
+ * @see tanhl()
+ * @see sinh()
+ * @see cosh()
+ * @see tan()
+ * @see atanh()
+ */
double tanh( double x );
+
+/** These functions compute the hyperbolic tangent of x (measured in radians).
+ * @param x The value to compute the hyperbolic tangent of.
+ * @return The hyperbolic tangent of x.
+ * @see tanh()
+ * @see tanhl()
+ * @see sinhf()
+ * @see coshf()
+ * @see tanf()
+ * @see atanhf()
+ */
float tanhf( float x );
+
+/** These functions compute the hyperbolic tangent of x (measured in radians).
+ * @param x The value to compute the hyperbolic tangent of.
+ * @return The hyperbolic tangent of x.
+ * @see tanh()
+ * @see tanhf()
+ * @see sinhl()
+ * @see coshl()
+ * @see tanl()
+ * @see atanhl()
+ */
long double tanhl( long double x );
-// These functions compute the arctangent of x.
+/** These functions compute the arctangent of x (measured in radians).
+ * @param x The value to compute the arctangent of.
+ * @return The arctangent of x.
+ * @see atanf()
+ * @see atanl()
+ * @see atan2()
+ * @see asin()
+ * @see acos()
+ * @see tan()
+ * @see atanh()
+ */
double atan( double x );
+
+/** These functions compute the arctangent of x (measured in radians).
+ * @param x The value to compute the arctangent of.
+ * @return The arctangent of x.
+ * @see atan()
+ * @see atanl()
+ * @see atan2f()
+ * @see asinf()
+ * @see acosf()
+ * @see tanf()
+ * @see atanhf()
+ */
float atanf( float x );
+
+/** These functions compute the arctangent of x (measured in radians).
+ * @param x The value to compute the arctangent of.
+ * @return The arctangent of x.
+ * @see atan()
+ * @see atanf()
+ * @see atan2l()
+ * @see asinl()
+ * @see acosl()
+ * @see tanl()
+ * @see atanhl()
+ */
long double atanl( long double x );
-// These functions return the hyperbolic arctangent of their parameter.
+/** These functions compute the hyperbolic arctangent of x (measured in radians).
+ * @param x The value to compute the hyperbolic arctangent of.
+ * @return The hyperbolic arctangent of x.
+ * @see atanhf()
+ * @see atanhl()
+ * @see asinh()
+ * @see acosh()
+ * @see tanh()
+ * @see atan()
+ */
double atanh( double x );
+
+/** These functions compute the hyperbolic arctangent of x (measured in radians).
+ * @param x The value to compute the hyperbolic arctangent of.
+ * @return The hyperbolic arctangent of x.
+ * @see atanh()
+ * @see atanhl()
+ * @see asinhf()
+ * @see acoshf()
+ * @see tanhf()
+ * @see atanf()
+ */
float atanhf( float x );
+
+/** These functions compute the hyperbolic arctangent of x (measured in radians).
+ * @param x The value to compute the hyperbolic arctangent of.
+ * @return The hyperbolic arctangent of x.
+ * @see atanh()
+ * @see atanhf()
+ * @see asinhl()
+ * @see acoshl()
+ * @see tanhl()
+ * @see atanl()
+ */
long double atanhl( long double x );
-// TODO
+/** These functions compute the hyperbolic arctangent of x / y (measured in radians).
+ * They return their answer between pi and -pi.
+ * @param y The first side of the triangle.
+ * @param x The second side of the triangle.
+ * @return The angle between the first and the second side.
+ * @see atan2f()
+ * @see atan2l()
+ * @see atan()
+ * @see asin()
+ * @see acos()
+ * @see atanh()
+ * @see tanh()
+ */
double atan2( double y, double x );
+
+/** These functions compute the hyperbolic arctangent of x / y (measured in radians).
+ * They return their answer between pi and -pi.
+ * @param y The first side of the triangle.
+ * @param x The second side of the triangle.
+ * @return The angle between the first and the second side.
+ * @see atan2f()
+ * @see atan2l()
+ * @see atanf()
+ * @see asinf()
+ * @see acosf()
+ * @see atanhf()
+ * @see tanhf()
+ */
float atan2f( float y, float x );
+
+/** These functions compute the hyperbolic arctangent of x / y (measured in radians).
+ * They return their answer between pi and -pi.
+ * @param y The first side of the triangle.
+ * @param x The second side of the triangle.
+ * @return The angle between the first and the second side.
+ * @see atan2f()
+ * @see atan2l()
+ * @see atanl()
+ * @see asinl()
+ * @see acosl()
+ * @see atanhl()
+ * @see tanhl()
+ */
long double atan2l( long double y, long double x );
-// These functions return sqrt(x^2 + y^2 ).
+/** These functions compute the hypotenuse of a straight triangle.
+ * @param x The length of one side of the triangle.
+ * @param y The length of the other side of the triangle.
+ * @return The length of the hypotenuse, according to h = sqrt(x*x+y*y).
+ * @see hypotf()
+ * @see hypotl()
+ */
double hypot( double x, double y );
+
+/** These functions compute the hypotenuse of a straight triangle.
+ * @param x The length of one side of the triangle.
+ * @param y The length of the other side of the triangle.
+ * @return The length of the hypotenuse, according to h = sqrt(x*x+y*y).
+ * @see hypot()
+ * @see hypotl()
+ */
float hypotf( float x, float y );
+
+/** These functions compute the hypotenuse of a straight triangle.
+ * @param x The length of one side of the triangle.
+ * @param y The length of the other side of the triangle.
+ * @return The length of the hypotenuse, according to h = sqrt(x*x+y*y).
+ * @see hypot()
+ * @see hypotf()
+ */
long double hypotl( long double x, long double y );
-// These functions return their parameter x, raised to the power y.
+/** These functions compute x raised to the power y.
+ * @param x The base of the power.
+ * @param y The exponent of the power.
+ * @return The base raised to the power of the exponent.
+ * @see powf()
+ * @see powl()
+ */
double pow( double x, double y );
+
+/** These functions compute x raised to the power y.
+ * @param x The base of the power.
+ * @param y The exponent of the power.
+ * @return The base raised to the power of the exponent.
+ * @see pow()
+ * @see powl()
+ */
float powf( float x, float y );
+
+/** These functions compute x raised to the power y.
+ * @param x The base of the power.
+ * @pa am y The exponent of the power.
+ * @return The base raised to the power of the exponent.
+ * @see pow()
+ * @see powf()
+ */
long double powl( long double x, long double y );
-// These functions return the square root of their parameter.
+/** These functions compute the square root of x.
+ * @param x The value to take the square root of.
+ * @return The square root of x.
+ * @see sqrtf()
+ * @see sqrtl()
+ */
double sqrt( double x );
+
+/** These functions compute the square root of x.
+ * @param x The value to take the square root of.
+ * @return The square root of x.
+ * @see sqrt()
+ * @see sqrtl()
+ */
float sqrtf( float x );
+
+/** These functions compute the square root of x.
+ * @param x The value to take the square root of.
+ * @return The square root of x.
+ * @see sqrt()
+ * @see sqrtf()
+ */
long double sqrtl( long double x );
-// TODO
+/* TODO */
double cbrt( double x );
float cbrtf( float x );
long double cbrtl( long double x );
-// TODO
+/* TODO */
double exp( double x );
float expf( float x );
long double expl( long double x );
-// TODO
+/* TODO */
double exp2( double x );
float exp2f( float x );
long double exp2l( long double x );
-// TODO
+/* TODO */
double expm1( double x );
float expm1f( float x );
long double expm1l( long double x );
-// TODO
+/* TODO */
double frexp( double x, int * exp );
float frexpf( float x, int * exp );
long double frexpl( long double x, int * exp );
-// TODO
+/* TODO */
double ldexp( double x, int exp );
float ldexpf( float x, int exp );
long double ldexpl( long double x, int exp );
-// These functions return the natural logarithm of their parameter.
+/** These functions compute the logarithm (base e) of x.
+ * @param x The value to take the logarithm of.
+ * @return The logarithm of x.
+ * @see logf()
+ * @see logl()
+ * @todo is this really the natural logarithm? wouldn't it be ln()?
+ */
double log( double x );
+
+/** These functions compute the logarithm (base e) of x.
+ * @param x The value to take the logarithm of.
+ * @return The logarithm of x.
+ * @see log()
+ * @see logl()
+ * @todo is this really the natural logarithm? wouldn't it be ln()?
+ */
float logf( float x );
+
+/** These functions compute the logarithm (base e) of x.
+ * @param x The value to take the logarithm of.
+ * @return The logarithm of x.
+ * @see log()
+ * @see logf()
+ * @todo is this really the natural logarithm? wouldn't it be ln()?
+ */
long double logl( long double x );
-// These functions return the logarithm (base 10 ) of their parameter.
+/** These functions compute the logarithm (base 10) of x.
+ * @param x The value to take the logarithm of.
+ * @return The logarithm of x.
+ * @see log10f()
+ * @see log10l()
+ */
double log10( double x );
+
+/** These functions compute the logarithm (base 10) of x.
+ * @param x The value to take the logarithm of.
+ * @return The logarithm of x.
+ * @see log10()
+ * @see log10l()
+ */
float log10f( float x );
+
+/** These functions compute the logarithm (base 10) of x.
+ * @param x The value to take the logarithm of.
+ * @return The logarithm of x.
+ * @see log10()
+ * @see log10f()
+ */
long double log10l( long double x );
-// These functions return the logarithm (base 2 ) of their parameter.
+/** These functions compute the logarithm (base 2) of x.
+ * @param x The value to take the logarithm of.
+ * @return The logarithm of x.
+ * @see log2f()
+ * @see log2l()
+ */
double log2( double x );
+
+/** These functions compute the logarithm (base 2) of x.
+ * @param x The value to take the logarithm of.
+ * @return The logarithm of x.
+ * @see log2()
+ * @see log2l()
+ */
float log2f( float x );
+
+/** These functions compute the logarithm (base 2) of x.
+ * @param x The value to take the logarithm of.
+ * @return The logarithm of x.
+ * @see log2()
+ * @see log2f()
+ */
long double log2l( long double x );
-// TODO
+/* TODO */
double logb( double x );
float logbf( float x );
long double logbl( long double x );
-// TODO
+/* TODO */
int ilogb( double x );
int ilogbf( float x );
int ilogbl( long double x );
-// TODO
+/* TODO */
double log1p( double x );
float log1pf( float x );
long double log1pl( long double x );
-// These functions return the smallest integer no smaller than value.
+/** These functions increase x to the next whole number.
+ * @param x The value to increase.
+ * @return The next whole number after x.
+ * @see ceilf()
+ * @see ceill()
+ */
double ceil( double x );
+
+/** These functions increase x to the next whole number.
+ * @param x The value to increase.
+ * @return The next whole number after x.
+ * @see ceil()
+ * @see ceill()
+ */
float ceilf( float x );
+
+/** These functions increase x to the next whole number.
+ * @param x The value to increase.
+ * @return The next whole number after x.
+ * @see ceil()
+ * @see ceilf()
+ */
long double ceill( long double x );
-// These functions return the largest integer no larger than their parameter.
+/** These functions decrease x to the previous whole number.
+ * @param x The value to decrease.
+ * @return The previous whole number before x.
+ * @see floorf()
+ * @see floorl()
+ */
double floor( double x );
+
+/** These functions decrease x to the previous whole number.
+ * @param x The value to decrease.
+ * @return The previous whole number before x.
+ * @see floor()
+ * @see floorl()
+ */
float floorf( float x );
+
+/** These functions decrease x to the previous whole number.
+ * @param x The value to decrease.
+ * @return The previous whole number before x.
+ * @see floor()
+ * @see floorf()
+ */
long double floorl( long double x );
-// TODO
+/** These functions compute the modulus of x and y.
+ * @param x The value to take the modulus of.
+ * @param y The modulus.
+ * @return The value of x modulus y.
+ * @see fmodf()
+ * @see fmodl()
+ */
double fmod( double x, double y );
+
+/** These functions compute the modulus of x and y.
+ * @param x The value to take the modulus of.
+ * @param y The modulus.
+ * @return The value of x modulus y.
+ * @see fmod()
+ * @see fmodl()
+ */
float fmodf( float x, float y );
+
+/** These functions compute the modulus of x and y.
+ * @param x The value to take the modulus of.
+ * @param y The modulus.
+ * @return The value of x modulus y.
+ * @see fmod()
+ * @see fmodf()
+ */
long double fmodl( long double x, long double y );
-// TODO
+/* TODO */
double modf( double x, double * integer );
float modff( float x, float * integer );
long double modfl( long double x, long double * integer );
-// These functions return their parameter x, with the sign of parameter y.
+/** These functions return x with the sign of y.
+ * @param x The value to set the sign of.
+ * @param y The value from which to read the sign.
+ * @return The magnitude of x with the sign of y.
+ * @see copysignf()
+ * @see copysignl()
+ */
double copysign( double x, double y );
+
+/** These functions return x with the sign of y.
+ * @param x The value to set the sign of.
+ * @param y The value from which to read the sign.
+ * @return The magnitude of x with the sign of y.
+ * @see copysign()
+ * @see copysignl()
+ */
float copysignf( float x, float y );
+
+/** These functions return x with the sign of y.
+ * @param x The value to set the sign of.
+ * @param y The value from which to read the sign.
+ * @return The magnitude of x with the sign of y.
+ * @see copysign()
+ * @see copysignf()
+ */
long double copysignl( long double x, long double y );
-// TODO
+/* TODO */
double erf( double x );
float erff( float x );
long double erfl( long double x );
-// TODO
+/* TODO */
double erfc( double x );
float erfcf( float x );
long double erfcl( long double x );
-// TODO
+/* TODO */
double fdim( double x, double y );
float fdimf( float x, float y );
long double fdiml( long double x, long double y );
-// TODO
+/* TODO */
double fma( double x, double y, double z );
float fmaf( float x, float y, float z );
long double fmal( long double x, long double y, long double z );
-// These functions return the larger of their parameters.
+/** These functions return the largest of the parameters.
+ * @param x The first candidate.
+ * @param y The second candidate.
+ * @return The largest of x and y.
+ * @see fmaxf()
+ * @see fmaxl()
+ */
double fmax( double x, double y );
+
+/** These functions return the largest of the parameters.
+ * @param x The first candidate.
+ * @param y The second candidate.
+ * @return The largest of x and y.
+ * @see fmax()
+ * @see fmaxl()
+ */
float fmaxf( float x, float y );
+
+/** These functions return the largest of the parameters.
+ * @param x The first candidate.
+ * @param y The second candidate.
+ * @return The largest of x and y.
+ * @see fmax()
+ * @see fmaxf()
+ */
long double fmaxl( long double x, long double y );
-// These functions return the smaller of their parameters.
+/** These functions return the smallest of the parameters.
+ * @param x The first candidate.
+ * @param y The second candidate.
+ * @return The smallest of x and y.
+ * @see fminf()
+ * @see fminl()
+ */
double fmin( double x, double y );
+
+/** These functions return the smallest of the parameters.
+ * @param x The first candidate.
+ * @param y The second candidate.
+ * @return The smallest of x and y.
+ * @see fmin()
+ * @see fminl()
+ */
float fminf( float x, float y );
+
+/** These functions return the smallest of the parameters.
+ * @param x The first candidate.
+ * @param y The second candidate.
+ * @return The smallest of x and y.
+ * @see fmin()
+ * @see fminf()
+ */
long double fminl( long double x, long double y );
-// TODO
+/* TODO */
long long llrint( double x );
long long llrintf( float x );
long long llrintl( long double x );
float rintf( float x );
long double rintl( long double x );
-// TODO
+/* TODO - These functions return their parameter correctly rounded according
+ * to the current rounding settings.
+ */
long long llround( double x );
long long llroundf( float x );
long long llroundl( long double x );
float roundf( float x );
long double roundl( long double x );
-// TODO
+/* TODO - These functions return their parameter with its decimal part
+ * truncated.
+ */
double trunc( double x );
float truncf( float x );
long double truncl( long double x );
float nextafterf( float x, float y );
long double nextafterl( long double x, long double y );
-// TODO
+/* TODO */
double nexttoward( double x, long double y );
float nexttowardf( float x, long double y );
long double nexttowardl( long double x, long double y );
-// TODO
+/* TODO - These functions divide parameter x by parameter y and return the
+ * remainder.
+ */
double remainder( double x, double y );
float remainderf( float x, float y );
long double remainderl( long double x, long double y );
-// TODO
+/* TODO */
double remquo( double x, double y, int * pquo );
float remquof( float x, float y, int * pquo );
long double remquol( long double x, long double y, int * pquo );
-// TODO
+/* TODO */
double scalbn( double x, int ex );
float scalbnf( float x, int ex );
long double scalbnl( long double x, int ex );
-// TODO
+/* TODO */
double scalbln( double x, long ex );
float scalblnf( float x, long ex );
long double scalblnl( long double x, long ex );
-// TODO
+/* TODO */
double lgamma( double x );
float lgammaf( float x );
long double lgammal( long double x );
-// TODO
+/* TODO */
double tgamma( double x );
float tgammaf( float x );
long double tgammal( long double x );
-// TODO
+/* TODO */
double nan( const char *str );
float nanf( const char *str );
long double nanl( const char *str );
-#endif // __MATH_H
+#endif /* _MATH_H */
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Nonlocal jumps
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Nonlocal jumps
+ * --------------------------------------------------------------------------*/
-#ifndef __SETJMP_H
-#define __SETJMP_H __SETJMP_H
+#ifndef _SETJMP_H
+#define _SETJMP_H _SETJMP_H
-// TODO: Documentation
+/* TODO: Documentation */
-// ----------------------------------------------------------------------------
-// TYPEDEFS
+/* ----------------------------------------------------------------------------
+ * TYPEDEFS
+ * --------------------------------------------------------------------------*/
-struct jmp_buf[1]; // TODO
+struct jmp_buf[1]; /* TODO */
-// ----------------------------------------------------------------------------
-// FUNCTIONS
+/* ----------------------------------------------------------------------------
+ * FUNCTIONS
+ * --------------------------------------------------------------------------*/
int setjmp( jmp_buf env );
void longjmp( jmp_buf env, int val );
-#endif // __SETJMP_H
+#endif /* _SETJMP_H */
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Signal handling
-// ----------------------------------------------------------------------------
-
-#ifndef __SIGNAL_H
-#define __SIGNAL_H __SIGNAL_H
-
-// TODO: Documentation
-
-// ----------------------------------------------------------------------------
-// MACROS
-
-#define SIGABRT // TODO - personality?
-#define SIGFPE // TODO - personality?
-#define SIGILL // TODO - personality?
-#define SIGINT // TODO - personality?
-#define SIGSEGV // TODO - personality?
-#define SIGTERM // TODO - personality?
-#define SIG_DFL // TODO - personality?
-#define SIG_ERR // TODO - personality?
-#define SIG_IGN // TODO - personality?
-
-// ----------------------------------------------------------------------------
-// TYPEDEFS
-
-typedef sig_atomic_t; // TODO - personality?
-
-// ----------------------------------------------------------------------------
-// FUNCTIONS
-
-int raise( int sig ); // TODO
-void ( * signal( int sig, void ( *func )( int ) ) ) ( int ); // TODO
-
-#endif // __SIGNAL_H
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Signal handling
+ * --------------------------------------------------------------------------*/
+
+#ifndef _SIGNAL_H
+#define _SIGNAL_H _SIGNAL_H
+
+#ifndef _NULL
+#include "__intern.h"
+#endif
+
+/* TODO: Documentation */
+
+/* ----------------------------------------------------------------------------
+ * MACROS
+ * --------------------------------------------------------------------------*/
+
+#define SIGABRT _SIGABRT
+#define SIGFPE _SIGFPE
+#define SIGILL _SIGILL
+#define SIGINT _SIGINT
+#define SIGSEGV _SIGSEGV
+#define SIGTERM _SIGTERM
+#define SIG_DFL _SIG_DFL
+#define SIG_ERR _SIG_ERR
+#define SIG_IGN _SIG_IGN
+
+/* ----------------------------------------------------------------------------
+ * TYPEDEFS
+ * --------------------------------------------------------------------------*/
+
+#ifndef _SIG_ATOMIC_T
+#define _SIG_ATOMIC_T _SIG_ATOMIC_T
+typedef __sig_atomic_t sig_atomic_t;
+#endif /* _SIG_ATOMIC_T
+
+/* ----------------------------------------------------------------------------
+ * FUNCTIONS
+ * --------------------------------------------------------------------------*/
+
+int raise( int sig ); /* TODO */
+void ( * signal( int sig, void ( *func )( int ) ) ) ( int ); /* TODO */
+
+#endif /* _SIGNAL_H */
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Variable arguments
-// ----------------------------------------------------------------------------
-
-#ifndef __STDARG_H
-#define __STDARG_H __STDARG_H
-
-// ----------------------------------------------------------------------------
-// TYPEDEFS
-
-typedef do-type va_list; // TODO
-
-// ----------------------------------------------------------------------------
-// MACROS
-
-#define va_arg( va_list ap, Ty ) // TODO
-#define va_copy( va_list dest, va_list src ) // TODO
-#define va_end( va_list ap ) // TODO
-#define va_start( va_list ap, last-par ) // TODO
-
-/* PDPC code - unreviewed
-#define va_start(ap, parmN) ap = (char *)&parmN + 4
-#define va_arg(ap, type) *(type *)(ap += sizeof(type), ap - sizeof(type))
-#define va_end(ap) ap = 0
-*/
-
-#endif // __STDARG_H
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Variable arguments
+ * ----------------------------------------------------------------------------
+ * This header is part of a freestanding implementation
+ * --------------------------------------------------------------------------*/
+
+#ifndef _STDARG_H
+#define _STDARG_H _STDARG_H
+
+/* TODO: This code was contributed by Michael Moody, who added:
+ * "As always with my code it's not guaranteed bug-free (In fact I know for a
+ * fact it won't work properly on certain archs)."
+ * Code assumes that:
+ * - arguments are passed on the stack;
+ * - arguments are alligned to pointer size.
+ */
+
+/* ----------------------------------------------------------------------------
+ * TYPEDEFS
+ * --------------------------------------------------------------------------*/
+
+typedef char * va_list;
+
+/* ----------------------------------------------------------------------------
+ * MACROS
+ * --------------------------------------------------------------------------*/
+
+/** Returns the size of 'type' rounded up to the nearest multiple of the size
+ * of a pointer. This macro is just here for clarity.
+ */
+#define __va_round(type) \
+ ( \
+ (sizeof(type) + sizeof(void *) - 1) & ~(sizeof(void *) - 1) \
+ )
+
+/** Initialises ap for use by va_arg by setting ap to point at the first
+ * argument in the ellipsis. parmN is the last known parameter in the function
+ * definition (ie the one before the ellipsis).
+ */
+#define va_start(ap, parmN) \
+ ( \
+ (ap) = (char *)&parmN + (__va_round(parmN)) \
+ , \
+ (void)0 \
+ )
+
+/** Returns the next argument, assumed variable type is 'type', in the
+ * ellipsis.
+ */
+#define va_arg(ap, type) \
+ ( \
+ (ap) += (__va_round(type)) \
+ , \
+ (*(type*)((ap) - (__va_round(type)))) \
+ )
+
+/** Cleans up ap.
+ */
+#define va_end(ap) \
+ ( \
+ (ap) = (void *)0 \
+ , \
+ (void)0 \
+ )
+
+/** Makes the va_list dest be a copy of the va_list src.
+ */
+#define va_copy(dest, src) \
+ ( \
+ (dest) = (src) \
+ , \
+ (void)0 \
+ )
+
+#endif /* _STDARG_H */
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Boolean type and values
-// ----------------------------------------------------------------------------
-
-#ifndef __STDBOOL_H
-#define __STDBOOL_H __STDBOOL_H
-
-// ----------------------------------------------------------------------------
-// MACROS
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Boolean type and values
+ * ----------------------------------------------------------------------------
+ * This header is part of a freestanding implementation
+ * --------------------------------------------------------------------------*/
+
+#ifndef _STDBOOL_H
+#define _STDBOOL_H _STDBOOL_H
+
+/* ----------------------------------------------------------------------------
+ * MACROS
+ * --------------------------------------------------------------------------*/
#define __bool_true_false_are_defined 1
#define false 0
#define true 1
-// ----------------------------------------------------------------------------
-// TYPEDEFS
+/* ----------------------------------------------------------------------------
+ * TYPEDEFS
+ * --------------------------------------------------------------------------*/
typedef int bool;
-#endif // __cplusplus
+#endif /* __cplusplus */
-#endif // __STDBOOL_H
+#endif /* _STDBOOL_H */
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Common definitions
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Common definitions
+ * ----------------------------------------------------------------------------
+ * This header is part of a freestanding implementation
+ * --------------------------------------------------------------------------*/
-#ifndef __STDDEF_H
-#define __STDDEF_H __STDDEF_H
+#ifndef _STDDEF_H
+#define _STDDEF_H _STDDEF_H
-// TODO: Documentation
+#ifndef _NULL
+#include "__intern.h"
+#endif
-// ----------------------------------------------------------------------------
-// MACROS
+/* TODO: Documentation */
-#include "__NULL.h"
+/* ----------------------------------------------------------------------------
+ * MACROS
+ * --------------------------------------------------------------------------*/
-#define offsetof( s-type, mbr ) // TODO - personality?
+#define NULL _NULL
-// ----------------------------------------------------------------------------
-// TYPEDEFS
+#define offsetof( s-type, mbr ) /* TODO - to __intern.h / __personality.h? */
-#include "__size_t.h"
-#include "__wchar_t.h"
+/* ----------------------------------------------------------------------------
+ * TYPEDEFS
+ * --------------------------------------------------------------------------*/
-typedef ptrdiff_t; // TODO - personality?
+#ifndef _SIZE_T
+#define _SIZE_T _SIZE_T
+typedef __size_t size_t;
+#endif /* _SIZE_T */
-#endif // __STDDEF_H
+#ifndef _WCHAR_T
+#define _WCHAR_T _WCHAR_T
+typedef __wchar_t wchar_t;
+#endif /* _WCHAR_T */
+
+/* Look this up in the C Standard Rationale, which has example code on this. */
+typedef ptrdiff_t; /* TODO - to __intern.h / __personality.h? */
+
+#endif /* _STDDEF_H */
--- /dev/null
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Integer types
+ * ----------------------------------------------------------------------------
+ * This header is part of a freestanding implementation
+ * --------------------------------------------------------------------------*/
+
+#ifndef _STDINT_H
+#define _STDINT_H _STDINT_H
+
+/* This file is part of the platform personality (see personality.txt). */
+#ifndef _NULL
+#include "__intern.h"
+#endif
+
+/* TODO: Documentation */
+
+/* ----------------------------------------------------------------------------
+ * TYPEDEFS
+ * --------------------------------------------------------------------------*/
+
+typedef int8_t; /* TODO */
+typedef int16_t; /* TODO */
+typedef int32_t; /* TODO */
+typedef int64_t; /* TODO */
+
+typedef uint8_t; /* TODO */
+typedef uint16_t; /* TODO */
+typedef uint32_t; /* TODO */
+typedef uint64_t; /* TODO */
+
+typedef int_least8_t; /* TODO */
+typedef int_least16_t; /* TODO */
+typedef int_least32_t; /* TODO */
+typedef int_least64_t; /* TODO */
+
+typedef uint_least8_t; /* TODO */
+typedef uint_least16_t; /* TODO */
+typedef uint_least32_t; /* TODO */
+typedef uint_least64_t; /* TODO */
+
+typedef int_fast8_t; /* TODO */
+typedef int_fast16_t; /* TODO */
+typedef int_fast32_t; /* TODO */
+typedef int_fast64_t; /* TODO */
+
+typedef uint_fast8_t; /* TODO */
+typedef uint_fast16_t; /* TODO */
+typedef uint_fast32_t; /* TODO */
+typedef uint_fast64_t; /* TODO */
+
+typedef intptr_t; /* TODO */
+typedef uintptr_t; /* TODO */
+
+typedef intmax_t; /* TODO */
+typedef uintmax_t; /* TODO */
+
+/* ----------------------------------------------------------------------------
+ * MACROS
+ * --------------------------------------------------------------------------*/
+
+#define INT8_MIN /* TODO */
+#define INT16_MIN /* TODO */
+#define INT32_MIN /* TODO */
+#define INT64_MIN /* TODO */
+
+#define INT8_MAX 0x7f
+#define INT16_MAX 0x7fff
+#define INT32_MAX 0x7fffffff
+#define INT64_MAX 0x7fffffffffffffff
+
+#define UINT8_MAX 0xff
+#define UINT16_MAX 0xffff
+#define UINT32_MAX 0xffffffff
+#define UINT64_MAX 0xffffffffffffffff
+
+#define INT_LEAST8_MIN /* TODO */
+#define INT_LEAST16_MIN /* TODO */
+#define INT_LEAST32_MIN /* TODO */
+#define INT_LEAST64_MIN /* TODO */
+
+#define INT_LEAST8_MAX /* TODO */
+#define INT_LEAST16_MAX /* TODO */
+#define INT_LEAST32_MAX /* TODO */
+#define INT_LEAST64_MAX /* TODO */
+
+#define UINT_LEAST8_MAX /* TODO */
+#define UINT_LEAST16_MAX /* TODO */
+#define UINT_LEAST32_MAX /* TODO */
+#define UINT_LEAST64_MAX /* TODO */
+
+#define INT_FAST8_MIN /* TODO */
+#define INT_FAST16_MIN /* TODO */
+#define INT_FAST32_MIN /* TODO */
+#define INT_FAST64_MIN /* TODO */
+
+#define INT_FAST8_MAX /* TODO */
+#define INT_FAST16_MAX /* TODO */
+#define INT_FAST32_MAX /* TODO */
+#define INT_FAST64_MAX /* TODO */
+
+#define UINT_FAST8_MAX /* TODO */
+#define UINT_FAST16_MAX /* TODO */
+#define UINT_FAST32_MAX /* TODO */
+#define UINT_FAST64_MAX /* TODO */
+
+#define INTPTR_MIN /* TODO */
+#define INTPTR_MAX /* TODO */
+#define UINTPTR_MAX /* TODO */
+
+#define INT8_C(x) /* TODO */
+#define INT16_C(x) /* TODO */
+#define INT32_C(x) /* TODO */
+#define INT64_C(x) /* TODO */
+
+#define UINT8_C(x) /* TODO */
+#define UINT16_C(x) /* TODO */
+#define UINT32_C(x) /* TODO */
+#define UINT64_C(x) /* TODO */
+
+#define INTMAX_C(x) /* TODO */
+#define UINTMAX_C(x) /* TODO */
+
+#define PTRDIFF_MIN /* TODO */
+#define PTRDIFF_MAX /* TODO */
+
+#define SIG_ATOMIC_MIN /* TODO */
+#define SIG_ATOMIC_MAX /* TODO */
+
+#define SIZE_MAX /* TODO */
+
+#define WCHAR_MIN _WCHAR_MIN
+#define WCHAR_MAX _WCHAR_MAX
+
+#define INTMAX_MIN /* TODO */
+#define INTMAX_MAX /* TODO */
+#define UINTMAX_MAX /* TODO */
+
+#endif // _STDINT_H
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Input/output
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Input/output
+ * --------------------------------------------------------------------------*/
-#ifndef __STDIO_H
-#define __STDIO_H __STDIO_H
+#ifndef _STDIO_H
+#define _STDIO_H _STDIO_H
-// ----------------------------------------------------------------------------
-// MACROS
+#ifndef _NULL
+#include "__intern.h"
+#endif /* _NULL */
-#include "__NULL.h"
-#include "__pdc_stdio.h"
+/* ----------------------------------------------------------------------------
+ * MACROS
+ * --------------------------------------------------------------------------*/
+
+#define NULL _NULL
#define _IOFBF 0 // @see setvbuf()
#define _IOLBF 1 // @see setvbuf()
#define EOF -1
-// ----------------------------------------------------------------------------
-// TYPEDEFS
+/* ----------------------------------------------------------------------------
+ * TYPEDEFS
+ * --------------------------------------------------------------------------*/
+
+#ifndef _SIZE_T
+#define _SIZE_T _SIZE_T
+typedef __size_t size_t
+#endif /* _SIZE_T */
-#include "__size_t.h"
+/* file position, buffer pointer, ErrorIndicator, EOFIndicator, HostRC */
+typedef FILE; /* TODO */
-typedef FILE; // file position, buffer pointer, ErrorIndicator, EOFIndicator,
- // HostRC
-typedef fpos_t; // file position
+/* file position */
+typedef fpos_t; /* TODO */
extern FILE * stdin;
extern FILE * stdout;
extern FILE * stderr;
-// ----------------------------------------------------------------------------
-// FUNCTIONS
+/* ----------------------------------------------------------------------------
+ * FUNCTIONS
+ * --------------------------------------------------------------------------*/
/* TABLE OF CONTENTS (in order of appearance)
*
*/
/** File OPEN. Opens a file.
- @param filename Name of the file.
- @param mode One of r, w, a, rb, wb, ab, r+, w+, a+, rb+, wb+, ab+,
- specifying which mode to open the file in.
- @return A file handle associated with the opened file, NULL if failed.
+ * @param filename Name of the file.
+ * @param mode One of r, w, a, rb, wb, ab, r+, w+, a+, rb+, wb+, ab+,
+ * specifying which mode to open the file in.
+ * @return A file handle associated with the opened file, NULL if failed.
*/
FILE * fopen( const char * restrict filename, const char * restrict mode );
/** File REOPEN. Opens the file specified by the given name, associating it
- with the given file handle. If filename is NULL, it is attempted to change
- the mode of the already opened file associated with the given file handle.
- (This function can e.g. be used to reassociate stdin / stdout / stderr with
- a filename.)
- @param filename Name of the file to be opened.
- @param mode One of r, w, a, rb, wb, ab, r+, w+, a+, rb+, wb+, ab+,
- specifying which mode to open the file in.
- @param fh The file handle to associate with the opened file.
- @return fh if successful, NULL if failed.
+ * with the given file handle. If filename is NULL, it is attempted to change
+ * the mode of the already opened file associated with the given file handle.
+ * (This function can e.g. be used to reassociate stdin / stdout / stderr with
+ * a filename.)
+ * @param filename Name of the file to be opened.
+ * @param mode One of r, w, a, rb, wb, ab, r+, w+, a+, rb+, wb+, ab+,
+ * specifying which mode to open the file in.
+ * @param fh The file handle to associate with the opened file.
+ * @return fh if successful, NULL if failed.
*/
FILE * freopen( const char * restrict filename, const char * restrict mode, FILE * fh );
/** File FLUSH. Flushes any output buffers of a file. If parameter is NULL,
- flushes output buffers for all file handles. The function is undefined for
- input streams or update streams when the last operation was input.
- @param fh The file handle.
- @return 0 if successful, EOF on write error (setting error indicator).
+ * flushes output buffers for all file handles. The function is undefined for
+ * input streams or update streams when the last operation was input.
+ * @param fh The file handle.
+ * @return 0 if successful, EOF on write error (setting error indicator).
*/
int fflush( FILE * fh );
/** File EOF. Tests whether EOF is set for a given file.
- @param fh The file handle.
- @return 0 if EOF is not set, non-zero if EOF is set.
+ * @param fh The file handle.
+ * @return 0 if EOF is not set, non-zero if EOF is set.
*/
int feof( FILE * fh );
/** File ERROR. Tests whether error indicator is set for a given file.
- @param fh The file handle.
- @return 0 if error indicator is not set, non-zero if set.
+ * @param fh The file handle.
+ * @return 0 if error indicator is not set, non-zero if set.
*/
int ferror( FILE * fh );
/** CLEAR ERRor. Clears EOF and error indicator of a FILE handle.
- @param fh The file handle.
+ * @param fh The file handle.
*/
void clearerr( FILE * fh );
/** File CLOSE. Flushes any output buffers, closes the file, frees internal
- buffers, and discards the file handle.
- @param fh The file handle.
- @return 0 if successful, non-zero if failed. (In any case, the file handle
- is invalid afterwards.)
+ * buffers, and discards the file handle.
+ * @param fh The file handle.
+ * @return 0 if successful, non-zero if failed. (In any case, the file handle
+ * is invalid afterwards.)
*/
int fclose( FILE * fh );
-// ----------------------------------------------------------------------------
+/* ------------------------------------------------------------------------- */
/** RENAME file. Causes a file to be no longer accessible under a given name,
- but a new name instead.
- @param filename Name of the file.
- @param newname New file name.
- @return 0 if successful, non-zero if failed. (This implementation: INT_MAX
- if newname already exists; INT_MIN if filename could not be found;
- EOF if filename is a currently open file.)
+ * but a new name instead.
+ * @param filename Name of the file.
+ * @param newname New file name.
+ * @return 0 if successful, non-zero if failed. (This implementation: INT_MAX
+ * if newname already exists; INT_MIN if filename could not be found;
+ * EOF if filename is a currently open file.)
*/
int rename( const char * filename, const char * newname );
/** REMOVE file. Causes a file to be no longer accessible under a given name.
- @param filename Name of the file.
- @return 0 if successful, non-zero if failed. (This implementation: INT_MAX
- if the file is currently open.)
+ * @param filename Name of the file.
+ * @return 0 if successful, non-zero if failed. (This implementation: INT_MAX
+ * if the file is currently open.)
*/
int remove( const char * filename );
-// ----------------------------------------------------------------------------
+/* ------------------------------------------------------------------------- */
/** TeMPorary FILE. Opens a previously non-existend file in "wb+" mode that
- will be automatically deleted when closed, or when the program terminates.
- (This implementation: If program terminates abnormally, file is not
- deleted.)
- @return A file handle for the temporary file. (NULL if opening failed.)
+ * will be automatically deleted when closed, or when the program terminates.
+ * (This implementation: If program terminates abnormally, file is not
+ * deleted.)
+ * @return A file handle for the temporary file. (NULL if opening failed.)
*/
FILE * tmpfile( void )
/** TeMPorary NAMe. Generates a file name that does not yet exist in the file
- system, and is different from the last call to the function. Note that a
- file generated with this name is not "temporary", and must be remove()d
- normally.
- @param filename NULL, or a char[ L_tmpnam ] array. (Beware, calling this
- function with a NULL parameter is not thread-safe.)
- @return If 'filename' is NULL, a pointer to an internal static buffer
- holding the generated name. If 'filename' is not null, the
- generated name is stored in 'filename', and 'filename' is returned.
- If the filename generation fails, function returns NULL.
+ * system, and is different from the last call to the function. Note that a
+ * file generated with this name is not "temporary", and must be remove()d
+ * normally.
+ * @param filename NULL, or a char[ L_tmpnam ] array. (Beware, calling this
+ * function with a NULL parameter is not thread-safe.)
+ * @return If 'filename' is NULL, a pointer to an internal static buffer
+ * holding the generated name. If 'filename' is not null, the
+ * generated name is stored in 'filename', and 'filename' is returned.
+ * If the filename generation fails, function returns NULL.
*/
char * tmpnam( char * filename );
-// ----------------------------------------------------------------------------
+/* ------------------------------------------------------------------------- */
/** File SEEK. Sets the current position in a file to the values specified by
- start and offset.
- @param fh The file handle.
- @param offset The offset from 'start' to position to.
- @param start The starting point from which to calculate the offset. May be
- one of SEEK_SET, SEEK_CUR, SEEK_END.
- @return 0 if successful, non-zero if error encountered.
+ * start and offset.
+ * @param fh The file handle.
+ * @param offset The offset from 'start' to position to.
+ * @param start The starting point from which to calculate the offset. May be
+ * one of SEEK_SET, SEEK_CUR, SEEK_END.
+ * @return 0 if successful, non-zero if error encountered.
*/
int fseek( FILE * fh, long offset, int start );
/** REWIND file. Equivalent to (void) fseek( fh, 0, SEEK_SET ).
- @param fh The file handle.
+ * @param fh The file handle.
*/
void rewind( FILE * fh );
/** File TELL position. Tells the current offset into a given file.
- @param fh The file handle.
- @return The offset into the file.
+ * @param fh The file handle.
+ * @return The offset into the file.
*/
long ftell( FILE * fh );
/** File GET POSition. Stores the current state and position in a file.
- @param fh The file handle.
- @param pos The object to store the current state in.
- @return 0 if successful, non-zero if error encountered.
+ * @param fh The file handle.
+ * @param pos The object to store the current state in.
+ * @return 0 if successful, non-zero if error encountered.
*/
int fgetpos( FILE * restrict fh, fpos_t * restrict pos );
/** File SET POSition. Sets the current file position to the value stored in a
- given fpos_t object.
- @param fh The file handle.
- @param pos The fpos_t object.
- @return 0 if successful, non-zero if error encountered.
+ * given fpos_t object.
+ * @param fh The file handle.
+ * @param pos The fpos_t object.
+ * @return 0 if successful, non-zero if error encountered.
*/
int fsetpos( FILE * fh, const fpos_t * pos );
-// ----------------------------------------------------------------------------
+/* ------------------------------------------------------------------------- */
/** File GET Character. Reads a character from file.
- @param fh The file handle.
- @return The next character in the file, as unsigned char converted to int,
- or EOF if end of file is reached.
+ * @param fh The file handle.
+ * @return The next character in the file, as unsigned char converted to int,
+ * or EOF if end of file is reached.
*/
int fgetc( FILE * fh );
/** GET Character. Equivalent to fgetc(), but may be implemented as macro, and
- is allowed to evaluate its parameter more than once.
- @param fh The file handle.
- @return The character read, or EOF if end of file / error encountered.
+ * is allowed to evaluate its parameter more than once.
+ * @param fh The file handle.
+ * @return The character read, or EOF if end of file / error encountered.
*/
int getc( FILE * fh );
/** GET CHARacter. Equivalent to getc( stdin ).
- @return The character read, or EOF if end of file / error encountered.
+ * @return The character read, or EOF if end of file / error encountered.
*/
int getchar( void );
/** UN-GET Character. Puts a character back into an input stream.
- @param c The character to put back.
- @param fh The file handle.
- @return The character put back, EOF if error encountered.
+ * @param c The character to put back.
+ * @param fh The file handle.
+ * @return The character put back, EOF if error encountered.
*/
int ungetc( int c, FILE * fh );
/** File GET String. Reads a line (terminated by newline character) from file,
- but reading no more than n characters.
- @param dest The char array to write into.
- @param n The maximum number of characters to read.
- @param fh The file handle.
- @return 'dest', or NULL if an error occurred.
+ * but reading no more than n characters.
+ * @param dest The char array to write into.
+ * @param n The maximum number of characters to read.
+ * @param fh The file handle.
+ * @return 'dest', or NULL if an error occurred.
*/
char * fgets( char * restrict dest, int n, FILE * restrict fh );
/** GET String. Equivalent to fgets( dest, stdin ).
- @param dest The character array to write to.
- @return 'dest', or NULL if an error occurred.
+ * @param dest The character array to write to.
+ * @return 'dest', or NULL if an error occurred.
*/
char * gets( char * dest );
-// ----------------------------------------------------------------------------
+/* ------------------------------------------------------------------------- */
/** File PUT Character. Writes a character to file.
- @param c The character (when converted to unsigned char) to write.
- @param fh The file handle.
- @return 'c', or EOF if an error occurred.
+ * @param c The character (when converted to unsigned char) to write.
+ * @param fh The file handle.
+ * @return 'c', or EOF if an error occurred.
*/
int fputc( int c, FILE * fh );
/** PUT Character. Equivalent to fputc( c, stdout ), but may be implemented as
- a macro, and may evaluate the file handle more than once.
- @param c The character to write.
- @param fh The file handle.
- @return The character written, or EOF if error encountered.
+ * a macro, and may evaluate the file handle more than once.
+ * @param c The character to write.
+ * @param fh The file handle.
+ * @return The character written, or EOF if error encountered.
*/
int putc( int c, FILE * fh );
/** PUT CHARacter. Equivalent to putc( c, stdout ).
- @param c The character to write.
- @return The character written, or EOF if error encountered.
+ * @param c The character to write.
+ * @return The character written, or EOF if error encountered.
*/
int putchar( int c );
/** File PUT String. Writes a C string to file.
- @param src The string to write.
- @param fh The file handle.
- @return >= 0 if successful, or EOF if an error occurred.
+ * @param src The string to write.
+ * @param fh The file handle.
+ * @return >= 0 if successful, or EOF if an error occurred.
*/
int fputs( const char * restrict src, FILE * restrict fh );
/** PUT String. Write a C string to stdout.
- @param src The C string to write.
- @return >= 0 if successful, EOF if error encountered.
+ * @param src The C string to write.
+ * @return >= 0 if successful, EOF if error encountered.
*/
int puts( const char * src );
-// ----------------------------------------------------------------------------
+/* ------------------------------------------------------------------------- */
/** File SCAN Formatted. Reads from given file handle, under control of a
- formatting string, the values of variables pointed to by 0..n pointers.
- @param fh The file handle.
- @param format The formatting string.
- @param ... A list of 0..n pointers corresponding to placeholders in
- 'format'.
- @return EOF if failed, number of values successfully assigned otherwise.
+ * formatting string, the values of variables pointed to by 0..n pointers.
+ * @param fh The file handle.
+ * @param format The formatting string.
+ * @param ... A list of 0..n pointers corresponding to placeholders in
+ * 'format'.
+ * @return EOF if failed, number of values successfully assigned otherwise.
*/
int fscanf( FILE * restrict fh, const char * restrict format, ... );
/** SCAN Formatted. Equivalent to fscanf( stdin, format, ... )
- @param format The formatting string.
- @param ... A list of 0..n pointers corresponding to placeholders in
- 'format'.
- @return EOF if failed, number of values successfully assigned otherwise.
+ * @param format The formatting string.
+ * @param ... A list of 0..n pointers corresponding to placeholders in
+ * 'format'.
+ * @return EOF if failed, number of values successfully assigned otherwise.
*/
int scanf( const char * restrict format, ... );
/** String SCAN Formatted. Equivalent to scanf( format, ... ), but using a C
- string instead of a file handle for input.
- @param src The input string.
- @param format The formatting string.
- @param ... A list of 0..n pointers corresponding to placeholders in
- 'format'.
- @return EOF if failed, number of values successfully assigned otherwise.
+ * string instead of a file handle for input.
+ * @param src The input string.
+ * @param format The formatting string.
+ * @param ... A list of 0..n pointers corresponding to placeholders in
+ * 'format'.
+ * @return EOF if failed, number of values successfully assigned otherwise.
*/
int sscanf( const char * restrict src, const char * restrict format, ... );
/** Variable File SCAN Formatted. Equivalent to fscanf( fh, format, ... ),
- with the variable-length parameter list replaced by a va_list, created by
- the va_start macro.
- @param fh The file handle.
- @param format The formatting string.
- @param args The argument list created by the va_start macro.
- @return Number of characters printed.
+ * with the variable-length parameter list replaced by a va_list, created by
+ * the va_start macro.
+ * @param fh The file handle.
+ * @param format The formatting string.
+ * @param args The argument list created by the va_start macro.
+ * @return Number of characters printed.
*/
int vfscanf( FILE * restrict fh, const char * restrict format, va_list args );
/** Variable SCAN Formatted. Equivalent to vfscanf( stdin, format, args ).
- @param format The formatting string.
- @param args The argument list created by the va_start macro.
- @return Number of characters printed.
+ * @param format The formatting string.
+ * @param args The argument list created by the va_start macro.
+ * @return Number of characters printed.
*/
int vscanf( const char * restrict format, va_list args );
/** Variable String SCAN Formatted. Equivalent to vscanf( format, args ), but
- reading from a C string instead of stdin.
- @param src The C string to read from.
- @param format The formatting string.
- @param args The argument list created by the va_start macro.
- @return Number of characters printed.
+ * reading from a C string instead of stdin.
+ * @param src The C string to read from.
+ * @param format The formatting string.
+ * @param args The argument list created by the va_start macro.
+ * @return Number of characters printed.
*/
int vsscanf( const char * restrict src, const char * restrict format, va_list ap );
-// ----------------------------------------------------------------------------
+/* ------------------------------------------------------------------------- */
/** File PRINT Formatted. Prints to given file handle, under control of a
- formatting string, the values of 0..n variables.
- @param fh The file handle.
- @param format The formatting string.
- @param ... A list of 0..n variables corresponding to placeholders in
- 'format'.
- @return Number of characters printed, negative value if error occurred.
+ * formatting string, the values of 0..n variables.
+ * @param fh The file handle.
+ * @param format The formatting string.
+ * @param ... A list of 0..n variables corresponding to placeholders in
+ * 'format'.
+ * @return Number of characters printed, negative value if error occurred.
*/
int fprintf( FILE * restrict fh, const char * restrict format, ... );
/** PRINT Formatted. Equivalent to fprintf( stdout, format, ... ).
- @param format The formatting string.
- @param ... A list of 0..n variables corresponding to placeholders in
- 'format'.
- @return Number of characters printed.
+ * @param format The formatting string.
+ * @param ... A list of 0..n variables corresponding to placeholders in
+ * 'format'.
+ * @return Number of characters printed.
*/
int printf( const char * restrict format, ... );
/** String PRINT Formatted. Equivalent to printf( format, ... ), but writing
- to a char array instead of stdout.
- @param dest The char array to write to.
- @param format The formatting string.
- @param ... A list of 0..n variables corresponding to placeholders in
- 'format'.
- @return Number of characters printed.
+ * to a char array instead of stdout.
+ * @param dest The char array to write to.
+ * @param format The formatting string.
+ * @param ... A list of 0..n variables corresponding to placeholders in
+ * 'format'.
+ * @return Number of characters printed.
*/
int sprintf( char * restrict dest, const char * restrict format, ... );
/** String N PRINT Formatted. Equivalent to sprintf( dest, format, ... ), but
- will not write more than n characters.
- @param dest The char array to write to.
- @param n The maximum number of characters to write.
- @param format The formatting string.
- @param ... A list of 0..n variables corresponding to placeholders in
- 'format'.
- @return Number of characters printed.
+ * will not write more than n characters.
+ * @param dest The char array to write to.
+ * @param n The maximum number of characters to write.
+ * @param format The formatting string.
+ * @param ... A list of 0..n variables corresponding to placeholders in
+ * 'format'.
+ * @return Number of characters printed.
*/
int snprintf( char * restrict s, size_t n, const char * restrict format, ... );
/** Variable File PRINT Formatted. Equivalent to fprintf( fh, format, ... ),
- with the variable-length parameter list replaced by a va_list, created by
- the va_start macro.
- @param fh The file handle.
- @param format The formatting string.
- @param args The argument list created by the va_start macro.
- @return Number of characters printed.
+ * with the variable-length parameter list replaced by a va_list, created by
+ * the va_start macro.
+ * @param fh The file handle.
+ * @param format The formatting string.
+ * @param args The argument list created by the va_start macro.
+ * @return Number of characters printed.
*/
int vfprintf( FILE * restrict fh, const char * restrict format, va_list args );
/** Variable PRINT Formatted. Equivalent to vfprintf( stdout, format, args ).
- @param format The formatting string.
- @param args The argument list created by the va_start macro.
- @return Number of characters printed.
+ * @param format The formatting string.
+ * @param args The argument list created by the va_start macro.
+ * @return Number of characters printed.
*/
int vprintf( const char * restrict format, va_list args );
/** Variable String PRINT Formatted. Equivalent to vprintf( format, args ), but
- writing to a char array instead to stdout.
- @param dest The char array to write to.
- @param format The formatting string.
- @param args The argument list created by the va_start macro.
- @return Number of characters printed.
+ * writing to a char array instead to stdout.
+ * @param dest The char array to write to.
+ * @param format The formatting string.
+ * @param args The argument list created by the va_start macro.
+ * @return Number of characters printed.
*/
int vsprintf( char * restrict s, const char * restrict format, va_list ap);
/** Variable String N PRINT Formatted. Equivalent to vsprintf( dest, format,
- args ), but will not write more than n characters.
- @param dest The char array to write to.
- @param n Maximum number of characters to write.
- @param format The formatting string.
- @param args The argument list created by the va_start macro.
- @return Number of characters printed.
+ * args ), but will not write more than n characters.
+ * @param dest The char array to write to.
+ * @param n Maximum number of characters to write.
+ * @param format The formatting string.
+ * @param args The argument list created by the va_start macro.
+ * @return Number of characters printed.
*/
int vsnprintf( char * restrict dest, size_t n, const char * restrict format, va_list ap );
-// ----------------------------------------------------------------------------
+/* ------------------------------------------------------------------------- */
/** Print ERROR.
- Equivalent to fprintf( stderr, "%s: %s\n", text, strerror( errno ) ).
- @param test Text to prepend the error message with.
+ * Equivalent to fprintf( stderr, "%s: %s\n", text, strerror( errno ) ).
+ * @param test Text to prepend the error message with.
*/
void perror( const char * text );
-// ----------------------------------------------------------------------------
+/* ------------------------------------------------------------------------- */
/** File READ. Reads a number of objects of a given size from file, and into
- a memory area.
- @param dest The memory area to write into.
- @param size The size of one object.
- @param n The number of objects to read.
- @param fh The file handle.
- @return The number of objects successfully read.
+ * a memory area.
+ * @param dest The memory area to write into.
+ * @param size The size of one object.
+ * @param n The number of objects to read.
+ * @param fh The file handle.
+ * @return The number of objects successfully read.
*/
size_t fread( void * restrict dest, size_t size, size_t n, FILE * restrict fh );
/** File WRITE. Writes a number of objects from a memory area to file.
- @param src The memory area to write from.
- @param size The size of a single object.
- @param n The number of objects to write.
- @param fh The file handle.
- @return The number of objects successfully written.
+ * @param src The memory area to write from.
+ * @param size The size of a single object.
+ * @param n The number of objects to write.
+ * @param fh The file handle.
+ * @return The number of objects successfully written.
*/
size_t fwrite( const void * restrict src, size_t size, size_t n, FILE * restrict fh );
-// ----------------------------------------------------------------------------
+/* ------------------------------------------------------------------------- */
/** SET Virtual BUFfer. Sets buffering mode and (optionally) the memory used
- for buffering, for a given file handle.
- This function must only be called immediately after associating the file
- handle with a file, before any operations are called on the file handle.
- @param fh The file handle.
- @param buf A pointer to the memory area to use for buffering, or NULL to
- use internally assigned buffer memory.
- @param mode One of _IOFBF, _IOLBF, _IONBF.
- @param size Size of the memory area to be used for buffering.
+ * for buffering, for a given file handle.
+ * This function must only be called immediately after associating the file
+ * handle with a file, before any operations are called on the file handle.
+ * @param fh The file handle.
+ * @param buf A pointer to the memory area to use for buffering, or NULL to
+ * use internally assigned buffer memory.
+ * @param mode One of _IOFBF, _IOLBF, _IONBF.
+ * @param size Size of the memory area to be used for buffering.
*/
int setvbuf( FILE * restrict fh, char * restrict buf, int mode, size_t size );
/** SET BUFfer. Equivalent to (void) setvbuf( fh, buf, _IOFBF, BUFSIZ ), or
- (void) setvbuf( fh, NULL, _IONBF, BUFSIZ ) if buf == NULL.
- @param fh The file handle to be passed to setvbuf().
- @param buf The buffer pointer to be passed to setvbuf().
+ * (void) setvbuf( fh, NULL, _IONBF, BUFSIZ ) if buf == NULL.
+ * @param fh The file handle to be passed to setvbuf().
+ * @param buf The buffer pointer to be passed to setvbuf().
*/
void setbuf( FILE * restrict fh, char * restrict buf );
-// ----------------------------------------------------------------------------
+/* ------------------------------------------------------------------------- */
/* PDPC code - unreviewed
/*
int theirBuffer; /* Is the buffer supplied by them? */
} FILE;
-#endif // __STDIO_H
+#endif /* _STDIO_H */
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// General utilities
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * General utilities
+ * --------------------------------------------------------------------------*/
-#ifndef __STDLIB_H
-#define __STDLIB_H __STDLIB_H
+#ifndef _STDLIB_H
+#define _STDLIB_H _STDLIB_H
-// TODO: Documentation
+#ifndef _NULL
+#include "__intern.h"
+#endif /* _NULL */
-// ----------------------------------------------------------------------------
-// MACROS
+/* TODO: Documentation */
-#include "__NULL.h"
+/* ----------------------------------------------------------------------------
+ * MACROS
+ * --------------------------------------------------------------------------*/
-#define EXIT_FAILURE // TODO
-#define EXIT_SUCCESS // TODO
-#define MB_CUR_MAX // TODO
-#define RAND_MAX // TODO
+#define NULL _NULL
-// ----------------------------------------------------------------------------
-// TYPEDEFS
+#define EXIT_FAILURE /* TODO */
+#define EXIT_SUCCESS /* TODO */
+#define MB_CUR_MAX /* TODO */
+#define RAND_MAX /* TODO */
+
+/* ----------------------------------------------------------------------------
+ * TYPEDEFS
+ * --------------------------------------------------------------------------*/
typedef struct
{
long long remainder;
} lldiv_t;
-#include "__size_t.h"
-#include "__wchar_t.h"
+#ifndef _SIZE_T
+#define _SIZE_T _SIZE_T
+typedef __size_t size_t
+#endif /* _SIZE_T */
+
+#ifndef _WCHAR_T
+#define _WCHAR_T _WCHAR_T
+typedef __wchar_t wchar_t
+#endif /* _WCHAR_T */
-// ----------------------------------------------------------------------------
-// FUNCTIONS
+/* ----------------------------------------------------------------------------
+ * FUNCTIONS
+ * --------------------------------------------------------------------------*/
int abs( int i );
long long llabs( long long i );
void * bsearch( const void * key, const void * base, size_t nelem, size_t size, int (*cmp) ( const void * ck, const void * ce) );
void qsort( void * base, size_t nelem, size_t size, int (*cmp) ( const void * e1, const void * e2) );
-#endif // __STDLIB_H
+#endif /* _STDLIB_H */
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// String handling
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * String handling
+ * --------------------------------------------------------------------------*/
-#ifndef __STRING_H
-#define __STRING_H __STRING_H
+#ifndef _STRING_H
+#define _STRING_H _STRING_H
-// ----------------------------------------------------------------------------
-// MACROS
+#ifndef _NULL
+#include "__intern.h"
+#endif /* _NULL */
-#include "__NULL.h"
+/* ----------------------------------------------------------------------------
+ * MACROS
+ * --------------------------------------------------------------------------*/
-// ----------------------------------------------------------------------------
-// TYPEDEFS
+#define NULL _NULL
-#include "__size_t.h"
+/* ----------------------------------------------------------------------------
+ * TYPEDEFS
+ * --------------------------------------------------------------------------*/
-// ----------------------------------------------------------------------------
-// FUNCTIONS
+#ifndef _SIZE_T
+#define _SIZE_T _SIZE_T
+typedef __size_t size_t
+#endif /* _SIZE_T */
+
+/* ----------------------------------------------------------------------------
+ * FUNCTIONS
+ * --------------------------------------------------------------------------*/
/** MEMory search for CHaRacter. Searches a memory area for a character.
* @param src The memory area.
*/
char * strstr( const char * src_1, const char * src_2 );
-#endif // __STRING_H
+#endif /* _STRING_H */
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Type-generic math
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Type-generic math
+ * --------------------------------------------------------------------------*/
-#ifndef __TGMATH_H
-#define __TGMATH_H __TGMATH_H
+#ifndef _TGMATH_H
+#define _TGMATH_H _TGMATH_H
-// TODO: Generics support
+/* Generics, despite necessary for implementing tgmath.h, are not part of the
+ * C language proper; it is - to my knowledge - not possible to implement this
+ * header in any implementation-independent way.
+ */
-#include <complex.h>
-#include <math.h>
-
-#endif // __TGMATH_H
+#endif /* _TGMATH_H */
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Date and time
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Date and time
+ * --------------------------------------------------------------------------*/
-#ifndef __TIME_H
-#define __TIME_H __TIME_H
+#ifndef _TIME_H
+#define _TIME_H _TIME_H
-// TODO: Documentation.
+#ifndef _NULL
+#include "__intern.h"
+#endif
-// ----------------------------------------------------------------------------
-// MACROS
+/* TODO: Documentation. */
-#include "__NULL.h"
+/* ----------------------------------------------------------------------------
+ * MACROS
+ * --------------------------------------------------------------------------*/
-#define CLOCKS_PER_SEC // TODO - personality?
+#define NULL _NULL
-// ----------------------------------------------------------------------------
-// TYPES
+#define CLOCKS_PER_SEC /* TODO - to __intern.h / __personality.h? */
-#include "__size_t.h"
-#include "__tm.h"
+/* ----------------------------------------------------------------------------
+ * TYPES
+ * --------------------------------------------------------------------------*/
-typedef clock_t; // TODO - personality?
-typedef time_t; // TODO - personality?
+/* TODO: Get struct tm into __intern.h */
-// ----------------------------------------------------------------------------
-// FUNCTIONS
+#ifndef _SIZE_T
+#define _SIZE_T _SIZE_T
+typedef __size_t size_t;
+#endif /* _SIZE_T */
+
+typedef clock_t; /* TODO - to __intern.h / __personality.h? */
+typedef time_t; /* TODO - to __intern.h / __personality.h? */
+
+/* ----------------------------------------------------------------------------
+ * FUNCTIONS
+ * --------------------------------------------------------------------------*/
char * asctime( const struct tm * tptr );
clock_t clock( void );
const struct tm * restrict tptr );
time_t time( time_t * tod );
-#endif // __TIME_H
+#endif /* _TIME_H */
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Extended multibyte and wide character utilities
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Extended multibyte and wide character utilities
+ * --------------------------------------------------------------------------*/
-#ifndef __WCHAR_H
-#define __WCHAR_H __WCHAR_H
+#ifndef _WCHAR_H
+#define _WCHAR_H _CHAR_H
-// TODO: Documentation
+#ifndef _NULL
+#include "__intern.h"
+#endif
-// ----------------------------------------------------------------------------
-// MACROS
+/* TODO: Documentation */
-#include "__NULL.h"
-#include "__WCHAR.h"
+/* ----------------------------------------------------------------------------
+ * MACROS
+ * --------------------------------------------------------------------------*/
-#define WEOF // TODO - personality?
+#define NULL _NULL
+#define WCHAR_MAX _WCHAR_MAX
+#define WCHAR_MIN _WCHAR_MIN
+#define WEOF _WEOF
-// ----------------------------------------------------------------------------
-// TYPEDEFS
+/* ----------------------------------------------------------------------------
+ * TYPEDEFS
+ * --------------------------------------------------------------------------*/
-#include "__tm.h"
-#include "__size_t.h"
-#include "__wchar_t.h"
-#include "__wint_t.h"
+/* TODO: Get struct tm into __intern.h */
-typedef mbstate_t; // TODO - personality?
-typedef size_t; // TODO - personality?
-typedef wint_t; // TODO - personality?
+#ifndef _SIZE_T
+#define _SIZE_T _SIZE_T
+typedef __size_t size_t;
+#endif /* _SIZE_T */
-// ----------------------------------------------------------------------------
-// FUNCTIONS
+#ifndef _WCHAR_T
+#define _WCHAR_T _WCHAR_T
+typedef __wchar_t wchar_t;
+#endif /* _WCHAR_T */
+
+#ifndef _WINT_T
+#define _WINT_T _WINT_T
+typedef __wint_t wint_t;
+#endif /* _WINT_T */
+
+typedef mbstate_t; /* TODO - to __intern.h / __personality.h? */
+
+/* ----------------------------------------------------------------------------
+ * FUNCTIONS
+ * --------------------------------------------------------------------------*/
wint_t fgetwc( FILE * stream );
wchar_t * fgetws( wchar_t * restrict s, int n, FILE * restrict stream );
wchar_t * wcsstr( const wchar_t * s1, const wchar_t * s2 );
wchar_t * wmemchr( const wchar_t * s, wchar_t c, size_t n);
-#endif // __WCHAR_H
+#endif /* _WCHAR_H */
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Wide character classification and mapping utilities
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Wide character classification and mapping utilities
+ * --------------------------------------------------------------------------*/
-#ifndef __WCTYPE_H
-#define __WCTYPE_H __WCTYPE_H
+#ifndef _WCTYPE_H
+#define _WCTYPE_H _WCTYPE_H
-// TODO: Documentation
+#ifndef _NULL
+#define _NULL _NULL
+#include "__intern.h"
+#endif /* _NULL */
-// ----------------------------------------------------------------------------
-// TYPEDEFS
+/* TODO: Documentation */
-#include "__wint_t.h"
+/* ----------------------------------------------------------------------------
+ * TYPEDEFS
+ * --------------------------------------------------------------------------*/
-typedef wctrans_t; // TODO - personality?
-typedef wctype_t; // TODO - personality?
+#ifndef _WINT_T
+#define _WINT_T _WINT_T
+typedef __wint_t wint_t
+#endif /* _WINT_T */
-// ----------------------------------------------------------------------------
-// FUNCTIONS
+typedef wctrans_t; /* TODO - to __intern.h / __personality.h? */
+typedef wctype_t; /* TODO - to __intern.h / __personality.h? */
+
+/* ----------------------------------------------------------------------------
+ * FUNCTIONS
+ * --------------------------------------------------------------------------*/
int iswalnum( wint_t c );
int iswalpha( wint_t c );
wctrans_t wctrans( const char * property );
wctype_t wctype( const char * property );
-#endif // __WCTYPE_H
+#endif /* _WCTYPE_H */
+++ /dev/null
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Input/output - personality
-// ----------------------------------------------------------------------------
-
-#define BUFSIZ // buffer size (see setvbuf()), >= 256
-#define FOPEN_MAX // supported number of simultaneously open files, >= 8
-#define FILENAME_MAX // supported length of filenames
-#define L_tmpnam // length of filenames generated by tmpnam() including \0
-#define TMP_MAX // number of unique filenames generateable by tmpnam(),
- // during a program run; >= 25
-
-#define stderr // FILE *
-#define stdin // FILE *
-#define stdout // FILE *
-
-// storing return code in fh->HostRC
-void __pdc_fclose( FILE * fh );
+++ /dev/null
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Personality #define's (see personality.txt)
-// ----------------------------------------------------------------------------
-
-#ifndef __PDCLIB_PERSONALITY_H
-#define __PDCLIB_PERSONALITY_H __PDCLIB_PERSONALITY_H
-
-// This structure is required by time.h and wchar.h.
-struct tm;
-
-// This type is required by wchar.h and wctype.h.
-typedef wint_t;
-
-// #undef this if environment does not support _Imaginary.
-#define __PERSONALITY_SUPPORTS_IMAGINARY
-
-#endif // __PDCLIB_PERSONALITY_H
+++ /dev/null
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Characteristics of floating types
-// ----------------------------------------------------------------------------
-
-#ifndef __FLOAT_H
-#define __FLOAT_H __FLOAT_H
-
-// This file is part of the platform personality (see personality.txt).
-
-#define FLT_RADIX // TODO
-#define FLT_ROUNDS // TODO
-#define FLT_EVAL_METHOD // TODO
-#define DECIMAL_DIG // TODO
-
-#define DBL_DIG // TODO
-#define DBL_EPSILON // TODO
-#define DBL_MANT_DIG // TODO
-#define DBL_MAX // TODO
-#define DBL_MAX_10_EXP // TODO
-#define DBL_MAX_EXP // TODO
-#define DBL_MIN // TODO
-#define DBL_MIN_10_EXP // TODO
-#define DBL_MIN_EXP // TODO
-
-#define FLT_DIG // TODO
-#define FLT_EPSILON // TODO
-#define FLT_MANT_DIG // TODO
-#define FLT_MAX // TODO
-#define FLT_MAX_10_EXP // TODO
-#define FLT_MAX_EXP // TODO
-#define FLT_MIN // TODO
-#define FLT_MIN_10_EXP // TODO
-#define FLT_MIN_EXP // TODO
-
-#define LDBL_DIG // TODO
-#define LDBL_EPSILON // TODO
-#define LDBL_MANT_DIG // TODO
-#define LDBL_MAX // TODO
-#define LDBL_MAX_10_EXP // TODO
-#define LDBL_MAX_EXP // TODO
-#define LDBL_MIN // TODO
-#define LDBL_MIN_10_EXP // TODO
-#define LDBL_MIN_EXP // TODO
-
-#endif // __FLOAT_H
+++ /dev/null
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Sizes of integer types
-// ----------------------------------------------------------------------------
-
-#ifndef __LIMITS_H
-#define __LIMITS_H __LIMITS_H
-
-// ISO/IEC 9899:1999, ยง5.2.4.2.1
-// The values given below shall be replaced by constant expressions suitable
-// for use in #if preprocessing directives. Moreover, except for CHAR_BIT and
-// MB_LEN_MAX, the following shall be replaced by expressions that have the
-// same type as would an expression that is an object of the corresponding type
-// converted according to the integer promotions. Their implementation-defined
-// values shall be equal or greater in magnitude (absolute value) to those
-// shown, with the same sign.
-
-// This file is part of the platform personality (see personality.txt).
-
-// Limits of type 'char'
-#define CHAR_BIT // 8
-#define CHAR_MAX // SCHAR_MAX / UCHAR_MAX
-#define CHAR_MIN // SCHAR_MIN / 0
-#define SCHAR_MAX // +127
-#define SCHAR_MIN // -127
-#define UCHAR_MAX // 255 (2^CHAR_BIT - 1)
-
-// Multibyte characters
-#define MB_LEN_MAX // 1
-
-// Limits of type 'short int'
-#define SHRT_MAX // +32767
-#define SHRT_MIN // -32767
-#define USHRT_MAX // 65535
-
-// Limits of type 'int'
-#define INT_MAX // +32767
-#define INT_MIN // -32767
-#define UINT_MAX // 65535
-
-// Limits of type 'long int'
-#define LONG_MAX // +2147483647
-#define LONG_MIN // -2147483647
-#define ULONG_MAX // 4294967295
-
-// Limits of type 'long long int'
-#define LLONG_MAX // +9223372036854775807
-#define LLONG_MIN // -9223372036854775807
-#define ULLONG_MAX // 18446744073709551615
-
-#endif // __LIMITS_H
--- /dev/null
+/* ----------------------------------------------------------------------------
+ * $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.
+++ /dev/null
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Integer types
-// ----------------------------------------------------------------------------
-
-#ifndef __STDINT_H
-#define __STDINT_H __STDINT_H
-
-// This file is part of the platform personality (see personality.txt).
-
-// TODO: Documentation
-
-// ----------------------------------------------------------------------------
-// TYPEDEFS
-
-typedef int8_t; // TODO
-typedef int16_t; // TODO
-typedef int32_t; // TODO
-typedef int64_t; // TODO
-
-typedef uint8_t; // TODO
-typedef uint16_t; // TODO
-typedef uint32_t; // TODO
-typedef uint64_t; // TODO
-
-typedef int_least8_t; // TODO
-typedef int_least16_t; // TODO
-typedef int_least32_t; // TODO
-typedef int_least64_t; // TODO
-
-typedef uint_least8_t; // TODO
-typedef uint_least16_t; // TODO
-typedef uint_least32_t; // TODO
-typedef uint_least64_t; // TODO
-
-typedef int_fast8_t; // TODO
-typedef int_fast16_t; // TODO
-typedef int_fast32_t; // TODO
-typedef int_fast64_t; // TODO
-
-typedef uint_fast8_t; // TODO
-typedef uint_fast16_t; // TODO
-typedef uint_fast32_t; // TODO
-typedef uint_fast64_t; // TODO
-
-typedef intptr_t; // TODO
-typedef uintptr_t; // TODO
-
-typedef intmax_t; // TODO
-typedef uintmax_t; // TODO
-
-// ----------------------------------------------------------------------------
-// MACROS
-
-#define INT8_MIN // TODO
-#define INT16_MIN // TODO
-#define INT32_MIN // TODO
-#define INT64_MIN // TODO
-
-#define INT8_MAX 0x7f
-#define INT16_MAX 0x7fff
-#define INT32_MAX 0x7fffffff
-#define INT64_MAX 0x7fffffffffffffff
-
-#define UINT8_MAX 0xff
-#define UINT16_MAX 0xffff
-#define UINT32_MAX 0xffffffff
-#define UINT64_MAX 0xffffffffffffffff
-
-#define INT_LEAST8_MIN // TODO
-#define INT_LEAST16_MIN // TODO
-#define INT_LEAST32_MIN // TODO
-#define INT_LEAST64_MIN // TODO
-
-#define INT_LEAST8_MAX // TODO
-#define INT_LEAST16_MAX // TODO
-#define INT_LEAST32_MAX // TODO
-#define INT_LEAST64_MAX // TODO
-
-#define UINT_LEAST8_MAX // TODO
-#define UINT_LEAST16_MAX // TODO
-#define UINT_LEAST32_MAX // TODO
-#define UINT_LEAST64_MAX // TODO
-
-#define INT_FAST8_MIN // TODO
-#define INT_FAST16_MIN // TODO
-#define INT_FAST32_MIN // TODO
-#define INT_FAST64_MIN // TODO
-
-#define INT_FAST8_MAX // TODO
-#define INT_FAST16_MAX // TODO
-#define INT_FAST32_MAX // TODO
-#define INT_FAST64_MAX // TODO
-
-#define UINT_FAST8_MAX // TODO
-#define UINT_FAST16_MAX // TODO
-#define UINT_FAST32_MAX // TODO
-#define UINT_FAST64_MAX // TODO
-
-#define INTPTR_MIN // TODO
-#define INTPTR_MAX // TODO
-#define UINTPTR_MAX // TODO
-
-#define INT8_C(x) // TODO
-#define INT16_C(x) // TODO
-#define INT32_C(x) // TODO
-#define INT64_C(x) // TODO
-
-#define UINT8_C(x) // TODO
-#define UINT16_C(x) // TODO
-#define UINT32_C(x) // TODO
-#define UINT64_C(x) // TODO
-
-#define INTMAX_C(x) // TODO
-#define UINTMAX_C(x) // TODO
-
-#define PTRDIFF_MIN // TODO
-#define PTRDIFF_MAX // TODO
-
-#define SIG_ATOMIC_MIN // TODO
-#define SIG_ATOMIC_MAX // TODO
-
-#define SIZE_MAX // TODO
-
-#define WCHAR_MIN // TODO
-#define WCHAR_MAX // TODO
-
-#include "__WCHAR.h"
-
-#define INTMAX_MIN // TODO
-#define INTMAX_MAX // TODO
-#define UINTMAX_MAX // TODO
-
-#endif // __STDINT_H
--- /dev/null
+/* ----------------------------------------------------------------------------
+ * $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 */
+++ /dev/null
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Description of the personality concept
-// ----------------------------------------------------------------------------
-
-The pdclib is aimed at providing a fully conforming implementation of the C99
-standard library, with a focus on adaptability to diverse environments.
-
-That means, an effort was made to make this library useful to you, no matter if
-you are looking for a replacement for the CLib provided by your system vendor,
-for a basic CLib to develop your own operating system on / with, or for a "bare
-bones" CLib to test your software against a strict "standard only" library.
-
-The traditional way of providing this kind of cross-platform support is the
-preprocessor directive '#ifdef'. However, careless use of this feature can make
-source code next to intelligible and hard to maintain. Hence, an effort was
-made to encapsule such platform dependencies, by the concept of "personality
-modules".
-
-A personality module consists of three parts: drop-ins, glue code, and the
-header file "__personality.h", in an appropriately named subdirectory of
-pdclib/personalities.
-
-// ----------------------------------------------------------------------------
-// DROP-INS
-
-The standard includes limits.h and stdint.h define various intrinsics of the
-integer types of a platform. The standard include float.h does the same for the
-floating point types. Throughout pdclib, these defines have been put to maximum
-use.
-
-Each personality module must provide those three include files, so that pdclib
-"knows" about the data type intrinsics of the platform in question. The files
-are simply "dropped" into the pdclib/includes subdirectory prior to building
-pdclib.
-
-// ----------------------------------------------------------------------------
-// GLUE CODE
-
-Most functions of pdclib could be implemented generically - i.e., any supported
-platform uses identical source code for them. Some functions, however, interact
-closely with the operating system at one point or another. pdclib implements
-the "top half" of those functions, where possible. The "bottom half" has to be
-provided by the operating system.
-
-If pdclib is used on a host OS, as replacement for a vendor-supplied CLib, the
-personality module should contain the "glue code" necessary to match the OS
-provided services to pdclib's top/bottom interface (see below).
-
-When a new operating system uses pdclib as "native" C standard library, the
-documentation of the top/bottom interfaces (see below) should help in bringing
-OS and pdclib together. In this case, no dedicated "glue code" is necessary.
-
-// ----------------------------------------------------------------------------
-// __PERSONALITY.H
-
-At some points within the library, information about the environment is needed
-which cannot be derived from the drop-ins. In those places, "__personality.h"
-is included; this file defines a couple of symbols specifying those environment
-options for the personality module. A template for __personality.h can be found
-in the pdclib/personalities directory.
-
-The symbols defined in personality.h are all named __PERSONALITY_*, with "*"
-being replaced with a service or feature provded or not provided. Never is the
-name of an OS, compiler, or hardware used in such symbols - later generations
-of either might provide a service that older ones did not, and it is also more
-self-explanatory if the symbol reads "__PERSONALITY_SUPPORTS_XYZ" instead of
-"__PERSONALITY_MyOS", which basically leaves the reader clueless as to what
-makes MyOS special in this case - information that might be outdated already
-without anyone being the wiser.
-
-If a new, exotic personality is added that requires a new symbol to be added to personality.h, that symbol is always worded in a way that the old personality
-modules need not be changed. The default goes without saying, so to speak.
-
-// ----------------------------------------------------------------------------
-// TOP/BOTTOM INTERFACE
-
-What follows is a documentation of the "bottom half" functions required by
-pdclib, with an exact description of interface, required functionality, etc.