CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Macros | Typedefs | Enumerations | Functions
Types.h File Reference
#include <stddef.h>

Go to the source code of this file.

Classes

struct  CLookToRead
 
struct  CSecToLook
 
struct  CSecToRead
 
struct  IByteIn
 
struct  IByteOut
 
struct  ICompressProgress
 
struct  ILookInStream
 
struct  ISeekInStream
 
struct  ISeqInStream
 
struct  ISeqOutStream
 
struct  ISzAlloc
 

Macros

#define CHAR_PATH_SEPARATOR   '/'
 
#define EXTERN_C_BEGIN
 
#define EXTERN_C_END
 
#define False   0
 
#define IAlloc_Alloc(p, size)   (p)->Alloc((p), size)
 
#define IAlloc_Free(p, a)   (p)->Free((p), a)
 
#define LookToRead_BUF_SIZE   (1 << 14)
 
#define MY_CDECL
 
#define MY_FAST_CALL
 
#define MY_STD_CALL
 
#define RINOK(x)   { int __result__ = (x); if (__result__ != 0) return __result__; }
 
#define STRING_PATH_SEPARATOR   "/"
 
#define SZ_ERROR_ARCHIVE   16
 
#define SZ_ERROR_CRC   3
 
#define SZ_ERROR_DATA   1
 
#define SZ_ERROR_FAIL   11
 
#define SZ_ERROR_INPUT_EOF   6
 
#define SZ_ERROR_MEM   2
 
#define SZ_ERROR_NO_ARCHIVE   17
 
#define SZ_ERROR_OUTPUT_EOF   7
 
#define SZ_ERROR_PARAM   5
 
#define SZ_ERROR_PROGRESS   10
 
#define SZ_ERROR_READ   8
 
#define SZ_ERROR_THREAD   12
 
#define SZ_ERROR_UNSUPPORTED   4
 
#define SZ_ERROR_WRITE   9
 
#define SZ_OK   0
 
#define True   1
 
#define UINT64_CONST(n)   n ## ULL
 
#define WCHAR_PATH_SEPARATOR   L'/'
 
#define WSTRING_PATH_SEPARATOR   L"/"
 

Typedefs

typedef int Bool
 
typedef unsigned char Byte
 
typedef short Int16
 
typedef int Int32
 
typedef long long int Int64
 
typedef size_t SizeT
 
typedef int SRes
 
typedef unsigned short UInt16
 
typedef unsigned int UInt32
 
typedef unsigned long long int UInt64
 
typedef int WRes
 

Enumerations

enum  ESzSeek { SZ_SEEK_SET = 0, SZ_SEEK_CUR = 1, SZ_SEEK_END = 2 }
 

Functions

SRes LookInStream_LookRead (ILookInStream *stream, void *buf, size_t *size)
 
SRes LookInStream_Read (ILookInStream *stream, void *buf, size_t size)
 
SRes LookInStream_Read2 (ILookInStream *stream, void *buf, size_t size, SRes errorType)
 
SRes LookInStream_SeekTo (ILookInStream *stream, UInt64 offset)
 
void LookToRead_CreateVTable (CLookToRead *p, int lookahead)
 
void LookToRead_Init (CLookToRead *p)
 
void SecToLook_CreateVTable (CSecToLook *p)
 
void SecToRead_CreateVTable (CSecToRead *p)
 
SRes SeqInStream_Read (ISeqInStream *stream, void *buf, size_t size)
 
SRes SeqInStream_Read2 (ISeqInStream *stream, void *buf, size_t size, SRes errorType)
 
SRes SeqInStream_ReadByte (ISeqInStream *stream, Byte *buf)
 

Macro Definition Documentation

#define CHAR_PATH_SEPARATOR   '/'

Definition at line 245 of file Types.h.

#define EXTERN_C_BEGIN

Definition at line 18 of file Types.h.

#define EXTERN_C_END

Definition at line 19 of file Types.h.

#define False   0

Definition at line 97 of file Types.h.

