comparison src/libpst.c @ 328:c507af52515a

add readpst -a option
author Carl Byington <carl@five-ten-sg.com>
date Wed, 12 Jun 2013 19:45:44 -0700
parents cb67b335afcc
children 0f3185217313
comparison
equal deleted inserted replaced
327:e1b9f9aa5074 328:c507af52515a
282 static void pst_printDptr(pst_file *pf, pst_desc_tree *ptr); 282 static void pst_printDptr(pst_file *pf, pst_desc_tree *ptr);
283 static void pst_printID2ptr(pst_id2_tree *ptr); 283 static void pst_printID2ptr(pst_id2_tree *ptr);
284 static int pst_process(uint64_t block_id, pst_mapi_object *list, pst_item *item, pst_item_attach *attach); 284 static int pst_process(uint64_t block_id, pst_mapi_object *list, pst_item *item, pst_item_attach *attach);
285 static size_t pst_read_block_size(pst_file *pf, int64_t offset, size_t size, char **buf); 285 static size_t pst_read_block_size(pst_file *pf, int64_t offset, size_t size, char **buf);
286 static int pst_decrypt(uint64_t i_id, char *buf, size_t size, unsigned char type); 286 static int pst_decrypt(uint64_t i_id, char *buf, size_t size, unsigned char type);
287 static int pst_stricmp(char *a, char *b);
288 static int pst_strincmp(char *a, char *b, size_t x); 287 static int pst_strincmp(char *a, char *b, size_t x);
289 static char* pst_wide_to_single(char *wt, size_t size); 288 static char* pst_wide_to_single(char *wt, size_t size);
290 289
291 290
292 static char *pst_getcwd(void) { 291 static char *pst_getcwd(void) {
3389 SAFE_FREE(item->email->sentmail_folder); 3388 SAFE_FREE(item->email->sentmail_folder);
3390 SAFE_FREE_STR(item->email->sentto_address); 3389 SAFE_FREE_STR(item->email->sentto_address);
3391 SAFE_FREE_STR(item->email->report_text); 3390 SAFE_FREE_STR(item->email->report_text);
3392 SAFE_FREE(item->email->report_time); 3391 SAFE_FREE(item->email->report_time);
3393 SAFE_FREE_STR(item->email->supplementary_info); 3392 SAFE_FREE_STR(item->email->supplementary_info);
3393 SAFE_FREE_STR(item->email->outlook_received_name1);
3394 SAFE_FREE_STR(item->email->outlook_sender_name2);
3395 SAFE_FREE_STR(item->email->outlook_normalized_subject);
3396 SAFE_FREE_STR(item->email->outlook_search_key);
3394 free(item->email); 3397 free(item->email);
3395 } 3398 }
3396 if (item->folder) { 3399 if (item->folder) {
3397 free(item->folder); 3400 free(item->folder);
3398 } 3401 }
4153 DEBUG_RET(); 4156 DEBUG_RET();
4154 return size; 4157 return size;
4155 } 4158 }
4156 4159
4157 4160
4158 static int pst_stricmp(char *a, char *b) { 4161 /** compare strings case-insensitive.
4159 // compare strings case-insensitive. 4162 * @return -1 if a < b, 0 if a==b, 1 if a > b
4160 // returns -1 if a < b, 0 if a==b, 1 if a > b 4163 */
4164 int pst_stricmp(char *a, char *b) {
4161 while(*a != '\0' && *b != '\0' && toupper(*a)==toupper(*b)) { 4165 while(*a != '\0' && *b != '\0' && toupper(*a)==toupper(*b)) {
4162 a++; b++; 4166 a++; b++;
4163 } 4167 }
4164 if (toupper(*a) == toupper(*b)) 4168 if (toupper(*a) == toupper(*b))
4165 return 0; 4169 return 0;