ReactOS 0.4.16-dev-250-g3ecd236
cabinet.h File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winnt.h"
#include "fdi.h"
#include "fci.h"
Include dependency graph for cabinet.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Ziphuft
 
struct  ZIPstate
 
struct  QTMmodelsym
 
struct  QTMmodel
 
struct  QTMstate
 
struct  LZXstate
 
struct  lzx_bits
 
struct  cab_file
 
struct  cab_folder
 
struct  cabinet
 
struct  cds_forward
 
struct  FILELIST
 
struct  SESSION
 

Macros

#define _S_IWRITE   0x0080
 
#define _S_IREAD   0x0100
 
#define _O_RDONLY   0
 
#define _O_WRONLY   1
 
#define _O_RDWR   2
 
#define _O_ACCMODE   (_O_RDONLY|_O_WRONLY|_O_RDWR)
 
#define _O_APPEND   0x0008
 
#define _O_RANDOM   0x0010
 
#define _O_SEQUENTIAL   0x0020
 
#define _O_TEMPORARY   0x0040
 
#define _O_NOINHERIT   0x0080
 
#define _O_CREAT   0x0100
 
#define _O_TRUNC   0x0200
 
#define _O_EXCL   0x0400
 
#define _O_SHORT_LIVED   0x1000
 
#define _O_TEXT   0x4000
 
#define _O_BINARY   0x8000
 
#define CAB_SPLITMAX   (10)
 
#define CAB_SEARCH_SIZE   (32*1024)
 
#define CAB_ULONG_BITS   (sizeof(cab_ULONG) * 8) /* CHAR_BIT */
 
#define cfhead_Signature   (0x00)
 
#define cfhead_CabinetSize   (0x08)
 
#define cfhead_FileOffset   (0x10)
 
#define cfhead_MinorVersion   (0x18)
 
#define cfhead_MajorVersion   (0x19)
 
#define cfhead_NumFolders   (0x1A)
 
#define cfhead_NumFiles   (0x1C)
 
#define cfhead_Flags   (0x1E)
 
#define cfhead_SetID   (0x20)
 
#define cfhead_CabinetIndex   (0x22)
 
#define cfhead_SIZEOF   (0x24)
 
#define cfheadext_HeaderReserved   (0x00)
 
#define cfheadext_FolderReserved   (0x02)
 
#define cfheadext_DataReserved   (0x03)
 
#define cfheadext_SIZEOF   (0x04)
 
#define cffold_DataOffset   (0x00)
 
#define cffold_NumBlocks   (0x04)
 
#define cffold_CompType   (0x06)
 
#define cffold_SIZEOF   (0x08)
 
#define cffile_UncompressedSize   (0x00)
 
#define cffile_FolderOffset   (0x04)
 
#define cffile_FolderIndex   (0x08)
 
#define cffile_Date   (0x0A)
 
#define cffile_Time   (0x0C)
 
#define cffile_Attribs   (0x0E)
 
#define cffile_SIZEOF   (0x10)
 
#define cfdata_CheckSum   (0x00)
 
#define cfdata_CompressedSize   (0x04)
 
#define cfdata_UncompressedSize   (0x06)
 
#define cfdata_SIZEOF   (0x08)
 
#define cffoldCOMPTYPE_MASK   (0x000f)
 
#define cffoldCOMPTYPE_NONE   (0x0000)
 
#define cffoldCOMPTYPE_MSZIP   (0x0001)
 
#define cffoldCOMPTYPE_QUANTUM   (0x0002)
 
#define cffoldCOMPTYPE_LZX   (0x0003)
 
#define cfheadPREV_CABINET   (0x0001)
 
#define cfheadNEXT_CABINET   (0x0002)
 
#define cfheadRESERVE_PRESENT   (0x0004)
 
#define cffileCONTINUED_FROM_PREV   (0xFFFD)
 
#define cffileCONTINUED_TO_NEXT   (0xFFFE)
 
#define cffileCONTINUED_PREV_AND_NEXT   (0xFFFF)
 
#define cffile_A_RDONLY   (0x01)
 
#define cffile_A_HIDDEN   (0x02)
 
#define cffile_A_SYSTEM   (0x04)
 
