ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

fci.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2002 Patrik Stridvall
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00017  */
00018 
00019 #ifndef __WINE_FCI_H
00020 #define __WINE_FCI_H
00021 
00022 #include <basetsd.h>
00023 
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif /* defined(__cplusplus) */
00027 
00028 #include <pshpack4.h>
00029 
00030 #ifndef INCLUDED_TYPES_FCI_FDI
00031 #define INCLUDED_TYPES_FCI_FDI 1
00032 
00033 /***********************************************************************
00034  * Common FCI/TDI declarations
00035  */
00036 
00037 typedef ULONG CHECKSUM;
00038 
00039 typedef ULONG UOFF;
00040 typedef ULONG COFF;
00041 
00042 /**********************************************************************/
00043 
00044 typedef struct {
00045     int   erfOper;  /* FCI/FDI error code - see {FCI,FDI}ERROR_XXX for details. */
00046     int   erfType;  /* Optional error value filled in by FCI/FDI. */
00047     BOOL  fError;   /* TRUE => error present */
00048 } ERF, *PERF;
00049 
00050 /**********************************************************************/
00051 
00052 #define CB_MAX_CHUNK         32768U
00053 #define CB_MAX_DISK          0x7fffffffL
00054 #define CB_MAX_FILENAME      256
00055 #define CB_MAX_CABINET_NAME  256
00056 #define CB_MAX_CAB_PATH      256
00057 #define CB_MAX_DISK_NAME     256
00058 
00059 /**********************************************************************/
00060 
00061 typedef unsigned short TCOMP;
00062 
00063 #define tcompMASK_TYPE          0x000F  /* Mask for compression type */
00064 #define tcompTYPE_NONE          0x0000  /* No compression */
00065 #define tcompTYPE_MSZIP         0x0001  /* MSZIP */
00066 #define tcompTYPE_QUANTUM       0x0002  /* Quantum */
00067 #define tcompTYPE_LZX           0x0003  /* LZX */
00068 #define tcompBAD                0x000F  /* Unspecified compression type */
00069 
00070 #define tcompMASK_LZX_WINDOW    0x1F00  /* Mask for LZX Compression Memory */
00071 #define tcompLZX_WINDOW_LO      0x0F00  /* Lowest LZX Memory (15) */
00072 #define tcompLZX_WINDOW_HI      0x1500  /* Highest LZX Memory (21) */
00073 #define tcompSHIFT_LZX_WINDOW        8  /* Amount to shift over to get int */
00074 
00075 #define tcompMASK_QUANTUM_LEVEL 0x00F0  /* Mask for Quantum Compression Level */
00076 #define tcompQUANTUM_LEVEL_LO   0x0010  /* Lowest Quantum Level (1) */
00077 #define tcompQUANTUM_LEVEL_HI   0x0070  /* Highest Quantum Level (7) */
00078 #define tcompSHIFT_QUANTUM_LEVEL     4  /* Amount to shift over to get int */
00079 
00080 #define tcompMASK_QUANTUM_MEM   0x1F00  /* Mask for Quantum Compression Memory */
00081 #define tcompQUANTUM_MEM_LO     0x0A00  /* Lowest Quantum Memory (10) */
00082 #define tcompQUANTUM_MEM_HI     0x1500  /* Highest Quantum Memory (21) */
00083 #define tcompSHIFT_QUANTUM_MEM       8  /* Amount to shift over to get int */
00084 
00085 #define tcompMASK_RESERVED      0xE000  /* Reserved bits (high 3 bits) */
00086 
00087 /**********************************************************************/
00088 
00089 #define CompressionTypeFromTCOMP(tc) \
00090     ((tc) & tcompMASK_TYPE)
00091 
00092 #define CompressionLevelFromTCOMP(tc) \
00093     (((tc) & tcompMASK_QUANTUM_LEVEL) >> tcompSHIFT_QUANTUM_LEVEL)
00094 
00095 #define CompressionMemoryFromTCOMP(tc) \
00096     (((tc) & tcompMASK_QUANTUM_MEM) >> tcompSHIFT_QUANTUM_MEM)
00097 
00098 #define TCOMPfromTypeLevelMemory(t, l, m) \
00099     (((m) << tcompSHIFT_QUANTUM_MEM  ) | \
00100      ((l) << tcompSHIFT_QUANTUM_LEVEL) | \
00101      ( t                             ))
00102 
00103 #define LZXCompressionWindowFromTCOMP(tc) \
00104     (((tc) & tcompMASK_LZX_WINDOW) >> tcompSHIFT_LZX_WINDOW)
00105 
00106 #define TCOMPfromLZXWindow(w) \
00107     (((w) << tcompSHIFT_LZX_WINDOW) | \
00108      ( tcompTYPE_LZX              ))
00109 
00110 #endif /* !defined(INCLUDED_TYPES_FCI_FDI) */
00111 
00112 /***********************************************************************
00113  * FCI declarations
00114  */
00115 
00116 typedef enum {
00117     FCIERR_NONE,
00118     FCIERR_OPEN_SRC,
00119     FCIERR_READ_SRC,
00120     FCIERR_ALLOC_FAIL,
00121     FCIERR_TEMP_FILE,
00122     FCIERR_BAD_COMPR_TYPE,
00123     FCIERR_CAB_FILE,
00124     FCIERR_USER_ABORT,
00125     FCIERR_MCI_FAIL,
00126 } FCIERROR;
00127 
00128 /**********************************************************************/
00129 
00130 #ifndef _A_NAME_IS_UTF
00131 #define _A_NAME_IS_UTF  0x80
00132 #endif
00133 
00134 #ifndef _A_EXEC
00135 #define _A_EXEC         0x40
00136 #endif
00137 
00138 /**********************************************************************/
00139 
00140 typedef void *HFCI;
00141 
00142 /**********************************************************************/
00143 
00144 typedef struct {
00145     ULONG cb;              /* Size available for cabinet on this media */
00146     ULONG cbFolderThresh;  /* Threshold for forcing a new Folder */
00147 
00148     UINT  cbReserveCFHeader;     /* Space to reserve in CFHEADER */
00149     UINT  cbReserveCFFolder;     /* Space to reserve in CFFOLDER */
00150     UINT  cbReserveCFData;       /* Space to reserve in CFDATA */
00151     int   iCab;                  /* Sequential numbers for cabinets */
00152     int   iDisk;                 /* Disk number */
00153 #ifndef REMOVE_CHICAGO_M6_HACK
00154     int   fFailOnIncompressible; /* TRUE => Fail if a block is incompressible */
00155 #endif
00156 
00157     USHORT setID; /* Cabinet set ID */
00158 
00159     char szDisk[CB_MAX_DISK_NAME];   /* Current disk name */
00160     char szCab[CB_MAX_CABINET_NAME]; /* Current cabinet name */
00161     char szCabPath[CB_MAX_CAB_PATH]; /* Path for creating cabinet */
00162 } CCAB, *PCCAB;
00163 
00164 /**********************************************************************/
00165 
00166 typedef void * (__cdecl __WINE_ALLOC_SIZE(1) *PFNFCIALLOC)(ULONG cb);
00167 #define FNFCIALLOC(fn) void * __cdecl fn(ULONG cb)
00168 
00169 typedef void (__cdecl *PFNFCIFREE)(void *memory);
00170 #define FNFCIFREE(fn) void __cdecl fn(void *memory)
00171 
00172 typedef INT_PTR (__cdecl *PFNFCIOPEN) (char *pszFile, int oflag, int pmode, int *err, void *pv);
00173 #define FNFCIOPEN(fn) INT_PTR __cdecl fn(char *pszFile, int oflag, int pmode, int *err, void *pv)
00174 
00175 typedef UINT (__cdecl *PFNFCIREAD) (INT_PTR hf, void *memory, UINT cb, int *err, void *pv);
00176 #define FNFCIREAD(fn) UINT __cdecl fn(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
00177 
00178 typedef UINT (__cdecl *PFNFCIWRITE)(INT_PTR hf, void *memory, UINT cb, int *err, void *pv);
00179 #define FNFCIWRITE(fn) UINT __cdecl fn(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
00180 
00181 typedef int  (__cdecl *PFNFCICLOSE)(INT_PTR hf, int *err, void *pv);
00182 #define FNFCICLOSE(fn) int __cdecl fn(INT_PTR hf, int *err, void *pv)
00183 
00184 typedef LONG (__cdecl *PFNFCISEEK) (INT_PTR hf, LONG dist, int seektype, int *err, void *pv);
00185 #define FNFCISEEK(fn) LONG __cdecl fn(INT_PTR hf, LONG dist, int seektype, int *err, void *pv)
00186 
00187 typedef int  (__cdecl *PFNFCIDELETE) (char *pszFile, int *err, void *pv);
00188 #define FNFCIDELETE(fn) int __cdecl fn(char *pszFile, int *err, void *pv)
00189 
00190 typedef BOOL (__cdecl *PFNFCIGETNEXTCABINET)(PCCAB pccab, ULONG  cbPrevCab, void *pv);
00191 #define FNFCIGETNEXTCABINET(fn) BOOL __cdecl fn(PCCAB pccab, \
00192                         ULONG  cbPrevCab, \
00193                         void *pv)
00194 
00195 typedef int (__cdecl *PFNFCIFILEPLACED)(PCCAB pccab,
00196                     char *pszFile,
00197                     LONG  cbFile,
00198                     BOOL  fContinuation,
00199                     void *pv);
00200 #define FNFCIFILEPLACED(fn) int __cdecl fn(PCCAB pccab, \
00201                        char *pszFile, \
00202                                            LONG  cbFile, \
00203                        BOOL  fContinuation, \
00204                        void *pv)
00205 
00206 typedef INT_PTR (__cdecl *PFNFCIGETOPENINFO)(char *pszName,
00207                          USHORT *pdate,
00208                          USHORT *ptime,
00209                          USHORT *pattribs,
00210                          int *err,
00211                          void *pv);
00212 #define FNFCIGETOPENINFO(fn) INT_PTR __cdecl fn(char *pszName, \
00213                         USHORT *pdate, \
00214                         USHORT *ptime, \
00215                         USHORT *pattribs, \
00216                         int *err, \
00217                         void *pv)
00218 
00219 #define statusFile     0  /* Add File to Folder callback */
00220 #define statusFolder   1  /* Add Folder to Cabinet callback */
00221 #define statusCabinet  2  /* Write out a completed cabinet callback */
00222 
00223 typedef LONG (__cdecl *PFNFCISTATUS)(UINT typeStatus,
00224                      ULONG cb1,
00225                      ULONG cb2,
00226                      void *pv);
00227 #define FNFCISTATUS(fn) LONG __cdecl fn(UINT typeStatus, \
00228                     ULONG  cb1, \
00229                     ULONG  cb2, \
00230                     void *pv)
00231 
00232 typedef BOOL (__cdecl *PFNFCIGETTEMPFILE)(char *pszTempName,
00233                       int   cbTempName,
00234                       void *pv);
00235 #define FNFCIGETTEMPFILE(fn) BOOL __cdecl fn(char *pszTempName, \
00236                                              int   cbTempName, \
00237                                              void *pv)
00238 
00239 /**********************************************************************/
00240 
00241 HFCI __cdecl FCICreate(PERF, PFNFCIFILEPLACED, PFNFCIALLOC, PFNFCIFREE,
00242                PFNFCIOPEN, PFNFCIREAD, PFNFCIWRITE, PFNFCICLOSE,
00243                PFNFCISEEK, PFNFCIDELETE, PFNFCIGETTEMPFILE, PCCAB,
00244                void *);
00245 BOOL __cdecl FCIAddFile(HFCI, char *, char *, BOOL, PFNFCIGETNEXTCABINET,
00246             PFNFCISTATUS, PFNFCIGETOPENINFO, TCOMP);
00247 BOOL __cdecl FCIFlushCabinet(HFCI, BOOL, PFNFCIGETNEXTCABINET, PFNFCISTATUS);
00248 BOOL __cdecl FCIFlushFolder(HFCI, PFNFCIGETNEXTCABINET, PFNFCISTATUS);
00249 BOOL __cdecl FCIDestroy(HFCI hfci);
00250 
00251 /**********************************************************************/
00252 
00253 #include <poppack.h>
00254 
00255 #ifdef __cplusplus
00256 } /* extern "C" */
00257 #endif /* defined(__cplusplus) */
00258 
00259 #endif  /* __WINE_FCI_H */

Generated on Fri May 25 2012 04:30:00 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.