-/* $Id$ */
-
/* _PDCLIB_filemode( const char * )
This file is part of the Public Domain C Library (PDCLib).
#include <stddef.h>
+#ifndef REGTEST
+
/* Helper function that parses the C-style mode string passed to fopen() into
the PDCLib flags FREAD, FWRITE, FAPPEND, FRW (read-write) and FBIN (binary
mode).
return 0;
}
+#endif
+
#ifdef TEST
-#include <_PDCLIB_test.h>
+
+#include "_PDCLIB_test.h"
int main( void )
{
+#ifndef REGTEST
TESTCASE( _PDCLIB_filemode( "r" ) == _PDCLIB_FREAD );
TESTCASE( _PDCLIB_filemode( "w" ) == _PDCLIB_FWRITE );
TESTCASE( _PDCLIB_filemode( "a" ) == ( _PDCLIB_FAPPEND | _PDCLIB_FWRITE ) );
TESTCASE( _PDCLIB_filemode( "r++" ) == 0 );
TESTCASE( _PDCLIB_filemode( "wbb" ) == 0 );
TESTCASE( _PDCLIB_filemode( "a+bx" ) == 0 );
+#endif
return TEST_RESULTS;
}
#endif
-