lua_setfield(L, -2, "item");
}
+void dlua_push_timeval(lua_State *L, const struct timeval *tv)
+{
+ lua_pushinteger(L, tv == NULL ? 0 :
+ tv->tv_sec * 1000000LL + tv->tv_usec);
+}
+
static int dlua_event_append_log_prefix(lua_State *L)
{
DLUA_REQUIRE_ARGS(L, 2);
const char *dlua_push_vfstring(lua_State *L, const char *fmt, va_list argp) ATTR_FORMAT(2, 0);
const char *dlua_push_fstring(lua_State *L, const char *fmt, ...) ATTR_FORMAT(2, 3);
+/* push timeval as a microseconds integer to top of the stack */
+void dlua_push_timeval(lua_State *L, const struct timeval *tv);
+
/* improved luaL_error, can handle full C format support */
int dluaL_error(lua_State *L, const char *fmt, ...) ATTR_FORMAT(2, 3);
#define luaL_error(...) dluaL_error(__VA_ARGS__)