X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=option.h;h=7a842e678f8359f1501a6963c033d3f4a0ad0bdc;hb=de010509fa0e57ba955da6512c714fbff8606af3;hp=1d5eab0ec2bb2f883c31cad21cf861358f0af500;hpb=a0f731f21d6aa26dbf7246039a1c66c2ade0533f;p=polyglot.git diff --git a/option.h b/option.h index 1d5eab0..7a842e6 100644 --- a/option.h +++ b/option.h @@ -7,6 +7,7 @@ // includes #include "util.h" +#include "ini.h" // defines @@ -14,8 +15,20 @@ #define XBOARD (1<<0) #define UCI (1<<1) #define PG (1<<2) +#define XBSEL (1<<3) #define OptionNb 256 +#define IS_BUTTON(str) (my_string_case_equal(str,"button") || \ + my_string_case_equal(str,"save") || \ + my_string_case_equal(str,"reset")) \ + +#define IS_SPIN(str) (my_string_case_equal(str,"spin") || \ + my_string_case_equal(str,"slider")) \ + +#define IS_STRING(str) (my_string_case_equal(str,"string") || \ + my_string_case_equal(str,"path") || \ + my_string_case_equal(str,"file")) \ + // types typedef struct { // TODO: put back in more logical order @@ -65,6 +78,10 @@ extern double option_get_double (option_list_t *option, const char var[] extern int option_get_int (option_list_t *option, const char var[]); extern const char * option_get_string (option_list_t *option, const char var[]); +extern void option_from_ini (option_list_t *option, + ini_t *ini, + const char *section); + extern bool option_is_ok (const option_list_t *option); extern option_t * option_find (option_list_t *option, const char var[]); extern void option_clear (option_list_t *option);