Mercurial > libpst
changeset 118:0f1492b7fe8b
patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
add processing for pst files of type 0x0f
start adding support for properly building and installing libpst.so and the header files required to use it.
remove version.h since the version number is now in config.h
more const correctness issues regarding getopt()
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Sat, 31 Jan 2009 12:12:36 -0800 |
parents | 0a3d854b53f6 |
children | f50f4321aa2d |
files | AUTHORS ChangeLog Makefile.am NEWS configure.in libpst.spec.in libpst/Makefile.am libpst/config.h regression/regression-tests.bash src/Makefile.am src/XGetopt.c src/XGetopt.h src/common.h src/debug.c src/define.h src/deltasearch.cpp src/dumpblocks.c src/getidblock.c src/libpst.c src/libpst.h src/lspst.c src/nick2ldif.cpp src/pst2dii.cpp.in src/pst2ldif.cpp src/readpst.c src/readpstlog.c src/testdebug.c src/timeconv.c src/timeconv.h src/version.h.in xml/libpst.in |
diffstat | 31 files changed, 400 insertions(+), 264 deletions(-) [+] |
line wrap: on
line diff
--- a/AUTHORS Fri Jan 16 15:31:11 2009 -0800 +++ b/AUTHORS Sat Jan 31 12:12:36 2009 -0800 @@ -24,3 +24,4 @@ Robert Harris <robert.f.harris@blueyonder.co.uk> David Cuadrado <krawek@gmail.com> Chris Eagle <cseagle@redshift.com> + Fridrich Strba <fstrba@novell.com>
--- a/ChangeLog Fri Jan 16 15:31:11 2009 -0800 +++ b/ChangeLog Sat Jan 31 12:12:36 2009 -0800 @@ -1,3 +1,13 @@ +LibPST 0.6.26 (2009-01-31) +=============================== + * patch from Fridrich Strba for building on mingw and + general cleanup of autoconf files + * add processing for pst files of type 0x0f + * start adding support for properly building and installing + libpst.so and the header files required to use it. + * remove version.h since the version number is now in config.h + * more const correctness issues regarding getopt() + LibPST 0.6.25 (2009-01-16) =============================== * improve handling of content-type charset values in mime parts
--- a/Makefile.am Fri Jan 16 15:31:11 2009 -0800 +++ b/Makefile.am Sat Jan 31 12:12:36 2009 -0800 @@ -3,10 +3,12 @@ html_DATA = AUTHORS COPYING ChangeLog NEWS README CLEANFILES = xml/libpst xml/Makefile -if BUILD_LIBPST_SHARED - pkgconfigdir = $(libdir)/pkgconfig - pkgconfig_DATA = libpst.pc -endif +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libpst.pc EXTRA_DIST = Doxyfile libpst.html.tar.gz libpst.spec $(wildcard xml/M*) $(wildcard xml/h*) $(wildcard xml/lib*) +if !STATIC_TOOLS + libpstincludedir = $(includedir)/libpst + libpstinclude_HEADERS = config.h +endif
--- a/NEWS Fri Jan 16 15:31:11 2009 -0800 +++ b/NEWS Sat Jan 31 12:12:36 2009 -0800 @@ -1,3 +1,4 @@ +0.6.26 2009-01-31 patch from Fridrich Strba for building on mingw, and autoconf cleanup 0.6.25 2009-01-16 improve handling of content-type charset values in mime parts 0.6.24 2008-12-11 patch from Chris Eagle to build on cygwin 0.6.23 2008-12-04 bump version to avoid cvs tagging mistake in fedora
--- a/configure.in Fri Jan 16 15:31:11 2009 -0800 +++ b/configure.in Sat Jan 31 12:12:36 2009 -0800 @@ -1,44 +1,68 @@ AC_PREREQ(2.59) -AC_INIT(libpst,0.6.25,carl@five-ten-sg.com) +AC_INIT(libpst,0.6.26,carl@five-ten-sg.com) AC_CONFIG_SRCDIR([config.h.in]) AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE($PACKAGE_NAME,$PACKAGE_VERSION) +AC_CANONICAL_HOST + +# Check for Win32 +AC_MSG_CHECKING([for Win32]) +case "$host" in + *-mingw*) + os_win32=yes + ;; + *) + os_win32=no + ;; +esac +AC_MSG_RESULT($os_win32) +AM_CONDITIONAL(OS_WIN32, [test "$os_win32" = "yes"]) + # Checks for programs. -my_build_dii=yes -AC_PATH_PROG(CONVERT, convert) -if test "x$CONVERT" = "x" ; then - AC_MSG_WARN([convert not found. pst2dii disabled]) - my_build_dii=no -else - # The following lines adds the --enable-dii option to configure: - # - # Give the user the choice to enter one of these: - # --enable-dii - # --enable-dii=yes - # --enable-dii=no - # - AC_MSG_CHECKING([whether we are enabling dii utility]) - AC_ARG_ENABLE(dii, - AC_HELP_STRING([--enable-dii], [enable dii utility]), - [if test "${enable_dii}" = "no" ; then - AC_MSG_RESULT([no]) - my_build_dii=no - else - AC_MSG_RESULT([yes]) - fi], - # Default value for configure - AC_MSG_RESULT([yes]) - ) +# The following lines adds the --enable-dii option to configure: +# +# Give the user the choice to enter one of these: +# --enable-dii +# --enable-dii=yes +# --enable-dii=no +# +AC_MSG_CHECKING([whether we are enabling dii utility]) +AC_ARG_ENABLE(dii, + AC_HELP_STRING([--enable-dii], [enable dii utility]), + [ + case "${enableval}" in + yes) ;; + no) ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-dii) ;; + esac + ], + # default if not specified + enable_dii=yes + ) +AC_MSG_RESULT([$enable_dii]) +if test "$enable_dii" = "yes"; then + AC_PATH_PROG(CONVERT, convert) + if test "x$CONVERT" = "x" ; then + AC_MSG_WARN([convert not found. pst2dii disabled]) + enable_dii=no + fi fi -AM_CONDITIONAL(BUILD_DII, test $my_build_dii = yes) +if test "$enable_dii" = "yes"; then + AC_CHECK_HEADER([gd.h], , [ + enable_dii=no + AC_MSG_WARN([gd.h not found. pst2dii disabled]) + ]) +fi +AM_CONDITIONAL(BUILD_DII, [test "$enable_dii" = "yes"]) # Checks for programs. AC_PROG_CXX AC_PROG_CC +AM_PROG_CC_C_O AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S @@ -51,15 +75,12 @@ # Checks for header files. AC_CHECK_HEADER([unistd.h], - AM_CONDITIONAL(NEED_XGETOPT, [test yes = no ]), + AM_CONDITIONAL(NEED_XGETOPT, [test yes = no]), AM_CONDITIONAL(NEED_XGETOPT, [test yes = yes]) ) AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h stdint.h stdlib.h string.h sys/param.h unistd.h wchar.h]) -if test "$my_build_dii" = "yes"; then - AC_CHECK_HEADERS([gd.h]) -fi # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL @@ -72,17 +93,19 @@ AC_FUNC_FSEEKO AC_FUNC_LSTAT AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK -AC_FUNC_MALLOC -AC_FUNC_MKTIME -AC_FUNC_REALLOC +if test "$cross_compiling" != "yes"; then + AC_FUNC_MALLOC + AC_FUNC_MKTIME + AC_FUNC_REALLOC +fi AC_FUNC_STRFTIME AC_FUNC_VPRINTF -AC_CHECK_FUNCS([memchr memmove memset strcasecmp strchr strdup strerror strpbrk strrchr strstr strtol]) +AC_CHECK_FUNCS([memchr memmove memset strcasecmp strncasecmp strchr strdup strerror strpbrk strrchr strstr strtol]) # iconv on mac is a library -SAVELIBS="${LIBS}" +SAVELIBS="$LIBS" AC_SEARCH_LIBS([iconv_open], [iconv]) -if test "x${SAVELIBS}" != "x${LIBS}"; then +if test "$SAVELIBS" != "$LIBS"; then all_libraries="-L/usr/lib $all_libraries" AC_SUBST(all_libraries) AC_MSG_WARN([This should be building on Mac OSX, adding /usr/lib to the library path]) @@ -92,7 +115,8 @@ AC_LANG_PUSH([C++]) AC_COMPILE_IFELSE([ #include <iconv.h> - int main(int argc, char **argv) + #include <stddef.h> + int main(int argc, char* const* argv) { size_t inlen = 100; char buffer[[inlen]]; @@ -122,16 +146,21 @@ # AC_MSG_CHECKING([whether we are forcing debug dump file creation]) AC_ARG_ENABLE(pst-debug, - AC_HELP_STRING([--enable-pst-debug], [force debug dump file creation]), - [if test "${enable_pst_debug}" = "no" ; then - AC_MSG_RESULT([no]) - else - AC_DEFINE(DEBUG_ALL, 1, Define to 1 to force debug dump file creation) - AC_MSG_RESULT([yes]) - fi], - # Default value for configure - AC_MSG_RESULT([no]) - ) + AC_HELP_STRING([--enable-pst-debug], [force debug dump file creation]), + [ + case "${enableval}" in + yes) ;; + no) ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-pst-debug) ;; + esac + ], + # default if not specified + enable_pst_debug=no + ) +AC_MSG_RESULT([$enable_pst_debug]) +if test "$enable_pst_debug" = "yes"; then + AC_DEFINE(DEBUG_ALL, 1, Define to 1 to force debug dump file creation) +fi # The following lines adds the --enable-libpst-shared option to configure: @@ -143,31 +172,74 @@ # AC_MSG_CHECKING([whether we are building libpst shared object]) AC_ARG_ENABLE(libpst-shared, - AC_HELP_STRING([--enable-libpst-shared], [build libpst shared object]), - [if test "${enable_libpst_shared}" = "no" ; then - AC_MSG_RESULT([no]) - AM_CONDITIONAL(BUILD_LIBPST_SHARED, test 0 = 1) - else - AC_MSG_RESULT([yes]) - AM_CONDITIONAL(BUILD_LIBPST_SHARED, test 1 = 1) - fi], - # Default value for configure - [AC_MSG_RESULT([no]) - AM_CONDITIONAL(BUILD_LIBPST_SHARED, test 0 = 1)] - ) + AC_HELP_STRING([--enable-libpst-shared], [build libpst shared object]), + [ + case "${enableval}" in + yes) ;; + no) ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-libpst-shared) ;; + esac + ], + # default if not specified + enable_libpst_shared=no + ) +AC_MSG_RESULT([$enable_libpst_shared]) +enable_static_tools=yes +if test "$enable_libpst_shared" = "yes"; then + enable_shared=yes + enable_static_tools=no +fi + + +# needed by STATIC_TOOLS in src/Makefile.am +AC_SUBST(PST_OBJDIR, [$objdir]) + + +# The following lines adds the --enable-static-tools option to configure: +# +# Give the user the choice to enter one of these: +# --enable-static-tools +# --enable-static-tools=yes +# --enable-static-tools=no +# +AC_MSG_CHECKING([whether to link command line tools with libpst statically]) +AC_ARG_ENABLE([static-tools], + AC_HELP_STRING([--enable-static-tools], [link command line tools with libpst statically]), + [ + case "${enableval}" in + yes) ;; + no) ;; + *) AC_MSG_ERROR(bad value ${enableval} for --static-tools) ;; + esac + ], + [ + enable_static_tools=no + ]) +AC_MSG_RESULT([$enable_static_tools]) +AM_CONDITIONAL(STATIC_TOOLS, [test "$enable_static_tools" = "yes"]) +if test "$enable_static_tools" = "yes"; then + enable_static="yes" +fi + + +AC_MSG_CHECKING([system enable shared]) +AC_MSG_RESULT([$enable_shared]) +AC_MSG_CHECKING([system enable static]) +AC_MSG_RESULT([$enable_static]) + AC_OUTPUT( \ Makefile \ + debian/Makefile \ debian/changelog \ - debian/Makefile \ - libpst.spec \ - libpst.pc \ html/Makefile \ info/Makefile \ + libpst.pc \ + libpst.spec \ + libpst/Makefile \ man/Makefile \ src/Makefile \ - src/version.h \ src/pst2dii.cpp \ xml/Makefile \ xml/libpst \
--- a/libpst.spec.in Fri Jan 16 15:31:11 2009 -0800 +++ b/libpst.spec.in Sat Jan 31 12:12:36 2009 -0800 @@ -47,6 +47,11 @@ %changelog +* Sat Jan 31 2009 Carl Byington <carl@five-ten-sg.com> - 0.6.26-1 +- patch from Fridrich Strba for building on mingw and general +- cleanup of autoconf files. +- add processing for pst files of type 0x0f + * Fri Jan 16 2009 Carl Byington <carl@five-ten-sg.com> - 0.6.25-1 - improve handling of content-type charset values in mime parts
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libpst/Makefile.am Sat Jan 31 12:12:36 2009 -0800 @@ -0,0 +1,1 @@ +EXTRA_DIST = config.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libpst/config.h Sat Jan 31 12:12:36 2009 -0800 @@ -0,0 +1,8 @@ +// +// this file only exists to allow including <libpst/config.h> +// while building this package. The real config.h is at the +// top level, generated by ./configure, and installed into +// $includepath/libpst + +#include "../config.h" +
--- a/regression/regression-tests.bash Fri Jan 16 15:31:11 2009 -0800 +++ b/regression/regression-tests.bash Sat Jan 31 12:12:36 2009 -0800 @@ -17,19 +17,23 @@ { n="$1" fn="$2" + echo $fn + ba=$(basename "$fn" .pst) rm -rf output$n mkdir output$n - $val ../src/readpst -cv -o output$n -d dumper $fn >$fn.err 2>&1 - ../src/readpstlog -f I dumper >$fn.log - #$val ../src/pst2ldif -b 'o=ams-cc.com, c=US' -c 'newPerson' -o $fn >$fn.ldif.err 2>&1 - #$val ../src/pst2ldif -b 'o=ams-cc.com, c=US' -c 'inetOrgPerson' $fn >$fn.ldif2.err 2>&1 + #../src/readpst -cv -o output$n $fn >$ba.err 2>&1 + $val ../src/readpst -cv -o output$n -d dumper $fn >$ba.err 2>&1 + ../src/readpstlog -f I dumper >$ba.log + #$val ../src/pst2ldif -d dumper -b 'o=ams-cc.com, c=US' -c 'newPerson' -o $fn >$ba.ldif.err 2>&1 + #$val ../src/pst2ldif -d dumper -b 'o=ams-cc.com, c=US' -c 'inetOrgPerson' $fn >$ba.ldif2.err 2>&1 + # ../src/readpstlog -f I dumper >$ba.log rm -f dumper } val="valgrind --leak-check=full" -#val='' +val='' pushd .. make || exit @@ -53,7 +57,10 @@ #dopst 10 returned_message.pst #dopst 11 flow.pst #dopst 12 test-html.pst - dopst 13 test-text.pst + #dopst 13 test-text.pst #dopst 14 joe.romanowski.pst + #dopst 15 hourig1.pst + #dopst 16 hourig2.pst + dopst 17 hourig3.pst fi
--- a/src/Makefile.am Fri Jan 16 15:31:11 2009 -0800 +++ b/src/Makefile.am Sat Jan 31 12:12:36 2009 -0800 @@ -1,59 +1,75 @@ -hfiles = $(wildcard *.h) +if OS_WIN32 + ICONVLIB = -liconv +else + ICONVLIB = +endif + +if STATIC_TOOLS + PSTLIB=@PST_OBJDIR@/libpst.a +else + PSTLIB=libpst.la +endif + +common_header = common.h \ + define.h \ + libpst.h \ + libstrfunc.h \ + lzfu.h \ + timeconv.h \ + vbuf.h + +common_source = debug.c \ + libpst.c \ + libstrfunc.c \ + lzfu.c \ + timeconv.c \ + vbuf.c + +if NEED_XGETOPT + common_source += XGetopt.c +endif + +noinst_PROGRAMS = deltasearch dumpblocks getidblock bin_PROGRAMS = lspst readpst readpstlog pst2ldif if BUILD_DII bin_PROGRAMS += pst2dii endif -noinst_PROGRAMS = deltasearch dumpblocks getidblock - -lspst_SOURCES = $(hfiles) lspst.c libpst.c timeconv.c libstrfunc.c debug.c vbuf.c -readpst_SOURCES = $(hfiles) readpst.c libpst.c timeconv.c libstrfunc.c debug.c lzfu.c vbuf.c -readpstlog_SOURCES = $(hfiles) readpstlog.c debug.c -pst2ldif_SOURCES = $(hfiles) pst2ldif.cpp libpst.c timeconv.c libstrfunc.c debug.c lzfu.c vbuf.c -pst2dii_SOURCES = $(hfiles) pst2dii.cpp libpst.c timeconv.c libstrfunc.c debug.c lzfu.c vbuf.c -deltasearch_SOURCES = deltasearch.cpp debug.c -dumpblocks_SOURCES = dumpblocks.c debug.c libpst.c libstrfunc.c timeconv.c vbuf.c -getidblock_SOURCES = getidblock.c debug.c libpst.c libstrfunc.c timeconv.c vbuf.c +lspst_SOURCES = lspst.c $(common_header) +readpst_SOURCES = readpst.c $(common_header) +readpstlog_SOURCES = readpstlog.c $(common_header) +pst2ldif_SOURCES = pst2ldif.cpp $(common_header) +pst2dii_SOURCES = pst2dii.cpp $(common_header) +deltasearch_SOURCES = deltasearch.cpp $(common_header) +dumpblocks_SOURCES = dumpblocks.c $(common_header) +getidblock_SOURCES = getidblock.c $(common_header) -if BUILD_LIBPST_SHARED - lspst_CFLAGS = $(AM_CFLAGS) - readpst_CFLAGS = $(AM_CFLAGS) - readpstlog_CFLAGS = $(AM_CFLAGS) - pst2ldif_CFLAGS = $(AM_CFLAGS) - pst2dii_CFLAGS = $(AM_CFLAGS) - deltasearch_CFLAGS = $(AM_CFLAGS) - dumpblocks_CFLAGS = $(AM_CFLAGS) - getidblock_CFLAGS = $(AM_CFLAGS) - lib_LTLIBRARIES = libpst.la - libpst_la_SOURCES = common.h \ - debug.c \ - libpst.c \ - libpst.h \ - libstrfunc.c \ - libstrfunc.h \ - lspst.c \ - timeconv.c \ - timeconv.h \ - vbuf.c \ - vbuf.h \ - version.h - libpst_la_LDFLAGS = -no-undefined - libpstincludedir = $(includedir)/libpst - libpstinclude_HEADERS = common.h \ - define.h \ - libpst.h \ - libstrfunc.h \ - timeconv.h \ - vbuf.h \ - version.h +lspst_CFLAGS = $(AM_CFLAGS) +readpst_CFLAGS = $(AM_CFLAGS) +readpstlog_CFLAGS = $(AM_CFLAGS) +pst2ldif_CFLAGS = $(AM_CFLAGS) +pst2dii_CFLAGS = $(AM_CFLAGS) +deltasearch_CFLAGS = $(AM_CFLAGS) +dumpblocks_CFLAGS = $(AM_CFLAGS) +getidblock_CFLAGS = $(AM_CFLAGS) + +if STATIC_TOOLS + noinst_LTLIBRARIES = libpst.la +else + lib_LTLIBRARIES = libpst.la + libpstincludedir = $(includedir)/libpst + libpstinclude_HEADERS = \ + common.h \ + define.h \ + libpst.h \ + libstrfunc.h\ + timeconv.h \ + vbuf.h + libpst_la_LDFLAGS = -no-undefined -version-info 1:0:0 endif -if NEED_XGETOPT - lspst_SOURCES += XGetopt.c - readpst_SOURCES += XGetopt.c - readpstlog_SOURCES += XGetopt.c - pst2ldif_SOURCES += XGetopt.c - pst2dii_SOURCES += XGetopt.c -endif +libpst_la_SOURCES = $(common_source) $(common_header) +libpst_la_LIBADD = $(ICONVLIB) + EXTRA_DIST = testdebug.c @@ -61,9 +77,11 @@ INCLUDES= $(all_includes) # the library search path. -lspst_LDFLAGS = $(all_libraries) -readpst_LDFLAGS = $(all_libraries) -readpstlog_LDFLAGS = $(all_libraries) -pst2ldif_LDFLAGS = $(all_libraries) -pst2dii_LDFLAGS = $(all_libraries) -lgd -lpng -lz -lfreetype -lm - +lspst_LDADD = $(all_libraries) $(PSTLIB) $(ICONVLIB) +readpst_LDADD = $(all_libraries) $(PSTLIB) $(ICONVLIB) +readpstlog_LDADD = $(all_libraries) $(PSTLIB) $(ICONVLIB) +pst2ldif_LDADD = $(all_libraries) $(PSTLIB) $(ICONVLIB) +pst2dii_LDADD = $(all_libraries) $(PSTLIB) $(ICONVLIB) -lgd +dumpblocks_LDADD = $(all_libraries) $(PSTLIB) $(ICONVLIB) +getidblock_LDADD = $(all_libraries) $(PSTLIB) $(ICONVLIB) +deltasearch_LDADD = $(all_libraries) $(PSTLIB) $(ICONVLIB)
--- a/src/XGetopt.c Fri Jan 16 15:31:11 2009 -0800 +++ b/src/XGetopt.c Sat Jan 31 12:12:36 2009 -0800 @@ -18,6 +18,8 @@ // /////////////////////////////////////////////////////////////////////////////// +#ifndef __MINGW32__ /* mingw has getopt() */ + #include <stdio.h> #include <string.h> #include "XGetopt.h" @@ -31,7 +33,7 @@ // getopt -- parse command line options // // SYNOPSIS -// int getopt(int argc, char *argv[], char *optstring) +// int getopt(int argc, char* const* argv, const char *optstring) // // extern char *optarg; // extern int optind; @@ -135,9 +137,9 @@ char *optarg; // global argument pointer int optind = 0; // global argv index -int getopt(int argc, char *argv[], char *optstring) +int getopt(int argc, char* const* argv, char *optstring) { - static char *next = NULL; + static char *next = NULL; char c, *cp; if (optind == 0) next = NULL; @@ -197,3 +199,5 @@ return c; } + +#endif /* !__MINGW32__ */
--- a/src/XGetopt.h Fri Jan 16 15:31:11 2009 -0800 +++ b/src/XGetopt.h Sat Jan 31 12:12:36 2009 -0800 @@ -18,6 +18,6 @@ extern int optind, opterr; extern char *optarg; -int getopt(int argc, char *argv[], char *optstring); +int getopt(int argc, char* const* argv, char *optstring); #endif //XGETOPT_H
--- a/src/common.h Fri Jan 16 15:31:11 2009 -0800 +++ b/src/common.h Sat Jan 31 12:12:36 2009 -0800 @@ -3,20 +3,21 @@ #define __COMMON_H #ifndef _WIN32 - typedef unsigned int DWORD; - typedef unsigned short int WORD; - typedef unsigned char BYTE; - typedef unsigned int UINT32; + typedef uint32_t DWORD; + typedef uint16_t WORD; + typedef uint8_t BYTE; + typedef uint32_t UINT32; # pragma pack (1) -# ifndef FILETIME_DEFINED -# define FILETIME_DEFINED - /*Win32 Filetime struct - copied from WINE*/ - typedef struct { - unsigned int dwLowDateTime; - unsigned int dwHighDateTime; - } FILETIME; -# endif // FILETIME_DEFINED +#ifndef FILETIME_DEFINED +#define FILETIME_DEFINED + /*Win32 Filetime struct - copied from WINE*/ + typedef struct { + DWORD dwLowDateTime; + DWORD dwHighDateTime; + } FILETIME; +#endif // FILETIME_DEFINED + #endif // _WIN32 #endif // __COMMON_H
--- a/src/debug.c Fri Jan 16 15:31:11 2009 -0800 +++ b/src/debug.c Sat Jan 31 12:12:36 2009 -0800 @@ -1,14 +1,6 @@ #include "define.h" - -#include <stdio.h> -#include <stdlib.h> -#include <stdarg.h> -#include <ctype.h> -#include <string.h> -#include <limits.h> -#include <stdint.h> -#include <inttypes.h> +//#include <stdint.h> struct pst_debug_item { int type;
--- a/src/define.h Fri Jan 16 15:31:11 2009 -0800 +++ b/src/define.h Sat Jan 31 12:12:36 2009 -0800 @@ -6,15 +6,14 @@ */ #ifdef HAVE_CONFIG_H - #include "config.h" -#else - #ifdef _MSC_VER - #undef HAVE_UNISTD_H - #define HAVE_DIRECT_H - #define HAVE_WINDOWS_H - #endif + #include <libpst/config.h> #endif -#include "version.h" + +#ifdef _WIN32 + #undef HAVE_UNISTD_H + #define HAVE_DIRECT_H + #define HAVE_WINDOWS_H +#endif #ifndef DEFINEH_H #define DEFINEH_H @@ -59,40 +58,59 @@ #define PERM_DIRS 0777 -#ifdef HAVE_UNISTD_H - #include <unistd.h> - #define D_MKDIR(x) mkdir(x, PERM_DIRS) -#else - #include "XGetopt.h" - #ifdef HAVE_DIRECT_H - #include <direct.h> // win32 - #define D_MKDIR(x) mkdir(x) - #define chdir _chdir +#ifdef _WIN32 + #include <direct.h> // win32 + + #define D_MKDIR(x) mkdir(x) + #define chdir _chdir + + #define vsnprintf _vsnprintf + #define snprintf _snprintf + #ifdef _MSC_VER + #define ftello _ftelli64 + #define fseeko _fseeki64 + #elif defined (__MINGW32__) + #define ftello ftello64 + #define fseeko fseeko64 + #else + #error Only MSC and mingw supported for Windows #endif + #define strcasecmp _stricmp + #ifndef __MINGW32__ + #define off_t __int64 + #define size_t __int64 + #endif + #define int64_t __int64 + #define uint64_t unsigned __int64 + #define int32_t __int32 + #define uint32_t unsigned int + #define int16_t short int + #define uint16_t unsigned short int + #define int8_t signed char + #define uint8_t unsigned char + #ifndef UINT64_MAX + #define UINT64_MAX ((uint64_t)0xffffffffffffffff) + #endif + #define PRIx64 "I64x" + int __cdecl _fseeki64(FILE *, __int64, int); + __int64 __cdecl _ftelli64(FILE *); - #ifdef HAVE_WINDOWS_H - #include <windows.h> + #ifdef __MINGW32__ + #include <getopt.h> + #else + #include "XGetopt.h" #endif - #ifdef _MSC_VER - #define vsnprintf _vsnprintf - #define snprintf _snprintf - #define ftello _ftelli64 - #define fseeko _fseeki64 - #define strcasecmp _stricmp - #define off_t __int64 - #define size_t __int64 - #define int64_t __int64 - #define uint64_t unsigned __int64 - #define int32_t __int32 - #define uint32_t unsigned int - #define int16_t short int - #define uint16_t unsigned short int - #define int8_t signed char - #define uint8_t unsigned char - #define UINT64_MAX ((uint64_t)0xffffffffffffffff) - int __cdecl _fseeki64(FILE *, __int64, int); - __int64 __cdecl _ftelli64(FILE *); + #include <windows.h> +#else + #ifdef HAVE_INTTYPES_H + #include <inttypes.h> + #endif + #ifdef HAVE_UNISTD_H + #include <unistd.h> + #define D_MKDIR(x) mkdir(x, PERM_DIRS) + #else + #include "XGetopt.h" #endif #endif
--- a/src/deltasearch.cpp Fri Jan 16 15:31:11 2009 -0800 +++ b/src/deltasearch.cpp Sat Jan 31 12:12:36 2009 -0800 @@ -42,15 +42,15 @@ 0xd4, 0xe1, 0x11, 0xd0, 0x08, 0x8b, 0x2a, 0xf2, 0xed, 0x9a, 0x64, 0x3f, 0xc1, 0x6c, 0xf9, 0xec}; /*0xff*/ -int main(int argc, char *argv[]) { +int main(int argc, char* const* argv) { if (argc < 4) { - cout << "usage: " << argv[0] << " filename.pst integer-delta search-string" << endl; + printf("usage: %s filename.pst integer-delta search-string\n", argv[0]); return 0; } int fd = open(argv[1], O_RDONLY); int d = atoi(argv[2]); string search(argv[3]); - cout << "using file " << argv[1] << " with delta " << d << " looking for " << search << endl; + printf("using file %s with delta %d looking for %s\n", argv[1], d, argv[3]); if (fd) { struct stat st; fstat(fd, &st); @@ -58,9 +58,7 @@ char buf[size]; size_t s = read(fd, buf, size); pst_debug_hexdumper(stdout, buf, s, 16, 0); - cout << endl; - cout << endl; - cout << " dump decrypted data " << endl; + printf("\n\n dump decrypted data \n"); for (off_t i=0; i<size; i++) { buf[i] = comp_enc[(unsigned char)buf[i]]; }
--- a/src/dumpblocks.c Fri Jan 16 15:31:11 2009 -0800 +++ b/src/dumpblocks.c Sat Jan 31 12:12:36 2009 -0800 @@ -6,7 +6,7 @@ #include "libpst.h" #define OUT_BUF 20 -int main(int argc, char **argv) +int main(int argc, char* const* argv) { pst_file pstfile; pst_index_ll *ptr;
--- a/src/getidblock.c Fri Jan 16 15:31:11 2009 -0800 +++ b/src/getidblock.c Sat Jan 31 12:12:36 2009 -0800 @@ -4,7 +4,7 @@ static void usage(); -int main(int argc, char **argv) +int main(int argc, char* const* argv) { // pass the id number to display on the command line char *fname, *sid;
--- a/src/libpst.c Fri Jan 16 15:31:11 2009 -0800 +++ b/src/libpst.c Sat Jan 31 12:12:36 2009 -0800 @@ -4,16 +4,19 @@ * Written by David Smith * dave.s@earthcorp.com */ + #include "define.h" #include "libstrfunc.h" #include "vbuf.h" #include "libpst.h" +#include "common.h" #include "timeconv.h" #define ASSERT(x) { if(!(x)) raise( SIGSEGV ); } #define INDEX_TYPE32 0x0E +#define INDEX_TYPE32A 0x0F // unknown, but assumed to be similar for now #define INDEX_TYPE64 0x17 #define INDEX_TYPE_OFFSET (off_t)0x0A @@ -196,6 +199,7 @@ DEBUG_INFO(("index_type = %i\n", pf->ind_type)); switch (pf->ind_type) { case INDEX_TYPE32 : + case INDEX_TYPE32A : pf->do_read64 = 0; break; case INDEX_TYPE64 : @@ -4472,7 +4476,7 @@ } -#ifdef _MSC_VER +#ifdef _WIN32 char * fileTimeToAscii(const FILETIME* filetime) { time_t t; DEBUG_ENT("fileTimeToAscii"); @@ -4508,7 +4512,7 @@ } -#endif //_MSC_VER +#endif //_WIN32 int pst_stricmp(char *a, char *b) { // compare strings case-insensitive.
--- a/src/libpst.h Fri Jan 16 15:31:11 2009 -0800 +++ b/src/libpst.h Sat Jan 31 12:12:36 2009 -0800 @@ -10,26 +10,26 @@ #ifndef LIBPST_H #define LIBPST_H -#ifndef _MSC_VER +#ifndef _WIN32 #include <stdint.h> #include <inttypes.h> #ifndef FILETIME_DEFINED - #define FILETIME_DEFINED - //Win32 Filetime struct - copied from WINE - typedef struct { - uint32_t dwLowDateTime; - uint32_t dwHighDateTime; - } FILETIME; + #define FILETIME_DEFINED + //Win32 Filetime struct - copied from WINE + typedef struct { + uint32_t dwLowDateTime; + uint32_t dwHighDateTime; + } FILETIME; #endif #endif // According to Jan Wolter, sys/param.h is the most portable source of endian // information on UNIX systems. see http://www.unixpapa.com/incnote/byteorder.html -#ifdef _MSC_VER +#ifdef _WIN32 #define BYTE_ORDER LITTLE_ENDIAN #else #include <sys/param.h> -#endif // defined _MSC_VER +#endif // defined _WIN32 #if BYTE_ORDER == BIG_ENDIAN # define LE64_CPU(x) \
--- a/src/lspst.c Fri Jan 16 15:31:11 2009 -0800 +++ b/src/lspst.c Sat Jan 31 12:12:36 2009 -0800 @@ -17,6 +17,7 @@ #include <unistd.h> #include "libpst.h" +#include "common.h" #include "timeconv.h" struct file_ll { @@ -30,8 +31,8 @@ void canonicalize_filename(char *fname); void debug_print(char *fmt, ...); -int usage(char *prog_name); -int version(); +void usage(char *prog_name); +void version(); // global settings pst_file pstfile; @@ -149,7 +150,7 @@ } -int usage(char *prog_name) { +void usage(char *prog_name) { DEBUG_ENT("usage"); version(); printf("Usage: %s [OPTIONS] {PST FILENAME}\n", prog_name); @@ -158,11 +159,10 @@ printf("\t-h\t- Help. This screen\n"); printf("\t-V\t- Version. Display program version\n"); DEBUG_RET(); - return 0; } -int version() { +void version() { DEBUG_ENT("version"); printf("lspst / LibPST v%s\n", VERSION); #if BYTE_ORDER == BIG_ENDIAN @@ -176,11 +176,10 @@ printf("GCC %d.%d : %s %s\n", __GNUC__, __GNUC_MINOR__, __DATE__, __TIME__); #endif DEBUG_RET(); - return 0; } -int main(int argc, char** argv) { +int main(int argc, char* const* argv) { pst_item *item = NULL; pst_desc_ll *d_ptr; char *temp = NULL; //temporary char pointer
--- a/src/nick2ldif.cpp Fri Jan 16 15:31:11 2009 -0800 +++ b/src/nick2ldif.cpp Sat Jan 31 12:12:36 2009 -0800 @@ -10,7 +10,9 @@ #include <iostream> //#include <fstream> #include <unistd.h> -#include "version.h" +extern "C" { + #include "define.h" +} char *ldap_base = NULL; char *ldap_org = NULL; @@ -18,7 +20,7 @@ using namespace std; -int main(int argc, char** argv) { +int main(int argc, const char** argv) { char c; char *temp; while ((c = getopt(argc, argv, "b:c:"))!= -1) {
--- a/src/pst2dii.cpp.in Fri Jan 16 15:31:11 2009 -0800 +++ b/src/pst2dii.cpp.in Sat Jan 31 12:12:36 2009 -0800 @@ -84,8 +84,8 @@ static void close_png(); -static int version(); -static int version() +static void version(); +static void version() { printf("pst2dii v%s\n", VERSION); #if BYTE_ORDER == BIG_ENDIAN @@ -98,12 +98,11 @@ #ifdef __GNUC__ printf("GCC %d.%d : %s %s\n", __GNUC__, __GNUC_MINOR__, __DATE__, __TIME__); #endif - return 0; } -static int usage(); -static int usage() +static void usage(); +static void usage() { version(); printf("Usage: %s [OPTIONS] {PST FILENAME}\n", prog_name); @@ -117,7 +116,6 @@ printf("\t-f ttf-font-file \t- Set the font file\n"); printf("\t-h \t- Help. This screen\n"); printf("\t-o dirname \t- Output directory to write files to.\n"); - return 0; } @@ -645,7 +643,7 @@ } -int main(int argc, char **argv) +int main(int argc, char* const* argv) { pst_desc_ll *d_ptr; char *fname = NULL;
--- a/src/pst2ldif.cpp Fri Jan 16 15:31:11 2009 -0800 +++ b/src/pst2ldif.cpp Sat Jan 31 12:12:36 2009 -0800 @@ -26,8 +26,8 @@ #include "iconv.h" } -int32_t usage(); -int32_t version(); +void usage(void); +void version(void); char *check_filename(char *fname); void print_ldif_single(const char *attr, const char *value); void print_ldif_address(const char *attr, int nvalues, char *value, ...); @@ -547,7 +547,7 @@ } -int main(int argc, char** argv) { +int main(int argc, char* const* argv) { pst_desc_ll *d_ptr; char *fname = NULL; int c; @@ -657,7 +657,7 @@ } -int32_t usage() { +void usage(void) { version(); printf("Usage: %s [OPTIONS] {PST FILENAME}\n", prog_name); printf("OPTIONS:\n"); @@ -669,11 +669,10 @@ printf("\t-h\t- Help. This screen\n"); printf("\t-l line\t- extra line to insert in the LDIF file for each contact\n"); printf("\t-o\t- use old schema, default is new schema\n"); - return 0; } -int32_t version() { +void version(void) { printf("pst2ldif v%s\n", VERSION); #if BYTE_ORDER == BIG_ENDIAN printf("Big Endian implementation being used.\n"); @@ -685,7 +684,6 @@ #ifdef __GNUC__ printf("GCC %d.%d : %s %s\n", __GNUC__, __GNUC_MINOR__, __DATE__, __TIME__); #endif - return 0; }
--- a/src/readpst.c Fri Jan 16 15:31:11 2009 -0800 +++ b/src/readpst.c Sat Jan 31 12:12:36 2009 -0800 @@ -33,8 +33,8 @@ void process(pst_item *outeritem, pst_desc_ll *d_ptr); void write_email_body(FILE *f, char *body); char* removeCR (char *c); -int usage(); -int version(); +void usage(); +void version(); char* mk_kmail_dir(char*); int close_kmail_dir(); char* mk_recurse_dir(char*); @@ -54,7 +54,7 @@ void create_enter_dir(struct file_ll* f, pst_item *item); void close_enter_dir(struct file_ll *f); -char* prog_name; +const char* prog_name; char* output_dir = "."; char* kmail_chdir = NULL; @@ -219,7 +219,7 @@ -int main(int argc, char** argv) { +int main(int argc, char* const* argv) { pst_item *item = NULL; pst_desc_ll *d_ptr; char * fname = NULL; @@ -416,7 +416,7 @@ } -int usage() { +void usage() { DEBUG_ENT("usage"); version(); printf("Usage: %s [OPTIONS] {PST FILENAME}\n", prog_name); @@ -436,11 +436,10 @@ printf("\t-r\t- Recursive. Output in a recursive format\n"); printf("\t-w\t- Overwrite any output mbox files\n"); DEBUG_RET(); - return 0; } -int version() { +void version() { DEBUG_ENT("version"); printf("ReadPST / LibPST v%s\n", VERSION); #if BYTE_ORDER == BIG_ENDIAN @@ -454,7 +453,6 @@ printf("GCC %d.%d : %s %s\n", __GNUC__, __GNUC_MINOR__, __DATE__, __TIME__); #endif DEBUG_RET(); - return 0; }
--- a/src/readpstlog.c Fri Jan 16 15:31:11 2009 -0800 +++ b/src/readpstlog.c Sat Jan 31 12:12:36 2009 -0800 @@ -2,12 +2,12 @@ #define BUF_SIZE 4096 -int usage(); +void usage(); size_t get(void * buf, int size, unsigned int count, FILE *fp); int split_args(char *args, int **targ); int is_in(int a, int *b, int c); -int main(int argc, char** argv) { +int main(int argc, char* const* argv) { int identity = 0; int level = 0; int x, ptr, stop=0, flag; @@ -190,7 +190,7 @@ return z; } -int usage() { +void usage() { printf("readlog -t[show_type] -x[exclude_type] -f[format] filename\n"); printf("\tformat:\n\t\tt: text log format\n"); printf("\t\ti: indented text log format\n"); @@ -198,7 +198,6 @@ "[ie, 2,4,1,6]\n"); printf("\texclude_type:\n\t\tcomma separated list of types to exclude " "[ie, 1,5,3,7]\n"); - return 0; }
--- a/src/testdebug.c Fri Jan 16 15:31:11 2009 -0800 +++ b/src/testdebug.c Sat Jan 31 12:12:36 2009 -0800 @@ -4,7 +4,7 @@ #include <string.h> #define BUF_SIZE 100000 -int main() { +int main(int argc, const char** argv) { char *x = xmalloc(BUF_SIZE); // 10k memset(x, '.', BUF_SIZE-1); x[BUF_SIZE-2]='P';
--- a/src/timeconv.c Fri Jan 16 15:31:11 2009 -0800 +++ b/src/timeconv.c Sat Jan 31 12:12:36 2009 -0800 @@ -11,7 +11,11 @@ * Do not use this one */ +#ifndef _WIN32 + #include <time.h> +#include "define.h" +#include "common.h" #include "timeconv.h" char * fileTimeToAscii (const FILETIME *filetime) { @@ -121,3 +125,5 @@ return ((((time_t)a2) << 16) << 16) + (a1 << 16) + a0; #endif } + +#endif /* !_WIN32 */
--- a/src/timeconv.h Fri Jan 16 15:31:11 2009 -0800 +++ b/src/timeconv.h Sat Jan 31 12:12:36 2009 -0800 @@ -1,8 +1,6 @@ #ifndef __TIMECONV_H #define __TIMECONV_H -#include "common.h" - #include <time.h> #ifdef __cplusplus @@ -13,7 +11,7 @@ char * fileTimeToAscii (const FILETIME *filetime); struct tm * fileTimeToStructTM (const FILETIME *filetime); - + #ifdef __cplusplus } #endif
--- a/src/version.h.in Fri Jan 16 15:31:11 2009 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -#define VERSION "@VERSION@"
--- a/xml/libpst.in Fri Jan 16 15:31:11 2009 -0800 +++ b/xml/libpst.in Sat Jan 31 12:12:36 2009 -0800 @@ -3,11 +3,6 @@ <partintro> <title>Packages</title> - <para>This is a fork of the libpst project at SourceForge. Another fork - is located at <ulink - url="http://alioth.debian.org/projects/libpst/">http://alioth.debian.org/projects/libpst/</ulink> - </para> - <para>The various source and binary packages are available at <ulink url="http://www.five-ten-sg.com/@PACKAGE@/packages/">http://www.five-ten-sg.com/@PACKAGE@/packages/</ulink>. The most recent documentation is available at <ulink @@ -33,7 +28,7 @@ <refentry id="readpst.1"> <refentryinfo> - <date>2008-10-09</date> + <date>2009-01-25</date> </refentryinfo> <refmeta> @@ -233,7 +228,7 @@ <refentry id="lspst.1"> <refentryinfo> - <date>2008-10-09</date> + <date>2009-01-25</date> </refentryinfo> <refmeta> @@ -336,7 +331,7 @@ <refentry id="readpstlog.1"> <refentryinfo> - <date>2008-10-09</date> + <date>2009-01-25</date> </refentryinfo> <refmeta> @@ -520,7 +515,7 @@ <refentry id="pst2ldif.1"> <refentryinfo> - <date>2008-10-09</date> + <date>2009-01-25</date> </refentryinfo> <refmeta> @@ -696,7 +691,7 @@ <refentry id="pst2dii.1"> <refentryinfo> - <date>2008-10-09</date> + <date>2009-01-25</date> </refentryinfo> <refmeta> @@ -830,7 +825,7 @@ <refentry id="pst.5"> <refentryinfo> - <date>2008-10-09</date> + <date>2009-01-25</date> </refentryinfo> <refmeta> @@ -910,12 +905,14 @@ 00bc offsetIndex2 [4 bytes] 0x0c7e00 in this case ]]></literallayout> <para> - We only support index types 0x0e and 0x17, and encryption types + We only support index types 0x0e, 0x0f, and 0x17, and encryption types 0x00, 0x01 and 0x02. Index type 0x0e is the older 32 bit Outlook format. + Index type 0x0f seems to be rare, and so far the data seems to be + identical to that in type 0x0e files. Index type 0x17 is the newer 64 bit Outlook format. Encryption type 0x00 is no encryption, type 0x01 is "compressible" encryption which is a simple substitution cipher, and type 0x02 is "strong" - encryption, which seems to be related to a three rotor Enigma cipher. + encryption, which is a simple three rotor Enigma cipher from WWII. </para> <para> offsetIndex1 is the file offset of the root of the