#define cffile_A_ARCH   (0x20)
 
#define cffile_A_EXEC   (0x40)
 
#define cffile_A_NAME_IS_UTF   (0x80)
 
#define ZIPWSIZE   0x8000 /* window size */
 
#define ZIPLBITS   9 /* bits in base literal/length lookup table */
 
#define ZIPDBITS   6 /* bits in base distance lookup table */
 
#define ZIPBMAX   16 /* maximum bit length of any code */
 
#define ZIPN_MAX   288 /* maximum number of codes in any set */
 
#define LZX_MIN_MATCH   (2)
 
#define LZX_MAX_MATCH   (257)
 
#define LZX_NUM_CHARS   (256)
 
#define LZX_BLOCKTYPE_INVALID   (0) /* also blocktypes 4-7 invalid */
 
#define LZX_BLOCKTYPE_VERBATIM   (1)
 
#define LZX_BLOCKTYPE_ALIGNED   (2)
 
#define LZX_BLOCKTYPE_UNCOMPRESSED   (3)
 
#define LZX_PRETREE_NUM_ELEMENTS   (20)
 
#define LZX_ALIGNED_NUM_ELEMENTS   (8) /* aligned offset tree #elements */
 
#define LZX_NUM_PRIMARY_LENGTHS   (7) /* this one missing from spec! */
 
#define LZX_NUM_SECONDARY_LENGTHS   (249) /* length tree #elements */
 
#define LZX_PRETREE_MAXSYMBOLS   (LZX_PRETREE_NUM_ELEMENTS)
 
#define LZX_PRETREE_TABLEBITS   (6)
 
#define LZX_MAINTREE_MAXSYMBOLS   (LZX_NUM_CHARS + 50*8)
 
#define LZX_MAINTREE_TABLEBITS   (12)
 
#define LZX_LENGTH_MAXSYMBOLS   (LZX_NUM_SECONDARY_LENGTHS+1)
 
#define LZX_LENGTH_TABLEBITS   (12)
 
#define LZX_ALIGNED_MAXSYMBOLS   (LZX_ALIGNED_NUM_ELEMENTS)
 
#define LZX_ALIGNED_TABLEBITS   (7)
 
#define LZX_LENTABLE_SAFETY   (64) /* we allow length table decoding overruns */
 
#define LZX_DECLARE_TABLE(tbl)
 
#define CAB_BLOCKMAX   (32768)
 
#define CAB_INPUTMAX   (CAB_BLOCKMAX+6144)
 
#define Q_INIT_BITSTREAM   do { bitsleft = 0; bitbuf = 0; } while (0)
 
#define Q_FILL_BUFFER
 
#define Q_PEEK_BITS(n)   (bitbuf >> (CAB_ULONG_BITS - (n)))
 
#define Q_REMOVE_BITS(n)   ((bitbuf <<= (n)), (bitsleft -= (n)))
 
#define Q_READ_BITS(v, n)
 
#define Q_MENTRIES(model)   (QTM(model).entries)
 
#define Q_MSYM(model, symidx)   (QTM(model).syms[(symidx)].sym)
 
#define Q_MSYMFREQ(model, symidx)   (QTM(model).syms[(symidx)].cumfreq)
 
#define GET_SYMBOL(m, var)
 
#define INIT_BITSTREAM   do { bitsleft = 0; bitbuf = 0; } while (0)
 
#define ENSURE_BITS(n)
 
#define PEEK_BITS(n)   (bitbuf >> (CAB_ULONG_BITS - (n)))
 
#define REMOVE_BITS(n)   ((bitbuf <<= (n)), (bitsleft -= (n)))
 
#define READ_BITS(v, n)
 
#define TABLEBITS(tbl)   (LZX_##tbl##_TABLEBITS)
 
#define MAXSYMBOLS(tbl)   (LZX_##tbl##_MAXSYMBOLS)
 
#define SYMTABLE(tbl)   (LZX(tbl##_table))
 
#define LENTABLE(tbl)   (LZX(tbl##_len))
 
#define BUILD_TABLE(tbl)
 
#define READ_HUFFSYM(tbl, var)
 
#define READ_LENGTHS(tbl, first, last, fn)
 
#define THOSE_ZIP_CONSTS
 
