MCPcopy Create free account
hub / github.com/audacity/audacity / zipfileReadCDS

Function zipfileReadCDS

lib-src/sqlite/shell.c:6472–6500  ·  view source on GitHub ↗

** Decode the CDS record in buffer aBuf into (*pCDS). Return SQLITE_ERROR ** if the record is not well-formed, or SQLITE_OK otherwise. */

Source from the content-addressed store, hash-verified

6470** if the record is not well-formed, or SQLITE_OK otherwise.
6471*/
6472static int zipfileReadCDS(u8 *aBuf, ZipfileCDS *pCDS){
6473 u8 *aRead = aBuf;
6474 u32 sig = zipfileRead32(aRead);
6475 int rc = SQLITE_OK;
6476 if( sig!=ZIPFILE_SIGNATURE_CDS ){
6477 rc = SQLITE_ERROR;
6478 }else{
6479 pCDS->iVersionMadeBy = zipfileRead16(aRead);
6480 pCDS->iVersionExtract = zipfileRead16(aRead);
6481 pCDS->flags = zipfileRead16(aRead);
6482 pCDS->iCompression = zipfileRead16(aRead);
6483 pCDS->mTime = zipfileRead16(aRead);
6484 pCDS->mDate = zipfileRead16(aRead);
6485 pCDS->crc32 = zipfileRead32(aRead);
6486 pCDS->szCompressed = zipfileRead32(aRead);
6487 pCDS->szUncompressed = zipfileRead32(aRead);
6488 assert( aRead==&aBuf[ZIPFILE_CDS_NFILE_OFF] );
6489 pCDS->nFile = zipfileRead16(aRead);
6490 pCDS->nExtra = zipfileRead16(aRead);
6491 pCDS->nComment = zipfileRead16(aRead);
6492 pCDS->iDiskStart = zipfileRead16(aRead);
6493 pCDS->iInternalAttr = zipfileRead16(aRead);
6494 pCDS->iExternalAttr = zipfileRead32(aRead);
6495 pCDS->iOffset = zipfileRead32(aRead);
6496 assert( aRead==&aBuf[ZIPFILE_CDS_FIXED_SZ] );
6497 }
6498
6499 return rc;
6500}
6501
6502/*
6503** Decode the LFH record in buffer aBuf into (*pLFH). Return SQLITE_ERROR

Callers 1

zipfileGetEntryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected