-/* The worker for all printf() type of functions. The pointer spec should point
- to the introducing '%' of a conversion specifier. The status structure is to
- be that of the current printf() function, of which the members n, s, stream
- and arg will be preserved, i will be updated, and all others will be trashed
- by the function.
- Returns a pointer to the first character not parsed as conversion specifier.
-*/
-const char * _PDCLIB_print( const char * spec, struct _PDCLIB_status_t * status );
+/* -------------------------------------------------------------------------- */
+/* locale / wchar / uchar */
+/* -------------------------------------------------------------------------- */
+
+#ifndef __cplusplus
+typedef _PDCLIB_uint16_t _PDCLIB_char16_t;
+typedef _PDCLIB_uint32_t _PDCLIB_char32_t;
+#else
+typedef char16_t _PDCLIB_char16_t;
+typedef char32_t _PDCLIB_char32_t;
+#endif
+
+typedef struct _PDCLIB_mbstate {
+ union {
+ /* Is this the best way to represent this? Is this big enough? */
+ _PDCLIB_uint64_t _St64[15];
+ _PDCLIB_uint32_t _St32[31];
+ _PDCLIB_uint16_t _St16[62];
+ unsigned char _StUC[124];
+ signed char _StSC[124];
+ char _StC [124];
+ };
+
+ /* c16/related functions: Surrogate storage
+ *
+ * If zero, no surrogate pending. If nonzero, surrogate.
+ */
+ _PDCLIB_uint16_t _Surrogate;
+
+ /* In cases where the underlying codec is capable of regurgitating a
+ * character without consuming any extra input (e.g. a surrogate pair in a
+ * UCS-4 to UTF-16 conversion) then these fields are used to track that
+ * state. In particular, they are used to buffer/fake the input for mbrtowc
+ * and similar functions.
+ *
+ * See _PDCLIB_encoding.h for values of _PendState and the resultant value
+ * in _PendChar.
+ */
+ unsigned char _PendState;
+ char _PendChar;
+} _PDCLIB_mbstate_t;
+
+typedef struct _PDCLIB_charcodec *_PDCLIB_charcodec_t;
+typedef struct _PDCLIB_locale *_PDCLIB_locale_t;
+typedef struct lconv _PDCLIB_lconv_t;
+
+_PDCLIB_size_t _PDCLIB_mb_cur_max( void );
+
+/* -------------------------------------------------------------------------- */
+/* 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;