#define EXTRACT_FILLFILELIST   0x00000001
 
#define EXTRACT_EXTRACTFILES   0x00000002
 

Typedefs

typedef unsigned char cab_UBYTE
 
typedef UINT16 cab_UWORD
 
typedef UINT32 cab_ULONG
 
typedef INT32 cab_LONG
 
typedef UINT32 cab_off_t
 
typedef struct cds_forward cab_decomp_state
 

Macro Definition Documentation

◆ _O_ACCMODE

#define _O_ACCMODE   (_O_RDONLY|_O_WRONLY|_O_RDWR)

Definition at line 40 of file cabinet.h.

◆ _O_APPEND

#define _O_APPEND   0x0008

Definition at line 41 of file cabinet.h.

◆ _O_BINARY

#define _O_BINARY   0x8000

Definition at line 51 of file cabinet.h.

◆ _O_CREAT

#define _O_CREAT   0x0100

Definition at line 46 of file cabinet.h.

◆ _O_EXCL

#define _O_EXCL   0x0400

Definition at line 48 of file cabinet.h.

◆ _O_NOINHERIT

#define _O_NOINHERIT   0x0080

Definition at line 45 of file cabinet.h.

◆ _O_RANDOM

#define _O_RANDOM   0x0010

Definition at line 42 of file cabinet.h.

◆ _O_RDONLY

#define _O_RDONLY   0

Definition at line 37 of file cabinet.h.

◆ _O_RDWR

#define _O_RDWR   2

Definition at line 39 of file cabinet.h.

◆ _O_SEQUENTIAL

#define _O_SEQUENTIAL   0x0020

Definition at line 43 of file cabinet.h.

◆ _O_SHORT_LIVED

#define _O_SHORT_LIVED   0x1000

Definition at line 49 of file cabinet.h.

◆ _O_TEMPORARY

#define _O_TEMPORARY   0x0040

Definition at line 44 of file cabinet.h.

◆ _O_TEXT

#define _O_TEXT   0x4000

Definition at line 50 of file cabinet.h.

◆ _O_TRUNC

#define _O_TRUNC   0x0200

Definition at line 47 of file cabinet.h.

◆ _O_WRONLY

#define _O_WRONLY   1

Definition at line 38 of file cabinet.h.

◆ _S_IREAD

#define _S_IREAD   0x0100

Definition at line 34 of file cabinet.h.

◆ _S_IWRITE

#define _S_IWRITE   0x0080

Definition at line 33 of file cabinet.h.

◆ BUILD_TABLE

#define BUILD_TABLE (   tbl)
Value:
MAXSYMBOLS(tbl), TABLEBITS(tbl), LENTABLE(tbl), SYMTABLE(tbl) \
)) { return DECR_ILLEGALDATA; }
#define DECR_ILLEGALDATA
Definition: mszip.h:81
#define LENTABLE(tbl)
Definition: cabinet.h:442
#define SYMTABLE(tbl)
Definition: cabinet.h:441
#define MAXSYMBOLS(tbl)
Definition: cabinet.h:440
#define TABLEBITS(tbl)
Definition: cabinet.h:439
static int make_decode_table(cab_ULONG nsyms, cab_ULONG nbits, const cab_UBYTE *length, cab_UWORD *table)
Definition: fdi.c:279

Definition at line 449 of file cabinet.h.

◆ CAB_BLOCKMAX

#define CAB_BLOCKMAX   (32768)

Definition at line 245 of file cabinet.h.

◆ CAB_INPUTMAX

#define CAB_INPUTMAX   (CAB_BLOCKMAX+6144)

Definition at line 246 of file cabinet.h.

◆ CAB_SEARCH_SIZE

#define CAB_SEARCH_SIZE   (32*1024)

Definition at line 55 of file cabinet.h.

◆ CAB_SPLITMAX

#define CAB_SPLITMAX   (10)

Definition at line 53 of file cabinet.h.

◆ CAB_ULONG_BITS

#define CAB_ULONG_BITS   (sizeof(cab_ULONG) * 8) /* CHAR_BIT */

Definition at line 65 of file cabinet.h.

◆ cfdata_CheckSum

#define cfdata_CheckSum   (0x00)

