|
|
|
1 |
|
/*** types.h - Common defines for FCI/FDI stuff -- goes into FCI/FDI.H |
2 |
|
* |
3 |
|
* Copyright (C) Microsoft Corporation |
4 |
|
* All Rights Reserved. |
5 |
|
* |
6 |
|
*/ |
7 |
|
|
8 |
|
#ifndef INCLUDED_TYPES_FCI_FDI |
9 |
|
#define INCLUDED_TYPES_FCI_FDI 1 |
10 |
|
|
11 |
|
#ifdef __cplusplus |
12 |
|
extern "C" { /* Assume C declarations for C++ */ |
13 |
|
#endif /* __cplusplus */ |
14 |
|
|
15 |
|
|
16 |
|
//** Define away for 32-bit build |
17 |
|
#ifndef HUGE |
18 |
|
#define HUGE |
19 |
|
#endif |
20 |
|
|
21 |
|
#ifndef FAR |
22 |
|
#define FAR |
23 |
|
#endif |
24 |
|
|
25 |
|
|
26 |
|
#ifndef DIAMONDAPI |
27 |
|
#define DIAMONDAPI __cdecl |
28 |
|
#endif |
29 |
|
|
30 |
|
|
31 |
|
//** Specify structure packing explicitly for clients of FDI |
32 |
|
|
33 |
|
#ifndef _WIN64 |
34 |
|
#include <pshpack4.h> |
35 |
|
#endif |
36 |
|
|
37 |
|
|
38 |
|
//** Don't redefine types defined in Win16 WINDOWS.H (_INC_WINDOWS) |
39 |
|
// or Win32 WINDOWS.H (_WINDOWS_) |
40 |
|
// |
41 |
|
#if !defined(_INC_WINDOWS) && !defined(_WINDOWS_) |
42 |
|
typedef int BOOL; /* f */ |
43 |
|
typedef unsigned char BYTE; /* b */ |
44 |
|
typedef unsigned int UINT; /* ui */ |
45 |
|
typedef unsigned short USHORT; /* us */ |
46 |
|
typedef unsigned long ULONG; /* ul */ |
47 |
|
#endif // _INC_WINDOWS |
48 |
|
|
49 |
|
typedef unsigned long CHECKSUM; /* csum */ |
50 |
|
|
51 |
|
typedef unsigned long UOFF; /* uoff - uncompressed offset */ |
52 |
|
typedef unsigned long COFF; /* coff - cabinet file offset */ |
53 |
|
|
54 |
|
|
55 |
|
#ifndef TRUE |
56 |
|
#define TRUE 1 |
57 |
|
#endif |
58 |
|
|
59 |
|
#ifndef FALSE |
60 |
|
#define FALSE 0 |
61 |
|
#endif |
62 |
|
|
63 |
|
#ifndef NULL |
64 |
|
#define NULL 0 |
65 |
|
#endif |
66 |
|
|
67 |
|
|
68 |
|
/*** ERF - Error structure |
69 |
|
* |
70 |
|
* This structure returns error information from FCI/FDI. The caller should |
71 |
|
* not modify this structure. |
72 |
|
*/ |
73 |
|
typedef struct { |
74 |
|
int erfOper; // FCI/FDI error code -- see FDIERROR_XXX |
75 |
|
// and FCIERR_XXX equates for details. |
76 |
|
|
77 |
|
int erfType; // Optional error value filled in by FCI/FDI. |
78 |
|
// For FCI, this is usually the C run-time |
79 |
|
// *errno* value. |
80 |
|
|
81 |
|
BOOL fError; // TRUE => error present |
82 |
|
} ERF; /* erf */ |
83 |
|
typedef ERF FAR *PERF; /* perf */ |
84 |
|
|
85 |
|
#ifdef _DEBUG |
86 |
|
// don't hide statics from map during debugging |
87 |
|
#define STATIC |
88 |
|
#else // !DEBUG |
89 |
|
#define STATIC static |
90 |
|
#endif // !DEBUG |
91 |
|
|
92 |
|
#define CB_MAX_CHUNK 32768U |
93 |
|
#define CB_MAX_DISK 0x7fffffffL |
94 |
|
#define CB_MAX_FILENAME 256 |
95 |
|
#define CB_MAX_CABINET_NAME 256 |
96 |
|
#define CB_MAX_CAB_PATH 256 |
97 |
|
#define CB_MAX_DISK_NAME 256 |
98 |
|
|
99 |
|
/*** tcompXXX - Diamond compression types |
100 |
|
* |
101 |
|
* These are passed to FCIAddFile(), and are also stored in the CFFOLDER |
102 |
|
* structures in cabinet files. |
103 |
|
* |
104 |
|
* NOTE: We reserve bits for the TYPE, QUANTUM_LEVEL, and QUANTUM_MEM |
105 |
|
* to provide room for future expansion. Since this value is stored |
106 |
|
* in the CFDATA records in the cabinet file, we don't want to |
107 |
|
* have to change the format for existing compression configurations |
108 |
|
* if we add new ones in the future. This will allows us to read |
109 |
|
* old cabinet files in the future. |
110 |
|
*/ |
111 |
|
|
112 |
|
typedef unsigned short TCOMP; /* tcomp */ |
113 |
|
|
114 |
|
#define tcompMASK_TYPE 0x000F // Mask for compression type |
601 |
|
/*** FCIFlushFolder - Complete the current folder under construction |
602 |
|
* |
603 |
|
* This will force the termination of the current folder, which may or |
604 |
|
* may not cause one or more cabinet files to be completed. |
605 |
|
* |
606 |
|
* Entry: |
607 |
|
* hfci - FCI context |
608 |
|
* GetNextCab - callback function to get continuation cabinets |
609 |
|
* pfnProgress - callback function for progress reporting |
610 |
|
* pv - caller's internal context for callbacks |
611 |
|
* |
612 |
|
* Exit-Success: |
613 |
|
* return code TRUE |
614 |
|
* |
615 |
|
* Exit-Failure: |
616 |
|
* return code FALSE, error structure filled in |
617 |
|
*/ |
618 |
|
BOOL DIAMONDAPI FCIFlushFolder(__in HFCI hfci, |
619 |
|
__callback PFNFCIGETNEXTCABINET pfnfcignc, |
620 |
|
__callback PFNFCISTATUS pfnfcis |
621 |
|
); |
622 |
|
|
623 |
|
|
624 |
|
/*** FCIDestroy - Destroy a FCI context and delete temp files |
625 |
|
* |
626 |
|
* Entry: |
627 |
|
* hfci - FCI context |
628 |
|
* |
629 |
|
* Exit-Success: |
630 |
|
* return code TRUE |
631 |
|
* |
632 |
|
* Exit-Failure: |
633 |
|
* return code FALSE, error structure filled in |
634 |
|
*/ |
635 |
|
BOOL DIAMONDAPI FCIDestroy (__in HFCI hfci); |
636 |
|
|
637 |
|
//** Revert to default structure packing |
638 |
|
|
639 |
|
#ifndef _WIN64 |
640 |
|
#include <poppack.h> |
641 |
|
#endif |
642 |
|
|
643 |
|
#ifdef __cplusplus |
644 |
|
} |
645 |
|
#endif /* __cplusplus */ |
646 |
|
|
647 |
|
#endif // !INCLUDED_FCI |
648 |
|
|
649 |
|
|
|
|
|