Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
130 ligi 1
#include "config.h"
2
 
3
 
4
char *input_evdev_name;
5
 
6
char *bluetooth_mac;
7
 
8
int  mk_socket_port=0;
9
int  loop_delay=0;
10
 
11
 
12
 
13
double nick_mul=0.3f;
14
double roll_mul=0.3f;
15
double gier_mul=0.3f;
16
double gas_mul=0.3f;
17
 
18
 
19
int rel_axis_nick=1;
20
int rel_axis_roll=0;
21
int rel_axis_gier=5;
22
int rel_axis_gas=2;
23
 
24
 
25
cfg_bool_t exit_after_init = cfg_false;
26
 
27
 
28
int parse_config(char* fname)
29
{
30
 
31
 
32
  cfg_opt_t opts[] = {
33
 
34
    CFG_SIMPLE_STR("bluetooth_mac", &bluetooth_mac),    
35
 
36
    CFG_SIMPLE_BOOL("exit_after_init", &exit_after_init),
37
    CFG_SIMPLE_STR("input_evdev", &input_evdev_name),
38
    CFG_SIMPLE_INT("loop_delay", &loop_delay),
39
    CFG_SIMPLE_INT("mk_socket_port", &mk_socket_port),
40
 
41
    CFG_SIMPLE_FLOAT("nick_mul", &nick_mul),
42
    CFG_SIMPLE_FLOAT("roll_mul", &roll_mul),
43
    CFG_SIMPLE_FLOAT("gier_mul", &gier_mul),
44
    CFG_SIMPLE_FLOAT("gas_mul", &gas_mul),
45
 
46
    CFG_SIMPLE_INT("rel_axis_nick", &rel_axis_nick),
47
    CFG_SIMPLE_INT("rel_axis_roll", &rel_axis_roll),
48
    CFG_SIMPLE_INT("rel_axis_gier", &rel_axis_gier),
49
    CFG_SIMPLE_INT("rel_axis_gas", &rel_axis_gas),
50
 
51
    CFG_END()
52
  };
53
 
54
  cfg_t *cfg;
55
 
56
 
57
  printf("Parsing config file %s\n",fname);
58
 
59
  cfg = cfg_init(opts, 0);
60
 
61
  cfg_parse(cfg,fname);
62
 
63
 
64
  return 0;
65
}