summaryrefslogtreecommitdiff
path: root/src
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
parent7e393a4fda482d01252bd1a6e84ca8149bcc278e (diff)
Renamed ".binary" files
Use the .lgr extension for Lagrange binary files.
Diffstat (limited to 'src')
-rw-r--r--src/app.c19
-rw-r--r--src/gmcerts.c12
2 files changed, 18 insertions, 13 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);
diff --git a/src/gmcerts.c b/src/gmcerts.c
index 0a5638fa..da918279 100644
--- a/src/gmcerts.c
+++ b/src/gmcerts.c
@@ -34,9 +34,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
34#include <the_Foundation/time.h> 34#include <the_Foundation/time.h>
35#include <ctype.h> 35#include <ctype.h>
36 36
37static const char *filename_GmCerts_ = "trusted.txt"; 37static const char *filename_GmCerts_ = "trusted.txt";
38static const char *identsDir_GmCerts_ = "idents"; 38static const char *identsDir_GmCerts_ = "idents";
39static const char *identsFilename_GmCerts_ = "idents.binary"; 39static const char *oldIdentsFilename_GmCerts_ = "idents.binary";
40static const char *identsFilename_GmCerts_ = "idents.lgr";
40 41
41iDeclareClass(TrustEntry) 42iDeclareClass(TrustEntry)
42 43
@@ -237,8 +238,9 @@ static void save_GmCerts_(const iGmCerts *d) {
237} 238}
238 239
239static void loadIdentities_GmCerts_(iGmCerts *d) { 240static void loadIdentities_GmCerts_(iGmCerts *d) {
240 iFile *f = 241 const iString *oldPath = collect_String(concatCStr_Path(&d->saveDir, oldIdentsFilename_GmCerts_));
241 iClob(new_File(collect_String(concatCStr_Path(&d->saveDir, identsFilename_GmCerts_)))); 242 const iString *path = collect_String(concatCStr_Path(&d->saveDir, identsFilename_GmCerts_));
243 iFile *f = iClob(new_File(fileExists_FileInfo(path) ? path : oldPath));
242 if (open_File(f, readOnly_FileMode)) { 244 if (open_File(f, readOnly_FileMode)) {
243 char magic[4]; 245 char magic[4];
244 readData_File(f, sizeof(magic), magic); 246 readData_File(f, sizeof(magic), magic);