Mercurial > libpst
comparison src/readpst.c @ 75:987aa872294e stable-0-6-11
Use ftello/fseeko to properly handle large files.
Document and properly use datasize field in b5 blocks.
Fix some MSVC compile issues and collect MSVC dependencies into one place.
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Tue, 03 Jun 2008 12:00:58 -0700 |
parents | 3cb02cb1e6cd |
children | 87216aefc6df |
comparison
equal
deleted
inserted
replaced
74:6f82d13e9300 | 75:987aa872294e |
---|---|
4 * Written by David Smith | 4 * Written by David Smith |
5 * dave.s@earthcorp.com | 5 * dave.s@earthcorp.com |
6 */ | 6 */ |
7 #include "define.h" | 7 #include "define.h" |
8 #include "libstrfunc.h" | 8 #include "libstrfunc.h" |
9 //#include "vbuf.h" | |
10 #include "libpst.h" | 9 #include "libpst.h" |
11 #include "common.h" | 10 #include "common.h" |
12 #include "timeconv.h" | 11 #include "timeconv.h" |
13 #include "lzfu.h" | 12 #include "lzfu.h" |
14 | 13 |
17 #define KMAIL_INDEX ".%s.index" | 16 #define KMAIL_INDEX ".%s.index" |
18 #define SEP_MAIL_FILE_TEMPLATE "%i" /* "%09i" */ | 17 #define SEP_MAIL_FILE_TEMPLATE "%i" /* "%09i" */ |
19 | 18 |
20 // max size of the c_time char*. It will store the date of the email | 19 // max size of the c_time char*. It will store the date of the email |
21 #define C_TIME_SIZE 500 | 20 #define C_TIME_SIZE 500 |
22 #define PERM_DIRS 0777 | |
23 | |
24 // macro used for creating directories | |
25 #ifndef WIN32 | |
26 #define D_MKDIR(x) mkdir(x, PERM_DIRS) | |
27 #else | |
28 #define D_MKDIR(x) mkdir(x) | |
29 #endif | |
30 | 21 |
31 struct file_ll { | 22 struct file_ll { |
32 char *name; | 23 char *name; |
33 char *dname; | 24 char *dname; |
34 FILE * output; | 25 FILE * output; |
571 y++; | 562 y++; |
572 } while (overwrite == 0); | 563 } while (overwrite == 0); |
573 | 564 |
574 if (chdir(dir_name)) { | 565 if (chdir(dir_name)) { |
575 x = errno; | 566 x = errno; |
576 DIE(("mk_recurse_dir: Cannot change to directory %s: %s\n", dir, strerror(x))); | 567 DIE(("mk_seperate_dir: Cannot change to directory %s: %s\n", dir, strerror(x))); |
577 } | 568 } |
578 | 569 |
579 if (overwrite) { | 570 if (overwrite) { |
580 // we should probably delete all files from this directory | 571 // we should probably delete all files from this directory |
581 #if !defined(WIN32) && !defined(__CYGWIN__) | 572 #if !defined(WIN32) && !defined(__CYGWIN__) |