1 #ifndef _FORMAT_PRINT_H
2 #define _FORMAT_PRINT_H
6 /* NULL is treated like "" */
9 /* [h:]mm:ss. can be negative */
12 /* set to 1 if you want to disable printing */
13 unsigned int empty
: 1;
14 enum { FO_STR
, FO_INT
, FO_TIME
} type
;
18 #define DEF_FO_STR(ch) { { .fo_str = NULL }, 0, FO_STR, ch }
19 #define DEF_FO_INT(ch) { { .fo_int = 0 }, 0, FO_INT, ch }
20 #define DEF_FO_TIME(ch) { { .fo_time = 0 }, 0, FO_TIME, ch }
21 #define DEF_FO_END { { .fo_str = NULL }, 0, 0, 0 }
23 int format_print(char *str
, int width
, const char *format
, const struct format_option
*fopts
);
24 int format_valid(const char *format
);