summaryrefslogtreecommitdiff
path: root/src/lib/elua
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2015-04-16 16:30:05 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2015-05-06 15:05:21 +0100
commit7cb8d13980150e8a2f99377b8f2987b3c7aa9ff7 (patch)
tree99741a9067b86204bd06554a1e8ff1178035015c /src/lib/elua
parent145cd1a615b6060805a5ce2aa197b77b523c1e5b (diff)
elua lib: hide some APIs that should not be public
Diffstat (limited to 'src/lib/elua')
-rw-r--r--src/lib/elua/Elua.h4
-rw-r--r--src/lib/elua/elua.c19
-rw-r--r--src/lib/elua/elua_private.h2
-rw-r--r--src/lib/elua/io.c4
4 files changed, 15 insertions, 14 deletions
diff --git a/src/lib/elua/Elua.h b/src/lib/elua/Elua.h
index 880c7736a2..81a6421b6e 100644
--- a/src/lib/elua/Elua.h
+++ b/src/lib/elua/Elua.h
@@ -92,10 +92,6 @@ EAPI Eina_Bool elua_state_modules_setup(const Elua_State *es);
92EAPI Eina_Bool elua_state_io_setup(const Elua_State *es); 92EAPI Eina_Bool elua_state_io_setup(const Elua_State *es);
93 93
94EAPI int elua_io_loadfile(const Elua_State *es, const char *fname); 94EAPI int elua_io_loadfile(const Elua_State *es, const char *fname);
95EAPI int elua_io_popen(lua_State *L);
96
97EAPI int elua_module_init(lua_State *L);
98EAPI int elua_module_system_init(lua_State *L);
99 95
100EAPI int elua_util_require(Elua_State *es, const char *libname); 96EAPI int elua_util_require(Elua_State *es, const char *libname);
101EAPI int elua_util_file_run(Elua_State *es, const char *fname); 97EAPI int elua_util_file_run(Elua_State *es, const char *fname);
diff --git a/src/lib/elua/elua.c b/src/lib/elua/elua.c
index d60f1a3963..488438ab0d 100644
--- a/src/lib/elua/elua.c
+++ b/src/lib/elua/elua.c
@@ -292,11 +292,14 @@ elua_state_i18n_setup(const Elua_State *es)
292 return EINA_TRUE; 292 return EINA_TRUE;
293} 293}
294 294
295int _elua_module_init(lua_State *L);
296int _elua_module_system_init(lua_State *L);
297
295const luaL_reg _elua_cutillib[] = 298const luaL_reg _elua_cutillib[] =
296{ 299{
297 { "init_module", elua_module_init }, 300 { "init_module", _elua_module_init },
298 { "popenv" , elua_io_popen }, 301 { "popenv" , _elua_io_popen },
299 { NULL , NULL } 302 { NULL , NULL }
300}; 303};
301 304
302EAPI Eina_Bool 305EAPI Eina_Bool
@@ -310,15 +313,15 @@ elua_state_modules_setup(const Elua_State *es)
310 snprintf(buf, sizeof(buf), "%s/module.lua", es->coredir); 313 snprintf(buf, sizeof(buf), "%s/module.lua", es->coredir);
311 if (elua_util_error_report(es, es->progname, elua_io_loadfile(es, buf))) 314 if (elua_util_error_report(es, es->progname, elua_io_loadfile(es, buf)))
312 return EINA_FALSE; 315 return EINA_FALSE;
313 lua_pushcfunction(es->luastate, elua_module_system_init); 316 lua_pushcfunction(es->luastate, _elua_module_system_init);
314 lua_createtable(es->luastate, 0, 0); 317 lua_createtable(es->luastate, 0, 0);
315 luaL_register(es->luastate, NULL, _elua_cutillib); 318 luaL_register(es->luastate, NULL, _elua_cutillib);
316 lua_call(es->luastate, 2, 0); 319 lua_call(es->luastate, 2, 0);
317 return EINA_TRUE; 320 return EINA_TRUE;
318} 321}
319 322
320EAPI int 323int
321elua_module_init(lua_State *L) 324_elua_module_init(lua_State *L)
322{ 325{
323 Elua_State *es = elua_state_from_lua_state_get(L); 326 Elua_State *es = elua_state_from_lua_state_get(L);
324 if (!lua_isnoneornil(L, 1)) 327 if (!lua_isnoneornil(L, 1))
@@ -335,8 +338,8 @@ elua_module_init(lua_State *L)
335 return 0; 338 return 0;
336} 339}
337 340
338EAPI int 341int
339elua_module_system_init(lua_State *L) 342_elua_module_system_init(lua_State *L)
340{ 343{
341 Elua_State *es = elua_state_from_lua_state_get(L); 344 Elua_State *es = elua_state_from_lua_state_get(L);
342 const char *corepath = es->coredir; 345 const char *corepath = es->coredir;
diff --git a/src/lib/elua/elua_private.h b/src/lib/elua/elua_private.h
index fbf7bb3ca9..cf24e1e661 100644
--- a/src/lib/elua/elua_private.h
+++ b/src/lib/elua/elua_private.h
@@ -47,4 +47,6 @@ extern int _elua_log_dom;
47#define ERR(...) EINA_LOG_DOM_ERR(_elua_log_dom, __VA_ARGS__) 47#define ERR(...) EINA_LOG_DOM_ERR(_elua_log_dom, __VA_ARGS__)
48#define CRT(...) EINA_LOG_DOM_CRITICAL(_elua_log_dom, __VA_ARGS__) 48#define CRT(...) EINA_LOG_DOM_CRITICAL(_elua_log_dom, __VA_ARGS__)
49 49
50int _elua_io_popen(lua_State *L);
51
50#endif 52#endif
diff --git a/src/lib/elua/io.c b/src/lib/elua/io.c
index 4b73a3b789..91eef6f372 100644
--- a/src/lib/elua/io.c
+++ b/src/lib/elua/io.c
@@ -341,8 +341,8 @@ elua_newfile(lua_State *L)
341 return f; 341 return f;
342} 342}
343 343
344EAPI int 344int
345elua_io_popen(lua_State *L) 345_elua_io_popen(lua_State *L)
346{ 346{
347 const char *fname = luaL_checkstring(L, 1); 347 const char *fname = luaL_checkstring(L, 1);
348 const char *mode = luaL_optstring(L, 2, "r"); 348 const char *mode = luaL_optstring(L, 2, "r");