tvl-depot/third_party/lisp/mime4cl
sterni b379e44dfb refactor(3p/lisp/mime4cl): use flexi-streams and binary input
This refactor is driven by the following (ultimate) aims:

- Get rid of as much of the custom stream code in mime4cl which makes
  less code to maintain in the future.

- Lay the groundwork for correct handling of 8bit transfer encoding:
  The mime4cl we inherited assumes that any MIME message can be decoded
  completely by the CL implementation (in SBCL's case using latin1)
  into CHARACTERs. This is not necessarily the case. flexi-streams
  allows changing how the stream is decoded on the fly and also has
  support for reading the underlying bytes which is perfect for the
  requirements decoding MIME has.

- Since flexi-streams uses trivial-gray-streams, it supports
  READ-SEQUENCE. Taking advantage of this may improve decoding
  performance significantly in the future.

This incurs the following changes:

- Naturally we now open given files as binary files in MIME-MESSAGE.
  Given strings are encoded using STRING-TO-OCTETS and then passed on
  to a new octet vector method. Instead of MY-STRING-INPUT-STREAM this
  now uses flexi-streams' WITH-INPUT-FROM-SEQUENCE.

- OPEN-FILE-PORTION and OPEN-DECODED-FILE-PORTION need to be merged,
  since the transfer encoding not only implies an extra decoder stream
  that needs to be attached after file portion stream, but also imply a
  certain encoding of the stream itself (mostly binary vs. ASCII).
  As flexi-streams can change their encoding on the fly this could be
  untangled again, but it is not strictly necessary.

  As before, we use the DATA slot of the file portion to create a fresh
  stream if possible. Instead of strings we now use an vector of octets
  to match MIME-MESSAGE.

  The actual portioned stream relies on POSITIONED-FLEXI-INPUT-STREAM, a
  subclass of the stock FLEXI-INPUT-STREAM class, described below.

- POSITIONED-FLEXI-INPUT-STREAM replaces DELIMITED-INPUT-STREAM. It is
  created using MAKE-POSITIONED-FLEXI-INPUT-STREAM which accepts the
  same arguments as MAKE-FLEXI-STREAMS and, additionally, :IGNORE-CLOSE.
  A POSITIONED-FLEXI-INPUT-STREAM works the same as an
  FLEXI-INPUT-STREAM, but upon creation, the underlying stream is
  rewinded or forwarded to the argument given by :POSITION using
  FILE-POSITION.

  If :IGNORE-CLOSE is T, a call to CLOSE is not forwarded to the
  underlying stream.

Change-Id: I2d48c769bb110ca0b7cf52441bd63c1e1c2ccd04
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8559
Reviewed-by: sterni <sternenseemann@systemli.org>
Autosubmit: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
2023-05-18 16:14:37 +00:00
..
test refactor(3p/lisp/mime4cl/test): create one test case per sample file 2023-05-16 16:25:11 +00:00
.skip-subtree feat(3p/lisp/mime4cl): build using buildLisp 2021-09-01 22:57:17 +00:00
address.lisp chore(3p/lisp/mime4cl): remove CMUCL specific code 2022-01-26 17:43:54 +00:00
default.nix fix(3p/lisp/mime4cl/tests): fix sample discovery in nix build 2023-05-09 16:44:55 +00:00
endec.lisp refactor(3p/lisp/mime4cl): replace babel with flexi-streams 2023-03-30 16:11:54 +00:00
ex-sclf.lisp chore: remove sclf from the tree 2022-07-05 15:01:17 +00:00
mime.lisp refactor(3p/lisp/mime4cl): use flexi-streams and binary input 2023-05-18 16:14:37 +00:00
mime4cl-tests.asd chore(3p/lisp/mime4cl): remove CMUCL specific code 2022-01-26 17:43:54 +00:00
mime4cl.asd refactor(3p/lisp/mime4cl): use trivial-gray-streams 2022-01-26 17:43:54 +00:00
OWNERS chore(gerrit): migrate OWNERS files to code-owners style 2022-09-19 11:13:28 +00:00
package.lisp refactor(3p/lisp/mime4cl): replace babel with flexi-streams 2023-03-30 16:11:54 +00:00
README feat(3p/lisp/mime4cl): build using buildLisp 2021-09-01 22:57:17 +00:00
streams.lisp refactor(3p/lisp/mime4cl): use flexi-streams and binary input 2023-05-18 16:14:37 +00:00

MIME4CL is a Common Lisp library for dealing with MIME messages.
It has originally been written by Walter C. Pelissero and vendored
into depot as upstream has become inactive and provides no repo
of any kind. Upstream and depot version may diverge.

Upstream Website: http://wcp.sdf-eu.org/software/#mime4cl
Vendored Tarball: http://wcp.sdf-eu.org/software/mime4cl-20150207T211851.tbz