File: options.h

package info (click to toggle)
moc 1%3A2.6.0~svn-r3005-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,656 kB
  • sloc: ansic: 31,749; sh: 929; cpp: 487; makefile: 240
file content (48 lines) | stat: -rw-r--r-- 1,422 bytes parent folder | download | duplicates (6)
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
48
#ifndef OPTIONS_H
#define OPTIONS_H

#include "lists.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
};

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);
lists_t_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);
int options_was_defaulted (const char *name);
enum option_type options_get_type (const char *name);

#ifdef __cplusplus
}
#endif

#endif