# All files belonging to the source distribution
ALLFILES := $(SRCFILES) $(HDRFILES) $(AUXFILES)
-WARNINGS := -Wall -Wextra -pedantic -Wno-unused-parameter -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wno-long-long -Wuninitialized -Wstrict-prototypes
+WARNINGS := -Wall -Wextra -pedantic -Wno-unused-parameter -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wno-long-long -Wuninitialized -Wstrict-prototypes
CFLAGS := -fno-builtin -g -std=c99 -I./internals -I./testing -I./platform/example/include -I./platform/example/internals $(WARNINGS) $(USERFLAGS)
-.PHONY: all clean srcdist bindist test tests testdrivers regtests regtestdrivers todos fixmes find links unlink help
+.PHONY: all clean srcdist tests testdrivers regtests regtestdrivers todos fixmes help
all: pdclib.a testdrivers regtestdrivers
@echo
hopefully keeping overly ambitious editors from repeating my mistakes. The
header files especially should be self-documenting to the point of being a
suitable replacement for any library reference book you might be using.
-
So, expect significant change to how stdio is done in upcoming releases.
Everything *WILL* be stable by the time v1.0 comes around, but until then
you will have to accept that I can only deliver "hobby quality" for now.
-
- test drivers for functionality that does not have its own implementation
file to put the test driver in.
-
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
+
#include <signal.h>
static int EXPECTED_ABORT = 0;
}
#define NDEBUG
+
#include <assert.h>
static int disabled_test( void )
}
#undef NDEBUG
+
#include <assert.h>
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
}
#endif
-
char _PDCLIB_Xdigits[] = "0123456789ABCDEF";
#ifdef TEST
+
#include "_PDCLIB_test.h"
#include <string.h>
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
#include <errno.h>
}
#endif
-
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
}
#endif
-
#include <stdio.h>
#ifndef REGTEST
+
#include "_PDCLIB_glue.h"
int _PDCLIB_prepread( struct _PDCLIB_file_t * stream )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
}
#endif
-
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
}
#endif
-
modifiers.
*/
/* FIXME: one too many flags to work on a 16-bit machine, join some (e.g. the
- width flags) into a combined field.
-*/
+ width flags) into a combined field. */
#define E_minus 1<<0
#define E_plus 1<<1
#define E_alt 1<<2
va_end( status.arg );
return status.i;
}
+
#endif
#define TEST_CONVERSION_ONLY
#include "_PDCLIB_test.h"
#ifndef REGTEST
+
static int testscanf( char const * s, char const * format, ... )
{
struct _PDCLIB_status_t status;
va_end( status.arg );
return status.n;
}
+
#endif
#define TEST_CONVERSION_ONLY
unsigned long int _PDCLIB_seed = 1;
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
+
#include <errno.h>
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( tolower( '[' ) == '[' );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( toupper( '[' ) == '[' );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
+
#include <limits.h>
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
#include <errno.h>
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
+
#include <errno.h>
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( NO_TESTDRIVER );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( NO_TESTDRIVER );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
}
#endif
-
#include <stdlib.h>
#ifndef REGTEST
+
#include "_PDCLIB_glue.h"
extern struct _PDCLIB_file_t * _PDCLIB_filelist;
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
}
#endif
-
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
}
#endif
-
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
}
#endif
-
#include <stdio.h>
#ifndef REGTEST
+
#include "_PDCLIB_glue.h"
extern struct _PDCLIB_file_t * _PDCLIB_filelist;
return _PDCLIB_flushbuffer( stream );
}
}
-
+
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
}
#endif
-
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
+
#include <string.h>
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
+
#include <string.h>
int main( void )
}
#endif
-
#include <stdlib.h>
#ifndef REGTEST
+
#include "_PDCLIB_glue.h"
+
#include <string.h>
extern struct _PDCLIB_file_t * _PDCLIB_filelist;
/* no memory */
return NULL;
}
- if ( ( rc->status = _PDCLIB_filemode( mode ) ) == 0 )
+ if ( ( rc->status = _PDCLIB_filemode( mode ) ) == 0 )
{
/* invalid mode */
free( rc );
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#include <stdio.h>
#ifndef REGTEST
+
#include "_PDCLIB_glue.h"
int fputs( const char * _PDCLIB_restrict s, struct _PDCLIB_file_t * _PDCLIB_restrict stream )
}
#endif
+
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
}
#endif
-
*/
#include <stdio.h>
+#include <stdbool.h>
+#include <string.h>
#ifndef REGTEST
#include "_PDCLIB_glue.h"
-#include <stdbool.h>
-#include <string.h>
-
size_t fread( void * _PDCLIB_restrict ptr, size_t size, size_t nmemb, struct _PDCLIB_file_t * _PDCLIB_restrict stream )
{
if ( _PDCLIB_prepread( stream ) == EOF )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
}
#endif
-
*/
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#ifndef REGTEST
#include "_PDCLIB_glue.h"
-#include <stdlib.h>
-#include <string.h>
struct _PDCLIB_file_t * freopen( const char * _PDCLIB_restrict filename, const char * _PDCLIB_restrict mode, struct _PDCLIB_file_t * _PDCLIB_restrict stream )
{
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
+
#include <string.h>
int main( void )
}
#endif
-
#include <stdio.h>
#ifndef REGTEST
+
#include "_PDCLIB_glue.h"
int fsetpos( struct _PDCLIB_file_t * stream, const struct _PDCLIB_fpos_t * pos )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
#include <stdlib.h>
}
#endif
-
*/
#include <stdio.h>
+#include <stdbool.h>
+#include <string.h>
#ifndef REGTEST
#include "_PDCLIB_glue.h"
-#include <stdbool.h>
-#include <string.h>
-
size_t fwrite( const void * _PDCLIB_restrict ptr, size_t size, size_t nmemb, struct _PDCLIB_file_t * _PDCLIB_restrict stream )
{
if ( _PDCLIB_prepwrite( stream ) == EOF )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
}
#endif
-
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
*/
#include <stdio.h>
-
-#ifndef REGTEST
-
#include <errno.h>
#include <locale.h>
+#ifndef REGTEST
+
/* TODO: Doing this via a static array is not the way to do it. */
void perror( const char * s )
{
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
+
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#include <stdio.h>
#ifndef REGTEST
+
#include "_PDCLIB_glue.h"
extern char * _PDCLIB_eol;
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
}
#endif
-
#include <stdio.h>
#ifndef REGTEST
+
#include "_PDCLIB_glue.h"
#include <string.h>
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
#include <stdlib.h>
}
#endif
-
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
+
#include <stdlib.h>
int main( void )
*/
/* If current buffer is big enough for requested size, but not
over twice as big (and wasting memory space), we use the
- current buffer (i.e., do nothing), to save the malloc() /
+ current buffer (i.e., do nothing), to save the malloc() /
free() overhead.
*/
if ( ( stream->bufsize < size ) || ( stream->bufsize > ( size << 1 ) ) )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
#include <errno.h>
}
#endif
-
#ifndef REGTEST
-#include <string.h>
#include "_PDCLIB_glue.h"
+#include <string.h>
+
char * tmpnam( char * s )
{
static char filename[ L_tmpnam ];
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
#include <string.h>
}
#endif
-
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#include <stdio.h>
#include <stdarg.h>
+#include <ctype.h>
#ifndef REGTEST
-#include <ctype.h>
int vsscanf( const char * _PDCLIB_restrict s, const char * _PDCLIB_restrict format, va_list arg )
{
#include <stdio.h>
#ifndef REGTEST
+
#include "_PDCLIB_glue.h"
void _Exit( int status )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
#include <stdio.h>
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
+
#include <limits.h>
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
+
#include <assert.h>
static int flags[ 32 ];
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
static int compare( const void * left, const void * right )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
+
#include <stdbool.h>
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
+
#include <limits.h>
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
+
#include <limits.h>
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
PRINT( " - memlist first: %#.4x - last: %#.4x",
( _PDCLIB_memlist.first == NULL ) ? NULL : (char *)_PDCLIB_memlist.first - (char *)pages_start,
( _PDCLIB_memlist.last == NULL ) ? NULL : (char *)_PDCLIB_memlist.last - (char *)pages_start );
- if ( ( firstnode != 0 ) &&
+ if ( ( firstnode != 0 ) &&
( ( ( (char *)_PDCLIB_memlist.first - (char *)pages_start ) != firstnode )
|| ( ( (char *)_PDCLIB_memlist.last - (char *)pages_start ) != lastnode ) ) )
{
return result;
}
-#endif
+#endif
/* Note that this test driver heavily tests *internals* of the implementation
above (and of free() and realloc(), too). That means that changes in the
void * ptr1, * ptr2, * ptr3, * ptr4, * ptr5, * ptr6, * ptr7, * ptr8, * ptr9, * ptrA, * ptrB, * ptrC;
pages_start = _PDCLIB_allocpages( 0 );
- PRINT( "\nEffective is: %#.4x\nsizeof( memnode ) is: %#.2x\n\n", EFFECTIVE, sizeof( struct _PDCLIB_memnode_t ) );
+ PRINT( "\nEffective is: %#.4x\nsizeof( memnode ) is: %#.2x\n\n", EFFECTIVE, sizeof( struct _PDCLIB_memnode_t ) );
/* Allocating 10 bytes; expecting one page allocation and a node split */
TESTCASE( MEMTEST( ptr1, 10 ) );
#define PUSH( base, limit ) stackptr[0] = base; stackptr[1] = limit; stackptr += 2
#define POP( base, limit ) stackptr -= 2; base = stackptr[0]; limit = stackptr[1]
/* TODO: Stack usage is log2( nmemb ) (minus what T shaves off the worst case).
- Worst-case nmemb is platform dependent and should probably be
+ Worst-case nmemb is platform dependent and should probably be
configured through _PDCLIB_config.h.
*/
#define STACKSIZE 64
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
+
#include <string.h>
#include <limits.h>
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
}
#endif
-
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
#include <errno.h>
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
#include <errno.h>
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
+
#include <errno.h>
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
+
#include <errno.h>
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( memcmp( xxxxx, abcde, 1 ) > 0 );
return 0;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( s[10] == 'x' );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( s[4] == 'a' );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( s[1] == 'o' );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( s[6] == 'e' );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( strchr( abccd, 'c' ) == &abccd[2] );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( strcmp( abcde, cmpabcd_ ) < 0 );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( strcmp( abcde, empty ) > 0 );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( s[5] == '\0' );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( strcspn( abcde, "cba" ) == 0 );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
#include <stdio.h>
TESTCASE( strerror( ERANGE ) != strerror( EDOM ) );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( strlen( "" ) == 0 );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( s[8] == '\0' );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( strncmp( abcde, cmpabcd_, 10 ) < 0 );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( s[3] == 'd' );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( strpbrk( abcde, "cba" ) == &abcde[0] );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( strrchr( abccd, 'c' ) == &abccd[3] );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( strspn( abcde, abcde ) == 5 );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( strstr( s, "abcde" ) == &s[10] );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( strtok( NULL, "_" ) == NULL );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
TESTCASE( s[10] == '\0' );
return TEST_RESULTS;
}
-#endif
+#endif
/* Returns true for every standard whitespace character (' ', '\f', '\n', '\r',
'\t', '\v') in the "C" locale. In any other locale, also returns true for a
locale-specific set of characters for which isalnum() is false.
-*/
+*/
int isspace( int c );
/* Returns true for uppercase letters in the "C" locale.
#define EDOM _PDCLIB_EDOM
#endif
-
/* TODO: wcstoimax(), wcstoumax() */
#endif
-
#define xor_eq ^=
#endif
-
#define ULONG_MAX _PDCLIB_ULONG_MAX
#endif
-
struct lconv * localeconv( void );
#endif
-
-/* Variable arguments <stdarg.h>
+/* Variable arguments <stdarg.h>
This file is part of the Public Domain C Library (PDCLib).
Permission is granted to use, modify, and / or redistribute at will.
#define va_start( ap, parmN ) _PDCLIB_va_start( ap, parmN )
#endif
-
#define __bool_true_false_are_defined 1
#endif
-
#define offsetof( type, member ) _PDCLIB_offsetof( type, member )
#endif
-
int remove( const char * filename );
/* Rename the given old file to the given new name.
- Returns zero if successful, non-zero otherwise.
+ Returns zero if successful, non-zero otherwise.
This implementation does detect if the old filename corresponds to an open
file, and fails the rename in this case.
If there already is a file with the new filename, behaviour is defined by
reverse order of registration (last-in, first-out).
Returns zero if registration is successfull, nonzero if it failed.
*/
-int atexit( void (*func)( void ) );
+int atexit( void (*func)( void ) );
/* Normal process termination. Functions registered by atexit() (see above) are
called, streams flushed, files closed and temporary files removed before the
/* stdio.h */
-/* A system call that opens a file identified by name in a given mode. Return
+/* A system call that opens a file identified by name in a given mode. Return
a file descriptor uniquely identifying that file.
(The mode is the return value of the _PDCLIB_filemode() function.)
*/
*/
#define _PDCLIB_FREAD 8u
#define _PDCLIB_FWRITE 16u
-#define _PDCLIB_FAPPEND 32u
+#define _PDCLIB_FAPPEND 32u
#define _PDCLIB_FRW 64u
#define _PDCLIB_FBIN 128u
/* Parsing any fopen() style filemode string into a number of flags. */
unsigned int _PDCLIB_filemode( const char * mode );
-/* Sanity checking and preparing of read buffer, should be called first thing
+/* Sanity checking and preparing of read buffer, should be called first thing
by any stdio read-data function.
Returns 0 on success, EOF on error.
On error, EOF / error flags and errno are set appropriately.
platform of choice, it is also highly inefficient and should be replaced by
inline assembly. Just make sure that your assembly keeps all the promises
the C library makes.
-
#include <stdlib.h>
#ifndef REGTEST
+
#include "_PDCLIB_glue.h"
extern void _exit( int status ) _PDCLIB_NORETURN;
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#include <stdio.h>
#ifndef REGTEST
+
#include "_PDCLIB_glue.h"
extern int close( int fd );
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
#include <stdio.h>
#ifndef REGTEST
+
#include "_PDCLIB_glue.h"
#include </usr/include/errno.h>
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
}
#endif
-
#include <string.h>
#ifndef REGTEST
+
#include "_PDCLIB_glue.h"
#include </usr/include/errno.h>
#endif
-
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
}
#endif
-
#include <stdio.h>
#ifndef REGTEST
+
#include "_PDCLIB_glue.h"
#include <sys/types.h>
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
#include <stdlib.h>
}
#endif
-
#include <stdio.h>
#ifndef REGTEST
+
#include "_PDCLIB_glue.h"
#include </usr/include/errno.h>
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
}
#endif
-
{ 0x00, 0xFF, 0xFF, 0xFF }
};
-struct lconv _PDCLIB_lconv = {
+struct lconv _PDCLIB_lconv = {
/* _PDCLIB_ctype */ _ctype + 1,
/* _PDCLIB_errno_texts */
{
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
{
- /* Testing covered by several other testdrivers using stdin / stdout /
+ /* Testing covered by several other testdrivers using stdin / stdout /
stderr.
*/
return TEST_RESULTS;
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
#include <stdlib.h>
TESTCASE( flag == 1 );
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
/* Testing covered by raise.c */
return TEST_RESULTS;
}
+
#endif
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
}
#endif
-
#ifndef REGTEST
+#include "_PDCLIB_glue.h"
+
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
-#include "_PDCLIB_glue.h"
-
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
generate the filename candidate, which is *also* platform-dependent.
*/
unsigned int random;
- fscanf( randomsource, "%u", &random );
+ fscanf( randomsource, "%u", &random );
sprintf( filename, "/tmp/%u.tmp", random );
/* Check if file of this name exists. Note that fopen() is a very weak
check, which does not take e.g. access permissions into account
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
+
#include <string.h>
int main( void )
}
#endif
-
#endif
#ifdef TEST
+
#include "_PDCLIB_test.h"
int main( void )
}
#ifdef TEST
+
#include "_PDCLIB_test.h"
#define SHELLCOMMAND "echo 'SUCCESS testing system()'"
int raise( int sig );
#endif
-
/* Large enough an integer to hold all character codes of the largest supported
locale.
*/
-#define _PDCLIB_wchar unsigned short
+#define _PDCLIB_wchar unsigned short
#define _PDCLIB_WCHAR USHRT
/* (Signed) integer type capable of taking the (cast) value of a void *, and
#if defined( _PDCLIB_FILEIO ) || defined( _PDCLIB_STRINGIO )
#include "_PDCLIB_iotest.h"
#endif
-
- {
+{
PRINTF_TEST( 4, "-128", "%hhd", CHAR_MIN );
PRINTF_TEST( 3, "127", "%hhd", CHAR_MAX );
PRINTF_TEST( 1, "0", "%hhd", 0 );
TESTCASE( val2 == 9 );
}
#endif
- }
+}