-/* Writing out unwritten buffers to file. Returns 0 if successful, EOF if error
- occured. Sets error flag of stream in case of error.
- */
-int _PDCLIB_fflush( struct _PDCLIB_file_t * stream );
+/* -------------------------------------------------------------------------- */
+/* stdio */
+/* -------------------------------------------------------------------------- */
+
+/* Position / status structure for getpos() / fsetpos(). */
+typedef struct _PDCLIB_fpos
+{
+ _PDCLIB_int_fast64_t offset; /* File position offset */
+ _PDCLIB_mbstate_t mbs; /* Multibyte parsing state */
+} _PDCLIB_fpos_t;
+
+typedef struct _PDCLIB_fileops _PDCLIB_fileops_t;
+typedef union _PDCLIB_fd _PDCLIB_fd_t;
+typedef struct _PDCLIB_file _PDCLIB_file_t; // Rename to _PDCLIB_FILE?
+
+/* Status structure required by _PDCLIB_print(). */
+struct _PDCLIB_status_t
+{
+ /* XXX This structure is horrible now. scanf needs its own */
+
+ int base; /* base to which the value shall be converted */
+ _PDCLIB_int_fast32_t flags; /* flags and length modifiers */
+ unsigned n; /* print: maximum characters to be written (snprintf) */
+ /* scan: number matched conversion specifiers */
+ unsigned i; /* number of characters read/written */
+ unsigned current;/* chars read/written in the CURRENT conversion */
+ unsigned width; /* specified field width */
+ int prec; /* specified field precision */
+
+ union {
+ void * ctx; /* context for callback */
+ const char * s; /* input string for scanf */
+ };
+
+ union {
+ _PDCLIB_size_t ( *write ) ( void *p, const char *buf, _PDCLIB_size_t size );
+ _PDCLIB_file_t *stream; /* for scanf */
+ };
+ _PDCLIB_va_list arg; /* argument stack */
+};
+
+#endif