comparison src/libpst.h @ 186:0a4f7ecd7452

more cleanup of external names in the shared library
author Carl Byington <carl@five-ten-sg.com>
date Mon, 13 Apr 2009 19:14:30 -0700
parents b65e8d0a088a
children d588dafd03e8
comparison
equal deleted inserted replaced
185:e0392999e9b8 186:0a4f7ecd7452
73 #define PST_APP_RECUR_WEEKLY 2 73 #define PST_APP_RECUR_WEEKLY 2
74 #define PST_APP_RECUR_MONTHLY 3 74 #define PST_APP_RECUR_MONTHLY 3
75 #define PST_APP_RECUR_YEARLY 4 75 #define PST_APP_RECUR_YEARLY 4
76 76
77 77
78 typedef struct pst_misc_6_struct { 78 typedef struct pst_misc_6 {
79 int32_t i1; 79 int32_t i1;
80 int32_t i2; 80 int32_t i2;
81 int32_t i3; 81 int32_t i3;
82 int32_t i4; 82 int32_t i4;
83 int32_t i5; 83 int32_t i5;
84 int32_t i6; 84 int32_t i6;
85 } pst_misc_6; 85 } pst_misc_6;
86 86
87 87
88 typedef struct pst_entryid_struct { 88 typedef struct pst_entryid {
89 int32_t u1; 89 int32_t u1;
90 char entryid[16]; 90 char entryid[16];
91 uint32_t id; 91 uint32_t id;
92 } pst_entryid; 92 } pst_entryid;
93 93
94 94
95 typedef struct pst_desc_struct32 { 95 typedef struct pst_desc32 {
96 uint32_t d_id; 96 uint32_t d_id;
97 uint32_t desc_id; 97 uint32_t desc_id;
98 uint32_t tree_id; 98 uint32_t tree_id;
99 uint32_t parent_d_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 {
104 uint64_t d_id; 104 uint64_t d_id;
105 uint64_t desc_id; 105 uint64_t desc_id;
106 uint64_t tree_id; 106 uint64_t tree_id;
107 uint32_t parent_d_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_desc;
110 110
111 111
112 typedef struct pst_index_struct32 { 112 typedef struct pst_index32 {
113 uint32_t id; 113 uint32_t id;
114 uint32_t offset; 114 uint32_t offset;
115 uint16_t size; 115 uint16_t size;
116 int16_t u1; 116 int16_t u1;
117 } pst_index32; 117 } pst_index32;
118 118
119 119
120 typedef struct pst_index_struct { 120 typedef struct pst_index {
121 uint64_t id; 121 uint64_t id;
122 uint64_t offset; 122 uint64_t offset;
123 uint16_t size; 123 uint16_t size;
124 int16_t u0; 124 int16_t u0;
125 int32_t u1; 125 int32_t u1;
126 } pst_index; 126 } pst_index;
127 127
128 128
129 typedef struct pst_index_tree32 { 129 typedef struct pst_index_ll {
130 uint32_t i_id;
131 uint32_t offset;
132 uint32_t size;
133 int32_t u1;
134 struct pst_index_tree * next;
135 } pst_index_ll32;
136
137
138 typedef struct pst_index_tree {
139 uint64_t i_id; 130 uint64_t i_id;
140 uint64_t offset; 131 uint64_t offset;
141 uint64_t size; 132 uint64_t size;
142 int64_t u1; 133 int64_t u1;
143 struct pst_index_tree *next; 134 struct pst_index_ll *next;
144 } pst_index_ll; 135 } pst_index_ll;
145 136
146 137
147 typedef struct pst_id2_tree { 138 typedef struct pst_id2_tree {
148 uint64_t id2; 139 uint64_t id2;
149 pst_index_ll *id; 140 pst_index_ll *id;
150 struct pst_id2_tree *child; 141 struct pst_id2_tree *child;
151 struct pst_id2_tree *next; 142 struct pst_id2_tree *next;
152 } pst_id2_ll; 143 } pst_id2_tree;
153 144
154 145
155 typedef struct pst_desc_tree { 146 typedef struct pst_desc_tree {
156 uint64_t d_id; 147 uint64_t d_id;
157 uint64_t parent_d_id; 148 uint64_t parent_d_id;
161 struct pst_desc_tree *prev; 152 struct pst_desc_tree *prev;
162 struct pst_desc_tree *next; 153 struct pst_desc_tree *next;
163 struct pst_desc_tree *parent; 154 struct pst_desc_tree *parent;
164 struct pst_desc_tree *child; 155 struct pst_desc_tree *child;
165 struct pst_desc_tree *child_tail; 156 struct pst_desc_tree *child_tail;
166 } pst_desc_ll; 157 } pst_desc_tree;
167 158
168 159
169 typedef struct pst_string { 160 typedef struct pst_string {
170 int is_utf8; // 1 = true, 0 = false 161 int is_utf8; // 1 = true, 0 = false
171 char *str; // either utf8 or some sbcs 162 char *str; // either utf8 or some sbcs
399 pst_string work_address_postofficebox; // 0x804a 390 pst_string work_address_postofficebox; // 0x804a
400 } pst_item_contact; 391 } pst_item_contact;
401 392
402 393
403 typedef struct pst_item_attach { 394 typedef struct pst_item_attach {
404 pst_string filename1; 395 pst_string filename1;
405 pst_string filename2; 396 pst_string filename2;
406 pst_string mimetype; 397 pst_string mimetype;
407 pst_binary data; 398 pst_binary data;
408 uint64_t id2_val; 399 uint64_t id2_val;
409 /** calculated from id2_val during creation of record */ 400 /** calculated from id2_val during creation of record */
410 uint64_t i_id; 401 uint64_t i_id;
411 /** deep copy from child */ 402 /** deep copy from child */
412 pst_id2_ll *id2_head; 403 pst_id2_tree *id2_head;
413 /** 0=no attachment, 1=attach by value, 2=attach by reference, 3=attach by reference resolve, 4=attach by reference only, 5=embedded message, 6=OLE */ 404 /** 0=no attachment, 1=attach by value, 2=attach by reference, 3=attach by reference resolve, 4=attach by reference only, 5=embedded message, 6=OLE */
414 int32_t method; 405 int32_t method;
415 int32_t position; 406 int32_t position;
416 int32_t sequence; 407 int32_t sequence;
417 struct pst_item_attach *next; 408 struct pst_item_attach *next;
418 } pst_item_attach; 409 } pst_item_attach;
419 410
420 411
421 typedef struct pst_item_extra_field { 412 typedef struct pst_item_extra_field {
472 FILETIME *recurrence_end; 463 FILETIME *recurrence_end;
473 } pst_item_appointment; 464 } pst_item_appointment;
474 465
475 466
476 typedef struct pst_item { 467 typedef struct pst_item {
477 struct pst_item_email *email; // data referring to email 468 pst_item_email *email; // data referring to email
478 struct pst_item_folder *folder; // data referring to folder 469 pst_item_folder *folder; // data referring to folder
479 struct pst_item_contact *contact; // data referring to contact 470 pst_item_contact *contact; // data referring to contact
480 struct pst_item_attach *attach; // linked list of attachments 471 pst_item_attach *attach; // linked list of attachments
481 struct pst_item_message_store *message_store; // data referring to the message store 472 pst_item_message_store *message_store; // data referring to the message store
482 struct pst_item_extra_field *extra_fields; // linked list of extra headers and such 473 pst_item_extra_field *extra_fields; // linked list of extra headers and such
483 struct pst_item_journal *journal; // data referring to a journal entry 474 pst_item_journal *journal; // data referring to a journal entry
484 struct pst_item_appointment *appointment; // data referring to a calendar entry 475 pst_item_appointment *appointment; // data referring to a calendar entry
485 int type; 476 int type;
486 char *ascii_type; 477 char *ascii_type;
487 /** @li 0x01 - Read 478 /** @li 0x01 - Read
488 @li 0x02 - Unmodified 479 @li 0x02 - Unmodified
489 @li 0x04 - Submit 480 @li 0x04 - Submit
536 } pst_block_recorder; 527 } pst_block_recorder;
537 528
538 529
539 typedef struct pst_file { 530 typedef struct pst_file {
540 pst_index_ll *i_head, *i_tail; 531 pst_index_ll *i_head, *i_tail;
541 pst_desc_ll *d_head, *d_tail; 532 pst_desc_tree *d_head, *d_tail;
542 pst_x_attrib_ll *x_head; 533 pst_x_attrib_ll *x_head;
543 pst_block_recorder *block_head; 534 pst_block_recorder *block_head;
544 535
545 /** 0 is 32-bit pst file, pre Outlook 2003; 536 /** 0 is 32-bit pst file, pre Outlook 2003;
546 * 1 is 64-bit pst file, Outlook 2003 and later 537 * 1 is 64-bit pst file, Outlook 2003 and later
609 600
610 601
611 // prototypes 602 // prototypes
612 int pst_open(pst_file *pf, char *name); 603 int pst_open(pst_file *pf, char *name);
613 int pst_close(pst_file *pf); 604 int pst_close(pst_file *pf);
614 pst_desc_ll * pst_getTopOfFolders(pst_file *pf, pst_item *root); 605 pst_desc_tree * pst_getTopOfFolders(pst_file *pf, pst_item *root);
615 size_t pst_attach_to_file(pst_file *pf, pst_item_attach *attach, FILE* fp); 606 size_t pst_attach_to_file(pst_file *pf, pst_item_attach *attach, FILE* fp);
616 size_t pst_attach_to_file_base64(pst_file *pf, pst_item_attach *attach, FILE* fp); 607 size_t pst_attach_to_file_base64(pst_file *pf, pst_item_attach *attach, FILE* fp);
617 int pst_load_index (pst_file *pf); 608 int pst_load_index (pst_file *pf);
618 pst_desc_ll* pst_getNextDptr(pst_desc_ll* d); 609 pst_desc_tree* pst_getNextDptr(pst_desc_tree* d);
619 int pst_load_extended_attributes(pst_file *pf); 610 int pst_load_extended_attributes(pst_file *pf);
620 pst_item* pst_getItem(pst_file *pf, pst_desc_ll *d_ptr); 611 pst_item* pst_getItem(pst_file *pf, pst_desc_tree *d_ptr);
621 pst_item* pst_parse_item (pst_file *pf, pst_desc_ll *d_ptr, pst_id2_ll *m_head); 612 pst_item* pst_parse_item (pst_file *pf, pst_desc_tree *d_ptr, pst_id2_tree *m_head);
622 void pst_freeItem(pst_item *item); 613 void pst_freeItem(pst_item *item);
623 pst_index_ll* pst_getID(pst_file* pf, uint64_t i_id); 614 pst_index_ll* pst_getID(pst_file* pf, uint64_t i_id);
624 int pst_decrypt(uint64_t id, char *buf, size_t size, unsigned char type); 615 int pst_decrypt(uint64_t id, char *buf, size_t size, unsigned char type);
625 size_t pst_ff_getIDblock_dec(pst_file *pf, uint64_t id, char **b); 616 size_t pst_ff_getIDblock_dec(pst_file *pf, uint64_t id, char **b);
626 size_t pst_ff_getIDblock(pst_file *pf, uint64_t id, char** b); 617 size_t pst_ff_getIDblock(pst_file *pf, uint64_t id, char** b);