Subversion Repositories Projects

Rev

Rev 130 | Blame | Compare with Previous | Last modification | View Log | RSS feed

#include "config.h"

 
char *input_evdev_name;
char *input_joydev_name;

char *bluetooth_mac;

int  mk_socket_port=0;
int  loop_delay=0;



double nick_mul=0.3f;
double roll_mul=0.3f;
double gier_mul=0.3f;
double gas_mul=0.3f;


double nick_add=0.3f;
double roll_add=0.3f;
double gier_add=0.3f;
double gas_add=0.3f;


int rel_axis_nick=1;
int rel_axis_roll=0;
int rel_axis_gier=5;
int rel_axis_gas=2;


cfg_bool_t exit_after_init = cfg_false;


int parse_config(char* fname)
{


  cfg_opt_t opts[] = {
   
    CFG_SIMPLE_STR("bluetooth_mac", &bluetooth_mac),    

    CFG_SIMPLE_BOOL("exit_after_init", &exit_after_init),
    CFG_SIMPLE_STR("input_evdev", &input_evdev_name),
    CFG_SIMPLE_STR("input_joydev", &input_joydev_name),
    CFG_SIMPLE_INT("loop_delay", &loop_delay),
    CFG_SIMPLE_INT("mk_socket_port", &mk_socket_port),
   
    CFG_SIMPLE_FLOAT("nick_mul", &nick_mul),
    CFG_SIMPLE_FLOAT("roll_mul", &roll_mul),
    CFG_SIMPLE_FLOAT("gier_mul", &gier_mul),
    CFG_SIMPLE_FLOAT("gas_mul", &gas_mul),

    CFG_SIMPLE_FLOAT("nick_add", &nick_add),
    CFG_SIMPLE_FLOAT("roll_add", &roll_add),
    CFG_SIMPLE_FLOAT("gier_add", &gier_add),
    CFG_SIMPLE_FLOAT("gas_add", &gas_add),
   
    CFG_SIMPLE_INT("rel_axis_nick", &rel_axis_nick),
    CFG_SIMPLE_INT("rel_axis_roll", &rel_axis_roll),
    CFG_SIMPLE_INT("rel_axis_gier", &rel_axis_gier),
    CFG_SIMPLE_INT("rel_axis_gas", &rel_axis_gas),



   
    CFG_END()
  };
 
  cfg_t *cfg;


  printf("Parsing config file %s\n",fname);
 
  cfg = cfg_init(opts, 0);

  cfg_parse(cfg,fname);


  return 0;
}