1 #ifndef OPTIONS_H 2 #define OPTIONS_H 3 4 #ifdef __cplusplus 5 extern "C" { 6 #endif 7 8 enum option_type 9 { 10 OPTION_FREE = 0, 11 OPTION_INT = 1, 12 OPTION_BOOL = 2, 13 OPTION_STR = 4, 14 OPTION_SYMB = 8, 15 OPTION_LIST = 16, 16 OPTION_ANY = 255 17 }; 18 19 struct lists_s_strs; 20 21 int options_get_int (const char *name); 22 bool options_get_bool (const char *name); 23 char *options_get_str (const char *name); 24 char *options_get_symb (const char *name); 25 struct lists_s_strs *options_get_list (const char *name); 26 void options_set_int (const char *name, const int value); 27 void options_set_bool (const char *name, const bool value); 28 void options_set_str (const char *name, const char *value); 29 void options_set_symb (const char *name, const char *value); 30 void options_set_list (const char *name, const char *value, bool append); 31 bool options_set_pair (const char *name, const char *value, bool append); 32 void options_init (); 33 void options_parse (const char *config_file); 34 void options_free (); 35 void options_ignore_config (const char *name); 36 int options_check_str (const char *name, const char *val); 37 int options_check_symb (const char *name, const char *val); 38 int options_check_int (const char *name, const int val); 39 int options_check_bool (const char *name, const bool val); 40 int options_check_list (const char *name, const char *val); 41 int options_was_defaulted (const char *name); 42 enum option_type options_get_type (const char *name); 43 44 #ifdef __cplusplus 45 } 46 #endif 47 48 #endif 49