aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/libraries/SledjHamr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libraries/SledjHamr.c')
-rw-r--r--src/libraries/SledjHamr.c23
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
3void 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}