Load /tmp/tmp.NkkSUd/mimetic-0.9.1 into upstream/0.9.1
authorgregor herrmann <gregoa@debian.org>
Sun, 16 Apr 2006 12:18:02 +0000 (12:18 -0000)
committergregor herrmann <gregoa@debian.org>
Sun, 16 Apr 2006 12:18:02 +0000 (12:18 -0000)
debian/mimetic/branches/upstream/current.

18 files changed:
ChangeLog
configure
configure.in
examples/Makefile.in
mimetic/Makefile.in
mimetic/body.h
mimetic/codec/Makefile.in
mimetic/codec/base64.h
mimetic/codec/codec_base.h
mimetic/codec/qp.h
mimetic/config.h
mimetic/os/directory.h
mimetic/os/mmfile.cxx
mimetic/parser/itparser.h
mimetic/rfc822/Makefile.in
mimetic/rfc822/messageid.h
mimetic/utils.h
test/Makefile.in

index 818ad0892f2807fd2f23b8364191141260648e32..500bc5b604fff2c94585aa68d3d4122ea91fa89c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+x.x.x, 0.9.2
+       - Solaris compatibility fixes (thanks to Shan Will)
+
+10.04.2006, 0.9.1
+       - utils.h: gcc 4.1 compatibility fix
+       - assert() on malformed quoted-printable messages removed
+
+12.03.2006, 0.9.0
+       - Body::load optimization (thanks to Jorge Ortiz Claver)
+       - InIt copy_until_boundary fix (thanks to Harald Gering)
+       - fixes to let it build on Solaris (thanks to Shan Will)
+
 07.03.2005, 0.8.9
        - thread-safe MessageId
        - always use CRLF (instead of '\n') on write functions
index 9fd7beeef80ce8cb009a144c6e1e50ad865e13f1..70ef0b72272e4561bcaddcd63cb40da4d3ac2970 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 1.29 .
+# From configure.in Revision: 1.32 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.59.
 #
@@ -1778,7 +1778,7 @@ fi
 
 PACKAGE=mimetic
 
