summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/app.c b/src/app.c
index 46235206..21028edc 100644
--- a/src/app.c
+++ b/src/app.c
@@ -41,7 +41,8 @@ static const char *dataDir_App_ = "~/Library/Application Support/fi.skyjake.Lagr
41static const char *dataDir_App_ = "~/AppData/Roaming/fi.skyjake.Lagrange"; 41static const char *dataDir_App_ = "~/AppData/Roaming/fi.skyjake.Lagrange";
42#endif 42#endif
43#if defined (iPlatformLinux) 43#if defined (iPlatformLinux)
44#define EMB_BIN "../../share/lagrange/resources.bin" 44#define EMB_BIN "../../share/lagrange/resources.bin"
45#define EMB_BIN2 "../resources.bin" /* try from build dir as well */
45static const char *dataDir_App_ = "~/.config/lagrange"; 46static const char *dataDir_App_ = "~/.config/lagrange";
46#endif 47#endif
47static const char *prefsFileName_App_ = "prefs.cfg"; 48static const char *prefsFileName_App_ = "prefs.cfg";
@@ -152,9 +153,11 @@ static void init_App_(iApp *d, int argc, char **argv) {
152 load_History(d->history, dataDir_App_); 153 load_History(d->history, dataDir_App_);
153#if defined (iHaveLoadEmbed) 154#if defined (iHaveLoadEmbed)
154 /* Load the resources from a file. */ { 155 /* Load the resources from a file. */ {
155 if (!load_Embed(concatPath_CStr(cstr_String(execPath_App()), EMB_BIN))) { 156 if (!load_Embed(concatPath_CStr(cstr_String(execPath_App()), "../resources.bin"))) {
156 fprintf(stderr, "failed to load resources.bin\n"); 157 if (!load_Embed(concatPath_CStr(cstr_String(execPath_App()), EMB_BIN))) {
157 exit(-1); 158 fprintf(stderr, "failed to load resources.bin: %s\n", strerror(errno));
159 exit(-1);
160 }
158 } 161 }
159 } 162 }
160#endif 163#endif
@@ -311,6 +314,10 @@ void addTicker_App(void (*ticker)(iAny *), iAny *context) {
311 insert_SortedArray(&d->tickers, &(iTicker){ context, ticker }); 314 insert_SortedArray(&d->tickers, &(iTicker){ context, ticker });
312} 315}
313 316
317iGmCerts *certs_App(void) {
318 return app_.certs;
319}
320
314const iHistory *history_App(void) { 321const iHistory *history_App(void) {
315 return app_.history; 322 return app_.history;
316} 323}