#define IAlloc_Alloc (   p,
  size 
)    (p)->Alloc((p), size)

Definition at line 233 of file Types.h.

#define IAlloc_Free (   p,
  a 
)    (p)->Free((p), a)

Definition at line 234 of file Types.h.

#define LookToRead_BUF_SIZE   (1 << 14)

Definition at line 190 of file Types.h.

Referenced by LookToRead_Look_Exact(), and LookToRead_Look_Lookahead().

#define MY_CDECL

Definition at line 119 of file Types.h.

#define MY_FAST_CALL

Definition at line 120 of file Types.h.

#define MY_STD_CALL

Definition at line 103 of file Types.h.

#define RINOK (   x)    { int __result__ = (x); if (__result__ != 0) return __result__; }
#define STRING_PATH_SEPARATOR   "/"

Definition at line 247 of file Types.h.

#define SZ_ERROR_ARCHIVE   16

Definition at line 40 of file Types.h.

#define SZ_ERROR_CRC   3

Definition at line 29 of file Types.h.

#define SZ_ERROR_DATA   1
#define SZ_ERROR_FAIL   11

Definition at line 37 of file Types.h.

#define SZ_ERROR_INPUT_EOF   6

Definition at line 32 of file Types.h.

Referenced by LookInStream_Read(), LzmaDecode(), SeqInStream_Read(), and SeqInStream_ReadByte().

#define SZ_ERROR_MEM   2

Definition at line 28 of file Types.h.

Referenced by LzmaDec_Allocate(), LzmaDec_AllocateProbs2(), and main().

#define SZ_ERROR_NO_ARCHIVE   17

Definition at line 41 of file Types.h.

#define SZ_ERROR_OUTPUT_EOF   7

Definition at line 33 of file Types.h.

#define SZ_ERROR_PARAM   5

Definition at line 31 of file Types.h.

#define SZ_ERROR_PROGRESS   10

Definition at line 36 of file Types.h.

#define SZ_ERROR_READ   8

Definition at line 34 of file Types.h.

Referenced by FileInStream_Read(), FileSeqInStream_Read(), and main().

#define SZ_ERROR_THREAD   12

Definition at line 38 of file Types.h.

#define SZ_ERROR_UNSUPPORTED   4

Definition at line 30 of file Types.h.

Referenced by LzmaProps_Decode().

#define SZ_ERROR_WRITE   9

Definition at line 35 of file Types.h.

Referenced by main().

#define SZ_OK   0
#define True   1

Definition at line 96 of file Types.h.

Referenced by LzmaDec_Init().

#define UINT64_CONST (   n)    n ## ULL

Definition at line 84 of file Types.h.

#define WCHAR_PATH_SEPARATOR   L'/'

Definition at line 246 of file Types.h.

#define WSTRING_PATH_SEPARATOR   L"/"

Definition at line 248 of file Types.h.

Typedef Documentation

typedef int Bool

Definition at line 95 of file Types.h.

typedef unsigned char Byte

Definition at line 55 of file Types.h.

typedef short Int16

Definition at line 56 of file Types.h.

typedef int Int32

Definition at line 63 of file Types.h.

typedef long long int Int64

Definition at line 82 of file Types.h.

typedef size_t SizeT

Definition at line 92 of file Types.h.

typedef int SRes

Definition at line 43 of file Types.h.

typedef unsigned short UInt16

Definition at line 57 of file Types.h.

typedef unsigned int UInt32

Definition at line 64 of file Types.h.

typedef unsigned long long int UInt64

Definition at line 83 of file Types.h.

typedef int WRes

Definition at line 48 of file Types.h.

Enumeration Type Documentation

enum ESzSeek
Enumerator
SZ_SEEK_SET 
SZ_SEEK_CUR 
SZ_SEEK_END 

Definition at line 156 of file Types.h.

157 {
158  SZ_SEEK_SET = 0,
159  SZ_SEEK_CUR = 1,
160  SZ_SEEK_END = 2
161 } ESzSeek;
ESzSeek
Definition: Types.h:156