Definition at line 94 of file cabinet.h.

◆ cfdata_CompressedSize

#define cfdata_CompressedSize   (0x04)

Definition at line 95 of file cabinet.h.

◆ cfdata_SIZEOF

#define cfdata_SIZEOF   (0x08)

Definition at line 97 of file cabinet.h.

◆ cfdata_UncompressedSize

#define cfdata_UncompressedSize   (0x06)

Definition at line 96 of file cabinet.h.

◆ cffile_A_ARCH

#define cffile_A_ARCH   (0x20)

Definition at line 114 of file cabinet.h.

◆ cffile_A_EXEC

#define cffile_A_EXEC   (0x40)

Definition at line 115 of file cabinet.h.

◆ cffile_A_HIDDEN

#define cffile_A_HIDDEN   (0x02)

Definition at line 112 of file cabinet.h.

◆ cffile_A_NAME_IS_UTF

#define cffile_A_NAME_IS_UTF   (0x80)

Definition at line 116 of file cabinet.h.

◆ cffile_A_RDONLY

#define cffile_A_RDONLY   (0x01)

Definition at line 111 of file cabinet.h.

◆ cffile_A_SYSTEM

#define cffile_A_SYSTEM   (0x04)

Definition at line 113 of file cabinet.h.

◆ cffile_Attribs

#define cffile_Attribs   (0x0E)

Definition at line 92 of file cabinet.h.

◆ cffile_Date

#define cffile_Date   (0x0A)

Definition at line 90 of file cabinet.h.

◆ cffile_FolderIndex

#define cffile_FolderIndex   (0x08)

Definition at line 89 of file cabinet.h.

◆ cffile_FolderOffset

#define cffile_FolderOffset   (0x04)

Definition at line 88 of file cabinet.h.

◆ cffile_SIZEOF

#define cffile_SIZEOF   (0x10)

Definition at line 93 of file cabinet.h.

◆ cffile_Time

#define cffile_Time   (0x0C)

Definition at line 91 of file cabinet.h.

◆ cffile_UncompressedSize

#define cffile_UncompressedSize   (0x00)

Definition at line 87 of file cabinet.h.

◆ cffileCONTINUED_FROM_PREV

#define cffileCONTINUED_FROM_PREV   (0xFFFD)

Definition at line 108 of file cabinet.h.

◆ cffileCONTINUED_PREV_AND_NEXT

#define cffileCONTINUED_PREV_AND_NEXT   (0xFFFF)

Definition at line 110 of file cabinet.h.

◆ cffileCONTINUED_TO_NEXT

#define cffileCONTINUED_TO_NEXT   (0xFFFE)

Definition at line 109 of file cabinet.h.

◆ cffold_CompType

#define cffold_CompType   (0x06)

Definition at line 85 of file cabinet.h.

◆ cffold_DataOffset

#define cffold_DataOffset   (0x00)

Definition at line 83 of file cabinet.h.

◆ cffold_NumBlocks

#define cffold_NumBlocks   (0x04)

Definition at line 84 of file cabinet.h.

◆ cffold_SIZEOF

#define cffold_SIZEOF   (0x08)

Definition at line 86 of file cabinet.h.

◆ cffoldCOMPTYPE_LZX

#define cffoldCOMPTYPE_LZX   (0x0003)

Definition at line 104 of file cabinet.h.

◆ cffoldCOMPTYPE_MASK

#define cffoldCOMPTYPE_MASK   (0x000f)

Definition at line 100 of file cabinet.h.

◆ cffoldCOMPTYPE_MSZIP

#define cffoldCOMPTYPE_MSZIP   (0x0001)

Definition at line 102 of file cabinet.h.

◆ cffoldCOMPTYPE_NONE

#define cffoldCOMPTYPE_NONE   (0x0000)

Definition at line 101 of file cabinet.h.

◆ cffoldCOMPTYPE_QUANTUM

#define cffoldCOMPTYPE_QUANTUM   (0x0002)

Definition at line 103 of file cabinet.h.

◆ cfhead_CabinetIndex

#define cfhead_CabinetIndex   (0x22)

Definition at line 77 of file cabinet.h.

◆ cfhead_CabinetSize

#define cfhead_CabinetSize   (0x08)

