blob: f09af916b676c48008bc4d9c0a81be0c9778759b (
plain)
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
|
#include "lua.h"
#ifndef _config_h
#define _config_h
enum config_type {
c_none,
c_string,
c_int,
c_number,
//c_function,
//c_table
};
struct config {
const char* name;
enum config_type type;
//a single value will be valid, all other are undefined (except len which will be valid for c_string and c_function)
struct value {
char** c_string;
int* c_int;
float* c_number;
char** c_function;
//location of table in lua registery
int* c_table_idx;
//length used for c_string or c_function
size_t* len;
} value;
};
int i_config_metatable(lua_State*, struct config[]);
#endif
|