RetroArch
Classes | Macros | Typedefs | Functions | Variables
7zIn.c File Reference
#include <stdint.h>
#include <string.h>
#include "7z.h"
#include "7zCrc.h"
#include "CpuArch.h"
Include dependency graph for 7zIn.c:

Classes

struct  _CSzState
 

Macros

#define RINOM(x)   { if ((x) == 0) return SZ_ERROR_MEM; }
 
#define NUM_FOLDER_CODERS_MAX   32
 
#define NUM_CODER_STREAMS_MAX   32
 
#define MY_ALLOC(T, p, size, alloc)
 

Typedefs

typedef struct _CSzState CSzData
 

Functions

void SzFolder_Free (CSzFolder *p, ISzAlloc *alloc)
 
int SzFolder_FindBindPairForOutStream (CSzFolder *p, uint32_t outStreamIndex)
 
void SzCoderInfo_Init (CSzCoderInfo *p)
 
void SzCoderInfo_Free (CSzCoderInfo *p, ISzAlloc *alloc)
 
void SzFolder_Init (CSzFolder *p)
 
uint32_t SzFolder_GetNumOutStreams (CSzFolder *p)
 
int SzFolder_FindBindPairForInStream (CSzFolder *p, uint32_t inStreamIndex)
 
uint64_t SzFolder_GetUnpackSize (CSzFolder *p)
 
void SzFile_Init (CSzFileItem *p)
 
void SzAr_Init (CSzAr *p)
 
void SzAr_Free (CSzAr *p, ISzAlloc *alloc)
 
void SzArEx_Init (CSzArEx *p)
 
void SzArEx_Free (CSzArEx *p, ISzAlloc *alloc)
 
static SRes SzArEx_Fill (CSzArEx *p, ISzAlloc *alloc)
 
uint64_t SzArEx_GetFolderStreamPos (const CSzArEx *p, uint32_t folderIndex, uint32_t indexInFolder)
 
int SzArEx_GetFolderFullPackSize (const CSzArEx *p, uint32_t folderIndex, uint64_t *resSize)
 
static int TestSignatureCandidate (uint8_t *testuint8_ts)
 
static SRes SzReaduint8_t (CSzData *sd, uint8_t *b)
 
static SRes SzReaduint8_ts (CSzData *sd, uint8_t *data, size_t size)
 
static SRes SzReaduint32_t (CSzData *sd, uint32_t *value)
 
static SRes SzReadNumber (CSzData *sd, uint64_t *value)
 
static SRes SzReadNumber32 (CSzData *sd, uint32_t *value)
 
static SRes SzReadID (CSzData *sd, uint64_t *value)
 
static SRes SzSkeepDataSize (CSzData *sd, uint64_t size)
 
static SRes SzSkeepData (CSzData *sd)
 
static SRes SzReadArchiveProperties (CSzData *sd)
 
static SRes SzWaitAttribute (CSzData *sd, uint64_t attribute)
 
static SRes SzReadBoolVector (CSzData *sd, size_t numItems, uint8_t **v, ISzAlloc *alloc)
 
static SRes SzReadBoolVector2 (CSzData *sd, size_t numItems, uint8_t **v, ISzAlloc *alloc)
 
static SRes SzReadHashDigests (CSzData *sd, size_t numItems, uint8_t **digestsDefined, uint32_t **digests, ISzAlloc *alloc)
 
static SRes SzReadPackInfo (CSzData *sd, uint64_t *dataOffset, uint32_t *numPackStreams, uint64_t **packSizes, uint8_t **packCRCsDefined, uint32_t **packCRCs, ISzAlloc *alloc)
 
static SRes SzReadSwitch (CSzData *sd)
 
static SRes SzGetNextFolderItem (CSzData *sd, CSzFolder *folder, ISzAlloc *alloc)
 
static SRes SzReadUnpackInfo (CSzData *sd, uint32_t *numFolders, CSzFolder **folders, ISzAlloc *alloc, ISzAlloc *allocTemp)
 
