summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-01-18 19:19:47 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-01-18 19:19:47 +0200
commit1ac1db7f0b508e6219dce4aa2fbd2c5515472506 (patch)
tree6b076cea341655240fa2d048ad76e35a30786b14 /src/app.c
parent7e393a4fda482d01252bd1a6e84ca8149bcc278e (diff)
Renamed ".binary" files
Use the .lgr extension for Lagrange binary files.
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/app.c b/src/app.c
index 8ee09651..a46a6976 100644
--- a/src/app.c
+++ b/src/app.c
@@ -74,25 +74,26 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
74iDeclareType(App) 74iDeclareType(App)
75 75
76#if defined (iPlatformApple) 76#if defined (iPlatformApple)
77#define EMB_BIN "../../Resources/resources.binary" 77#define EMB_BIN "../../Resources/resources.lgr"
78static const char *dataDir_App_ = "~/Library/Application Support/fi.skyjake.Lagrange"; 78static const char *dataDir_App_ = "~/Library/Application Support/fi.skyjake.Lagrange";
79#endif 79#endif
80#if defined (iPlatformMsys) 80#if defined (iPlatformMsys)
81#define EMB_BIN "../resources.binary" 81#define EMB_BIN "../resources.lgr"
82static const char *dataDir_App_ = "~/AppData/Roaming/fi.skyjake.Lagrange"; 82static const char *dataDir_App_ = "~/AppData/Roaming/fi.skyjake.Lagrange";
83#endif 83#endif
84#if defined (iPlatformLinux) || defined (iPlatformOther) 84#if defined (iPlatformLinux) || defined (iPlatformOther)
85#define EMB_BIN "../../share/lagrange/resources.binary" 85#define EMB_BIN "../../share/lagrange/resources.lgr"
86static const char *dataDir_App_ = "~/.config/lagrange"; 86static const char *dataDir_App_ = "~/.config/lagrange";
87#endif 87#endif
88#if defined (LAGRANGE_EMB_BIN) /* specified in build config */ 88#if defined (LAGRANGE_EMB_BIN) /* specified in build config */
89# undef EMB_BIN 89# undef EMB_BIN
90# define EMB_BIN LAGRANGE_EMB_BIN 90# define EMB_BIN LAGRANGE_EMB_BIN
91#endif 91#endif
92#define EMB_BIN2 "../resources.binary" /* fallback from build/executable dir */ 92#define EMB_BIN2 "../resources.lgr" /* fallback from build/executable dir */
93static const char *prefsFileName_App_ = "prefs.cfg"; 93static const char *prefsFileName_App_ = "prefs.cfg";
94static const char *stateFileName_App_ = "state.binary"; 94static const char *oldStateFileName_App_ = "state.binary";
95static const char *downloadDir_App_ = "~/Downloads"; 95static const char *stateFileName_App_ = "state.lgr";
96static const char *downloadDir_App_ = "~/Downloads";
96 97
97static const int idleThreshold_App_ = 1000; /* ms */ 98static const int idleThreshold_App_ = 1000; /* ms */
98 99
@@ -265,7 +266,9 @@ static const char *magicTabDocument_App_ = "tabd";
265 266
266static iBool loadState_App_(iApp *d) { 267static iBool loadState_App_(iApp *d) {
267 iUnused(d); 268 iUnused(d);
268 iFile *f = iClob(newCStr_File(concatPath_CStr(dataDir_App_, stateFileName_App_))); 269 const char *oldPath = concatPath_CStr(dataDir_App_, oldStateFileName_App_);
270 const char *path = concatPath_CStr(dataDir_App_, stateFileName_App_);
271 iFile *f = iClob(newCStr_File(fileExistsCStr_FileInfo(path) ? path : oldPath));
269 if (open_File(f, readOnly_FileMode)) { 272 if (open_File(f, readOnly_FileMode)) {
270 char magic[4]; 273 char magic[4];
271 readData_File(f, 4, magic); 274 readData_File(f, 4, magic);