CMS 3D CMS Logo

7zFile.h
Go to the documentation of this file.
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 <cstdio>
15 #endif
16 
17 #include "Types.h"
18 
20 
21 /* ---------- File ---------- */
22 
23 typedef struct
24 {
25  #ifdef USE_WINDOWS_FILE
26  HANDLE handle;
27  #else
28  FILE *file;
29  #endif
30 } CSzFile;
31 
32 void File_Construct(CSzFile *p);
33 #if !defined(UNDER_CE) || !defined(USE_WINDOWS_FILE)
34 WRes InFile_Open(CSzFile *p, const char *name);
35 WRes OutFile_Open(CSzFile *p, const char *name);
36 #endif
37 #ifdef USE_WINDOWS_FILE
38 WRes InFile_OpenW(CSzFile *p, const WCHAR *name);
39 WRes OutFile_OpenW(CSzFile *p, const WCHAR *name);
40 #endif
42 
43 /* reads max(*size, remain file's size) bytes */
44 WRes File_Read(CSzFile *p, void *data, size_t *size);
45 
46 /* writes *size bytes */
47 WRes File_Write(CSzFile *p, const void *data, size_t *size);
48 
49 WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin);
51 
52 
53 /* ---------- FileInStream ---------- */
54 
55 typedef struct
56 {
60 
62 
63 
64 typedef struct
65 {
69 
71 
72 
73 typedef struct
74 {
78 
80 
82 
83 #endif
size
Write out results.
Definition: 7zFile.h:23
void File_Construct(CSzFile *p)
Definition: 7zFile.cc:28
unsigned long long int UInt64
Definition: Types.h:83
FILE * file
Definition: 7zFile.h:28
int WRes
Definition: Types.h:48
CSzFile file
Definition: 7zFile.h:58
void FileSeqInStream_CreateVTable(CFileSeqInStream *p)
Definition: 7zFile.cc:245
void FileOutStream_CreateVTable(CFileOutStream *p)
Definition: 7zFile.cc:281
WRes File_GetLength(CSzFile *p, UInt64 *length)
Definition: 7zFile.cc:210
CSzFile file
Definition: 7zFile.h:67
ISeqOutStream s
Definition: 7zFile.h:75
ESzSeek
Definition: Types.h:156
WRes File_Read(CSzFile *p, void *data, size_t *size)
Definition: 7zFile.cc:97
long long int Int64
Definition: Types.h:82
ISeekInStream s
Definition: 7zFile.h:66
WRes File_Close(CSzFile *p)
Definition: 7zFile.cc:76
void FileInStream_CreateVTable(CFileInStream *p)
Definition: 7zFile.cc:265
ISeqInStream s
Definition: 7zFile.h:57
WRes File_Write(CSzFile *p, const void *data, size_t *size)
Definition: 7zFile.cc:132
WRes OutFile_Open(CSzFile *p, const char *name)
Definition: 7zFile.cc:59
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
CSzFile file
Definition: 7zFile.h:76
WRes InFile_Open(CSzFile *p, const char *name)
Definition: 7zFile.cc:58
WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin)
Definition: 7zFile.cc:167
#define EXTERN_C_END
Definition: Types.h:19
#define EXTERN_C_BEGIN
Definition: Types.h:18