Add `opendoc' command
[shigofumi.git] / src / ui.h
blob7a03e174ac3a4ff00dcb39490862957071252941
1 #ifndef __ISDS_UI_H__
2 #define __ISDS_UI_H__
4 /* Convenience wrappers around *printf() functions to pass text to output
5 * FILE stream.
6 * TODO: Find UI patterns and make generic toolkit interface allowing to pass
7 * it into GUI toolkit */
9 #include <stdio.h>
10 #include "utils.h"
12 #define oprintf(format, ...) fprintf(output, (format), ## __VA_ARGS__)
13 #define eprintf(format, ...) fprintf(stderr, (format), ## __VA_ARGS__)
15 #define ohprint(locale_string, width) \
16 fhprint(output, (locale_string), (width));
18 #define onprint(locale_string, width) \
19 fnprint(output, (locale_string), (width));
21 /* Convenience weappers around fwrite() function to pass data to output FILE
22 * stream. */
23 #define owrite(data, length) fwrite((data), 1, (length), output)
24 #define ewrite(data, length) fwrite((data), 1, (length), stderr)
26 #endif