aboutsummaryrefslogtreecommitdiff
path: root/include/fmt.h
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-05-21 20:49:16 +0000
committerrsc <devnull@localhost>2006-05-21 20:49:16 +0000
commit85231fd8cdf32d861e196d7dfa827b7239157817 (patch)
tree467cd12c69cbb79e90e28a9750a4397cc3b80143 /include/fmt.h
parent8d7133308db580d2356d5d1dd30f0b9a1f0a7417 (diff)
downloadplan9port-85231fd8cdf32d861e196d7dfa827b7239157817.tar.gz
plan9port-85231fd8cdf32d861e196d7dfa827b7239157817.tar.bz2
plan9port-85231fd8cdf32d861e196d7dfa827b7239157817.zip
fmt changes from Google
Diffstat (limited to 'include/fmt.h')
-rw-r--r--include/fmt.h17
1 files changed, 16 insertions, 1 deletions
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);