Mercurial > libpst
comparison src/libpst.c @ 390:5c0ce43c7532
Fix a number of spelling mistakes
Changes-by: codespell -w
Suggested-by: codespell, spellintian, lintian
I: libpst4: spelling-error-in-binary usr/lib/x86_64-linux-gnu/libpst.so.4.1.14 occured occurred
I: libpst-dev: spelling-error-in-manpage usr/share/man/man5/outlook.pst.5.gz Attachement Attachment
author | Paul Wise <pabs3@bonedaddy.net> |
---|---|
date | Sat, 21 Dec 2019 21:25:45 +0800 |
parents | 2379a4d8d9c7 |
children |
comparison
equal
deleted
inserted
replaced
389:3f83feface7a | 390:5c0ce43c7532 |
---|---|
733 pst_free_id2(id2_head); | 733 pst_free_id2(id2_head); |
734 DEBUG_RET(); | 734 DEBUG_RET(); |
735 return 0; | 735 return 0; |
736 } | 736 } |
737 | 737 |
738 DEBUG_INFO(("look thru d_id 0x61 list of mapi objects\n")); | 738 DEBUG_INFO(("look through d_id 0x61 list of mapi objects\n")); |
739 for (x=0; x < list->count_elements; x++) { | 739 for (x=0; x < list->count_elements; x++) { |
740 DEBUG_INFO(("#%d - mapi-id: %#x type: %#x length: %#x\n", x, list->elements[x]->mapi_id, list->elements[x]->type, list->elements[x]->size)); | 740 DEBUG_INFO(("#%d - mapi-id: %#x type: %#x length: %#x\n", x, list->elements[x]->mapi_id, list->elements[x]->type, list->elements[x]->size)); |
741 if (list->elements[x]->data) { | 741 if (list->elements[x]->data) { |
742 DEBUG_HEXDUMPC(list->elements[x]->data, list->elements[x]->size, 0x10); | 742 DEBUG_HEXDUMPC(list->elements[x]->data, list->elements[x]->size, 0x10); |
743 } | 743 } |
2516 break; | 2516 break; |
2517 case 0x1006: // PR_RTF_SYNC_BODY_CRC | 2517 case 0x1006: // PR_RTF_SYNC_BODY_CRC |
2518 LIST_COPY_EMAIL_INT32("RTF Sync Body CRC", item->email->rtf_body_crc); | 2518 LIST_COPY_EMAIL_INT32("RTF Sync Body CRC", item->email->rtf_body_crc); |
2519 break; | 2519 break; |
2520 case 0x1007: // PR_RTF_SYNC_BODY_COUNT | 2520 case 0x1007: // PR_RTF_SYNC_BODY_COUNT |
2521 // a count of the *significant* charcters in the rtf body. Doesn't count | 2521 // a count of the *significant* characters in the rtf body. Doesn't count |
2522 // whitespace and other ignorable characters | 2522 // whitespace and other ignorable characters |
2523 LIST_COPY_EMAIL_INT32("RTF Sync Body character count", item->email->rtf_body_char_count); | 2523 LIST_COPY_EMAIL_INT32("RTF Sync Body character count", item->email->rtf_body_char_count); |
2524 break; | 2524 break; |
2525 case 0x1008: // PR_RTF_SYNC_BODY_TAG | 2525 case 0x1008: // PR_RTF_SYNC_BODY_TAG |
2526 // the first couple of lines of RTF body so that after modification, then beginning can | 2526 // the first couple of lines of RTF body so that after modification, then beginning can |
3303 pst_index_ll *i_ptr = NULL; | 3303 pst_index_ll *i_ptr = NULL; |
3304 pst_id2_tree *i2_ptr = NULL; | 3304 pst_id2_tree *i2_ptr = NULL; |
3305 DEBUG_ENT("pst_build_id2"); | 3305 DEBUG_ENT("pst_build_id2"); |
3306 | 3306 |
3307 if (pst_read_block_size(pf, list->offset, list->size, list->inflated_size, &buf) < list->size) { | 3307 if (pst_read_block_size(pf, list->offset, list->size, list->inflated_size, &buf) < list->size) { |
3308 //an error occured in block read | 3308 //an error occurred in block read |
3309 DEBUG_WARN(("block read error occured. offset = %#"PRIx64", size = %#"PRIx64"\n", list->offset, list->size)); | 3309 DEBUG_WARN(("block read error occurred. offset = %#"PRIx64", size = %#"PRIx64"\n", list->offset, list->size)); |
3310 if (buf) free(buf); | 3310 if (buf) free(buf); |
3311 DEBUG_RET(); | 3311 DEBUG_RET(); |
3312 return NULL; | 3312 return NULL; |
3313 } | 3313 } |
3314 DEBUG_HEXDUMPC(buf, list->size, 16); | 3314 DEBUG_HEXDUMPC(buf, list->size, 16); |
3846 * @param buf pointer to the buffer to be decrypted in place | 3846 * @param buf pointer to the buffer to be decrypted in place |
3847 * @param size size of the buffer | 3847 * @param size size of the buffer |
3848 * @param type | 3848 * @param type |
3849 @li 0 PST_NO_ENCRYPT, none | 3849 @li 0 PST_NO_ENCRYPT, none |
3850 @li 1 PST_COMP_ENCRYPT, simple byte substitution cipher with fixed key | 3850 @li 1 PST_COMP_ENCRYPT, simple byte substitution cipher with fixed key |
3851 @li 2 PST_ENCRYPT, german enigma 3 rotor cipher with fixed key | 3851 @li 2 PST_ENCRYPT, German enigma 3 rotor cipher with fixed key |
3852 * @return 0 if ok, -1 if error (NULL buffer or unknown encryption type) | 3852 * @return 0 if ok, -1 if error (NULL buffer or unknown encryption type) |
3853 */ | 3853 */ |
3854 static int pst_decrypt(uint64_t i_id, char *buf, size_t size, unsigned char type) { | 3854 static int pst_decrypt(uint64_t i_id, char *buf, size_t size, unsigned char type) { |
3855 size_t x = 0; | 3855 size_t x = 0; |
3856 unsigned char y; | 3856 unsigned char y; |
4240 return 1; | 4240 return 1; |
4241 } | 4241 } |
4242 | 4242 |
4243 | 4243 |
4244 static int pst_strincmp(char *a, char *b, size_t x) { | 4244 static int pst_strincmp(char *a, char *b, size_t x) { |
4245 // compare upto x chars in string a and b case-insensitively | 4245 // compare up to x chars in string a and b case-insensitively |
4246 // returns -1 if a < b, 0 if a==b, 1 if a > b | 4246 // returns -1 if a < b, 0 if a==b, 1 if a > b |
4247 size_t y = 0; | 4247 size_t y = 0; |
4248 while (*a != '\0' && *b != '\0' && y < x && toupper(*a)==toupper(*b)) { | 4248 while (*a != '\0' && *b != '\0' && y < x && toupper(*a)==toupper(*b)) { |
4249 a++; b++; y++; | 4249 a++; b++; y++; |
4250 } | 4250 } |
4357 char* pst_rfc2425_datetime_format(const FILETIME* ft, int buflen, char* result) { | 4357 char* pst_rfc2425_datetime_format(const FILETIME* ft, int buflen, char* result) { |
4358 struct tm stm; | 4358 struct tm stm; |
4359 DEBUG_ENT("rfc2425_datetime_format"); | 4359 DEBUG_ENT("rfc2425_datetime_format"); |
4360 pst_fileTimeToStructTM(ft, &stm); | 4360 pst_fileTimeToStructTM(ft, &stm); |
4361 if (strftime(result, buflen, "%Y-%m-%dT%H:%M:%SZ", &stm)==0) { | 4361 if (strftime(result, buflen, "%Y-%m-%dT%H:%M:%SZ", &stm)==0) { |
4362 DEBUG_INFO(("Problem occured formatting date\n")); | 4362 DEBUG_INFO(("Problem occurred formatting date\n")); |
4363 } | 4363 } |
4364 DEBUG_RET(); | 4364 DEBUG_RET(); |
4365 return result; | 4365 return result; |
4366 } | 4366 } |
4367 | 4367 |
4369 char* pst_rfc2445_datetime_format(const FILETIME* ft, int buflen, char* result) { | 4369 char* pst_rfc2445_datetime_format(const FILETIME* ft, int buflen, char* result) { |
4370 struct tm stm; | 4370 struct tm stm; |
4371 DEBUG_ENT("rfc2445_datetime_format"); | 4371 DEBUG_ENT("rfc2445_datetime_format"); |
4372 pst_fileTimeToStructTM(ft, &stm); | 4372 pst_fileTimeToStructTM(ft, &stm); |
4373 if (strftime(result, buflen, "%Y%m%dT%H%M%SZ", &stm)==0) { | 4373 if (strftime(result, buflen, "%Y%m%dT%H%M%SZ", &stm)==0) { |
4374 DEBUG_INFO(("Problem occured formatting date\n")); | 4374 DEBUG_INFO(("Problem occurred formatting date\n")); |
4375 } | 4375 } |
4376 DEBUG_RET(); | 4376 DEBUG_RET(); |
4377 return result; | 4377 return result; |
4378 } | 4378 } |
4379 | 4379 |
4382 struct tm stm; | 4382 struct tm stm; |
4383 time_t t = time(NULL); | 4383 time_t t = time(NULL); |
4384 DEBUG_ENT("rfc2445_datetime_format_now"); | 4384 DEBUG_ENT("rfc2445_datetime_format_now"); |
4385 gmtime_r(&t, &stm); | 4385 gmtime_r(&t, &stm); |
4386 if (strftime(result, buflen, "%Y%m%dT%H%M%SZ", &stm)==0) { | 4386 if (strftime(result, buflen, "%Y%m%dT%H%M%SZ", &stm)==0) { |
4387 DEBUG_INFO(("Problem occured formatting date\n")); | 4387 DEBUG_INFO(("Problem occurred formatting date\n")); |
4388 } | 4388 } |
4389 DEBUG_RET(); | 4389 DEBUG_RET(); |
4390 return result; | 4390 return result; |
4391 } | 4391 } |
4392 | 4392 |
4444 * the charset for pst_string elements that are not already in utf8 encoding. | 4444 * the charset for pst_string elements that are not already in utf8 encoding. |
4445 * | 4445 * |
4446 * @param item pointer to the mapi item of interest | 4446 * @param item pointer to the mapi item of interest |
4447 * @param[in] buflen length of the output buffer | 4447 * @param[in] buflen length of the output buffer |
4448 * @param[out] result pointer to output buffer, must be at least 30 bytes | 4448 * @param[out] result pointer to output buffer, must be at least 30 bytes |
4449 * @return default character set as a string useable by iconv() | 4449 * @return default character set as a string usable by iconv() |
4450 */ | 4450 */ |
4451 const char* pst_default_charset(pst_item *item, int buflen, char* result) { | 4451 const char* pst_default_charset(pst_item *item, int buflen, char* result) { |
4452 return (item->body_charset.str) ? item->body_charset.str : | 4452 return (item->body_charset.str) ? item->body_charset.str : |
4453 (item->message_codepage) ? codepage(item->message_codepage, buflen, result) : | 4453 (item->message_codepage) ? codepage(item->message_codepage, buflen, result) : |
4454 (item->internet_cpid) ? codepage(item->internet_cpid, buflen, result) : | 4454 (item->internet_cpid) ? codepage(item->internet_cpid, buflen, result) : |