summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2014-12-12 12:04:10 +0000
committerDaniel Kolesa <d.kolesa@samsung.com>2014-12-12 12:04:10 +0000
commit4a1bfdeb4d771f39c49f9d8fc65aa0cde2700de0 (patch)
tree9963277f3cbe4129a9dbaed21d5b1071fe8cdfe7
parent784045df9ae73f4f74b52b5f2cc7a6254b9b7c1d (diff)
elua: move io extensions to library
-rw-r--r--src/Makefile_Elua.am7
-rw-r--r--src/bin/elua/main.c4
-rw-r--r--src/lib/elua/Elua.h2
-rw-r--r--src/lib/elua/elua.c2
-rw-r--r--src/lib/elua/io.c (renamed from src/bin/elua/io.c)11
5 files changed, 11 insertions, 15 deletions
diff --git a/src/Makefile_Elua.am b/src/Makefile_Elua.am
index cd302519c5..65792b6e83 100644
--- a/src/Makefile_Elua.am
+++ b/src/Makefile_Elua.am
@@ -7,7 +7,9 @@ dist_installed_eluamainheaders_DATA = \
7lib/elua/Elua.h 7lib/elua/Elua.h
8 8
9lib_elua_libelua_la_SOURCES = \ 9lib_elua_libelua_la_SOURCES = \
10lib/elua/elua.c 10 lib/elua/elua_private.h \
11 lib/elua/elua.c \
12 lib/elua/io.c
11 13
12lib_elua_libelua_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ELUA_CFLAGS@ \ 14lib_elua_libelua_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ELUA_CFLAGS@ \
13 -DLOCALE_DIR=\"@LOCALE_DIR@\" \ 15 -DLOCALE_DIR=\"@LOCALE_DIR@\" \
@@ -28,8 +30,7 @@ bin_PROGRAMS += bin/elua/elua
28bin_elua_elua_SOURCES = \ 30bin_elua_elua_SOURCES = \
29 bin/elua/main.h \ 31 bin/elua/main.h \
30 bin/elua/cache.c \ 32 bin/elua/cache.c \
31 bin/elua/main.c \ 33 bin/elua/main.c
32 bin/elua/io.c
33 34
34bin_elua_elua_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ELUA_CFLAGS@ \ 35bin_elua_elua_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ELUA_CFLAGS@ \
35 -DLOCALE_DIR=\"@LOCALE_DIR@\" \ 36 -DLOCALE_DIR=\"@LOCALE_DIR@\" \
diff --git a/src/bin/elua/main.c b/src/bin/elua/main.c
index 789ee06a9f..5ff7487bef 100644
--- a/src/bin/elua/main.c
+++ b/src/bin/elua/main.c
@@ -316,13 +316,11 @@ struct Main_Data
316 int status; 316 int status;
317}; 317};
318 318
319int elua_popen(lua_State *L);
320
321const luaL_reg cutillib[] = 319const luaL_reg cutillib[] =
322{ 320{
323 { "init_module" , elua_init_module }, 321 { "init_module" , elua_init_module },
324 { "register_callbacks", elua_register_callbacks }, 322 { "register_callbacks", elua_register_callbacks },
325 { "popenv" , elua_popen }, 323 { "popenv" , elua_io_popen },
326 { NULL , NULL } 324 { NULL , NULL }
327}; 325};
328 326
diff --git a/src/lib/elua/Elua.h b/src/lib/elua/Elua.h
index 7b8387eae0..bba00e9030 100644
--- a/src/lib/elua/Elua.h
+++ b/src/lib/elua/Elua.h
@@ -63,6 +63,8 @@ EAPI int elua_shutdown(void);
63 63
64EAPI void elua_state_setup_i18n(lua_State *L); 64EAPI void elua_state_setup_i18n(lua_State *L);
65 65
66EAPI int elua_io_popen(lua_State *L);
67
66#endif 68#endif
67 69
68#ifdef __cplusplus 70#ifdef __cplusplus
diff --git a/src/lib/elua/elua.c b/src/lib/elua/elua.c
index ea23bc6cdc..f4411ae1e9 100644
--- a/src/lib/elua/elua.c
+++ b/src/lib/elua/elua.c
@@ -1,5 +1,3 @@
1#include <Eina.h>
2
3#include "Elua.h" 1#include "Elua.h"
4#include "elua_private.h" 2#include "elua_private.h"
5 3
diff --git a/src/bin/elua/io.c b/src/lib/elua/io.c
index 9d4ad17803..4b73a3b789 100644
--- a/src/bin/elua/io.c
+++ b/src/lib/elua/io.c
@@ -1,8 +1,5 @@
1#include "config.h" 1#include "Elua.h"
2 2#include "elua_private.h"
3/* elua io extras, largely taken from lua io lib source */
4
5#include "main.h"
6 3
7/* expand fname to full path name (so that PATH is ignored) plus turn 4/* expand fname to full path name (so that PATH is ignored) plus turn
8 * stuff into a command, and also verify whether the path exists */ 5 * stuff into a command, and also verify whether the path exists */
@@ -344,8 +341,8 @@ elua_newfile(lua_State *L)
344 return f; 341 return f;
345} 342}
346 343
347int 344EAPI int
348elua_popen(lua_State *L) 345elua_io_popen(lua_State *L)
349{ 346{
350 const char *fname = luaL_checkstring(L, 1); 347 const char *fname = luaL_checkstring(L, 1);
351 const char *mode = luaL_optstring(L, 2, "r"); 348 const char *mode = luaL_optstring(L, 2, "r");