Function Documentation

SRes LookInStream_LookRead ( ILookInStream stream,
void *  buf,
size_t *  size 
)

Definition at line 40 of file 7zStream.cc.

References ILookInStream::Look, RINOK, ILookInStream::Skip, and SZ_OK.

Referenced by SecToLook_Read().

41 {
42  const void *lookBuf;
43  if (*size == 0)
44  return SZ_OK;
45  RINOK(stream->Look(stream, &lookBuf, size));
46  memcpy(buf, lookBuf, *size);
47  return stream->Skip(stream, *size);
48 }
#define SZ_OK
Definition: Types.h:25
SRes(* Skip)(void *p, size_t offset)
Definition: Types.h:175
#define RINOK(x)
Definition: Types.h:52
SRes(* Look)(void *p, const void **buf, size_t *size)
Definition: Types.h:171
tuple size
Write out results.
SRes LookInStream_Read ( ILookInStream stream,
void *  buf,
size_t  size 
)

Definition at line 64 of file 7zStream.cc.

References LookInStream_Read2(), and SZ_ERROR_INPUT_EOF.

65 {
66  return LookInStream_Read2(stream, buf, size, SZ_ERROR_INPUT_EOF);
67 }
#define SZ_ERROR_INPUT_EOF
Definition: Types.h:32
SRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType)
Definition: 7zStream.cc:50
tuple size
Write out results.
SRes LookInStream_Read2 ( ILookInStream stream,
void *  buf,
size_t  size,
SRes  errorType 
)

Definition at line 50 of file 7zStream.cc.

References ILookInStream::Read, RINOK, findQualityFiles::size, and SZ_OK.

Referenced by LookInStream_Read().

51 {
52  while (size != 0)
53  {
54  size_t processed = size;
55  RINOK(stream->Read(stream, buf, &processed));
56  if (processed == 0)
57  return errorType;
58  buf = (void *)((Byte *)buf + processed);
59  size -= processed;
60  }
61  return SZ_OK;
62 }
#define SZ_OK
Definition: Types.h:25
unsigned char Byte
Definition: Types.h:55
SRes(* Read)(void *p, void *buf, size_t *size)
Definition: Types.h:178
#define RINOK(x)
Definition: Types.h:52
tuple size
Write out results.
SRes LookInStream_SeekTo ( ILookInStream stream,
UInt64  offset 
)

Definition at line 34 of file 7zStream.cc.

References evf::evtn::offset(), ILookInStream::Seek, SZ_SEEK_SET, and lumiQTWidget::t.

35 {
36  Int64 t = offset;
37  return stream->Seek(stream, &t, SZ_SEEK_SET);
38 }
long long int Int64
Definition: Types.h:82
unsigned int offset(bool)
SRes(* Seek)(void *p, Int64 *pos, ESzSeek origin)
Definition: Types.h:180
void LookToRead_CreateVTable ( CLookToRead p,
int  lookahead 
)

Definition at line 134 of file 7zStream.cc.

References ILookInStream::Look, LookToRead_Look_Exact(), LookToRead_Look_Lookahead(), LookToRead_Read(), LookToRead_Seek(), LookToRead_Skip(), ILookInStream::Read, CLookToRead::s, ILookInStream::Seek, and ILookInStream::Skip.

135 {
136  p->s.Look = lookahead ?
139  p->s.Skip = LookToRead_Skip;
140  p->s.Read = LookToRead_Read;
141  p->s.Seek = LookToRead_Seek;
142 }
static SRes LookToRead_Read(void *pp, void *buf, size_t *size)
Definition: 7zStream.cc:113
static SRes LookToRead_Look_Lookahead(void *pp, const void **buf, size_t *size)
Definition: 7zStream.cc:69
static SRes LookToRead_Look_Exact(void *pp, const void **buf, size_t *size)
Definition: 7zStream.cc:87
SRes(* Skip)(void *p, size_t offset)
Definition: Types.h:175
ILookInStream s
Definition: Types.h:194
static SRes LookToRead_Skip(void *pp, size_t offset)
Definition: 7zStream.cc:106
static SRes LookToRead_Seek(void *pp, Int64 *pos, ESzSeek origin)
Definition: 7zStream.cc:127
SRes(* Read)(void *p, void *buf, size_t *size)
Definition: Types.h:178
SRes(* Seek)(void *p, Int64 *pos, ESzSeek origin)
Definition: Types.h:180
SRes(* Look)(void *p, const void **buf, size_t *size)
Definition: Types.h:171
void LookToRead_Init ( CLookToRead p)

