#include "common.h"
Go to the source code of this file.
Data Structures | |
struct | pst_entryid |
struct | pst_index_ll |
struct | pst_id2_tree |
struct | pst_desc_tree |
struct | pst_string |
The string is either utf8 encoded, or it is in the code page specified by the containing mapi object. More... | |
struct | pst_binary |
a simple wrapper for binary blobs More... | |
struct | pst_item_email |
This contains the email related mapi elements. More... | |
struct | pst_item_folder |
This contains the folder related mapi elements. More... | |
struct | pst_item_message_store |
This contains the message store related mapi elements. More... | |
struct | pst_item_contact |
This contains the contact related mapi elements. More... | |
struct | pst_item_attach |
This contains the attachment related mapi elements. More... | |
struct | pst_item_extra_field |
linked list of extra header fields More... | |
struct | pst_item_journal |
This contains the journal related mapi elements. More... | |
struct | pst_recurrence |
This contains the recurrence data separated into fields. More... | |
struct | pst_item_appointment |
This contains the appointment related mapi elements. More... | |
struct | pst_item |
This contains the common mapi elements, and pointers to structures for each major mapi item type. More... | |
struct | pst_x_attrib_ll |
Linked list of extended attributes. More... | |
struct | pst_block_recorder |
this is only used for internal debugging More... | |
struct | pst_file |
Defines | |
#define | PST_TYPE_NOTE 1 |
#define | PST_TYPE_SCHEDULE 2 |
#define | PST_TYPE_APPOINTMENT 8 |
#define | PST_TYPE_CONTACT 9 |
#define | PST_TYPE_JOURNAL 10 |
#define | PST_TYPE_STICKYNOTE 11 |
#define | PST_TYPE_TASK 12 |
#define | PST_TYPE_OTHER 13 |
#define | PST_TYPE_REPORT 14 |
#define | PST_NO_ENCRYPT 0 |
#define | PST_COMP_ENCRYPT 1 |
#define | PST_ENCRYPT 2 |
#define | PST_MAP_ATTRIB (uint32_t)1 |
#define | PST_MAP_HEADER (uint32_t)2 |
#define | PST_ATTRIB_HEADER -1 |
#define | PST_FREEBUSY_FREE 0 |
#define | PST_FREEBUSY_TENTATIVE 1 |
#define | PST_FREEBUSY_BUSY 2 |
#define | PST_FREEBUSY_OUT_OF_OFFICE 3 |
#define | PST_APP_LABEL_NONE 0 |
#define | PST_APP_LABEL_IMPORTANT 1 |
#define | PST_APP_LABEL_BUSINESS 2 |
#define | PST_APP_LABEL_PERSONAL 3 |
#define | PST_APP_LABEL_VACATION 4 |
#define | PST_APP_LABEL_MUST_ATTEND 5 |
#define | PST_APP_LABEL_TRAVEL_REQ 6 |
#define | PST_APP_LABEL_NEEDS_PREP 7 |
#define | PST_APP_LABEL_BIRTHDAY 8 |
#define | PST_APP_LABEL_ANNIVERSARY 9 |
#define | PST_APP_LABEL_PHONE_CALL 10 |
#define | PST_APP_RECUR_NONE 0 |
#define | PST_APP_RECUR_DAILY 1 |
#define | PST_APP_RECUR_WEEKLY 2 |
#define | PST_APP_RECUR_MONTHLY 3 |
#define | PST_APP_RECUR_YEARLY 4 |
#define | PST_ATTACH_NONE 0 |
#define | PST_ATTACH_BY_VALUE 1 |
#define | PST_ATTACH_BY_REF 2 |
#define | PST_ATTACH_BY_REF_RESOLV 3 |
#define | PST_ATTACH_BY_REF_ONLY 4 |
#define | PST_ATTACH_EMBEDDED 5 |
#define | PST_ATTACH_OLE 6 |
#define | PST_FLAG_READ 0x01 |
#define | PST_FLAG_UNMODIFIED 0x02 |
#define | PST_FLAG_SUBMIT 0x04 |
#define | PST_FLAG_UNSENT 0x08 |
#define | PST_FLAG_HAS_ATTACHMENT 0x10 |
#define | PST_FLAG_FROM_ME 0x20 |
#define | PST_FLAG_ASSOCIATED 0x40 |
#define | PST_FLAG_RESEND 0x80 |
#define | PST_FLAG_RN_PENDING 0x100 |
#define | PST_FLAG_NRN_PENDING 0x200 |
Functions | |
int | pst_open (pst_file *pf, const char *name, const char *charset) |
Open a pst file. | |
int | pst_reopen (pst_file *pf) |
Reopen the pst file after a fork. | |
int | pst_load_index (pst_file *pf) |
Load the index entries from the pst file. | |
int | pst_load_extended_attributes (pst_file *pf) |
Load the extended attribute mapping table from the pst file. | |
int | pst_close (pst_file *pf) |
Close a pst file. | |
pst_desc_tree * | pst_getTopOfFolders (pst_file *pf, const pst_item *root) |
Get the top of folders descriptor tree. | |
pst_binary | pst_attach_to_mem (pst_file *pf, pst_item_attach *attach) |
Assemble the binary attachment into a single buffer. | |
size_t | pst_attach_to_file (pst_file *pf, pst_item_attach *attach, FILE *fp) |
Write a binary attachment to a file. | |
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_desc_tree * | pst_getNextDptr (pst_desc_tree *d) |
Walk the descriptor tree. | |
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. | |
void | pst_freeItem (pst_item *item) |
Free the item returned by pst_parse_item(). | |
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. | |
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. | |
int | pst_stricmp (char *a, char *b) |
compare strings case-insensitive. | |
size_t | pst_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stream) |
fwrite with checking for null pointer. | |
char * | pst_rfc2426_escape (char *str, char **result, size_t *resultlen) |
Add any necessary escape characters for rfc2426 vcard format. | |
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 forms in the ISO3601 standard. | |
char * | pst_rfc2445_datetime_format (const FILETIME *ft, int buflen, char *result) |
Convert a FILETIME into rfc2445 date/time format 19531015T231000Z. | |
char * | pst_rfc2445_datetime_format_now (int buflen, char *result) |
Convert the current time rfc2445 date/time format 19531015T231000Z. | |
const char * | pst_default_charset (pst_item *item, int buflen, char *result) |
Get the default character set for this item. | |
void | pst_rfc2231 (pst_string *str) |
Convert str to rfc2231 encoding of str. | |
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. | |
void | pst_convert_utf8_null (pst_item *item, pst_string *str) |
Convert str to utf8 if possible; null strings are preserved. | |
void | pst_convert_utf8 (pst_item *item, pst_string *str) |
Convert str to utf8 if possible; null strings are converted into empty strings. | |
pst_recurrence * | pst_convert_recurrence (pst_item_appointment *appt) |
Decode raw recurrence data into a better structure. | |
void | pst_free_recurrence (pst_recurrence *r) |
Free a recurrence structure. |
#define PST_APP_LABEL_ANNIVERSARY 9 |
Definition at line 64 of file libpst.h.
Referenced by write_appointment().
#define PST_APP_LABEL_BIRTHDAY 8 |
Definition at line 63 of file libpst.h.
Referenced by write_appointment().
#define PST_APP_LABEL_BUSINESS 2 |
Definition at line 57 of file libpst.h.
Referenced by write_appointment().
#define PST_APP_LABEL_IMPORTANT 1 |
Definition at line 56 of file libpst.h.
Referenced by write_appointment().
#define PST_APP_LABEL_MUST_ATTEND 5 |
Definition at line 60 of file libpst.h.
Referenced by write_appointment().
#define PST_APP_LABEL_NEEDS_PREP 7 |
Definition at line 62 of file libpst.h.
Referenced by write_appointment().
#define PST_APP_LABEL_NONE 0 |
Definition at line 55 of file libpst.h.
Referenced by write_appointment().
#define PST_APP_LABEL_PERSONAL 3 |
Definition at line 58 of file libpst.h.
Referenced by write_appointment().
#define PST_APP_LABEL_PHONE_CALL 10 |
Definition at line 65 of file libpst.h.
Referenced by write_appointment().
#define PST_APP_LABEL_TRAVEL_REQ 6 |
Definition at line 61 of file libpst.h.
Referenced by write_appointment().
#define PST_APP_LABEL_VACATION 4 |
Definition at line 59 of file libpst.h.
Referenced by write_appointment().
#define PST_ATTACH_EMBEDDED 5 |
Definition at line 80 of file libpst.h.
Referenced by write_msg_email(), and write_normal_email().
#define PST_ATTRIB_HEADER -1 |
Definition at line 46 of file libpst.h.
Referenced by pst_parse_block(), and pst_process().
#define PST_COMP_ENCRYPT 1 |
Definition at line 38 of file libpst.h.
Referenced by pst_decrypt().
#define PST_ENCRYPT 2 |
Definition at line 39 of file libpst.h.
Referenced by pst_decrypt().
#define PST_FLAG_HAS_ATTACHMENT 0x10 |
Definition at line 88 of file libpst.h.
Referenced by pst_parse_item().
#define PST_FLAG_READ 0x01 |
Definition at line 84 of file libpst.h.
Referenced by write_normal_email().
#define PST_FREEBUSY_BUSY 2 |
Definition at line 51 of file libpst.h.
Referenced by write_appointment().
#define PST_FREEBUSY_FREE 0 |
Definition at line 49 of file libpst.h.
Referenced by write_appointment().
#define PST_FREEBUSY_OUT_OF_OFFICE 3 |
Definition at line 52 of file libpst.h.
Referenced by write_appointment().
#define PST_FREEBUSY_TENTATIVE 1 |
Definition at line 50 of file libpst.h.
Referenced by write_appointment().
#define PST_MAP_ATTRIB (uint32_t)1 |
Definition at line 42 of file libpst.h.
Referenced by pst_load_extended_attributes(), and pst_parse_block().
#define PST_MAP_HEADER (uint32_t)2 |
Definition at line 43 of file libpst.h.
Referenced by pst_load_extended_attributes(), and pst_parse_block().
#define PST_TYPE_APPOINTMENT 8 |
Definition at line 28 of file libpst.h.
Referenced by mk_recurse_dir(), process(), and pst_process().
#define PST_TYPE_CONTACT 9 |
Definition at line 29 of file libpst.h.
Referenced by mk_recurse_dir(), process(), and pst_process().
#define PST_TYPE_JOURNAL 10 |
Definition at line 30 of file libpst.h.
Referenced by mk_recurse_dir(), process(), and pst_process().
#define PST_TYPE_NOTE 1 |
Definition at line 26 of file libpst.h.
Referenced by mk_recurse_dir(), process(), and pst_process().
#define PST_TYPE_OTHER 13 |
Definition at line 33 of file libpst.h.
Referenced by mk_recurse_dir(), and pst_process().
#define PST_TYPE_REPORT 14 |
Definition at line 34 of file libpst.h.
Referenced by mk_recurse_dir(), process(), pst_process(), and write_normal_email().
#define PST_TYPE_SCHEDULE 2 |
Definition at line 27 of file libpst.h.
Referenced by process(), pst_process(), and write_normal_email().
#define PST_TYPE_STICKYNOTE 11 |
Definition at line 31 of file libpst.h.
Referenced by mk_recurse_dir(), and pst_process().
#define PST_TYPE_TASK 12 |
Definition at line 32 of file libpst.h.
Referenced by mk_recurse_dir(), and pst_process().
size_t pst_attach_to_file | ( | pst_file * | pf, | |
pst_item_attach * | attach, | |||
FILE * | fp | |||
) |
Write a binary attachment to a file.
pf | pointer to the pst_file structure setup by pst_open(). | |
attach | pointer to the attachment record | |
fp | pointer to an open FILE. |
Definition at line 580 of file libpst.c.
References pst_binary::data, pst_item_attach::data, DEBUG_ENT, DEBUG_RET, DEBUG_WARN, pst_item_attach::i_id, pst_ff_getID2data(), pst_fwrite(), pst_getID(), and pst_binary::size.
Referenced by write_msg_email(), and write_separate_attachment().
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.
pf | pointer to the pst_file structure setup by pst_open(). | |
attach | pointer to the attachment record | |
fp | pointer to an open FILE. |
Definition at line 604 of file libpst.c.
References pst_binary::data, pst_item_attach::data, DEBUG_ENT, DEBUG_RET, DEBUG_WARN, pst_item_attach::i_id, pst_base64_encode(), pst_ff_getID2data(), pst_fwrite(), pst_getID(), and pst_binary::size.
Referenced by write_inline_attachment().
pst_binary pst_attach_to_mem | ( | pst_file * | pf, | |
pst_item_attach * | attach | |||
) |
Assemble the binary attachment into a single buffer.
pf | pointer to the pst_file structure setup by pst_open(). | |
attach | pointer to the attachment record |
Definition at line 556 of file libpst.c.
References pst_item_attach::data, pst_binary::data, DEBUG_ENT, DEBUG_RET, DEBUG_WARN, pst_item_attach::i_id, pst_ff_getID2data(), pst_getID(), and pst_binary::size.
int pst_close | ( | pst_file * | pf | ) |
Close a pst file.
pf | pointer to the pst_file structure setup by pst_open(). |
Definition at line 394 of file libpst.c.
References pst_file::cwd, pst_file::d_head, DEBUG_ENT, DEBUG_RET, DEBUG_WARN, pst_file::fname, pst_file::fp, pst_file::i_table, pst_free_desc(), pst_free_xattrib(), and pst_file::x_head.
Referenced by main().
pst_recurrence* pst_convert_recurrence | ( | pst_item_appointment * | appt | ) |
Decode raw recurrence data into a better structure.
appt | pointer to appointment structure |
Definition at line 4497 of file libpst.c.
References pst_recurrence::bydaymask, pst_recurrence::count, pst_binary::data, pst_recurrence::dayofmonth, pst_recurrence::interval, pst_recurrence::monthofyear, pst_recurrence::parm1, pst_recurrence::parm2, pst_recurrence::parm4, pst_recurrence::parm5, pst_recurrence::position, PST_LE_GET_UINT32, PST_LE_GET_UINT8, pst_malloc(), pst_item_appointment::recurrence_data, pst_recurrence::signature, pst_binary::size, pst_recurrence::sub_type, pst_recurrence::termination, and pst_recurrence::type.
Referenced by write_appointment().
void pst_convert_utf8 | ( | pst_item * | item, | |
pst_string * | str | |||
) |
Convert str to utf8 if possible; null strings are converted into empty strings.
item | pointer to the containing mapi item | |
str | pointer to the mapi string of interest |
Definition at line 4457 of file libpst.c.
References pst_varbuf::b, DEBUG_ENT, DEBUG_RET, DEBUG_WARN, pst_string::is_utf8, pst_default_charset(), pst_vb_8bit2utf8(), pst_vballoc(), and pst_string::str.
Referenced by create_enter_dir(), process(), pst_convert_utf8_null(), pst_rfc2047(), and write_normal_email().
void pst_convert_utf8_null | ( | pst_item * | item, | |
pst_string * | str | |||
) |
Convert str to utf8 if possible; null strings are preserved.
item | pointer to the containing mapi item | |
str | pointer to the mapi string of interest |
Definition at line 4446 of file libpst.c.
References pst_convert_utf8(), and pst_string::str.
Referenced by process(), write_appointment(), write_journal(), write_normal_email(), and write_vcard().
const char* pst_default_charset | ( | pst_item * | item, | |
int | buflen, | |||
char * | result | |||
) |
Get the default character set for this item.
This is used to find the charset for pst_string elements that are not already in utf8 encoding.
item | pointer to the mapi item of interest | |
[in] | buflen | length of the output buffer |
[out] | result | pointer to output buffer, must be at least 30 bytes |
Definition at line 4362 of file libpst.c.
References pst_item::body_charset, pst_file::charset, codepage(), pst_item::internet_cpid, pst_item::message_codepage, pst_item::pf, and pst_string::str.
Referenced by pst_convert_utf8(), write_msg_email(), and write_normal_email().
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.
pf | pointer to the pst_file structure setup by pst_open(). | |
i_id | ID of block to retrieve | |
buf | reference to pointer to buffer that will contain the data block. If this pointer is non-NULL, it will first be free()d. |
Get an ID block from the file using pst_ff_getIDblock() and decrypt if necessary.
pf | PST file structure | |
i_id | ID of block to retrieve | |
buf | reference to pointer to buffer that will contain the data block. If this pointer is non-NULL, it will first be free()d. |
Definition at line 3896 of file libpst.c.
References DEBUG_ENT, DEBUG_HEXDUMPC, DEBUG_INFO, DEBUG_RET, pst_file::encryption, pst_decrypt(), and pst_ff_getIDblock().
Referenced by dumper(), main(), pst_ff_compile_ID(), pst_ff_getID2data(), and pst_parse_block().
void pst_free_recurrence | ( | pst_recurrence * | r | ) |
Free a recurrence structure.
r | input pointer to be freed |
Definition at line 4572 of file libpst.c.
Referenced by write_appointment().
void pst_freeItem | ( | pst_item * | item | ) |
Free the item returned by pst_parse_item().
item | pointer to item returned from pst_parse_item(). |
Definition at line 3323 of file libpst.c.
References pst_item_contact::account_name, pst_item_contact::address1, pst_item_contact::address1_desc, pst_item_contact::address1_transport, pst_item_contact::address1a, pst_item_contact::address2, pst_item_contact::address2_desc, pst_item_contact::address2_transport, pst_item_contact::address2a, pst_item_contact::address3, pst_item_contact::address3_desc, pst_item_contact::address3_transport, pst_item_contact::address3a, pst_item_appointment::alarm_filename, pst_item::appointment, pst_item_email::arrival_date, pst_item::ascii_type, pst_item_contact::assistant_name, pst_item_contact::assistant_phone, pst_item::attach, pst_item_email::bcc_address, pst_item_contact::billing_information, pst_item_contact::birthday, pst_item::body, pst_item::body_charset, pst_item_contact::business_address, pst_item_contact::business_city, pst_item_contact::business_country, pst_item_contact::business_fax, pst_item_contact::business_homepage, pst_item_contact::business_phone, pst_item_contact::business_phone2, pst_item_contact::business_po_box, pst_item_contact::business_postal_code, pst_item_contact::business_state, pst_item_contact::business_street, pst_item_contact::callback_phone, pst_item_contact::car_phone, pst_item_email::cc_address, pst_item::comment, pst_item_contact::common_name, pst_item_message_store::common_view_folder, pst_item_contact::company_main_phone, pst_item_contact::company_name, pst_item_contact::computer_name, pst_item::contact, pst_item_email::conversation_index, pst_item::create_date, pst_item_contact::customer_id, DEBUG_ENT, DEBUG_RET, pst_item_contact::def_postal_address, pst_item_message_store::default_outbox_folder, pst_item_message_store::deleted_items_folder, pst_item_contact::department, pst_item_contact::display_name_prefix, pst_item::email, pst_item_email::encrypted_body, pst_item_email::encrypted_htmlbody, pst_item_appointment::end, pst_item_journal::end, pst_item::extra_fields, pst_item_extra_field::field_name, pst_item::file_as, pst_item_contact::first_name, pst_item::folder, pst_item_contact::followup, pst_item_contact::free_busy_address, pst_item_contact::ftp_site, pst_item_contact::fullname, pst_item_contact::gov_id, pst_item_email::header, pst_item_contact::hobbies, pst_item_contact::home_address, pst_item_contact::home_city, pst_item_contact::home_country, pst_item_contact::home_fax, pst_item_contact::home_phone, pst_item_contact::home_phone2, pst_item_contact::home_po_box, pst_item_contact::home_postal_code, pst_item_contact::home_state, pst_item_contact::home_street, pst_item_email::htmlbody, pst_item_email::in_reply_to, pst_item_contact::initials, pst_item_contact::isdn_phone, pst_item_contact::job_title, pst_item::journal, pst_item_contact::keyword, pst_item_contact::language, pst_item_appointment::location, pst_item_contact::location, pst_item_contact::manager_name, pst_item::message_store, pst_item_email::messageid, pst_item_contact::middle_name, pst_item_contact::mileage, pst_item_contact::mobile_phone, pst_item::modify_date, pst_item_extra_field::next, pst_item_contact::nickname, pst_item_contact::office_loc, pst_item_contact::org_id, pst_item_email::original_bcc, pst_item_email::original_cc, pst_item_email::original_to, pst_item_contact::other_address, pst_item_contact::other_city, pst_item_contact::other_country, pst_item_contact::other_phone, pst_item_contact::other_po_box, pst_item_contact::other_postal_code, pst_item_contact::other_state, pst_item_contact::other_street, pst_item_email::outlook_normalized_subject, pst_item_email::outlook_received_name1, pst_item_email::outlook_recipient, pst_item_email::outlook_recipient2, pst_item_email::outlook_recipient_name, pst_item_email::outlook_search_key, pst_item_email::outlook_sender, pst_item_email::outlook_sender2, pst_item_email::outlook_sender_name, pst_item_email::outlook_sender_name2, pst_item::outlook_version, pst_item_contact::pager_phone, pst_item_contact::personal_homepage, pst_item::predecessor_change, pst_item_contact::pref_name, pst_item_contact::primary_fax, pst_item_contact::primary_phone, pst_item_email::processed_subject, pst_item_contact::profession, pst_free_attach(), pst_item_contact::radio_phone, pst_item_email::recip2_access, pst_item_email::recip2_address, pst_item_email::recip_access, pst_item_email::recip_address, pst_item::record_key, pst_item_appointment::recurrence_data, pst_item_appointment::recurrence_description, pst_item_appointment::recurrence_end, pst_item_appointment::recurrence_start, pst_item_appointment::reminder, pst_item_email::reply_to, pst_item_email::report_text, pst_item_email::report_time, pst_item_email::return_path_address, pst_item_email::rtf_body_tag, pst_item_email::rtf_compressed, SAFE_FREE, SAFE_FREE_BIN, SAFE_FREE_STR, pst_item_message_store::search_root_folder, pst_item_email::sender2_access, pst_item_email::sender2_address, pst_item_email::sender_access, pst_item_email::sender_address, pst_item_email::sent_date, pst_item_message_store::sent_items_folder, pst_item_email::sentmail_folder, pst_item_email::sentto_address, pst_item_contact::spouse_name, pst_item_appointment::start, pst_item_journal::start, pst_item::subject, pst_item_contact::suffix, pst_item_email::supplementary_info, pst_item_contact::surname, pst_item_contact::telex, pst_item_appointment::timezonestring, pst_item_message_store::top_of_folder, pst_item_message_store::top_of_personal_folder, pst_item_contact::transmittable_display_name, pst_item_contact::ttytdd_phone, pst_item_journal::type, pst_item_message_store::user_views_folder, pst_item_extra_field::value, pst_item_contact::wedding_anniversary, pst_item_contact::work_address_city, pst_item_contact::work_address_country, pst_item_contact::work_address_postalcode, pst_item_contact::work_address_postofficebox, pst_item_contact::work_address_state, and pst_item_contact::work_address_street.
Referenced by dumper(), main(), process(), pst_parse_item(), and write_embedded_message().
size_t pst_fwrite | ( | const void * | ptr, | |
size_t | size, | |||
size_t | nmemb, | |||
FILE * | stream | |||
) |
fwrite with checking for null pointer.
ptr | pointer to the buffer | |
size | size of each item | |
nmemb | number of items | |
stream | output file |
Definition at line 4172 of file libpst.c.
References DEBUG_ENT, DEBUG_RET, and DEBUG_WARN.
Referenced by main(), print_pdf(), pst_append_holder(), pst_attach_to_file(), pst_attach_to_file_base64(), pst_finish_cleanup_holder(), and write_email_body().
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.
pf | pointer to the pst_file structure setup by pst_open(). | |
i_id | key for the index linked list |
Definition at line 3618 of file libpst.c.
References DEBUG_ENT, DEBUG_INFO, DEBUG_RET, pst_file::i_count, pst_file::i_table, and pst_getID_compare().
Referenced by dumper(), pst_attach_to_file(), pst_attach_to_file_base64(), pst_attach_to_mem(), pst_build_desc_ptr(), pst_build_id2(), pst_ff_getIDblock(), write_embedded_message(), write_inline_attachment(), and write_separate_attachment().
pst_desc_tree* pst_getNextDptr | ( | pst_desc_tree * | d | ) |
Walk the descriptor tree.
d | pointer to the current item in the descriptor tree. |
Definition at line 654 of file libpst.c.
References pst_desc_tree::child, DEBUG_ENT, DEBUG_RET, pst_desc_tree::next, and pst_desc_tree::parent.
Referenced by dumper().
pst_desc_tree* pst_getTopOfFolders | ( | pst_file * | pf, | |
const pst_item * | root | |||
) |
Get the top of folders descriptor tree.
This is the main descriptor tree that needs to be walked to look at every item in the pst file.
pf | pointer to the pst_file structure setup by pst_open(). | |
root | root item, which can be obtained by pst_parse_item(pf, pf->d_head, NULL). |
Definition at line 524 of file libpst.c.
References pst_desc_tree::assoc_tree, pst_desc_tree::d_id, DEBUG_ENT, DEBUG_INFO, DEBUG_RET, pst_desc_tree::desc, pst_entryid::id, pst_item::message_store, pst_desc_tree::parent_d_id, pst_getDptr(), pst_malloc(), record_descriptor(), and pst_item_message_store::top_of_personal_folder.
Referenced by main().
int pst_load_extended_attributes | ( | pst_file * | pf | ) |
Load the extended attribute mapping table from the pst file.
This should normally be the second call after pst_open().
pf | pointer to the pst_file structure setup by pst_open(). |
Load the extended attribute mapping table from the pst file.
Definition at line 678 of file libpst.c.
References pst_desc_tree::assoc_tree, pst_mapi_object::count_elements, pst_x_attrib_ll::data, pst_mapi_element::data, DEBUG_ENT, DEBUG_HEXDUMPC, DEBUG_INFO, DEBUG_RET, DEBUG_WARN, pst_desc_tree::desc, pst_mapi_object::elements, pst_x_attrib::extended, pst_index_ll::i_id, LE32_CPU, pst_x_attrib_ll::map, pst_x_attrib::map, pst_mapi_element::mapi_id, pst_x_attrib_ll::mytype, pst_x_attrib_ll::next, pst_build_id2(), pst_free_id2(), pst_free_list(), pst_getDptr(), PST_LE_GET_UINT16, PST_LE_GET_UINT32, pst_malloc(), PST_MAP_ATTRIB, PST_MAP_HEADER, pst_parse_block(), pst_printID2ptr(), pst_wide_to_single(), pst_mapi_element::size, pst_x_attrib::type, pst_mapi_element::type, and pst_file::x_head.
Referenced by main().
int pst_load_index | ( | pst_file * | pf | ) |
Load the index entries from the pst file.
This loads both the i_id linked list, and the d_id tree, and should normally be the first call after pst_open().
pf | pointer to the pst_file structure setup by pst_open(). |
Definition at line 632 of file libpst.c.
References pst_file::d_head, DEBUG_ENT, DEBUG_INFO, DEBUG_RET, DEBUG_WARN, pst_file::index1, pst_file::index1_back, pst_file::index2, pst_file::index2_back, pst_build_desc_ptr(), pst_build_id_ptr(), and pst_printDptr().
Referenced by main().
int pst_open | ( | pst_file * | pf, | |
const char * | name, | |||
const char * | charset | |||
) |
Open a pst file.
pf | pointer to uninitialized pst_file structure. This structure will be filled in by this function. | |
name | name of the file, suitable for fopen(). | |
charset | default charset for item with unspecified character sets |
Definition at line 302 of file libpst.c.
References pst_file::charset, pst_file::cwd, DEBUG_ENT, DEBUG_INFO, DEBUG_RET, DEBUG_WARN, pst_file::do_read64, ENC_TYPE, pst_file::encryption, FILE_SIZE_POINTER, pst_file::fname, pst_file::fp, pst_file::ind_type, pst_file::index1, pst_file::index1_back, pst_file::index2, pst_file::index2_back, INDEX_BACK, INDEX_POINTER, INDEX_TYPE32, INDEX_TYPE32A, INDEX_TYPE64, INDEX_TYPE64A, INDEX_TYPE_OFFSET, LE32_CPU, pst_getAtPos(), pst_getcwd(), pst_getIntAtPos(), PST_SIGNATURE, pst_unicode_init(), SECOND_BACK, SECOND_POINTER, pst_file::size, and WARN.
Referenced by main().
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.
pf | pointer to the pst_file structure setup by pst_open(). | |
d_ptr | pointer to an item in the descriptor tree. | |
m_head | normally NULL. This is only used when processing embedded attached rfc822 messages, in which case it is attach->id2_head. |
Definition at line 1191 of file libpst.c.
References pst_desc_tree::assoc_tree, pst_item::attach, pst_id2_tree::child, pst_mapi_object::count_objects, DEBUG_ENT, DEBUG_INFO, DEBUG_RET, DEBUG_WARN, deep_copy(), pst_desc_tree::desc, pst_item::flags, pst_item_attach::i_id, pst_index_ll::i_id, pst_id2_tree::id, pst_item_attach::id2_head, pst_item_attach::id2_val, pst_item_attach::next, pst_item::pf, pst_build_id2(), PST_FLAG_HAS_ATTACHMENT, pst_free_id2(), pst_free_list(), pst_freeItem(), pst_getID2(), pst_malloc(), pst_parse_block(), pst_printID2ptr(), and pst_process().
Referenced by dumper(), main(), process(), and write_embedded_message().
int pst_reopen | ( | pst_file * | pf | ) |
Reopen the pst file after a fork.
pf | pointer to the pst_file structure setup by pst_open(). |
Definition at line 379 of file libpst.c.
References pst_file::cwd, pst_file::fname, pst_file::fp, and pst_getcwd().
Referenced by try_fork().
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.
item | pointer to the containing mapi item | |
str | pointer to the mapi string of interest | |
needs_quote | true if strings containing spaces should be wrapped in quotes |
Definition at line 4413 of file libpst.c.
References pst_base64_encode_single(), pst_convert_utf8(), pst_malloc(), and pst_string::str.
Referenced by write_normal_email().
void pst_rfc2231 | ( | pst_string * | str | ) |
Convert str to rfc2231 encoding of str.
str | pointer to the mapi string of interest |
Definition at line 4375 of file libpst.c.
References pst_malloc(), and pst_string::str.
Referenced by write_inline_attachment().
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 forms in the ISO3601 standard.
[in] | ft | time to be converted |
[in] | buflen | length of the output buffer |
[out] | result | pointer to output buffer, must be at least 30 bytes |
Definition at line 4268 of file libpst.c.
References DEBUG_ENT, DEBUG_INFO, DEBUG_RET, and pst_fileTimeToStructTM().
Referenced by write_vcard().
char* pst_rfc2426_escape | ( | char * | str, | |
char ** | result, | |||
size_t * | resultlen | |||
) |
Add any necessary escape characters for rfc2426 vcard format.
[in] | str | pointer to input string |
[in,out] | result | pointer to a char* pointer that may be realloc'ed if needed |
[in,out] | resultlen | size of the result buffer |
Definition at line 4204 of file libpst.c.
References DEBUG_ENT, DEBUG_RET, pst_chr_count(), and pst_realloc().
Referenced by process(), write_appointment(), write_extra_categories(), write_journal(), and write_vcard().
char* pst_rfc2445_datetime_format | ( | const FILETIME * | ft, | |
int | buflen, | |||
char * | result | |||
) |
Convert a FILETIME into rfc2445 date/time format 19531015T231000Z.
[in] | ft | time to be converted |
[in] | buflen | length of the output buffer |
[out] | result | pointer to output buffer, must be at least 30 bytes |
Definition at line 4280 of file libpst.c.
References DEBUG_ENT, DEBUG_INFO, DEBUG_RET, and pst_fileTimeToStructTM().
Referenced by process(), write_appointment(), and write_journal().
char* pst_rfc2445_datetime_format_now | ( | int | buflen, | |
char * | result | |||
) |
Convert the current time rfc2445 date/time format 19531015T231000Z.
[in] | buflen | length of the output buffer |
[out] | result | pointer to output buffer, must be at least 30 bytes |
Definition at line 4292 of file libpst.c.
References DEBUG_ENT, DEBUG_INFO, and DEBUG_RET.
Referenced by write_appointment(), and write_journal().
int pst_stricmp | ( | char * | a, | |
char * | b | |||
) |
compare strings case-insensitive.
Definition at line 4142 of file libpst.c.
Referenced by acceptable_ext(), and pst_process().