aboutsummaryrefslogtreecommitdiff
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
parent7187be8b76452aa968726180af24deaaa545431d (diff)
downloadluasocket-86de838eb5ed49711be8d62e01255cc2ccd3342e.tar.gz
luasocket-86de838eb5ed49711be8d62e01255cc2ccd3342e.tar.bz2
luasocket-86de838eb5ed49711be8d62e01255cc2ccd3342e.zip
cleanup; move ./etc into ./samples and mark 'unsupported'
-rw-r--r--.luacheckrc2
-rw-r--r--etc/README89
-rw-r--r--luasocket-scm-3.rockspec1
-rw-r--r--makefile.dist28
-rw-r--r--samples/README90
-rw-r--r--samples/b64.lua (renamed from etc/b64.lua)0
-rw-r--r--samples/check-links.lua (renamed from etc/check-links.lua)0
-rw-r--r--samples/check-memory.lua (renamed from etc/check-memory.lua)0
-rw-r--r--samples/cookie.lua (renamed from etc/cookie.lua)0
-rw-r--r--samples/dict.lua (renamed from etc/dict.lua)0
-rw-r--r--samples/dispatch.lua (renamed from etc/dispatch.lua)0
-rw-r--r--samples/eol.lua (renamed from etc/eol.lua)0
-rw-r--r--samples/forward.lua (renamed from etc/forward.lua)0
-rw-r--r--samples/get.lua (renamed from etc/get.lua)0
-rw-r--r--samples/links (renamed from etc/links)0
-rw-r--r--samples/lp.lua (renamed from etc/lp.lua)0
-rw-r--r--samples/qp.lua (renamed from etc/qp.lua)0
-rw-r--r--samples/tftp.lua (renamed from etc/tftp.lua)0
18 files changed, 98 insertions, 112 deletions
diff --git a/.luacheckrc b/.luacheckrc
index 8b25dd7..a3b4f63 100644
--- a/.luacheckrc
+++ b/.luacheckrc
@@ -15,8 +15,6 @@ include_files = {
15} 15}
16 16
17exclude_files = { 17exclude_files = {
18 "etc/*.lua",
19 "etc/**/*.lua",
20 "test/*.lua", 18 "test/*.lua",
21 "test/**/*.lua", 19 "test/**/*.lua",
22 "samples/*.lua", 20 "samples/*.lua",
diff --git a/etc/README b/etc/README
deleted file mode 100644
index cfd3e37..0000000
--- a/etc/README
+++ /dev/null
@@ -1,89 +0,0 @@
1This directory contains code that is more useful than the
2samples. This code *is* supported.
3
4 tftp.lua -- Trivial FTP client
5
6This module implements file retrieval by the TFTP protocol.
7Its main use was to test the UDP code, but since someone
8found it usefull, I turned it into a module that is almost
9official (no uploads, yet).
10
11 dict.lua -- Dict client
12
13The dict.lua module started with a cool simple client
14for the DICT protocol, written by Luiz Henrique Figueiredo.
15This new version has been converted into a library, similar
16to the HTTP and FTP libraries, that can be used from within
17any luasocket application. Take a look on the source code
18and you will be able to figure out how to use it.
19
20 lp.lua -- LPD client library
21
22The lp.lua module implements the client part of the Line
23Printer Daemon protocol, used to print files on Unix
24machines. It is courtesy of David Burgess! See the source
25code and the lpr.lua in the examples directory.
26
27 b64.lua
28 qp.lua
29 eol.lua
30
31These are tiny programs that perform Base64,
32Quoted-Printable and end-of-line marker conversions.
33
34 get.lua -- file retriever
35
36This little program is a client that uses the FTP and
37HTTP code to implement a command line file graber. Just
38run
39
40 lua get.lua <remote-file> [<local-file>]
41
42to download a remote file (either ftp:// or http://) to
43the specified local file. The program also prints the
44download throughput, elapsed time, bytes already downloaded
45etc during download.
46
47 check-memory.lua -- checks memory consumption
48
49This is just to see how much memory each module uses.
50
51 dispatch.lua -- coroutine based dispatcher
52
53This is a first try at a coroutine based non-blocking
54dispatcher for LuaSocket. Take a look at 'check-links.lua'
55and at 'forward.lua' to see how to use it.
56
57 check-links.lua -- HTML link checker program
58
59This little program scans a HTML file and checks for broken
60links. It is similar to check-links.pl by Jamie Zawinski,
61but uses all facilities of the LuaSocket library and the Lua
62language. It has not been thoroughly tested, but it should
63work. Just run
64
65 lua check-links.lua [-n] {<url>} > output
66
67and open the result to see a list of broken links. Make sure
68you check the '-n' switch. It runs in non-blocking mode,
69using coroutines, and is MUCH faster!
70
71 forward.lua -- coroutine based forward server
72
73This is a forward server that can accept several connections
74and transfers simultaneously using non-blocking I/O and the
75coroutine-based dispatcher. You can run, for example
76
77 lua forward.lua 8080:proxy.com:3128
78
79to redirect all local conections to port 8080 to the host
80'proxy.com' at port 3128.
81
82 unix.c and unix.h
83
84This is an implementation of Unix local domain sockets and
85demonstrates how to extend LuaSocket with a new type of
86transport. It has been tested on Linux and on Mac OS X.
87
88Good luck,
89Diego.
diff --git a/luasocket-scm-3.rockspec b/luasocket-scm-3.rockspec
index 71f335c..f3d24e3 100644
--- a/luasocket-scm-3.rockspec
+++ b/luasocket-scm-3.rockspec
@@ -129,6 +129,5 @@ build = {
129 copy_directories = { 129 copy_directories = {
130 "docs" 130 "docs"
131 , "samples" 131 , "samples"
132 , "etc"
133 , "test" } 132 , "test" }
134} 133}
diff --git a/makefile.dist b/makefile.dist
index a27ba57..5ef44d3 100644
--- a/makefile.dist
+++ b/makefile.dist
@@ -22,20 +22,17 @@ SAMPLES = \
22 samples/lpr.lua \ 22 samples/lpr.lua \
23 samples/talker.lua \ 23 samples/talker.lua \
24 samples/tinyirc.lua 24 samples/tinyirc.lua
25 25 samples/b64.lua \
26ETC = \ 26 samples/check-links.lua \
27 etc/README \ 27 samples/check-memory.lua \
28 etc/b64.lua \ 28 samples/dict.lua \
29 etc/check-links.lua \ 29 samples/dispatch.lua \
30 etc/check-memory.lua \ 30 samples/eol.lua \
31 etc/dict.lua \ 31 samples/forward.lua \
32 etc/dispatch.lua \ 32 samples/get.lua \
33 etc/eol.lua \ 33 samples/lp.lua \
34 etc/forward.lua \ 34 samples/qp.lua \
35 etc/get.lua \ 35 samples/tftp.lua
36 etc/lp.lua \
37 etc/qp.lua \
38 etc/tftp.lua
39 36
40SRC = \ 37SRC = \
41 src/makefile \ 38 src/makefile \
@@ -117,9 +114,6 @@ dist:
117 cp -vf README.md $(DIST) 114 cp -vf README.md $(DIST)
118 cp -vf $(MAKE) $(DIST) 115 cp -vf $(MAKE) $(DIST)
119 116
120 mkdir -p $(DIST)/etc
121 cp -vf $(ETC) $(DIST)/etc
122
123 mkdir -p $(DIST)/src 117 mkdir -p $(DIST)/src
124 cp -vf $(SRC) $(DIST)/src 118 cp -vf $(SRC) $(DIST)/src
125 119
diff --git a/samples/README b/samples/README
index e63a6f5..4ee06b6 100644
--- a/samples/README
+++ b/samples/README
@@ -1,11 +1,95 @@
1This directory contains some sample programs using 1This directory contains some sample programs using
2LuaSocket. This code is not supported. 2LuaSocket. This code is not supported.
3 3
4 tftp.lua -- Trivial FTP client
5
6This module implements file retrieval by the TFTP protocol.
7Its main use was to test the UDP code, but since someone
8found it usefull, I turned it into a module that is almost
9official (no uploads, yet).
10
11 dict.lua -- Dict client
12
13The dict.lua module started with a cool simple client
14for the DICT protocol, written by Luiz Henrique Figueiredo.
15This new version has been converted into a library, similar
16to the HTTP and FTP libraries, that can be used from within
17any luasocket application. Take a look on the source code
18and you will be able to figure out how to use it.
19
20 lp.lua -- LPD client library
21
22The lp.lua module implements the client part of the Line
23Printer Daemon protocol, used to print files on Unix
24machines. It is courtesy of David Burgess! See the source
25code and the lpr.lua in the examples directory.
26
27 b64.lua
28 qp.lua
29 eol.lua
30
31These are tiny programs that perform Base64,
32Quoted-Printable and end-of-line marker conversions.
33
34 get.lua -- file retriever
35
36This little program is a client that uses the FTP and
37HTTP code to implement a command line file graber. Just
38run
39
40 lua get.lua <remote-file> [<local-file>]
41
42to download a remote file (either ftp:// or http://) to
43the specified local file. The program also prints the
44download throughput, elapsed time, bytes already downloaded
45etc during download.
46
47 check-memory.lua -- checks memory consumption
48
49This is just to see how much memory each module uses.
50
51 dispatch.lua -- coroutine based dispatcher
52
53This is a first try at a coroutine based non-blocking
54dispatcher for LuaSocket. Take a look at 'check-links.lua'
55and at 'forward.lua' to see how to use it.
56
57 check-links.lua -- HTML link checker program
58
59This little program scans a HTML file and checks for broken
60links. It is similar to check-links.pl by Jamie Zawinski,
61but uses all facilities of the LuaSocket library and the Lua
62language. It has not been thoroughly tested, but it should
63work. Just run
64
65 lua check-links.lua [-n] {<url>} > output
66
67and open the result to see a list of broken links. Make sure
68you check the '-n' switch. It runs in non-blocking mode,
69using coroutines, and is MUCH faster!
70
71 forward.lua -- coroutine based forward server
72
73This is a forward server that can accept several connections
74and transfers simultaneously using non-blocking I/O and the
75coroutine-based dispatcher. You can run, for example
76
77 lua forward.lua 8080:proxy.com:3128
78
79to redirect all local conections to port 8080 to the host
80'proxy.com' at port 3128.
81
82 unix.c and unix.h
83
84This is an implementation of Unix local domain sockets and
85demonstrates how to extend LuaSocket with a new type of
86transport. It has been tested on Linux and on Mac OS X.
87
4 listener.lua -- socket to stdout 88 listener.lua -- socket to stdout
5 talker.lua -- stdin to socket 89 talker.lua -- stdin to socket
6 90
7listener.lua and talker.lua are about the simplest 91listener.lua and talker.lua are about the simplest
8applications you can write using LuaSocket. Run 92applications you can write using LuaSocket. Run
9 93
10 'lua listener.lua' and 'lua talker.lua' 94 'lua listener.lua' and 'lua talker.lua'
11 95
@@ -17,13 +101,13 @@ be printed by listen.lua.
17This is a cool program written by David Burgess to print 101This is a cool program written by David Burgess to print
18files using the Line Printer Daemon protocol, widely used in 102files using the Line Printer Daemon protocol, widely used in
19Unix machines. It uses the lp.lua implementation, in the 103Unix machines. It uses the lp.lua implementation, in the
20etc directory. Just run 'lua lpr.lua <filename> 104samples directory. Just run 'lua lpr.lua <filename>
21queue=<printername>' and the file will print! 105queue=<printername>' and the file will print!
22 106
23 cddb.lua -- CDDB client 107 cddb.lua -- CDDB client
24 108
25This is the first try on a simple CDDB client. Not really 109This is the first try on a simple CDDB client. Not really
26useful, but one day it might become a module. 110useful, but one day it might become a module.
27 111
28 daytimeclnt.lua -- day time client 112 daytimeclnt.lua -- day time client
29 113
diff --git a/etc/b64.lua b/samples/b64.lua
index 11eeb2d..11eeb2d 100644
--- a/etc/b64.lua
+++ b/samples/b64.lua
diff --git a/etc/check-links.lua b/samples/check-links.lua
index 283f3ac..283f3ac 100644
--- a/etc/check-links.lua
+++ b/samples/check-links.lua
diff --git a/etc/check-memory.lua b/samples/check-memory.lua
index 7bd984d..7bd984d 100644
--- a/etc/check-memory.lua
+++ b/samples/check-memory.lua
diff --git a/etc/cookie.lua b/samples/cookie.lua
index fec10a1..fec10a1 100644
--- a/etc/cookie.lua
+++ b/samples/cookie.lua
diff --git a/etc/dict.lua b/samples/dict.lua
index 8c5b711..8c5b711 100644
--- a/etc/dict.lua
+++ b/samples/dict.lua
diff --git a/etc/dispatch.lua b/samples/dispatch.lua
index 2485415..2485415 100644
--- a/etc/dispatch.lua
+++ b/samples/dispatch.lua
diff --git a/etc/eol.lua b/samples/eol.lua
index eeaf0ce..eeaf0ce 100644
--- a/etc/eol.lua
+++ b/samples/eol.lua
diff --git a/etc/forward.lua b/samples/forward.lua
index 05ced1a..05ced1a 100644
--- a/etc/forward.lua
+++ b/samples/forward.lua
diff --git a/etc/get.lua b/samples/get.lua
index d53c465..d53c465 100644
--- a/etc/get.lua
+++ b/samples/get.lua
diff --git a/etc/links b/samples/links
index 087f1c0..087f1c0 100644
--- a/etc/links
+++ b/samples/links
diff --git a/etc/lp.lua b/samples/lp.lua
index 25f0b95..25f0b95 100644
--- a/etc/lp.lua
+++ b/samples/lp.lua
diff --git a/etc/qp.lua b/samples/qp.lua
index 523238b..523238b 100644
--- a/etc/qp.lua
+++ b/samples/qp.lua
diff --git a/etc/tftp.lua b/samples/tftp.lua
index ed99cd1..ed99cd1 100644
--- a/etc/tftp.lua
+++ b/samples/tftp.lua