summaryrefslogtreecommitdiffstats
path: root/src/cc4group.c
diff options
context:
space:
mode:
authorMarkus Mittendrein <git@maxmitti.tk>2020-04-30 17:39:24 +0200
committerMarkus Mittendrein <git@maxmitti.tk>2020-04-30 17:39:24 +0200
commite04dc6ded7c3ca015095f7826aeb63804624abed (patch)
tree6469f72a98b5ae5b8f00c873eca5874f0bf574b5 /src/cc4group.c
parent5876cbb5f465490d5c3f7cb310f04efde093c896 (diff)
downloadcc4group-e04dc6ded7c3ca015095f7826aeb63804624abed.tar.gz
cc4group-e04dc6ded7c3ca015095f7826aeb63804624abed.zip
Add crc to CC4Group_EntryInfo
Diffstat (limited to 'src/cc4group.c')
-rw-r--r--src/cc4group.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/cc4group.c b/src/cc4group.c
index bd0ea1a..0435c72 100644
--- a/src/cc4group.c
+++ b/src/cc4group.c
@@ -3089,6 +3089,20 @@ static bool cc4group_getEntryInfoForEntry(CC4Group* const this, const C4GroupEnt
}
}
+ uint32_t crc = entry->core.CRC;
+ if(entry->core.HasCRC != C4GroupEntryCore_ContentsFileNameCRC)
+ {
+ if(lazy)
+ {
+ crc = 0;
+ }
+ else
+ {
+ cc4group_calculateEntryCRC(this, (C4GroupEntryData*)entry);
+ crc = entry->core.CRC;
+ }
+ }
+
C4GroupHeader* headerOrParentHeader = header != NULL ? header : entry->parent != NULL ? entry->parent->header : NULL;
*info = (CC4Group_EntryInfo){
@@ -3099,7 +3113,8 @@ static bool cc4group_getEntryInfoForEntry(CC4Group* const this, const C4GroupEnt
.totalSize = entry->core.Size,
.executable = entry->core.Executable ? true : false,
.directory = entry->core.Directory ? true : false,
- .official = headerOrParentHeader != NULL ? C4GroupHeader_isOfficial(headerOrParentHeader) : false
+ .official = headerOrParentHeader != NULL ? C4GroupHeader_isOfficial(headerOrParentHeader) : false,
+ .crc = crc
};
return true;