diff src/readpst.c @ 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 cfd6175f9334
line wrap: on
line diff
--- a/src/readpst.c	Wed Feb 06 23:05:56 2008 -0800
+++ b/src/readpst.c	Thu Feb 14 14:55:32 2008 -0800
@@ -5,39 +5,13 @@
  *            dave.s@earthcorp.com
  */
 #include "define.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-#include <string.h>
-#include <ctype.h>
-#include <limits.h>
-#include <errno.h>
+#include "libstrfunc.h"
 #include "vbuf.h"
-
-#ifndef _WIN32
-# include <unistd.h>
-# include <sys/stat.h> //mkdir
-
-// for reading of directory and clearing in function mk_seperate_dir
-# include <sys/types.h>
-# include <dirent.h>
-#else
-# include <direct.h>
-# define chdir _chdir
-# define int32_t __int32
-#endif
-
-#ifndef __GNUC__
-# include "XGetopt.h"
-#endif
-
-#include "libstrfunc.h" // for base64_encoding
-
 #include "libpst.h"
 #include "common.h"
 #include "timeconv.h"
 #include "lzfu.h"
+
 #define OUTPUT_TEMPLATE "%s"
 #define OUTPUT_KMAIL_DIR_TEMPLATE ".%s.directory"
 #define KMAIL_INDEX ".%s.index"
@@ -53,6 +27,7 @@
 #else
 #define D_MKDIR(x) mkdir(x)
 #endif
+
 struct file_ll {
     char *name;
     char *dname;
@@ -350,7 +325,7 @@
 
     if (output_mode != OUTPUT_QUIET) printf("Opening PST file and indexes...\n");
 
-    RET_DERROR(pst_open(&pstfile, fname, "r"), 1, ("Error opening File\n"));
+    RET_DERROR(pst_open(&pstfile, fname), 1, ("Error opening File\n"));
     RET_DERROR(pst_load_index(&pstfile), 2, ("Index Error\n"));
 
     pst_load_extended_attributes(&pstfile);