comparison src/libpst.h @ 150:06aa84023b48

rename some structure fields to reflect our better understanding of the pst format
author Carl Byington <carl@five-ten-sg.com>
date Thu, 05 Mar 2009 08:23:32 -0800
parents fdc58ad2c758
children cda7c812ec01
comparison
equal deleted inserted replaced
149:f9773b6368e0 150:06aa84023b48
93 93
94 94
95 typedef struct pst_desc_struct32 { 95 typedef struct pst_desc_struct32 {
96 uint32_t d_id; 96 uint32_t d_id;
97 uint32_t desc_id; 97 uint32_t desc_id;
98 uint32_t list_id; 98 uint32_t tree_id;
99 uint32_t parent_id; 99 uint32_t parent_d_id;
100 } pst_desc32; 100 } pst_desc32;
101 101
102 102
103 typedef struct pst_desc_structn { 103 typedef struct pst_desc_structn {
104 uint64_t d_id; 104 uint64_t d_id;
105 uint64_t desc_id; 105 uint64_t desc_id;
106 uint64_t list_id; 106 uint64_t tree_id;
107 uint32_t parent_id; // not 64 bit ?? 107 uint32_t parent_d_id; // not 64 bit ??
108 uint32_t u1; // padding 108 uint32_t u1; // padding
109 } pst_descn; 109 } pst_descn;
110 110
111 111
112 typedef struct pst_index_struct32 { 112 typedef struct pst_index_struct32 {
113 uint32_t id; 113 uint32_t id;
142 int64_t u1; 142 int64_t u1;
143 struct pst_index_tree *next; 143 struct pst_index_tree *next;
144 } pst_index_ll; 144 } pst_index_ll;
145 145
146 146
147 typedef struct pst_index2_tree { 147 typedef struct pst_id2_tree {
148 uint64_t id2; 148 uint64_t id2;
149 pst_index_ll *id; 149 pst_index_ll *id;
150 struct pst_index2_tree *child; 150 struct pst_id2_tree *child;
151 struct pst_index2_tree *next; 151 struct pst_id2_tree *next;
152 } pst_index2_ll; 152 } pst_id2_ll;
153 153
154 154
155 typedef struct pst_desc_tree { 155 typedef struct pst_desc_tree {
156 uint64_t id; 156 uint64_t d_id;
157 uint64_t parent_id; 157 uint64_t parent_d_id;
158 pst_index_ll *list_index;
159 pst_index_ll *desc; 158 pst_index_ll *desc;
159 pst_index_ll *assoc_tree;
160 int32_t no_child; 160 int32_t no_child;
161 struct pst_desc_tree *prev; 161 struct pst_desc_tree *prev;
162 struct pst_desc_tree *next; 162 struct pst_desc_tree *next;
163 struct pst_desc_tree *parent; 163 struct pst_desc_tree *parent;
164 struct pst_desc_tree *child; 164 struct pst_desc_tree *child;
176 typedef struct pst_item_email { 176 typedef struct pst_item_email {
177 FILETIME *arrival_date; 177 FILETIME *arrival_date;
178 int autoforward; // 1 = true, 0 = not set, -1 = false 178 int autoforward; // 1 = true, 0 = not set, -1 = false
179 char *body; 179 char *body;
180 int32_t body_was_unicode; // 1 = true, 0 = false 180 int32_t body_was_unicode; // 1 = true, 0 = false
181 char *body_charset; // null if not specified
182 char *cc_address; 181 char *cc_address;
183 char *bcc_address; 182 char *bcc_address;
184 char *common_name; 183 char *common_name;
185 int32_t conv_index; 184 int32_t conv_index;
186 int conversion_prohib; // 1 = true, 0 = false 185 int conversion_prohib; // 1 = true, 0 = false
231 char *sender_access; 230 char *sender_access;
232 char *sender_address; 231 char *sender_address;
233 char *sender2_access; 232 char *sender2_access;
234 char *sender2_address; 233 char *sender2_address;
235 int32_t sensitivity; 234 int32_t sensitivity;
236 int32_t internet_cpid;
237 int32_t message_codepage;
238 FILETIME *sent_date; 235 FILETIME *sent_date;
239 pst_entryid *sentmail_folder; 236 pst_entryid *sentmail_folder;
240 char *sentto_address; 237 char *sentto_address;
241 pst_item_email_subject *subject; 238 pst_item_email_subject *subject;
242 // delivery report fields 239 // delivery report fields
381 char *mimetype; 378 char *mimetype;
382 char *data; 379 char *data;
383 size_t size; 380 size_t size;
384 uint64_t id2_val; 381 uint64_t id2_val;
385 uint64_t id_val; // calculated from id2_val during creation of record 382 uint64_t id_val; // calculated from id2_val during creation of record
386 pst_index2_ll *id2_head; // deep copy from child 383 pst_id2_ll *id2_head; // deep copy from child
387 int32_t method; 384 int32_t method;
388 int32_t position; 385 int32_t position;
389 int32_t sequence; 386 int32_t sequence;
390 struct pst_item_attach *next; 387 struct pst_item_attach *next;
391 } pst_item_attach; 388 } pst_item_attach;
423 FILETIME *recurrence_end; 420 FILETIME *recurrence_end;
424 } pst_item_appointment; 421 } pst_item_appointment;
425 422
426 423
427 typedef struct pst_item { 424 typedef struct pst_item {
428 struct pst_item_email *email; // data reffering to email 425 struct pst_item_email *email; // data referring to email
429 struct pst_item_folder *folder; // data reffering to folder 426 struct pst_item_folder *folder; // data referring to folder
430 struct pst_item_contact *contact; // data reffering to contact 427 struct pst_item_contact *contact; // data referring to contact
431 struct pst_item_attach *attach; // linked list of attachments 428 struct pst_item_attach *attach; // linked list of attachments
432 struct pst_item_message_store *message_store; // data referring to the message store 429 struct pst_item_message_store *message_store; // data referring to the message store
433 struct pst_item_extra_field *extra_fields; // linked list of extra headers and such 430 struct pst_item_extra_field *extra_fields; // linked list of extra headers and such
434 struct pst_item_journal *journal; // data reffering to a journal entry 431 struct pst_item_journal *journal; // data referring to a journal entry
435 struct pst_item_appointment *appointment; // data reffering to a calendar entry 432 struct pst_item_appointment *appointment; // data referring to a calendar entry
436 int type; 433 int type;
437 char *ascii_type; 434 char *ascii_type;
438 char *file_as; 435 char *file_as;
439 char *comment; 436 char *comment;
440 int32_t message_size; 437 char *body_charset; // null if not specified
441 char *outlook_version; 438 int32_t internet_cpid;
442 char *record_key; // probably 16 bytes long. 439 int32_t message_codepage;
443 size_t record_key_size; 440 int32_t message_size;
444 int response_requested; // 1 = true, 0 = false 441 char *outlook_version;
445 FILETIME *create_date; 442 char *record_key; // probably 16 bytes long.
446 FILETIME *modify_date; 443 size_t record_key_size;
447 int private_member; // 1 = true, 0 = false 444 int response_requested; // 1 = true, 0 = false
445 FILETIME *create_date;
446 FILETIME *modify_date;
447 int private_member; // 1 = true, 0 = false
448 } pst_item; 448 } pst_item;
449 449
450 450
451 typedef struct pst_x_attrib_ll { 451 typedef struct pst_x_attrib_ll {
452 uint32_t type; 452 uint32_t type;
547 int pst_load_extended_attributes(pst_file *pf); 547 int pst_load_extended_attributes(pst_file *pf);
548 548
549 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); 549 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);
550 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); 550 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);
551 pst_item* pst_getItem(pst_file *pf, pst_desc_ll *d_ptr); 551 pst_item* pst_getItem(pst_file *pf, pst_desc_ll *d_ptr);
552 pst_item* pst_parse_item (pst_file *pf, pst_desc_ll *d_ptr, pst_index2_ll *m_head); 552 pst_item* pst_parse_item (pst_file *pf, pst_desc_ll *d_ptr, pst_id2_ll *m_head);
553 pst_num_array* pst_parse_block(pst_file *pf, uint64_t block_id, pst_index2_ll *i2_head, pst_num_array *na_head); 553 pst_num_array* pst_parse_block(pst_file *pf, uint64_t block_id, pst_id2_ll *i2_head, pst_num_array *na_head);
554 int pst_process(pst_num_array *list, pst_item *item, pst_item_attach *attach); 554 int pst_process(pst_num_array *list, pst_item *item, pst_item_attach *attach);
555 void pst_free_list(pst_num_array *list); 555 void pst_free_list(pst_num_array *list);
556 void pst_freeItem(pst_item *item); 556 void pst_freeItem(pst_item *item);
557 void pst_free_id2(pst_index2_ll * head); 557 void pst_free_id2(pst_id2_ll * head);
558 void pst_free_id (pst_index_ll *head); 558 void pst_free_id (pst_index_ll *head);
559 void pst_free_desc (pst_desc_ll *head); 559 void pst_free_desc (pst_desc_ll *head);
560 void pst_free_xattrib(pst_x_attrib_ll *x); 560 void pst_free_xattrib(pst_x_attrib_ll *x);
561 int pst_getBlockOffsetPointer(pst_file *pf, pst_index2_ll *i2_head, pst_subblocks *subblocks, uint32_t offset, pst_block_offset_pointer *p); 561 int pst_getBlockOffsetPointer(pst_file *pf, pst_id2_ll *i2_head, pst_subblocks *subblocks, uint32_t offset, pst_block_offset_pointer *p);
562 int pst_getBlockOffset(char *buf, size_t read_size, uint32_t i_offset, uint32_t offset, pst_block_offset *p); 562 int pst_getBlockOffset(char *buf, size_t read_size, uint32_t i_offset, uint32_t offset, pst_block_offset *p);
563 pst_index2_ll* pst_build_id2(pst_file *pf, pst_index_ll* list); 563 pst_id2_ll* pst_build_id2(pst_file *pf, pst_index_ll* list);
564 pst_index_ll* pst_getID(pst_file* pf, uint64_t id); 564 pst_index_ll* pst_getID(pst_file* pf, uint64_t id);
565 pst_index2_ll* pst_getID2(pst_index2_ll * ptr, uint64_t id); 565 pst_id2_ll* pst_getID2(pst_id2_ll * ptr, uint64_t id);
566 pst_desc_ll* pst_getDptr(pst_file *pf, uint64_t id); 566 pst_desc_ll* pst_getDptr(pst_file *pf, uint64_t id);
567 size_t pst_read_block_size(pst_file *pf, int64_t offset, size_t size, char **buf); 567 size_t pst_read_block_size(pst_file *pf, int64_t offset, size_t size, char **buf);
568 int pst_decrypt(uint64_t id, char *buf, size_t size, unsigned char type); 568 int pst_decrypt(uint64_t id, char *buf, size_t size, unsigned char type);
569 uint64_t pst_getIntAt(pst_file *pf, char *buf); 569 uint64_t pst_getIntAt(pst_file *pf, char *buf);
570 uint64_t pst_getIntAtPos(pst_file *pf, int64_t pos); 570 uint64_t pst_getIntAtPos(pst_file *pf, int64_t pos);
571 size_t pst_getAtPos(pst_file *pf, int64_t pos, void* buf, size_t size); 571 size_t pst_getAtPos(pst_file *pf, int64_t pos, void* buf, size_t size);
572 size_t pst_ff_getIDblock_dec(pst_file *pf, uint64_t id, char **b); 572 size_t pst_ff_getIDblock_dec(pst_file *pf, uint64_t id, char **b);
573 size_t pst_ff_getIDblock(pst_file *pf, uint64_t id, char** b); 573 size_t pst_ff_getIDblock(pst_file *pf, uint64_t id, char** b);
574 size_t pst_ff_getID2block(pst_file *pf, uint64_t id2, pst_index2_ll *id2_head, char** buf); 574 size_t pst_ff_getID2block(pst_file *pf, uint64_t id2, pst_id2_ll *id2_head, char** buf);
575 size_t pst_ff_getID2data(pst_file *pf, pst_index_ll *ptr, pst_holder *h); 575 size_t pst_ff_getID2data(pst_file *pf, pst_index_ll *ptr, pst_holder *h);
576 size_t pst_ff_compile_ID(pst_file *pf, uint64_t id, pst_holder *h, size_t size); 576 size_t pst_ff_compile_ID(pst_file *pf, uint64_t id, pst_holder *h, size_t size);
577 577
578 int pst_strincmp(char *a, char *b, size_t x); 578 int pst_strincmp(char *a, char *b, size_t x);
579 int pst_stricmp(char *a, char *b); 579 int pst_stricmp(char *a, char *b);
585 char * pst_rfc2425_datetime_format(FILETIME *ft); 585 char * pst_rfc2425_datetime_format(FILETIME *ft);
586 char * pst_rfc2445_datetime_format(FILETIME *ft); 586 char * pst_rfc2445_datetime_format(FILETIME *ft);
587 587
588 void pst_printDptr(pst_file *pf, pst_desc_ll *ptr); 588 void pst_printDptr(pst_file *pf, pst_desc_ll *ptr);
589 void pst_printIDptr(pst_file* pf); 589 void pst_printIDptr(pst_file* pf);
590 void pst_printID2ptr(pst_index2_ll *ptr); 590 void pst_printID2ptr(pst_id2_ll *ptr);
591 591
592 592
593 // switch from maximal packing back to default packing 593 // switch from maximal packing back to default packing
594 // undo the packing from the beginning of this file 594 // undo the packing from the beginning of this file
595 #ifdef _MSC_VER 595 #ifdef _MSC_VER