home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of Windows 95.com 1996 September
/
WIN95_09964.iso
/
disktool
/
cabrsckt.exe
/
FCI_INT.H
next >
Wrap
C/C++ Source or Header
|
1996-07-31
|
14KB
|
450 lines
/*** fci_int.h - File Compression Interface definitions
*
* Microsoft Confidential
* Copyright (C) Microsoft Corporation 1993-1996
* All Rights Reserved.
*/
#ifndef INCLUDED_FCI
#define INCLUDED_FCI 1
//** Specify structure packing explicitly for clients of FCI
#pragma pack(4)
/*** FCIERROR - Error codes returned in erf.erfOper field
*
*/
typedef enum {
FCIERR_NONE, // No error
FCIERR_OPEN_SRC, // Failure opening file to be stored in cabinet
// erf.erfTyp has C run-time *errno* value
FCIERR_READ_SRC, // Failure reading file to be stored in cabinet
// erf.erfTyp has C run-time *errno* value
FCIERR_ALLOC_FAIL, // Out of memory in FCI
FCIERR_TEMP_FILE, // Could not create a temporary file
// erf.erfTyp has C run-time *errno* value
FCIERR_BAD_COMPR_TYPE, // Unknown compression type
FCIERR_CAB_FILE, // Could not create cabinet file
// erf.erfTyp has C run-time *errno* value
FCIERR_USER_ABORT, // Client requested abort
FCIERR_MCI_FAIL, // Failure compressing data
#ifndef REMOVE_CHICAGO_M6_HACK
FCIERR_M6_HACK_INCOMPRESSIBLE, // Data was incompressible
#endif
} FCIERROR;
/*** HFCI - Handle to an FCI Context
*
*/
typedef void * HFCI;
/*** CCAB - Current Cabinet
*
* This structure is used for passing in the cabinet parameters to FCI,
* and is passed back on certain FCI callbacks to provide cabinet
* information to the client.
*/
typedef struct {
// longs first
ULONG cb; // size available for cabinet on this media
ULONG cbFolderThresh; // Thresshold for forcing a new Folder
// then ints
UINT cbReserveCFHeader; // Space to reserve in CFHEADER
UINT cbReserveCFFolder; // Space to reserve in CFFOLDER
UINT cbReserveCFData; // Space to reserve in CFDATA
int iCab; // sequential numbers for cabinets
int iDisk; // Disk number
#ifndef REMOVE_CHICAGO_M6_HACK
int fFailOnIncompressible; // TRUE => Fail if a block is incompressible
#endif
// then shorts
USHORT setID; // Cabinet set ID
// then chars
char szDisk[CB_MAX_DISK_NAME]; // current disk name
char szCab[CB_MAX_CABINET_NAME]; // current cabinet name
char szCabPath[CB_MAX_CAB_PATH]; // path for creating cabinet
} CCAB; /* ccab */
typedef CCAB *PCCAB; /* pccab */
/*** FNFCIGETNEXTCABINET - Callback used to request new cabinet info
*
* Entry:
* pccab - Points to copy of old ccab structure to modify
* cbPrevCab - Estimate of size of previous cabinet
* pv - Has the caller's context pointer
*
* Exit-Success:
* returns TRUE;
*
* Exit-Failure:
* returns FALSE;
*/
typedef BOOL (DIAMONDAPI *PFNFCIGETNEXTCABINET)(PCCAB pccab,
ULONG cbPrevCab,
void *pv); /* pfnfcignc */
#define FNFCIGETNEXTCABINET(fn) BOOL DIAMONDAPI fn(PCCAB pccab, \
ULONG cbPrevCab, \
void *pv)
/*** FNFCIFILEPLACED - Notify FCI client that file was placed
*
* Entry:
* pccab - cabinet structure to fill in, with copy of previous one
* pszFile - name of file, from cabinet
* cbFile - length of file
* fContinuation - true if this is a later segment of a continued file
* pv - the context of the client
*
* Exit-Success:
* return value anything but -1
*
* Exit-Failure:
* return value -1 zakP_FILpoin ccahn
*hn
M valre:
* N //FNFCIGETNEXTC TRUT)(PCCAB pccab,
hat file w ULONG cbPrevCab,
]; /*om cabi ULONG cbPrevCab,
* ULONG cbPrevCab,
a later segme ULONG cbPrevCab,
CurreFNFCIGETNEXTCAfpET(fn) BOOL DIAMONDAhat file wccab, TRU\
ULONG cbPrevCab, \
]; /*om cabi ULONG cbPrevCab, \
* ULONG cbPrevCab, \
a later segme ULONG cbPrevCab, \
CurreFNFNotify FCI clienCDAPI openINFO - Op ourceile getM6_He/R_AB/attribs - cabinet structureszN c --OVE_CleteAB; /*s oneeX_CAB_Ptructure6_He
*
- cef structhn
*hFAT-styleM6_HeieldB_PtructureR_ABO *
- cef structhn
*hFAT-styleMR_ABOeldB_Ptructureattribs
- cef structhn
*hFAT-styleMattributesntext of the client--OV -Success: return value anything but -1
*Rn
*hn
M is
* h
type
* p inet return value -1 zakP_FILpoin ccaRn
*hn
M is retFCIGETNEXTC TRUT)(PCCAB pccab,
PI openINFO)(]; // *eszN void *pv); /* pfnfcignc */abinet *e6_He void *pv); /* pfnfcignc */abinet *eR_AB void *pv); /* pfnfcignc */abinet *eattribs void *pv); /* pfnfcignc */EPLACEe FNFCIGETNEXTCABoiET(fn) BOOL DIAMONDAPI openINFOccab, TRU\
]; // *eszN ULONG cbPrevCab, \
abinet *e6_He ULONG cbPrevCab, \
abinet *eR_AB ULONG cbPrevCab, \
abinet *eattribs ULONG cbPrevCab, \
EPLACEe FNF ULONG cbfy FCI client tSTATUS - Status/
chaS pv inform - cabinet structurGETNStatus == status ifOVE_CHICAGO_Mf
// n* N f cbResstructurevCab, \
]b1 =aS pv ofOVE_CHICA to
//esstructurevCab, \
]b2 =aS pv ofOunVE_CHICA to
//esstt structurGETNStatus == status cbRendifddGO_Mff cbR * N - length of file
evCab, \
]b1 =aAmoupv f cbR copi *
*th copy oo faresstructurevCab, \
]b2 =aTotal pv f cbResstt structurGETNStatus == status
chandiwri
typout _CleteA length of file
evCab, \
]b1 =ainet
*d*th copy o pv try: p - naly of file
evCab, \
acks tos onXTCAGetNext
ch().esstructurevCab, \
]b2 =aActual th copy o pvesstructurevCab, \
NOTE:aRn
*hn
M isdesi
* Eno pv of file
evCab, \
.d in ue6_He *
*maximum th copy o pvesstructurevCab, \
in ccahnmait
uAGO_Mtinuen
M.sing inallow fil* retructurevCab, \
in ccas ogener_HeimultiCle {
AX_C,CI cahavvesstructurevCab, \
in ccain limit*
*o pv correcpack--s:
* n doesstructurevCab, \
in ccaclus
* pv roundGO_Mo
* and is p pv!esstructurevCab, \
in ccaT
* sh ei * rthn
*hcb2, roundhcb2esstructurevCab, \
in ccaupas osome larg rtxit-Faildthn
*htry:.urn value anything but -1
*Rn
*sailure:
o * rttryn -1;but -1
*NOTE:aSee status
cha stly alahn
*hn
Ms! return value -1 zakP_FILpoin ccaRn
*s as osignalatry:in sh ;define INCOOL DIAstatus 0r szAddnitionon c cbR c inform COOL DIAstatus cbR 1r szAddni cbR * N
chac inform COOL DIAstatus
cha 2r szWri * ut _Cleted*th copy c inform CIGETNEXTC T)(PCCAB pccab,
STATUS)(pace toGETNStatus void *pv); /* pfnfcignc 1 void *pv); /* pfnfcignc 2 void *pv); /* pfnfcigncdefine FNFCIGETNEXTCAsET(fn) BOOL DIAMONDASTATUSccab, \
pace toGETNStatus ULONG cbPrevCab, \
1 ULONG cbPrevCab, \
2 ULONG cbPrevCab, \
EPLACED - Notify FCI client tGETt crhat cabinet inf,* Entrys //AX_CAB_P - cabinet structureszT N c- BuffbR * Nreceive _CleteA //AX_CAB_P ]bT N c - S pv szT N cbuffbR return value anything but -1
*
* E return value -1 zakP_FILpoin ccahn
*hNDAPI //, buffbR * o smnet return vaNot_FILpoin ccaIt isconceiv Utry:tinuefuncf strmayahn
*haoneeX_CAB_Ptructurtry: e
alinety exist by
* R_ABOit is p ed.d iortinuILpoin ccahnasme
* Exit sh make severalMatt to mod B_Ptructurt //s before giv
up.*PFNFCIGETNEXTCABINET)(PCCAB pccab,
t crhat )(]; /* szT N void *pv); /* pfnfcignc */
TRUE ]bT N FCIGETNEXTCABtfET(fn) BOOL DIAMONDAPI t crhat ccab, \
]; /* szT N void *pv)
/*** FNFCI TRUE ]bT N Fodes returned in C --OV et
* it-Succ( et p CAB,CI t p FOL)B_P - cabinet structureerft
*
of previouwheiouweahn
*heer field
t structureEXTCAfpE withet infoto
typed* Exit of eventual dtry: true i
t structureEXat
*
E, allocef strfuncf str inform ructureEXTt
*
E, freerfuncf str inform ructureEXTCABtfE-rt //AX_CAogener_Horr inform ructure ccab struc *
*th copy/AX_CABINE & pv of previo return vaNot_g but -1(1)aT
alloc/freer informatmustahnmaithn
id throughoutB_Ptructurtre lifecess:
*it-Suc,aupas oI calncludGO_Mtier inas B_PtructurFCIDtryroy.urn va(2)aT
eerft * in t :
*iE, it-Succ(HCI),B_PtructurI caanyheer fs -sub
int
* ins aren t :
B_Ptructurerfttry: pcks to *tinu** in. return value anything but -1
*Rn
*s non-NULL h
typedef void * it-Suc. return value -1 zakP_FILpoin ccaRn
*sNULL, eerftne
to .*PFNFCI
*
\
in C (PERF
/*** FNFCIeerf void *pv)ab,
hat file wureEXTCAfp void *pv)ab,emory* FNFCIefna void *pv)ab,REE * FNFCIefnf void *pv)ab,
GETt crhat ceEXTCABtf void *pv)a * FNFCIe cca void *pv)binet
*
*
Addition-zAddnaMAX_CA ff cbR/cs used for passicabinet structurhTCAlient
*
* it-Succh
typt structureszSourceition-zN cbFile fdtos on cbResstructurom cabiN c n-zN cs ost n* Nf cbR/cs used for Executet
*
laCI,dic/
typexecutetonpextract ructureEX_prog tructrog t inform ructureEXTCABnc
*
GetNext
cht inform ructureEXTCAsnt
*
Status inform ructureEXTCABoi
*
Op Info inform ructurGETNs
*
*
TETN ofOVE_CHICA structusv tinuef context of the client
*
*
*thExit-Su nalaccess: return value anything but -1
*ure:
* returns FALSE;
*/
typedef BOOL (DIAMONDAPI,heer fine
to ypedef Bypedef BTinued f
*maitrfuncf str
*
*fdtof co(s) * N - length of file serie*** . Iss:
*szCabPale ca
ss:
*szCabP of filef cbR/cs used * Noverflows:
AX_CAimag
*szCabPly be:
* ilt,B_Ptruct * and is p e
b rmin
*d,CI caa:
* p/AX_CABINE e
B_Ptructb prE_CtrameterviaN - linform. aT
eendGO_Mf cbR e
b rimmb file ss:
d} FCIhich
FCIEalinety beenogener_He :
Conshed*th copy.*PFNFCI \
Additio(
*
hTCA void *pv);]; // *eszSourceitio void *pv);]; // *eszcabiN void *pv); b, \
Execute void *pv);ab,
ureEXTCABnc void *pv);ab,
STATUS FNFCIefnfcis void *pv);ab,
openINFO ctureEXTCABoi void *pv);Tressab, \
in ccasETNs
*
void *pv);EPLACEe *ev void *pv))bin ULONG cbfy
*
*
Flush
cht-ns
leteA
*szCabPaand is puncbR conof preion for passing in e
ca
A
*szCabPaand is p(assum FCI,t is y)as B_Ptrube ga * r *
ge * rtI cawritetructAX_C. for passicabinet structurhTCAlient
* it-Suc for GetNext
Tresssiblinet GetNext
as oget -ef str
typ;esstructurevCab, \
NDAPIsiblDon'ht in GetNext
aunl
*tinue of file
evCab, \
ile verflows. ructureEXTCABnc
withet infofuncf strs oget -ef str / ructureEXTCAsnt
withet infofuncf stretersrog trepor
tyntext of the client
-*thExit-Su nalaccess: informa return value anything but -1
*
* EeldE return value -1 zakP_FILpoin ccahn
*heldENDAPI,heer fiof previoune
to ypedFCI \
Flush
ch(
*
hTCA void *pv);*pv); b, \
GetNext
void *pv);*pv);ab,
ureEXTCABnc void *pv);*pv);ab,
STATUS FNFCIefnfcis void *pv);*pv);EPLACEe *ev void *pv) *pv)binet
*
*
Flushi cbR -ns
leteA
*szCabPaf cbR uncbR conof preion for passing in e
intseA
rmin
strofA
*szCabPaf cbR,CIhich
mayaoResstrumaya a
Aonee m //s _Cleted. for passicabinet structurhTCAlient
* it-Suc for GetNext
a withet infofuncf strs oget -ef str / ructureEXtrog twithet infofuncf stretersrog trepor
tyntext of the client
-*thExit-Su nalaccess: informa return value anything but -1
*
* EeldE return value -1 zakP_FILpoin ccahn
*heldENDAPI,heer fiof previoune
to ypedFCI \
Flushi cbR(
*
hTCA void *pv);*pv)ab,
ureEXTCABnc void *pv);*pv)ab,
STATUS FNFCIefnfcis void *pv);*pv)EPLACEe *ev void *pv) *p)binet
*
*
Dtryroy - Dtryroy a
* it-SuccI cadeleteA rue i
t st passicabinet structurhTCAl
* it-Suc forurn value anything but -1
*
* EeldE return value -1 zakP_FILpoin ccahn
*heldENDAPI,heer fiof previoune
to ypedFCI \
Dtryroy (
*
hTCA)bin ULONG cb
plicReverd * Ndefaultr clients of FCI