register and init the constants table */
| 1921 | |
| 1922 | /* register and init the constants table */ |
| 1923 | staticfn void |
| 1924 | init_nhc_data(lua_State *L) |
| 1925 | { |
| 1926 | int i; |
| 1927 | |
| 1928 | lua_newtable(L); |
| 1929 | |
| 1930 | for (i = 0; nhl_consts[i].name; i++) { |
| 1931 | lua_pushstring(L, nhl_consts[i].name); |
| 1932 | lua_pushinteger(L, nhl_consts[i].value); |
| 1933 | lua_rawset(L, -3); |
| 1934 | } |
| 1935 | |
| 1936 | lua_setglobal(L, "nhc"); |
| 1937 | } |
| 1938 | |
| 1939 | staticfn int |
| 1940 | nhl_push_anything(lua_State *L, int anytype, void *src) |