-VERSION=0.8.9
+VERSION=0.9.1
 
 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
   { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
 done
 
 
+for ac_header in stdint.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
 
 
 
index 2d29680a13b55c766c30f52c5d9ee7a6d70bd81b..d58da24da9288d5b4b57566681fb6b13f088a1b9 100644 (file)
@@ -1,9 +1,9 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_REVISION($Revision: 1.29 $)
+AC_REVISION($Revision: 1.32 $)
 AC_INIT(mimetic/mimetic.h)
 AC_CANONICAL_SYSTEM
 
-AM_INIT_AUTOMAKE(mimetic,0.8.9)
+AM_INIT_AUTOMAKE(mimetic,0.9.1)
 AM_CONFIG_HEADER(mimetic/config.h)
 
 dnl Checks for programs.
@@ -172,6 +172,7 @@ AC_TYPE_UID_T
 
 AC_HEADER_DIRENT
 AC_CHECK_HEADERS(sys/time.h)
+AC_CHECK_HEADERS(stdint.h)
 
 AC_SUBST(PACKAGE)
 AC_SUBST(VERSION)
index aadce3f1658d045482cf5e263aeaeeb4b93c8189..55852386cafe26882848347fb73ac261aaaa4e98 100644 (file)
@@ -319,54 +319,6 @@ distdir: $(DISTFILES)
            || cp -p $$d/$$file $(distdir)/$$file || :; \
          fi; \
        done
-exbin.o: exbin.cxx ../mimetic/mimetic.h ../mimetic/libconfig.h \
-       ../mimetic/config.h ../mimetic/version.h ../mimetic/body.h \
-       ../mimetic/rfc822/body.h ../mimetic/codec/code.h \
-       ../mimetic/codec/codec_base.h ../mimetic/codec/codec_chain.h \
-       ../mimetic/codec/other_codecs.h ../mimetic/utils.h \
-       ../mimetic/strutils.h ../mimetic/mimeentitylist.h \
-       ../mimetic/os/file.h ../mimetic/os/stdfile.h \
-       ../mimetic/os/fileop.h ../mimetic/os/file_iterator.h \
-       ../mimetic/os/mmfile.h ../mimetic/circular_buffer.h \
-       ../mimetic/contentdescription.h ../mimetic/rfc822/fieldvalue.h \
-       ../mimetic/contentdisposition.h ../mimetic/fieldparam.h \
-       ../mimetic/contenttransferencoding.h ../mimetic/contenttype.h \
-       ../mimetic/header.h ../mimetic/rfc822/header.h \
-       ../mimetic/rfc822/field.h ../mimetic/rfc822/mailbox.h \
-       ../mimetic/rfc822/messageid.h ../mimetic/os/utils.h \
-       ../mimetic/rfc822/mailboxlist.h ../mimetic/rfc822/addresslist.h \
-       ../mimetic/rfc822/address.h ../mimetic/rfc822/group.h \
-       ../mimetic/mimeversion.h ../mimetic/contentid.h \
-       ../mimetic/message.h ../mimetic/mimeentity.h \
-       ../mimetic/codec/codec.h ../mimetic/codec/base64.h \
-       ../mimetic/codec/qp.h ../mimetic/parser/itparserdecl.h \
-       ../mimetic/streambufs.h ../mimetic/tokenizer.h \
-       ../mimetic/os/os.h ../mimetic/parser/itparser.h \
-       ../mimetic/tree.h
-structure.o: structure.cxx ../mimetic/config.h ../mimetic/mimetic.h \
-       ../mimetic/libconfig.h ../mimetic/config.h ../mimetic/version.h \
-       ../mimetic/body.h ../mimetic/rfc822/body.h \
-       ../mimetic/codec/code.h ../mimetic/codec/codec_base.h \
-       ../mimetic/codec/codec_chain.h ../mimetic/codec/other_codecs.h \
-       ../mimetic/utils.h ../mimetic/strutils.h \
-       ../mimetic/mimeentitylist.h ../mimetic/os/file.h \
-       ../mimetic/os/stdfile.h ../mimetic/os/fileop.h \
-       ../mimetic/os/file_iterator.h ../mimetic/os/mmfile.h \
-       ../mimetic/circular_buffer.h ../mimetic/contentdescription.h \
-       ../mimetic/rfc822/fieldvalue.h ../mimetic/contentdisposition.h \
-       ../mimetic/fieldparam.h ../mimetic/contenttransferencoding.h \
-       ../mimetic/contenttype.h ../mimetic/header.h \
-       ../mimetic/rfc822/header.h ../mimetic/rfc822/field.h \
-       ../mimetic/rfc822/mailbox.h ../mimetic/rfc822/messageid.h \
-       ../mimetic/os/utils.h ../mimetic/rfc822/mailboxlist.h \
-       ../mimetic/rfc822/addresslist.h ../mimetic/rfc822/address.h \
-       ../mimetic/rfc822/group.h ../mimetic/mimeversion.h \
-       ../mimetic/contentid.h ../mimetic/message.h \
-       ../mimetic/mimeentity.h ../mimetic/codec/codec.h \
-       ../mimetic/codec/base64.h ../mimetic/codec/qp.h \
-       ../mimetic/parser/itparserdecl.h ../mimetic/streambufs.h \
-       ../mimetic/tokenizer.h ../mimetic/os/os.h \
-       ../mimetic/parser/itparser.h ../mimetic/tree.h
 
 info-am:
 info: info-am
index 2add3bb4b130526706b516734c61a7ac2bc2f1d0..dc905696d2e4f322d450e08c6e41eaee2d03b593 100644 (file)
@@ -394,7 +394,7 @@ body.lo body.o : body.cxx mimeentity.h strutils.h utils.h libconfig.h \
        codec/code.h codec/other_codecs.h os/file.h os/stdfile.h \
        os/fileop.h os/file_iterator.h os/mmfile.h header.h \
        rfc822/header.h rfc822/field.h rfc822/mailbox.h \
-       rfc822/messageid.h os/utils.h rfc822/mailboxlist.h \
+       rfc822/messageid.h config.h os/utils.h rfc822/mailboxlist.h \
        rfc822/addresslist.h rfc822/address.h rfc822/group.h \
        contentid.h contentdescription.h body.h rfc822/body.h \
        parser/itparserdecl.h streambufs.h
@@ -415,7 +415,7 @@ fieldparam.lo fieldparam.o : fieldparam.cxx fieldparam.h strutils.h \
        utils.h libconfig.h config.h
 header.lo header.o : header.cxx header.h rfc822/header.h strutils.h \
        utils.h libconfig.h config.h rfc822/field.h rfc822/fieldvalue.h \
-       rfc822/mailbox.h rfc822/messageid.h os/utils.h \
+       rfc822/mailbox.h rfc822/messageid.h config.h os/utils.h \
        rfc822/mailboxlist.h rfc822/addresslist.h rfc822/address.h \
        rfc822/group.h mimeversion.h version.h contenttype.h \
        fieldparam.h contentid.h contenttransferencoding.h \
@@ -428,10 +428,11 @@ message.lo message.o : message.cxx message.h libconfig.h config.h \
        codec/base64.h circular_buffer.h codec/qp.h codec/code.h \
        codec/other_codecs.h os/file.h os/stdfile.h os/fileop.h \
        os/file_iterator.h os/mmfile.h header.h rfc822/header.h \
-       rfc822/field.h rfc822/mailbox.h rfc822/messageid.h os/utils.h \
-       rfc822/mailboxlist.h rfc822/addresslist.h rfc822/address.h \
-       rfc822/group.h contentid.h contentdescription.h body.h \
-       rfc822/body.h parser/itparserdecl.h streambufs.h
+       rfc822/field.h rfc822/mailbox.h rfc822/messageid.h config.h \
+       os/utils.h rfc822/mailboxlist.h rfc822/addresslist.h \
+       rfc822/address.h rfc822/group.h contentid.h \
+       contentdescription.h body.h rfc822/body.h parser/itparserdecl.h \
+       streambufs.h
 mimeentity.lo mimeentity.o : mimeentity.cxx mimeentity.h strutils.h \
        utils.h libconfig.h config.h contenttype.h rfc822/fieldvalue.h \
        fieldparam.h contenttransferencoding.h contentdisposition.h \
@@ -440,7 +441,7 @@ mimeentity.lo mimeentity.o : mimeentity.cxx mimeentity.h strutils.h \
        circular_buffer.h codec/qp.h codec/code.h codec/other_codecs.h \
        os/file.h os/stdfile.h os/fileop.h os/file_iterator.h \
        os/mmfile.h header.h rfc822/header.h rfc822/field.h \
-       rfc822/mailbox.h rfc822/messageid.h os/utils.h \
+       rfc822/mailbox.h rfc822/messageid.h config.h os/utils.h \
        rfc822/mailboxlist.h rfc822/addresslist.h rfc822/address.h \
        rfc822/group.h contentid.h contentdescription.h body.h \
        rfc822/body.h parser/itparserdecl.h streambufs.h tokenizer.h \
index eb9ea72af23fe80830bc76521699a62268f25f0a..2bc5750bb75255eb318369310277b01b7e6853de 100644 (file)
@@ -2,7 +2,7 @@
     copyright            : (C) 2002-2005 by Stefano Barbato
     email                : stefano@codesink.org
 
-    $Id: body.h,v 1.14 2005/02/23 10:26:14 tat Exp $
+    $Id: body.h,v 1.15 2006/03/12 12:04:36 tat Exp $
  ***************************************************************************/
 
 /***************************************************************************
@@ -16,6 +16,7 @@
 #ifndef _MIMETIC_BODY_H_
 #define _MIMETIC_BODY_H_
 #include <string>
+#include <math.h>
 #include <mimetic/rfc822/body.h>
 #include <mimetic/codec/code.h>
 #include <mimetic/mimeentitylist.h>
@@ -108,8 +109,19 @@ bool Body::load(const std::string& fqn, const Codec& cc)
     File in(fqn);
     if(!in)
         return false;
+
     File::iterator beg = in.begin(), end = in.end();
     Codec codec(cc);
+
+    if(codec.codeSizeMultiplier() > 1.0)
+    {
+        /* increase body string size */
+        struct stat st;
+        if(::stat(fqn.c_str(), &st))
+            return false;
+        reserve((size_type)(::ceil(st.st_size * codec.codeSizeMultiplier())));
+    }
+
     mimetic::code(beg, end, codec, back_inserter(*this) );
     return true;
 }
