mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
- Virtual File System (VFS) by birdflu. This is needed for Multiplayer and is also used for Single Player. Very neat system :-) - Multiplayer Version 1.1 + some additional features and bugfixes * INFO: If you compile a new EXE and want to test, be sure to also use the latest SVN GameDir files in your JA2 install directory * git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2961 3b4a5df2-a311-0410-b5c6-a8a6f20db521
75 lines
1.3 KiB
C
75 lines
1.3 KiB
C
/* 7zFile.h -- File IO
|
|
2008-11-22 : Igor Pavlov : Public domain */
|
|
|
|
#ifndef __7Z_FILE_H
|
|
#define __7Z_FILE_H
|
|
|
|
#ifdef _WIN32
|
|
#define USE_WINDOWS_FILE
|
|
#endif
|
|
|
|
#ifdef USE_WINDOWS_FILE
|
|
#include <windows.h>
|
|
#else
|
|
#include <stdio.h>
|
|
#endif
|
|
|
|
#include "Types.h"
|
|
|
|
|
|
/* ---------- File ---------- */
|
|
|
|
typedef struct
|
|
{
|
|
#ifdef USE_WINDOWS_FILE
|
|
HANDLE handle;
|
|
#else
|
|
FILE *file;
|
|
#endif
|
|
} CSzFile;
|
|
|
|
void File_Construct(CSzFile *p);
|
|
WRes InFile_Open(CSzFile *p, const char *name);
|
|
WRes OutFile_Open(CSzFile *p, const char *name);
|
|
WRes File_Close(CSzFile *p);
|
|
|
|
/* reads max(*size, remain file's size) bytes */
|
|
WRes File_Read(CSzFile *p, void *data, size_t *size);
|
|
|
|
/* writes *size bytes */
|
|
WRes File_Write(CSzFile *p, const void *data, size_t *size);
|
|
|
|
WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin);
|
|
WRes File_GetLength(CSzFile *p, UInt64 *length);
|
|
|
|
|
|
/* ---------- FileInStream ---------- */
|
|
|
|
typedef struct
|
|
{
|
|
ISeqInStream s;
|
|
CSzFile file;
|
|
} CFileSeqInStream;
|
|
|
|
void FileSeqInStream_CreateVTable(CFileSeqInStream *p);
|
|
|
|
|
|
typedef struct
|
|
{
|
|
ISeekInStream s;
|
|
CSzFile file;
|
|
} CFileInStream;
|
|
|
|
void FileInStream_CreateVTable(CFileInStream *p);
|
|
|
|
|
|
typedef struct
|
|
{
|
|
ISeqOutStream s;
|
|
CSzFile file;
|
|
} CFileOutStream;
|
|
|
|
void FileOutStream_CreateVTable(CFileOutStream *p);
|
|
|
|
#endif
|