hunk ./quoted-printable-stream.lisp 81 - (end (search "?=" string :start1 0 :start2 start)) - (encoded (subseq string (+ start 3) end))) - (decode-quoted-printable encoded)) + (end (search "?=" string :start1 0 :start2 (or start 0)))) + (if (and start end) + (let ((encoded (subseq string (+ start 3) end))) + (decode-quoted-printable encoded)) + string)) hunk ./quoted-printable-stream.lisp 87 - hunk ./rfc2822.lisp 776 - finally (princ item stream)) + finally (princ (car (last list)) stream)) hunk ./folders/imap/folder.lisp 304 - (end-of-imap-response () (let ((result (nreverse result))) - (if *imap-debug* - (print result) - result)))))) + (end-of-imap-response () (let ((result (nreverse result))) + (if *imap-debug* + (print result) + result)))))) hunk ./lisp-dep/environment.lisp 77 - (if (zerop (#_gethostname resultbuf 256)) + (if (zerop (c-gethostname resultbuf 256)) hunk ./lisp-dep/files.lisp 60 -;; Oops I re -#+(and :lispworks :unix :macosx) + +#+(and :lispworks :macosx) hunk ./lisp-dep/files.lisp 77 -#+(and :lispworks :unix) +#+(and :lispworks (or :unix :macosx)) hunk ./lisp-dep/files.lisp 82 -#+(and :lispworks :unix) +#+(and :lispworks (or :unix :macosx)) hunk ./lisp-dep/files.lisp 87 -#+(and :lispworks :unix) +#+(and :lispworks (or :unix :macosx)) hunk ./lisp-dep/files.lisp 92 -#+(and :lispworks :unix) +#+(and :lispworks (or :unix :macosx)) hunk ./lisp-dep/files.lisp 98 -#+(and :lispworks :unix) +#+(and :lispworks (or :unix :macosx)) hunk ./lisp-dep/files.lisp 105 -#+(and :lispworks :unix) +#+(and :lispworks (or :unix :macosx)) hunk ./lisp-dep/files.lisp 117 -#+(and :lispworks :unix) +#+(and :lispworks (or :unix :macosx)) hunk ./lisp-dep/files.lisp 131 - #-(or lispworks allegro) (remove-if #'null (directory wildspec) :key #'pathname-name))) + #-(or lispworks allegro openmcl) (remove-if #'null (directory wildspec) :key #'pathname-name))) hunk ./lisp-dep/files.lisp 138 - #-(or lispworks allegro) (remove-if-not #'null (directory wildspec) :key #'pathname-name))) + #-(or lispworks allegro openmcl) (remove-if-not #'null (directory wildspec) :key #'pathname-name))) hunk ./lisp-dep/filesystem.lisp 47 - (pathname-type file)))))))))) + (pathname-type file))))))) + (directory files)))) hunk ./lisp-dep/filesystem.lisp 57 -#-(or cmu sbcl (and lispworks unix)) +#-(or cmu sbcl clisp (and :lispworks (or :unix :macosx))) addfile ./lisp-dep/openmcl-fixes.lisp hunk ./lisp-dep/openmcl-fixes.lisp 1 - +;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*- + +;;; Copyright (c) 2004, Jochen Schmidt . +;;; All rights reserved. + +;;; Redistribution and use in source and binary forms, with or without +;;; modification, are permitted provided that the following conditions +;;; are met: + +;;; * Redistributions of source code must retain the above copyright +;;; notice, this list of conditions and the following disclaimer. + +;;; * Redistributions in binary form must reproduce the above +;;; copyright notice, this list of conditions and the following +;;; disclaimer in the documentation and/or other materials +;;; provided with the distribution. + +;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED +;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +;;; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +(in-package :mel.environment) + +;; Define this piece in the openmcl specific fixes-file +;; because the #_ reader syntax breaks conditional code in other +;; CL implementations +(declaim (inline c-gethostname)) +(defun c-gethostname (buffer length) + (#_gethostname resultbuf 256)) hunk ./lisp-dep/packages.lisp 34 - #+mcl :ccl #+allegro :excl #+sbcl :sb-gray #+abcl :gray-streams + #+openmcl :ccl #+mcl :ccl #+allegro :excl #+sbcl :sb-gray #+abcl :gray-streams hunk ./mel-base.asd 36 - :version "0.5" + :version "0.7.0" hunk ./mel-base.asd 56 + #+openmcl (:file "openmcl-fixes") hunk ./mel-base.asd 56 - #+openmcl (:file "openmcl-fixes") + #+openmcl (:file "openmcl-fixes" :depends-on ("packages")) hunk ./mel-base.asd 60 - (:file "environment" :depends-on ("packages")) + (:file "environment" :depends-on ("packages" #+openmcl "openmcl-fixes")) hunk ./lisp-dep/environment.lisp 59 -#+(and unix #.(cl:if (cl:find-package "UFFI") '(and) '(or))) -(uffi:def-function ("gethostname" c-gethostname) - ((name (* :unsigned-char)) - (len :int)) - :returning :int) - -#+(and unix #.(cl:if (cl:find-package "UFFI") '(and) '(or))) -(defun gethostname () - "Returns the hostname" - (uffi:with-foreign-object (name '(:array :unsigned-char 256)) - (if (zerop (c-gethostname (uffi:char-array-to-pointer name) 256)) - (uffi:convert-from-foreign-string name) - (error "gethostname() failed.")))) hunk ./lisp-dep/environment.lisp 60 +;; Host CL implementations hunk ./lisp-dep/environment.lisp 69 -#+clisp +#+(and clisp unix) hunk ./lisp-dep/environment.lisp 73 -#+(or (not unix) #.(cl:if (cl:find-package "UFFI") '(or) '(and))) +#+(and :clisp :win32) +(ffi:def-call-out c-gethostname + (:name \"gethostname\") + (:arguments + (name (ffi:c-ptr + (ffi:c-array-max ffi:char 256)) :out :alloca) + (len ffi:int)) + (:language :stdc) + (:return-type ffi:int) + (:library "wsock32.dll")) + +#+(and :clisp :win32) +(defun gethostname () + "Returns the hostname" + (multiple-value-bind (success name) (c-gethostname 256) + (if (zerop success) + (ext:convert-string-from-bytes name +custom:*FOREIGN-ENCODING*) + (error (strerr errno))))) + +;; UFFI Implementation +#+(or (not (or clisp openmcl)) + (and unix #.(cl:if (cl:find-package "UFFI") '(and) '(or)))) +(uffi:def-function ("gethostname" c-gethostname) + ((name (* :unsigned-char)) + (len :int)) + :returning :int) + +#+(or (not (or clisp openmcl)) + (and unix #.(cl:if (cl:find-package "UFFI") '(and) '(or)))) +(defun gethostname () + "Returns the hostname" + (uffi:with-foreign-object (name '(:array :unsigned-char 256)) + (if (zerop (c-gethostname (uffi:char-array-to-pointer name) 256)) + (uffi:convert-from-foreign-string name) + (error "gethostname() failed.")))) + +;; If no GETHOSTNAME is yet defined - generate a dummy stub +#+#. (cl:if (cl:fboundp 'gethostname) '(and) '(or)) hunk ./lisp-dep/environment.lisp 114 + hunk ./rfc2822.lisp 296 +(defconstant +vt+ (code-char 11)) + hunk ./rfc2822.lisp 325 - ((#\space #\tab #-(or abcl openmcl) #\vt) (loop (let ((c (get-char))) + ((#\space #\tab +vt+) (loop (let ((c (get-char))) hunk ./rfc2822.lisp 327 - ((#\space #\tab #-(or abcl openmcl) #\vt) nil) + ((#\space #\tab +vt+) nil) hunk ./lisp-dep/environment.lisp 40 -#+(and #.(cl:if (cl:find-package "UFFI") '(or) '(and))) +#-#.(cl:if (cl:find-package "UFFI") '(and) '(or)) hunk ./lisp-dep/environment.lisp 42 -#+(and clisp #.(cl:if (cl:find-package "LINUX") '(and) '(or))) -(linux:getpid) +#+clisp +(system:process-id) hunk ./lisp-dep/environment.lisp 52 - -#+(not unix) +#+(or (and lispworks (not unix)) + (and sbcl (not unix)) + (not (or clisp openmcl))) hunk ./lisp-dep/environment.lisp 70 -#+(and clisp unix) +#+(And clisp unix) hunk ./lisp-dep/environment.lisp 95 -#+(or (not (or clisp openmcl)) - (and unix #.(cl:if (cl:find-package "UFFI") '(and) '(or)))) +#+(and (not (or clisp openmcl)) unix #.(cl:if (cl:find-package "UFFI") '(and) '(or))) hunk ./lisp-dep/environment.lisp 101 -#+(or (not (or clisp openmcl)) +#+(and (not (or clisp openmcl)) hunk ./lisp-dep/environment.lisp 112 +(progn + (warn "Uses dummy GETHOSTNAME function - try loading UFFI before compiling mel-base") hunk ./lisp-dep/environment.lisp 115 - "localhost") + "localhost")) hunk ./compose-message.lisp 160 + (declare (ignore start)) hunk ./folders/imap/folder.lisp 455 + (declare (ignore arguments)) hunk ./folders/imap/folder.lisp 504 - (with-slots (username password host port mailbox) folder - (setf (connection folder) (make-imap-connection folder)) - (setf (state folder) :connected) - (select-mailbox folder))) + (setf (connection folder) (make-imap-connection folder)) + (setf (state folder) :connected) + (select-mailbox folder)) hunk ./folders/imap/folder.lisp 701 - + +(defmethod copy-message-using-folders :around ((message message) (message-folder imap-folder) (sink-folder imap-folder)) + "Copy a message between two imap folders. We can optimize this case if the folders are on the same server." + (if (and (equal (host message-folder) (host sink-folder)) + (equal (username message-folder) (username sink-folder)) + (equal (password message-folder) (password sink-folder)) + (equal (imap-port message-folder) (imap-port sink-folder))) + (progn + (send-command message-folder "~A uid copy ~A ~A" "UID" (uid message) (mailbox sink-folder)) + (process-response message-folder :on-uid (lambda (m) m))) + ;; if we're not using the same server, play it safe + (call-next-method))) + hunk ./folders/imap/folder.lisp 815 + (declare (ignore message)) hunk ./folders/imap/folder.lisp 819 - #+nil(cerror "Continue without unsetting the RECENT flag" "It is not possible to modify the RECENT flag manually")) + (declare (ignore message)) + #+nil + (cerror "Continue without unsetting the RECENT flag" "It is not possible to modify the RECENT flag manually")) hunk ./folders/maildir/folder.lisp 94 -(defmethod make-maildir-folder (pathname &rest args &key (if-does-not-exist :error) (line-terminator-style nil) &allow-other-keys) +(defmethod make-maildir-folder (pathname &key (if-does-not-exist :error) (line-terminator-style nil) &allow-other-keys) hunk ./folders/pop3/folder.lisp 133 - #+cmu(declare (ignorable args)) + (declare (ignorable args)) hunk ./folders/pop3/folder.lisp 227 + (declare (ignore new-value)) hunk ./folders/pop3/folder.lisp 231 + (declare (ignore character)) hunk ./folders/smtp/folder.lisp 128 + (declare (ignore message)) hunk ./folders/smtp/folder.lisp 259 -(defmethod validate-command-in-state (cmd state) +(defmethod validate-command-in-state ((cmd t) (state t)) hunk ./folders/smtp/folder.lisp 274 - #+cmu(declare (ignorable args)) + (declare (ignorable args)) hunk ./lisp-dep/unix.lisp 61 + #+openmcl (declare (ignore stat)) hunk ./lisp-dep/unix.lisp 69 + #+openmcl (declare (ignore stat)) hunk ./lisp-dep/unix.lisp 77 - #+openmcl (multiple-value-bind (succ mode size mtime inode uid) - (ccl::%stat stat) mtime)) + #+openmcl (nth-value 3 (ccl::%stat stat))) hunk ./mime.lisp 88 - (let ((value (apply #'subseq string (1+ del) - (if next (list next))))) - (accept-rfc2822-token (apply #'subseq string - (1+ del) - (if next (list next))) - nil - :type-test (mel.mime::token-type-test-function 'or :atom :dot-atom :quoted-string)))) + (accept-rfc2822-token (apply #'subseq string + (1+ del) + (if next (list next))) + nil + :type-test (mel.mime::token-type-test-function 'or :atom :dot-atom :quoted-string))) hunk ./multiparts.lisp 297 - (lines 0) line line-octets line-end-p) - (loop (multiple-value-setq (line line-octets line-end-p) + (lines 0) line line-octets) + (loop (multiple-value-setq (line line-octets) hunk ./multiparts.lisp 316 + (declare (ignore folder)) hunk ./line-terminator-filter.lisp 78 - (#\linefeed nil) + ;; on openmcl newline and linefeed are the same character + #-openmcl (#\linefeed nil) hunk ./line-terminator-filter.lisp 87 - (#\linefeed nil) + ;; on openmcl newline and linefeed are the same character + #-openmcl(#\linefeed nil) hunk ./rfc2822.lisp 276 +(defun clean-header-field (string) + (string-trim '(#\space #\tab #\return #\linefeed) string)) hunk ./rfc2822.lisp 280 - (string-trim '(#\space #\tab #\return #\linefeed) message-id)) + (clean-header-field message-id)) hunk ./rfc2822.lisp 286 - (let ((date (string-trim '(#\space) date))) - (date-to-universal-time date))) + (date-to-universal-time (clean-header-field date))) hunk ./rfc2822.lisp 292 - (string-trim '(#\space #\tab) subject)) + (clean-header-field subject)) hunk ./rfc2822.lisp 708 - (with-slots (port) object - (if (and (slot-boundp object 'display-name) - (display-name object)) - (format stream "~A" (display-name object)) - (write-string "invalid address" stream)))) - (with-slots (port) object - (if (and (slot-boundp object 'display-name) - (display-name object)) - (format stream "~A" (display-name object)) - (write-string "invalid address" stream))))) + (if (and (slot-boundp object 'display-name) + (display-name object)) + (format stream "~A" (display-name object)) + (write-string "invalid address" stream))) + (if (and (slot-boundp object 'display-name) + (display-name object)) + (format stream "~A" (display-name object)) + (write-string "invalid address" stream)))) hunk ./rfc2822.lisp 720 - (with-slots (port) object - (if (and (slot-boundp object 'display-name) - (display-name object)) - (format stream "~A <~A>" (display-name object) (address-spec object)) - (format stream "<~A>" (address-spec object))))) - (with-slots (port) object - (if (and (slot-boundp object 'display-name) - (display-name object)) - (format stream "~A <~A>" (display-name object) (address-spec object)) - (format stream "<~A>" (address-spec object)))))) + (if (and (slot-boundp object 'display-name) + (display-name object)) + (format stream "~A <~A>" (display-name object) (address-spec object)) + (format stream "<~A>" (address-spec object)))) + (if (and (slot-boundp object 'display-name) + (display-name object)) + (format stream "~A <~A>" (display-name object) (address-spec object)) + (format stream "<~A>" (address-spec object))))) hunk ./rfc2822.lisp 732 - (with-slots (port) object - (if (slot-boundp object 'display-name) - (format stream "~A:~A~{,~A~};" (display-name object) (first (mailbox-list object)) (rest (mailbox-list object))) - (format stream "anonymous:~A~{,~A~};" (first (mailbox-list object)) (rest (mailbox-list object)))))) - (with-slots (port) object - (if (slot-boundp object 'display-name) - (format stream "~A:~A~{,~A~};" (display-name object) (first (mailbox-list object)) (rest (mailbox-list object))) - (format stream "anonymous:~A~{,~A~};" (first (mailbox-list object)) (rest (mailbox-list object))))))) + (if (slot-boundp object 'display-name) + (format stream "~A:~A~{,~A~};" (display-name object) (first (mailbox-list object)) (rest (mailbox-list object))) + (format stream "anonymous:~A~{,~A~};" (first (mailbox-list object)) (rest (mailbox-list object))))) + (if (slot-boundp object 'display-name) + (format stream "~A:~A~{,~A~};" (display-name object) (first (mailbox-list object)) (rest (mailbox-list object))) + (format stream "anonymous:~A~{,~A~};" (first (mailbox-list object)) (rest (mailbox-list object)))))) hunk ./rfc2822.lisp 799 -(eval-when (:compile-toplevel :execute) +(eval-when (:compile-toplevel :load-toplevel :execute) hunk ./rfc2822.lisp 877 - (:and (word) (setf zone 0))))) + (:and (word) (setf zone 0)) + ;; some mailers (esp hotmail around 2001) don't set zones. + (setf zone 0)))) hunk ./folders/imap/folder.lisp 559 - (cond ((> exists non-recent) + (cond ((/= exists non-recent) hunk ./compose-message.lisp 38 - (format nil "~D~D~D@~A" + (format nil "<~D~D~D@~A>" hunk ./folders/imap/folder.lisp 611 - (let (result) - (process-response folder :on-header (lambda (header) (setf result header))) - nil)) + (process-response folder :on-header (lambda (header) (declare (ignore header))))) hunk ./protocols/folder-metainfo.lisp 58 - (set-difference all-messages non-recent-messages - :test #'uid=))) + (mapcar fn (set-difference all-messages non-recent-messages + :test #'uid=)))) hunk ./compose-message.lisp 108 -(defun parse-mime-table (&optional (file "/etc/mime.types")) +(defvar *mime-types-file* (or (probe-file "/etc/mime.types") + (probe-file (merge-pathnames "mime.types" *load-truename*)))) + +(defun parse-mime-table (&optional (file *mime-types-file*)) hunk ./compose-message.lisp 125 - #+(and unix (not (or macosx darwin))) - (parse-mime-table) - #-(and unix (not (or macosx darwin))) nil) + (if *mime-types-file* + (parse-mime-table *mime-types-file*) + nil)) hunk ./compose-message.lisp 131 + (or hunk ./compose-message.lisp 134 - *mime-table*)))) + *mime-table*)) + "application/octet-stream"))) hunk ./lisp-dep/files.lisp 52 -#+(and :lispworks :unix) +#+(and :lispworks :unix (not :macosx)) hunk ./protocols/folder-metainfo.lisp 62 + (declare (ignore fn)) hunk ./protocols/message-transport.lisp 58 + (declare (ignore message-folder)) hunk ./protocols/message-transport.lisp 103 + (declare (ignore message-folder)) hunk ./rfc2822.lisp 885 - (match-month month) + (match-month (string-capitalize month)) hunk ./mel-base.asd 88 - :depends-on (#+sbcl sb-posix #+sbcl sb-md5 #+sbcl sb-bsd-sockets)) + :depends-on (#+sbcl sb-posix #+sbcl sb-md5 #+sbcl sb-bsd-sockets #+cmu uffi)) + hunk ./folders/imap/folder.lisp 546 - (setf (state folder) :disconnected))) + (setf (state folder) :disconnected) + ;; Added by KTR on 07/17/2008 to close the network connection + (close (connection folder)))) hunk ./quoted-printable-stream.lisp 74 - do (write-char c out)))))) + do (when c (write-char c out))))))) hunk ./mel-base.asd 36 - :version "0.7.0" + :version "0.8.2" hunk ./multiparts.lisp 82 - -(defmethod parts ((message simple-part)) - (list message)) hunk ./multiparts.lisp 176 -(defun read-line-counted (in-stream &optional (eof-error-p t) eof-value) - (let ((octets 0) - (line-end-p nil)) +(defun scan-forward-boundary-tag (in-stream boundary) + (let ((tag (concatenate 'string "--" boundary)) + (match 0) + (octets 0) + (lines 0) + (line-ending-octets 0)) hunk ./multiparts.lisp 184 + (skip () (read-char in-stream)) hunk ./multiparts.lisp 189 - (with-output-to-string (line) - (handler-case hunk ./multiparts.lisp 192 - (#\return (consume) (go cr)) - (#\linefeed (consume) (go lf)) - (otherwise (write-char (consume) line) (go start)))) + (#\return (skip) (go cr)) + (#\linefeed (skip) (go lf)) + (otherwise (consume) (go start)))) hunk ./multiparts.lisp 196 - lf (setf line-end-p 1) - (go end) + lf (setf line-ending-octets 1) (go newline) hunk ./multiparts.lisp 198 - cr (setf line-end-p 1) + cr hunk ./multiparts.lisp 201 - (#\linefeed (consume) (go crlf)) - (otherwise (go end)))) - - crlf (setf line-end-p 2) (go end) + (#\linefeed (setf line-ending-octets 2) + (skip) (go newline)) + (otherwise + (setf line-ending-octets 1) + (go newline)))) hunk ./multiparts.lisp 207 - end - (return-from read-line-counted - (values (get-output-stream-string line) - octets - (not (null line-end-p))))) - (end-of-file ()(let ((result (get-output-stream-string line))) - (cond ((plusp (length result)) - (return-from read-line-counted - (values result octets (not (null line-end-p))))) - (line-end-p - (return-from read-line-counted - (values result octets t))) - (t - (if eof-error-p - (error 'end-of-file :stream in-stream) - (return-from read-line-counted - (values eof-value octets nil)))))))))))) - -(defun scan-forward-boundary-tag (stream boundary) - (let ((tag (concatenate 'string "--" boundary))) - (let ((lines 0) - (octets 0) - line line-octets line-end-p) - (loop (multiple-value-setq (line line-octets line-end-p) - (read-line-counted stream)) - (when (string-prefixp tag line) - (return)) - - (when line-end-p - (incf octets line-octets) - (incf lines))) + newline + (let ((c (peek))) + (case c + (#\- (go possible-boundary)) + (otherwise (incf octets line-ending-octets) + (incf lines) + (setf line-ending-octets 0) + (go start)))) hunk ./multiparts.lisp 216 - (if (string-prefixp (concatenate 'string tag "--") line) - (progn (format t "End tag in f-b-t~%") - (force-output t) - (values octets lines t)) - (values octets lines nil))))) + possible-boundary + (if (= match (length tag)) + (go boundary-matched) + (let ((c (peek))) + (cond ((char= c (char tag match)) + (skip) (incf match)(go possible-boundary)) + (t (incf octets (+ line-ending-octets match)) + (setf match 0 line-ending-octets 0) + (incf lines) + (go start))))) + boundary-matched + (let ((c (peek))) + (case c + (#\- (skip) + (case c + (#\- (go end-boundary)) + (otherwise (go boundary)))) + (otherwise (go boundary)))) + + boundary + (loop until (case (peek) ((#\return #\linefeed :eof) t) + (otherwise nil)) + do (skip)) + (return-from scan-forward-boundary-tag + (values octets lines nil)) + + end-boundary + (loop until (case (peek) ((#\return #\linefeed :eof) t) + (otherwise nil)) + do (skip)) + (return-from scan-forward-boundary-tag + (values octets lines t)) + )))) hunk ./multiparts.lisp 266 - (format t "End tag of boundary=~A~%" boundary) - (force-output t) + ; (format t "End tag of boundary=~A~%" boundary) hunk ./multiparts.lisp 271 - (format t "Multipart-Structure: ~A~%" result) - (force-output t) + ; (format t "Multipart-Structure: ~A~%" result) hunk ./multiparts.lisp 275 - (format t "Headers read ~A" hoctets) - (force-output t) + ; (format t "Headers read ~A" hoctets) hunk ./multiparts.lisp 292 + (unless (getf params :charset) + (setf params (list* :charset "us-ascii" params))) hunk ./multiparts.lisp 298 +;; super sub params nil nil encoding octets lines nil nil nil hunk ./multiparts.lisp 315 + (unless (getf params :charset) + (setf params (list* :charset "us-ascii" params))) hunk ./lisp-dep/environment.lisp 62 + +#+(and lispworks unix) +(fli:define-foreign-function (gethostname "gethostname" :source) + ((string (:reference-return (:ef-mb-string :limit 256))) + (n :int)) + :lambda-list (&aux string (n 256)) + :calling-convention :cdecl) + hunk ./lisp-dep/environment.lisp 119 -#+#. (cl:if (cl:fboundp 'gethostname) '(and) '(or)) +#-#. (cl:if (cl:fboundp 'gethostname) '(and) '(or)) hunk ./multiparts.lisp 176 +(defun read-lines-and-octets (in-stream) + (let ((octets 0) + (lines 0)) + (flet ((peek () + (peek-char nil in-stream nil :eof)) + (consume () + (prog1 + (read-char in-stream) + (incf octets)))) + (tagbody + start (let ((c (peek))) + (case c + (#\return (consume) (go cr)) + (#\linefeed (consume) (go lf)) + (:eof (go eof)) + (otherwise (consume) (go start)))) + + lf (go newline) + + cr + (let ((c (peek))) + (case c + (#\linefeed + (consume) (go newline)) + (:eof (incf lines) (go eof)) + (otherwise + (go newline)))) + + newline + (incf lines) + (go start) + + eof + (return-from read-lines-and-octets + (values lines octets)))))) + hunk ./multiparts.lisp 336 - (let ((octets 0) - (lines 0) line line-octets) - (loop (multiple-value-setq (line line-octets) - (read-line-counted stream nil stream)) - (when (eq stream line) - (incf lines) - (when (plusp line-octets) - (incf octets line-octets)) - (return)) - - (incf lines) - (incf octets line-octets)) - + (multiple-value-bind (lines octets) + (read-lines-and-octets stream) hunk ./multiparts.lisp 343 - (force-output t) hunk ./folders/maildir/folder.lisp 216 - (type simple-base-string file)) + (type string file)) hunk ./folders/maildir/folder.lisp 225 - (declare (type simple-base-string uid) + (declare (type string uid) hunk ./folders/maildir/folder.lisp 424 - (declare (type simple-base-string file)) + (declare (type string file)) hunk ./protocols/message-transport.lisp 81 - (type simple-base-string buffer)) + (type string buffer)) hunk ./base64-stream.lisp 106 - (let ((buffer (make-array (multiple-value-bind (div rest) - (floor (- end start) 3) (+ (* div 4) (if (zerop rest) 0 4))) :element-type 'base-char))) + (let ((buffer (make-string (multiple-value-bind (div rest) + (floor (- end start) 3) (+ (* div 4) (if (zerop rest) 0 4)))))) hunk ./base64-stream.lisp 138 - (let ((buffer (make-array (multiple-value-bind (div rest) - (floor (- end start) 3) (+ (* div 4) (if (zerop rest) 0 4))) :element-type 'base-char))) + (let ((buffer (make-string (multiple-value-bind (div rest) + (floor (- end start) 3) (+ (* div 4) (if (zerop rest) 0 4)))))) hunk ./compose-message.lisp 175 - (let ((header-stream (make-string-input-stream headers)) + (let ((header-stream (make-sequence-input-stream headers)) hunk ./folders/imap/folder.lisp 247 - (let ((buffer (make-string number))) + (let ((buffer (make-array number :element-type '(unsigned-byte 8)))) hunk ./folders/imap/folder.lisp 363 - (with-input-from-string (s message) + (with-input-from-sequence (s message) hunk ./folders/imap/folder.lisp 473 - :element-type 'character))) + :element-type '(unsigned-byte 8)))) hunk ./folders/imap/folder.lisp 686 - (let ((stream (make-string-input-stream (fetch-message folder + (let ((stream (make-sequence-input-stream (fetch-message folder hunk ./folders/imap/folder.lisp 692 - (make-string-input-stream (fetch-message-body folder + (make-sequence-input-stream (fetch-message-body folder hunk ./folders/imap/folder.lisp 696 - (let ((stream (make-string-input-stream (fetch-message-header folder + (let ((stream (make-sequence-input-stream (fetch-message-header folder hunk ./folders/pop3/folder.lisp 216 - ((input-buffer :accessor input-buffer :initform (make-array 4096 :element-type 'base-char)) + ((input-buffer :accessor input-buffer :initform (make-string 4096)) hunk ./folders/pop3/folder.lisp 330 - (let ((buffer (make-array 4096 :element-type 'base-char))) + (let ((buffer (make-string 4096))) hunk ./lisp-dep/files.lisp 96 - (current-entry :accessor current-entry :initform (make-array 256 :element-type 'base-char :fill-pointer 0)))) + (current-entry :accessor current-entry :initform (make-array 256 :element-type lw:*default-character-element-type* :fill-pointer 0)))) hunk ./lisp-dep/network.lisp 55 - :element-type element-type - #+sb-unicode :external-format - #+sb-unicode(if (subtypep element-type - 'character) - :ascii - *default*) - ; :buffering :none + :element-type :default hunk ./lisp-dep/network.lisp 69 - :element-type (if (eq element-type 'character) 'base-char element-type) + :element-type (if (eq element-type 'character) lw:*default-character-element-type* element-type) hunk ./lisp-dep/packages.lisp 100 - "FILE-DIRECTORY-P")) + "FILE-DIRECTORY-P" + "WITH-INPUT-FROM-SEQUENCE" + "MAKE-SEQUENCE-INPUT-STREAM")) hunk ./lisp-dep/utils.lisp 113 - +(defmacro with-input-from-sequence ((sym seq) &body forms) + (rebinding (seq) + (with-unique-names (in) + `(if (stringp ,seq) + (with-input-from-string (,sym ,seq) + ,@forms) + (flexi-streams:with-input-from-sequence (,in ,seq) + (let ((,sym (flexi-streams:make-flexi-stream ,in))) + ,@forms)))))) + +(defmethod make-sequence-input-stream ((seq string)) + (make-string-input-stream seq)) + +(defmethod make-sequence-input-stream ((seq vector)) + (flexi-streams:make-flexi-stream (flexi-streams:make-in-memory-input-stream seq))) hunk ./mel-base.asd 88 - :depends-on (#+sbcl sb-posix #+sbcl sb-md5 #+sbcl sb-bsd-sockets #+cmu uffi)) + :depends-on (#+sbcl sb-posix #+sbcl sb-md5 #+sbcl sb-bsd-sockets #+cmu uffi flexi-streams)) hunk ./mime.lisp 59 - :element-type 'base-char + :element-type (array-element-type string) hunk ./mime.lisp 133 - (ignore-errors +; (ignore-errors hunk ./mime.lisp 140 - (values super sub params)))))) + (values super sub params)))));) hunk ./protocols/message-transport.lisp 79 - (let ((buffer (make-array 8192 :element-type 'base-char))) - (declare #-(or sbcl cmu)(dynamic-extent buffer) - (type string buffer)) + (let ((buffer (make-string 8192))) + (declare #-(or sbcl cmu)(dynamic-extent buffer)) hunk ./quoted-printable-stream.lisp 67 - (with-input-from-string (s qp) + (with-input-from-sequence (s qp) hunk ./rfc2822.lisp 228 - (with-input-from-string (s string) + (with-input-from-sequence (s string) hunk ./mel-base.asd 36 - :version "0.8.2" + :version "0.9.0" hunk ./lisp-dep/utils.lisp 102 - #+sbcl (eq :directory (sb-unix:unix-file-kind - (namestring x))) + #+sbcl (eq :directory (#.(or (find-symbol "NATIVE-FILE-KIND" :sb-impl) + (find-symbol "UNIX-FILE-KIND" :sb-unix)) + (namestring x))) hunk ./mel-base.asd 36 - :version "0.9.0" + :version "0.9.1" hunk ./lisp-dep/filesystem.lisp 16 -#+(and sbcl unix) +#+(and sbcl (or unix darwin)) hunk ./lisp-dep/filesystem.lisp 25 - (unless (char= #\. (char file 0)) + (unless (char= #\. (aref file 0)) hunk ./mel-base.asd 36 - :version "0.9.1" + :version "0.9.2"