Almost ready to release.

This commit is contained in:
Diego Nehab 2005-09-29 06:11:42 +00:00
parent 773e35ced3
commit a32c6d9140
38 changed files with 115 additions and 383 deletions

View file

@ -63,24 +63,28 @@ the package scheme will likely already have been answered.
<h3>Directory structure</h3>
<p> The standard distribution reserves a directory to be the root of
the libraries installed
on a given system. Let's call this directory <tt>&lt;ROOT&gt;</tt>.
On my system, this is the <tt>/usr/local/share/lua/5.0</tt> directory.
Here is the standard LuaSocket distribution directory structure:</p>
<p> On Unix systems, the standard distribution uses two base
directories, one for system dependent files, and another for system
independent files. Let's call these directories <tt>&lt;LIB&gt;</tt>
and <tt>&lt;SHARE&gt;</tt>, respectively.
For instance, in my laptop, I use '<tt>/usr/local/lib/lua/5.0</tt>' for
<tt>&lt;LIB&gt;</tt> and '<tt>/usr/local/share/lua/5.0</tt>' for
<tt>&lt;SHARE&gt;</tt>. On Windows, only one directory is used, say
'<tt>c:\program files\lua\5.0</tt>'. Here is the standard LuaSocket
distribution directory structure:</p>
<pre class=example>
&lt;ROOT&gt;/compat-5.1.lua
&lt;ROOT&gt;/ltn12.lua
&lt;ROOT&gt;/mime/init.lua
&lt;ROOT&gt;/mime/core.dll
&lt;ROOT&gt;/socket/init.lua
&lt;ROOT&gt;/socket/core.dll
&lt;ROOT&gt;/socket/http.lua
&lt;ROOT&gt;/socket/tp.lua
&lt;ROOT&gt;/socket/ftp.lua
&lt;ROOT&gt;/socket/smtp.lua
&lt;ROOT&gt;/socket/url.lua
&lt;SHARE&gt;/compat-5.1.lua
&lt;SHARE&gt;/ltn12.lua
&lt;SHARE&gt;/mime/init.lua
&lt;LIB&gt;/mime/core.dll
&lt;SHARE&gt;/socket/init.lua
&lt;LIB&gt;/socket/core.dll
&lt;SHARE&gt;/socket/http.lua
&lt;SHARE&gt;/socket/tp.lua
&lt;SHARE&gt;/socket/ftp.lua
&lt;SHARE&gt;/socket/smtp.lua
&lt;SHARE&gt;/socket/url.lua
</pre>
<p> Naturally, on Unix systems, <tt>core.dll</tt>
@ -91,7 +95,7 @@ environment variables need to be set. The first environment variable tells
the interpreter to load the <tt>compat-5.1.lua</tt> module at startup: </p>
<pre class=example>
LUA_INIT=@&lt;ROOT&gt;/compat-5.1.lua
LUA_INIT=@&lt;SHARE&gt;/compat-5.1.lua
</pre>
<p>
@ -101,13 +105,12 @@ directories and with the appropriate filename extensions.
</p>
<pre class=example>
LUA_PATH=&lt;ROOT&gt;/?.lua;?.lua
LUA_CPATH=&lt;ROOT&gt;/?.dll;?.dll
LUA_PATH=&lt;SHARE&gt;/?.lua;?.lua
LUA_CPATH=&lt;LIB&gt;/?.dll;?.dll
</pre>
<p> Again, naturally, in Unix the shared library extension would be
<tt>.so</tt> instead of <tt>.dll</tt> and on Mac OS X it would be
<tt>.dylib</tt></p>
<p> Again, naturally, on Unix systmems the shared library extension would be
<tt>.so</tt> instead of <tt>.dll</tt></p>
<h3>Using LuaSocket</h3>
@ -118,8 +121,8 @@ it should be easy to use LuaSocket. Just fire the interpreter and use the
<pre class=example>
Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio
&gt; socket = require("socket")
&gt; print(socket.VERSION)
--&gt; LuaSocket 2.0 (beta3)
&gt; print(socket._VERSION)
--&gt; LuaSocket 2.0
</pre>
<p> Each module loads their dependencies automatically, so you only need to
@ -128,7 +131,8 @@ load the modues you directly depend upon: <p>
<pre class=example>
Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio
&gt; http = require("socket.http")
&gt; print(http.request("http://www.tecgraf.puc-rio.br/luasocket"))
&gt;
print(http.request("http://www.cs.princeton.edu/~diego/professional/luasocket"))
--&gt; homepage gets dumped to terminal
</pre>