MCPcopy Create free account
hub / github.com/comaps/comaps / MBS_ReadHeader

Function MBS_ReadHeader

3party/bsdiff-courgette/bsdiff/bsdiff_common.h:46–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44
45template <typename Source>
46BSDiffStatus MBS_ReadHeader(Source & src, MBSPatchHeader* header) {
47 src.Read(header->tag, sizeof(header->tag));
48 header->slen = ReadVarUint<uint32_t>(src);
49 header->scrc32 = ReadVarUint<uint32_t>(src);
50 header->dlen = ReadVarUint<uint32_t>(src);
51
52 // The string will have a NUL terminator that we don't use, hence '-1'.
53 static_assert(sizeof(MBS_PATCH_HEADER_TAG) - 1 == sizeof(header->tag),
54 "MBS_PATCH_HEADER_TAG must match header field size");
55 if (memcmp(header->tag, MBS_PATCH_HEADER_TAG, 8) != 0)
56 return UNEXPECTED_ERROR;
57
58 return OK;
59}
60
61inline std::string DebugPrint(BSDiffStatus status) {
62 switch (status) {

Callers 1

ApplyBinaryPatchFunction · 0.85

Calls 1

ReadMethod · 0.45

Tested by

no test coverage detected