@@ -121,6 +133,10 @@ bool Body::code(const Codec& cc)
     // OPTIMIZE
     std::string coded;
     Codec codec(cc);
+
+    if(codec.codeSizeMultiplier() > 1.0)
+        coded.reserve((size_type)::ceil(size() * codec.codeSizeMultiplier()));
+
     mimetic::code(begin(), end(), cc, back_inserter(coded) );
     this->assign(coded);
     return true;
index 7436674a5aa6c2b5baa84751bb1b25b7f57be3ee..7b8aa344be4416ad23eac1cd81251d028ef671ae 100644 (file)
@@ -263,7 +263,8 @@ distdir: $(DISTFILES)
 base64.lo base64.o : base64.cxx base64.h ../../mimetic/circular_buffer.h \
        codec_base.h codec_chain.h
 qp.lo qp.o : qp.cxx qp.h ../../mimetic/libconfig.h \
-       ../../mimetic/config.h ../../mimetic/circular_buffer.h \
+       ../../mimetic/config.h ../../mimetic/utils.h \
+       ../../mimetic/strutils.h ../../mimetic/circular_buffer.h \
        codec_base.h codec_chain.h
 
 info-am:
index 05304d242f4d0d78555bd06afba23210b89ca788..3e5e02c93f1ac1e825585a43a5cafc91f3e649f4 100644 (file)
@@ -2,7 +2,7 @@
     copyright            : (C) 2002-2005 by Stefano Barbato
     email                : stefano@codesink.org
 
-    $Id: base64.h,v 1.13 2005/02/24 11:51:10 tat Exp $
+    $Id: base64.h,v 1.14 2006/03/12 12:04:36 tat Exp $
  ***************************************************************************/
 
 /***************************************************************************
@@ -84,6 +84,12 @@ class Encoder: public buffered_codec, public chainable_codec<Encoder>
         }
     }
 public:
+    /*! return the multiplier of the required (max) size of the output buffer 
+     * when encoding */
+    double codeSizeMultiplier() const
+    {
+        return 1.5;
+    }
     /*! Constructor, maxlen is the maximum length of every encoded line */
     Encoder(int maxlen = default_maxlen)
     : m_cidx(0), m_pos(1), m_maxlen(maxlen)
index 9826cd71abc62c087277e2bcc7d8df89e12f4aa1..5dc0a3f21bb9b93f46bbe8bfe2ed62b2de34d823 100644 (file)
@@ -2,7 +2,7 @@
     copyright            : (C) 2002-2005 by Stefano Barbato
     email                : stefano@codesink.org
 
-    $Id: codec_base.h,v 1.11 2005/02/23 10:26:15 tat Exp $
+    $Id: codec_base.h,v 1.12 2006/03/12 12:04:36 tat Exp $
  ***************************************************************************/
 
 /***************************************************************************
@@ -34,6 +34,10 @@ struct codec
     typedef unsigned char char_type;
     virtual ~codec() {}
     virtual const char* name() const = 0;
+
+    /*! return the multiplier of the required (max) size of the output buffer 
+     * when encoding */
+    virtual double codeSizeMultiplier() const { return 1.0; }
 };
 
 
index 11a2f0a7645c71f9ed2bc0f40b2bfe9b9f1b5fa7..e8cae69ddf3384bc8174b0e0f5be3d2ad4578a6f 100644 (file)
@@ -2,7 +2,7 @@
     copyright            : (C) 2002-2005 by Stefano Barbato
     email                : stefano@codesink.org
 
-    $Id: qp.h,v 1.16 2005/02/23 11:48:15 tat Exp $
+    $Id: qp.h,v 1.19 2006/04/10 09:43:50 tat Exp $
  ***************************************************************************/
 
 /***************************************************************************
@@ -20,6 +20,7 @@
 #include <sstream>
 #include <cassert>
 #include <mimetic/libconfig.h>
+#include <mimetic/utils.h>
 #include <mimetic/circular_buffer.h>
 #include <mimetic/codec/codec_base.h>
 #include <mimetic/codec/codec_chain.h>
@@ -150,6 +151,15 @@ class Encoder: public buffered_codec, public chainable_codec<Encoder>
         }
     }
 public:
+    /*! return the multiplier of the required (max) size of the output buffer 
+     * when encoding */
+    double codeSizeMultiplier() const
+    {
+        // worse case is *3 but we'll use the (euristic) average value of 1.5.
+        // this may decrease performance when encoding messages with many 
+        // non-ASCII (> 127) characters 
+        return 1.5;
+    }
     /*!
      Constructor
      \param isBinary if true all space and newline characters will be
@@ -467,7 +477,7 @@ public:
         {
             if(len == 1)
             {
-                assert(m_prev[0] == '=');
+                /* malformed if m_prev[0] == '=' */
                 write('=', out);
             } else {
                 write('=', out);
index 959d5b16ceae1ff7cc2f3f05e0d29de88e603a7a..9450b049a64539a9f9501725b7da39a0704b3da7 100644 (file)
@@ -80,7 +80,7 @@
 #define STDC_HEADERS 1
 
 /* Version number of package */
-#define VERSION "0.8.9"
+#define VERSION "0.9.1"
 
 /* Define to `int' if <sys/types.h> doesn't define. */
 /* #undef gid_t */
index e7f23dd91876b6a7ba48d126d8d632c83c90e034..9ff86cfcb6f51d802fcf72480221ba147fc391c4 100644 (file)
@@ -2,7 +2,10 @@
 #define _MIMETIC_OS_DIRECTORY_H_
 #include <string>
 #include <iterator>
+#include <mimetic/config.h>
+#ifdef HAVE_DIRENT_H
 #include <dirent.h>
+#endif
 #include <unistd.h>
 #include <sys/stat.h>
 
@@ -79,7 +82,9 @@ public:
             m_eoi == right.m_eoi &&
             m_dirp->m_path == right.m_dirp->m_path &&
             m_dirent && right.m_dirent &&
+            #ifdef _DIRENT_HAVE_D_TYPE
             m_dirent->d_type == right.m_dirent->d_type &&
+            #endif
             std::string(m_dirent->d_name) == right.m_dirent->d_name;
         }
         bool operator!=(const iterator& right)
@@ -90,6 +95,8 @@ public:
         void setDirent(struct dirent* dent)
         {
             m_de.name = dent->d_name;
+            m_de.type = DirEntry::Unknown;
+            #ifdef _DIRENT_HAVE_D_TYPE
             switch(dent->d_type)
             {
             case DT_DIR:
@@ -101,9 +108,8 @@ public:
             case DT_LNK:
                 m_de.type = DirEntry::Link;
                 break;
-            default:
-                m_de.type = DirEntry::Unknown;
             }
+            #endif
         }
         Directory* m_dirp;
         DIR* m_dirh;
index 70facfe64e438e31506fec33b34a5d828038f10f..709a7aed5db35c95238e86016b873c840f320fa0 100644 (file)
@@ -2,7 +2,7 @@
     copyright            : (C) 2002-2005 by Stefano Barbato
     email                : stefano@codesink.org
 
-    $Id: mmfile.cxx,v 1.2 2005/02/23 10:26:15 tat Exp $
+    $Id: mmfile.cxx,v 1.4 2006/04/11 10:04:58 tat Exp $
  ***************************************************************************/
 
 /***************************************************************************
@@ -15,6 +15,7 @@
  ***************************************************************************/
 #include <sys/stat.h>
 #include <sys/types.h>
+#include <sys/mman.h>
 #include <unistd.h>
 #include <assert.h>
 #include <time.h>
@@ -25,7 +26,6 @@
 
 using namespace std;
 
-
 namespace mimetic
 {
 
index e91e3a78c12081428c8c160cbfd0713bcd1f6943..b2773fae110cd8769955fcd0715c477f6b2c7fbf 100644 (file)
@@ -482,13 +482,21 @@ protected:
             c = *m_bit;
             if(isnl(c))
             {
-                // eat the second char of the NL sequence(ifany)
+                char nlbuf[3] = { 0, 0, 0 };
+
+                nlbuf[0] = c; // save the current NL char in nlbuf
+
+                // save the second char of the NL sequence (if any) in nlbuf
                 if(++m_bit != m_eit) 
                 {
                     char next = *m_bit;
                     if(next == (c == CR ? LF : CR))
+                    {
+                        nlbuf[1] = next; // save the next char in the NL seq
                         ++m_bit;
+                    }
                 }
+
                 if(pos)
                 {
                     // not an empty row, is this a boundary?
@@ -530,9 +538,9 @@ protected:
                         }
                     }
                 }
-                // append a new line
-                for(int i = 0; nl[i] != 0; i++)
-                    block[blkpos++] = nl[i];
+                // append the saved NL sequence
+                for(int i = 0; nlbuf[i] != 0; i++)
+                    block[blkpos++] = nlbuf[i];
                 block[blkpos] = 0;
                 sl_off = blkpos;
                 pos = 0;
index 13580c1d9d36e1402277569827cc634760f91b7a..2ed72adcd567754e44bc1c1398b1d417557e2e8e 100644 (file)
@@ -282,8 +282,8 @@ group.lo group.o : group.cxx group.h mailbox.h fieldvalue.h \
 header.lo header.o : header.cxx header.h ../../mimetic/strutils.h \
        ../../mimetic/utils.h ../../mimetic/libconfig.h \
        ../../mimetic/config.h field.h fieldvalue.h mailbox.h \
-       messageid.h ../../mimetic/os/utils.h mailboxlist.h \
-       addresslist.h address.h group.h
+       messageid.h ../../mimetic/config.h ../../mimetic/os/utils.h \
+       mailboxlist.h addresslist.h address.h group.h
 mailbox.lo mailbox.o : mailbox.cxx mailbox.h fieldvalue.h \
        ../../mimetic/strutils.h
 mailboxlist.lo mailboxlist.o : mailboxlist.cxx mailboxlist.h \
@@ -293,12 +293,13 @@ mailboxlist.lo mailboxlist.o : mailboxlist.cxx mailboxlist.h \
 message.lo message.o : message.cxx message.h header.h \
        ../../mimetic/strutils.h ../../mimetic/utils.h \
        ../../mimetic/libconfig.h ../../mimetic/config.h field.h \
-       fieldvalue.h mailbox.h messageid.h ../../mimetic/os/utils.h \
-       mailboxlist.h addresslist.h address.h group.h body.h
+       fieldvalue.h mailbox.h messageid.h ../../mimetic/config.h \
+       ../../mimetic/os/utils.h mailboxlist.h addresslist.h address.h \
+       group.h body.h
 messageid.lo messageid.o : messageid.cxx messageid.h \
-       ../../mimetic/utils.h ../../mimetic/libconfig.h \
-       ../../mimetic/config.h ../../mimetic/strutils.h \
-       ../../mimetic/os/utils.h fieldvalue.h
+       ../../mimetic/config.h ../../mimetic/utils.h \
+       ../../mimetic/libconfig.h ../../mimetic/config.h \
+       ../../mimetic/strutils.h ../../mimetic/os/utils.h fieldvalue.h
 
 info-am:
 info: info-am
index 78ecb8fae85989156f46977f9ab8ec04d8a442fa..90784b74d3c4d4c3c33e77362fbd3930a12132a4 100644 (file)
@@ -2,7 +2,7 @@
     copyright            : (C) 2002-2005 by Stefano Barbato
     email                : stefano@codesink.org
 
-    $Id: messageid.h,v 1.11 2005/02/24 13:09:11 tat Exp $
+    $Id: messageid.h,v 1.13 2006/04/11 10:04:58 tat Exp $
  ***************************************************************************/
 
 /***************************************************************************
  ***************************************************************************/
 #ifndef _MIMETIC_MESSAGEID_H_
 #define _MIMETIC_MESSAGEID_H_
+#ifdef HAVE_STDINT_H
 #include <stdint.h>
+#endif
 #include <string>
+#include <mimetic/config.h>
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
 #include <mimetic/utils.h>
 #include <mimetic/os/utils.h>
 #include <mimetic/rfc822/fieldvalue.h>
index 50459a0d62db32b428660767c6ca1c5c93342186..1d4fcd24e442caeca7629c83af57bd80b3371f09 100644 (file)
@@ -2,7 +2,7 @@
     copyright            : (C) 2002-2005 by Stefano Barbato
     email                : stefano@codesink.org
 
-    $Id: utils.h,v 1.21 2005/03/07 15:35:08 tat Exp $
+    $Id: utils.h,v 1.22 2006/04/10 08:42:44 tat Exp $
  ***************************************************************************/
 
 /***************************************************************************
@@ -49,20 +49,6 @@ int str2int(const std::string& s);
 /// returns a string hexadecimal representation of \p n
 std::string int2hex(unsigned int n);
 
-// boyer-moore find 
-/**
- * find the first occurrence of \p word in (\p bit, \p eit]
- *
- * returns an Iterator pointing at the first character of the found pattern
- * or \p eit if the search fails
- */
-template<typename Iterator>
-Iterator find_bm(Iterator bit, Iterator eit, const std::string& word)
-{
-    return find_bm(bit, eit, word, 
-        typename std::iterator_traits<Iterator>::iterator_category());
-}
-
 // find_bm specialization for random access iterators
 template<typename Iterator>
 Iterator find_bm(Iterator bit, Iterator eit, const std::string& word, const std::random_access_iterator_tag&)
@@ -94,6 +80,20 @@ Iterator find_bm(Iterator bit, Iterator eit, const std::string& word, const std:
     return bit + i + 1;
 }
 
+// boyer-moore find 
+/**
+ * find the first occurrence of \p word in (\p bit, \p eit]
+ *
+ * returns an Iterator pointing at the first character of the found pattern
+ * or \p eit if the search fails
+ */
+template<typename Iterator>
+Iterator find_bm(Iterator bit, Iterator eit, const std::string& word)
+{
+    return find_bm(bit, eit, word, 
+        typename std::iterator_traits<Iterator>::iterator_category());
+}
+
 
 
 } // ns utils
index ec2e3010b8bfcc1f040a8917497109f101cb67cd..4b824baa900e65837efbfd70613d11c72195fb3e 100644 (file)
@@ -286,16 +286,15 @@ t.base64.cutee.o: t.base64.cutee.cxx cutee.h t.base64.h \
        ../mimetic/codec/codec.h ../mimetic/codec/codec_base.h \
        ../mimetic/codec/codec_chain.h ../mimetic/codec/base64.h \
        ../mimetic/circular_buffer.h ../mimetic/codec/qp.h \
-       ../mimetic/libconfig.h ../mimetic/config.h \
-       ../mimetic/codec/code.h ../mimetic/codec/other_codecs.h \
-       ../mimetic/utils.h ../mimetic/strutils.h
+       ../mimetic/libconfig.h ../mimetic/config.h ../mimetic/utils.h \
+       ../mimetic/strutils.h ../mimetic/codec/code.h \
+       ../mimetic/codec/other_codecs.h
 t.base64.o: t.base64.cxx t.base64.h ../mimetic/codec/codec.h \
        ../mimetic/codec/codec_base.h ../mimetic/codec/codec_chain.h \
        ../mimetic/codec/base64.h ../mimetic/circular_buffer.h \
        ../mimetic/codec/qp.h ../mimetic/libconfig.h \
-       ../mimetic/config.h ../mimetic/codec/code.h \
-       ../mimetic/codec/other_codecs.h ../mimetic/utils.h \
-       ../mimetic/strutils.h cutee.h
+       ../mimetic/config.h ../mimetic/utils.h ../mimetic/strutils.h \
+       ../mimetic/codec/code.h ../mimetic/codec/other_codecs.h cutee.h
 t.circular_buffer.cutee.o: t.circular_buffer.cutee.cxx cutee.h \
        t.circular_buffer.h ../mimetic/circular_buffer.h
 t.circular_buffer.o: t.circular_buffer.cxx t.circular_buffer.h cutee.h \
@@ -304,30 +303,30 @@ t.codec.cutee.o: t.codec.cutee.cxx cutee.h t.codec.h
 t.codec.o: t.codec.cxx ../mimetic/codec/base64.h \
        ../mimetic/circular_buffer.h ../mimetic/codec/codec_base.h \
        ../mimetic/codec/codec_chain.h ../mimetic/codec/qp.h \
-       ../mimetic/libconfig.h ../mimetic/config.h \
-       ../mimetic/codec/code.h ../mimetic/codec/other_codecs.h \
-       ../mimetic/utils.h ../mimetic/strutils.h t.codec.h cutee.h
+       ../mimetic/libconfig.h ../mimetic/config.h ../mimetic/utils.h \
+       ../mimetic/strutils.h ../mimetic/codec/code.h \
+       ../mimetic/codec/other_codecs.h t.codec.h cutee.h
 t.composite.cutee.o: t.composite.cutee.cxx cutee.h t.composite.h \
        ../mimetic/codec/codec.h ../mimetic/codec/codec_base.h \
        ../mimetic/codec/codec_chain.h ../mimetic/codec/base64.h \
        ../mimetic/circular_buffer.h ../mimetic/codec/qp.h \
