aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-05-08 08:53:36 +1000
committerDavid Walter Seikel2014-05-08 08:53:36 +1000
commit83e12170dbffa258fa4a23d80fb9b18547adc193 (patch)
treee68155f23a13d49d644518fc9883617331b93989 /src
parentAnd now purkle is it's own skang module. (diff)
downloadSledjHamr-83e12170dbffa258fa4a23d80fb9b18547adc193.zip
SledjHamr-83e12170dbffa258fa4a23d80fb9b18547adc193.tar.gz
SledjHamr-83e12170dbffa258fa4a23d80fb9b18547adc193.tar.bz2
SledjHamr-83e12170dbffa258fa4a23d80fb9b18547adc193.tar.xz
Setup all the Lua paths in a central place.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/GuiLua/test.sh1
-rw-r--r--src/libraries/SledjHamr.c13
-rw-r--r--src/libraries/SledjHamr.h3
3 files changed, 15 insertions, 2 deletions
diff --git a/src/GuiLua/test.sh b/src/GuiLua/test.sh
index 0cf39d9..30e8742 100755
--- a/src/GuiLua/test.sh
+++ b/src/GuiLua/test.sh
@@ -2,5 +2,4 @@
2 2
3wd=$(pwd) 3wd=$(pwd)
4 4
5export LUA_PATH="$wd/../../lib/?.lua;./?.lua"
6../../skang -l test -foo "argy bargy" 5../../skang -l test -foo "argy bargy"
diff --git a/src/libraries/SledjHamr.c b/src/libraries/SledjHamr.c
index aa68774..6137199 100644
--- a/src/libraries/SledjHamr.c
+++ b/src/libraries/SledjHamr.c
@@ -2,6 +2,8 @@
2 2
3void HamrTime(void *elm_main, char *domain) 3void HamrTime(void *elm_main, char *domain)
4{ 4{
5 char *env, cwd[PATH_MAX], temp[PATH_MAX * 2];
6
5 elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR); 7 elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR);
6 elm_app_compile_data_dir_set(PACKAGE_DATA_DIR); 8 elm_app_compile_data_dir_set(PACKAGE_DATA_DIR);
7 elm_app_compile_lib_dir_set(PACKAGE_LIB_DIR); 9 elm_app_compile_lib_dir_set(PACKAGE_LIB_DIR);
@@ -20,4 +22,15 @@ void HamrTime(void *elm_main, char *domain)
20 elm_app_info_set(elm_main, domain, "checkme.txt"); 22 elm_app_info_set(elm_main, domain, "checkme.txt");
21 // Once this is all setup, the code can do - 23 // Once this is all setup, the code can do -
22 // elm_app_prefix_dir_get(); // or bin, lib, data, locale. 24 // elm_app_prefix_dir_get(); // or bin, lib, data, locale.
25
26 getcwd(cwd, PATH_MAX);
27 env = getenv("LUA_CPATH");
28 if (!env) env = "";
29 sprintf(temp, "%s;%s/lib?.so;%s/?.so;%s/?.so", env, elm_app_lib_dir_get(), elm_app_lib_dir_get(), cwd);
30 setenv("LUA_CPATH", temp, 1);
31
32 env = getenv("LUA_PATH");
33 if (!env) env = "";
34 sprintf(temp, "%s;%s/?.lua;%s/?.lua", env, elm_app_lib_dir_get(), cwd);
35 setenv("LUA_PATH", temp, 1);
23} 36}
diff --git a/src/libraries/SledjHamr.h b/src/libraries/SledjHamr.h
index 2351507..956b37e 100644
--- a/src/libraries/SledjHamr.h
+++ b/src/libraries/SledjHamr.h
@@ -8,7 +8,8 @@
8/* Enable access to unstable EFL EO API. */ 8/* Enable access to unstable EFL EO API. */
9#define EFL_EO_API_SUPPORT 1 9#define EFL_EO_API_SUPPORT 1
10 10
11#include <ctype.h> 11//#include <ctype.h>
12#include <stdlib.h>
12 13
13#include <Elementary.h> 14#include <Elementary.h>
14 15