From 85231fd8cdf32d861e196d7dfa827b7239157817 Mon Sep 17 00:00:00 2001 From: rsc Date: Sun, 21 May 2006 20:49:16 +0000 Subject: fmt changes from Google --- include/fmt.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/fmt.h b/include/fmt.h index 1744ddc0..480ccad5 100644 --- a/include/fmt.h +++ b/include/fmt.h @@ -34,6 +34,18 @@ struct Fmt{ int width; int prec; unsigned long flags; + char *decimal; /* decimal point; cannot be "" */ + + /* For %'d */ + char *thousands; /* separator for thousands */ + + /* + * Each char is an integer indicating #digits before next separator. Values: + * \xFF: no more grouping (or \x7F; defined to be CHAR_MAX in POSIX) + * \x00: repeat previous indefinitely + * \x**: count that many + */ + char *grouping; /* descriptor of separator placement */ }; enum{ @@ -43,7 +55,8 @@ enum{ FmtSharp = FmtPrec << 1, FmtSpace = FmtSharp << 1, FmtSign = FmtSpace << 1, - FmtZero = FmtSign << 1, + FmtApost = FmtSign << 1, + FmtZero = FmtApost << 1, FmtUnsigned = FmtZero << 1, FmtShort = FmtUnsigned << 1, FmtLong = FmtShort << 1, @@ -64,6 +77,8 @@ double fmtcharstod(int(*f)(void*), void *vp); int fmtfdflush(Fmt *f); int fmtfdinit(Fmt *f, int fd, char *buf, int size); int fmtinstall(int c, int (*f)(Fmt*)); +int fmtnullinit(Fmt*); +void fmtlocaleinit(Fmt*, char*, char*, char*); int fmtprint(Fmt *f, char *fmt, ...); int fmtrune(Fmt *f, int r); int fmtrunestrcpy(Fmt *f, Rune *s); -- cgit v1.2.3