Lines Matching refs:sd

316 static SRes SzReadByte(CSzData *sd, Byte *b)  in SzReadByte()  argument
318 if (sd->Size == 0) in SzReadByte()
320 sd->Size--; in SzReadByte()
321 *b = *sd->Data++; in SzReadByte()
325 static SRes SzReadBytes(CSzData *sd, Byte *data, size_t size) in SzReadBytes() argument
330 RINOK(SzReadByte(sd, data + i)); in SzReadBytes()
335 static SRes SzReadUInt32(CSzData *sd, UInt32 *value) in SzReadUInt32() argument
342 RINOK(SzReadByte(sd, &b)); in SzReadUInt32()
348 static SRes SzReadNumber(CSzData *sd, UInt64 *value) in SzReadNumber() argument
353 RINOK(SzReadByte(sd, &firstByte)); in SzReadNumber()
364 RINOK(SzReadByte(sd, &b)); in SzReadNumber()
371 static SRes SzReadNumber32(CSzData *sd, UInt32 *value) in SzReadNumber32() argument
374 RINOK(SzReadNumber(sd, &value64)); in SzReadNumber32()
383 static SRes SzReadID(CSzData *sd, UInt64 *value) in SzReadID() argument
385 return SzReadNumber(sd, value); in SzReadID()
388 static SRes SzSkeepDataSize(CSzData *sd, UInt64 size) in SzSkeepDataSize() argument
390 if (size > sd->Size) in SzSkeepDataSize()
392 sd->Size -= (size_t)size; in SzSkeepDataSize()
393 sd->Data += (size_t)size; in SzSkeepDataSize()
397 static SRes SzSkeepData(CSzData *sd) in SzSkeepData() argument
400 RINOK(SzReadNumber(sd, &size)); in SzSkeepData()
401 return SzSkeepDataSize(sd, size); in SzSkeepData()
404 static SRes SzReadArchiveProperties(CSzData *sd) in SzReadArchiveProperties() argument
409 RINOK(SzReadID(sd, &type)); in SzReadArchiveProperties()
412 SzSkeepData(sd); in SzReadArchiveProperties()
417 static SRes SzWaitAttribute(CSzData *sd, UInt64 attribute) in SzWaitAttribute() argument
422 RINOK(SzReadID(sd, &type)); in SzWaitAttribute()
427 RINOK(SzSkeepData(sd)); in SzWaitAttribute()
431 static SRes SzReadBoolVector(CSzData *sd, size_t numItems, Byte **v, ISzAlloc *alloc) in SzReadBoolVector() argument
441 RINOK(SzReadByte(sd, &b)); in SzReadBoolVector()
450 static SRes SzReadBoolVector2(CSzData *sd, size_t numItems, Byte **v, ISzAlloc *alloc) in SzReadBoolVector2() argument
454 RINOK(SzReadByte(sd, &allAreDefined)); in SzReadBoolVector2()
456 return SzReadBoolVector(sd, numItems, v, alloc); in SzReadBoolVector2()
464 CSzData *sd, in SzReadHashDigests() argument
471 RINOK(SzReadBoolVector2(sd, numItems, digestsDefined, alloc)); in SzReadHashDigests()
476 RINOK(SzReadUInt32(sd, (*digests) + i)); in SzReadHashDigests()
482 CSzData *sd, in SzReadPackInfo() argument
491 RINOK(SzReadNumber(sd, dataOffset)); in SzReadPackInfo()
492 RINOK(SzReadNumber32(sd, numPackStreams)); in SzReadPackInfo()
494 RINOK(SzWaitAttribute(sd, k7zIdSize)); in SzReadPackInfo()
500 RINOK(SzReadNumber(sd, (*packSizes) + i)); in SzReadPackInfo()
506 RINOK(SzReadID(sd, &type)); in SzReadPackInfo()
511 RINOK(SzReadHashDigests(sd, (size_t)*numPackStreams, packCRCsDefined, packCRCs, alloc)); in SzReadPackInfo()
514 RINOK(SzSkeepData(sd)); in SzReadPackInfo()
529 static SRes SzReadSwitch(CSzData *sd) in SzReadSwitch() argument
532 RINOK(SzReadByte(sd, &external)); in SzReadSwitch()
536 static SRes SzGetNextFolderItem(CSzData *sd, CSzFolder *folder, ISzAlloc *alloc) in SzGetNextFolderItem() argument
541 RINOK(SzReadNumber32(sd, &numCoders)); in SzGetNextFolderItem()
558 RINOK(SzReadByte(sd, &mainByte)); in SzGetNextFolderItem()
560 RINOK(SzReadBytes(sd, longID, idSize)); in SzGetNextFolderItem()
569 RINOK(SzReadNumber32(sd, &coder->NumInStreams)); in SzGetNextFolderItem()
570 RINOK(SzReadNumber32(sd, &coder->NumOutStreams)); in SzGetNextFolderItem()
583 RINOK(SzReadNumber(sd, &propertiesSize)); in SzGetNextFolderItem()
586 RINOK(SzReadBytes(sd, coder->Props.data, (size_t)propertiesSize)); in SzGetNextFolderItem()
591 RINOK(SzReadByte(sd, &mainByte)); in SzGetNextFolderItem()
592 RINOK(SzSkeepDataSize(sd, (mainByte & 0xF))); in SzGetNextFolderItem()
596 RINOK(SzReadNumber32(sd, &n)); in SzGetNextFolderItem()
597 RINOK(SzReadNumber32(sd, &n)); in SzGetNextFolderItem()
602 RINOK(SzReadNumber(sd, &propertiesSize)); in SzGetNextFolderItem()
603 RINOK(SzSkeepDataSize(sd, propertiesSize)); in SzGetNextFolderItem()
619 RINOK(SzReadNumber32(sd, &bp->InIndex)); in SzGetNextFolderItem()
620 RINOK(SzReadNumber32(sd, &bp->OutIndex)); in SzGetNextFolderItem()
641 RINOK(SzReadNumber32(sd, folder->PackStreams + i)); in SzGetNextFolderItem()
647 CSzData *sd, in SzReadUnpackInfo() argument
654 RINOK(SzWaitAttribute(sd, k7zIdFolder)); in SzReadUnpackInfo()
655 RINOK(SzReadNumber32(sd, numFolders)); in SzReadUnpackInfo()
657 RINOK(SzReadSwitch(sd)); in SzReadUnpackInfo()
666 RINOK(SzGetNextFolderItem(sd, (*folders) + i, alloc)); in SzReadUnpackInfo()
670 RINOK(SzWaitAttribute(sd, k7zIdCodersUnpackSize)); in SzReadUnpackInfo()
682 RINOK(SzReadNumber(sd, folder->UnpackSizes + j)); in SzReadUnpackInfo()
689 RINOK(SzReadID(sd, &type)); in SzReadUnpackInfo()
697 res = SzReadHashDigests(sd, *numFolders, &crcsDefined, &crcs, allocTemp); in SzReadUnpackInfo()
712 RINOK(SzSkeepData(sd)); in SzReadUnpackInfo()
717 CSzData *sd, in SzReadSubStreamsInfo() argument
737 RINOK(SzReadID(sd, &type)); in SzReadSubStreamsInfo()
744 RINOK(SzReadNumber32(sd, &numStreams)); in SzReadSubStreamsInfo()
754 RINOK(SzSkeepData(sd)); in SzReadSubStreamsInfo()
788 RINOK(SzReadNumber(sd, &size)); in SzReadSubStreamsInfo()
796 RINOK(SzReadID(sd, &type)); in SzReadSubStreamsInfo()
822 SRes res = SzReadHashDigests(sd, numDigests, &digestsDefined2, &digests2, allocTemp); in SzReadSubStreamsInfo()
855 RINOK(SzSkeepData(sd)); in SzReadSubStreamsInfo()
857 RINOK(SzReadID(sd, &type)); in SzReadSubStreamsInfo()
863 CSzData *sd, in SzReadStreamsInfo() argument
876 RINOK(SzReadID(sd, &type)); in SzReadStreamsInfo()
885 RINOK(SzReadPackInfo(sd, dataOffset, &p->NumPackStreams, in SzReadStreamsInfo()
891 RINOK(SzReadUnpackInfo(sd, &p->NumFolders, &p->Folders, alloc, allocTemp)); in SzReadStreamsInfo()
896 RINOK(SzReadSubStreamsInfo(sd, p->NumFolders, p->Folders, in SzReadStreamsInfo()
942 CSzData *sd, in SzReadHeader2() argument
959 RINOK(SzReadID(sd, &type)); in SzReadHeader2()
963 RINOK(SzReadArchiveProperties(sd)); in SzReadHeader2()
964 RINOK(SzReadID(sd, &type)); in SzReadHeader2()
970 RINOK(SzReadStreamsInfo(sd, in SzReadHeader2()
978 RINOK(SzReadID(sd, &type)); in SzReadHeader2()
986 RINOK(SzReadNumber32(sd, &numFiles)); in SzReadHeader2()
999 RINOK(SzReadID(sd, &type)); in SzReadHeader2()
1002 RINOK(SzReadNumber(sd, &size)); in SzReadHeader2()
1003 if (size > sd->Size) in SzReadHeader2()
1007 RINOK(SzSkeepDataSize(sd, size)); in SzReadHeader2()
1015 RINOK(SzReadSwitch(sd)); in SzReadHeader2()
1022 memcpy(p->FileNames.data, sd->Data, namesSize); in SzReadHeader2()
1023 RINOK(SzReadFileNames(sd->Data, namesSize >> 1, numFiles, p->FileNameOffsets)) in SzReadHeader2()
1024 RINOK(SzSkeepDataSize(sd, namesSize)); in SzReadHeader2()
1029 RINOK(SzReadBoolVector(sd, numFiles, emptyStreamVector, allocTemp)); in SzReadHeader2()
1038 RINOK(SzReadBoolVector(sd, numEmptyStreams, emptyFileVector, allocTemp)); in SzReadHeader2()
1043 RINOK(SzReadBoolVector2(sd, numFiles, lwtVector, allocTemp)); in SzReadHeader2()
1044 RINOK(SzReadSwitch(sd)); in SzReadHeader2()
1053 RINOK(SzReadUInt32(sd, &f->Attrib)); in SzReadHeader2()
1062 RINOK(SzReadBoolVector2(sd, numFiles, lwtVector, allocTemp)); in SzReadHeader2()
1063 RINOK(SzReadSwitch(sd)); in SzReadHeader2()
1072 RINOK(SzReadUInt32(sd, &f->MTime.Low)); in SzReadHeader2()
1073 RINOK(SzReadUInt32(sd, &f->MTime.High)); in SzReadHeader2()
1082 RINOK(SzSkeepDataSize(sd, size)); in SzReadHeader2()
1124 CSzData *sd, in SzReadHeader() argument
1134 SRes res = SzReadHeader2(p, sd, in SzReadHeader()
1149 CSzData *sd, in SzReadAndDecodePackedStreams2() argument
1165 RINOK(SzReadStreamsInfo(sd, &dataStartPos, p, in SzReadAndDecodePackedStreams2()
1193 CSzData *sd, in SzReadAndDecodePackedStreams() argument
1204 res = SzReadAndDecodePackedStreams2(inStream, sd, outBuffer, baseOffset, in SzReadAndDecodePackedStreams()
1276 CSzData sd; in SzArEx_Open2() local
1278 sd.Data = buffer.data; in SzArEx_Open2()
1279 sd.Size = buffer.size; in SzArEx_Open2()
1280 res = SzReadID(&sd, &type); in SzArEx_Open2()
1287 … res = SzReadAndDecodePackedStreams(inStream, &sd, &outBuffer, p->startPosAfterHeader, allocTemp); in SzArEx_Open2()
1295 sd.Data = buffer.data; in SzArEx_Open2()
1296 sd.Size = buffer.size; in SzArEx_Open2()
1297 res = SzReadID(&sd, &type); in SzArEx_Open2()
1304 res = SzReadHeader(p, &sd, allocMain, allocTemp); in SzArEx_Open2()