diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-01-18 19:19:47 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-01-18 19:19:47 +0200 |
commit | 1ac1db7f0b508e6219dce4aa2fbd2c5515472506 (patch) | |
tree | 6b076cea341655240fa2d048ad76e35a30786b14 /src | |
parent | 7e393a4fda482d01252bd1a6e84ca8149bcc278e (diff) |
Renamed ".binary" files
Use the .lgr extension for Lagrange binary files.
Diffstat (limited to 'src')
-rw-r--r-- | src/app.c | 19 | ||||
-rw-r--r-- | src/gmcerts.c | 12 |
2 files changed, 18 insertions, 13 deletions
@@ -74,25 +74,26 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
74 | iDeclareType(App) | 74 | iDeclareType(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" |
78 | static const char *dataDir_App_ = "~/Library/Application Support/fi.skyjake.Lagrange"; | 78 | static 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" |
82 | static const char *dataDir_App_ = "~/AppData/Roaming/fi.skyjake.Lagrange"; | 82 | static 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" |
86 | static const char *dataDir_App_ = "~/.config/lagrange"; | 86 | static 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 */ |
93 | static const char *prefsFileName_App_ = "prefs.cfg"; | 93 | static const char *prefsFileName_App_ = "prefs.cfg"; |
94 | static const char *stateFileName_App_ = "state.binary"; | 94 | static const char *oldStateFileName_App_ = "state.binary"; |
95 | static const char *downloadDir_App_ = "~/Downloads"; | 95 | static const char *stateFileName_App_ = "state.lgr"; |
96 | static const char *downloadDir_App_ = "~/Downloads"; | ||
96 | 97 | ||
97 | static const int idleThreshold_App_ = 1000; /* ms */ | 98 | static const int idleThreshold_App_ = 1000; /* ms */ |
98 | 99 | ||
@@ -265,7 +266,9 @@ static const char *magicTabDocument_App_ = "tabd"; | |||
265 | 266 | ||
266 | static iBool loadState_App_(iApp *d) { | 267 | static 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 | ||
37 | static const char *filename_GmCerts_ = "trusted.txt"; | 37 | static const char *filename_GmCerts_ = "trusted.txt"; |
38 | static const char *identsDir_GmCerts_ = "idents"; | 38 | static const char *identsDir_GmCerts_ = "idents"; |
39 | static const char *identsFilename_GmCerts_ = "idents.binary"; | 39 | static const char *oldIdentsFilename_GmCerts_ = "idents.binary"; |
40 | static const char *identsFilename_GmCerts_ = "idents.lgr"; | ||
40 | 41 | ||
41 | iDeclareClass(TrustEntry) | 42 | iDeclareClass(TrustEntry) |
42 | 43 | ||
@@ -237,8 +238,9 @@ static void save_GmCerts_(const iGmCerts *d) { | |||
237 | } | 238 | } |
238 | 239 | ||
239 | static void loadIdentities_GmCerts_(iGmCerts *d) { | 240 | static 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); |