From 8eaab964a0f5138bf77825acfed1d9f231051c19 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sat, 6 Feb 2016 16:15:39 +1000 Subject: Create our home directories, if not already created. --- TODO | 12 ++++++++++++ src/LuaSL/build.lua | 1 - src/extantz/extantz.c | 17 +++++++++++++++++ src/libraries/LumbrJack.c | 5 ++++- 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index 1633dc1..4b23cb8 100644 --- a/TODO +++ b/TODO @@ -317,6 +317,18 @@ SOOOO ... For now, we don't care, there's no actual installing going on. SledjHamr/locale -> prefix .. '/share/SledjHamr/locale' + ~/.SledjHamr/ + Contains an index.omg, and / or a bunch of sim directories / OAR files / etc.. + ~/.SledjHamr/.downloaded/ + Contains downloaded sims in their original format, like OAR files. + ~/.SledjHamr/.cache/ unpacked/ converted/ sha1/ types/ compiled/ + Contains various cached stuff that can be deleted at any time. + unpacked/ is for anything that's in an archive file, unpack it all in there. + converted/ is for anything that is converted to SledjHamr formats, from legacy formats. + sha1/ is for the sha1 sums of asset files, and other details? + types/ is for storing the types of asset files? + compiled/ is for translated and compiled scripts. + Irrlicht is flickering like crazy. Hmm, might be Irrlicht's fault, mostly it flickers to black, but I've seen it flicker to the first frame diff --git a/src/LuaSL/build.lua b/src/LuaSL/build.lua index df002f6..dafcf5e 100755 --- a/src/LuaSL/build.lua +++ b/src/LuaSL/build.lua @@ -13,7 +13,6 @@ if 'nil' == type(dir) then dir = workingDir end - removeFiles(dir, {'*.output', '*.backup', 'LuaSL_lexer.h', 'LuaSL_lexer.c', 'LuaSL_lemon_yaccer.h', 'LuaSL_lemon_yaccer.c', 'LuaSL_lemon_yaccer.out'}) -- Build and run lemon first, flex depends on it to define the symbol values. diff --git a/src/extantz/extantz.c b/src/extantz/extantz.c index f2c0a43..7a21aee 100644 --- a/src/extantz/extantz.c +++ b/src/extantz/extantz.c @@ -15,6 +15,18 @@ globals ourGlobals; //static char *myKey = "12345678-1234-4321-abcd-0123456789ab"; //static char *myName = "onefang rejected"; +static const char *dirs[] = +{ + ".cache", + ".cache/compiled", + ".cache/converted", + ".cache/sha1", + ".cache/types", + ".cache/unpacked", + ".download", + "inventory", + NULL +}; #if USE_LOVE @@ -586,10 +598,15 @@ static Eina_Bool _makeSkang(void *data) EAPI_MAIN int elm_main(int argc, char **argv) { GLData *gld = NULL; + char temp[PATH_MAX]; // Eina_Bool gotWebKit = elm_need_web(); // Initialise ewebkit if it exists, or return EINA_FALSE if it don't. logDom = HamrTime(argv[0], elm_main, logDom); + // Create our home directories, if not already created. + sprintf(temp, "%s/.SledjHamr", eina_environment_home_get()); + ecore_file_mksubdirs(temp, dirs); + /* Set the locale according to the system pref. * If you don't do so the file selector will order the files list in * a case sensitive manner diff --git a/src/libraries/LumbrJack.c b/src/libraries/LumbrJack.c index 3bb67e9..b92dc97 100644 --- a/src/libraries/LumbrJack.c +++ b/src/libraries/LumbrJack.c @@ -10,7 +10,6 @@ static char dateTime[DATE_TIME_LEN]; static Eina_Prefix *prefix = NULL; - int HamrTime(char *argv0, void *main, int logDom) { Eina_Array *path; @@ -47,6 +46,10 @@ int HamrTime(char *argv0, void *main, int logDom) // PD("The data files are in %s", eina_prefix_data_get(prefix)); // PD("The libraries are in %s", eina_prefix_lib_get(prefix)); // PD("The locale files are in %s", eina_prefix_locale_get(prefix)); +// TODO - ecore_file_escape_name(const char *filename) might also be useful. +// EFL doesn't seem to support links under Windows. Though apparently Windows itself has something similar. +// PD("The HOME directory is %s", eina_environment_home_get()); +// PD("The TMP directory is %s", eina_environment_tmp_get()); getcwd(cwd, PATH_MAX); env = getenv("LUA_CPATH"); -- cgit v1.1