dbd/common.h

changeset 2
c4f02fc67e5a
parent 1
408291a6eb3e
child 4
c50b0e6f25d6
equal deleted inserted replaced
1:408291a6eb3e 2:c4f02fc67e5a
8 8
9 #if !defined(LUA_VERSION_NUM) || (LUA_VERSION_NUM < 501) 9 #if !defined(LUA_VERSION_NUM) || (LUA_VERSION_NUM < 501)
10 #include <compat-5.1.h> 10 #include <compat-5.1.h>
11 #endif 11 #endif
12 12
13 13 /*
14 *
15 * Table construction helper functions
16 *
17 * LUA_PUSH_ATTRIB_* creates string indexed (hashmap)
18 * LUA_PUSH_ATTRIB_* creates integer indexed (array)
19 *
20 */
14 21
15 #define LUA_PUSH_ATTRIB_INT(n, v) \ 22 #define LUA_PUSH_ATTRIB_INT(n, v) \
16 lua_pushstring(L, n); \ 23 lua_pushstring(L, n); \
17 lua_pushinteger(L, v); \ 24 lua_pushinteger(L, v); \
18 lua_rawset(L, -3); 25 lua_rawset(L, -3);
62 #define LUA_PUSH_ARRAY_NIL(n) \ 69 #define LUA_PUSH_ARRAY_NIL(n) \
63 lua_pushnil(L); \ 70 lua_pushnil(L); \
64 lua_rawseti(L, -2, n); \ 71 lua_rawseti(L, -2, n); \
65 n++; 72 n++;
66 73
67 74 /*
75 *
76 * Describes SQL to Lua API conversions
77 *
78 */
68 79
69 typedef enum lua_push_type { 80 typedef enum lua_push_type {
70 LUA_PUSH_NIL = 0, 81 LUA_PUSH_NIL = 0,
71 LUA_PUSH_INTEGER, 82 LUA_PUSH_INTEGER,
72 LUA_PUSH_NUMBER, 83 LUA_PUSH_NUMBER,

mercurial