Selaa lähdekoodia

app_lua: added helper function to return int to Lua

Daniel-Constantin Mierla 15 vuotta sitten
vanhempi
commit
85cb987856
2 muutettua tiedostoa jossa 10 lisäystä ja 0 poistoa
  1. 9 0
      modules/app_lua/app_lua_api.c
  2. 1 0
      modules/app_lua/app_lua_api.h

+ 9 - 0
modules/app_lua/app_lua_api.c

@@ -271,6 +271,15 @@ int lua_sr_initialized(void)
 	return 1;
 }
 
+/**
+ *
+ */
+int app_lua_return_int(lua_State *L, int v)
+{
+	lua_pushinteger(L, v);
+	return 1;
+}
+
 /**
  *
  */

+ 1 - 0
modules/app_lua/app_lua_api.h

@@ -60,6 +60,7 @@ int app_lua_run(struct sip_msg *msg, char *func, char *p1, char *p2,
 int app_lua_return_boolean(lua_State *L, int b);
 int app_lua_return_false(lua_State *L);
 int app_lua_return_true(lua_State *L);
+int app_lua_return_int(lua_State *L, int v);
 
 void app_lua_dump_stack(lua_State *L);