static SRes SzReadSubStreamsInfo (CSzData *sd, uint32_t numFolders, CSzFolder *folders, uint32_t *numUnpackStreams, uint64_t **unpackSizes, uint8_t **digestsDefined, uint32_t **digests, ISzAlloc *allocTemp)
 
static SRes SzReadStreamsInfo (CSzData *sd, uint64_t *dataOffset, CSzAr *p, uint32_t *numUnpackStreams, uint64_t **unpackSizes, uint8_t **digestsDefined, uint32_t **digests, ISzAlloc *alloc, ISzAlloc *allocTemp)
 
size_t SzArEx_GetFileNameUtf16 (const CSzArEx *p, size_t fileIndex, uint16_t *dest)
 
static SRes SzReadFileNames (const uint8_t *p, size_t size, uint32_t numFiles, size_t *sizes)
 
static SRes SzReadHeader2 (CSzArEx *p, CSzData *sd, uint64_t **unpackSizes, uint8_t **digestsDefined, uint32_t **digests, uint8_t **emptyStreamVector, uint8_t **emptyFileVector, uint8_t **lwtVector, ISzAlloc *allocMain, ISzAlloc *allocTemp)
 
static SRes SzReadHeader (CSzArEx *p, CSzData *sd, ISzAlloc *allocMain, ISzAlloc *allocTemp)
 
static SRes SzReadAndDecodePackedStreams2 (ILookInStream *inStream, CSzData *sd, CBuf *outBuffer, uint64_t baseOffset, CSzAr *p, uint64_t **unpackSizes, uint8_t **digestsDefined, uint32_t **digests, ISzAlloc *allocTemp)
 
static SRes SzReadAndDecodePackedStreams (ILookInStream *inStream, CSzData *sd, CBuf *outBuffer, uint64_t baseOffset, ISzAlloc *allocTemp)
 
static SRes SzArEx_Open2 (CSzArEx *p, ILookInStream *inStream, ISzAlloc *allocMain, ISzAlloc *allocTemp)
 
SRes SzArEx_Open (CSzArEx *p, ILookInStream *inStream, ISzAlloc *allocMain, ISzAlloc *allocTemp)
 
SRes SzArEx_Extract (const CSzArEx *p, ILookInStream *inStream, uint32_t fileIndex, uint32_t *blockIndex, uint8_t **outBuffer, size_t *outBufferSize, size_t *offset, size_t *outSizeProcessed, ISzAlloc *allocMain, ISzAlloc *allocTemp)
 

Variables

uint8_t k7zSignature [k7zSignatureSize] = {'7', 'z', 0xBC, 0xAF, 0x27, 0x1C}
 

Macro Definition Documentation

◆ MY_ALLOC

