diff options
author | David Walter Seikel | 2014-04-27 16:48:07 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-04-27 16:48:07 +1000 |
commit | 568c8829db2f886921c7592cadbadbf4241127b6 (patch) | |
tree | 0af400526db683fa4ff5fb18a7eb2f685795fd04 /src/libraries/SledjHamr.c | |
parent | Added stuff cut and pasted from the new Evas_3d examples, but they are broken... (diff) | |
download | SledjHamr-568c8829db2f886921c7592cadbadbf4241127b6.zip SledjHamr-568c8829db2f886921c7592cadbadbf4241127b6.tar.gz SledjHamr-568c8829db2f886921c7592cadbadbf4241127b6.tar.bz2 SledjHamr-568c8829db2f886921c7592cadbadbf4241127b6.tar.xz |
Centralise the PACKAGE_* stuff, move our libraries to lib, and shuffle stuff to suit.
Diffstat (limited to 'src/libraries/SledjHamr.c')
-rw-r--r-- | src/libraries/SledjHamr.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/libraries/SledjHamr.c b/src/libraries/SledjHamr.c new file mode 100644 index 0000000..aa68774 --- /dev/null +++ b/src/libraries/SledjHamr.c | |||
@@ -0,0 +1,23 @@ | |||
1 | #include "SledjHamr.h" | ||
2 | |||
3 | void HamrTime(void *elm_main, char *domain) | ||
4 | { | ||
5 | elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR); | ||
6 | elm_app_compile_data_dir_set(PACKAGE_DATA_DIR); | ||
7 | elm_app_compile_lib_dir_set(PACKAGE_LIB_DIR); | ||
8 | elm_app_compile_locale_set(PACKAGE_LOCALE_DIR); | ||
9 | // Do this after the above calls, but before changing the working directory, or screwing with argv[0]. | ||
10 | // It tries to set up the package paths depending on where the executable is, so things are relocatable. | ||
11 | // First argument is the elm_main() function that Elementary starts us from. | ||
12 | // Second argument should be a lower case string used as the "domain", which is different from the log domain. | ||
13 | // It's used lower case as part of the data directory path. | ||
14 | // So, if prefix is /usr/local, then the system data dir is /usr/local/share, | ||
15 | // and this apps data dir is /usr/local/share/"domain". | ||
16 | // It's used upper case as part of environment variables to override directory paths at run time. | ||
17 | // So "DOMAIN"_PREFIX, "DOMAIN"_BIN_DIR, "DOMAIN"_LIB_DIR, "DOMAIN"_DATA_DIR, and "DOMAIN"_LOCALE_DIR | ||
18 | // Third argument is the name of a file it can check for to make sure it found the correct path. | ||
19 | // This file is looked for in the data dir. | ||
20 | elm_app_info_set(elm_main, domain, "checkme.txt"); | ||
21 | // Once this is all setup, the code can do - | ||
22 | // elm_app_prefix_dir_get(); // or bin, lib, data, locale. | ||
23 | } | ||