File: options.h

package info (click to toggle)
moc 1%3A2.5.0-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,484 kB
  • ctags: 3,337
  • sloc: ansic: 31,948; sh: 11,039; cpp: 501; makefile: 282
file content (47 lines) | stat: -rw-r--r-- 1,385 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef OPTIONS_H
#define OPTIONS_H

#ifdef __cplusplus
extern "C" {
#endif

enum option_type
{
	OPTION_FREE = 0,
	OPTION_INT  = 1,
	OPTION_BOOL = 2,
	OPTION_STR  = 4,
	OPTION_SYMB = 8,
	OPTION_LIST = 16,
	OPTION_ANY  = 255
};

struct lists_s_strs;

int options_get_int (const char *name);
bool options_get_bool (const char *name);
char *options_get_str (const char *name);
char *options_get_symb (const char *name);
struct lists_s_strs *options_get_list (const char *name);
void options_set_int (const char *name, const int value);
void options_set_bool (const char *name, const bool value);
void options_set_str (const char *name, const char *value);
void options_set_symb (const char *name, const char *value);
void options_set_list (const char *name, const char *value, bool append);
bool options_set_pair (const char *name, const char *value, bool append);
void options_init ();
void options_parse (const char *config_file);
void options_free ();
void options_ignore_config (const char *name);
int options_check_str (const char *name, const char *val);
int options_check_symb (const char *name, const char *val);
int options_check_int (const char *name, const int val);
int options_check_bool (const char *name, const bool val);
int options_check_list (const char *name, const char *val);
enum option_type options_get_type (const char *name);

#ifdef __cplusplus
}
#endif

#endif