Definition at line 69 of file cabinet.h.

◆ cfhead_FileOffset

#define cfhead_FileOffset   (0x10)

Definition at line 70 of file cabinet.h.

◆ cfhead_Flags

#define cfhead_Flags   (0x1E)

Definition at line 75 of file cabinet.h.

◆ cfhead_MajorVersion

#define cfhead_MajorVersion   (0x19)

Definition at line 72 of file cabinet.h.

◆ cfhead_MinorVersion

#define cfhead_MinorVersion   (0x18)

Definition at line 71 of file cabinet.h.

◆ cfhead_NumFiles

#define cfhead_NumFiles   (0x1C)

Definition at line 74 of file cabinet.h.

◆ cfhead_NumFolders

#define cfhead_NumFolders   (0x1A)

Definition at line 73 of file cabinet.h.

◆ cfhead_SetID

#define cfhead_SetID   (0x20)

Definition at line 76 of file cabinet.h.

◆ cfhead_Signature

#define cfhead_Signature   (0x00)

Definition at line 68 of file cabinet.h.

◆ cfhead_SIZEOF

#define cfhead_SIZEOF   (0x24)

Definition at line 78 of file cabinet.h.

◆ cfheadext_DataReserved

#define cfheadext_DataReserved   (0x03)

Definition at line 81 of file cabinet.h.

◆ cfheadext_FolderReserved

#define cfheadext_FolderReserved   (0x02)

Definition at line 80 of file cabinet.h.

◆ cfheadext_HeaderReserved

#define cfheadext_HeaderReserved   (0x00)

Definition at line 79 of file cabinet.h.

◆ cfheadext_SIZEOF

#define cfheadext_SIZEOF   (0x04)

Definition at line 82 of file cabinet.h.

◆ cfheadNEXT_CABINET

#define cfheadNEXT_CABINET   (0x0002)

Definition at line 106 of file cabinet.h.

◆ cfheadPREV_CABINET

#define cfheadPREV_CABINET   (0x0001)

Definition at line 105 of file cabinet.h.

◆ cfheadRESERVE_PRESENT

#define cfheadRESERVE_PRESENT   (0x0004)

Definition at line 107 of file cabinet.h.

◆ ENSURE_BITS

#define ENSURE_BITS (   n)
Value:
while (bitsleft < (n)) { \
bitbuf |= ((inpos[1]<<8)|inpos[0]) << (CAB_ULONG_BITS-16 - bitsleft); \
bitsleft += 16; inpos+=2; \
}
#define CAB_ULONG_BITS
Definition: cabinet.h:65
GLdouble n
Definition: glext.h:7729

Definition at line 417 of file cabinet.h.

◆ EXTRACT_EXTRACTFILES

#define EXTRACT_EXTRACTFILES   0x00000002

Definition at line 508 of file cabinet.h.

◆ EXTRACT_FILLFILELIST

#define EXTRACT_FILLFILELIST   0x00000001

Definition at line 507 of file cabinet.h.

◆ GET_SYMBOL

#define GET_SYMBOL (   m,
  var 
)
Value:
do { \
range = ((H - L) & 0xFFFF) + 1; \
symf = ((((C - L + 1) * Q_MSYMFREQ(m,0)) - 1) / range) & 0xFFFF; \
\
for (i=1; i < Q_MENTRIES(m); i++) { \
if (Q_MSYMFREQ(m,i) <= symf) break; \
} \
(var) = Q_MSYM(m,i-1); \
\
range = (H - L) + 1; \
H = L + ((Q_MSYMFREQ(m,i-1) * range) / Q_MSYMFREQ(m,0)) - 1; \
L = L + ((Q_MSYMFREQ(m,i) * range) / Q_MSYMFREQ(m,0)); \
while (1) { \
if ((L & 0x8000) != (H & 0x8000)) { \
if ((L & 0x4000) && !(H & 0x4000)) { \
/* underflow case */ \
C ^= 0x4000; L &= 0x3FFF; H |= 0x4000; \
} \
else break; \
} \
L <<= 1; H = (H << 1) | 1; \
C = (C << 1) | Q_PEEK_BITS(1); \
Q_REMOVE_BITS(1); \
} \
\
QTMupdatemodel(&(QTM(m)), i); \
} while (0)
Definition: terminate.cpp:24
#define Q_MSYMFREQ(model, symidx)
Definition: cabinet.h:362
#define Q_MSYM(model, symidx)
Definition: cabinet.h:361
#define Q_FILL_BUFFER
Definition: cabinet.h:340
#define Q_PEEK_BITS(n)
Definition: cabinet.h:347
#define Q_MENTRIES(model)
Definition: cabinet.h:360
#define QTM(x)
Definition: fdi.c:176
GLenum GLint * range
Definition: glext.h:7539
const GLfloat * m
Definition: glext.h:10848
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
const char * var
Definition: shader.c:5666
#define H
#define L(x)
Definition: ntvdm.h:50

