1 /* ########################################################### */
2 /* This Software is licensed under the GPL licensed Version 2, */
3 /* please read http://www.gnu.org/copyleft/gpl.html */
4 /* ########################################################### */
48 typedef struct state_s
50 char * prog_name
; /* base name of the program name. */
51 char * ctx_name
; /* current context name. */
52 char * ctx_par_name
; /* parameter which led to this context. */
53 char * opt_name
; /* current option name. */
54 int opts_count
; /* limit of the number of occurrences of *
55 | the current option. */
56 int opt_args_count
; /* limit of the number of parameters of *
57 | the current option. */
58 char * pre_opt_par_name
; /* parameter before the current one. */
59 char * cur_opt_par_name
; /* current parameter. */
63 ctxopt_init(char * prog_name
);
66 ctxopt_analyze(int nb_words
, char ** words
, int * rem_count
, char *** rem_args
);
69 ctxopt_evaluate(void);
72 ctxopt_new_ctx(char * name
, char * opts_specs
);
75 ctxopt_ctx_disp_usage(char * ctx_name
, usage_behaviour action
);
78 ctxopt_disp_usage(usage_behaviour action
);
81 ctxopt_add_global_settings(settings s
, ...);
84 ctxopt_add_ctx_settings(settings s
, ...);
87 ctxopt_add_opt_settings(settings s
, ...);
90 ctxopt_format_constraint(int nb_args
, char ** args
, char * value
, char * par
);
93 ctxopt_re_constraint(int nb_args
, char ** args
, char * value
, char * par
);
96 ctxopt_range_constraint(int nb_args
, char ** args
, char * value
, char * par
);
99 ctxopt_free_memory(void);