10 #ifndef __PST_LIBPST_H 11 #define __PST_LIBPST_H 26 #if defined(__GNUC__) || defined (__SUNPRO_C) || defined(__SUNPRO_CC) 31 #define PST_TYPE_NOTE 1 32 #define PST_TYPE_SCHEDULE 2 33 #define PST_TYPE_APPOINTMENT 8 34 #define PST_TYPE_CONTACT 9 35 #define PST_TYPE_JOURNAL 10 36 #define PST_TYPE_STICKYNOTE 11 37 #define PST_TYPE_TASK 12 38 #define PST_TYPE_OTHER 13 39 #define PST_TYPE_REPORT 14 40 #define PST_TYPE_MAX 15 43 #define PST_NO_ENCRYPT 0 44 #define PST_COMP_ENCRYPT 1 48 #define PST_MAP_ATTRIB (uint32_t)1 49 #define PST_MAP_HEADER (uint32_t)2 52 #define PST_ATTRIB_HEADER -1 55 #define PST_FREEBUSY_FREE 0 56 #define PST_FREEBUSY_TENTATIVE 1 57 #define PST_FREEBUSY_BUSY 2 58 #define PST_FREEBUSY_OUT_OF_OFFICE 3 61 #define PST_APP_LABEL_NONE 0 62 #define PST_APP_LABEL_IMPORTANT 1 63 #define PST_APP_LABEL_BUSINESS 2 64 #define PST_APP_LABEL_PERSONAL 3 65 #define PST_APP_LABEL_VACATION 4 66 #define PST_APP_LABEL_MUST_ATTEND 5 67 #define PST_APP_LABEL_TRAVEL_REQ 6 68 #define PST_APP_LABEL_NEEDS_PREP 7 69 #define PST_APP_LABEL_BIRTHDAY 8 70 #define PST_APP_LABEL_ANNIVERSARY 9 71 #define PST_APP_LABEL_PHONE_CALL 10 74 #define PST_APP_RECUR_NONE 0 75 #define PST_APP_RECUR_DAILY 1 76 #define PST_APP_RECUR_WEEKLY 2 77 #define PST_APP_RECUR_MONTHLY 3 78 #define PST_APP_RECUR_YEARLY 4 81 #define PST_ATTACH_NONE 0 82 #define PST_ATTACH_BY_VALUE 1 83 #define PST_ATTACH_BY_REF 2 84 #define PST_ATTACH_BY_REF_RESOLV 3 85 #define PST_ATTACH_BY_REF_ONLY 4 86 #define PST_ATTACH_EMBEDDED 5 87 #define PST_ATTACH_OLE 6 90 #define PST_FLAG_READ 0x01 91 #define PST_FLAG_UNMODIFIED 0x02 92 #define PST_FLAG_SUBMIT 0x04 93 #define PST_FLAG_UNSENT 0x08 94 #define PST_FLAG_HAS_ATTACHMENT 0x10 95 #define PST_FLAG_FROM_ME 0x20 96 #define PST_FLAG_ASSOCIATED 0x40 97 #define PST_FLAG_RESEND 0x80 98 #define PST_FLAG_RN_PENDING 0x100 99 #define PST_FLAG_NRN_PENDING 0x200 1067 size_t pst_fwrite(
const void* ptr,
size_t size,
size_t nmemb, FILE* stream);
1165 #if defined(__GNUC__) || defined (__SUNPRO_C) || defined(__SUNPRO_CC) pst_string sender_address
mapi element 0x0065 PR_SENT_REPRESENTING_EMAIL_ADDRESS
int32_t valid_mask
mapi element 0x35df, bit mask of folders in this message store
pst_string original_cc
mapi element 0x0073 PR_ORIGINAL_DISPLAY_CC
pst_entryid * sent_items_folder
mapi element 0x35e4
pst_string timezonestring
mapi element 0x8234
uint32_t bydaymask
bit mask of days of the week
pst_string outlook_received_name1
mapi element 0x0040 PR_RECEIVED_BY_NAME
struct pst_id2_tree pst_id2_tree
int pst_load_index(pst_file *pf)
Load the index entries from the pst file.
struct pst_item_contact pst_item_contact
This contains the contact related mapi elements.
int32_t alarm_minutes
mapi element 0x8501 PR_OUTLOOK_COMMON_REMINDER_MINUTES_BEFORE
This contains the folder related mapi elements.
char * pst_rfc2426_escape(char *str, char **result, size_t *resultlen)
Add any necessary escape characters for rfc2426 vcard format.
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
pst_item_appointment * appointment
calendar mapi elements
FILETIME * modify_date
mapi element 0x3008 PR_LAST_MODIFICATION_TIME
pst_item_contact * contact
contact mapi elements
pst_string comment
mapi element 0x3004 PR_COMMENT
int pst_reopen(pst_file *pf)
Reopen the pst file after a fork.
int32_t importance
mapi element 0x0017 PR_IMPORTANCE
int32_t flags
mapi element 0x0e07 PR_MESSAGE_FLAGS
pst_string subject
mapi element 0x0037 PR_SUBJECT
int32_t recurrence_type
mapi element 0x8231
uint32_t position
occurrence of day for 2nd Tuesday of month, in which case position is 2
struct pst_item_email pst_item_email
This contains the email related mapi elements.
pst_string alarm_filename
mapi element 0x851f
pst_binary record_key
mapi element 0x0ff9 PR_RECORD_KEY
int subfolder
mapi element 0x360a PR_SUBFOLDERS
pst_string header
mapi element 0x007d PR_TRANSPORT_MESSAGE_HEADERS
struct pst_item_attach pst_item_attach
This contains the attachment related mapi elements.
struct pst_desc_tree * child_tail
int32_t original_sensitivity
mapi element 0x002e PR_ORIGINAL_SENSITIVITY
FILETIME * create_date
mapi element 0x3007 PR_CREATION_TIME
int32_t rtf_ws_trailing_count
mapi element 0x1011 PR_RTF_SYNC_TRAILING_COUNT, a count of the ignored characters after the last sign...
uint32_t parm1
must be contiguous, not an array to make Python interface easier
uint64_t index2_back
back pointer value in the first b-tree node in the descriptor tree
pst_binary conversation_index
mapi element 0x0071 PR_CONVERSATION_INDEX
int delete_after_submit
mapi element 0x0e01 PR_DELETE_AFTER_SUBMIT
pst_entryid * default_outbox_folder
mapi element 0x35e2
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
uint32_t termination
type of termination of the recurrence
uint64_t id2_val
only used if the attachment is by reference, in which case this is the id2 reference ...
int32_t internet_cpid
mapi element 0x3fde PR_INTERNET_CPID
struct pst_desc_tree * parent
int alarm
mapi element 0x8503 PR_OUTLOOK_COMMON_REMINDER_SET
struct pst_entryid pst_entryid
char * ascii_type
mapi element 0x001a PR_MESSAGE_CLASS or 0x3613 PR_CONTAINER_CLASS
int rtf_in_sync
mapi element 0x0e1f PR_RTF_IN_SYNC, True means that the rtf version is same as text body...
void pst_convert_utf8(pst_item *item, pst_string *str)
Convert str to utf8 if possible; null strings are converted into empty strings.
struct pst_x_attrib_ll * next
link to next item in the list
pst_item_journal * journal
journal mapi elements
struct pst_item_message_store pst_item_message_store
This contains the message store related mapi elements.
uint64_t block_id
block id that can be used to generate uid
uint32_t map
key for the mapping
int pst_open(pst_file *pf, const char *name, const char *charset)
Open a pst file.
unsigned char ind_type
index type or file type
pst_entryid * user_views_folder
mapi element 0x35e5
pst_binary encrypted_body
mapi element 0x6f04
struct pst_index_ll pst_index_ll
int32_t unseen_item_count
mapi element 0x3603 PR_CONTENT_UNREAD
pst_string recurrence_description
mapi element 0x8232 recurrence description
FILETIME * end
mapi element 0x8708
int conversion_prohibited
mapi element 0x3a03 PR_CONVERSION_PROHIBITED
pst_string outlook_sender
mapi element 0x003b PR_SENT_REPRESENTING_SEARCH_KEY
FILETIME * recurrence_start
mapi element 0x8235 PR_OUTLOOK_EVENT_RECURRENCE_START
struct pst_block_recorder pst_block_recorder
this is only used for internal debugging
pst_string sender2_access
mapi element 0x0c1e PR_SENDER_ADDRTYPE
struct pst_x_attrib_ll pst_x_attrib_ll
Linked list of extended attributes.
int32_t showas
mapi element 0x8205 PR_OUTLOOK_EVENT_SHOW_TIME_AS
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.
FILETIME * reminder
mapi element 0x8560
This contains the common mapi elements, and pointers to structures for each major mapi item type...
int32_t method
mapi element 0x3705 PR_ATTACH_METHOD
pst_entryid * top_of_personal_folder
mapi element 0x35e0
int private_member
mapi element 0x002b PR_RECIPIENT_REASSIGNMENT_PROHIBITED
This contains the attachment related mapi elements.
Linked list of extended attributes.
pst_string reply_to
mapi element 0x0050 PR_REPLY_RECIPIENT_NAMES
uint32_t sub_type
implies number of recurrence parameters
char * cwd
original cwd when the file was opened
pst_string outlook_recipient_name
mapi element 0x0044 PR_RCVD_REPRESENTING_NAME
pst_binary data
mapi element 0x3701 PR_ATTACH_DATA_OBJ
a simple wrapper for binary blobs
pst_string report_text
mapi element 0x1001 PR_REPORT_TEXT, delivery report dsn body
pst_entryid * common_view_folder
mapi element 0x35e6
pst_string body_charset
derived from extra_fields["content-type"] if it contains a charset= subfield
pst_entryid * deleted_items_folder
mapi element 0x35e3
int message_cc_me
mapi element 0x0058 PR_MESSAGE_CC_ME, this user is listed explicitly in the CC address ...
pst_string file_as
mapi element 0x3001 PR_DISPLAY_NAME
int pst_close(pst_file *pf)
Close a pst file.
pst_string messageid
mapi element 0x1035
int32_t rtf_body_char_count
mapi element 0x1007 PR_RTF_SYNC_BODY_COUNT, a count of the significant characters in the rtf body...
pst_string outlook_sender_name2
mapi element 0x0c1a PR_SENDER_NAME
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
uint32_t monthofyear
month of year for yearly recurrences
The string is either utf8 encoded, or it is in the code page specified by the containing mapi object...
int32_t ndr_reason_code
mapi element 0x0c04 PR_NDR_REASON_CODE
pst_string recip2_address
mapi element 0x0078 PR_RCVD_REPRESENTING_EMAIL_ADDRESS
int autoforward
mapi element 0x0002 PR_ALTERNATE_RECIPIENT_ALLOWED
struct pst_desc_tree * next
int32_t priority
mapi element 0x0026 PR_PRIORITY
pst_string recip_access
mapi element 0x0075 PR_RECEIVED_BY_ADDRTYPE
pst_string outlook_recipient2
mapi element 0x0052 PR_RCVD_REPRESENTING_SEARCH_KEY
struct pst_id2_tree * child
This contains the message store related mapi elements.
pst_string mimetype
mapi element 0x370e PR_ATTACH_MIME_TAG
int32_t label
mapi element 0x8214
pst_binary predecessor_change
mapi element 0x65e3 PR_PREDECESSOR_CHANGE_LIST
struct pst_desc_tree * child
pst_string cc_address
mapi element 0x0e03 PR_DISPLAY_CC
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...
uint32_t signature
0x30043004
pst_string sentto_address
mapi element 0x0e04 PR_DISPLAY_TO
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...
int32_t rtf_ws_prefix_count
mapi element 0x1010 PR_RTF_SYNC_PREFIX_COUNT, a count of the ignored characters before the first sign...
uint64_t index1
file offset of the first b-tree node in the index tree
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
int delivery_report
mapi element 0x0023 PR_ORIGINATOR_DELIVERY_REPORT_REQUESTED
pst_string filename1
mapi element 0x3704 PR_ATTACH_FILENAME
uint32_t dayofmonth
day of month for monthly and yearly recurrences
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...
pst_string body
mapi element 0x1000 PR_BODY
pst_item_message_store * message_store
message store mapi elements
int32_t message_size
mapi element 0x0e08 PR_MESSAGE_SIZE
FILETIME * end
mapi element 0x820e PR_OUTLOOK_EVENT_START_END
this is only used for internal debugging
uint32_t interval
recurrence interval in terms of the recurrence type
pst_entryid * top_of_folder
mapi element 0x7c07
pst_string type
mapi element 0x8700
pst_string supplementary_info
mapi element 0x0c1b PR_SUPPLEMENTARY_INFO
struct pst_item_journal pst_item_journal
This contains the journal related mapi elements.
FILETIME * arrival_date
mapi element 0x0e06 PR_MESSAGE_DELIVERY_TIME
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
pst_string outlook_recipient
mapi element 0x0051 PR_RECEIVED_BY_SEARCH_KEY
int32_t message_codepage
mapi element 0x3ffd PR_MESSAGE_CODEPAGE
struct pst_desc_tree pst_desc_tree
int read_receipt
mapi element 0x0029 PR_READ_RECEIPT_REQUESTED
void pst_freeItem(pst_item *item)
Free the item returned by pst_parse_item().
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
pst_string bcc_address
mapi element 0x0e02 PR_DISPLAY_BCC
void * data
data target of the mapping, either uint32_t or string
uint64_t index2
file offset of the first b-tree node in the descriptor tree
pst_string outlook_version
mapi element 0x8554 PR_OUTLOOK_VERSION
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
pst_index_ll * assoc_tree
int is_recurring
mapi element 0x8223 PR_OUTLOOK_EVENT_IS_RECURRING
pst_string htmlbody
mapi element 0x1013
char * fname
original file name when the file was opened
int type
derived from mapi elements 0x001a PR_MESSAGE_CLASS or 0x3613 PR_CONTAINER_CLASS
int32_t pwd_chksum
mapi element 0x76ff
int32_t sequence
mapi element 0x3710 PR_ATTACH_MIME_SEQUENCE
int message_to_me
mapi element 0x0057 PR_MESSAGE_TO_ME, this user is listed explicitly in the TO address ...
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.
pst_item_extra_field * extra_fields
linked list of extra headers and such
int reply_requested
mapi element 0x0c17 PR_REPLY_REQUESTED
struct pst_block_recorder * next
pst_entryid * search_root_folder
mapi element 0x35e7
pst_string in_reply_to
mapi element 0x1042
pst_string outlook_normalized_subject
mapi element 0x0e1d PR_NORMALIZED_SUBJECT
uint64_t index1_back
back pointer value in the first b-tree node in the index tree
pst_binary recurrence_data
mapi element 0x8216 recurrence data
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
uint64_t size
size of the pst file
pst_string sender2_address
mapi element 0x0c1f PR_SENDER_EMAIL_ADDRESS
pst_binary rtf_compressed
mapi element 0x1009 PR_RTF_COMPRESSED, the compressed rtf body data.
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 email related mapi elements.
int32_t ndr_status_code
mapi element 0x0c20 PR_NDR_STATUS_CODE
pst_string return_path_address
mapi element 0x1046, this seems to be the message-id of the rfc822 mail that is being returned ...
struct pst_item_folder pst_item_folder
This contains the folder related mapi elements.
pst_string filename2
mapi element 0x3707 PR_ATTACH_LONG_FILENAME
FILETIME * report_time
mapi element 0x0032 PR_REPORT_TIME, delivery report time
pst_string description
mapi element 0x8712
FILETIME * recurrence_end
mapi element 0x8236 PR_OUTLOOK_EVENT_RECURRENCE_END
This contains the journal related mapi elements.
int message_recip_me
mapi element 0x0059 PR_MESSAGE_RECIP_ME, this user appears in TO, CC or BCC address list ...
void pst_free_recurrence(pst_recurrence *r)
Free a recurrence structure.
const char * charset
default character set for items without one
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_desc_tree * d_head
the head and tail of the top level of the descriptor tree
pst_string recip_address
mapi element 0x0076 PR_RECEIVED_BY_EMAIL_ADDRESS
int pst_load_extended_attributes(pst_file *pf)
Load the extended attribute mapping table from the pst file.
struct pst_id2_tree * next
int32_t ndr_diag_code
mapi element 0x0c05 PR_NDR_DIAG_CODE
pst_item_email * email
email mapi elements
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
pst_entryid * sentmail_folder
mapi element 0x0e0a PR_SENTMAIL_ENTRYID
int32_t sensitivity
mapi element 0x0036 PR_SENSITIVITY
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
pst_string recip2_access
mapi element 0x0077 PR_RCVD_REPRESENTING_ADDRTYPE
FILETIME * start
mapi element 0x820d PR_OUTLOOK_EVENT_START_DATE
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
struct pst_item_appointment pst_item_appointment
This contains the appointment related mapi elements.
FILE * fp
file pointer to opened PST file
struct pst_item_attach * next
int32_t position
mapi element 0x370b PR_RENDERING_POSITION
uint32_t count
number of occurrences, even if recurrence terminates based on date
pst_binary pst_attach_to_mem(pst_file *pf, pst_item_attach *attach)
Assemble the binary attachment into a single buffer.
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...
void pst_rfc2231(pst_string *str)
Convert str to rfc2231 encoding of str.
struct pst_desc_tree * prev
pst_item_folder * folder
folder mapi elements
int32_t rtf_body_crc
mapi element 0x1006 PR_RTF_SYNC_BODY_CRC
pst_string outlook_sender2
mapi element 0x0c1d PR_SENDER_SEARCH_KEY
pst_string original_bcc
mapi element 0x0072 PR_ORIGINAL_DISPLAY_BCC
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
FILETIME * start
mapi element 0x8706
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
This contains the recurrence data separated into fields.
int all_day
mapi element 0x8215 PR_OUTLOOK_EVENT_ALL_DAY
pst_index_ll * i_table
the array of index structures
struct pst_file * pf
pointer to the pst_file
pst_string location
mapi element 0x8208 PR_OUTLOOK_EVENT_LOCATION
pst_string content_id
mapi element 0x3712 PR_ATTACH_CONTENT_ID