-/** 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.
- */
-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.
- */
-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.
- */
-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.
- */
-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.
- */
-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.
- */
-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.
- */
-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.
- */
-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.
- */
-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.
- */
-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.
- */
-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.
- */
-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.
- */
-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.
- */
-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.
- */
-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.
- */
-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.
- */
-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.
- */
-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.
- */
-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.
- */
-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 setbuf( FILE * restrict fh, char * restrict buf );
-
-// ----------------------------------------------------------------------------
-
-/* PDPC code - unreviewed
-/*
- What we have is an internal buffer, which is 8 characters
- longer than the actually used buffer. E.g. say BUFSIZ is
- 512 bytes, then we actually allocate 520 bytes. The first
- 2 characters will be junk, the next 2 characters set to NUL,
- for protection against some backward-compares. The fourth-last
- character is set to '\n', to protect against overscan. The
- last 3 characters will be junk, to protect against memory
- violation. intBuffer is the internal buffer, but everyone refers
- to fbuf, which is actually set to the &intBuffer[4]. Also,
- szfbuf is the size of the "visible" buffer, not the internal
- buffer. The reason for the 2 junk characters at the beginning
- is to align the buffer on a 4-byte boundary.
-*/
-
-typedef struct
-{
-#if (defined(__OS2__) || defined(__32BIT__))
- unsigned long hfile; /* OS/2 file handle */