|
1 /* 7zIn.h */ |
|
2 |
|
3 #ifndef __7Z_IN_H |
|
4 #define __7Z_IN_H |
|
5 |
|
6 #include "7zHeader.h" |
|
7 #include "7zItem.h" |
|
8 #include "7zAlloc.h" |
|
9 |
|
10 typedef struct _CInArchiveInfo |
|
11 { |
|
12 CFileSize StartPositionAfterHeader; |
|
13 CFileSize DataStartPosition; |
|
14 }CInArchiveInfo; |
|
15 |
|
16 typedef struct _CArchiveDatabaseEx |
|
17 { |
|
18 CArchiveDatabase Database; |
|
19 CInArchiveInfo ArchiveInfo; |
|
20 UInt32 *FolderStartPackStreamIndex; |
|
21 CFileSize *PackStreamStartPositions; |
|
22 UInt32 *FolderStartFileIndex; |
|
23 UInt32 *FileIndexToFolderIndexMap; |
|
24 }CArchiveDatabaseEx; |
|
25 |
|
26 void SzArDbExInit(CArchiveDatabaseEx *db); |
|
27 void SzArDbExFree(CArchiveDatabaseEx *db, void (*freeFunc)(void *)); |
|
28 CFileSize SzArDbGetFolderStreamPos(CArchiveDatabaseEx *db, UInt32 folderIndex, UInt32 indexInFolder); |
|
29 int SzArDbGetFolderFullPackSize(CArchiveDatabaseEx *db, UInt32 folderIndex, CFileSize *resSize); |
|
30 |
|
31 typedef struct _ISzInStream |
|
32 { |
|
33 #ifdef _LZMA_IN_CB |
|
34 SZ_RESULT (*Read)( |
|
35 void *object, /* pointer to ISzInStream itself */ |
|
36 void **buffer, /* out: pointer to buffer with data */ |
|
37 size_t maxRequiredSize, /* max required size to read */ |
|
38 size_t *processedSize); /* real processed size. |
|
39 processedSize can be less than maxRequiredSize. |
|
40 If processedSize == 0, then there are no more |
|
41 bytes in stream. */ |
|
42 #else |
|
43 SZ_RESULT (*Read)(void *object, void *buffer, size_t size, size_t *processedSize); |
|
44 #endif |
|
45 SZ_RESULT (*Seek)(void *object, CFileSize pos); |
|
46 } ISzInStream; |
|
47 |
|
48 |
|
49 int SzArchiveOpen( |
|
50 ISzInStream *inStream, |
|
51 CArchiveDatabaseEx *db, |
|
52 ISzAlloc *allocMain, |
|
53 ISzAlloc *allocTemp); |
|
54 |
|
55 #endif |