7zIn.h 1.6 KB

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