Definition at line 367 of file cabinet.h.

◆ INIT_BITSTREAM

#define INIT_BITSTREAM   do { bitsleft = 0; bitbuf = 0; } while (0)

Definition at line 414 of file cabinet.h.

◆ LENTABLE

#define LENTABLE (   tbl)    (LZX(tbl##_len))

Definition at line 442 of file cabinet.h.

◆ LZX_ALIGNED_MAXSYMBOLS

#define LZX_ALIGNED_MAXSYMBOLS   (LZX_ALIGNED_NUM_ELEMENTS)

Definition at line 203 of file cabinet.h.

◆ LZX_ALIGNED_NUM_ELEMENTS

#define LZX_ALIGNED_NUM_ELEMENTS   (8) /* aligned offset tree #elements */

Definition at line 192 of file cabinet.h.

◆ LZX_ALIGNED_TABLEBITS

#define LZX_ALIGNED_TABLEBITS   (7)

Definition at line 204 of file cabinet.h.

◆ LZX_BLOCKTYPE_ALIGNED

#define LZX_BLOCKTYPE_ALIGNED   (2)

Definition at line 189 of file cabinet.h.

◆ LZX_BLOCKTYPE_INVALID

#define LZX_BLOCKTYPE_INVALID   (0) /* also blocktypes 4-7 invalid */

Definition at line 187 of file cabinet.h.

◆ LZX_BLOCKTYPE_UNCOMPRESSED

#define LZX_BLOCKTYPE_UNCOMPRESSED   (3)

Definition at line 190 of file cabinet.h.

◆ LZX_BLOCKTYPE_VERBATIM

#define LZX_BLOCKTYPE_VERBATIM   (1)

Definition at line 188 of file cabinet.h.

◆ LZX_DECLARE_TABLE

#define LZX_DECLARE_TABLE (   tbl)
Value:
cab_UWORD tbl##_table[(1<<LZX_##tbl##_TABLEBITS) + (LZX_##tbl##_MAXSYMBOLS<<1)];\
cab_UBYTE tbl##_len [LZX_##tbl##_MAXSYMBOLS + LZX_LENTABLE_SAFETY]
UINT16 cab_UWORD
Definition: mszip.h:26
unsigned char cab_UBYTE
Definition: mszip.h:25
#define LZX_LENTABLE_SAFETY
Definition: cabinet.h:206

Definition at line 208 of file cabinet.h.

◆ LZX_LENGTH_MAXSYMBOLS

#define LZX_LENGTH_MAXSYMBOLS   (LZX_NUM_SECONDARY_LENGTHS+1)

Definition at line 201 of file cabinet.h.

◆ LZX_LENGTH_TABLEBITS

#define LZX_LENGTH_TABLEBITS   (12)

Definition at line 202 of file cabinet.h.

◆ LZX_LENTABLE_SAFETY

#define LZX_LENTABLE_SAFETY   (64) /* we allow length table decoding overruns */

Definition at line 206 of file cabinet.h.

◆ LZX_MAINTREE_MAXSYMBOLS

#define LZX_MAINTREE_MAXSYMBOLS   (LZX_NUM_CHARS + 50*8)

Definition at line 199 of file cabinet.h.

◆ LZX_MAINTREE_TABLEBITS

#define LZX_MAINTREE_TABLEBITS   (12)

Definition at line 200 of file cabinet.h.

◆ LZX_MAX_MATCH

#define LZX_MAX_MATCH   (257)

