]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/opt-internal.h
Opt: Added OPT_HELP_COLUMNS
[libucw.git] / ucw / opt-internal.h
index 0ac2a77324f05e0998923f69a17e155156931d41..21c67a6e16e5ff9a906631aa180fb31270727dee 100644 (file)
 #define opt_precompute ucw_opt_precompute
 #endif
 
 #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;
 struct opt_context {
   const struct opt_section * options;
   struct opt_precomputed * opts;
   struct opt_precomputed ** shortopt;
-  struct opt_item ** hooks;
+  const struct opt_item ** hooks;
   int opt_count;
   int hook_count;
   int positional_max;
   int positional_count;
   int opt_count;
   int hook_count;
   int positional_max;
   int positional_count;
-  bool stop_parsing;
+  int stop_parsing;
+  enum opt_conf_state conf_state;
 };
 
 struct opt_precomputed {
 };
 
 struct opt_precomputed {
-  struct opt_item * item;
+  const struct opt_item * item;
   const char * name;
   short flags;
   short count;
 };
 
   const char * name;
   short flags;
   short count;
 };
 
-void opt_precompute(struct opt_precomputed *opt, struct opt_item *item);
+void opt_precompute(struct opt_precomputed *opt, const struct opt_item *item);
 
 #endif
 
 #endif