1 /* _PDCLIB_prepwrite( FILE * )
3 This file is part of the Public Domain C Library (PDCLib).
4 Permission is granted to use, modify, and / or redistribute at will.
11 #include <_PDCLIB_io.h>
13 int _PDCLIB_prepwrite( FILE * stream )
15 if ( ( stream->bufidx < stream->bufend ) || ( stream->ungetidx > 0 ) ||
16 ( stream->status & ( _PDCLIB_FREAD | _PDCLIB_ERRORFLAG | _PDCLIB_WIDESTREAM | _PDCLIB_EOFFLAG ) ) ||
17 ! ( stream->status & ( _PDCLIB_FWRITE | _PDCLIB_FAPPEND | _PDCLIB_FRW ) ) )
19 /* Function called on illegal (e.g. input) stream.
20 See the comments on implementation-defined errno values in
24 stream->status |= _PDCLIB_ERRORFLAG;
27 stream->status |= _PDCLIB_FWRITE | _PDCLIB_BYTESTREAM;
33 #include <_PDCLIB_test.h>
37 /* Testing covered by ftell.c */