@@ -99,15 +99,17 @@ typedef void uta_ctx; /* dummy */
9999/* config.h: */
100100/* extended from opt.h */
101101#define OPT_REQUIRED 0x8000U
102- #define OPT_EMPTY_OK 0x4000U
102+ #define OPT_EMPTY_OK 0x4000U /* ignored unless OPT_REQUIRED is set */
103103typedef enum
104104{
105105 OPT_TXT , /** String variable receives a pointer to the option argument */
106+ OPT_SEL , /** enumeration of selectable tags, index returned in 'int1' choice */
106107 OPT_NUM , /** Long integer variable receives the decimal number given as argument */
107108 OPT_INT , /** As before, but regular integer variable */
108109 OPT_POS_INT , /** As before, but restriction to positive integers */
109110 OPT_BOOL ,/** Boolean variable receives a truth value */
110111 OPT_TXT_REQUIRED = OPT_TXT | OPT_REQUIRED ,
112+ OPT_SEL_REQUIRED = OPT_SEL | OPT_REQUIRED ,
111113 OPT_NUM_REQUIRED = OPT_NUM | OPT_REQUIRED ,
112114 OPT_INT_REQUIRED = OPT_INT | OPT_REQUIRED ,
113115 OPT_POS_INT_REQUIRED = OPT_POS_INT | OPT_REQUIRED ,
@@ -117,7 +119,7 @@ typedef enum
117119union varval_union {
118120 const char * txt ; /** String value */
119121 long num ; /** Long integer value, or vpm_opt */
120- int int1 ; /** Integer value, may be restricted to being positive */
122+ int int1 ; /** Integer/selection value, may be restricted to being positive */
121123 bool bit ; /** Boolean value */
122124};
123125
@@ -135,9 +137,11 @@ typedef struct opt_t
135137 union varval_union default_value ; /** default value for the option */
136138 union varref_union varref_u ; /** reference to the variable to receive the option value */
137139 const char * help_str ; /** a short description of the option for help output */
138- } opt_t ; /** an option with its name, type, default value, variable, and help string */
140+ const char * * selectable ; /** values to choose from with OPT_SEL, NULL-terminated array */
141+ } opt_t ; /** an option with its name, type, default value, variable,
142+ optional help string, and optional selectable tags */
139143
140- #define OPT_END { NULL, OPT_BOOL, {.bit = false}, {NULL}, NULL}
144+ #define OPT_END { NULL, OPT_BOOL, {.bit = false}, {.bit = NULL}, NULL}
141145CONF * CONF_load_config (OPTIONAL ossl_unused uta_ctx * ctx , const char * file );
142146bool CONF_entry_in_sections (const CONF * conf , const char * sections , const char * entry );
143147bool CONF_read_check_options (const CONF * conf , const char * source ,
0 commit comments