Software / code / prosody
Comparison
util-src/crand.c @ 12976:a187600ec7d6
util: Add compat for prosody module name change to C sources
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 17 Mar 2023 18:03:07 +0100 |
| parent | 12575:1f6f05a98fcd |
comparison
equal
deleted
inserted
replaced
| 12975:d10957394a3c | 12976:a187600ec7d6 |
|---|---|
| 121 | 121 |
| 122 lua_pushlstring(L, buf, len); | 122 lua_pushlstring(L, buf, len); |
| 123 return 1; | 123 return 1; |
| 124 } | 124 } |
| 125 | 125 |
| 126 int luaopen_util_crand(lua_State *L) { | 126 int luaopen_prosody_util_crand(lua_State *L) { |
| 127 luaL_checkversion(L); | 127 luaL_checkversion(L); |
| 128 | 128 |
| 129 lua_createtable(L, 0, 2); | 129 lua_createtable(L, 0, 2); |
| 130 lua_pushcfunction(L, Lrandom); | 130 lua_pushcfunction(L, Lrandom); |
| 131 lua_setfield(L, -2, "bytes"); | 131 lua_setfield(L, -2, "bytes"); |
| 140 lua_setfield(L, -2, "_source"); | 140 lua_setfield(L, -2, "_source"); |
| 141 | 141 |
| 142 return 1; | 142 return 1; |
| 143 } | 143 } |
| 144 | 144 |
| 145 int luaopen_util_crand(lua_State *L) { | |
| 146 return luaopen_prosody_util_crand(L); | |
| 147 } |