aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2005-11-21 07:04:44 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2005-11-21 07:04:44 +0000
commita2b780bf7a78c66d54a248fa99b5fc862c12a127 (patch)
treea9377a265f47439952c9100c594ed789117d9063
parent71f483496de874f1200526816528b7b2a4e9e4a6 (diff)
downloadluasocket-a2b780bf7a78c66d54a248fa99b5fc862c12a127.tar.gz
luasocket-a2b780bf7a78c66d54a248fa99b5fc862c12a127.tar.bz2
luasocket-a2b780bf7a78c66d54a248fa99b5fc862c12a127.zip
Spell checking on the manuals.
David's changes to lp.lua.
-rw-r--r--doc/dns.html2
-rw-r--r--doc/ftp.html2
-rw-r--r--doc/http.html2
-rw-r--r--doc/index.html4
-rw-r--r--doc/installation.html13
-rw-r--r--doc/introduction.html2
-rw-r--r--doc/ltn12.html2
-rw-r--r--doc/mime.html2
-rw-r--r--doc/reference.html2
-rw-r--r--doc/smtp.html2
-rw-r--r--doc/socket.html4
-rw-r--r--doc/tcp.html4
-rw-r--r--doc/udp.html2
-rw-r--r--doc/url.html2
-rw-r--r--etc/lp.lua24
15 files changed, 36 insertions, 33 deletions
diff --git a/doc/dns.html b/doc/dns.html
index af64ce4..826e4a2 100644
--- a/doc/dns.html
+++ b/doc/dns.html
@@ -122,7 +122,7 @@ message.
122<p> 122<p>
123<small> 123<small>
124Last modified by Diego Nehab on <br> 124Last modified by Diego Nehab on <br>
125Sun Nov 28 03:19:00 EST 2004 125Mon Nov 21 01:56:09 EST 2005
126</small> 126</small>
127</p> 127</p>
128</center> 128</center>
diff --git a/doc/ftp.html b/doc/ftp.html
index 1886344..4398a2a 100644
--- a/doc/ftp.html
+++ b/doc/ftp.html
@@ -279,7 +279,7 @@ f, e = ftp.put{
279<p> 279<p>
280<small> 280<small>
281Last modified by Diego Nehab on <br> 281Last modified by Diego Nehab on <br>
282Sun Nov 28 03:19:00 EST 2004 282Mon Nov 21 01:56:32 EST 2005
283</small> 283</small>
284</p> 284</p>
285</center> 285</center>
diff --git a/doc/http.html b/doc/http.html
index 9d80c23..a60ed25 100644
--- a/doc/http.html
+++ b/doc/http.html
@@ -315,7 +315,7 @@ r, c = http.request {
315<p> 315<p>
316<small> 316<small>
317Last modified by Diego Nehab on <br> 317Last modified by Diego Nehab on <br>
318Sun Nov 28 03:19:00 EST 2004 318Mon Nov 21 01:57:03 EST 2005
319</small> 319</small>
320</p> 320</p>
321</center> 321</center>
diff --git a/doc/index.html b/doc/index.html
index 7ac0d4c..06369a7 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -101,7 +101,7 @@ contains several examples, this user's manual and basic test procedures.
101</p> 101</p>
102 102
103<p> 103<p>
104Danilo Tuler is mantaining Win32 binaries for LuaSocket, which are also 104Danilo Tuler is maintaining Win32 binaries for LuaSocket, which are also
105available from LuaForge. These are compatible with the 105available from LuaForge. These are compatible with the
106<a href=http://luaforge.net/projects/luabinaries>LuaBinaries</a> 106<a href=http://luaforge.net/projects/luabinaries>LuaBinaries</a>
107available from LuaForge. 107available from LuaForge.
@@ -246,7 +246,7 @@ still available for those that have compatibility issues.
246<p> 246<p>
247<small> 247<small>
248Last modified by Diego Nehab on <br> 248Last modified by Diego Nehab on <br>
249Sun Nov 28 03:19:00 EST 2004 249Mon Nov 21 01:56:56 EST 2005
250</small> 250</small>
251</p> 251</p>
252</center> 252</center>
diff --git a/doc/installation.html b/doc/installation.html
index 4086f41..c8eb5d9 100644
--- a/doc/installation.html
+++ b/doc/installation.html
@@ -37,7 +37,7 @@ Installation">
37 37
38<!-- installation ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 38<!-- installation ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
39 39
40<h2>Instalation</h2> 40<h2>Installation</h2>
41 41
42<p> LuaSocket 2.0 uses the new package proposal for Lua 5.1. 42<p> LuaSocket 2.0 uses the new package proposal for Lua 5.1.
43All Lua library developers are encouraged to update their libraries so that 43All Lua library developers are encouraged to update their libraries so that
@@ -48,7 +48,7 @@ standardization and flexibility of the standard.
48<p> 48<p>
49The proposal was considered important enough by some of us to justify 49The proposal was considered important enough by some of us to justify
50early adoption, even before release of Lua 5.1. 50early adoption, even before release of Lua 5.1.
51Thus, a compability module 51Thus, a compatibility module
52<a href=http://www.keplerproject.org/compat/>compat-5.1</a> 52<a href=http://www.keplerproject.org/compat/>compat-5.1</a>
53has been released in conjunction with Roberto Ierusalimschy and <a 53has been released in conjunction with Roberto Ierusalimschy and <a
54href=http://www.keplerproject.org/>The Kepler Project</a> team. 54href=http://www.keplerproject.org/>The Kepler Project</a> team.
@@ -110,7 +110,7 @@ LUA_PATH=&lt;SHARE&gt;/?.lua;?.lua
110LUA_CPATH=&lt;LIB&gt;/?.dll;?.dll 110LUA_CPATH=&lt;LIB&gt;/?.dll;?.dll
111</pre> 111</pre>
112 112
113<p> Again, naturally, on Unix systmems the shared library extension would be 113<p> Again, naturally, on Unix systems the shared library extension would be
114<tt>.so</tt> instead of <tt>.dll</tt>.</p> 114<tt>.so</tt> instead of <tt>.dll</tt>.</p>
115 115
116<h3>Using LuaSocket</h3> 116<h3>Using LuaSocket</h3>
@@ -127,13 +127,12 @@ Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio
127</pre> 127</pre>
128 128
129<p> Each module loads their dependencies automatically, so you only need to 129<p> Each module loads their dependencies automatically, so you only need to
130load the modues you directly depend upon: <p> 130load the modules you directly depend upon: </p>
131 131
132<pre class=example> 132<pre class=example>
133Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio 133Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio
134&gt; http = require("socket.http") 134&gt; http = require("socket.http")
135&gt; 135&gt; print(http.request("http://www.cs.princeton.edu/~diego/professional/luasocket"))
136print(http.request("http://www.cs.princeton.edu/~diego/professional/luasocket"))
137--&gt; homepage gets dumped to terminal 136--&gt; homepage gets dumped to terminal
138</pre> 137</pre>
139 138
@@ -152,7 +151,7 @@ print(http.request("http://www.cs.princeton.edu/~diego/professional/luasocket"))
152<p> 151<p>
153<small> 152<small>
154Last modified by Diego Nehab on <br> 153Last modified by Diego Nehab on <br>
155Sun Nov 28 03:19:00 EST 2004 154Mon Nov 21 01:57:22 EST 2005
156</small> 155</small>
157</p> 156</p>
158</center> 157</center>
diff --git a/doc/introduction.html b/doc/introduction.html
index c88fa40..bb55762 100644
--- a/doc/introduction.html
+++ b/doc/introduction.html
@@ -323,7 +323,7 @@ and many others are covered by the <a href=reference.html>reference manual</a>.
323<p> 323<p>
324<small> 324<small>
325Last modified by Diego Nehab on <br> 325Last modified by Diego Nehab on <br>
326Sun Nov 28 03:19:00 EST 2004 326Mon Nov 21 01:57:43 EST 2005
327</small> 327</small>
328</p> 328</p>
329</center> 329</center>
diff --git a/doc/ltn12.html b/doc/ltn12.html
index c5a0f59..7d2842e 100644
--- a/doc/ltn12.html
+++ b/doc/ltn12.html
@@ -420,7 +420,7 @@ Creates and returns a source that produces the contents of a
420<p> 420<p>
421<small> 421<small>
422Last modified by Diego Nehab on <br> 422Last modified by Diego Nehab on <br>
423Sun Nov 28 03:19:00 EST 2004 423Mon Nov 21 01:57:47 EST 2005
424</small> 424</small>
425</p> 425</p>
426</center> 426</center>
diff --git a/doc/mime.html b/doc/mime.html
index 47ab47b..11ec543 100644
--- a/doc/mime.html
+++ b/doc/mime.html
@@ -466,7 +466,7 @@ marker.
466<p> 466<p>
467<small> 467<small>
468Last modified by Diego Nehab on <br> 468Last modified by Diego Nehab on <br>
469Sun Nov 28 03:19:00 EST 2004 469Mon Nov 21 01:57:51 EST 2005
470</small> 470</small>
471</p> 471</p>
472</center> 472</center>
diff --git a/doc/reference.html b/doc/reference.html
index b4b2f1d..ed1702d 100644
--- a/doc/reference.html
+++ b/doc/reference.html
@@ -229,7 +229,7 @@ Support, Manual">
229<p> 229<p>
230<small> 230<small>
231Last modified by Diego Nehab on <br> 231Last modified by Diego Nehab on <br>
232Sun Nov 28 03:19:00 EST 2004 232Mon Nov 21 01:57:56 EST 2005
233</small> 233</small>
234</p> 234</p>
235</center> 235</center>
diff --git a/doc/smtp.html b/doc/smtp.html
index 14def8a..833aa83 100644
--- a/doc/smtp.html
+++ b/doc/smtp.html
@@ -407,7 +407,7 @@ r, e = smtp.send{
407<p> 407<p>
408<small> 408<small>
409Last modified by Diego Nehab on <br> 409Last modified by Diego Nehab on <br>
410Sun Nov 28 03:19:00 EST 2004 410Mon Nov 21 01:58:01 EST 2005
411</small> 411</small>
412</p> 412</p>
413</center> 413</center>
diff --git a/doc/socket.html b/doc/socket.html
index 54b12cb..82e958a 100644
--- a/doc/socket.html
+++ b/doc/socket.html
@@ -230,7 +230,7 @@ sink from a stream socket object.
230</p> 230</p>
231 231
232<p class=parameters> 232<p class=parameters>
233<tt>Mode</tt> defines the behaviour of the sink. The following 233<tt>Mode</tt> defines the behavior of the sink. The following
234options are available: 234options are available:
235</p> 235</p>
236<ul> 236<ul>
@@ -395,7 +395,7 @@ This constant has a string describing the current LuaSocket version.
395<p> 395<p>
396<small> 396<small>
397Last modified by Diego Nehab on <br> 397Last modified by Diego Nehab on <br>
398Sun Nov 28 03:19:00 EST 2004 398Mon Nov 21 01:58:06 EST 2005
399</small> 399</small>
400</p> 400</p>
401</center> 401</center>
diff --git a/doc/tcp.html b/doc/tcp.html
index 2c687c0..5814e1a 100644
--- a/doc/tcp.html
+++ b/doc/tcp.html
@@ -177,7 +177,7 @@ method affects the behavior of <tt>connect</tt>, causing it to return
177with an error in case of a timeout. If that happens, you can still call <a 177with an error in case of a timeout. If that happens, you can still call <a
178href=socket.html#select><tt>socket.select</tt></a> with the socket in the 178href=socket.html#select><tt>socket.select</tt></a> with the socket in the
179<tt>sendt</tt> table. The socket will be writable when the connection is 179<tt>sendt</tt> table. The socket will be writable when the connection is
180stablished. 180established.
181</p> 181</p>
182 182
183<!-- getpeername ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 183<!-- getpeername ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
@@ -539,7 +539,7 @@ This function returns 1.
539<p> 539<p>
540<small> 540<small>
541Last modified by Diego Nehab on <br> 541Last modified by Diego Nehab on <br>
542Sun Nov 28 03:19:00 EST 2004 542Mon Nov 21 01:58:10 EST 2005
543</small> 543</small>
544</p> 544</p>
545</center> 545</center>
diff --git a/doc/udp.html b/doc/udp.html
index ea8f289..60c5ba3 100644
--- a/doc/udp.html
+++ b/doc/udp.html
@@ -406,7 +406,7 @@ imperative nature obvious.
406<p> 406<p>
407<small> 407<small>
408Last modified by Diego Nehab on <br> 408Last modified by Diego Nehab on <br>
409Sun Nov 28 03:19:00 EST 2004 409Mon Nov 21 01:58:15 EST 2005
410</small> 410</small>
411</p> 411</p>
412</center> 412</center>
diff --git a/doc/url.html b/doc/url.html
index ac84d24..5785224 100644
--- a/doc/url.html
+++ b/doc/url.html
@@ -319,7 +319,7 @@ The function returns the decoded string.
319<p> 319<p>
320<small> 320<small>
321Last modified by Diego Nehab on <br> 321Last modified by Diego Nehab on <br>
322Sun Nov 28 03:19:00 EST 2004 322Mon Nov 21 01:58:20 EST 2005
323</small> 323</small>
324</p> 324</p>
325</center> 325</center>
diff --git a/etc/lp.lua b/etc/lp.lua
index a60fb86..3757e2d 100644
--- a/etc/lp.lua
+++ b/etc/lp.lua
@@ -11,6 +11,8 @@
11-- make sure LuaSocket is loaded 11-- make sure LuaSocket is loaded
12local io = require("io") 12local io = require("io")
13local base = _G 13local base = _G
14local os = require("os")
15local math = require("math")
14local string = require("string") 16local string = require("string")
15local socket = require("socket") 17local socket = require("socket")
16local ltn12 = require("ltn12") 18local ltn12 = require("ltn12")
@@ -192,6 +194,7 @@ local function send_data(con,fh,size)
192 con.try(size == 0, "file size mismatch") 194 con.try(size == 0, "file size mismatch")
193 end 195 end
194 end 196 end
197 recv_ack(con) -- note the double acknowledgement
195 send_ack(con) 198 send_ack(con)
196 recv_ack(con) 199 recv_ack(con)
197 return size 200 return size
@@ -224,7 +227,7 @@ local control_dflt = {
224local seq = 0 227local seq = 0
225local function newjob(connection) 228local function newjob(connection)
226 seq = seq + 1 229 seq = seq + 1
227 return math.floor(socket.gettime() * 1000 + seq) 230 return math.floor(socket.gettime() * 1000 + seq)%1000
228end 231end
229 232
230 233
@@ -241,22 +244,24 @@ local format_codes = {
241 f = 'f' 244 f = 'f'
242} 245}
243 246
244-- lp.send 247-- lp.send{option}
248-- requires option.file
245 249
246send = socket.protect(function(file, option) 250send = socket.protect(function(option)
247 socket.try(file, "invalid file name")
248 socket.try(option and base.type(option) == "table", "invalid options") 251 socket.try(option and base.type(option) == "table", "invalid options")
252 local file = option.file
253 socket.try(file, "invalid file name")
249 local fh = socket.try(io.open(file,"rb")) 254 local fh = socket.try(io.open(file,"rb"))
250 local datafile_size = fh:seek("end") -- get total size 255 local datafile_size = fh:seek("end") -- get total size
251 fh:seek("set") -- go back to start of file 256 fh:seek("set") -- go back to start of file
252 local localhost = socket.dns.gethostname() or os.getenv("COMPUTERNAME") 257 local localhost = socket.dns.gethostname() or os.getenv("COMPUTERNAME")
253 or "localhost" 258 or "localhost"
254 local con = connect(localhost, option) 259 local con = connect(localhost, option)
255-- format the control file 260-- format the control file
256 local jobno = newjob() 261 local jobno = newjob()
257 local localip = socket.dns.toip(localhost) 262 local localip = socket.dns.toip(localhost)
258 localhost = string.sub(localhost,1,31) 263 localhost = string.sub(localhost,1,31)
259 local user = string.sub(option.user or os.getenv("LPRUSER") or 264 local user = string.sub(option.user or os.getenv("LPRUSER") or
260 os.getenv("USERNAME") or os.getenv("USER") or "anonymous", 1,31) 265 os.getenv("USERNAME") or os.getenv("USER") or "anonymous", 1,31)
261 local lpfile = string.format("dfA%3.3d%-s", jobno, localhost); 266 local lpfile = string.format("dfA%3.3d%-s", jobno, localhost);
262 local fmt = format_codes[option.format] or 'l' 267 local fmt = format_codes[option.format] or 'l'
@@ -306,15 +311,14 @@ end)
306-- 311--
307query = socket.protect(function(p) 312query = socket.protect(function(p)
308 p = p or {} 313 p = p or {}
309 local localhost = socket.dns.gethostname() or os.getenv("COMPUTERNAME") 314 local localhost = socket.dns.gethostname() or os.getenv("COMPUTERNAME")
310 or "localhost" 315 or "localhost"
311 local con = connect(localhost,p) 316 local con = connect(localhost,p)
312 local fmt 317 local fmt
313 if string.sub(p.format or 's',1,1) == 's' then fmt = 3 else fmt = 4 end 318 if string.sub(p.format or 's',1,1) == 's' then fmt = 3 else fmt = 4 end
314 con.try(con.skt:send(string.format("%c%s %s\n", fmt, p.queue or "*", 319 con.try(con.skt:send(string.format("%c%s %s\n", fmt, p.queue or "*",
315 p.list or ""))) 320 p.list or "")))
316 local data = con.try(con.skt:receive("*a")) 321 local data = con.try(con.skt:receive("*a"))
317 con.skt:close() 322 con.skt:close()
318 return data 323 return data
319end) 324end)
320