Definition at line 185 of file cabinet.h.

◆ LZX_MIN_MATCH

#define LZX_MIN_MATCH   (2)

Definition at line 184 of file cabinet.h.

◆ LZX_NUM_CHARS

#define LZX_NUM_CHARS   (256)

Definition at line 186 of file cabinet.h.

◆ LZX_NUM_PRIMARY_LENGTHS

#define LZX_NUM_PRIMARY_LENGTHS   (7) /* this one missing from spec! */

Definition at line 193 of file cabinet.h.

◆ LZX_NUM_SECONDARY_LENGTHS

#define LZX_NUM_SECONDARY_LENGTHS   (249) /* length tree #elements */

Definition at line 194 of file cabinet.h.

◆ LZX_PRETREE_MAXSYMBOLS

#define LZX_PRETREE_MAXSYMBOLS   (LZX_PRETREE_NUM_ELEMENTS)

Definition at line 197 of file cabinet.h.

◆ LZX_PRETREE_NUM_ELEMENTS

#define LZX_PRETREE_NUM_ELEMENTS   (20)

Definition at line 191 of file cabinet.h.

◆ LZX_PRETREE_TABLEBITS

#define LZX_PRETREE_TABLEBITS   (6)

Definition at line 198 of file cabinet.h.

◆ MAXSYMBOLS

#define MAXSYMBOLS (   tbl)    (LZX_##tbl##_MAXSYMBOLS)

Definition at line 440 of file cabinet.h.

◆ PEEK_BITS

#define PEEK_BITS (   n)    (bitbuf >> (CAB_ULONG_BITS - (n)))

Definition at line 423 of file cabinet.h.

◆ Q_FILL_BUFFER

#define Q_FILL_BUFFER
Value:
do { \
if (bitsleft <= (CAB_ULONG_BITS - 16)) { \
bitbuf |= ((inpos[0]<<8)|inpos[1]) << (CAB_ULONG_BITS-16 - bitsleft); \
bitsleft += 16; inpos += 2; \
} \
} while (0)

Definition at line 340 of file cabinet.h.

◆ Q_INIT_BITSTREAM

#define Q_INIT_BITSTREAM   do { bitsleft = 0; bitbuf = 0; } while (0)

Definition at line 338 of file cabinet.h.

◆ Q_MENTRIES

#define Q_MENTRIES (   model)    (QTM(model).entries)

Definition at line 360 of file cabinet.h.

◆ Q_MSYM

#define Q_MSYM (   model,
  symidx 
)    (QTM(model).syms[(symidx)].sym)

Definition at line 361 of file cabinet.h.

◆ Q_MSYMFREQ

#define Q_MSYMFREQ (   model,
  symidx 
)    (QTM(model).syms[(symidx)].cumfreq)

Definition at line 362 of file cabinet.h.

◆ Q_PEEK_BITS

#define Q_PEEK_BITS (   n)    (bitbuf >> (CAB_ULONG_BITS - (n)))

Definition at line 347 of file cabinet.h.

◆ Q_READ_BITS

#define Q_READ_BITS (   v,
  n 
)
Value:
do { \
(v) = 0; \
for (bitsneed = (n); bitsneed; bitsneed -= bitrun) { \
bitrun = (bitsneed > bitsleft) ? bitsleft : bitsneed; \
(v) = ((v) << bitrun) | Q_PEEK_BITS(bitrun); \
Q_REMOVE_BITS(bitrun); \
} \
} while (0)
const GLdouble * v
Definition: gl.h:2040

Definition at line 350 of file cabinet.h.

◆ Q_REMOVE_BITS

#define Q_REMOVE_BITS (   n)    ((bitbuf <<= (n)), (bitsleft -= (n)))

Definition at line 348 of file cabinet.h.

◆ READ_BITS

#define READ_BITS (   v,
  n 
)
Value:
do { \
if (n) { \
ENSURE_BITS(n); \
(v) = PEEK_BITS(n); \
REMOVE_BITS(n); \
} \
else { \
(v) = 0; \
} \
} while (0)
#define PEEK_BITS(n)
Definition: cabinet.h:423

Definition at line 426 of file cabinet.h.

◆ READ_HUFFSYM

