diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-10-20 19:01:40 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-10-20 19:01:40 +0300 |
commit | 2052acf054291c2915ace9da9cc1a395c3abf832 (patch) | |
tree | 646d57659ffea2e9e143cf35928fea0a14446487 /src/app.c | |
parent | 33190c949f5249e211810cb57dced95eb3dfb39d (diff) |
Added timestamps to serialized responses
A new version of the binary serialization format that includes timestamps for GmResponse.
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -22,6 +22,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
22 | 22 | ||
23 | #include "app.h" | 23 | #include "app.h" |
24 | #include "bookmarks.h" | 24 | #include "bookmarks.h" |
25 | #include "defs.h" | ||
25 | #include "embedded.h" | 26 | #include "embedded.h" |
26 | #include "gmcerts.h" | 27 | #include "gmcerts.h" |
27 | #include "gmdocument.h" | 28 | #include "gmdocument.h" |
@@ -255,9 +256,9 @@ static iBool loadState_App_(iApp *d) { | |||
255 | printf("%s: format not recognized\n", cstr_String(path_File(f))); | 256 | printf("%s: format not recognized\n", cstr_String(path_File(f))); |
256 | return iFalse; | 257 | return iFalse; |
257 | } | 258 | } |
258 | const int version = read32_File(f); | 259 | const uint32_t version = readU32_File(f); |
259 | /* Check supported versions. */ | 260 | /* Check supported versions. */ |
260 | if (version != 0) { | 261 | if (version > latest_FileVersion) { |
261 | printf("%s: unsupported version\n", cstr_String(path_File(f))); | 262 | printf("%s: unsupported version\n", cstr_String(path_File(f))); |
262 | return iFalse; | 263 | return iFalse; |
263 | } | 264 | } |
@@ -303,7 +304,7 @@ static void saveState_App_(const iApp *d) { | |||
303 | iFile *f = newCStr_File(concatPath_CStr(dataDir_App_, stateFileName_App_)); | 304 | iFile *f = newCStr_File(concatPath_CStr(dataDir_App_, stateFileName_App_)); |
304 | if (open_File(f, writeOnly_FileMode)) { | 305 | if (open_File(f, writeOnly_FileMode)) { |
305 | writeData_File(f, magicState_App_, 4); | 306 | writeData_File(f, magicState_App_, 4); |
306 | write32_File(f, 0); /* version */ | 307 | writeU32_File(f, latest_FileVersion); /* version */ |
307 | iConstForEach(ObjectList, i, iClob(listDocuments_App())) { | 308 | iConstForEach(ObjectList, i, iClob(listDocuments_App())) { |
308 | if (isInstance_Object(i.object, &Class_DocumentWidget)) { | 309 | if (isInstance_Object(i.object, &Class_DocumentWidget)) { |
309 | writeData_File(f, magicTabDocument_App_, 4); | 310 | writeData_File(f, magicTabDocument_App_, 4); |