Skip to content
Snippets Groups Projects
Commit 655713fa authored by Roman Tsisyk's avatar Roman Tsisyk
Browse files

Fix cyclic dependency between libserver.a and libbox.a

Spent couple hours to figure it out.
parent feba8f63
No related branches found
No related tags found
No related merge requests found
......@@ -49,6 +49,9 @@ boxffi_select(struct port *port, uint32_t space_id, uint32_t index_id,
char *
lbox_encode_tuple_on_gc(struct lua_State *L, int idx, size_t *p_len);
void
box_lua_init(struct lua_State *L);
#if defined(__cplusplus)
} /* extern "C" */
......
......@@ -58,14 +58,6 @@
#include <readline/readline.h>
#include <readline/history.h>
/**
* This is a callback used by tarantool_lua_init() to open
* module-specific libraries into given Lua state.
*
* No return value, panics if error.
*/
extern void box_lua_init(struct lua_State *L);
/**
* The single Lua state of the transaction processor (tx) thread.
*/
......@@ -430,8 +422,6 @@ tarantool_lua_init(const char *tarantool_bin, int argc, char **argv)
luaopen_tarantool(L);
lua_pop(L, 1);
box_lua_init(L);
lua_newtable(L);
lua_pushinteger(L, -1);
lua_pushstring(L, tarantool_bin);
......
......@@ -41,6 +41,8 @@ struct lua_State;
struct luaL_Reg;
extern bool start_loop;
extern struct lua_State *tarantool_L;
/**
* Create an instance of Lua interpreter and load it with
* Tarantool modules. Creates a Lua state, imports global
......
......@@ -71,6 +71,7 @@
#include <readline/history.h>
#include "title.h"
#include <libutil.h>
#include "box/lua/call.h" /* box_lua_init() */
static pid_t master_pid = getpid();
static struct pidfh *pid_file_handle;
......@@ -630,6 +631,7 @@ main(int argc, char **argv)
coeio_init();
signal_init();
tarantool_lua_init(tarantool_bin, main_argc, main_argv);
box_lua_init(tarantool_L);
/* main core cleanup routine */
atexit(tarantool_free);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment