]> pd.if.org Git - pdclib/blobdiff - includes/stdio.h
Various updates. Made assert() no longer rely on standard version. Removed _PDCLIB_C_...
[pdclib] / includes / stdio.h
index 014052bda5f4451883f586f8c2e530248f67b00b..d85af175a91ca6bfb4809427ff684c12ccaffc31 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /* Input/output <stdio.h>
 
    This file is part of the Public Domain C Library (PDCLib).
 /* Input/output <stdio.h>
 
    This file is part of the Public Domain C Library (PDCLib).
@@ -9,10 +7,7 @@
 #ifndef _PDCLIB_STDIO_H
 #define _PDCLIB_STDIO_H _PDCLIB_STDIO_H
 
 #ifndef _PDCLIB_STDIO_H
 #define _PDCLIB_STDIO_H _PDCLIB_STDIO_H
 
-#ifndef _PDCLIB_INT_H
-#define _PDCLIB_INT_H _PDCLIB_INT_H
 #include <_PDCLIB_int.h>
 #include <_PDCLIB_int.h>
-#endif
 
 #ifndef _PDCLIB_SIZE_T_DEFINED
 #define _PDCLIB_SIZE_T_DEFINED _PDCLIB_SIZE_T_DEFINED
 
 #ifndef _PDCLIB_SIZE_T_DEFINED
 #define _PDCLIB_SIZE_T_DEFINED _PDCLIB_SIZE_T_DEFINED
@@ -162,7 +157,9 @@ FILE * fopen( const char * _PDCLIB_restrict filename, const char * _PDCLIB_restr
    identified by the given filename with the given mode (equivalent to fopen()),
    and associate it with the given stream. If filename is a NULL pointer,
    attempt to change the mode of the given stream.
    identified by the given filename with the given mode (equivalent to fopen()),
    and associate it with the given stream. If filename is a NULL pointer,
    attempt to change the mode of the given stream.
-   This implementation allows the following mode changes: TODO
+   This implementation allows any mode changes on "real" files, and associating
+   of the standard streams with files. It does *not* support mode changes on
+   standard streams.
    (Primary use of this function is to redirect stdin, stdout, and stderr.)
 */
 FILE * freopen( const char * _PDCLIB_restrict filename, const char * _PDCLIB_restrict mode, FILE * _PDCLIB_restrict stream );
    (Primary use of this function is to redirect stdin, stdout, and stderr.)
 */
 FILE * freopen( const char * _PDCLIB_restrict filename, const char * _PDCLIB_restrict mode, FILE * _PDCLIB_restrict stream );
@@ -652,31 +649,23 @@ int fputc( int c, FILE * stream );
 */
 int fputs( const char * _PDCLIB_restrict s, FILE * _PDCLIB_restrict stream );
 
 */
 int fputs( const char * _PDCLIB_restrict s, FILE * _PDCLIB_restrict stream );
 
-/* Equivalent to fgetc( stream ), but may be implemented as a macro that
+/* Equivalent to fgetc( stream ), but may be overloaded by a macro that
    evaluates its parameter more than once.
 */
    evaluates its parameter more than once.
 */
-#define getc( stream ) fgetc( stream )
+int getc( FILE * stream );
 
 
-/* Equivalent to fgetc( stdin ), but may be implemented as a macro. */
-#define getchar() fgetc( stdin )
-
-/* Read characters from given stream into the array s, stopping at \n or EOF.
-   The string read is terminated with \0. Returns s if successful. If EOF is
-   encountered before any characters are read, the contents of s are unchanged,
-   and NULL is returned. If a read error occurs, the contents of s are indeter-
-   minate, and NULL is returned.
-*/
-char * gets( char * s );
+/* Equivalent to fgetc( stdin ). */
+int getchar( void );
 
 
-/* Equivalent to fputc( c, stream ), but may be implemented as a macro that
+/* Equivalent to fputc( c, stream ), but may be overloaded by a macro that
    evaluates its parameter more than once.
 */
    evaluates its parameter more than once.
 */
-#define putc( c, stream ) fputc( c, stream )
+int putc( int c, FILE * stream );
 
 
-/* Equivalent to fputc( c, stdout ), but may be implemented as a macro that
+/* Equivalent to fputc( c, stdout ), but may be overloaded by a macro that
    evaluates its parameter more than once.
 */
    evaluates its parameter more than once.
 */
-#define putchar( c ) putc( c, stdout )
+int putchar( int c );
 
 /* Write the string s (not including the terminating \0) to stdout, and append
    a newline to the output. Returns a value >= 0 when successful, EOF if a
 
 /* Write the string s (not including the terminating \0) to stdout, and append
    a newline to the output. Returns a value >= 0 when successful, EOF if a