Mercurial > libpst
comparison src/pst2ldif.cpp @ 59:7d5c637aaafb
General cleanup and code fixes.
Use autoscan to cleanup our autoconf system.
Use autoconf to detect when we need to use our XGetopt files and other header files.
Decode BCC field.
Fix missing LE32_CPU byte swapping for FILETIME types.
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Thu, 14 Feb 2008 14:55:32 -0800 |
parents | 034641c26ab9 |
children | 3cb02cb1e6cd |
comparison
equal
deleted
inserted
replaced
58:a8b772313ff4 | 59:7d5c637aaafb |
---|---|
8 | 8 |
9 */ | 9 */ |
10 | 10 |
11 using namespace std; | 11 using namespace std; |
12 | 12 |
13 #include <stdio.h> | |
14 #include <stdlib.h> | |
15 #include <time.h> | |
16 #include <string.h> | |
17 #include <ctype.h> | |
18 #include <limits.h> | |
19 #include <errno.h> | |
20 | |
21 #ifndef _WIN32 | |
22 # include <unistd.h> | |
23 # include <sys/stat.h> //mkdir | |
24 | |
25 // for reading of directory and clearing in function mk_separate_dir | |
26 # include <sys/types.h> | |
27 # include <dirent.h> | |
28 #else | |
29 # include <direct.h> | |
30 # define chdir _chdir | |
31 # define int32_t __int32 | |
32 #endif | |
33 | |
34 #ifndef __GNUC__ | |
35 # include "XGetopt.h" | |
36 #endif | |
37 | |
38 // needed for std c++ collections | 13 // needed for std c++ collections |
39 #include <set> | 14 #include <set> |
40 | 15 |
41 extern "C" { | 16 extern "C" { |
42 #include "libstrfunc.h" // for base64_encoding | |
43 #include "define.h" | 17 #include "define.h" |
18 #include "libstrfunc.h" | |
44 #include "libpst.h" | 19 #include "libpst.h" |
45 #include "common.h" | 20 #include "common.h" |
46 #include "timeconv.h" | 21 #include "timeconv.h" |
47 #include "lzfu.h" | 22 #include "lzfu.h" |
48 #include "version.h" | |
49 } | 23 } |
50 | 24 |
51 int32_t usage(); | 25 int32_t usage(); |
52 int32_t version(); | 26 int32_t version(); |
53 char *my_stristr(char *haystack, char *needle); | 27 char *my_stristr(char *haystack, char *needle); |
423 if (!d_log) d_log = "pst2ldif.log"; | 397 if (!d_log) d_log = "pst2ldif.log"; |
424 #endif | 398 #endif |
425 DEBUG_INIT(d_log); | 399 DEBUG_INIT(d_log); |
426 DEBUG_REGISTER_CLOSE(); | 400 DEBUG_REGISTER_CLOSE(); |
427 DEBUG_ENT("main"); | 401 DEBUG_ENT("main"); |
428 RET_DERROR(pst_open(&pstfile, fname, "r"), 1, ("Error opening File\n")); | 402 RET_DERROR(pst_open(&pstfile, fname), 1, ("Error opening File\n")); |
429 RET_DERROR(pst_load_index(&pstfile), 2, ("Index Error\n")); | 403 RET_DERROR(pst_load_index(&pstfile), 2, ("Index Error\n")); |
430 | 404 |
431 pst_load_extended_attributes(&pstfile); | 405 pst_load_extended_attributes(&pstfile); |
432 | 406 |
433 d_ptr = pstfile.d_head; // first record is main record | 407 d_ptr = pstfile.d_head; // first record is main record |