elua: move io extensions to library

This commit is contained in:
Daniel Kolesa 2014-12-12 12:04:10 +00:00
parent 784045df9a
commit 4a1bfdeb4d
5 changed files with 11 additions and 15 deletions

View File

@ -7,7 +7,9 @@ dist_installed_eluamainheaders_DATA = \
lib/elua/Elua.h lib/elua/Elua.h
lib_elua_libelua_la_SOURCES = \ lib_elua_libelua_la_SOURCES = \
lib/elua/elua.c lib/elua/elua_private.h \
lib/elua/elua.c \
lib/elua/io.c
lib_elua_libelua_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ELUA_CFLAGS@ \ lib_elua_libelua_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ELUA_CFLAGS@ \
-DLOCALE_DIR=\"@LOCALE_DIR@\" \ -DLOCALE_DIR=\"@LOCALE_DIR@\" \
@ -28,8 +30,7 @@ bin_PROGRAMS += bin/elua/elua
bin_elua_elua_SOURCES = \ bin_elua_elua_SOURCES = \
bin/elua/main.h \ bin/elua/main.h \
bin/elua/cache.c \ bin/elua/cache.c \
bin/elua/main.c \ bin/elua/main.c
bin/elua/io.c
bin_elua_elua_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ELUA_CFLAGS@ \ bin_elua_elua_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ELUA_CFLAGS@ \
-DLOCALE_DIR=\"@LOCALE_DIR@\" \ -DLOCALE_DIR=\"@LOCALE_DIR@\" \

View File

@ -316,13 +316,11 @@ struct Main_Data
int status; int status;
}; };
int elua_popen(lua_State *L);
const luaL_reg cutillib[] = const luaL_reg cutillib[] =
{ {
{ "init_module" , elua_init_module }, { "init_module" , elua_init_module },
{ "register_callbacks", elua_register_callbacks }, { "register_callbacks", elua_register_callbacks },
{ "popenv" , elua_popen }, { "popenv" , elua_io_popen },
{ NULL , NULL } { NULL , NULL }
}; };

View File

@ -63,6 +63,8 @@ EAPI int elua_shutdown(void);
EAPI void elua_state_setup_i18n(lua_State *L); EAPI void elua_state_setup_i18n(lua_State *L);
EAPI int elua_io_popen(lua_State *L);
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -1,5 +1,3 @@
#include <Eina.h>
#include "Elua.h" #include "Elua.h"
#include "elua_private.h" #include "elua_private.h"

View File

@ -1,8 +1,5 @@
#include "config.h" #include "Elua.h"
#include "elua_private.h"
/* elua io extras, largely taken from lua io lib source */
#include "main.h"
/* expand fname to full path name (so that PATH is ignored) plus turn /* expand fname to full path name (so that PATH is ignored) plus turn
* stuff into a command, and also verify whether the path exists */ * stuff into a command, and also verify whether the path exists */
@ -344,8 +341,8 @@ elua_newfile(lua_State *L)
return f; return f;
} }
int EAPI int
elua_popen(lua_State *L) elua_io_popen(lua_State *L)
{ {
const char *fname = luaL_checkstring(L, 1); const char *fname = luaL_checkstring(L, 1);
const char *mode = luaL_optstring(L, 2, "r"); const char *mode = luaL_optstring(L, 2, "r");