Mercurial > libpst
comparison src/libpst.h @ 151:cda7c812ec01
track character set individually for each mapi element
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Sun, 08 Mar 2009 14:35:26 -0700 |
parents | 06aa84023b48 |
children | edebaf0e87d2 |
comparison
equal
deleted
inserted
replaced
150:06aa84023b48 | 151:cda7c812ec01 |
---|---|
164 struct pst_desc_tree *child; | 164 struct pst_desc_tree *child; |
165 struct pst_desc_tree *child_tail; | 165 struct pst_desc_tree *child_tail; |
166 } pst_desc_ll; | 166 } pst_desc_ll; |
167 | 167 |
168 | 168 |
169 typedef struct pst_item_email_subject { | 169 typedef struct pst_string { |
170 int off1; | 170 int is_utf8; // 1 = true, 0 = false |
171 int off2; | 171 char *str; // either utf8 or some sbcs |
172 char *subj; | 172 } pst_string; |
173 } pst_item_email_subject; | |
174 | 173 |
175 | 174 |
176 typedef struct pst_item_email { | 175 typedef struct pst_item_email { |
177 FILETIME *arrival_date; | 176 FILETIME *arrival_date; |
178 int autoforward; // 1 = true, 0 = not set, -1 = false | 177 int autoforward; // 1 = true, 0 = not set, -1 = false |
179 char *body; | 178 pst_string cc_address; |
180 int32_t body_was_unicode; // 1 = true, 0 = false | 179 pst_string bcc_address; |
181 char *cc_address; | |
182 char *bcc_address; | |
183 char *common_name; | |
184 int32_t conv_index; | 180 int32_t conv_index; |
185 int conversion_prohib; // 1 = true, 0 = false | 181 int conversion_prohibited; // 1 = true, 0 = false |
186 int delete_after_submit; // 1 = true, 0 = false | 182 int delete_after_submit; // 1 = true, 0 = false |
187 int delivery_report; // 1 = true, 0 = false | 183 int delivery_report; // 1 = true, 0 = false |
188 char *encrypted_body; | 184 char *encrypted_body; |
189 size_t encrypted_body_size; | 185 size_t encrypted_body_size; |
190 char *encrypted_htmlbody; | 186 char *encrypted_htmlbody; |
191 size_t encrypted_htmlbody_size; | 187 size_t encrypted_htmlbody_size; |
192 int32_t flag; | 188 int32_t flag; |
193 char *header; | 189 pst_string header; |
194 char *htmlbody; | 190 pst_string htmlbody; |
195 int32_t htmlbody_was_unicode; // 1 = true, 0 = false | |
196 int32_t importance; | 191 int32_t importance; |
197 char *in_reply_to; | 192 pst_string in_reply_to; |
198 int message_cc_me; // 1 = true, 0 = false | 193 int message_cc_me; // 1 = true, 0 = false |
199 int message_recip_me; // 1 = true, 0 = false | 194 int message_recip_me; // 1 = true, 0 = false |
200 int message_to_me; // 1 = true, 0 = false | 195 int message_to_me; // 1 = true, 0 = false |
201 char *messageid; | 196 pst_string messageid; |
202 int32_t orig_sensitivity; | 197 int32_t orig_sensitivity; |
203 char *original_bcc; | 198 pst_string original_bcc; |
204 char *original_cc; | 199 pst_string original_cc; |
205 char *original_to; | 200 pst_string original_to; |
206 char *outlook_recipient; | 201 pst_string outlook_recipient; |
207 char *outlook_recipient_name; | 202 pst_string outlook_recipient_name; |
208 char *outlook_recipient2; | 203 pst_string outlook_recipient2; |
209 char *outlook_sender; | 204 pst_string outlook_sender; |
210 char *outlook_sender_name; | 205 pst_string outlook_sender_name; |
211 char *outlook_sender2; | 206 pst_string outlook_sender2; |
212 int32_t priority; | 207 int32_t priority; |
213 char *proc_subject; | 208 pst_string processed_subject; |
214 int read_receipt; // 1 = true, 0 = false | 209 int read_receipt; // 1 = true, 0 = false |
215 char *recip_access; | 210 pst_string recip_access; |
216 char *recip_address; | 211 pst_string recip_address; |
217 char *recip2_access; | 212 pst_string recip2_access; |
218 char *recip2_address; | 213 pst_string recip2_address; |
219 int reply_requested; // 1 = true, 0 = false | 214 int reply_requested; // 1 = true, 0 = false |
220 char *reply_to; | 215 pst_string reply_to; |
221 char *return_path_address; | 216 pst_string return_path_address; |
222 int32_t rtf_body_char_count; | 217 int32_t rtf_body_char_count; |
223 int32_t rtf_body_crc; | 218 int32_t rtf_body_crc; |
224 char *rtf_body_tag; | 219 pst_string rtf_body_tag; |
225 char *rtf_compressed; | 220 char *rtf_compressed; |
226 uint32_t rtf_compressed_size; | 221 uint32_t rtf_compressed_size; |
227 int rtf_in_sync; // 1 = true, 0 = doesn't exist, -1 = false | 222 int rtf_in_sync; // 1 = true, 0 = doesn't exist, -1 = false |
228 int32_t rtf_ws_prefix_count; | 223 int32_t rtf_ws_prefix_count; |
229 int32_t rtf_ws_trailing_count; | 224 int32_t rtf_ws_trailing_count; |
230 char *sender_access; | 225 pst_string sender_access; |
231 char *sender_address; | 226 pst_string sender_address; |
232 char *sender2_access; | 227 pst_string sender2_access; |
233 char *sender2_address; | 228 pst_string sender2_address; |
234 int32_t sensitivity; | 229 int32_t sensitivity; |
235 FILETIME *sent_date; | 230 FILETIME *sent_date; |
236 pst_entryid *sentmail_folder; | 231 pst_entryid *sentmail_folder; |
237 char *sentto_address; | 232 pst_string sentto_address; |
238 pst_item_email_subject *subject; | |
239 // delivery report fields | 233 // delivery report fields |
240 char *report_text; | 234 pst_string report_text; |
241 int32_t report_was_unicode; | |
242 FILETIME *report_time; | 235 FILETIME *report_time; |
243 int32_t ndr_reason_code; | 236 int32_t ndr_reason_code; |
244 int32_t ndr_diag_code; | 237 int32_t ndr_diag_code; |
245 char *supplementary_info; | 238 pst_string supplementary_info; |
246 int32_t ndr_status_code; | 239 int32_t ndr_status_code; |
247 } pst_item_email; | 240 } pst_item_email; |
248 | 241 |
249 | 242 |
250 typedef struct pst_item_folder { | 243 typedef struct pst_item_folder { |
268 int32_t pwd_chksum; // 0x76ff | 261 int32_t pwd_chksum; // 0x76ff |
269 } pst_item_message_store; | 262 } pst_item_message_store; |
270 | 263 |
271 | 264 |
272 typedef struct pst_item_contact { | 265 typedef struct pst_item_contact { |
273 char *access_method; | 266 pst_string access_method; |
274 char *account_name; | 267 pst_string account_name; |
275 char *address1; | 268 pst_string address1; |
276 char *address1a; | 269 pst_string address1a; |
277 char *address1_desc; | 270 pst_string address1_desc; |
278 char *address1_transport; | 271 pst_string address1_transport; |
279 char *address2; | 272 pst_string address2; |
280 char *address2a; | 273 pst_string address2a; |
281 char *address2_desc; | 274 pst_string address2_desc; |
282 char *address2_transport; | 275 pst_string address2_transport; |
283 char *address3; | 276 pst_string address3; |
284 char *address3a; | 277 pst_string address3a; |
285 char *address3_desc; | 278 pst_string address3_desc; |
286 char *address3_transport; | 279 pst_string address3_transport; |
287 char *assistant_name; | 280 pst_string assistant_name; |
288 char *assistant_phone; | 281 pst_string assistant_phone; |
289 char *billing_information; | 282 pst_string billing_information; |
290 FILETIME *birthday; | 283 FILETIME *birthday; |
291 char *business_address; // 0x801b | 284 pst_string business_address; // 0x801b |
292 char *business_city; | 285 pst_string business_city; |
293 char *business_country; | 286 pst_string business_country; |
294 char *business_fax; | 287 pst_string business_fax; |
295 char *business_homepage; | 288 pst_string business_homepage; |
296 char *business_phone; | 289 pst_string business_phone; |
297 char *business_phone2; | 290 pst_string business_phone2; |
298 char *business_po_box; | 291 pst_string business_po_box; |
299 char *business_postal_code; | 292 pst_string business_postal_code; |
300 char *business_state; | 293 pst_string business_state; |
301 char *business_street; | 294 pst_string business_street; |
302 char *callback_phone; | 295 pst_string callback_phone; |
303 char *car_phone; | 296 pst_string car_phone; |
304 char *company_main_phone; | 297 pst_string company_main_phone; |
305 char *company_name; | 298 pst_string company_name; |
306 char *computer_name; | 299 pst_string computer_name; |
307 char *customer_id; | 300 pst_string customer_id; |
308 char *def_postal_address; | 301 pst_string def_postal_address; |
309 char *department; | 302 pst_string department; |
310 char *display_name_prefix; | 303 pst_string display_name_prefix; |
311 char *first_name; | 304 pst_string first_name; |
312 char *followup; | 305 pst_string followup; |
313 char *free_busy_address; | 306 pst_string free_busy_address; |
314 char *ftp_site; | 307 pst_string ftp_site; |
315 char *fullname; | 308 pst_string fullname; |
316 int16_t gender; | 309 int16_t gender; |
317 char *gov_id; | 310 pst_string gov_id; |
318 char *hobbies; | 311 pst_string hobbies; |
319 char *home_address; // 0x801a | 312 pst_string home_address; // 0x801a |
320 char *home_city; | 313 pst_string home_city; |
321 char *home_country; | 314 pst_string home_country; |
322 char *home_fax; | 315 pst_string home_fax; |
323 char *home_phone; | 316 pst_string home_phone; |
324 char *home_phone2; | 317 pst_string home_phone2; |
325 char *home_po_box; | 318 pst_string home_po_box; |
326 char *home_postal_code; | 319 pst_string home_postal_code; |
327 char *home_state; | 320 pst_string home_state; |
328 char *home_street; | 321 pst_string home_street; |
329 char *initials; | 322 pst_string initials; |
330 char *isdn_phone; | 323 pst_string isdn_phone; |
331 char *job_title; | 324 pst_string job_title; |
332 char *keyword; | 325 pst_string keyword; |
333 char *language; | 326 pst_string language; |
334 char *location; | 327 pst_string location; |
335 int mail_permission; // 1 = true, 0 = false | 328 int mail_permission; // 1 = true, 0 = false |
336 char *manager_name; | 329 pst_string manager_name; |
337 char *middle_name; | 330 pst_string middle_name; |
338 char *mileage; | 331 pst_string mileage; |
339 char *mobile_phone; | 332 pst_string mobile_phone; |
340 char *nickname; | 333 pst_string nickname; |
341 char *office_loc; | 334 pst_string office_loc; |
342 char *org_id; | 335 pst_string common_name; |
343 char *other_address; // 0x801c | 336 pst_string org_id; |
344 char *other_city; | 337 pst_string other_address; // 0x801c |
345 char *other_country; | 338 pst_string other_city; |
346 char *other_phone; | 339 pst_string other_country; |
347 char *other_po_box; | 340 pst_string other_phone; |
348 char *other_postal_code; | 341 pst_string other_po_box; |
349 char *other_state; | 342 pst_string other_postal_code; |
350 char *other_street; | 343 pst_string other_state; |
351 char *pager_phone; | 344 pst_string other_street; |
352 char *personal_homepage; | 345 pst_string pager_phone; |
353 char *pref_name; | 346 pst_string personal_homepage; |
354 char *primary_fax; | 347 pst_string pref_name; |
355 char *primary_phone; | 348 pst_string primary_fax; |
356 char *profession; | 349 pst_string primary_phone; |
357 char *radio_phone; | 350 pst_string profession; |
358 int rich_text; // 1 = true, 0 = false | 351 pst_string radio_phone; |
359 char *spouse_name; | 352 int rich_text; // 1 = true, 0 = false |
360 char *suffix; | 353 pst_string spouse_name; |
361 char *surname; | 354 pst_string suffix; |
362 char *telex; | 355 pst_string surname; |
363 char *transmittable_display_name; | 356 pst_string telex; |
364 char *ttytdd_phone; | 357 pst_string transmittable_display_name; |
365 FILETIME *wedding_anniversary; | 358 pst_string ttytdd_phone; |
366 char *work_address_street; // 0x8045 | 359 FILETIME *wedding_anniversary; |
367 char *work_address_city; // 0x8046 | 360 pst_string work_address_street; // 0x8045 |
368 char *work_address_state; // 0x8047 | 361 pst_string work_address_city; // 0x8046 |
369 char *work_address_postalcode; // 0x8048 | 362 pst_string work_address_state; // 0x8047 |
370 char *work_address_country; // 0x8049 | 363 pst_string work_address_postalcode; // 0x8048 |
371 char *work_address_postofficebox; // 0x804a | 364 pst_string work_address_country; // 0x8049 |
365 pst_string work_address_postofficebox; // 0x804a | |
372 } pst_item_contact; | 366 } pst_item_contact; |
373 | 367 |
374 | 368 |
375 typedef struct pst_item_attach { | 369 typedef struct pst_item_attach { |
376 char *filename1; | 370 pst_string filename1; |
377 char *filename2; | 371 pst_string filename2; |
378 char *mimetype; | 372 pst_string mimetype; |
379 char *data; | 373 char *data; |
380 size_t size; | 374 size_t size; |
381 uint64_t id2_val; | 375 uint64_t id2_val; |
382 uint64_t id_val; // calculated from id2_val during creation of record | 376 uint64_t id_val; // calculated from id2_val during creation of record |
383 pst_id2_ll *id2_head; // deep copy from child | 377 pst_id2_ll *id2_head; // deep copy from child |
384 int32_t method; | 378 int32_t method; |
385 int32_t position; | 379 int32_t position; |
386 int32_t sequence; | 380 int32_t sequence; |
387 struct pst_item_attach *next; | 381 struct pst_item_attach *next; |
388 } pst_item_attach; | 382 } pst_item_attach; |
389 | 383 |
390 | 384 |
391 typedef struct pst_item_extra_field { | 385 typedef struct pst_item_extra_field { |
392 char *field_name; | 386 char *field_name; |
393 char *value; | 387 char *value; |
394 struct pst_item_extra_field *next; | 388 struct pst_item_extra_field *next; |
395 } pst_item_extra_field; | 389 } pst_item_extra_field; |
396 | 390 |
397 | 391 |
398 typedef struct pst_item_journal { | 392 typedef struct pst_item_journal { |
399 FILETIME *end; | 393 FILETIME *end; |
400 FILETIME *start; | 394 FILETIME *start; |
401 char *type; | 395 pst_string type; |
402 } pst_item_journal; | 396 } pst_item_journal; |
403 | 397 |
404 | 398 |
405 typedef struct pst_item_appointment { | 399 typedef struct pst_item_appointment { |
406 FILETIME *end; | 400 FILETIME *end; |
407 char *location; | 401 pst_string location; |
408 int alarm; // 1 = true, 0 = false | 402 int alarm; // 1 = true, 0 = false |
409 FILETIME *reminder; | 403 FILETIME *reminder; |
410 int32_t alarm_minutes; | 404 int32_t alarm_minutes; |
411 char *alarm_filename; | 405 pst_string alarm_filename; |
412 FILETIME *start; | 406 FILETIME *start; |
413 char *timezonestring; | 407 pst_string timezonestring; |
414 int32_t showas; | 408 int32_t showas; |
415 int32_t label; | 409 int32_t label; |
416 int all_day; // 1 = true, 0 = false | 410 int all_day; // 1 = true, 0 = false |
417 char *recurrence; | 411 pst_string recurrence; |
418 int32_t recurrence_type; | 412 int32_t recurrence_type; |
419 FILETIME *recurrence_start; | 413 FILETIME *recurrence_start; |
420 FILETIME *recurrence_end; | 414 FILETIME *recurrence_end; |
421 } pst_item_appointment; | 415 } pst_item_appointment; |
422 | 416 |
423 | 417 |
424 typedef struct pst_item { | 418 typedef struct pst_item { |
425 struct pst_item_email *email; // data referring to email | 419 struct pst_item_email *email; // data referring to email |
430 struct pst_item_extra_field *extra_fields; // linked list of extra headers and such | 424 struct pst_item_extra_field *extra_fields; // linked list of extra headers and such |
431 struct pst_item_journal *journal; // data referring to a journal entry | 425 struct pst_item_journal *journal; // data referring to a journal entry |
432 struct pst_item_appointment *appointment; // data referring to a calendar entry | 426 struct pst_item_appointment *appointment; // data referring to a calendar entry |
433 int type; | 427 int type; |
434 char *ascii_type; | 428 char *ascii_type; |
435 char *file_as; | 429 pst_string file_as; |
436 char *comment; | 430 pst_string comment; |
437 char *body_charset; // null if not specified | 431 pst_string body_charset; // null if not specified |
432 pst_string body; // email, journal | |
433 pst_string subject; // email, journal | |
438 int32_t internet_cpid; | 434 int32_t internet_cpid; |
439 int32_t message_codepage; | 435 int32_t message_codepage; |
440 int32_t message_size; | 436 int32_t message_size; |
441 char *outlook_version; | 437 pst_string outlook_version; |
442 char *record_key; // probably 16 bytes long. | 438 char *record_key; // probably 16 bytes long. |
443 size_t record_key_size; | 439 size_t record_key_size; |
444 int response_requested; // 1 = true, 0 = false | 440 int response_requested; // 1 = true, 0 = false |
445 FILETIME *create_date; | 441 FILETIME *create_date; |
446 FILETIME *modify_date; | 442 FILETIME *modify_date; |
447 int private_member; // 1 = true, 0 = false | 443 int private_member; // 1 = true, 0 = false |
587 | 583 |
588 void pst_printDptr(pst_file *pf, pst_desc_ll *ptr); | 584 void pst_printDptr(pst_file *pf, pst_desc_ll *ptr); |
589 void pst_printIDptr(pst_file* pf); | 585 void pst_printIDptr(pst_file* pf); |
590 void pst_printID2ptr(pst_id2_ll *ptr); | 586 void pst_printID2ptr(pst_id2_ll *ptr); |
591 | 587 |
588 const char* pst_codepage(int cp); | |
589 const char* pst_default_charset(pst_item *item); | |
590 void pst_convert_utf8_null(pst_item *item, pst_string *str); | |
591 void pst_convert_utf8(pst_item *item, pst_string *str); | |
592 | |
592 | 593 |
593 // switch from maximal packing back to default packing | 594 // switch from maximal packing back to default packing |
594 // undo the packing from the beginning of this file | 595 // undo the packing from the beginning of this file |
595 #ifdef _MSC_VER | 596 #ifdef _MSC_VER |
596 #pragma pack(pop) | 597 #pragma pack(pop) |