]> pd.if.org Git - pdclib/blobdiff - platform/example/functions/_PDCLIB/stdinit.c
Closer to functional printf().
[pdclib] / platform / example / functions / _PDCLIB / stdinit.c
index ec4193b85183570d0f71cb764ac0a1f2d00d1707..baf6985f4eaad7ee1568babed56693f8870ffdc9 100644 (file)
    descriptors 0, 1, and 2 respectively.
 */
 /* TODO: This is proof-of-concept, requires finetuning. */
-static struct _PDCLIB_file_t _PDCLIB_sin  = { 0, { 0, 0 }, 0, 0, 0, /* mbstate, */ 0 };
-static struct _PDCLIB_file_t _PDCLIB_sout = { 1, { 0, 0 }, 0, 0, 0, /* mbstate, */ 0 };
-static struct _PDCLIB_file_t _PDCLIB_serr = { 2, { 0, 0 }, 0, 0, 0, /* mbstate, */ 0 };
+static char _PDCLIB_sin_buffer[BUFSIZ];
+static char _PDCLIB_sout_buffer[BUFSIZ];
+
+static struct _PDCLIB_file_t _PDCLIB_serr = { 2, { 0 }, NULL, 0, 0, 0u, /* mbstate, */ NULL };
+static struct _PDCLIB_file_t _PDCLIB_sout = { 1, { 0 }, _PDCLIB_sout_buffer, BUFSIZ, 0, 0u, /* mbstate, */ &_PDCLIB_serr };
+static struct _PDCLIB_file_t _PDCLIB_sin  = { 0, { 0 }, _PDCLIB_sin_buffer, BUFSIZ, 0, 0u, /* mbstate, */ &_PDCLIB_sout };
 
-/* FIXME: Disabled for initial stdio.h development. */
-#if 0
 struct _PDCLIB_file_t * stdin  = &_PDCLIB_sin;
 struct _PDCLIB_file_t * stdout = &_PDCLIB_sout;
 struct _PDCLIB_file_t * stderr = &_PDCLIB_serr;
-#endif
 
 #endif