rasapi32: Update spec file.
[wine/zf.git] / include / fci.h
blobda736bddf6e2b974b0e875e755f3dff5c48c5818
1 /*
2 * Copyright (C) 2002 Patrik Stridvall
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __WINE_FCI_H
20 #define __WINE_FCI_H
22 #include <basetsd.h>
24 #ifdef __cplusplus
25 extern "C" {
26 #endif /* defined(__cplusplus) */
28 #ifndef _WIN64
29 #include <pshpack4.h>
30 #endif
32 #ifndef INCLUDED_TYPES_FCI_FDI
33 #define INCLUDED_TYPES_FCI_FDI 1
35 /***********************************************************************
36 * Common FCI/TDI declarations
39 typedef ULONG CHECKSUM;
41 typedef ULONG UOFF;
42 typedef ULONG COFF;
44 /**********************************************************************/
46 typedef struct {
47 int erfOper; /* FCI/FDI error code - see {FCI,FDI}ERROR_XXX for details. */
48 int erfType; /* Optional error value filled in by FCI/FDI. */
49 BOOL fError; /* TRUE => error present */
50 } ERF, *PERF;
52 /**********************************************************************/
54 #define CB_MAX_CHUNK 32768U
55 #define CB_MAX_DISK __MSABI_LONG(0x7fffffff)
56 #define CB_MAX_FILENAME 256
57 #define CB_MAX_CABINET_NAME 256
58 #define CB_MAX_CAB_PATH 256
59 #define CB_MAX_DISK_NAME 256
61 /**********************************************************************/
63 typedef unsigned short TCOMP;
65 #define tcompMASK_TYPE 0x000F /* Mask for compression type */
66 #define tcompTYPE_NONE 0x0000 /* No compression */
67 #define tcompTYPE_MSZIP 0x0001 /* MSZIP */
68 #define tcompTYPE_QUANTUM 0x0002 /* Quantum */
69 #define tcompTYPE_LZX 0x0003 /* LZX */
70 #define tcompBAD 0x000F /* Unspecified compression type */
72 #define tcompMASK_LZX_WINDOW 0x1F00 /* Mask for LZX Compression Memory */
73 #define tcompLZX_WINDOW_LO 0x0F00 /* Lowest LZX Memory (15) */
74 #define tcompLZX_WINDOW_HI 0x1500 /* Highest LZX Memory (21) */
75 #define tcompSHIFT_LZX_WINDOW 8 /* Amount to shift over to get int */
77 #define tcompMASK_QUANTUM_LEVEL 0x00F0 /* Mask for Quantum Compression Level */
78 #define tcompQUANTUM_LEVEL_LO 0x0010 /* Lowest Quantum Level (1) */
79 #define tcompQUANTUM_LEVEL_HI 0x0070 /* Highest Quantum Level (7) */
80 #define tcompSHIFT_QUANTUM_LEVEL 4 /* Amount to shift over to get int */
82 #define tcompMASK_QUANTUM_MEM 0x1F00 /* Mask for Quantum Compression Memory */
83 #define tcompQUANTUM_MEM_LO 0x0A00 /* Lowest Quantum Memory (10) */
84 #define tcompQUANTUM_MEM_HI 0x1500 /* Highest Quantum Memory (21) */
85 #define tcompSHIFT_QUANTUM_MEM 8 /* Amount to shift over to get int */
87 #define tcompMASK_RESERVED 0xE000 /* Reserved bits (high 3 bits) */
89 /**********************************************************************/
91 #define CompressionTypeFromTCOMP(tc) \
92 ((tc) & tcompMASK_TYPE)
94 #define CompressionLevelFromTCOMP(tc) \
95 (((tc) & tcompMASK_QUANTUM_LEVEL) >> tcompSHIFT_QUANTUM_LEVEL)
97 #define CompressionMemoryFromTCOMP(tc) \
98 (((tc) & tcompMASK_QUANTUM_MEM) >> tcompSHIFT_QUANTUM_MEM)
100 #define TCOMPfromTypeLevelMemory(t, l, m) \
101 (((m) << tcompSHIFT_QUANTUM_MEM ) | \
102 ((l) << tcompSHIFT_QUANTUM_LEVEL) | \
103 ( t ))
105 #define LZXCompressionWindowFromTCOMP(tc) \
106 (((tc) & tcompMASK_LZX_WINDOW) >> tcompSHIFT_LZX_WINDOW)
108 #define TCOMPfromLZXWindow(w) \
109 (((w) << tcompSHIFT_LZX_WINDOW) | \
110 ( tcompTYPE_LZX ))
112 #endif /* !defined(INCLUDED_TYPES_FCI_FDI) */
114 /***********************************************************************
115 * FCI declarations
118 typedef enum {
119 FCIERR_NONE,
120 FCIERR_OPEN_SRC,
121 FCIERR_READ_SRC,
122 FCIERR_ALLOC_FAIL,
123 FCIERR_TEMP_FILE,
124 FCIERR_BAD_COMPR_TYPE,
125 FCIERR_CAB_FILE,
126 FCIERR_USER_ABORT,
127 FCIERR_MCI_FAIL,
128 } FCIERROR;
130 /**********************************************************************/
132 #ifndef _A_NAME_IS_UTF
133 #define _A_NAME_IS_UTF 0x80
134 #endif
136 #ifndef _A_EXEC
137 #define _A_EXEC 0x40
138 #endif
140 /**********************************************************************/
142 typedef void *HFCI;
144 /**********************************************************************/
146 typedef struct {
147 ULONG cb; /* Size available for cabinet on this media */
148 ULONG cbFolderThresh; /* Threshold for forcing a new Folder */
150 UINT cbReserveCFHeader; /* Space to reserve in CFHEADER */
151 UINT cbReserveCFFolder; /* Space to reserve in CFFOLDER */
152 UINT cbReserveCFData; /* Space to reserve in CFDATA */
153 int iCab; /* Sequential numbers for cabinets */
154 int iDisk; /* Disk number */
155 #ifndef REMOVE_CHICAGO_M6_HACK
156 int fFailOnIncompressible; /* TRUE => Fail if a block is incompressible */
157 #endif
159 USHORT setID; /* Cabinet set ID */
161 char szDisk[CB_MAX_DISK_NAME]; /* Current disk name */
162 char szCab[CB_MAX_CABINET_NAME]; /* Current cabinet name */
163 char szCabPath[CB_MAX_CAB_PATH]; /* Path for creating cabinet */
164 } CCAB, *PCCAB;
166 /**********************************************************************/
168 typedef void * (__cdecl __WINE_ALLOC_SIZE(1) *PFNFCIALLOC)(ULONG cb);
169 #define FNFCIALLOC(fn) void * __cdecl fn(ULONG cb)
171 typedef void (__cdecl *PFNFCIFREE)(void *memory);
172 #define FNFCIFREE(fn) void __cdecl fn(void *memory)
174 typedef INT_PTR (__cdecl *PFNFCIOPEN) (char *pszFile, int oflag, int pmode, int *err, void *pv);
175 #define FNFCIOPEN(fn) INT_PTR __cdecl fn(char *pszFile, int oflag, int pmode, int *err, void *pv)
177 typedef UINT (__cdecl *PFNFCIREAD) (INT_PTR hf, void *memory, UINT cb, int *err, void *pv);
178 #define FNFCIREAD(fn) UINT __cdecl fn(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
180 typedef UINT (__cdecl *PFNFCIWRITE)(INT_PTR hf, void *memory, UINT cb, int *err, void *pv);
181 #define FNFCIWRITE(fn) UINT __cdecl fn(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
183 typedef int (__cdecl *PFNFCICLOSE)(INT_PTR hf, int *err, void *pv);
184 #define FNFCICLOSE(fn) int __cdecl fn(INT_PTR hf, int *err, void *pv)
186 typedef LONG (__cdecl *PFNFCISEEK) (INT_PTR hf, LONG dist, int seektype, int *err, void *pv);
187 #define FNFCISEEK(fn) LONG __cdecl fn(INT_PTR hf, LONG dist, int seektype, int *err, void *pv)
189 typedef int (__cdecl *PFNFCIDELETE) (char *pszFile, int *err, void *pv);
190 #define FNFCIDELETE(fn) int __cdecl fn(char *pszFile, int *err, void *pv)
192 typedef BOOL (__cdecl *PFNFCIGETNEXTCABINET)(PCCAB pccab, ULONG cbPrevCab, void *pv);
193 #define FNFCIGETNEXTCABINET(fn) BOOL __cdecl fn(PCCAB pccab, \
194 ULONG cbPrevCab, \
195 void *pv)
197 typedef int (__cdecl *PFNFCIFILEPLACED)(PCCAB pccab,
198 char *pszFile,
199 LONG cbFile,
200 BOOL fContinuation,
201 void *pv);
202 #define FNFCIFILEPLACED(fn) int __cdecl fn(PCCAB pccab, \
203 char *pszFile, \
204 LONG cbFile, \
205 BOOL fContinuation, \
206 void *pv)
208 typedef INT_PTR (__cdecl *PFNFCIGETOPENINFO)(char *pszName,
209 USHORT *pdate,
210 USHORT *ptime,
211 USHORT *pattribs,
212 int *err,
213 void *pv);
214 #define FNFCIGETOPENINFO(fn) INT_PTR __cdecl fn(char *pszName, \
215 USHORT *pdate, \
216 USHORT *ptime, \
217 USHORT *pattribs, \
218 int *err, \
219 void *pv)
221 #define statusFile 0 /* Add File to Folder callback */
222 #define statusFolder 1 /* Add Folder to Cabinet callback */
223 #define statusCabinet 2 /* Write out a completed cabinet callback */
225 typedef LONG (__cdecl *PFNFCISTATUS)(UINT typeStatus,
226 ULONG cb1,
227 ULONG cb2,
228 void *pv);
229 #define FNFCISTATUS(fn) LONG __cdecl fn(UINT typeStatus, \
230 ULONG cb1, \
231 ULONG cb2, \
232 void *pv)
234 typedef BOOL (__cdecl *PFNFCIGETTEMPFILE)(char *pszTempName,
235 int cbTempName,
236 void *pv);
237 #define FNFCIGETTEMPFILE(fn) BOOL __cdecl fn(char *pszTempName, \
238 int cbTempName, \
239 void *pv)
241 /**********************************************************************/
243 HFCI __cdecl FCICreate(PERF, PFNFCIFILEPLACED, PFNFCIALLOC, PFNFCIFREE,
244 PFNFCIOPEN, PFNFCIREAD, PFNFCIWRITE, PFNFCICLOSE,
245 PFNFCISEEK, PFNFCIDELETE, PFNFCIGETTEMPFILE, PCCAB,
246 void *);
247 BOOL __cdecl FCIAddFile(HFCI, char *, char *, BOOL, PFNFCIGETNEXTCABINET,
248 PFNFCISTATUS, PFNFCIGETOPENINFO, TCOMP);
249 BOOL __cdecl FCIFlushCabinet(HFCI, BOOL, PFNFCIGETNEXTCABINET, PFNFCISTATUS);
250 BOOL __cdecl FCIFlushFolder(HFCI, PFNFCIGETNEXTCABINET, PFNFCISTATUS);
251 BOOL __cdecl FCIDestroy(HFCI hfci);
253 /**********************************************************************/
255 #ifndef _WIN64
256 #include <poppack.h>
257 #endif
259 #ifdef __cplusplus
260 } /* extern "C" */
261 #endif /* defined(__cplusplus) */
263 #endif /* __WINE_FCI_H */