Mercurial > libpst
annotate src/libpst.h @ 136:16770fc77139
fix for const correctness on Fedora 11
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Sat, 07 Feb 2009 09:29:29 -0800 |
parents | 5e4d6faada34 |
children | 2189a6b8134e |
rev | line source |
---|---|
16 | 1 /*** |
2 * libpst.h | |
3 * Part of LibPST project | |
4 * Written by David Smith | |
46 | 5 * dave.s@earthcorp.com |
16 | 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 | |
132
5e4d6faada34
fix from Fridrich Strba for parallel make
Carl Byington <carl@five-ten-sg.com>
parents:
130
diff
changeset
|
13 #include "common.h" |
130
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
14 |
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
15 |
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
16 // switch to maximal packing for all structures in the libpst interface |
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
17 // this is reverted at the end of this file |
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
18 #ifdef _MSC_VER |
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
19 #pragma pack(push, 1) |
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
20 #endif |
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
21 #if defined(__GNUC__) || defined (__SUNPRO_C) || defined(__SUNPRO_CC) |
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
22 #pragma pack(1) |
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
23 #endif |
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
24 |
16 | 25 |
79
56fa05fd5271
Patch from Robert Simpson for encryption type 2.
Carl Byington <carl@five-ten-sg.com>
parents:
75
diff
changeset
|
26 #define PST_TYPE_NOTE 1 |
16 | 27 #define PST_TYPE_APPOINTMENT 8 |
79
56fa05fd5271
Patch from Robert Simpson for encryption type 2.
Carl Byington <carl@five-ten-sg.com>
parents:
75
diff
changeset
|
28 #define PST_TYPE_CONTACT 9 |
56fa05fd5271
Patch from Robert Simpson for encryption type 2.
Carl Byington <carl@five-ten-sg.com>
parents:
75
diff
changeset
|
29 #define PST_TYPE_JOURNAL 10 |
16 | 30 #define PST_TYPE_STICKYNOTE 11 |
79
56fa05fd5271
Patch from Robert Simpson for encryption type 2.
Carl Byington <carl@five-ten-sg.com>
parents:
75
diff
changeset
|
31 #define PST_TYPE_TASK 12 |
56fa05fd5271
Patch from Robert Simpson for encryption type 2.
Carl Byington <carl@five-ten-sg.com>
parents:
75
diff
changeset
|
32 #define PST_TYPE_OTHER 13 |
56fa05fd5271
Patch from Robert Simpson for encryption type 2.
Carl Byington <carl@five-ten-sg.com>
parents:
75
diff
changeset
|
33 #define PST_TYPE_REPORT 14 |
16 | 34 |
35 // defines whether decryption is done on this bit of data | |
36 #define PST_NO_ENC 0 | |
79
56fa05fd5271
Patch from Robert Simpson for encryption type 2.
Carl Byington <carl@five-ten-sg.com>
parents:
75
diff
changeset
|
37 #define PST_ENC 1 |
16 | 38 |
39 // defines types of possible encryption | |
79
56fa05fd5271
Patch from Robert Simpson for encryption type 2.
Carl Byington <carl@five-ten-sg.com>
parents:
75
diff
changeset
|
40 #define PST_NO_ENCRYPT 0 |
16 | 41 #define PST_COMP_ENCRYPT 1 |
79
56fa05fd5271
Patch from Robert Simpson for encryption type 2.
Carl Byington <carl@five-ten-sg.com>
parents:
75
diff
changeset
|
42 #define PST_ENCRYPT 2 |
16 | 43 |
44 // defines different types of mappings | |
46 | 45 #define PST_MAP_ATTRIB (uint32_t)1 |
46 #define PST_MAP_HEADER (uint32_t)2 | |
16 | 47 |
48 // define my custom email attributes. | |
49 #define PST_ATTRIB_HEADER -1 | |
50 | |
51 // defines types of free/busy values for appointment->showas | |
52 #define PST_FREEBUSY_FREE 0 | |
53 #define PST_FREEBUSY_TENTATIVE 1 | |
54 #define PST_FREEBUSY_BUSY 2 | |
55 #define PST_FREEBUSY_OUT_OF_OFFICE 3 | |
56 | |
57 // defines labels for appointment->label | |
46 | 58 #define PST_APP_LABEL_NONE 0 // None |
16 | 59 #define PST_APP_LABEL_IMPORTANT 1 // Important |
46 | 60 #define PST_APP_LABEL_BUSINESS 2 // Business |
61 #define PST_APP_LABEL_PERSONAL 3 // Personal | |
62 #define PST_APP_LABEL_VACATION 4 // Vacation | |
16 | 63 #define PST_APP_LABEL_MUST_ATTEND 5 // Must Attend |
64 #define PST_APP_LABEL_TRAVEL_REQ 6 // Travel Required | |
65 #define PST_APP_LABEL_NEEDS_PREP 7 // Needs Preparation | |
46 | 66 #define PST_APP_LABEL_BIRTHDAY 8 // Birthday |
16 | 67 #define PST_APP_LABEL_ANNIVERSARY 9 // Anniversary |
68 #define PST_APP_LABEL_PHONE_CALL 10// Phone Call | |
69 | |
50 | 70 // define type of reccuring event |
71 #define PST_APP_RECUR_NONE 0 | |
72 #define PST_APP_RECUR_DAILY 1 | |
73 #define PST_APP_RECUR_WEEKLY 2 | |
74 #define PST_APP_RECUR_MONTHLY 3 | |
75 #define PST_APP_RECUR_YEARLY 4 | |
76 | |
49 | 77 |
46 | 78 typedef struct pst_misc_6_struct { |
49 | 79 int32_t i1; |
80 int32_t i2; | |
81 int32_t i3; | |
82 int32_t i4; | |
83 int32_t i5; | |
84 int32_t i6; | |
16 | 85 } pst_misc_6; |
86 | |
49 | 87 |
46 | 88 typedef struct pst_entryid_struct { |
49 | 89 int32_t u1; |
90 char entryid[16]; | |
91 uint32_t id; | |
16 | 92 } pst_entryid; |
93 | |
49 | 94 |
46 | 95 typedef struct pst_desc_struct32 { |
49 | 96 uint32_t d_id; |
97 uint32_t desc_id; | |
98 uint32_t list_id; | |
99 uint32_t parent_id; | |
43 | 100 } pst_desc32; |
16 | 101 |
49 | 102 |
46 | 103 typedef struct pst_desc_structn { |
49 | 104 uint64_t d_id; |
105 uint64_t desc_id; | |
106 uint64_t list_id; | |
107 uint32_t parent_id; // not 64 bit ?? | |
108 uint32_t u1; // padding | |
43 | 109 } pst_descn; |
110 | |
49 | 111 |
46 | 112 typedef struct pst_index_struct32 { |
49 | 113 uint32_t id; |
114 uint32_t offset; | |
115 uint16_t size; | |
116 int16_t u1; | |
43 | 117 } pst_index32; |
118 | |
49 | 119 |
46 | 120 typedef struct pst_index_struct { |
49 | 121 uint64_t id; |
122 uint64_t offset; | |
123 uint16_t size; | |
124 int16_t u0; | |
125 int32_t u1; | |
16 | 126 } pst_index; |
127 | |
49 | 128 |
46 | 129 typedef struct pst_index_tree32 { |
49 | 130 uint32_t id; |
131 uint32_t offset; | |
132 uint32_t size; | |
133 int32_t u1; | |
134 struct pst_index_tree * next; | |
43 | 135 } pst_index_ll32; |
136 | |
49 | 137 |
46 | 138 typedef struct pst_index_tree { |
49 | 139 uint64_t id; |
140 uint64_t offset; | |
141 uint64_t size; | |
142 int64_t u1; | |
143 struct pst_index_tree * next; | |
16 | 144 } pst_index_ll; |
145 | |
49 | 146 |
46 | 147 typedef struct pst_index2_tree { |
49 | 148 uint64_t id2; |
149 pst_index_ll *id; | |
150 struct pst_index2_tree * next; | |
16 | 151 } pst_index2_ll; |
152 | |
49 | 153 |
46 | 154 typedef struct pst_desc_tree { |
49 | 155 uint64_t id; |
101
1fc33da23175
fix for orphan children when building descriptor tree, avoid writing uninitialized data to debug log file
Carl Byington <carl@five-ten-sg.com>
parents:
94
diff
changeset
|
156 uint64_t parent_id; |
49 | 157 pst_index_ll * list_index; |
158 pst_index_ll * desc; | |
159 int32_t no_child; | |
160 struct pst_desc_tree * prev; | |
161 struct pst_desc_tree * next; | |
162 struct pst_desc_tree * parent; | |
163 struct pst_desc_tree * child; | |
164 struct pst_desc_tree * child_tail; | |
16 | 165 } pst_desc_ll; |
166 | |
49 | 167 |
46 | 168 typedef struct pst_item_email_subject { |
49 | 169 int off1; |
170 int off2; | |
171 char *subj; | |
16 | 172 } pst_item_email_subject; |
173 | |
49 | 174 |
46 | 175 typedef struct pst_item_email { |
49 | 176 FILETIME *arrival_date; |
177 int autoforward; // 1 = true, 0 = not set, -1 = false | |
178 char *body; | |
116
ed2a260bbb98
improve handling of content-type charset values in mime parts
Carl Byington <carl@five-ten-sg.com>
parents:
102
diff
changeset
|
179 char *body_charset; // null if not specified |
49 | 180 char *cc_address; |
59
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
52
diff
changeset
|
181 char *bcc_address; |
49 | 182 char *common_name; |
183 int32_t conv_index; | |
184 int conversion_prohib; // 1 = true, 0 = false | |
185 int delete_after_submit; // 1 = true, 0 = false | |
186 int delivery_report; // 1 = true, 0 = false | |
187 char *encrypted_body; | |
50 | 188 size_t encrypted_body_size; |
49 | 189 char *encrypted_htmlbody; |
50 | 190 size_t encrypted_htmlbody_size; |
49 | 191 int32_t flag; |
192 char *header; | |
193 char *htmlbody; | |
194 int32_t importance; | |
195 char *in_reply_to; | |
196 int message_cc_me; // 1 = true, 0 = false | |
197 int message_recip_me; // 1 = true, 0 = false | |
198 int message_to_me; // 1 = true, 0 = false | |
199 char *messageid; | |
200 int32_t orig_sensitivity; | |
63
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
201 char *original_bcc; |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
202 char *original_cc; |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
203 char *original_to; |
49 | 204 char *outlook_recipient; |
63
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
205 char *outlook_recipient_name; |
49 | 206 char *outlook_recipient2; |
207 char *outlook_sender; | |
208 char *outlook_sender_name; | |
209 char *outlook_sender2; | |
210 int32_t priority; | |
211 char *proc_subject; | |
212 int read_receipt; // 1 = true, 0 = false | |
213 char *recip_access; | |
214 char *recip_address; | |
215 char *recip2_access; | |
216 char *recip2_address; | |
217 int reply_requested; // 1 = true, 0 = false | |
218 char *reply_to; | |
219 char *return_path_address; | |
220 int32_t rtf_body_char_count; | |
221 int32_t rtf_body_crc; | |
222 char *rtf_body_tag; | |
223 char *rtf_compressed; | |
63
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
224 uint32_t rtf_compressed_size; |
49 | 225 int rtf_in_sync; // 1 = true, 0 = doesn't exist, -1 = false |
226 int32_t rtf_ws_prefix_count; | |
227 int32_t rtf_ws_trailing_count; | |
228 char *sender_access; | |
229 char *sender_address; | |
230 char *sender2_access; | |
231 char *sender2_address; | |
232 int32_t sensitivity; | |
233 FILETIME *sent_date; | |
234 pst_entryid *sentmail_folder; | |
235 char *sentto_address; | |
236 pst_item_email_subject *subject; | |
16 | 237 } pst_item_email; |
238 | |
49 | 239 |
46 | 240 typedef struct pst_item_folder { |
49 | 241 int32_t email_count; |
242 int32_t unseen_email_count; | |
243 int32_t assoc_count; | |
244 int subfolder; // 1 = true, 0 = false | |
16 | 245 } pst_item_folder; |
246 | |
49 | 247 |
46 | 248 typedef struct pst_item_message_store { |
51 | 249 pst_entryid *top_of_personal_folder; // 0x35e0 |
250 pst_entryid *default_outbox_folder; // 0x35e2 | |
251 pst_entryid *deleted_items_folder; // 0x35e3 | |
252 pst_entryid *sent_items_folder; // 0x35e4 | |
253 pst_entryid *user_views_folder; // 0x35e5 | |
254 pst_entryid *common_view_folder; // 0x35e6 | |
255 pst_entryid *search_root_folder; // 0x35e7 | |
256 pst_entryid *top_of_folder; // 0x7c07 | |
257 int32_t valid_mask; // 0x35df // what folders the message store contains | |
258 int32_t pwd_chksum; // 0x76ff | |
16 | 259 } pst_item_message_store; |
260 | |
49 | 261 |
46 | 262 typedef struct pst_item_contact { |
49 | 263 char *access_method; |
264 char *account_name; | |
265 char *address1; | |
266 char *address1a; | |
267 char *address1_desc; | |
268 char *address1_transport; | |
269 char *address2; | |
270 char *address2a; | |
271 char *address2_desc; | |
272 char *address2_transport; | |
273 char *address3; | |
274 char *address3a; | |
275 char *address3_desc; | |
276 char *address3_transport; | |
277 char *assistant_name; | |
278 char *assistant_phone; | |
279 char *billing_information; | |
280 FILETIME *birthday; | |
51 | 281 char *business_address; // 0x801b |
49 | 282 char *business_city; |
283 char *business_country; | |
284 char *business_fax; | |
285 char *business_homepage; | |
286 char *business_phone; | |
287 char *business_phone2; | |
288 char *business_po_box; | |
289 char *business_postal_code; | |
290 char *business_state; | |
291 char *business_street; | |
292 char *callback_phone; | |
293 char *car_phone; | |
294 char *company_main_phone; | |
295 char *company_name; | |
296 char *computer_name; | |
297 char *customer_id; | |
298 char *def_postal_address; | |
299 char *department; | |
300 char *display_name_prefix; | |
301 char *first_name; | |
302 char *followup; | |
303 char *free_busy_address; | |
304 char *ftp_site; | |
305 char *fullname; | |
51 | 306 int16_t gender; |
49 | 307 char *gov_id; |
308 char *hobbies; | |
51 | 309 char *home_address; // 0x801a |
49 | 310 char *home_city; |
311 char *home_country; | |
312 char *home_fax; | |
313 char *home_phone; | |
314 char *home_phone2; | |
315 char *home_po_box; | |
316 char *home_postal_code; | |
317 char *home_state; | |
318 char *home_street; | |
319 char *initials; | |
320 char *isdn_phone; | |
321 char *job_title; | |
322 char *keyword; | |
323 char *language; | |
324 char *location; | |
51 | 325 int mail_permission; // 1 = true, 0 = false |
49 | 326 char *manager_name; |
327 char *middle_name; | |
328 char *mileage; | |
329 char *mobile_phone; | |
330 char *nickname; | |
331 char *office_loc; | |
332 char *org_id; | |
51 | 333 char *other_address; // 0x801c |
49 | 334 char *other_city; |
335 char *other_country; | |
336 char *other_phone; | |
337 char *other_po_box; | |
338 char *other_postal_code; | |
339 char *other_state; | |
340 char *other_street; | |
341 char *pager_phone; | |
342 char *personal_homepage; | |
343 char *pref_name; | |
344 char *primary_fax; | |
345 char *primary_phone; | |
346 char *profession; | |
347 char *radio_phone; | |
51 | 348 int rich_text; // 1 = true, 0 = false |
49 | 349 char *spouse_name; |
350 char *suffix; | |
351 char *surname; | |
352 char *telex; | |
353 char *transmittable_display_name; | |
354 char *ttytdd_phone; | |
355 FILETIME *wedding_anniversary; | |
51 | 356 char *work_address_street; // 0x8045 |
357 char *work_address_city; // 0x8046 | |
358 char *work_address_state; // 0x8047 | |
359 char *work_address_postalcode; // 0x8048 | |
360 char *work_address_country; // 0x8049 | |
361 char *work_address_postofficebox; // 0x804a | |
16 | 362 } pst_item_contact; |
363 | |
49 | 364 |
46 | 365 typedef struct pst_item_attach { |
49 | 366 char *filename1; |
367 char *filename2; | |
368 char *mimetype; | |
369 char *data; | |
370 size_t size; | |
371 uint64_t id2_val; | |
372 uint64_t id_val; // calculated from id2_val during creation of record | |
373 int32_t method; | |
374 int32_t position; | |
375 int32_t sequence; | |
376 struct pst_item_attach *next; | |
16 | 377 } pst_item_attach; |
378 | |
49 | 379 |
46 | 380 typedef struct pst_item_extra_field { |
49 | 381 char *field_name; |
382 char *value; | |
383 struct pst_item_extra_field *next; | |
16 | 384 } pst_item_extra_field; |
385 | |
49 | 386 |
46 | 387 typedef struct pst_item_journal { |
49 | 388 FILETIME *end; |
389 FILETIME *start; | |
390 char *type; | |
16 | 391 } pst_item_journal; |
392 | |
49 | 393 |
46 | 394 typedef struct pst_item_appointment { |
49 | 395 FILETIME *end; |
50 | 396 char *location; |
397 int alarm; // 1 = true, 0 = false | |
49 | 398 FILETIME *reminder; |
50 | 399 int32_t alarm_minutes; |
400 char *alarm_filename; | |
49 | 401 FILETIME *start; |
50 | 402 char *timezonestring; |
403 int32_t showas; | |
404 int32_t label; | |
405 int all_day; // 1 = true, 0 = false | |
406 char *recurrence; | |
407 int32_t recurrence_type; | |
408 FILETIME *recurrence_start; | |
409 FILETIME *recurrence_end; | |
16 | 410 } pst_item_appointment; |
411 | |
49 | 412 |
46 | 413 typedef struct pst_item { |
49 | 414 struct pst_item_email *email; // data reffering to email |
415 struct pst_item_folder *folder; // data reffering to folder | |
416 struct pst_item_contact *contact; // data reffering to contact | |
417 struct pst_item_attach *attach; // linked list of attachments | |
418 struct pst_item_message_store *message_store; // data referring to the message store | |
419 struct pst_item_extra_field *extra_fields; // linked list of extra headers and such | |
420 struct pst_item_journal *journal; // data reffering to a journal entry | |
421 struct pst_item_appointment *appointment; // data reffering to a calendar entry | |
422 int type; | |
423 char *ascii_type; | |
424 char *file_as; | |
425 char *comment; | |
426 int32_t message_size; | |
427 char *outlook_version; | |
428 char *record_key; // probably 16 bytes long. | |
429 size_t record_key_size; | |
430 int response_requested; // 1 = true, 0 = false | |
431 FILETIME *create_date; | |
432 FILETIME *modify_date; | |
433 int private_member; // 1 = true, 0 = false | |
16 | 434 } pst_item; |
435 | |
49 | 436 |
46 | 437 typedef struct pst_x_attrib_ll { |
49 | 438 uint32_t type; |
439 uint32_t mytype; | |
440 uint32_t map; | |
441 void *data; | |
442 struct pst_x_attrib_ll *next; | |
16 | 443 } pst_x_attrib_ll; |
444 | |
49 | 445 |
52 | 446 typedef struct pst_block_recorder { |
447 struct pst_block_recorder *next; | |
125
23a36ac0514d
recover dropped pragma pack line, use int64_t rather than off_t to avoid forcing users of the shared library to enable large file support.
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
448 int64_t offset; |
52 | 449 size_t size; |
450 int readcount; | |
451 } pst_block_recorder; | |
452 | |
453 | |
46 | 454 typedef struct pst_file { |
49 | 455 pst_index_ll *i_head, *i_tail; |
52 | 456 pst_desc_ll *d_head, *d_tail; |
49 | 457 pst_x_attrib_ll *x_head; |
52 | 458 pst_block_recorder *block_head; |
46 | 459 |
49 | 460 //set this to 0 to read 32-bit pst files (pre Outlook 2003) |
461 //set this to 1 to read 64-bit pst files (Outlook 2003 and later) | |
462 int do_read64; | |
46 | 463 |
49 | 464 uint64_t index1; |
465 uint64_t index1_back; | |
466 uint64_t index2; | |
467 uint64_t index2_back; | |
468 FILE * fp; // file pointer to opened PST file | |
469 uint64_t size; // pst file size | |
470 unsigned char encryption; // pst encryption setting | |
471 unsigned char ind_type; // pst index type | |
16 | 472 } pst_file; |
473 | |
49 | 474 |
46 | 475 typedef struct pst_block_offset { |
49 | 476 int16_t from; |
477 int16_t to; | |
16 | 478 } pst_block_offset; |
479 | |
49 | 480 |
46 | 481 typedef struct pst_block_offset_pointer { |
52 | 482 char *from; |
483 char *to; | |
484 int needfree; | |
35 | 485 } pst_block_offset_pointer; |
486 | |
49 | 487 |
488 typedef struct pst_num_item { | |
52 | 489 uint32_t id; // not an id1 or id2, this is actually some sort of type code |
490 char *data; | |
491 uint32_t type; | |
492 size_t size; | |
493 char *extra; | |
49 | 494 } pst_num_item; |
495 | |
16 | 496 |
46 | 497 typedef struct pst_num_array { |
49 | 498 int32_t count_item; |
499 int32_t orig_count; | |
500 int32_t count_array; | |
501 struct pst_num_item ** items; | |
502 struct pst_num_array *next; | |
16 | 503 } pst_num_array; |
504 | |
49 | 505 |
506 typedef struct pst_holder { | |
94
997cf1373f9e
fix base64 encoding that could create long lines
Carl Byington <carl@five-ten-sg.com>
parents:
90
diff
changeset
|
507 char **buf; |
997cf1373f9e
fix base64 encoding that could create long lines
Carl Byington <carl@five-ten-sg.com>
parents:
90
diff
changeset
|
508 FILE *fp; |
997cf1373f9e
fix base64 encoding that could create long lines
Carl Byington <carl@five-ten-sg.com>
parents:
90
diff
changeset
|
509 int base64; |
49 | 510 } pst_holder; |
511 | |
512 | |
513 typedef struct pst_subblock { | |
52 | 514 char *buf; |
515 size_t read_size; | |
516 size_t i_offset; | |
49 | 517 } pst_subblock; |
518 | |
519 | |
520 typedef struct pst_subblocks { | |
521 size_t subblock_count; | |
522 pst_subblock *subs; | |
523 } pst_subblocks; | |
524 | |
16 | 525 |
526 // prototypes | |
59
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
52
diff
changeset
|
527 int pst_open(pst_file *pf, char *name); |
46 | 528 int pst_close(pst_file *pf); |
529 pst_desc_ll * pst_getTopOfFolders(pst_file *pf, pst_item *root); | |
52 | 530 size_t pst_attach_to_mem(pst_file *pf, pst_item_attach *attach, char **b); |
46 | 531 size_t pst_attach_to_file(pst_file *pf, pst_item_attach *attach, FILE* fp); |
532 size_t pst_attach_to_file_base64(pst_file *pf, pst_item_attach *attach, FILE* fp); | |
533 int pst_load_index (pst_file *pf); | |
534 pst_desc_ll* pst_getNextDptr(pst_desc_ll* d); | |
535 int pst_load_extended_attributes(pst_file *pf); | |
16 | 536 |
125
23a36ac0514d
recover dropped pragma pack line, use int64_t rather than off_t to avoid forcing users of the shared library to enable large file support.
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
537 int pst_build_id_ptr(pst_file *pf, int64_t offset, int32_t depth, uint64_t linku1, uint64_t start_val, uint64_t end_val); |
23a36ac0514d
recover dropped pragma pack line, use int64_t rather than off_t to avoid forcing users of the shared library to enable large file support.
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
538 int pst_build_desc_ptr(pst_file *pf, int64_t offset, int32_t depth, uint64_t linku1, uint64_t start_val, uint64_t end_val); |
46 | 539 pst_item* pst_getItem(pst_file *pf, pst_desc_ll *d_ptr); |
540 pst_item* pst_parse_item (pst_file *pf, pst_desc_ll *d_ptr); | |
48 | 541 pst_num_array* pst_parse_block(pst_file *pf, uint64_t block_id, pst_index2_ll *i2_head, pst_num_array *na_head); |
46 | 542 int pst_process(pst_num_array *list, pst_item *item, pst_item_attach *attach); |
543 void pst_free_list(pst_num_array *list); | |
544 void pst_freeItem(pst_item *item); | |
545 void pst_free_id2(pst_index2_ll * head); | |
546 void pst_free_id (pst_index_ll *head); | |
547 void pst_free_desc (pst_desc_ll *head); | |
548 void pst_free_xattrib(pst_x_attrib_ll *x); | |
49 | 549 int pst_getBlockOffsetPointer(pst_file *pf, pst_index2_ll *i2_head, pst_subblocks *subblocks, uint32_t offset, pst_block_offset_pointer *p); |
52 | 550 int pst_getBlockOffset(char *buf, size_t read_size, uint32_t i_offset, uint32_t offset, pst_block_offset *p); |
46 | 551 pst_index2_ll* pst_build_id2(pst_file *pf, pst_index_ll* list, pst_index2_ll* head_ptr); |
552 pst_index_ll* pst_getID(pst_file* pf, uint64_t id); | |
553 pst_index_ll* pst_getID2(pst_index2_ll * ptr, uint64_t id); | |
554 pst_desc_ll* pst_getDptr(pst_file *pf, uint64_t id); | |
125
23a36ac0514d
recover dropped pragma pack line, use int64_t rather than off_t to avoid forcing users of the shared library to enable large file support.
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
555 size_t pst_read_block_size(pst_file *pf, int64_t offset, size_t size, char **buf); |
79
56fa05fd5271
Patch from Robert Simpson for encryption type 2.
Carl Byington <carl@five-ten-sg.com>
parents:
75
diff
changeset
|
556 int pst_decrypt(uint64_t id, char *buf, size_t size, unsigned char type); |
46 | 557 uint64_t pst_getIntAt(pst_file *pf, char *buf); |
125
23a36ac0514d
recover dropped pragma pack line, use int64_t rather than off_t to avoid forcing users of the shared library to enable large file support.
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
558 uint64_t pst_getIntAtPos(pst_file *pf, int64_t pos); |
23a36ac0514d
recover dropped pragma pack line, use int64_t rather than off_t to avoid forcing users of the shared library to enable large file support.
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
559 size_t pst_getAtPos(pst_file *pf, int64_t pos, void* buf, size_t size); |
52 | 560 size_t pst_ff_getIDblock_dec(pst_file *pf, uint64_t id, char **b); |
561 size_t pst_ff_getIDblock(pst_file *pf, uint64_t id, char** b); | |
562 size_t pst_ff_getID2block(pst_file *pf, uint64_t id2, pst_index2_ll *id2_head, char** buf); | |
49 | 563 size_t pst_ff_getID2data(pst_file *pf, pst_index_ll *ptr, pst_holder *h); |
564 size_t pst_ff_compile_ID(pst_file *pf, uint64_t id, pst_holder *h, size_t size); | |
16 | 565 |
46 | 566 int pst_strincmp(char *a, char *b, size_t x); |
567 int pst_stricmp(char *a, char *b); | |
568 size_t pst_fwrite(const void*ptr, size_t size, size_t nmemb, FILE*stream); | |
47 | 569 char * pst_wide_to_single(char *wt, size_t size); |
43 | 570 |
46 | 571 char * pst_rfc2426_escape(char *str); |
572 int pst_chr_count(char *str, char x); | |
573 char * pst_rfc2425_datetime_format(FILETIME *ft); | |
574 char * pst_rfc2445_datetime_format(FILETIME *ft); | |
43 | 575 |
51 | 576 void pst_printDptr(pst_file *pf, pst_desc_ll *ptr); |
577 void pst_printIDptr(pst_file* pf); | |
578 void pst_printID2ptr(pst_index2_ll *ptr); | |
16 | 579 |
130
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
580 |
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
581 // switch from maximal packing back to default packing |
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
582 // undo the packing from the beginning of this file |
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
583 #ifdef _MSC_VER |
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
584 #pragma pack(pop) |
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
585 #endif |
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
586 #if defined(__GNUC__) || defined (__SUNPRO_C) || defined(__SUNPRO_CC) |
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
587 #pragma pack() |
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
588 #endif |
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
589 |
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
590 |
e35fd42bac05
more cleanup of include files
Carl Byington <carl@five-ten-sg.com>
parents:
128
diff
changeset
|
591 |
16 | 592 #endif // defined LIBPST_H |