"Fossies" - the Fresh Open Source Software Archive

Member "clamav-0.102.3/libclamav/7z/7zFile.h" (12 May 2020, 1459 Bytes) of package /linux/misc/clamav-0.102.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "7zFile.h" see the Fossies "Dox" file reference documentation.

    1 /* 7zFile.h -- File IO
    2 2009-11-24 : Igor Pavlov : Public domain */
    3 
    4 #ifndef __7Z_FILE_H
    5 #define __7Z_FILE_H
    6 
    7 #ifdef _WIN32
    8 #define USE_WINDOWS_FILE
    9 #endif
   10 
   11 #ifdef USE_WINDOWS_FILE
   12 #include <windows.h>
   13 #else
   14 #include <stdio.h>
   15 #endif
   16 
   17 #include "Types.h"
   18 
   19 EXTERN_C_BEGIN
   20 
   21 /* ---------- File ---------- */
   22 
   23 typedef struct
   24 {
   25 #ifdef USE_WINDOWS_FILE
   26   HANDLE handle;
   27 #else
   28   FILE *file;
   29 #endif
   30     fmap_t *fmap;
   31 } CSzFile;
   32 
   33 void File_Construct(CSzFile *p);
   34 #if !defined(UNDER_CE) || !defined(USE_WINDOWS_FILE)
   35 WRes InFile_Open(CSzFile *p, const char *name);
   36 WRes OutFile_Open(CSzFile *p, const char *name);
   37 #endif
   38 #ifdef USE_WINDOWS_FILE
   39 WRes InFile_OpenW(CSzFile *p, const WCHAR *name);
   40 WRes OutFile_OpenW(CSzFile *p, const WCHAR *name);
   41 #endif
   42 WRes File_Close(CSzFile *p);
   43 
   44 /* reads max(*size, remain file's size) bytes */
   45 WRes File_Read(CSzFile *p, void *data, size_t *size);
   46 
   47 /* writes *size bytes */
   48 WRes File_Write(CSzFile *p, const void *data, size_t *size);
   49 
   50 WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin);
   51 
   52 
   53 /* ---------- FileInStream ---------- */
   54 
   55 typedef struct
   56 {
   57   ISeqInStream s;
   58   CSzFile file;
   59 } CFileSeqInStream;
   60 
   61 void FileSeqInStream_CreateVTable(CFileSeqInStream *p);
   62 
   63 
   64 typedef struct
   65 {
   66   ISeekInStream s;
   67   CSzFile file;
   68 } CFileInStream;
   69 
   70 void FileInStream_CreateVTable(CFileInStream *p);
   71 
   72 
   73 typedef struct
   74 {
   75   ISeqOutStream s;
   76   CSzFile file;
   77 } CFileOutStream;
   78 
   79 void FileOutStream_CreateVTable(CFileOutStream *p);
   80 
   81 EXTERN_C_END
   82 
   83 #endif