Software /
code /
prosody
Comparison
util-src/hashes.c @ 6411:6c8f6364bc48
util-src/*.c: Don't create globals when loaded
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 16 Sep 2014 21:56:18 +0200 |
parent | 5774:6ef79af0c445 |
child | 6412:0e94f89d0e62 |
comparison
equal
deleted
inserted
replaced
6407:4bbd198cf3e6 | 6411:6c8f6364bc48 |
---|---|
201 { NULL, NULL } | 201 { NULL, NULL } |
202 }; | 202 }; |
203 | 203 |
204 LUALIB_API int luaopen_util_hashes(lua_State *L) | 204 LUALIB_API int luaopen_util_hashes(lua_State *L) |
205 { | 205 { |
206 luaL_register(L, "hashes", Reg); | 206 lua_newtable(L); |
207 luaL_register(L, NULL, Reg); | |
207 lua_pushliteral(L, "version"); /** version */ | 208 lua_pushliteral(L, "version"); /** version */ |
208 lua_pushliteral(L, "-3.14"); | 209 lua_pushliteral(L, "-3.14"); |
209 lua_settable(L,-3); | 210 lua_settable(L,-3); |
210 return 1; | 211 return 1; |
211 } | 212 } |