-       ../mimetic/libconfig.h ../mimetic/config.h \
-       ../mimetic/codec/code.h ../mimetic/codec/other_codecs.h \
-       ../mimetic/utils.h ../mimetic/strutils.h
+       ../mimetic/libconfig.h ../mimetic/config.h ../mimetic/utils.h \
+       ../mimetic/strutils.h ../mimetic/codec/code.h \
+       ../mimetic/codec/other_codecs.h
 t.composite.o: t.composite.cxx t.composite.h ../mimetic/codec/codec.h \
        ../mimetic/codec/codec_base.h ../mimetic/codec/codec_chain.h \
        ../mimetic/codec/base64.h ../mimetic/circular_buffer.h \
        ../mimetic/codec/qp.h ../mimetic/libconfig.h \
-       ../mimetic/config.h ../mimetic/codec/code.h \
-       ../mimetic/codec/other_codecs.h ../mimetic/utils.h \
-       ../mimetic/strutils.h cutee.h
+       ../mimetic/config.h ../mimetic/utils.h ../mimetic/strutils.h \
+       ../mimetic/codec/code.h ../mimetic/codec/other_codecs.h cutee.h
 t.contenttype.cutee.o: t.contenttype.cutee.cxx cutee.h t.contenttype.h
 t.contenttype.o: t.contenttype.cxx ../mimetic/contenttype.h \
        ../mimetic/strutils.h ../mimetic/rfc822/fieldvalue.h \
        ../mimetic/fieldparam.h t.contenttype.h cutee.h
 t.directory.cutee.o: t.directory.cutee.cxx cutee.h t.directory.h \
-       ../mimetic/os/directory.h ../mimetic/os/fileop.h \
-       ../mimetic/utils.h ../mimetic/libconfig.h ../mimetic/config.h \
+       ../mimetic/os/directory.h ../mimetic/config.h \
+       ../mimetic/os/fileop.h ../mimetic/utils.h \
+       ../mimetic/libconfig.h ../mimetic/config.h \
        ../mimetic/strutils.h
 t.fieldparam.cutee.o: t.fieldparam.cutee.cxx cutee.h t.fieldparam.h \
        ../mimetic/fieldparam.h ../mimetic/strutils.h
@@ -358,15 +357,16 @@ t.mimemessage.cutee.o: t.mimemessage.cutee.cxx cutee.h t.mimemessage.h \
        ../mimetic/contenttype.h ../mimetic/header.h \
        ../mimetic/rfc822/header.h ../mimetic/rfc822/field.h \
        ../mimetic/rfc822/mailbox.h ../mimetic/rfc822/messageid.h \
-       ../mimetic/os/utils.h ../mimetic/rfc822/mailboxlist.h \
-       ../mimetic/rfc822/addresslist.h ../mimetic/rfc822/address.h \
-       ../mimetic/rfc822/group.h ../mimetic/mimeversion.h \
-       ../mimetic/contentid.h ../mimetic/message.h \
-       ../mimetic/mimeentity.h ../mimetic/codec/codec.h \
-       ../mimetic/codec/base64.h ../mimetic/codec/qp.h \
-       ../mimetic/parser/itparserdecl.h ../mimetic/streambufs.h \
-       ../mimetic/tokenizer.h ../mimetic/os/os.h \
-       ../mimetic/parser/itparser.h ../mimetic/tree.h
+       ../mimetic/config.h ../mimetic/os/utils.h \
+       ../mimetic/rfc822/mailboxlist.h ../mimetic/rfc822/addresslist.h \
+       ../mimetic/rfc822/address.h ../mimetic/rfc822/group.h \
+       ../mimetic/mimeversion.h ../mimetic/contentid.h \
+       ../mimetic/message.h ../mimetic/mimeentity.h \
+       ../mimetic/codec/codec.h ../mimetic/codec/base64.h \
+       ../mimetic/codec/qp.h ../mimetic/parser/itparserdecl.h \
+       ../mimetic/streambufs.h ../mimetic/tokenizer.h \
+       ../mimetic/os/os.h ../mimetic/parser/itparser.h \
+       ../mimetic/tree.h
 t.parser.cutee.o: t.parser.cutee.cxx cutee.h t.parser.h \
        ../mimetic/mimeentity.h ../mimetic/strutils.h \
        ../mimetic/utils.h ../mimetic/libconfig.h ../mimetic/config.h \
@@ -383,44 +383,42 @@ t.parser.cutee.o: t.parser.cutee.cxx cutee.h t.parser.h \
        ../mimetic/os/mmfile.h ../mimetic/header.h \
        ../mimetic/rfc822/header.h ../mimetic/rfc822/field.h \
        ../mimetic/rfc822/mailbox.h ../mimetic/rfc822/messageid.h \
