diff options
Diffstat (limited to 'newlib/libc/stdio/local.h')
-rw-r--r-- | newlib/libc/stdio/local.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/newlib/libc/stdio/local.h b/newlib/libc/stdio/local.h index 29e7cc6c1..1e1e042d2 100644 --- a/newlib/libc/stdio/local.h +++ b/newlib/libc/stdio/local.h @@ -44,6 +44,10 @@ int _EXFUN(_svfprintf_r,(struct _reent *, FILE *, const char *, int _EXFUN(_svfiprintf_r,(struct _reent *, FILE *, const char *, va_list) _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); +int _EXFUN(_svfwprintf_r,(struct _reent *, FILE *, const wchar_t *, + va_list)); +int _EXFUN(_svfiwprintf_r,(struct _reent *, FILE *, const wchar_t *, + va_list)); extern FILE *_EXFUN(__sfp,(struct _reent *)); extern int _EXFUN(__sflags,(struct _reent *,_CONST char*, int*)); extern int _EXFUN(__srefill_r,(struct _reent *,FILE *)); @@ -167,3 +171,51 @@ _VOID _EXFUN(__sfp_lock_release,(_VOID)); _VOID _EXFUN(__sinit_lock_acquire,(_VOID)); _VOID _EXFUN(__sinit_lock_release,(_VOID)); #endif + +/* Types used in positional argument support in vfprinf/vfwprintf. + The implementation is char/wchar_t dependent but the class and state + tables are only defined once in vfprintf.c. */ +typedef enum { + ZERO, /* '0' */ + DIGIT, /* '1-9' */ + DOLLAR, /* '$' */ + MODFR, /* spec modifier */ + SPEC, /* format specifier */ + DOT, /* '.' */ + STAR, /* '*' */ + FLAG, /* format flag */ + OTHER, /* all other chars */ + MAX_CH_CLASS /* place-holder */ +} __CH_CLASS; + +typedef enum { + START, /* start */ + SFLAG, /* seen a flag */ + WDIG, /* seen digits in width area */ + WIDTH, /* processed width */ + SMOD, /* seen spec modifier */ + SDOT, /* seen dot */ + VARW, /* have variable width specifier */ + VARP, /* have variable precision specifier */ + PREC, /* processed precision */ + VWDIG, /* have digits in variable width specification */ + VPDIG, /* have digits in variable precision specification */ + DONE, /* done */ + MAX_STATE, /* place-holder */ +} __STATE; + +typedef enum { + NOOP, /* do nothing */ + NUMBER, /* build a number from digits */ + SKIPNUM, /* skip over digits */ + GETMOD, /* get and process format modifier */ + GETARG, /* get and process argument */ + GETPW, /* get variable precision or width */ + GETPWB, /* get variable precision or width and pushback fmt char */ + GETPOS, /* get positional parameter value */ + PWPOS, /* get positional parameter value for variable width or precision */ +} __ACTION; + +_CONST __CH_CLASS __chclass[256]; +_CONST __STATE __state_table[MAX_STATE][MAX_CH_CLASS]; +_CONST __ACTION __action_table[MAX_STATE][MAX_CH_CLASS]; |