aboutsummaryrefslogtreecommitdiff
path: root/include/fmt.h
diff options
context:
space:
mode:
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);