-       ../mimetic/os/utils.h ../mimetic/rfc822/mailboxlist.h \
-       ../mimetic/rfc822/addresslist.h ../mimetic/rfc822/address.h \
-       ../mimetic/rfc822/group.h ../mimetic/contentid.h \
-       ../mimetic/contentdescription.h ../mimetic/body.h \
-       ../mimetic/rfc822/body.h ../mimetic/parser/itparserdecl.h \
-       ../mimetic/streambufs.h ../mimetic/parser/itparser.h \
-       ../mimetic/tree.h
+       ../mimetic/config.h ../mimetic/os/utils.h \
+       ../mimetic/rfc822/mailboxlist.h ../mimetic/rfc822/addresslist.h \
+       ../mimetic/rfc822/address.h ../mimetic/rfc822/group.h \
+       ../mimetic/contentid.h ../mimetic/contentdescription.h \
+       ../mimetic/body.h ../mimetic/rfc822/body.h \
+       ../mimetic/parser/itparserdecl.h ../mimetic/streambufs.h \
+       ../mimetic/parser/itparser.h ../mimetic/tree.h
 t.qp.cutee.o: t.qp.cutee.cxx cutee.h t.qp.h ../mimetic/codec/codec.h \
        ../mimetic/codec/codec_base.h ../mimetic/codec/codec_chain.h \
        ../mimetic/codec/base64.h ../mimetic/circular_buffer.h \
        ../mimetic/codec/qp.h ../mimetic/libconfig.h \
-       ../mimetic/config.h ../mimetic/codec/code.h \
-       ../mimetic/codec/other_codecs.h ../mimetic/utils.h \
-       ../mimetic/strutils.h
+       ../mimetic/config.h ../mimetic/utils.h ../mimetic/strutils.h \
+       ../mimetic/codec/code.h ../mimetic/codec/other_codecs.h
 t.qp.o: t.qp.cxx t.qp.h cutee.h ../mimetic/codec/codec.h \
        ../mimetic/codec/codec_base.h ../mimetic/codec/codec_chain.h \
        ../mimetic/codec/base64.h ../mimetic/circular_buffer.h \
        ../mimetic/codec/qp.h ../mimetic/libconfig.h \
-       ../mimetic/config.h ../mimetic/codec/code.h \
-       ../mimetic/codec/other_codecs.h ../mimetic/utils.h \
-       ../mimetic/strutils.h
+       ../mimetic/config.h ../mimetic/utils.h ../mimetic/strutils.h \
+       ../mimetic/codec/code.h ../mimetic/codec/other_codecs.h
 t.rfc822.cutee.o: t.rfc822.cutee.cxx cutee.h t.rfc822.h \
        ../mimetic/rfc822/rfc822.h ../mimetic/rfc822/address.h \
        ../mimetic/rfc822/mailbox.h ../mimetic/rfc822/fieldvalue.h \
        ../mimetic/strutils.h ../mimetic/rfc822/group.h \
        ../mimetic/rfc822/addresslist.h ../mimetic/rfc822/body.h \
        ../mimetic/rfc822/datetime.h ../mimetic/rfc822/messageid.h \
-       ../mimetic/utils.h ../mimetic/libconfig.h ../mimetic/config.h \
-       ../mimetic/os/utils.h ../mimetic/rfc822/field.h \
-       ../mimetic/rfc822/header.h ../mimetic/rfc822/mailboxlist.h \
-       ../mimetic/rfc822/message.h
+       ../mimetic/config.h ../mimetic/utils.h ../mimetic/libconfig.h \
+       ../mimetic/config.h ../mimetic/os/utils.h \
+       ../mimetic/rfc822/field.h ../mimetic/rfc822/header.h \
+       ../mimetic/rfc822/mailboxlist.h ../mimetic/rfc822/message.h
 t.rfc822.o: t.rfc822.cxx t.rfc822.h ../mimetic/rfc822/rfc822.h \
        ../mimetic/rfc822/address.h ../mimetic/rfc822/mailbox.h \
        ../mimetic/rfc822/fieldvalue.h ../mimetic/strutils.h \
        ../mimetic/rfc822/group.h ../mimetic/rfc822/addresslist.h \
        ../mimetic/rfc822/body.h ../mimetic/rfc822/datetime.h \
-       ../mimetic/rfc822/messageid.h ../mimetic/utils.h \
-       ../mimetic/libconfig.h ../mimetic/config.h \
+       ../mimetic/rfc822/messageid.h ../mimetic/config.h \
+       ../mimetic/utils.h ../mimetic/libconfig.h ../mimetic/config.h \
        ../mimetic/os/utils.h ../mimetic/rfc822/field.h \
        ../mimetic/rfc822/header.h ../mimetic/rfc822/mailboxlist.h \
        ../mimetic/rfc822/message.h cutee.h