X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fopt-internal.h;h=21c67a6e16e5ff9a906631aa180fb31270727dee;hb=6c4c397f94ec5f5df6bcc178fb5fa4e84d3505fc;hp=05694ca5d8bc5a78af3c8111eb35b235da5c1781;hpb=7b52f60afc7ab5c9e96975d2fe9b08f3018bbd60;p=libucw.git diff --git a/ucw/opt-internal.h b/ucw/opt-internal.h index 05694ca5..21c67a6e 100644 --- a/ucw/opt-internal.h +++ b/ucw/opt-internal.h @@ -12,18 +12,35 @@ #define _UCW_OPT_INTERNAL_H #ifdef CONFIG_UCW_CLEAN_ABI -#define opt_failure ucw_opt_failure #define opt_precompute ucw_opt_precompute #endif +enum opt_conf_state { + OPT_CONF_HOOK_BEGIN, + OPT_CONF_HOOK_CONFIG, + OPT_CONF_HOOK_OTHERS, +}; + +struct opt_context { + const struct opt_section * options; + struct opt_precomputed * opts; + struct opt_precomputed ** shortopt; + const struct opt_item ** hooks; + int opt_count; + int hook_count; + int positional_max; + int positional_count; + int stop_parsing; + enum opt_conf_state conf_state; +}; + struct opt_precomputed { - struct opt_item * item; + const struct opt_item * item; const char * name; short flags; short count; }; -void opt_failure(const char * mesg, ...) FORMAT_CHECK(printf,1,2) NONRET; -void opt_precompute(struct opt_precomputed *opt, struct opt_item *item); +void opt_precompute(struct opt_precomputed *opt, const struct opt_item *item); #endif