]> pd.if.org Git - pdclib.old/blobdiff - internals/_PDCLIB_int.h
Temporary proof-of-concept for printf() output conversions.
[pdclib.old] / internals / _PDCLIB_int.h
index 67df3e1f640cb06e6cb22813a539feab1ab8f723..5e7d84035e8b0a8ca84d542b21ad485879fc3ffb 100644 (file)
@@ -250,6 +250,28 @@ typedef unsigned _PDCLIB_intmax _PDCLIB_uintmax_t;
 #define _PDCLIB_INTMAX_C( value )  concat( value, _PDCLIB_INTMAX_LITERAL )
 #define _PDCLIB_UINTMAX_C( value ) concat( value, concat( u, _PDCLIB_INTMAX_LITERAL ) )
 
+/* -------------------------------------------------------------------------- */
+/* Various <stdio.h> internals                                                */
+/* -------------------------------------------------------------------------- */
+
+/* Flags for representing mode (see fopen()). */
+#define _PDCLIB_FREAD    1
+#define _PDCLIB_FWRITE   2
+#define _PDCLIB_FAPPEND  4
+#define _PDCLIB_FRW      8
+#define _PDCLIB_FBIN    16
+
+struct
+{
+    _PDCLIB_fd_t            handle;   /* OS-specific file descriptor */
+    _PDCLIB_fpos_t          position; /* file position indicator */
+    void *                  buffer;   /* file buffer */
+    _PDCLIB_size_t          bufsize;  /* size of buffer */
+    int                     status;   /* misc. status bits */
+  /*mbstate_t               mbstate;    multibyte parse state - TODO: Unmask. */
+    struct _PDCLIB_file_t * next;     /* provisions for linked list handling */
+} _PDCLIB_file_t;
+
 /* -------------------------------------------------------------------------- */
 /* Declaration of helper functions (implemented in functions/_PDCLIB).        */
 /* -------------------------------------------------------------------------- */