diff options
| author | Wiimm <wiimm@wiimm.de> | 2023-09-22 17:19:28 +0200 |
|---|---|---|
| committer | Wiimm <wiimm@wiimm.de> | 2023-09-22 17:19:28 +0200 |
| commit | 336da838ce43edae40dd708dd465f1f43a2c312d (patch) | |
| tree | c7825c2937e1f79f5c6fc31e45c25eca053833d6 /project/src/lib-checksum.h | |
| parent | eb71ae7bdb97df01bf6cf0f2adc0f84e59e16fcb (diff) | |
SZS 2.38a
Diffstat (limited to '')
| -rw-r--r-- | project/src/lib-checksum.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/project/src/lib-checksum.h b/project/src/lib-checksum.h index 397ae88..2256f19 100644 --- a/project/src/lib-checksum.h +++ b/project/src/lib-checksum.h @@ -41,6 +41,7 @@ #define _GNU_SOURCE 1 #include "dclib-types.h" +#include "lib-szs-file.h" #include "lib-ledis.h" #include "crypt.h" @@ -67,6 +68,8 @@ void CreateSSChecksumBySZS ( char *buf, uint bufsize, const szs_file_t *szs ); void CreateSSChecksumDB ( char *buf, uint bufsize, const sha1_size_hash_t *ss ); void CreateSSChecksumDBByData ( char *buf, uint bufsize, cvp data, uint size ); void CreateSSChecksumDBBySZS ( char *buf, uint bufsize, const szs_file_t *szs ); +void CreateSSXChecksumDBByData ( char *buf, uint bufsize, cvp data, uint size, file_format_t ff ); +void CreateSSXChecksumDBBySZS ( char *buf, uint bufsize, const szs_file_t *szs ); enumError GetSSByFile ( sha1_size_hash_t *ss, ccp path1, ccp path2 ); @@ -111,6 +114,43 @@ ParamFieldItem_t * StoreSZSCache // => true: file result->data exists ); +//----------------------------------------------------------------------------- +// [[check_cache_t]] + +typedef struct check_cache_t +{ + file_format_t fform; + bool found; // true, if file found in cache + char csum[CHECKSUM_DB_SIZE+4]; + // checksum with suffix + szs_file_t cache; // file loaded from cache, valid if found==true +} +check_cache_t; + +void ResetCheckCache ( check_cache_t *cc ); + +bool CheckSZSCache +( + // returns true if file found in cache (same as cc->found) + + check_cache_t *cc, // initialized by CheckSZSCache() + szs_file_t *szs, // related SZS file + cvp data, // data + uint size, // size of 'data' + file_format_t fform, // compression format + ccp ext // wanted file extension including leading '.' +); + +bool CheckSZSCacheSZS +( + // returns true if file found in cache (same as cc->found) + + szs_file_t *szs, // related SZS file + file_format_t fform, // compression format + ccp ext, // wanted file extension including leading '.' + bool rm_uncompressed // true: remove uncompressed data if cache is used +); + // /////////////////////////////////////////////////////////////////////////////// /////////////// END /////////////// |
