Mercurial > libpst
comparison src/libpst.h @ 154:581fab9f1dc7
avoid emitting bogus empty email messages into contacts and calendar files
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Sat, 14 Mar 2009 15:13:27 -0700 |
parents | 0b1766da9be8 |
children | ab384fed78c5 |
comparison
equal
deleted
inserted
replaced
153:0b1766da9be8 | 154:581fab9f1dc7 |
---|---|
47 | 47 |
48 // define my custom email attributes. | 48 // define my custom email attributes. |
49 #define PST_ATTRIB_HEADER -1 | 49 #define PST_ATTRIB_HEADER -1 |
50 | 50 |
51 // defines types of free/busy values for appointment->showas | 51 // defines types of free/busy values for appointment->showas |
52 #define PST_FREEBUSY_FREE 0 | 52 #define PST_FREEBUSY_FREE 0 |
53 #define PST_FREEBUSY_TENTATIVE 1 | 53 #define PST_FREEBUSY_TENTATIVE 1 |
54 #define PST_FREEBUSY_BUSY 2 | 54 #define PST_FREEBUSY_BUSY 2 |
55 #define PST_FREEBUSY_OUT_OF_OFFICE 3 | 55 #define PST_FREEBUSY_OUT_OF_OFFICE 3 |
56 | 56 |
57 // defines labels for appointment->label | 57 // defines labels for appointment->label |
58 #define PST_APP_LABEL_NONE 0 // None | 58 #define PST_APP_LABEL_NONE 0 // None |
59 #define PST_APP_LABEL_IMPORTANT 1 // Important | 59 #define PST_APP_LABEL_IMPORTANT 1 // Important |
170 int is_utf8; // 1 = true, 0 = false | 170 int is_utf8; // 1 = true, 0 = false |
171 char *str; // either utf8 or some sbcs | 171 char *str; // either utf8 or some sbcs |
172 } pst_string; | 172 } pst_string; |
173 | 173 |
174 | 174 |
175 /** This struct defines an email message | |
176 */ | |
175 typedef struct pst_item_email { | 177 typedef struct pst_item_email { |
176 FILETIME *arrival_date; | 178 FILETIME *arrival_date; |
177 int autoforward; // 1 = true, 0 = not set, -1 = false | 179 /** 1 = true, 0 = not set, -1 = false */ |
180 int autoforward; | |
178 pst_string cc_address; | 181 pst_string cc_address; |
179 pst_string bcc_address; | 182 pst_string bcc_address; |
180 int32_t conversation_index; | 183 int32_t conversation_index; |
181 int conversion_prohibited; // 1 = true, 0 = false | 184 /** 1 = true, 0 = false */ |
182 int delete_after_submit; // 1 = true, 0 = false | 185 int conversion_prohibited; |
183 int delivery_report; // 1 = true, 0 = false | 186 /** 1 = true, 0 = false */ |
187 int delete_after_submit; | |
188 /** 1 = true, 0 = false */ | |
189 int delivery_report; | |
184 char *encrypted_body; | 190 char *encrypted_body; |
185 size_t encrypted_body_size; | 191 size_t encrypted_body_size; |
186 char *encrypted_htmlbody; | 192 char *encrypted_htmlbody; |
187 size_t encrypted_htmlbody_size; | 193 size_t encrypted_htmlbody_size; |
188 int32_t flag; | |
189 pst_string header; | 194 pst_string header; |
190 pst_string htmlbody; | 195 pst_string htmlbody; |
196 /** 0=low, 1=normal, 2=high */ | |
191 int32_t importance; | 197 int32_t importance; |
192 pst_string in_reply_to; | 198 pst_string in_reply_to; |
193 int message_cc_me; // 1 = true, 0 = false | 199 /** 1 = true, 0 = false */ |
194 int message_recip_me; // 1 = true, 0 = false | 200 int message_cc_me; |
195 int message_to_me; // 1 = true, 0 = false | 201 /** 1 = true, 0 = false */ |
202 int message_recip_me; | |
203 /** 1 = true, 0 = false */ | |
204 int message_to_me; | |
196 pst_string messageid; | 205 pst_string messageid; |
197 int32_t orig_sensitivity; | 206 /** 0=none, 1=personal, 2=private, 3=company confidential */ |
207 int32_t original_sensitivity; | |
198 pst_string original_bcc; | 208 pst_string original_bcc; |
199 pst_string original_cc; | 209 pst_string original_cc; |
200 pst_string original_to; | 210 pst_string original_to; |
201 pst_string outlook_recipient; | 211 pst_string outlook_recipient; |
202 pst_string outlook_recipient_name; | 212 pst_string outlook_recipient_name; |
203 pst_string outlook_recipient2; | 213 pst_string outlook_recipient2; |
204 pst_string outlook_sender; | 214 pst_string outlook_sender; |
205 pst_string outlook_sender_name; | 215 pst_string outlook_sender_name; |
206 pst_string outlook_sender2; | 216 pst_string outlook_sender2; |
217 /** 0=nonurgent, 1=normal, 2=urgent */ | |
207 int32_t priority; | 218 int32_t priority; |
208 pst_string processed_subject; | 219 pst_string processed_subject; |
209 int read_receipt; // 1 = true, 0 = false | 220 /** 1 = true, 0 = false */ |
221 int read_receipt; | |
210 pst_string recip_access; | 222 pst_string recip_access; |
211 pst_string recip_address; | 223 pst_string recip_address; |
212 pst_string recip2_access; | 224 pst_string recip2_access; |
213 pst_string recip2_address; | 225 pst_string recip2_address; |
214 int reply_requested; // 1 = true, 0 = false | 226 /** 1 = true, 0 = false */ |
227 int reply_requested; | |
215 pst_string reply_to; | 228 pst_string reply_to; |
216 pst_string return_path_address; | 229 pst_string return_path_address; |
217 int32_t rtf_body_char_count; | 230 int32_t rtf_body_char_count; |
218 int32_t rtf_body_crc; | 231 int32_t rtf_body_crc; |
219 pst_string rtf_body_tag; | 232 pst_string rtf_body_tag; |
220 char *rtf_compressed; | 233 char *rtf_compressed; |
221 uint32_t rtf_compressed_size; | 234 uint32_t rtf_compressed_size; |
222 int rtf_in_sync; // 1 = true, 0 = doesn't exist, -1 = false | 235 /** 1 = true, 0 = false */ |
236 int rtf_in_sync; | |
223 int32_t rtf_ws_prefix_count; | 237 int32_t rtf_ws_prefix_count; |
224 int32_t rtf_ws_trailing_count; | 238 int32_t rtf_ws_trailing_count; |
225 pst_string sender_access; | 239 pst_string sender_access; |
226 pst_string sender_address; | 240 pst_string sender_address; |
227 pst_string sender2_access; | 241 pst_string sender2_access; |
228 pst_string sender2_address; | 242 pst_string sender2_address; |
243 /** 0=none, 1=personal, 2=private, 3=company confidential */ | |
229 int32_t sensitivity; | 244 int32_t sensitivity; |
230 FILETIME *sent_date; | 245 FILETIME *sent_date; |
231 pst_entryid *sentmail_folder; | 246 pst_entryid *sentmail_folder; |
232 pst_string sentto_address; | 247 pst_string sentto_address; |
233 // delivery report fields | 248 // delivery report fields |
242 | 257 |
243 typedef struct pst_item_folder { | 258 typedef struct pst_item_folder { |
244 int32_t email_count; | 259 int32_t email_count; |
245 int32_t unseen_email_count; | 260 int32_t unseen_email_count; |
246 int32_t assoc_count; | 261 int32_t assoc_count; |
247 int subfolder; // 1 = true, 0 = false | 262 /** 1 = true, 0 = false */ |
263 int subfolder; | |
248 } pst_item_folder; | 264 } pst_item_folder; |
249 | 265 |
250 | 266 |
251 typedef struct pst_item_message_store { | 267 typedef struct pst_item_message_store { |
252 pst_entryid *top_of_personal_folder; // 0x35e0 | 268 pst_entryid *top_of_personal_folder; // 0x35e0 |
255 pst_entryid *sent_items_folder; // 0x35e4 | 271 pst_entryid *sent_items_folder; // 0x35e4 |
256 pst_entryid *user_views_folder; // 0x35e5 | 272 pst_entryid *user_views_folder; // 0x35e5 |
257 pst_entryid *common_view_folder; // 0x35e6 | 273 pst_entryid *common_view_folder; // 0x35e6 |
258 pst_entryid *search_root_folder; // 0x35e7 | 274 pst_entryid *search_root_folder; // 0x35e7 |
259 pst_entryid *top_of_folder; // 0x7c07 | 275 pst_entryid *top_of_folder; // 0x7c07 |
260 int32_t valid_mask; // 0x35df // what folders the message store contains | 276 /** what folders the message store contains |
277 @li FOLDER_IPM_SUBTREE_VALID 0x1 | |
278 @li FOLDER_IPM_INBOX_VALID 0x2 | |
279 @li FOLDER_IPM_OUTBOX_VALID 0x4 | |
280 @li FOLDER_IPM_WASTEBOX_VALID 0x8 | |
281 @li FOLDER_IPM_SENTMAIL_VALID 0x10 | |
282 @li FOLDER_VIEWS_VALID 0x20 | |
283 @li FOLDER_COMMON_VIEWS_VALID 0x40 | |
284 @li FOLDER_FINDER_VALID 0x80 | |
285 */ | |
286 int32_t valid_mask; // 0x35df | |
261 int32_t pwd_chksum; // 0x76ff | 287 int32_t pwd_chksum; // 0x76ff |
262 } pst_item_message_store; | 288 } pst_item_message_store; |
263 | 289 |
264 | 290 |
291 /** This struct defines a contact | |
292 */ | |
265 typedef struct pst_item_contact { | 293 typedef struct pst_item_contact { |
266 pst_string access_method; | 294 pst_string access_method; |
267 pst_string account_name; | 295 pst_string account_name; |
268 pst_string address1; | 296 pst_string address1; |
269 pst_string address1a; | 297 pst_string address1a; |
304 pst_string first_name; | 332 pst_string first_name; |
305 pst_string followup; | 333 pst_string followup; |
306 pst_string free_busy_address; | 334 pst_string free_busy_address; |
307 pst_string ftp_site; | 335 pst_string ftp_site; |
308 pst_string fullname; | 336 pst_string fullname; |
337 /** 0=unspecified, 1=female, 2=male */ | |
309 int16_t gender; | 338 int16_t gender; |
310 pst_string gov_id; | 339 pst_string gov_id; |
311 pst_string hobbies; | 340 pst_string hobbies; |
312 pst_string home_address; // 0x801a | 341 pst_string home_address; // 0x801a |
313 pst_string home_city; | 342 pst_string home_city; |
323 pst_string isdn_phone; | 352 pst_string isdn_phone; |
324 pst_string job_title; | 353 pst_string job_title; |
325 pst_string keyword; | 354 pst_string keyword; |
326 pst_string language; | 355 pst_string language; |
327 pst_string location; | 356 pst_string location; |
328 int mail_permission; // 1 = true, 0 = false | 357 /** 1 = true, 0 = false */ |
358 int mail_permission; | |
329 pst_string manager_name; | 359 pst_string manager_name; |
330 pst_string middle_name; | 360 pst_string middle_name; |
331 pst_string mileage; | 361 pst_string mileage; |
332 pst_string mobile_phone; | 362 pst_string mobile_phone; |
333 pst_string nickname; | 363 pst_string nickname; |
347 pst_string pref_name; | 377 pst_string pref_name; |
348 pst_string primary_fax; | 378 pst_string primary_fax; |
349 pst_string primary_phone; | 379 pst_string primary_phone; |
350 pst_string profession; | 380 pst_string profession; |
351 pst_string radio_phone; | 381 pst_string radio_phone; |
352 int rich_text; // 1 = true, 0 = false | 382 /** 1 = true, 0 = false */ |
383 int rich_text; | |
353 pst_string spouse_name; | 384 pst_string spouse_name; |
354 pst_string suffix; | 385 pst_string suffix; |
355 pst_string surname; | 386 pst_string surname; |
356 pst_string telex; | 387 pst_string telex; |
357 pst_string transmittable_display_name; | 388 pst_string transmittable_display_name; |
371 pst_string filename2; | 402 pst_string filename2; |
372 pst_string mimetype; | 403 pst_string mimetype; |
373 char *data; | 404 char *data; |
374 size_t size; | 405 size_t size; |
375 uint64_t id2_val; | 406 uint64_t id2_val; |
376 uint64_t id_val; // calculated from id2_val during creation of record | 407 /** calculated from id2_val during creation of record */ |
377 pst_id2_ll *id2_head; // deep copy from child | 408 uint64_t id_val; |
409 /** deep copy from child */ | |
410 pst_id2_ll *id2_head; | |
411 /** 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 */ | |
378 int32_t method; | 412 int32_t method; |
379 int32_t position; | 413 int32_t position; |
380 int32_t sequence; | 414 int32_t sequence; |
381 struct pst_item_attach *next; | 415 struct pst_item_attach *next; |
382 } pst_item_attach; | 416 } pst_item_attach; |
387 char *value; | 421 char *value; |
388 struct pst_item_extra_field *next; | 422 struct pst_item_extra_field *next; |
389 } pst_item_extra_field; | 423 } pst_item_extra_field; |
390 | 424 |
391 | 425 |
426 /** This struct defines a journal entry | |
427 */ | |
392 typedef struct pst_item_journal { | 428 typedef struct pst_item_journal { |
393 FILETIME *end; | 429 FILETIME *end; |
394 FILETIME *start; | 430 FILETIME *start; |
395 pst_string type; | 431 pst_string type; |
396 pst_string description; | 432 pst_string description; |
397 } pst_item_journal; | 433 } pst_item_journal; |
398 | 434 |
399 | 435 |
436 /** This struct defines an appointment | |
437 */ | |
400 typedef struct pst_item_appointment { | 438 typedef struct pst_item_appointment { |
401 FILETIME *end; | 439 FILETIME *end; |
402 pst_string location; | 440 pst_string location; |
403 int alarm; // 1 = true, 0 = false | 441 /** 1 = true, 0 = false */ |
442 int alarm; | |
404 FILETIME *reminder; | 443 FILETIME *reminder; |
405 int32_t alarm_minutes; | 444 int32_t alarm_minutes; |
406 pst_string alarm_filename; | 445 pst_string alarm_filename; |
407 FILETIME *start; | 446 FILETIME *start; |
408 pst_string timezonestring; | 447 pst_string timezonestring; |
448 /** 0=free, 1=tentative, 2=busy, 3=out of office*/ | |
409 int32_t showas; | 449 int32_t showas; |
450 /** @li 0=None | |
451 @li 1=Important | |
452 @li 2=Business | |
453 @li 3=Personal | |
454 @li 4=Vacation | |
455 @li 5=Must Attend | |
456 @li 6=Travel Required | |
457 @li 7=Needs Preparation | |
458 @li 8=Birthday | |
459 @li 9=Anniversary | |
460 @li 10=Phone Call | |
461 */ | |
410 int32_t label; | 462 int32_t label; |
411 int all_day; // 1 = true, 0 = false | 463 /** 1 = true, 0 = false */ |
464 int all_day; | |
465 /** recurrence description */ | |
412 pst_string recurrence; | 466 pst_string recurrence; |
467 /** 0=none, 1=daily, 2=weekly, 3=monthly, 4=yearly */ | |
413 int32_t recurrence_type; | 468 int32_t recurrence_type; |
414 FILETIME *recurrence_start; | 469 FILETIME *recurrence_start; |
415 FILETIME *recurrence_end; | 470 FILETIME *recurrence_end; |
416 } pst_item_appointment; | 471 } pst_item_appointment; |
417 | 472 |
425 struct pst_item_extra_field *extra_fields; // linked list of extra headers and such | 480 struct pst_item_extra_field *extra_fields; // linked list of extra headers and such |
426 struct pst_item_journal *journal; // data referring to a journal entry | 481 struct pst_item_journal *journal; // data referring to a journal entry |
427 struct pst_item_appointment *appointment; // data referring to a calendar entry | 482 struct pst_item_appointment *appointment; // data referring to a calendar entry |
428 int type; | 483 int type; |
429 char *ascii_type; | 484 char *ascii_type; |
485 /** @li 0x01 - Read | |
486 @li 0x02 - Unmodified | |
487 @li 0x04 - Submit | |
488 @li 0x08 - Unsent | |
489 @li 0x10 - Has Attachments | |
490 @li 0x20 - From Me | |
491 @li 0x40 - Associated | |
492 @li 0x80 - Resend | |
493 @li 0x100 - RN Pending | |
494 @li 0x200 - NRN Pending | |
495 */ | |
496 int32_t flags; | |
430 pst_string file_as; | 497 pst_string file_as; |
431 pst_string comment; | 498 pst_string comment; |
432 pst_string body_charset; // null if not specified | 499 /** null if not specified */ |
433 pst_string body; // email, journal | 500 pst_string body_charset; |
434 pst_string subject; // email, journal | 501 /** used by email and journal types */ |
502 pst_string body; | |
503 /** used by email and journal types */ | |
504 pst_string subject; | |
435 int32_t internet_cpid; | 505 int32_t internet_cpid; |
436 int32_t message_codepage; | 506 int32_t message_codepage; |
437 int32_t message_size; | 507 int32_t message_size; |
438 pst_string outlook_version; | 508 pst_string outlook_version; |
439 char *record_key; // probably 16 bytes long. | 509 char *record_key; // probably 16 bytes long. |
440 size_t record_key_size; | 510 size_t record_key_size; |
441 int response_requested; // 1 = true, 0 = false | 511 /** 1 = true, 0 = false */ |
512 int response_requested; | |
442 FILETIME *create_date; | 513 FILETIME *create_date; |
443 FILETIME *modify_date; | 514 FILETIME *modify_date; |
444 int private_member; // 1 = true, 0 = false | 515 /** 1 = true, 0 = false */ |
516 int private_member; | |
445 } pst_item; | 517 } pst_item; |
446 | 518 |
447 | 519 |
448 typedef struct pst_x_attrib_ll { | 520 typedef struct pst_x_attrib_ll { |
449 uint32_t type; | 521 uint32_t type; |