summaryrefslogtreecommitdiff
path: root/include/libHX/option.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libHX/option.h')
-rw-r--r--include/libHX/option.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/libHX/option.h b/include/libHX/option.h
index 82255d3..40cc6e7 100644
--- a/include/libHX/option.h
+++ b/include/libHX/option.h
@@ -27,12 +27,12 @@ extern struct HXformat_map *HXformat_init(void);
extern void HXformat_free(struct HXformat_map *);
extern int HXformat_add(struct HXformat_map *, const char *, const void *,
unsigned int);
-extern int HXformat_aprintf(const struct HXformat_map *,
- hxmc_t **, const char *);
-extern int HXformat_sprintf(const struct HXformat_map *,
- char *, size_t, const char *);
-extern int HXformat_fprintf(const struct HXformat_map *,
- FILE *, const char *);
+#define HXformat_aprintf(a, b, c) HXformat3_aprintf((a), (b), (c))
+#define HXformat_fprintf(a, b, c) HXformat3_fprintf((a), (b), (c))
+#define HXformat_sprintf(a, b, c, d) HXformat3_sprintf((a), (b), (c), (d))
+extern ssize_t HXformat3_aprintf(const struct HXformat_map *, hxmc_t **, const char *);
+extern ssize_t HXformat3_fprintf(const struct HXformat_map *, FILE *, const char *);
+extern ssize_t HXformat3_sprintf(const struct HXformat_map *, char *, size_t, const char *);
/*
* OPT.C
@@ -77,7 +77,7 @@ extern int HXformat_fprintf(const struct HXformat_map *,
* Type expected of struct HXoption.ptr is given in ().
* HX_getopt (o) and HXformat_* (f) support different sets, marked with [].
*/
-enum HX_option_type {
+enum {
HXTYPE_NONE = 0,
HXTYPE_VAL,
HXTYPE_SVAL,
@@ -110,7 +110,6 @@ enum HX_option_type {
HXTYPE_XSNTMARK,
HXTYPE_XHELP, /* 30 */
HXTYPE_SIZE_T,
-};
/**
* Extra flags to be OR'ed into struct HXoption.type.
@@ -125,7 +124,6 @@ enum HX_option_type {
* %HXOPT_AND: AND *ptr by argument
* %HXOPT_XOR: XOR *ptr by argument
*/
-enum {
HXOPT_OPTIONAL = 1 << 6,
HXOPT_INC = 1 << 7,
HXOPT_DEC = 1 << 8,
@@ -144,6 +142,7 @@ enum {
* %HXOPT_USAGEONERR: print out short usage when a parsing error occurs
* %HXOPT_RQ_ORDER: require option order/POSIX mode:
* first non-option terminates option processing
+ * %HXOPT_KEEP_ARGV: do not replace argc/argv at all
*/
enum {
HXOPT_PTHRU = 1 << 0,
@@ -152,6 +151,7 @@ enum {
HXOPT_HELPONERR = 1 << 3,
HXOPT_USAGEONERR = 1 << 4,
HXOPT_RQ_ORDER = 1 << 5,
+ HXOPT_KEEP_ARGV = 1 << 6,
};
/**