Definition at line 144 of file 7zStream.cc.

References CLookToRead::pos, and CLookToRead::size.

145 {
146  p->pos = p->size = 0;
147 }
size_t size
Definition: Types.h:197
size_t pos
Definition: Types.h:196
void SecToLook_CreateVTable ( CSecToLook p)

Definition at line 155 of file 7zStream.cc.

References ISeqInStream::Read, CSecToLook::s, and SecToLook_Read().

156 {
157  p->s.Read = SecToLook_Read;
158 }
static SRes SecToLook_Read(void *pp, void *buf, size_t *size)
Definition: 7zStream.cc:149
ISeqInStream s
Definition: Types.h:206
SRes(* Read)(void *p, void *buf, size_t *size)
Definition: Types.h:139
void SecToRead_CreateVTable ( CSecToRead p)

Definition at line 166 of file 7zStream.cc.

References ISeqInStream::Read, CSecToRead::s, and SecToRead_Read().

167 {
168  p->s.Read = SecToRead_Read;
169 }
static SRes SecToRead_Read(void *pp, void *buf, size_t *size)
Definition: 7zStream.cc:160
ISeqInStream s
Definition: Types.h:214
SRes(* Read)(void *p, void *buf, size_t *size)
Definition: Types.h:139
SRes SeqInStream_Read ( ISeqInStream stream,
void *  buf,
size_t  size 
)

Definition at line 22 of file 7zStream.cc.

References SeqInStream_Read2(), and SZ_ERROR_INPUT_EOF.

Referenced by LzmaFile::Open().

23 {
24  return SeqInStream_Read2(stream, buf, size, SZ_ERROR_INPUT_EOF);
25 }
SRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType)
Definition: 7zStream.cc:8
#define SZ_ERROR_INPUT_EOF
Definition: Types.h:32
tuple size
Write out results.
SRes SeqInStream_Read2 ( ISeqInStream stream,
void *  buf,
size_t  size,
SRes  errorType 
)

Definition at line 8 of file 7zStream.cc.

References ISeqInStream::Read, RINOK, findQualityFiles::size, and SZ_OK.

Referenced by SeqInStream_Read().

9 {
10  while (size != 0)
11  {
12  size_t processed = size;
13  RINOK(stream->Read(stream, buf, &processed));
14  if (processed == 0)
15  return errorType;
16  buf = (void *)((Byte *)buf + processed);
17  size -= processed;
18  }
19  return SZ_OK;
20 }
#define SZ_OK
Definition: Types.h:25
unsigned char Byte
Definition: Types.h:55
#define RINOK(x)
Definition: Types.h:52
SRes(* Read)(void *p, void *buf, size_t *size)
Definition: Types.h:139
tuple size
Write out results.
SRes SeqInStream_ReadByte ( ISeqInStream stream,
Byte buf 
)

Definition at line 27 of file 7zStream.cc.

References ISeqInStream::Read, RINOK, SZ_ERROR_INPUT_EOF, and SZ_OK.

28 {
29  size_t processed = 1;
30  RINOK(stream->Read(stream, buf, &processed));
31  return (processed == 1) ? SZ_OK : SZ_ERROR_INPUT_EOF;
32 }
#define SZ_OK
Definition: Types.h:25
#define SZ_ERROR_INPUT_EOF
Definition: Types.h:32
#define RINOK(x)
Definition: Types.h:52
SRes(* Read)(void *p, void *buf, size_t *size)
Definition: Types.h:139