#define READ_HUFFSYM (   tbl,
  var 
)
Value:
do { \
ENSURE_BITS(16); \
hufftbl = SYMTABLE(tbl); \
if ((i = hufftbl[PEEK_BITS(TABLEBITS(tbl))]) >= MAXSYMBOLS(tbl)) { \
j = 1 << (CAB_ULONG_BITS - TABLEBITS(tbl)); \
do { \
j >>= 1; i <<= 1; i |= (bitbuf & j) ? 1 : 0; \
if (!j) { return DECR_ILLEGALDATA; } \
} while ((i = hufftbl[i]) >= MAXSYMBOLS(tbl)); \
} \
j = LENTABLE(tbl)[(var) = i]; \
REMOVE_BITS(j); \
} while (0)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250

Definition at line 457 of file cabinet.h.

◆ READ_LENGTHS

#define READ_LENGTHS (   tbl,
  first,
  last,
  fn 
)
Value:
do { \
lb.bb = bitbuf; lb.bl = bitsleft; lb.ip = inpos; \
if (fn(LENTABLE(tbl),(first),(last),&lb,decomp_state)) { \
return DECR_ILLEGALDATA; \
} \
bitbuf = lb.bb; bitsleft = lb.bl; inpos = lb.ip; \
} while (0)
const GLint * first
Definition: glext.h:5794
static UINT UINT last
Definition: font.c:45
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159

Definition at line 475 of file cabinet.h.

◆ REMOVE_BITS

#define REMOVE_BITS (   n)    ((bitbuf <<= (n)), (bitsleft -= (n)))

Definition at line 424 of file cabinet.h.

◆ SYMTABLE

#define SYMTABLE (   tbl)    (LZX(tbl##_table))

Definition at line 441 of file cabinet.h.

◆ TABLEBITS

#define TABLEBITS (   tbl)    (LZX_##tbl##_TABLEBITS)

Definition at line 439 of file cabinet.h.

◆ THOSE_ZIP_CONSTS

#define THOSE_ZIP_CONSTS
Value:
static const cab_UBYTE Zipborder[] = /* Order of the bit length code lengths */ \
{ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; \
static const cab_UWORD Zipcplens[] = /* Copy lengths for literal codes 257..285 */ \
{ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, \
59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; \
static const cab_UWORD Zipcplext[] = /* Extra bits for literal codes 257..285 */ \
{ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, \
4, 5, 5, 5, 5, 0, 99, 99}; /* 99==invalid */ \
static const cab_UWORD Zipcpdist[] = /* Copy offsets for distance codes 0..29 */ \
{ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, \
513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577}; \
static const cab_UWORD Zipcpdext[] = /* Extra bits for distance codes */ \
{ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, \
10, 11, 11, 12, 12, 13, 13}; \
/* And'ing with Zipmask[n] masks the lower n bits */ \
static const cab_UWORD Zipmask[17] = { \
0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, \
0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff \
}

Definition at line 485 of file cabinet.h.

◆ ZIPBMAX

#define ZIPBMAX   16 /* maximum bit length of any code */

Definition at line 125 of file cabinet.h.

◆ ZIPDBITS

#define ZIPDBITS   6 /* bits in base distance lookup table */

Definition at line 124 of file cabinet.h.

◆ ZIPLBITS

#define ZIPLBITS   9 /* bits in base literal/length lookup table */

Definition at line 123 of file cabinet.h.

◆ ZIPN_MAX

#define ZIPN_MAX   288 /* maximum number of codes in any set */

Definition at line 126 of file cabinet.h.

◆ ZIPWSIZE

#define ZIPWSIZE   0x8000 /* window size */

Definition at line 122 of file cabinet.h.

Typedef Documentation

◆ cab_decomp_state

◆ cab_LONG

typedef INT32 cab_LONG

Definition at line 60 of file cabinet.h.

◆ cab_off_t

typedef UINT32 cab_off_t

Definition at line 62 of file cabinet.h.

◆ cab_UBYTE

Definition at line 57 of file cabinet.h.

◆ cab_ULONG

typedef UINT32 cab_ULONG

Definition at line 59 of file cabinet.h.

◆ cab_UWORD

typedef UINT16 cab_UWORD

Definition at line 58 of file cabinet.h.