aboutsummaryrefslogtreecommitdiff
path: root/etc/qp.lua
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2022-03-23 16:05:11 +0100
committerThijs Schreijer <thijs@thijsschreijer.nl>2022-03-29 13:33:00 +0200
commit86de838eb5ed49711be8d62e01255cc2ccd3342e (patch)
tree13665628395e9247bf378737ca2cfa140a96a3c2 /etc/qp.lua
parent7187be8b76452aa968726180af24deaaa545431d (diff)
downloadluasocket-86de838eb5ed49711be8d62e01255cc2ccd3342e.tar.gz
luasocket-86de838eb5ed49711be8d62e01255cc2ccd3342e.tar.bz2
luasocket-86de838eb5ed49711be8d62e01255cc2ccd3342e.zip
cleanup; move ./etc into ./samples and mark 'unsupported'
Diffstat (limited to 'etc/qp.lua')
-rw-r--r--etc/qp.lua23
1 files changed, 0 insertions, 23 deletions
diff --git a/etc/qp.lua b/etc/qp.lua
deleted file mode 100644
index 523238b..0000000
--- a/etc/qp.lua
+++ /dev/null
@@ -1,23 +0,0 @@
1-----------------------------------------------------------------------------
2-- Little program to convert to and from Quoted-Printable
3-- LuaSocket sample files
4-- Author: Diego Nehab
5-----------------------------------------------------------------------------
6local ltn12 = require("ltn12")
7local mime = require("mime")
8local convert
9arg = arg or {}
10local mode = arg and arg[1] or "-et"
11if mode == "-et" then
12 local normalize = mime.normalize()
13 local qp = mime.encode("quoted-printable")
14 local wrap = mime.wrap("quoted-printable")
15 convert = ltn12.filter.chain(normalize, qp, wrap)
16elseif mode == "-eb" then
17 local qp = mime.encode("quoted-printable", "binary")
18 local wrap = mime.wrap("quoted-printable")
19 convert = ltn12.filter.chain(qp, wrap)
20else convert = mime.decode("quoted-printable") end
21local source = ltn12.source.chain(ltn12.source.file(io.stdin), convert)
22local sink = ltn12.sink.file(io.stdout)
23ltn12.pump.all(source, sink)