#define MY_ALLOC (   T,
  p,
  size,
  alloc 
)
Value:
{ if ((size) == 0) p = 0; else \
if ((p = (T *)IAlloc_Alloc(alloc, (size) * sizeof(T))) == 0) return SZ_ERROR_MEM; }
#define T(x)
return
Definition: irq.c:321
GLsizeiptr size
Definition: glext.h:6559
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d &reg2 endm macro vzip8 reg2 vzip d d &reg2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld [DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld if[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp local skip1(dst_w_bpp<=(lowbit *8)) &&((lowbit *8)<(pixblock_size *dst_w_bpp)) .if lowbit< 16 tst DST_R
Definition: pixman-arm-neon-asm.h:469
#define IAlloc_Alloc(p, size)
Definition: 7zTypes.h:168
GLfloat GLfloat p
Definition: glext.h:9809
#define SZ_ERROR_MEM
Definition: 7zTypes.h:29

◆ NUM_CODER_STREAMS_MAX

#define NUM_CODER_STREAMS_MAX   32

◆ NUM_FOLDER_CODERS_MAX

#define NUM_FOLDER_CODERS_MAX   32

◆ RINOM

#define RINOM (   x)    { if ((x) == 0) return SZ_ERROR_MEM; }

Typedef Documentation

◆ CSzData

typedef struct _CSzState CSzData

Function Documentation

◆ SzAr_Free()

void SzAr_Free ( CSzAr *  p,
ISzAlloc *  alloc 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzAr_Init()

void SzAr_Init ( CSzAr *  p)
Here is the caller graph for this function:

◆ SzArEx_Extract()

SRes SzArEx_Extract ( const CSzArEx *  p,
ILookInStream *  inStream,
uint32_t  fileIndex,
uint32_t *  blockIndex,
uint8_t **  outBuffer,
size_t *  outBufferSize,
size_t *  offset,
size_t *  outSizeProcessed,
ISzAlloc *  allocMain,
ISzAlloc *  allocTemp 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzArEx_Fill()

static SRes SzArEx_Fill ( CSzArEx *  p,
ISzAlloc *  alloc 
)
static
Here is the caller graph for this function:

◆ SzArEx_Free()

void SzArEx_Free ( CSzArEx *  p,
ISzAlloc *  alloc 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzArEx_GetFileNameUtf16()

size_t SzArEx_GetFileNameUtf16 ( const CSzArEx *  p,
size_t  fileIndex,
uint16_t *  dest 
)
Here is the caller graph for this function:

◆ SzArEx_GetFolderFullPackSize()

int SzArEx_GetFolderFullPackSize ( const CSzArEx *  p,
uint32_t  folderIndex,
uint64_t *  resSize 
)

◆ SzArEx_GetFolderStreamPos()

uint64_t SzArEx_GetFolderStreamPos ( const CSzArEx *  p,
uint32_t  folderIndex,
uint32_t  indexInFolder 
)
Here is the caller graph for this function:

◆ SzArEx_Init()

void SzArEx_Init ( CSzArEx *  p)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzArEx_Open()

SRes SzArEx_Open ( CSzArEx *  p,
ILookInStream *  inStream,
ISzAlloc *  allocMain,
ISzAlloc *  allocTemp 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzArEx_Open2()

static SRes SzArEx_Open2 ( CSzArEx *  p,
ILookInStream *  inStream,
ISzAlloc *  allocMain,
ISzAlloc *  allocTemp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzCoderInfo_Free()

void SzCoderInfo_Free ( CSzCoderInfo *  p,
ISzAlloc *  alloc 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzCoderInfo_Init()

void SzCoderInfo_Init ( CSzCoderInfo *  p)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzFile_Init()

void SzFile_Init ( CSzFileItem *  p)
Here is the caller graph for this function:

◆ SzFolder_FindBindPairForInStream()

int SzFolder_FindBindPairForInStream ( CSzFolder *  p,
uint32_t  inStreamIndex 
)
Here is the caller graph for this function:

◆ SzFolder_FindBindPairForOutStream()

int SzFolder_FindBindPairForOutStream ( CSzFolder *  p,
uint32_t  outStreamIndex 
)
Here is the caller graph for this function:

◆ SzFolder_Free()

void SzFolder_Free ( CSzFolder *  p,
ISzAlloc *  alloc 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzFolder_GetNumOutStreams()

uint32_t SzFolder_GetNumOutStreams ( CSzFolder *  p)
Here is the caller graph for this function:

◆ SzFolder_GetUnpackSize()

uint64_t SzFolder_GetUnpackSize ( CSzFolder *  p)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzFolder_Init()

void SzFolder_Init ( CSzFolder *  p)
Here is the caller graph for this function:

◆ SzGetNextFolderItem()

static SRes SzGetNextFolderItem ( CSzData *  sd,
CSzFolder *  folder,
ISzAlloc *  alloc 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzReadAndDecodePackedStreams()

static SRes SzReadAndDecodePackedStreams ( ILookInStream *  inStream,
CSzData *  sd,
CBuf *  outBuffer,
uint64_t  baseOffset,
ISzAlloc *  allocTemp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzReadAndDecodePackedStreams2()

static SRes SzReadAndDecodePackedStreams2 ( ILookInStream *  inStream,
CSzData *  sd,
CBuf *  outBuffer,
uint64_t  baseOffset,
CSzAr *  p,
uint64_t **  unpackSizes,
uint8_t **  digestsDefined,
uint32_t **  digests,
ISzAlloc *  allocTemp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzReadArchiveProperties()

static SRes SzReadArchiveProperties ( CSzData *  sd)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzReadBoolVector()

static SRes SzReadBoolVector ( CSzData *  sd,
size_t  numItems,
uint8_t **  v,
ISzAlloc *  alloc 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzReadBoolVector2()

static SRes SzReadBoolVector2 ( CSzData *  sd,
size_t  numItems,
uint8_t **  v,
ISzAlloc *  alloc 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzReadFileNames()

static SRes SzReadFileNames ( const uint8_t *  p,
size_t  size,
uint32_t  numFiles,
size_t *  sizes 
)
static
Here is the caller graph for this function:

◆ SzReadHashDigests()

static SRes SzReadHashDigests ( CSzData *  sd,
size_t  numItems,
uint8_t **  digestsDefined,
uint32_t **  digests,
ISzAlloc *  alloc 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzReadHeader()

static SRes SzReadHeader ( CSzArEx *  p,
CSzData *  sd,
ISzAlloc *  allocMain,
ISzAlloc *  allocTemp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzReadHeader2()

static SRes SzReadHeader2 ( CSzArEx *  p,
CSzData *  sd,
uint64_t **  unpackSizes,
uint8_t **  digestsDefined,
uint32_t **  digests,
uint8_t **  emptyStreamVector,
uint8_t **  emptyFileVector,
uint8_t **  lwtVector,
ISzAlloc *  allocMain,
ISzAlloc *  allocTemp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzReadID()

static SRes SzReadID ( CSzData *  sd,
uint64_t *  value 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzReadNumber()

static SRes SzReadNumber ( CSzData *  sd,
uint64_t *  value 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzReadNumber32()

static SRes SzReadNumber32 ( CSzData *  sd,
uint32_t *  value 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzReadPackInfo()

static SRes SzReadPackInfo ( CSzData *  sd,
uint64_t *  dataOffset,
uint32_t *  numPackStreams,
uint64_t **  packSizes,
uint8_t **  packCRCsDefined,
uint32_t **  packCRCs,
ISzAlloc *  alloc 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzReadStreamsInfo()

static SRes SzReadStreamsInfo ( CSzData *  sd,
uint64_t *  dataOffset,
CSzAr *  p,
uint32_t *  numUnpackStreams,
uint64_t **  unpackSizes,
uint8_t **  digestsDefined,
uint32_t **  digests,
ISzAlloc *  alloc,
ISzAlloc *  allocTemp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzReadSubStreamsInfo()

static SRes SzReadSubStreamsInfo ( CSzData *  sd,
uint32_t  numFolders,
CSzFolder *  folders,
uint32_t *  numUnpackStreams,
uint64_t **  unpackSizes,
uint8_t **  digestsDefined,
uint32_t **  digests,
ISzAlloc *  allocTemp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzReadSwitch()

static SRes SzReadSwitch ( CSzData *  sd)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzReaduint32_t()

static SRes SzReaduint32_t ( CSzData *  sd,
uint32_t *  value 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzReaduint8_t()

static SRes SzReaduint8_t ( CSzData *  sd,
uint8_t *  b 
)
static
Here is the caller graph for this function:

◆ SzReaduint8_ts()

static SRes SzReaduint8_ts ( CSzData *  sd,
uint8_t *  data,
size_t  size 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzReadUnpackInfo()

static SRes SzReadUnpackInfo ( CSzData *  sd,
uint32_t *  numFolders,
CSzFolder **  folders,
ISzAlloc *  alloc,
ISzAlloc *  allocTemp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzSkeepData()

static SRes SzSkeepData ( CSzData *  sd)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SzSkeepDataSize()

static SRes SzSkeepDataSize ( CSzData *  sd,
uint64_t  size 
)
static
Here is the caller graph for this function:

◆ SzWaitAttribute()

static SRes SzWaitAttribute ( CSzData *  sd,
uint64_t  attribute 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ TestSignatureCandidate()

static int TestSignatureCandidate ( uint8_t *  testuint8_ts)
static
Here is the caller graph for this function:

Variable Documentation

◆ k7zSignature

uint8_t k7zSignature[k7zSignatureSize] = {'7', 'z', 0xBC, 0xAF, 0x27, 0x1C}