changeset 114:e213bfcf9aa7 stable-0-6-24

patch from Chris Eagle to build on cygwin
author Carl Byington <carl@five-ten-sg.com>
date Thu, 11 Dec 2008 11:58:22 -0800
parents f04499f1ef90
children 7689c006b166
files AUTHORS ChangeLog NEWS configure.in libpst.spec.in src/libpst.c src/pst2ldif.cpp
diffstat 7 files changed, 44 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/AUTHORS	Thu Dec 04 10:46:42 2008 -0800
+++ b/AUTHORS	Thu Dec 11 11:58:22 2008 -0800
@@ -23,3 +23,4 @@
     Bharath Acharya <abharath@novell.com>
     Robert Harris <robert.f.harris@blueyonder.co.uk>
     David Cuadrado <krawek@gmail.com>
+    Chris Eagle <cseagle@redshift.com>
--- a/ChangeLog	Thu Dec 04 10:46:42 2008 -0800
+++ b/ChangeLog	Thu Dec 11 11:58:22 2008 -0800
@@ -1,3 +1,7 @@
+LibPST 0.6.24 (2008-12-11)
+===============================
+        * patch from Chris Eagle to build on cygwin
+
 LibPST 0.6.23 (2008-12-04)
 ===============================
         * bump version to avoid cvs tagging mistake in fedora
--- a/NEWS	Thu Dec 04 10:46:42 2008 -0800
+++ b/NEWS	Thu Dec 11 11:58:22 2008 -0800
@@ -1,3 +1,4 @@
+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
 0.6.22  2008-11-28 process emails with type PST_TYPE_OTHER, fix malloc error and possible segfault
 0.6.21  2008-10-21 fix title bug with old schema in pst2ldif, also escape commas in distinguished names per rfc4514.
--- a/configure.in	Thu Dec 04 10:46:42 2008 -0800
+++ b/configure.in	Thu Dec 11 11:58:22 2008 -0800
@@ -1,5 +1,5 @@
 AC_PREREQ(2.59)
-AC_INIT(libpst,0.6.23,carl@five-ten-sg.com)
+AC_INIT(libpst,0.6.24,carl@five-ten-sg.com)
 AC_CONFIG_SRCDIR([config.h.in])
 AC_CONFIG_HEADER([config.h])
 
@@ -88,6 +88,31 @@
     AC_MSG_WARN([This should be building on Mac OSX, adding /usr/lib to the library path])
 fi
 
+AC_MSG_CHECKING([if iconv uses const arguments])
+AC_LANG_PUSH([C++])
+AC_COMPILE_IFELSE([
+        #include <iconv.h>
+        int main(int argc, char **argv)
+        {
+            size_t  inlen = 100;
+            char buffer[[inlen]];
+            char *p = buffer;
+            size_t utf8_len = 2 * inlen + 1;
+            char utf8_buffer[[utf8_len]];
+            char *utf8_p = utf8_buffer;
+            iconv_t cd = 0;
+            iconv(cd, (const char**)&p, &inlen, &utf8_p, &utf8_len);
+        }
+    ],
+    [AC_DEFINE(ICONV_CONST,const,[do we have const headers])
+     AC_MSG_RESULT([yes])
+    ],
+    [AC_DEFINE(ICONV_CONST,,[do we have const headers])
+     AC_MSG_RESULT([no])
+    ])
+AC_LANG_POP([C++])
+
+
 # The following lines adds the --enable-pst-debug option to configure:
 #
 # Give the user the choice to enter one of these:
--- a/libpst.spec.in	Thu Dec 04 10:46:42 2008 -0800
+++ b/libpst.spec.in	Thu Dec 11 11:58:22 2008 -0800
@@ -47,6 +47,9 @@
 
 
 %changelog
+* Thu Dec 11 2008 Carl Byington <carl@five-ten-sg.com> - 0.6.24-1
+- patch from Chris Eagle to build on cygwin
+
 * Thu Dec 04 2008 Carl Byington <carl@five-ten-sg.com> - 0.6.23-1
 - bump version to avoid cvs tagging mistake in fedora
 
--- a/src/libpst.c	Thu Dec 04 10:46:42 2008 -0800
+++ b/src/libpst.c	Thu Dec 11 11:58:22 2008 -0800
@@ -493,8 +493,7 @@
 
 
 typedef struct pst_x_attrib {
-    uint16_t extended;
-    uint16_t zero;
+    uint32_t extended;
     uint16_t type;
     uint16_t map;
 } pst_x_attrib;
@@ -560,8 +559,7 @@
     }
 
     memcpy(&xattrib, &(buffer[bptr]), sizeof(xattrib));
-    LE16_CPU(xattrib.extended);
-    LE16_CPU(xattrib.zero);
+    LE32_CPU(xattrib.extended);
     LE16_CPU(xattrib.type);
     LE16_CPU(xattrib.map);
     bptr += sizeof(xattrib);
@@ -572,8 +570,8 @@
         ptr->type = xattrib.type;
         ptr->map  = xattrib.map+0x8000;
         ptr->next = NULL;
-        DEBUG_INDEX(("xattrib: ext = %#hx, zero = %#hx, type = %#hx, map = %#hx\n",
-             xattrib.extended, xattrib.zero, xattrib.type, xattrib.map));
+        DEBUG_INDEX(("xattrib: ext = %#x, type = %#hx, map = %#hx\n",
+             xattrib.extended, xattrib.type, xattrib.map));
         err=0;
         if (xattrib.type & 0x0001) { // if the Bit 1 is set
             // pointer to Unicode field in buffer
@@ -623,8 +621,7 @@
             ptr = NULL;
         }
         memcpy(&xattrib, &(buffer[bptr]), sizeof(xattrib));
-        LE16_CPU(xattrib.extended);
-        LE16_CPU(xattrib.zero);
+        LE32_CPU(xattrib.extended);
         LE16_CPU(xattrib.type);
         LE16_CPU(xattrib.map);
         bptr += sizeof(xattrib);
--- a/src/pst2ldif.cpp	Thu Dec 04 10:46:42 2008 -0800
+++ b/src/pst2ldif.cpp	Thu Dec 11 11:58:22 2008 -0800
@@ -371,7 +371,7 @@
 
         iconv(cd, NULL, NULL, NULL, NULL);
         p = buffer;
-        int ret = iconv(cd, &p, &inlen, &utf8_p, &utf8_len);
+        int ret = iconv(cd, (ICONV_CONST char**)&p, &inlen, &utf8_p, &utf8_len);
 
         if (ret >= 0) {
             *utf8_p = 0;
@@ -657,7 +657,7 @@
 }
 
 
-int usage() {
+int32_t usage() {
     version();
     printf("Usage: %s [OPTIONS] {PST FILENAME}\n", prog_name);
     printf("OPTIONS:\n");
@@ -673,7 +673,7 @@
 }
 
 
-int version() {
+int32_t version() {
     printf("pst2ldif v%s\n", VERSION);
 #if BYTE_ORDER == BIG_ENDIAN
     printf("Big Endian implementation being used.\n");
@@ -745,7 +745,7 @@
         utf8_buffer = (char *)malloc(utf8_len);
         utf8_p = utf8_buffer;
         iconv(cd, NULL, NULL, NULL, NULL);
-        if (iconv(cd, &p, &inlen, &utf8_p, &utf8_len) >= 0) {
+        if (iconv(cd, (ICONV_CONST char**)&p, &inlen, &utf8_p, &utf8_len) >= 0) {
             *utf8_p = 0;
             value = utf8_buffer;
         }