aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-02-04 14:29:11 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-02-04 14:29:11 +0000
commit0b2542d1a61fc5425ff65ab3dbf7ba7de174763f (patch)
tree8a6188e11db0c9ef6891c31e8a1bebca050b23b2 /etc
parentf67864f86c7d703325e86b14d0ba33992c52891b (diff)
downloadluasocket-0b2542d1a61fc5425ff65ab3dbf7ba7de174763f.tar.gz
luasocket-0b2542d1a61fc5425ff65ab3dbf7ba7de174763f.tar.bz2
luasocket-0b2542d1a61fc5425ff65ab3dbf7ba7de174763f.zip
Worked on the manual.
Implemented stuffing (needs test) Added cddb and qp examples.
Diffstat (limited to 'etc')
-rw-r--r--etc/qp.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/etc/qp.lua b/etc/qp.lua
new file mode 100644
index 0000000..23c834a
--- /dev/null
+++ b/etc/qp.lua
@@ -0,0 +1,18 @@
1local convert
2arg = arg or {}
3local mode = arg and arg[1] or "-et"
4if mode == "-et" then
5 local canonic = socket.mime.canonic()
6 local qp = socket.mime.encode("quoted-printable")
7 local wrap = socket.mime.wrap("quoted-printable")
8 convert = socket.mime.chain(canonic, qp, wrap)
9elseif mode == "-eb" then
10 local qp = socket.mime.encode("quoted-printable", "binary")
11 local wrap = socket.mime.wrap("quoted-printable")
12 convert = socket.mime.chain(qp, wrap)
13else convert = socket.mime.decode("quoted-printable") end
14while 1 do
15 local chunk = io.read(4096)
16 io.write(convert(chunk))
17 if not chunk then break end
18end