Mercurial > libpst
annotate src/libpst.h @ 44:d4606d460daf
more fixes for 64 bit format
author | carl |
---|---|
date | Tue, 08 Jan 2008 16:19:26 -0800 |
parents | f6db1f060a95 |
children | b2a7f2e0926a |
rev | line source |
---|---|
16 | 1 /*** |
2 * libpst.h | |
3 * Part of LibPST project | |
4 * Written by David Smith | |
5 * dave.s@earthcorp.com | |
6 */ | |
7 // LibPST - Library for Accessing Outlook .pst files | |
8 // Dave Smith - davesmith@users.sourceforge.net | |
9 | |
10 #ifndef LIBPST_H | |
11 #define LIBPST_H | |
12 | |
43 | 13 #include <stdint.h> |
14 | |
16 | 15 #ifndef _MSC_VER |
16 | |
17 #ifndef FILETIME_DEFINED | |
18 #define FILETIME_DEFINED | |
19 //Win32 Filetime struct - copied from WINE | |
20 typedef struct { | |
43 | 21 uint32_t dwLowDateTime; |
22 uint32_t dwHighDateTime; | |
16 | 23 } FILETIME; |
24 #endif //ifndef FILETIME_DEFINED | |
25 #endif //ifndef _MSC_VER | |
26 | |
27 // According to Jan Wolter, sys/param.h is the most portable source of endian | |
28 // information on UNIX systems. see http://www.unixpapa.com/incnote/byteorder.html | |
29 #ifdef _MSC_VER | |
30 #define BYTE_ORDER LITTLE_ENDIAN | |
31 #else | |
32 #include <sys/param.h> | |
33 #endif // defined _MSC_VER | |
34 | |
35 #if BYTE_ORDER == BIG_ENDIAN | |
36 # define LE64_CPU(x) \ | |
37 x = ((((x) & 0xff00000000000000) >> 56) | \ | |
38 (((x) & 0x00ff000000000000) >> 40) | \ | |
39 (((x) & 0x0000ff0000000000) >> 24) | \ | |
40 (((x) & 0x000000ff00000000) >> 8 ) | \ | |
41 (((x) & 0x00000000ff000000) << 8 ) | \ | |
42 (((x) & 0x0000000000ff0000) << 24) | \ | |
43 (((x) & 0x000000000000ff00) << 40) | \ | |
44 (((x) & 0x00000000000000ff) << 56)); | |
45 # define LE32_CPU(x) \ | |
46 x = ((((x) & 0xff000000) >> 24) | \ | |
47 (((x) & 0x00ff0000) >> 8 ) | \ | |
48 (((x) & 0x0000ff00) << 8 ) | \ | |
49 (((x) & 0x000000ff) << 24)); | |
50 # define LE16_CPU(x) \ | |
51 x = ((((x) & 0xff00) >> 8) | \ | |
52 (((x) & 0x00ff) << 8)); | |
53 #elif BYTE_ORDER == LITTLE_ENDIAN | |
54 # define LE64_CPU(x) {} | |
55 # define LE32_CPU(x) {} | |
56 # define LE16_CPU(x) {} | |
57 #else | |
58 # error "Byte order not supported by this library" | |
59 #endif // BYTE_ORDER | |
60 | |
61 | |
62 #ifdef _MSC_VER | |
63 #include "windows.h" | |
44 | 64 #define int32_t int |
43 | 65 #define uint32_t unsigned int |
44 | 66 #define int16_t short int |
43 | 67 #define uint16_t unsigned short int |
16 | 68 #endif // _MSC_VER |
69 | |
70 #define PST_TYPE_NOTE 1 | |
71 #define PST_TYPE_APPOINTMENT 8 | |
72 #define PST_TYPE_CONTACT 9 | |
73 #define PST_TYPE_JOURNAL 10 | |
74 #define PST_TYPE_STICKYNOTE 11 | |
75 #define PST_TYPE_TASK 12 | |
76 #define PST_TYPE_OTHER 13 | |
77 #define PST_TYPE_REPORT 14 | |
78 | |
79 // defines whether decryption is done on this bit of data | |
80 #define PST_NO_ENC 0 | |
81 #define PST_ENC 1 | |
82 | |
83 // defines types of possible encryption | |
84 #define PST_NO_ENCRYPT 0 | |
85 #define PST_COMP_ENCRYPT 1 | |
86 #define PST_ENCRYPT 2 | |
87 | |
88 // defines different types of mappings | |
89 #define PST_MAP_ATTRIB 1 | |
90 #define PST_MAP_HEADER 2 | |
91 | |
92 // define my custom email attributes. | |
93 #define PST_ATTRIB_HEADER -1 | |
94 | |
95 // defines types of free/busy values for appointment->showas | |
96 #define PST_FREEBUSY_FREE 0 | |
97 #define PST_FREEBUSY_TENTATIVE 1 | |
98 #define PST_FREEBUSY_BUSY 2 | |
99 #define PST_FREEBUSY_OUT_OF_OFFICE 3 | |
100 | |
101 // defines labels for appointment->label | |
102 #define PST_APP_LABEL_NONE 0 // None | |
103 #define PST_APP_LABEL_IMPORTANT 1 // Important | |
104 #define PST_APP_LABEL_BUSINESS 2 // Business | |
105 #define PST_APP_LABEL_PERSONAL 3 // Personal | |
106 #define PST_APP_LABEL_VACATION 4 // Vacation | |
107 #define PST_APP_LABEL_MUST_ATTEND 5 // Must Attend | |
108 #define PST_APP_LABEL_TRAVEL_REQ 6 // Travel Required | |
109 #define PST_APP_LABEL_NEEDS_PREP 7 // Needs Preparation | |
110 #define PST_APP_LABEL_BIRTHDAY 8 // Birthday | |
111 #define PST_APP_LABEL_ANNIVERSARY 9 // Anniversary | |
112 #define PST_APP_LABEL_PHONE_CALL 10// Phone Call | |
113 | |
43 | 114 extern int do_read64; |
115 | |
16 | 116 typedef struct _pst_misc_6_struct { |
117 int32_t i1; | |
118 int32_t i2; | |
119 int32_t i3; | |
120 int32_t i4; | |
121 int32_t i5; | |
122 int32_t i6; | |
123 } pst_misc_6; | |
124 | |
125 typedef struct _pst_entryid_struct { | |
126 int32_t u1; | |
127 char entryid[16]; | |
43 | 128 uint32_t id; |
16 | 129 } pst_entryid; |
130 | |
43 | 131 typedef struct _pst_desc_struct32 { |
132 uint32_t d_id; | |
133 uint32_t desc_id; | |
134 uint32_t list_id; | |
135 uint32_t parent_id; | |
136 } pst_desc32; | |
16 | 137 |
43 | 138 typedef struct _pst_desc_structn { |
139 uint64_t d_id; | |
140 uint64_t desc_id; | |
141 uint64_t list_id; | |
142 uint32_t parent_id; // not 64 bit ?? | |
143 uint32_t u1; // padding | |
144 } pst_descn; | |
145 | |
146 typedef struct _pst_index_struct32 { | |
147 uint32_t id; | |
148 int32_t offset; | |
149 uint16_t size; | |
150 int16_t u1; | |
151 } pst_index32; | |
152 | |
153 typedef struct _pst_index_struct { | |
154 uint64_t id; | |
155 int64_t offset; | |
156 uint16_t size; | |
157 int16_t u0; | |
158 int32_t u1; | |
16 | 159 } pst_index; |
160 | |
43 | 161 typedef struct _pst_index_tree32 { |
162 uint32_t id; | |
163 int32_t offset; | |
164 int32_t size; | |
165 int32_t u1; | |
166 struct _pst_index_tree * next; | |
167 } pst_index_ll32; | |
168 | |
16 | 169 typedef struct _pst_index_tree { |
43 | 170 uint64_t id; |
171 int64_t offset; | |
172 int64_t size; | |
173 int64_t u1; | |
16 | 174 struct _pst_index_tree * next; |
175 } pst_index_ll; | |
176 | |
177 typedef struct _pst_index2_tree { | |
43 | 178 uint32_t id2; |
16 | 179 pst_index_ll *id; |
180 struct _pst_index2_tree * next; | |
181 } pst_index2_ll; | |
182 | |
183 typedef struct _pst_desc_tree { | |
43 | 184 uint32_t id; |
16 | 185 pst_index_ll * list_index; |
186 pst_index_ll * desc; | |
187 int32_t no_child; | |
188 struct _pst_desc_tree * prev; | |
189 struct _pst_desc_tree * next; | |
190 struct _pst_desc_tree * parent; | |
191 struct _pst_desc_tree * child; | |
192 struct _pst_desc_tree * child_tail; | |
193 } pst_desc_ll; | |
194 | |
195 typedef struct _pst_item_email_subject { | |
196 int32_t off1; | |
197 int32_t off2; | |
43 | 198 char *subj; |
16 | 199 } pst_item_email_subject; |
200 | |
201 typedef struct _pst_item_email { | |
202 FILETIME *arrival_date; | |
41
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
203 int32_t autoforward; // 1 = true, 0 = not set, -1 = false |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
204 char *body; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
205 char *cc_address; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
206 char *common_name; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
207 int32_t conv_index; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
208 int32_t conversion_prohib; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
209 int32_t delete_after_submit; // 1 = true, 0 = false |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
210 int32_t delivery_report; // 1 = true, 0 = false |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
211 char *encrypted_body; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
212 int32_t encrypted_body_size; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
213 char *encrypted_htmlbody; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
214 int32_t encrypted_htmlbody_size; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
215 int32_t flag; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
216 char *header; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
217 char *htmlbody; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
218 int32_t importance; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
219 char *in_reply_to; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
220 int32_t message_cc_me; // 1 = true, 0 = false |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
221 int32_t message_recip_me; // 1 = true, 0 = false |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
222 int32_t message_to_me; // 1 = true, 0 = false |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
223 char *messageid; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
224 int32_t orig_sensitivity; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
225 char *outlook_recipient; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
226 char *outlook_recipient2; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
227 char *outlook_sender; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
228 char *outlook_sender_name; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
229 char *outlook_sender2; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
230 int32_t priority; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
231 char *proc_subject; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
232 int32_t read_receipt; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
233 char *recip_access; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
234 char *recip_address; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
235 char *recip2_access; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
236 char *recip2_address; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
237 int32_t reply_requested; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
238 char *reply_to; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
239 char *return_path_address; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
240 int32_t rtf_body_char_count; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
241 int32_t rtf_body_crc; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
242 char *rtf_body_tag; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
243 char *rtf_compressed; |
43 | 244 uint32_t rtf_compressed_size; |
41
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
245 int32_t rtf_in_sync; // 1 = true, 0 = doesn't exist, -1 = false |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
246 int32_t rtf_ws_prefix_count; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
247 int32_t rtf_ws_trailing_count; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
248 char *sender_access; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
249 char *sender_address; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
250 char *sender2_access; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
251 char *sender2_address; |
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
252 int32_t sensitivity; |
16 | 253 FILETIME *sent_date; |
254 pst_entryid *sentmail_folder; | |
41
183ae993b9ad
security fix for potential buffer overrun in lz decompress
carl
parents:
39
diff
changeset
|
255 char *sentto_address; |
16 | 256 pst_item_email_subject *subject; |
257 } pst_item_email; | |
258 | |
259 typedef struct _pst_item_folder { | |
260 int32_t email_count; | |
261 int32_t unseen_email_count; | |
262 int32_t assoc_count; | |
263 char subfolder; | |
264 } pst_item_folder; | |
265 | |
266 typedef struct _pst_item_message_store { | |
267 pst_entryid *deleted_items_folder; | |
268 pst_entryid *search_root_folder; | |
269 pst_entryid *top_of_personal_folder; | |
270 pst_entryid *top_of_folder; | |
271 int32_t valid_mask; // what folders the message store contains | |
272 int32_t pwd_chksum; | |
273 } pst_item_message_store; | |
274 | |
275 typedef struct _pst_item_contact { | |
276 char *access_method; | |
277 char *account_name; | |
278 char *address1; | |
279 char *address1a; | |
280 char *address1_desc; | |
281 char *address1_transport; | |
282 char *address2; | |
283 char *address2a; | |
284 char *address2_desc; | |
285 char *address2_transport; | |
286 char *address3; | |
287 char *address3a; | |
288 char *address3_desc; | |
289 char *address3_transport; | |
290 char *assistant_name; | |
291 char *assistant_phone; | |
292 char *billing_information; | |
293 FILETIME *birthday; | |
294 char *business_address; | |
295 char *business_city; | |
296 char *business_country; | |
297 char *business_fax; | |
298 char *business_homepage; | |
299 char *business_phone; | |
300 char *business_phone2; | |
301 char *business_po_box; | |
302 char *business_postal_code; | |
303 char *business_state; | |
304 char *business_street; | |
305 char *callback_phone; | |
306 char *car_phone; | |
307 char *company_main_phone; | |
308 char *company_name; | |
309 char *computer_name; | |
310 char *customer_id; | |
311 char *def_postal_address; | |
312 char *department; | |
313 char *display_name_prefix; | |
314 char *first_name; | |
315 char *followup; | |
316 char *free_busy_address; | |
317 char *ftp_site; | |
318 char *fullname; | |
319 int32_t gender; | |
320 char *gov_id; | |
321 char *hobbies; | |
322 char *home_address; | |
323 char *home_city; | |
324 char *home_country; | |
325 char *home_fax; | |
326 char *home_phone; | |
327 char *home_phone2; | |
328 char *home_po_box; | |
329 char *home_postal_code; | |
330 char *home_state; | |
331 char *home_street; | |
332 char *initials; | |
333 char *isdn_phone; | |
334 char *job_title; | |
335 char *keyword; | |
336 char *language; | |
337 char *location; | |
338 int32_t mail_permission; | |
339 char *manager_name; | |
340 char *middle_name; | |
341 char *mileage; | |
342 char *mobile_phone; | |
343 char *nickname; | |
344 char *office_loc; | |
345 char *org_id; | |
346 char *other_address; | |
347 char *other_city; | |
348 char *other_country; | |
349 char *other_phone; | |
350 char *other_po_box; | |
351 char *other_postal_code; | |
352 char *other_state; | |
353 char *other_street; | |
354 char *pager_phone; | |
355 char *personal_homepage; | |
356 char *pref_name; | |
357 char *primary_fax; | |
358 char *primary_phone; | |
359 char *profession; | |
360 char *radio_phone; | |
361 int32_t rich_text; | |
362 char *spouse_name; | |
363 char *suffix; | |
364 char *surname; | |
365 char *telex; | |
366 char *transmittable_display_name; | |
367 char *ttytdd_phone; | |
368 FILETIME *wedding_anniversary; | |
369 } pst_item_contact; | |
370 | |
371 typedef struct _pst_item_attach { | |
372 char *filename1; | |
373 char *filename2; | |
374 char *mimetype; | |
375 char *data; | |
36 | 376 size_t size; |
16 | 377 int32_t id2_val; |
378 int32_t id_val; // calculated from id2_val during creation of record | |
379 int32_t method; | |
380 int32_t position; | |
381 int32_t sequence; | |
382 struct _pst_item_attach *next; | |
383 } pst_item_attach; | |
384 | |
385 typedef struct _pst_item_extra_field { | |
386 char *field_name; | |
387 char *value; | |
388 struct _pst_item_extra_field *next; | |
389 } pst_item_extra_field; | |
390 | |
391 typedef struct _pst_item_journal { | |
392 FILETIME *end; | |
393 FILETIME *start; | |
394 char *type; | |
395 } pst_item_journal; | |
396 | |
397 typedef struct _pst_item_appointment { | |
398 FILETIME *end; | |
399 char *location; | |
400 FILETIME *reminder; | |
401 FILETIME *start; | |
402 char *timezonestring; | |
403 int32_t showas; | |
404 int32_t label; | |
31 | 405 int32_t all_day; |
16 | 406 } pst_item_appointment; |
407 | |
408 typedef struct _pst_item { | |
43 | 409 struct _pst_item_email *email; // data reffering to email |
410 struct _pst_item_folder *folder; // data reffering to folder | |
411 struct _pst_item_contact *contact; // data reffering to contact | |
412 struct _pst_item_attach *attach; // linked list of attachments | |
413 struct _pst_item_message_store *message_store; // data referring to the message store | |
414 struct _pst_item_extra_field *extra_fields; // linked list of extra headers and such | |
415 struct _pst_item_journal *journal; // data reffering to a journal entry | |
416 struct _pst_item_appointment *appointment; // data reffering to a calendar entry | |
417 int32_t type; | |
418 char *ascii_type; | |
419 char *file_as; | |
420 char *comment; | |
421 int32_t message_size; | |
422 char *outlook_version; | |
423 char *record_key; // probably 16 bytes long. | |
424 size_t record_key_size; | |
425 int32_t response_requested; | |
16 | 426 FILETIME *create_date; |
427 FILETIME *modify_date; | |
43 | 428 int32_t private_member; |
16 | 429 } pst_item; |
430 | |
431 typedef struct _pst_x_attrib_ll { | |
432 int32_t type; | |
433 int32_t mytype; | |
434 int32_t map; | |
435 void *data; | |
436 struct _pst_x_attrib_ll *next; | |
437 } pst_x_attrib_ll; | |
438 | |
439 typedef struct _pst_file { | |
440 pst_index_ll *i_head, *i_tail; | |
441 pst_index2_ll *i2_head; | |
442 pst_desc_ll *d_head, *d_tail; | |
443 pst_x_attrib_ll *x_head; | |
444 int32_t index1; | |
445 int32_t index1_count; | |
446 int32_t index2; | |
447 int32_t index2_count; | |
43 | 448 int64_t index1_64; |
449 int64_t index1_count_64; | |
450 int64_t index2_64; | |
451 int64_t index2_count_64; | |
31 | 452 FILE * fp; // file pointer to opened PST file |
453 size_t size; // pst file size | |
454 unsigned char encryption; // pst encryption setting | |
455 unsigned char ind_type; // pst index type | |
16 | 456 } pst_file; |
457 | |
458 typedef struct _pst_block_offset { | |
459 int16_t from; | |
460 int16_t to; | |
461 } pst_block_offset; | |
462 | |
35 | 463 typedef struct _pst_block_offset_pointer { |
464 unsigned char *from; | |
465 unsigned char *to; | |
466 int needfree; | |
467 } pst_block_offset_pointer; | |
468 | |
16 | 469 struct _pst_num_item { |
43 | 470 uint32_t id; |
16 | 471 unsigned char *data; |
472 int32_t type; | |
473 size_t size; | |
474 char *extra; | |
475 }; | |
476 | |
477 typedef struct _pst_num_array { | |
478 int32_t count_item; | |
39 | 479 int32_t orig_count; |
16 | 480 int32_t count_array; |
481 struct _pst_num_item ** items; | |
482 struct _pst_num_array *next; | |
483 } pst_num_array; | |
484 | |
485 struct holder { | |
486 unsigned char **buf; | |
487 FILE * fp; | |
488 int32_t base64; | |
489 char base64_extra_chars[3]; | |
490 int32_t base64_extra; | |
491 }; | |
492 | |
493 // prototypes | |
43 | 494 void set_read64(); |
16 | 495 int32_t pst_open(pst_file *pf, char *name, char *mode); |
496 int32_t pst_close(pst_file *pf); | |
497 pst_desc_ll * pst_getTopOfFolders(pst_file *pf, pst_item *root); | |
498 int32_t pst_attach_to_mem(pst_file *pf, pst_item_attach *attach, unsigned char **b); | |
499 int32_t pst_attach_to_file(pst_file *pf, pst_item_attach *attach, FILE* fp); | |
500 int32_t pst_attach_to_file_base64(pst_file *pf, pst_item_attach *attach, FILE* fp); | |
501 int32_t pst_load_index (pst_file *pf); | |
502 pst_desc_ll* pst_getNextDptr(pst_desc_ll* d); | |
503 int32_t pst_load_extended_attributes(pst_file *pf); | |
504 | |
43 | 505 int32_t _pst_build_id_ptr(pst_file *pf, off_t offset, int32_t depth, int64_t linku1, uint64_t start_val, uint64_t end_val); |
506 int32_t _pst_build_desc_ptr (pst_file *pf, off_t offset, int32_t depth, int64_t linku1, uint64_t *high_id, uint64_t start_id, uint64_t end_val); | |
16 | 507 pst_item* _pst_getItem(pst_file *pf, pst_desc_ll *d_ptr); |
44 | 508 pst_item* _pst_parse_item (pst_file *pf, pst_desc_ll *d_ptr); |
43 | 509 pst_num_array * _pst_parse_block(pst_file *pf, uint32_t block_id, pst_index2_ll *i2_head); |
39 | 510 int32_t _pst_process(pst_num_array *list, pst_item *item, pst_item_attach *attach); |
16 | 511 int32_t _pst_free_list(pst_num_array *list); |
512 void _pst_freeItem(pst_item *item); | |
513 int32_t _pst_free_id2(pst_index2_ll * head); | |
514 int32_t _pst_free_id (pst_index_ll *head); | |
515 int32_t _pst_free_desc (pst_desc_ll *head); | |
516 int32_t _pst_free_xattrib(pst_x_attrib_ll *x); | |
35 | 517 int32_t _pst_getBlockOffsetPointer(pst_file *pf, pst_index2_ll *i2_head, unsigned char *buf, int32_t read_size, int32_t i_offset, int32_t offset, pst_block_offset_pointer *p); |
31 | 518 int32_t _pst_getBlockOffset(unsigned char *buf, int32_t read_size, int32_t i_offset, int32_t offset, pst_block_offset *p); |
16 | 519 pst_index2_ll * _pst_build_id2(pst_file *pf, pst_index_ll* list, pst_index2_ll* head_ptr); |
43 | 520 pst_index_ll * _pst_getID(pst_file* pf, uint64_t id); |
521 pst_index_ll * _pst_getID2(pst_index2_ll * ptr, uint32_t id); | |
522 pst_desc_ll * _pst_getDptr(pst_file *pf, uint32_t id); | |
523 size_t _pst_read_block_size(pst_file *pf, off_t offset, size_t size, char **buf, int32_t do_enc, unsigned char is_index); | |
16 | 524 int32_t _pst_decrypt(unsigned char *buf, size_t size, int32_t type); |
43 | 525 int64_t _getIntAt(char *buf); |
526 int64_t _pst_getIntAtPos(FILE *fp, off_t pos); | |
527 int32_t _pst_getAtPos(FILE *fp, off_t pos, void* buf, uint32_t size); | |
528 int32_t _pst_get (FILE *fp, void *buf, uint32_t size); | |
529 size_t _pst_ff_getIDblock_dec(pst_file *pf, uint32_t id, unsigned char **b); | |
530 size_t _pst_ff_getIDblock(pst_file *pf, uint32_t id, unsigned char** b); | |
531 size_t _pst_ff_getID2block(pst_file *pf, uint32_t id2, pst_index2_ll *id2_head, unsigned char** buf); | |
16 | 532 size_t _pst_ff_getID2data(pst_file *pf, pst_index_ll *ptr, struct holder *h); |
43 | 533 size_t _pst_ff_compile_ID(pst_file *pf, uint32_t id, struct holder *h, int32_t size); |
16 | 534 |
535 int32_t pst_strincmp(char *a, char *b, int32_t x); | |
536 int32_t pst_stricmp(char *a, char *b); | |
43 | 537 size_t pst_fwrite(const void*ptr, size_t size, size_t nmemb, FILE*stream); |
16 | 538 char * _pst_wide_to_single(char *wt, int32_t size); |
43 | 539 |
540 char *pst_rfc2426_escape(char *str); | |
541 int pst_chr_count(char *str, char x); | |
542 char *pst_rfc2425_datetime_format(FILETIME *ft); | |
543 char *pst_rfc2445_datetime_format(FILETIME *ft); | |
544 | |
16 | 545 // DEBUG functions |
546 int32_t _pst_printDptr(pst_file *pf); | |
547 int32_t _pst_printIDptr(pst_file* pf); | |
548 int32_t _pst_printID2ptr(pst_index2_ll *ptr); | |
549 void * xmalloc(size_t size); | |
550 | |
551 #endif // defined LIBPST_H |