libpst.so.4
libpst.h
Go to the documentation of this file.
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 __PST_LIBPST_H
11 #define __PST_LIBPST_H
12 
13 #include "common.h"
14 
15 
16 // switch to maximal packing for all structures in the libpst interface
17 // this is reverted at the end of this file
18 #ifdef _MSC_VER
19  #pragma pack(push, 1)
20 #endif
21 #if defined(__GNUC__) || defined (__SUNPRO_C) || defined(__SUNPRO_CC)
22  #pragma pack(1)
23 #endif
24 
25 
26 #define PST_TYPE_NOTE 1
27 #define PST_TYPE_SCHEDULE 2
28 #define PST_TYPE_APPOINTMENT 8
29 #define PST_TYPE_CONTACT 9
30 #define PST_TYPE_JOURNAL 10
31 #define PST_TYPE_STICKYNOTE 11
32 #define PST_TYPE_TASK 12
33 #define PST_TYPE_OTHER 13
34 #define PST_TYPE_REPORT 14
35 #define PST_TYPE_MAX 15
36 
37 // defines types of possible encryption
38 #define PST_NO_ENCRYPT 0
39 #define PST_COMP_ENCRYPT 1
40 #define PST_ENCRYPT 2
41 
42 // defines different types of mappings
43 #define PST_MAP_ATTRIB (uint32_t)1
44 #define PST_MAP_HEADER (uint32_t)2
45 
46 // define my custom email attributes.
47 #define PST_ATTRIB_HEADER -1
48 
49 // defines types of free/busy values for appointment->showas
50 #define PST_FREEBUSY_FREE 0
51 #define PST_FREEBUSY_TENTATIVE 1
52 #define PST_FREEBUSY_BUSY 2
53 #define PST_FREEBUSY_OUT_OF_OFFICE 3
54 
55 // defines labels for appointment->label
56 #define PST_APP_LABEL_NONE 0
57 #define PST_APP_LABEL_IMPORTANT 1
58 #define PST_APP_LABEL_BUSINESS 2
59 #define PST_APP_LABEL_PERSONAL 3
60 #define PST_APP_LABEL_VACATION 4
61 #define PST_APP_LABEL_MUST_ATTEND 5
62 #define PST_APP_LABEL_TRAVEL_REQ 6
63 #define PST_APP_LABEL_NEEDS_PREP 7
64 #define PST_APP_LABEL_BIRTHDAY 8
65 #define PST_APP_LABEL_ANNIVERSARY 9
66 #define PST_APP_LABEL_PHONE_CALL 10
67 
68 // define type of recuring event
69 #define PST_APP_RECUR_NONE 0
70 #define PST_APP_RECUR_DAILY 1
71 #define PST_APP_RECUR_WEEKLY 2
72 #define PST_APP_RECUR_MONTHLY 3
73 #define PST_APP_RECUR_YEARLY 4
74 
75 // define attachment types
76 #define PST_ATTACH_NONE 0
77 #define PST_ATTACH_BY_VALUE 1
78 #define PST_ATTACH_BY_REF 2
79 #define PST_ATTACH_BY_REF_RESOLV 3
80 #define PST_ATTACH_BY_REF_ONLY 4
81 #define PST_ATTACH_EMBEDDED 5
82 #define PST_ATTACH_OLE 6
83 
84 // define flags
85 #define PST_FLAG_READ 0x01
86 #define PST_FLAG_UNMODIFIED 0x02
87 #define PST_FLAG_SUBMIT 0x04
88 #define PST_FLAG_UNSENT 0x08
89 #define PST_FLAG_HAS_ATTACHMENT 0x10
90 #define PST_FLAG_FROM_ME 0x20
91 #define PST_FLAG_ASSOCIATED 0x40
92 #define PST_FLAG_RESEND 0x80
93 #define PST_FLAG_RN_PENDING 0x100
94 #define PST_FLAG_NRN_PENDING 0x200
95 
96 
97 typedef struct pst_entryid {
98  int32_t u1;
99  char entryid[16];
100  uint32_t id;
101 } pst_entryid;
102 
103 
104 typedef struct pst_index_ll {
105  uint64_t i_id;
106  uint64_t offset;
107  uint64_t size;
108  int64_t u1;
109 } pst_index_ll;
110 
111 
112 typedef struct pst_id2_tree {
113  uint64_t id2;
117 } pst_id2_tree;
118 
119 
120 typedef struct pst_desc_tree {
121  uint64_t d_id;
122  uint64_t parent_d_id;
125  int32_t no_child;
131 } pst_desc_tree;
132 
133 
138 typedef struct pst_string {
141  int is_utf8;
142  char *str;
143 } pst_string;
144 
145 
147 typedef struct pst_binary {
148  size_t size;
149  char *data;
150 } pst_binary;
151 
152 
155 typedef struct pst_item_email {
193  int32_t importance;
239  int32_t priority;
267  int32_t rtf_body_crc;
303  int32_t sensitivity;
317  int32_t ndr_diag_code;
322 
323  // elements added for .msg processing
333 
334 
337 typedef struct pst_item_folder {
339  int32_t item_count;
345  int32_t assoc_count;
352 
353 
356 typedef struct pst_item_message_store {
383  int32_t valid_mask;
385  int32_t pwd_chksum;
387 
388 
391 typedef struct pst_item_contact {
480  int16_t gender;
598 
599 
602 typedef struct pst_item_attach {
614  uint64_t id2_val;
616  uint64_t i_id;
627  int32_t method;
629  int32_t position;
631  int32_t sequence;
634 
635 
637 typedef struct pst_item_extra_field {
638  char *field_name;
639  char *value;
642 
643 
646 typedef struct pst_item_journal {
656 
657 
661 typedef struct pst_recurrence {
663  uint32_t signature;
668  uint32_t type;
675  uint32_t sub_type;
677  uint32_t parm1;
678  uint32_t parm2;
679  uint32_t parm3;
680  uint32_t parm4;
681  uint32_t parm5;
687  uint32_t termination;
689  uint32_t interval;
691  uint32_t bydaymask;
693  uint32_t dayofmonth;
695  uint32_t monthofyear;
697  uint32_t position;
699  uint32_t count;
700  // there is more data, including the termination date,
701  // but we can get that from other mapi elements.
703 
704 
707 typedef struct pst_item_appointment {
717  int alarm;
721  int32_t alarm_minutes;
731  int32_t showas;
744  int32_t label;
748  int all_day;
769 
770 
774 typedef struct pst_item {
776  struct pst_file *pf;
778  uint64_t block_id;
805  int type;
807  char *ascii_type;
819  int32_t flags;
831  int32_t internet_cpid;
835  int32_t message_size;
854 } pst_item;
855 
856 
865 typedef struct pst_x_attrib_ll {
869  uint32_t mytype;
871  uint32_t map;
873  void *data;
877 
878 
880 typedef struct pst_block_recorder {
882  int64_t offset;
883  size_t size;
886 
887 
888 typedef struct pst_file {
890  FILE* fp;
892  char* cwd;
894  char* fname;
896  const char* charset;
899  size_t i_count, i_capacity;
908 
913  uint64_t index1;
915  uint64_t index1_back;
917  uint64_t index2;
919  uint64_t index2_back;
921  uint64_t size;
925  unsigned char encryption;
931  unsigned char ind_type;
932 } pst_file;
933 
934 
942 int pst_open(pst_file *pf, const char *name, const char *charset);
943 
944 
949 int pst_reopen(pst_file *pf);
950 
951 
957 int pst_load_index (pst_file *pf);
958 
959 
965 
966 
970 int pst_close(pst_file *pf);
971 
972 
979 
980 
988 
989 
995 size_t pst_attach_to_file(pst_file *pf, pst_item_attach *attach, FILE* fp);
996 
997 
1003 size_t pst_attach_to_file_base64(pst_file *pf, pst_item_attach *attach, FILE* fp);
1004 
1005 
1011 
1012 
1021 
1022 
1026 void pst_freeItem(pst_item *item);
1027 
1028 
1034 pst_index_ll* pst_getID(pst_file* pf, uint64_t i_id);
1035 
1036 
1044 size_t pst_ff_getIDblock_dec(pst_file *pf, uint64_t i_id, char **buf);
1045 
1046 
1050 int pst_stricmp(char *a, char *b);
1051 
1052 
1060 size_t pst_fwrite(const void* ptr, size_t size, size_t nmemb, FILE* stream);
1061 
1062 
1071 char* pst_rfc2426_escape(char* str, char** result, size_t* resultlen);
1072 
1073 
1081 char* pst_rfc2425_datetime_format(const FILETIME* ft, int buflen, char* result);
1082 
1083 
1090 char* pst_rfc2445_datetime_format(const FILETIME* ft, int buflen, char* result);
1091 
1092 
1098 char* pst_rfc2445_datetime_format_now(int buflen, char* result);
1099 
1100 
1108 const char* pst_default_charset(pst_item *item, int buflen, char* result);
1109 
1110 
1114 void pst_rfc2231(pst_string *str);
1115 
1116 
1122 void pst_rfc2047(pst_item *item, pst_string *str, int needs_quote);
1123 
1124 
1129 void pst_convert_utf8_null(pst_item *item, pst_string *str);
1130 
1131 
1136 void pst_convert_utf8(pst_item *item, pst_string *str);
1137 
1138 
1144 
1145 
1150 
1151 
1152 
1153 // switch from maximal packing back to default packing
1154 // undo the packing from the beginning of this file
1155 #ifdef _MSC_VER
1156  #pragma pack(pop)
1157 #endif
1158 #if defined(__GNUC__) || defined (__SUNPRO_C) || defined(__SUNPRO_CC)
1159  #pragma pack()
1160 #endif
1161 
1162 
1163 
1164 #endif
pst_string sender_address
mapi element 0x0065 PR_SENT_REPRESENTING_EMAIL_ADDRESS
Definition: libpst.h:293
int32_t valid_mask
mapi element 0x35df, bit mask of folders in this message store
Definition: libpst.h:383
pst_string original_cc
mapi element 0x0073 PR_ORIGINAL_DISPLAY_CC
Definition: libpst.h:219
pst_entryid * sent_items_folder
mapi element 0x35e4
Definition: libpst.h:364
pst_string timezonestring
mapi element 0x8234
Definition: libpst.h:725
uint32_t bydaymask
bit mask of days of the week
Definition: libpst.h:691
pst_string outlook_received_name1
mapi element 0x0040 PR_RECEIVED_BY_NAME
Definition: libpst.h:325
struct pst_id2_tree pst_id2_tree
pst_string other_postal_code
mapi element 0x3a61 PR_OTHER_ADDRESS_POSTAL_CODE
Definition: libpst.h:548
int pst_load_index(pst_file *pf)
Load the index entries from the pst file.
pst_string suffix
mapi element 0x3a05 PR_GENERATION (Jr., Sr., III, etc)
Definition: libpst.h:574
struct pst_item_contact pst_item_contact
This contains the contact related mapi elements.
pst_string followup
mapi element 0x8530
Definition: libpst.h:469
int32_t alarm_minutes
mapi element 0x8501 PR_OUTLOOK_COMMON_REMINDER_MINUTES_BEFORE
Definition: libpst.h:721
pst_string work_address_city
mapi element 0x8046
Definition: libpst.h:588
This contains the folder related mapi elements.
Definition: libpst.h:337
char * pst_rfc2426_escape(char *str, char **result, size_t *resultlen)
Add any necessary escape characters for rfc2426 vcard format.
pst_string home_address
mapi element 0x801a
Definition: libpst.h:486
unsigned char encryption
Definition: libpst.h:925
FILETIME * wedding_anniversary
mapi element 0x3a41 PR_WEDDING_ANNIVERSARY
Definition: libpst.h:584
void pst_rfc2047(pst_item *item, pst_string *str, int needs_quote)
Convert str to rfc2047 encoding of str, possibly enclosed in quotes if it contains spaces...
pst_binary encrypted_htmlbody
mapi element 0x6f02
Definition: libpst.h:184
pst_item_appointment * appointment
calendar mapi elements
Definition: libpst.h:794
pst_string address2_transport
mapi element 0x8092
Definition: libpst.h:409
pst_desc_tree * d_tail
Definition: libpst.h:901
FILETIME * modify_date
mapi element 0x3008 PR_LAST_MODIFICATION_TIME
Definition: libpst.h:849
pst_item_contact * contact
contact mapi elements
Definition: libpst.h:784
pst_string comment
mapi element 0x3004 PR_COMMENT
Definition: libpst.h:823
int pst_reopen(pst_file *pf)
Reopen the pst file after a fork.
int32_t importance
mapi element 0x0017 PR_IMPORTANCE
Definition: libpst.h:193
pst_string billing_information
mapi element 0x8535
Definition: libpst.h:423
int32_t flags
mapi element 0x0e07 PR_MESSAGE_FLAGS
Definition: libpst.h:819
pst_string subject
mapi element 0x0037 PR_SUBJECT
Definition: libpst.h:829
int32_t recurrence_type
mapi element 0x8231
Definition: libpst.h:759
uint32_t position
occurence of day for 2nd Tuesday of month, in which case position is 2
Definition: libpst.h:697
int64_t offset
Definition: libpst.h:882
pst_string home_fax
mapi element 0x3a25 PR_HOME_FAX_NUMBER
Definition: libpst.h:492
uint32_t parm4
Definition: libpst.h:680
pst_string mobile_phone
mapi element 0x3a1c PR_MOBILE_TELEPHONE_NUMBER
Definition: libpst.h:528
int rich_text
mapi element 0x3a40 PR_SEND_RICH_INFO
Definition: libpst.h:570
struct pst_item_email pst_item_email
This contains the email related mapi elements.
pst_string car_phone
mapi element 0x3a1e PR_CAR_TELEPHONE_NUMBER
Definition: libpst.h:451
pst_string alarm_filename
mapi element 0x851f
Definition: libpst.h:723
pst_string hobbies
mapi element 0x3a43 PR_HOBBIES
Definition: libpst.h:484
pst_binary record_key
mapi element 0x0ff9 PR_RECORD_KEY
Definition: libpst.h:839
int subfolder
mapi element 0x360a PR_SUBFOLDERS
Definition: libpst.h:350
pst_string header
mapi element 0x007d PR_TRANSPORT_MESSAGE_HEADERS
Definition: libpst.h:186
struct pst_item_attach pst_item_attach
This contains the attachment related mapi elements.
pst_string transmittable_display_name
mapi element 0x3a20 PR_TRANSMITTABLE_DISPLAY_NAME
Definition: libpst.h:580
pst_string work_address_postofficebox
mapi element 0x804a
Definition: libpst.h:596
struct pst_desc_tree * child_tail
Definition: libpst.h:130
pst_string initials
mapi element 0x3a0a PR_INITIALS
Definition: libpst.h:506
int32_t original_sensitivity
mapi element 0x002e PR_ORIGINAL_SENSITIVITY
Definition: libpst.h:215
FILETIME * create_date
mapi element 0x3007 PR_CREATION_TIME
Definition: libpst.h:847
int32_t rtf_ws_trailing_count
mapi element 0x1011 PR_RTF_SYNC_TRAILING_COUNT, a count of the ignored characters after the last sign...
Definition: libpst.h:289
pst_string home_city
mapi element 0x3a59 PR_HOME_ADDRESS_CITY
Definition: libpst.h:488
pst_string business_homepage
mapi element 0x3a51 PR_BUSINESS_HOME_PAGE
Definition: libpst.h:435
uint32_t parm1
must be contiguous, not an array to make python interface easier
Definition: libpst.h:677
pst_string address2a
mapi element 0x8095
Definition: libpst.h:405
pst_string other_country
mapi element 0x3a60 PR_OTHER_ADDRESS_COUNTRY
Definition: libpst.h:542
uint64_t index2_back
back pointer value in the first b-tree node in the descriptor tree
Definition: libpst.h:919
pst_binary conversation_index
mapi element 0x0071 PR_CONVERSATION_INDEX
Definition: libpst.h:168
int delete_after_submit
mapi element 0x0e01 PR_DELETE_AFTER_SUBMIT
Definition: libpst.h:176
pst_entryid * default_outbox_folder
mapi element 0x35e2
Definition: libpst.h:360
size_t pst_attach_to_file(pst_file *pf, pst_item_attach *attach, FILE *fp)
Write a binary attachment to a file.
pst_string processed_subject
mapi element 0x0070 PR_CONVERSATION_TOPIC
Definition: libpst.h:241
uint32_t termination
type of termination of the recurrence
Definition: libpst.h:687
uint64_t id2_val
only used if the attachment is by reference, in which case this is the id2 reference ...
Definition: libpst.h:614
pst_string computer_name
mapi element 0x3a49 PR_COMPUTER_NETWORK_NAME
Definition: libpst.h:457
int32_t internet_cpid
mapi element 0x3fde PR_INTERNET_CPID
Definition: libpst.h:831
struct pst_desc_tree * parent
Definition: libpst.h:128
pst_string telex
mapi element 0x3a2c PR_TELEX_NUMBER
Definition: libpst.h:578
pst_string address1_desc
mapi element 0x8084
Definition: libpst.h:399
uint64_t parent_d_id
Definition: libpst.h:122
int64_t u1
Definition: libpst.h:108
pst_string home_street
mapi element 0x3a5d PR_HOME_ADDRESS_STREET
Definition: libpst.h:504
int alarm
mapi element 0x8503 PR_OUTLOOK_COMMON_REMINDER_SET
Definition: libpst.h:717
struct pst_entryid pst_entryid
pst_string business_state
mapi element 0x3a28 PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE
Definition: libpst.h:445
char * ascii_type
mapi element 0x001a PR_MESSAGE_CLASS or 0x3613 PR_CONTAINER_CLASS
Definition: libpst.h:807
int rtf_in_sync
mapi element 0x0e1f PR_RTF_IN_SYNC, True means that the rtf version is same as text body...
Definition: libpst.h:283
void pst_convert_utf8(pst_item *item, pst_string *str)
Convert str to utf8 if possible; null strings are converted into empty strings.
char entryid[16]
Definition: libpst.h:99
pst_string work_address_street
mapi element 0x8045
Definition: libpst.h:586
struct pst_x_attrib_ll * next
link to next item in the list
Definition: libpst.h:875
pst_string business_po_box
mapi element 0x3a2b PR_BUSINESS_PO_BOX
Definition: libpst.h:441
pst_item_journal * journal
journal mapi elements
Definition: libpst.h:792
uint64_t offset
Definition: libpst.h:106
pst_string other_street
mapi element 0x3a63 PR_OTHER_ADDRESS_STREET
Definition: libpst.h:552
struct pst_item_message_store pst_item_message_store
This contains the message store related mapi elements.
pst_string company_main_phone
mapi element 0x3a57 PR_COMPANY_MAIN_PHONE_NUMBER
Definition: libpst.h:453
uint64_t block_id
block id that can be used to generate uid
Definition: libpst.h:778
pst_string address1_transport
mapi element 0x3002 PR_ADDRTYPE, or 0x8082
Definition: libpst.h:401
uint32_t map
key for the mapping
Definition: libpst.h:871
int pst_open(pst_file *pf, const char *name, const char *charset)
Open a pst file.
int16_t gender
mapi element 0x3a4d PR_GENDER
Definition: libpst.h:480
pst_string address3_transport
mapi element 0x80a2
Definition: libpst.h:417
unsigned char ind_type
index type or file type
Definition: libpst.h:931
pst_entryid * user_views_folder
mapi element 0x35e5
Definition: libpst.h:366
pst_string other_po_box
mapi element 0x3a64 PR_OTHER_ADDRESS_POST_OFFICE_BOX
Definition: libpst.h:546
pst_string primary_fax
mapi element 0x3a23 PR_PRIMARY_FAX_NUMBER
Definition: libpst.h:560
pst_string department
mapi element 0x3a18 PR_DEPARTMENT_NAME
Definition: libpst.h:463
pst_binary encrypted_body
mapi element 0x6f04
Definition: libpst.h:182
uint32_t mytype
Definition: libpst.h:869
struct pst_index_ll pst_index_ll
int32_t unseen_item_count
mapi element 0x3603 PR_CONTENT_UNREAD
Definition: libpst.h:341
pst_string recurrence_description
mapi element 0x8232 recurrence description
Definition: libpst.h:761
pst_string business_country
mapi element 0x3a26 PR_BUSINESS_ADDRESS_COUNTRY
Definition: libpst.h:431
uint32_t id
Definition: libpst.h:100
uint64_t d_id
Definition: libpst.h:121
pst_string surname
mapi element 0x3a11 PR_SURNAME
Definition: libpst.h:576
FILETIME * end
mapi element 0x8708
Definition: libpst.h:650
struct pst_item_extra_field * next
Definition: libpst.h:640
size_t size
Definition: libpst.h:148
int conversion_prohibited
mapi element 0x3a03 PR_CONVERSION_PROHIBITED
Definition: libpst.h:172
pst_string outlook_sender
mapi element 0x003b PR_SENT_REPRESENTING_SEARCH_KEY
Definition: libpst.h:229
FILETIME * recurrence_start
mapi element 0x8235 PR_OUTLOOK_EVENT_RECURRENCE_START
Definition: libpst.h:765
pst_string display_name_prefix
mapi element 0x3a45 PR_DISPLAY_NAME_PREFIX
Definition: libpst.h:465
struct pst_block_recorder pst_block_recorder
this is only used for internal debugging
pst_string sender2_access
mapi element 0x0c1e PR_SENDER_ADDRTYPE
Definition: libpst.h:295
struct pst_x_attrib_ll pst_x_attrib_ll
Linked list of extended attributes.
pst_string work_address_state
mapi element 0x8047
Definition: libpst.h:590
int32_t showas
mapi element 0x8205 PR_OUTLOOK_EVENT_SHOW_TIME_AS
Definition: libpst.h:731
pst_string language
mapi element 0x3a0c PR_LANGUAGE
Definition: libpst.h:514
pst_string company_name
mapi element 0x3a16 PR_COMPANY_NAME
Definition: libpst.h:455
size_t pst_attach_to_file_base64(pst_file *pf, pst_item_attach *attach, FILE *fp)
Write a binary attachment base64 encoded to a file.
pst_string location
mapi element 0x3a0d PR_LOCATION
Definition: libpst.h:516
FILETIME * reminder
mapi element 0x8560
Definition: libpst.h:719
This contains the common mapi elements, and pointers to structures for each major mapi item type...
Definition: libpst.h:774
int32_t method
mapi element 0x3705 PR_ATTACH_METHOD
Definition: libpst.h:627
pst_entryid * top_of_personal_folder
mapi element 0x35e0
Definition: libpst.h:358
pst_string profession
mapi element 0x3a46 PR_PROFESSION
Definition: libpst.h:564
int private_member
mapi element 0x002b PR_RECIPIENT_REASSIGNMENT_PROHIBITED
Definition: libpst.h:853
This contains the attachment related mapi elements.
Definition: libpst.h:602
pst_string def_postal_address
mapi element 0x3a15 PR_POSTAL_ADDRESS
Definition: libpst.h:461
Linked list of extended attributes.
Definition: libpst.h:865
pst_string reply_to
mapi element 0x0050 PR_REPLY_RECIPIENT_NAMES
Definition: libpst.h:259
uint32_t sub_type
implies number of recurrence parameters
Definition: libpst.h:675
char * cwd
original cwd when the file was opened
Definition: libpst.h:892
pst_string free_busy_address
mapi element 0x80d8
Definition: libpst.h:471
pst_string outlook_recipient_name
mapi element 0x0044 PR_RCVD_REPRESENTING_NAME
Definition: libpst.h:225
pst_binary data
mapi element 0x3701 PR_ATTACH_DATA_OBJ
Definition: libpst.h:612
a simple wrapper for binary blobs
Definition: libpst.h:147
pst_string ttytdd_phone
mapi element 0x3a4b PR_TTYTDD_PHONE_NUMBER
Definition: libpst.h:582
pst_string report_text
mapi element 0x1001 PR_REPORT_TEXT, delivery report dsn body
Definition: libpst.h:311
pst_entryid * common_view_folder
mapi element 0x35e6
Definition: libpst.h:368
pst_string body_charset
derived from extra_fields["content-type"] if it contains a charset= subfield
Definition: libpst.h:825
pst_entryid * deleted_items_folder
mapi element 0x35e3
Definition: libpst.h:362
int message_cc_me
mapi element 0x0058 PR_MESSAGE_CC_ME, this user is listed explicitly in the CC address ...
Definition: libpst.h:199
pst_string nickname
mapi element 0x3a4f PR_NICKNAME
Definition: libpst.h:530
pst_string file_as
mapi element 0x3001 PR_DISPLAY_NAME
Definition: libpst.h:821
pst_string assistant_phone
mapi element 0x3a2e PR_ASSISTANT_TELEPHONE_NUMBER
Definition: libpst.h:421
int pst_close(pst_file *pf)
Close a pst file.
pst_string first_name
mapi element 0x3a06 PR_GIVEN_NAME
Definition: libpst.h:467
pst_string messageid
mapi element 0x1035
Definition: libpst.h:209
int32_t rtf_body_char_count
mapi element 0x1007 PR_RTF_SYNC_BODY_COUNT, a count of the significant charcters in the rtf body...
Definition: libpst.h:265
uint32_t parm3
Definition: libpst.h:679
pst_string address2
mapi element 0x8093
Definition: libpst.h:403
pst_string outlook_sender_name2
mapi element 0x0c1a PR_SENDER_NAME
Definition: libpst.h:327
pst_recurrence * pst_convert_recurrence(pst_item_appointment *appt)
Decode raw recurrence data into a better structure.
pst_string outlook_search_key
mapi element 0x300b PR_SEARCH_KEY
Definition: libpst.h:331
uint32_t monthofyear
month of year for yearly recurrences
Definition: libpst.h:695
The string is either utf8 encoded, or it is in the code page specified by the containing mapi object...
Definition: libpst.h:138
pst_string business_fax
mapi element 0x3a24 PR_BUSINESS_FAX_NUMBER
Definition: libpst.h:433
size_t i_count
Definition: libpst.h:899
uint32_t type
Definition: libpst.h:668
int32_t ndr_reason_code
mapi element 0x0c04 PR_NDR_REASON_CODE
Definition: libpst.h:315
pst_string job_title
mapi element 0x3a17 PR_TITLE
Definition: libpst.h:510
pst_string recip2_address
mapi element 0x0078 PR_RCVD_REPRESENTING_EMAIL_ADDRESS
Definition: libpst.h:253
uint64_t i_id
Definition: libpst.h:105
int autoforward
mapi element 0x0002 PR_ALTERNATE_RECIPIENT_ALLOWED
Definition: libpst.h:162
struct pst_desc_tree * next
Definition: libpst.h:127
int32_t priority
mapi element 0x0026 PR_PRIORITY
Definition: libpst.h:239
pst_string recip_access
mapi element 0x0075 PR_RECEIVED_BY_ADDRTYPE
Definition: libpst.h:247
pst_string outlook_recipient2
mapi element 0x0052 PR_RCVD_REPRESENTING_SEARCH_KEY
Definition: libpst.h:227
struct pst_id2_tree * child
Definition: libpst.h:115
This contains the message store related mapi elements.
Definition: libpst.h:356
pst_string mimetype
mapi element 0x370e PR_ATTACH_MIME_TAG
Definition: libpst.h:608
int32_t label
mapi element 0x8214
Definition: libpst.h:744
pst_binary predecessor_change
mapi element 0x65e3 PR_PREDECESSOR_CHANGE_LIST
Definition: libpst.h:841
struct pst_desc_tree * child
Definition: libpst.h:129
FILETIME * birthday
mapi element 0x3a42 PR_BIRTHDAY
Definition: libpst.h:425
struct pst_file pst_file
int mail_permission
mapi element 0x3a0e PR_MAIL_PERMISSION
Definition: libpst.h:520
int32_t u1
Definition: libpst.h:98
pst_string keyword
mapi element 0x3a0b PR_KEYWORD
Definition: libpst.h:512
pst_string cc_address
mapi element 0x0e03 PR_DISPLAY_CC
Definition: libpst.h:164
size_t pst_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
fwrite with checking for null pointer.
struct pst_item pst_item
This contains the common mapi elements, and pointers to structures for each major mapi item type...
char * data
Definition: libpst.h:149
pst_index_ll * desc
Definition: libpst.h:123
pst_string ftp_site
mapi element 0x3a4c PR_FTP_SITE
Definition: libpst.h:473
uint32_t signature
0x30043004
Definition: libpst.h:663
pst_string sentto_address
mapi element 0x0e04 PR_DISPLAY_TO
Definition: libpst.h:309
pst_block_recorder * block_head
the head of the block recorder, a debug artifact used to detect cases where we might read the same bl...
Definition: libpst.h:907
int32_t rtf_ws_prefix_count
mapi element 0x1010 PR_RTF_SYNC_PREFIX_COUNT, a count of the ignored characters before the first sign...
Definition: libpst.h:286
uint64_t index1
file offset of the first b-tree node in the index tree
Definition: libpst.h:913
pst_index_ll * pst_getID(pst_file *pf, uint64_t i_id)
Lookup the i_id in the index linked list, and return a pointer to the element.
FILETIME * sent_date
mapi element 0x0039 PR_CLIENT_SUBMIT_TIME
Definition: libpst.h:305
pst_string other_phone
mapi element 0x3a1f PR_OTHER_TELEPHONE_NUMBER
Definition: libpst.h:544
int delivery_report
mapi element 0x0023 PR_ORIGINATOR_DELIVERY_REPORT_REQUESTED
Definition: libpst.h:180
pst_string filename1
mapi element 0x3704 PR_ATTACH_FILENAME
Definition: libpst.h:604
uint32_t dayofmonth
day of month for monthly and yearly recurrences
Definition: libpst.h:693
int pst_stricmp(char *a, char *b)
compare strings case-insensitive.
int32_t assoc_count
mapi element 0x3617 PR_ASSOC_CONTENT_COUNT Associated content are items that are attached to this fol...
Definition: libpst.h:345
pst_string body
mapi element 0x1000 PR_BODY
Definition: libpst.h:827
pst_item_message_store * message_store
message store mapi elements
Definition: libpst.h:788
pst_string business_phone2
mapi element 0x3a1b PR_BUSINESS2_TELEPHONE_NUMBER
Definition: libpst.h:439
int32_t message_size
mapi element 0x0e08 PR_MESSAGE_SIZE
Definition: libpst.h:835
FILETIME * end
mapi element 0x820e PR_OUTLOOK_EVENT_START_END
Definition: libpst.h:711
this is only used for internal debugging
Definition: libpst.h:880
pst_string common_name
mapi element 0x3a0f PR_MHS_COMMON_NAME
Definition: libpst.h:534
int32_t no_child
Definition: libpst.h:125
uint32_t interval
recurrence interval in terms of the recurrence type
Definition: libpst.h:689
pst_string customer_id
mapi element 0x3a4a PR_CUSTOMER_ID
Definition: libpst.h:459
pst_entryid * top_of_folder
mapi element 0x7c07
Definition: libpst.h:372
pst_string manager_name
mapi element 0x3a4e PR_MANAGER_NAME
Definition: libpst.h:522
pst_string type
mapi element 0x8700
Definition: libpst.h:652
pst_string supplementary_info
mapi element 0x0c1b PR_SUPPLEMENTARY_INFO
Definition: libpst.h:319
pst_string org_id
mapi element 0x3a10 PR_ORGANIZATIONAL_ID_NUMBER
Definition: libpst.h:536
pst_string business_address
mapi element 0x801b
Definition: libpst.h:427
struct pst_item_journal pst_item_journal
This contains the journal related mapi elements.
FILETIME * arrival_date
mapi element 0x0e06 PR_MESSAGE_DELIVERY_TIME
Definition: libpst.h:157
const char * pst_default_charset(pst_item *item, int buflen, char *result)
Get the default character set for this item.
pst_string sender_access
mapi element 0x0064 PR_SENT_REPRESENTING_ADDRTYPE
Definition: libpst.h:291
pst_string outlook_recipient
mapi element 0x0051 PR_RECEIVED_BY_SEARCH_KEY
Definition: libpst.h:223
pst_string assistant_name
mapi element 0x3a30 PR_ASSISTANT
Definition: libpst.h:419
int32_t message_codepage
mapi element 0x3ffd PR_MESSAGE_CODEPAGE
Definition: libpst.h:833
struct pst_desc_tree pst_desc_tree
int read_receipt
mapi element 0x0029 PR_READ_RECEIPT_REQUESTED
Definition: libpst.h:245
void pst_freeItem(pst_item *item)
Free the item returned by pst_parse_item().
pst_string callback_phone
mapi element 0x3a02 PR_CALLBACK_TELEPHONE_NUMBER
Definition: libpst.h:449
pst_item * pst_parse_item(pst_file *pf, pst_desc_tree *d_ptr, pst_id2_tree *m_head)
Assemble a mapi object from a descriptor pointer.
uint64_t i_id
calculated from id2_val during creation of record
Definition: libpst.h:616
pst_string bcc_address
mapi element 0x0e02 PR_DISPLAY_BCC
Definition: libpst.h:166
void * data
data target of the mapping, either uint32_t or string
Definition: libpst.h:873
pst_string address3
mapi element 0x80a3
Definition: libpst.h:411
uint64_t index2
file offset of the first b-tree node in the descriptor tree
Definition: libpst.h:917
pst_string outlook_version
mapi element 0x8554 PR_OUTLOOK_VERSION
Definition: libpst.h:837
struct pst_binary pst_binary
a simple wrapper for binary blobs
pst_x_attrib_ll * x_head
the head of the extended attributes linked list
Definition: libpst.h:903
pst_string home_po_box
mapi element 0x3a5e PR_HOME_ADDRESS_POST_OFFICE_BOX
Definition: libpst.h:498
pst_index_ll * assoc_tree
Definition: libpst.h:124
int is_recurring
mapi element 0x8223 PR_OUTLOOK_EVENT_IS_RECURRING
Definition: libpst.h:752
pst_string htmlbody
mapi element 0x1013
Definition: libpst.h:188
char * fname
original file name when the file was opened
Definition: libpst.h:894
int type
derived from mapi elements 0x001a PR_MESSAGE_CLASS or 0x3613 PR_CONTAINER_CLASS
Definition: libpst.h:805
int32_t pwd_chksum
mapi element 0x76ff
Definition: libpst.h:385
int32_t sequence
mapi element 0x3710 PR_ATTACH_MIME_SEQUENCE
Definition: libpst.h:631
int message_to_me
mapi element 0x0057 PR_MESSAGE_TO_ME, this user is listed explicitly in the TO address ...
Definition: libpst.h:207
uint32_t parm5
Definition: libpst.h:681
pst_string radio_phone
mapi element 0x3a1d PR_RADIO_TELEPHONE_NUMBER
Definition: libpst.h:566
size_t pst_ff_getIDblock_dec(pst_file *pf, uint64_t i_id, char **buf)
Get an ID block from the file using pst_ff_getIDblock() and decrypt if necessary. ...
This contains the appointment related mapi elements.
Definition: libpst.h:707
pst_item_extra_field * extra_fields
linked list of extra headers and such
Definition: libpst.h:790
int reply_requested
mapi element 0x0c17 PR_REPLY_REQUESTED
Definition: libpst.h:257
struct pst_block_recorder * next
Definition: libpst.h:881
pst_string home_country
mapi element 0x3a5a PR_HOME_ADDRESS_COUNTRY
Definition: libpst.h:490
pst_string address2_desc
mapi element 0x8094
Definition: libpst.h:407
pst_string home_phone
mapi element 0x3a09 PR_HOME_TELEPHONE_NUMBER
Definition: libpst.h:494
linked list of extra header fields
Definition: libpst.h:637
pst_entryid * search_root_folder
mapi element 0x35e7
Definition: libpst.h:370
pst_string in_reply_to
mapi element 0x1042
Definition: libpst.h:195
pst_string outlook_normalized_subject
mapi element 0x0e1d PR_NORMALIZED_SUBJECT
Definition: libpst.h:329
uint64_t index1_back
back pointer value in the first b-tree node in the index tree
Definition: libpst.h:915
pst_binary recurrence_data
mapi element 0x8216 recurrence data
Definition: libpst.h:763
char * pst_rfc2445_datetime_format_now(int buflen, char *result)
Convert the current time rfc2445 date/time format 19531015T231000Z.
pst_string outlook_sender_name
mapi element 0x0042 PR_SENT_REPRESENTING_NAME
Definition: libpst.h:231
pst_string home_postal_code
mapi element 0x3a5b PR_HOME_ADDRESS_POSTAL_CODE
Definition: libpst.h:500
int is_utf8
Definition: libpst.h:141
uint64_t size
size of the pst file
Definition: libpst.h:921
pst_string sender2_address
mapi element 0x0c1f PR_SENDER_EMAIL_ADDRESS
Definition: libpst.h:297
pst_binary rtf_compressed
mapi element 0x1009 PR_RTF_COMPRESSED, the compressed rtf body data.
Definition: libpst.h:275
struct pst_string pst_string
The string is either utf8 encoded, or it is in the code page specified by the containing mapi object...
This contains the contact related mapi elements.
Definition: libpst.h:391
pst_string home_state
mapi element 0x3a5c PR_HOME_ADDRESS_STATE_OR_PROVINCE
Definition: libpst.h:502
This contains the email related mapi elements.
Definition: libpst.h:155
int32_t ndr_status_code
mapi element 0x0c20 PR_NDR_STATUS_CODE
Definition: libpst.h:321
pst_string return_path_address
mapi element 0x1046, this seems to be the message-id of the rfc822 mail that is being returned ...
Definition: libpst.h:261
struct pst_item_folder pst_item_folder
This contains the folder related mapi elements.
pst_string filename2
mapi element 0x3707 PR_ATTACH_LONG_FILENAME
Definition: libpst.h:606
FILETIME * report_time
mapi element 0x0032 PR_REPORT_TIME, delivery report time
Definition: libpst.h:313
pst_string description
mapi element 0x8712
Definition: libpst.h:654
FILETIME * recurrence_end
mapi element 0x8236 PR_OUTLOOK_EVENT_RECURRENCE_END
Definition: libpst.h:767
pst_string business_city
mapi element 0x3a27 PR_BUSINESS_ADDRESS_CITY
Definition: libpst.h:429
This contains the journal related mapi elements.
Definition: libpst.h:646
int message_recip_me
mapi element 0x0059 PR_MESSAGE_RECIP_ME, this user appears in TO, CC or BCC address list ...
Definition: libpst.h:203
pst_string pager_phone
mapi element 0x3a21 PR_PAGER_TELEPHONE_NUMBER
Definition: libpst.h:554
pst_string business_phone
mapi element 0x3a08 PR_BUSINESS_TELEPHONE_NUMBER
Definition: libpst.h:437
void pst_free_recurrence(pst_recurrence *r)
Free a recurrence structure.
pst_string isdn_phone
mapi element 0x3a2d PR_ISDN_NUMBER
Definition: libpst.h:508
const char * charset
default character set for items without one
Definition: libpst.h:896
char * pst_rfc2425_datetime_format(const FILETIME *ft, int buflen, char *result)
Convert a FILETIME into rfc2425 date/time format 1953-10-15T23:10:00Z which is the same as one of the...
pst_string office_loc
mapi element 0x3a19 PR_OFFICE_LOCATION
Definition: libpst.h:532
pst_string recip_address
mapi element 0x0076 PR_RECEIVED_BY_EMAIL_ADDRESS
Definition: libpst.h:249
int pst_load_extended_attributes(pst_file *pf)
Load the extended attribute mapping table from the pst file.
pst_index_ll * id
Definition: libpst.h:114
uint32_t parm2
Definition: libpst.h:678
pst_string primary_phone
mapi element 0x3a1a PR_PRIMARY_TELEPHONE_NUMBER
Definition: libpst.h:562
pst_string gov_id
mapi element 0x3a07 PR_GOVERNMENT_ID_NUMBER
Definition: libpst.h:482
struct pst_id2_tree * next
Definition: libpst.h:116
int32_t ndr_diag_code
mapi element 0x0c05 PR_NDR_DIAG_CODE
Definition: libpst.h:317
pst_string other_address
mapi element 0x801c
Definition: libpst.h:538
pst_item_email * email
email mapi elements
Definition: libpst.h:780
char * pst_rfc2445_datetime_format(const FILETIME *ft, int buflen, char *result)
Convert a FILETIME into rfc2445 date/time format 19531015T231000Z.
int response_requested
mapi element 0x0063 PR_RESPONSE_REQUESTED
Definition: libpst.h:845
pst_string personal_homepage
mapi element 0x3a50 PR_PERSONAL_HOME_PAGE
Definition: libpst.h:556
pst_string mileage
mapi element 0x8534
Definition: libpst.h:526
pst_entryid * sentmail_folder
mapi element 0x0e0a PR_SENTMAIL_ENTRYID
Definition: libpst.h:307
pst_string work_address_postalcode
mapi element 0x8048
Definition: libpst.h:592
int32_t sensitivity
mapi element 0x0036 PR_SENSITIVITY
Definition: libpst.h:303
pst_string fullname
mapi element 0x8005
Definition: libpst.h:475
pst_desc_tree * pst_getTopOfFolders(pst_file *pf, const pst_item *root)
Get the top of folders descriptor tree.
pst_item_attach * attach
linked list of attachments
Definition: libpst.h:786
pst_string address1
mapi element 0x3003 PR_EMAIL_ADDRESS, or 0x8083
Definition: libpst.h:395
pst_string pref_name
mapi element 0x3a47 PR_PREFERRED_BY_NAME
Definition: libpst.h:558
pst_string recip2_access
mapi element 0x0077 PR_RCVD_REPRESENTING_ADDRTYPE
Definition: libpst.h:251
FILETIME * start
mapi element 0x820d PR_OUTLOOK_EVENT_START_DATE
Definition: libpst.h:709
void pst_convert_utf8_null(pst_item *item, pst_string *str)
Convert str to utf8 if possible; null strings are preserved.
pst_string original_to
mapi element 0x0074 PR_ORIGINAL_DISPLAY_TO
Definition: libpst.h:221
struct pst_item_appointment pst_item_appointment
This contains the appointment related mapi elements.
uint64_t id2
Definition: libpst.h:113
FILE * fp
file pointer to opened PST file
Definition: libpst.h:890
pst_string work_address_country
mapi element 0x8049
Definition: libpst.h:594
pst_string business_street
mapi element 0x3a29 PR_BUSINESS_ADDRESS_STREET
Definition: libpst.h:447
struct pst_item_attach * next
Definition: libpst.h:632
int32_t position
mapi element 0x370b PR_RENDERING_POSITION
Definition: libpst.h:629
uint32_t count
number of occurrences, even if recurrence terminates based on date
Definition: libpst.h:699
pst_string spouse_name
mapi element 0x3a48 PR_SPOUSE_NAME
Definition: libpst.h:572
uint64_t size
Definition: libpst.h:107
pst_string business_postal_code
mapi element 0x3a2a PR_BUSINESS_POSTAL_CODE
Definition: libpst.h:443
int do_read64
Definition: libpst.h:911
pst_binary pst_attach_to_mem(pst_file *pf, pst_item_attach *attach)
Assemble the binary attachment into a single buffer.
pst_string other_state
mapi element 0x3a62 PR_OTHER_ADDRESS_STATE_OR_PROVINCE
Definition: libpst.h:550
pst_string rtf_body_tag
mapi element 0x1008 PR_RTF_SYNC_BODY_TAG, the first couple of lines of RTF body so that after modific...
Definition: libpst.h:271
void pst_rfc2231(pst_string *str)
Convert str to rfc2231 encoding of str.
pst_string middle_name
mapi element 0x3a44 PR_MIDDLE_NAME
Definition: libpst.h:524
struct pst_desc_tree * prev
Definition: libpst.h:126
pst_item_folder * folder
folder mapi elements
Definition: libpst.h:782
int32_t rtf_body_crc
mapi element 0x1006 PR_RTF_SYNC_BODY_CRC
Definition: libpst.h:267
pst_string address3_desc
mapi element 0x80a4
Definition: libpst.h:415
pst_string outlook_sender2
mapi element 0x0c1d PR_SENDER_SEARCH_KEY
Definition: libpst.h:233
pst_string original_bcc
mapi element 0x0072 PR_ORIGINAL_DISPLAY_BCC
Definition: libpst.h:217
pst_string other_city
mapi element 0x3a5f PR_OTHER_ADDRESS_CITY
Definition: libpst.h:540
char * str
Definition: libpst.h:142
pst_desc_tree * pst_getNextDptr(pst_desc_tree *d)
Walk the descriptor tree.
pst_id2_tree * id2_head
id2 tree needed to resolve attachments by reference
Definition: libpst.h:618
FILETIME * start
mapi element 0x8706
Definition: libpst.h:648
struct pst_item_extra_field pst_item_extra_field
linked list of extra header fields
struct pst_recurrence pst_recurrence
This contains the recurrence data separated into fields.
int32_t item_count
mapi element 0x3602 PR_CONTENT_COUNT
Definition: libpst.h:339
pst_string address1a
mapi element 0x8085
Definition: libpst.h:397
pst_string address3a
mapi element 0x80a5
Definition: libpst.h:413
This contains the recurrence data separated into fields.
Definition: libpst.h:661
int all_day
mapi element 0x8215 PR_OUTLOOK_EVENT_ALL_DAY
Definition: libpst.h:748
pst_index_ll * i_table
the array of index structures
Definition: libpst.h:898
struct pst_file * pf
pointer to the pst_file
Definition: libpst.h:776
pst_string home_phone2
mapi element 0x3a2f PR_HOME2_TELEPHONE_NUMBER
Definition: libpst.h:496
pst_string location
mapi element 0x8208 PR_OUTLOOK_EVENT_LOCATION
Definition: libpst.h:713
pst_string account_name
mapi element 0x3a00 PR_ACCOUNT
Definition: libpst.h:393
pst_string content_id
mapi element 0x3712 PR_ATTACH_CONTENT_ID
Definition: libpst.h:610