42#define timespec timeval
43#define tv_nsec tv_usec
48#define CDF_LOOP_LIMIT 10000
49#define CDF_ELEMENT_LIMIT 100000
51#define CDF_SECID_NULL 0
52#define CDF_SECID_FREE -1
53#define CDF_SECID_END_OF_CHAIN -2
54#define CDF_SECID_SECTOR_ALLOCATION_TABLE -3
55#define CDF_SECID_MASTER_SECTOR_ALLOCATION_TABLE -4
59#define CDF_MAGIC 0xE11AB1A1E011CFD0LL
78#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
79#define CDF_SEC_POS(h, secid) (CDF_SEC_SIZE(h) + (secid) * CDF_SEC_SIZE(h))
80#define CDF_SHORT_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_short_sec_size_p2)
81#define CDF_SHORT_SEC_POS(h, secid) ((secid) * CDF_SHORT_SEC_SIZE(h))
84#define CDF_DIRID_NULL -1
87#define CDF_BASE_YEAR 1601
88#define CDF_TIME_PREC 10000000
94#define CDF_DIR_TYPE_EMPTY 0
95#define CDF_DIR_TYPE_USER_STORAGE 1
96#define CDF_DIR_TYPE_USER_STREAM 2
97#define CDF_DIR_TYPE_LOCKBYTES 3
98#define CDF_DIR_TYPE_PROPERTY 4
99#define CDF_DIR_TYPE_ROOT_STORAGE 5
101#define CDF_DIR_COLOR_READ 0
102#define CDF_DIR_COLOR_BLACK 1
115#define CDF_DIRECTORY_SIZE 128
150#define CDF_SECTION_DECLARATION_OFFSET 0x1c
180#define pi_u64 pi_val._pi_u64
181#define pi_s64 pi_val._pi_s64
182#define pi_u32 pi_val._pi_u32
183#define pi_s32 pi_val._pi_s32
184#define pi_u16 pi_val._pi_u16
185#define pi_s16 pi_val._pi_s16
186#define pi_f pi_val._pi_f
187#define pi_d pi_val._pi_d
188#define pi_tp pi_val._pi_tp
189#define pi_str pi_val._pi_str
192#define CDF_ROUND(val, by) (((val) + (by) - 1) & ~((by) - 1))
195#define CDF_EMPTY 0x00000000
196#define CDF_NULL 0x00000001
197#define CDF_SIGNED16 0x00000002
198#define CDF_SIGNED32 0x00000003
199#define CDF_FLOAT 0x00000004
200#define CDF_DOUBLE 0x00000005
201#define CDF_CY 0x00000006
202#define CDF_DATE 0x00000007
203#define CDF_BSTR 0x00000008
204#define CDF_DISPATCH 0x00000009
205#define CDF_ERROR 0x0000000a
206#define CDF_BOOL 0x0000000b
207#define CDF_VARIANT 0x0000000c
208#define CDF_UNKNOWN 0x0000000d
209#define CDF_DECIMAL 0x0000000e
210#define CDF_SIGNED8 0x00000010
211#define CDF_UNSIGNED8 0x00000011
212#define CDF_UNSIGNED16 0x00000012
213#define CDF_UNSIGNED32 0x00000013
214#define CDF_SIGNED64 0x00000014
215#define CDF_UNSIGNED64 0x00000015
216#define CDF_INT 0x00000016
217#define CDF_UINT 0x00000017
218#define CDF_VOID 0x00000018
219#define CDF_HRESULT 0x00000019
220#define CDF_PTR 0x0000001a
221#define CDF_SAFEARRAY 0x0000001b
222#define CDF_CARRAY 0x0000001c
223#define CDF_USERDEFINED 0x0000001d
224#define CDF_LENGTH32_STRING 0x0000001e
225#define CDF_LENGTH32_WSTRING 0x0000001f
226#define CDF_FILETIME 0x00000040
227#define CDF_BLOB 0x00000041
228#define CDF_STREAM 0x00000042
229#define CDF_STORAGE 0x00000043
230#define CDF_STREAMED_OBJECT 0x00000044
231#define CDF_STORED_OBJECT 0x00000045
232#define CDF_BLOB_OBJECT 0x00000046
233#define CDF_CLIPBOARD 0x00000047
234#define CDF_CLSID 0x00000048
235#define CDF_VECTOR 0x00001000
236#define CDF_ARRAY 0x00002000
237#define CDF_BYREF 0x00004000
238#define CDF_RESERVED 0x00008000
239#define CDF_ILLEGAL 0x0000ffff
240#define CDF_ILLEGALMASKED 0x00000fff
241#define CDF_TYPEMASK 0x00000fff
243#define CDF_PROPERTY_CODE_PAGE 0x00000001
244#define CDF_PROPERTY_TITLE 0x00000002
245#define CDF_PROPERTY_SUBJECT 0x00000003
246#define CDF_PROPERTY_AUTHOR 0x00000004
247#define CDF_PROPERTY_KEYWORDS 0x00000005
248#define CDF_PROPERTY_COMMENTS 0x00000006
249#define CDF_PROPERTY_TEMPLATE 0x00000007
250#define CDF_PROPERTY_LAST_SAVED_BY 0x00000008
251#define CDF_PROPERTY_REVISION_NUMBER 0x00000009
252#define CDF_PROPERTY_TOTAL_EDITING_TIME 0x0000000a
253#define CDF_PROPERTY_LAST_PRINTED 0X0000000b
254#define CDF_PROPERTY_CREATE_TIME 0x0000000c
255#define CDF_PROPERTY_LAST_SAVED_TIME 0x0000000d
256#define CDF_PROPERTY_NUMBER_OF_PAGES 0x0000000e
257#define CDF_PROPERTY_NUMBER_OF_WORDS 0x0000000f
258#define CDF_PROPERTY_NUMBER_OF_CHARACTERS 0x00000010
259#define CDF_PROPERTY_THUMBNAIL 0x00000011
260#define CDF_PROPERTY_NAME_OF_APPLICATION 0x00000012
261#define CDF_PROPERTY_SECURITY 0x00000013
262#define CDF_PROPERTY_LOCALE_ID 0x80000000
336char *
cdf_u16tos8(
char *,
size_t,
const uint16_t *);
340void cdf_dump_sat(
const char *,
const cdf_sat_t *,
size_t);
341void cdf_dump(
const void *,
size_t);
int cdf_read_doc_summary_info(const cdf_info_t *, const cdf_header_t *, const cdf_sat_t *, const cdf_sat_t *, const cdf_stream_t *, const cdf_dir_t *, cdf_stream_t *)
int cdf_print_classid(char *, size_t, const cdf_classid_t *)
int cdf_unpack_catalog(const cdf_header_t *, const cdf_stream_t *, cdf_catalog_t **)
int cdf_read_dir(const cdf_info_t *, const cdf_header_t *, const cdf_sat_t *, cdf_dir_t *)
void cdf_swap_header(cdf_header_t *)
void cdf_swap_class(cdf_classid_t *)
void cdf_unpack_header(cdf_header_t *, char *)
int cdf_print_elapsed_time(char *, size_t, cdf_timestamp_t)
int cdf_read_short_sector_chain(const cdf_header_t *, const cdf_sat_t *, const cdf_stream_t *, cdf_secid_t, size_t, cdf_stream_t *)
uint16_t cdf_tole2(uint16_t)
int cdf_timestamp_to_timespec(struct timespec *, cdf_timestamp_t)
int cdf_read_header(const cdf_info_t *, cdf_header_t *)
int cdf_read_long_sector_chain(const cdf_info_t *, const cdf_header_t *, const cdf_sat_t *, cdf_secid_t, size_t, cdf_stream_t *)
size_t cdf_count_chain(const cdf_sat_t *, cdf_secid_t, size_t)
int cdf_unpack_summary_info(const cdf_stream_t *, const cdf_header_t *, cdf_summary_info_header_t *, cdf_property_info_t **, size_t *)
int cdf_read_user_stream(const cdf_info_t *, const cdf_header_t *, const cdf_sat_t *, const cdf_sat_t *, const cdf_stream_t *, const cdf_dir_t *, const char *, cdf_stream_t *)
int cdf_print_property_name(char *, size_t, uint32_t)
int cdf_read_summary_info(const cdf_info_t *, const cdf_header_t *, const cdf_sat_t *, const cdf_sat_t *, const cdf_stream_t *, const cdf_dir_t *, cdf_stream_t *)
ssize_t cdf_read_sector(const cdf_info_t *, void *, size_t, size_t, const cdf_header_t *, cdf_secid_t)
uint32_t cdf_tole4(uint32_t)
int cdf_zero_stream(cdf_stream_t *)
int cdf_read_short_stream(const cdf_info_t *, const cdf_header_t *, const cdf_sat_t *, const cdf_dir_t *, cdf_stream_t *, const cdf_directory_t **)
int cdf_read_sector_chain(const cdf_info_t *, const cdf_header_t *, const cdf_sat_t *, const cdf_sat_t *, const cdf_stream_t *, cdf_secid_t, size_t, cdf_stream_t *)
void cdf_unpack_dir(cdf_directory_t *, char *)
void cdf_swap_dir(cdf_directory_t *)
char * cdf_ctime(const time_t *, char *)
int cdf_timespec_to_timestamp(cdf_timestamp_t *, const struct timespec *)
ssize_t cdf_read_short_sector(const cdf_stream_t *, void *, size_t, size_t, const cdf_header_t *, cdf_secid_t)
int cdf_find_stream(const cdf_dir_t *, const char *, int)
int cdf_read_sat(const cdf_info_t *, cdf_header_t *, cdf_sat_t *)
int cdf_read_property_info(const cdf_stream_t *, const cdf_header_t *, uint32_t, cdf_property_info_t **, size_t *, size_t *)
char * cdf_u16tos8(char *, size_t, const uint16_t *)
uint64_t cdf_tole8(uint64_t)
int cdf_read_ssat(const cdf_info_t *, const cdf_header_t *, const cdf_sat_t *, cdf_sat_t *)
cdf_catalog_entry_t cat_e[1]
cdf_directory_t * dir_tab
cdf_timestamp_t d_created
cdf_secid_t d_stream_first_sector
cdf_timestamp_t d_modified
cdf_dirid_t d_right_child
uint64_t d_storage_uuid[2]
const unsigned char * i_buf