version 1.4.58b
[polyglot.git] / option.h
index 1d5eab0..7a842e6 100644 (file)
--- a/option.h
+++ b/option.h
@@ -7,6 +7,7 @@
 // includes\r
 \r
 #include "util.h"\r
+#include "ini.h"\r
 \r
 // defines\r
 \r
 #define XBOARD   (1<<0)\r
 #define UCI      (1<<1)\r
 #define PG       (1<<2)\r
+#define XBSEL    (1<<3)\r
 #define OptionNb 256\r
 \r
+#define IS_BUTTON(str) (my_string_case_equal(str,"button") ||      \\r
+                        my_string_case_equal(str,"save")   ||      \\r
+                        my_string_case_equal(str,"reset"))         \\r
+\r
+#define IS_SPIN(str)   (my_string_case_equal(str,"spin") ||        \\r
+                        my_string_case_equal(str,"slider"))        \\r
+\r
+#define IS_STRING(str) (my_string_case_equal(str,"string") ||      \\r
+                        my_string_case_equal(str,"path")   ||      \\r
+                        my_string_case_equal(str,"file"))          \\r
+\r
 // types\r
 \r
 typedef struct {   // TODO: put back in more logical order\r
@@ -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[]);\r
 extern const char * option_get_string   (option_list_t *option, const char var[]);\r
 \r
+extern void         option_from_ini     (option_list_t *option,\r
+                                         ini_t *ini,\r
+                                         const char *section);\r
+\r
 extern bool         option_is_ok        (const option_list_t *option);\r
 extern option_t *   option_find         (option_list_t *option, const char var[]);\r
 extern void         option_clear        (option_list_t *option);\r