You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.1 KiB

15 years ago
typedef enum {
} option_type;
15 years ago
struct option;
typedef struct option option;
struct option_set;
typedef struct option_set option_set;
15 years ago
#include "settings.h"
15 years ago
struct option {
option_type type;
union {
gboolean opt_bool;
gint opt_int;
GString *opt_string;
/* array of option */
GArray *opt_list;
/* hash GString => option */
15 years ago
GHashTable *opt_hash;
15 years ago
} value;
15 years ago
struct server_option;
15 years ago
struct option_set {
15 years ago
size_t ndx;
gpointer value;
struct server_option *sopt;
15 years ago
15 years ago
LI_API option* option_new_bool(gboolean val);
LI_API option* option_new_int(gint val);
LI_API option* option_new_string(GString *val);
LI_API option* option_new_list();
LI_API option* option_new_hash();
LI_API void option_free(option* opt);
LI_API const char* option_type_string(option_type type);
LI_API void option_list_free(GArray *optlist);
/* Extract value from option, destroy option */
LI_API gpointer option_extract_value(option *opt);
gboolean option_get_index(server *srv, GString *name, gsize *ndx);
15 years ago