Software /
code /
prosody
Comparison
util-src/time.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 (2023-03-17) |
parent | 10480:94cacf9fd0ae |
comparison
equal
deleted
inserted
replaced
12975:d10957394a3c | 12976:a187600ec7d6 |
---|---|
21 clock_gettime(CLOCK_MONOTONIC, &t); | 21 clock_gettime(CLOCK_MONOTONIC, &t); |
22 lua_pushnumber(L, tv2number(&t)); | 22 lua_pushnumber(L, tv2number(&t)); |
23 return 1; | 23 return 1; |
24 } | 24 } |
25 | 25 |
26 int luaopen_util_time(lua_State *L) { | 26 int luaopen_prosody_util_time(lua_State *L) { |
27 lua_createtable(L, 0, 2); | 27 lua_createtable(L, 0, 2); |
28 { | 28 { |
29 lua_pushcfunction(L, lc_time_realtime); | 29 lua_pushcfunction(L, lc_time_realtime); |
30 lua_setfield(L, -2, "now"); | 30 lua_setfield(L, -2, "now"); |
31 lua_pushcfunction(L, lc_time_monotonic); | 31 lua_pushcfunction(L, lc_time_monotonic); |
32 lua_setfield(L, -2, "monotonic"); | 32 lua_setfield(L, -2, "monotonic"); |
33 } | 33 } |
34 return 1; | 34 return 1; |
35 } | 35 } |
36 int luaopen_util_time(lua_State *L) { | |
37 return luaopen_prosody_util_time(L); | |
38 } |