aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'common.h')
-rw-r--r--common.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/common.h b/common.h
index 9b30011..7e42a49 100644
--- a/common.h
+++ b/common.h
@@ -11,3 +11,20 @@
void writeall(const char *s, size_t n);
void writechar(uint_least32_t cp);
int convert(enum libcharconv_result (*conv)(const char *, size_t, size_t *, uint_least32_t *, size_t *));
+
+
+#define SIMPLE(FUNCTION)\
+ USAGE("");\
+ \
+ int\
+ main(int argc, char *argv[])\
+ {\
+ ARGBEGIN {\
+ default:\
+ usage();\
+ } ARGEND;\
+ if (argc)\
+ usage();\
+ \
+ return convert(&FUNCTION);\
+ }