ddnet/src/engine/config.h

33 lines
983 B
C
Raw Normal View History

2007-06-01 11:08:33 +00:00
#ifndef _CONFIG_H
#define _CONFIG_H
struct configuration
{
#define MACRO_CONFIG_INT(name,def,min,max) int name;
#define MACRO_CONFIG_STR(name,len,def) char name[len];
2007-06-01 11:17:10 +00:00
#include "config_variables.h"
2007-06-01 11:08:33 +00:00
#undef MACRO_CONFIG_INT
#undef MACRO_CONFIG_STR
};
extern configuration config;
void config_set(const char *line);
2007-06-01 11:08:33 +00:00
void config_reset();
void config_load(const char *filename);
2007-06-01 11:17:10 +00:00
void config_save(const char *filename);
2007-06-01 11:08:33 +00:00
2007-06-01 12:24:13 +00:00
#define MACRO_CONFIG_INT(name,def,min,max) int config_get_ ## name (configuration *c);
#define MACRO_CONFIG_STR(name,len,def) const char *config_get_ ## name (configuration *c);
#include "config_variables.h"
#undef MACRO_CONFIG_INT
#undef MACRO_CONFIG_STR
2007-06-01 11:17:10 +00:00
#define MACRO_CONFIG_INT(name,def,min,max) void config_set_ ## name (configuration *c, int val);
2007-06-01 12:02:27 +00:00
#define MACRO_CONFIG_STR(name,len,def) void config_set_ ## name (configuration *c, const char *str);
2007-06-01 11:17:10 +00:00
#include "config_variables.h"
2007-06-01 11:08:33 +00:00
#undef MACRO_CONFIG_INT
#undef MACRO_CONFIG_STR
#endif