PageRenderTime 21ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/src/external/lua-5.2.3/doc/readme.html

https://gitlab.com/Blueprint-Marketing/ossec-hids
HTML | 413 lines | 362 code | 48 blank | 3 comment | 0 complexity | 3a6975806f910b08db10219fbdd5482c MD5 | raw file
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <HTML>
  3. <HEAD>
  4. <TITLE>Lua 5.2 readme</TITLE>
  5. <LINK REL="stylesheet" TYPE="text/css" HREF="lua.css">
  6. <META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1">
  7. <STYLE TYPE="text/css">
  8. blockquote, .display {
  9. border: solid #a0a0a0 2px ;
  10. border-radius: 8px ;
  11. padding: 1em ;
  12. margin: 0px ;
  13. }
  14. .display {
  15. word-spacing: 0.25em ;
  16. }
  17. dl.display dd {
  18. padding-bottom: 0.2em ;
  19. }
  20. tt, kbd, code {
  21. font-size: 12pt ;
  22. }
  23. </STYLE>
  24. </HEAD>
  25. <BODY>
  26. <HR>
  27. <H1>
  28. <A HREF="http://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua" BORDER=0></A>
  29. Welcome to Lua 5.2
  30. </H1>
  31. <P>
  32. <A HREF="#about">about</A>
  33. &middot;
  34. <A HREF="#install">installation</A>
  35. &middot;
  36. <A HREF="#changes">changes</A>
  37. &middot;
  38. <A HREF="#license">license</A>
  39. &middot;
  40. <A HREF="contents.html">reference manual</A>
  41. <H2><A NAME="about">About Lua</A></H2>
  42. <P>
  43. Lua is a powerful, fast, lightweight, embeddable scripting language
  44. developed by a
  45. <A HREF="http://www.lua.org/authors.html">team</A>
  46. at
  47. <A HREF="http://www.puc-rio.br/">PUC-Rio</A>,
  48. the Pontifical Catholic University of Rio de Janeiro in Brazil.
  49. Lua is
  50. <A HREF="#license">free software</A>
  51. used in many products and projects around the world.
  52. <P>
  53. Lua's
  54. <A HREF="http://www.lua.org/">official web site</A>
  55. provides complete information
  56. about Lua,
  57. including
  58. an
  59. <A HREF="http://www.lua.org/about.html">executive summary</A>
  60. and
  61. updated
  62. <A HREF="http://www.lua.org/docs.html">documentation</A>,
  63. especially the
  64. <A HREF="http://www.lua.org/manual/5.2/">reference manual</A>,
  65. which may differ slightly from the
  66. <A HREF="contents.html">local copy</A>
  67. distributed in this package.
  68. <H2><A NAME="install">Installing Lua</A></H2>
  69. <P>
  70. Lua is distributed in
  71. <A HREF="http://www.lua.org/ftp/">source</A>
  72. form.
  73. You need to build it before using it.
  74. Building Lua should be straightforward
  75. because
  76. Lua is implemented in pure ANSI C and compiles unmodified in all known
  77. platforms that have an ANSI C compiler.
  78. Lua also compiles unmodified as C++.
  79. The instructions given below for building Lua are for Unix-like platforms.
  80. See also
  81. <A HREF="#other">instructions for other systems</A>
  82. and
  83. <A HREF="#customization">customization options</A>.
  84. <P>
  85. If you don't have the time or the inclination to compile Lua yourself,
  86. get a binary from
  87. <A HREF="http://lua-users.org/wiki/LuaBinaries">LuaBinaries</A>.
  88. Try also
  89. <A HREF="http://luaforwindows.luaforge.net/">Lua for Windows</A>,
  90. an easy-to-use distribution of Lua that includes many useful libraries.
  91. <H3>Building Lua</H3>
  92. <P>
  93. In most Unix-like platforms, simply do "<KBD>make</KBD>" with a suitable target.
  94. Here are the details.
  95. <OL>
  96. <LI>
  97. Open a terminal window and move to
  98. the top-level directory, which is named <TT>lua-5.2.3</TT>.
  99. The Makefile there controls both the build process and the installation process.
  100. <P>
  101. <LI>
  102. Do "<KBD>make</KBD>" and see if your platform is listed.
  103. The platforms currently supported are:
  104. <P>
  105. <P CLASS="display">
  106. aix ansi bsd freebsd generic linux macosx mingw posix solaris
  107. </P>
  108. <P>
  109. If your platform is listed, just do "<KBD>make xxx</KBD>", where xxx
  110. is your platform name.
  111. <P>
  112. If your platform is not listed, try the closest one or posix, generic,
  113. ansi, in this order.
  114. <P>
  115. <LI>
  116. The compilation takes only a few moments
  117. and produces three files in the <TT>src</TT> directory:
  118. lua (the interpreter),
  119. luac (the compiler),
  120. and liblua.a (the library).
  121. <P>
  122. <LI>
  123. To check that Lua has been built correctly, do "<KBD>make test</KBD>"
  124. after building Lua. This will run the interpreter and print its version string.
  125. </OL>
  126. <P>
  127. If you're running Linux and get compilation errors,
  128. make sure you have installed the <TT>readline</TT> development package.
  129. If you get link errors after that,
  130. then try "<KBD>make linux MYLIBS=-ltermcap</KBD>".
  131. <H3>Installing Lua</H3>
  132. <P>
  133. Once you have built Lua, you may want to install it in an official
  134. place in your system. In this case, do "<KBD>make install</KBD>". The official
  135. place and the way to install files are defined in the Makefile. You'll
  136. probably need the right permissions to install files.
  137. <P>
  138. To build and install Lua in one step, do "<KBD>make xxx install</KBD>",
  139. where xxx is your platform name.
  140. <P>
  141. To install Lua locally, do "<KBD>make local</KBD>".
  142. This will create a directory <TT>install</TT> with subdirectories
  143. <TT>bin</TT>, <TT>include</TT>, <TT>lib</TT>, <TT>man</TT>,
  144. and install Lua as listed below.
  145. To install Lua locally, but in some other directory, do
  146. "<KBD>make install INSTALL_TOP=xxx</KBD>", where xxx is your chosen directory.
  147. <DL CLASS="display">
  148. <DT>
  149. bin:
  150. <DD>
  151. lua luac
  152. <DT>
  153. include:
  154. <DD>
  155. lua.h luaconf.h lualib.h lauxlib.h lua.hpp
  156. <DT>
  157. lib:
  158. <DD>
  159. liblua.a
  160. <DT>
  161. man/man1:
  162. <DD>
  163. lua.1 luac.1
  164. </DL>
  165. <P>
  166. These are the only directories you need for development.
  167. If you only want to run Lua programs,
  168. you only need the files in bin and man.
  169. The files in include and lib are needed for
  170. embedding Lua in C or C++ programs.
  171. <H3><A NAME="customization">Customization</A></H3>
  172. <P>
  173. Three kinds of things can be customized by editing a file:
  174. <UL>
  175. <LI> Where and how to install Lua &mdash; edit <TT>Makefile</TT>.
  176. <LI> How to build Lua &mdash; edit <TT>src/Makefile</TT>.
  177. <LI> Lua features &mdash; edit <TT>src/luaconf.h</TT>.
  178. </UL>
  179. <P>
  180. You don't actually need to edit the Makefiles because you may set the
  181. relevant variables in the command line when invoking make.
  182. Nevertheless, it's probably best to edit and save the Makefiles to
  183. record the changes you need.
  184. <P>
  185. On the other hand, if you need to customize some Lua features, you'll need
  186. to edit <TT>src/luaconf.h</TT> before building and installing Lua.
  187. The edited file will be the one installed, and
  188. it will be used by any Lua clients that you build, to ensure consistency.
  189. Further customization is available to experts by editing the Lua sources.
  190. <P>
  191. We strongly recommend that you enable dynamic loading in <TT>src/luaconf.h</TT>.
  192. This is done automatically for all platforms listed above that have
  193. this feature and also for Windows.
  194. <H3><A NAME="other">Building Lua on other systems</A></H3>
  195. <P>
  196. If you're not using the usual Unix tools, then the instructions for
  197. building Lua depend on the compiler you use. You'll need to create
  198. projects (or whatever your compiler uses) for building the library,
  199. the interpreter, and the compiler, as follows:
  200. <DL CLASS="display">
  201. <DT>
  202. library:
  203. <DD>
  204. lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c
  205. lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c ltable.c
  206. ltm.c lundump.c lvm.c lzio.c
  207. lauxlib.c lbaselib.c lbitlib.c lcorolib.c ldblib.c liolib.c
  208. lmathlib.c loslib.c lstrlib.c ltablib.c loadlib.c linit.c
  209. <DT>
  210. interpreter:
  211. <DD>
  212. library, lua.c
  213. <DT>
  214. compiler:
  215. <DD>
  216. library, luac.c
  217. </DL>
  218. <P>
  219. To use Lua as a library in your own programs you'll need to know how to
  220. create and use libraries with your compiler. Moreover, to dynamically load
  221. C libraries for Lua you'll need to know how to create dynamic libraries
  222. and you'll need to make sure that the Lua API functions are accessible to
  223. those dynamic libraries &mdash; but <EM>don't</EM> link the Lua library
  224. into each dynamic library. For Unix, we recommend that the Lua library
  225. be linked statically into the host program and its symbols exported for
  226. dynamic linking; <TT>src/Makefile</TT> does this for the Lua interpreter.
  227. For Windows, we recommend that the Lua library be a DLL.
  228. <P>
  229. As mentioned above, you may edit <TT>src/luaconf.h</TT> to customize
  230. some features before building Lua.
  231. <H2><A NAME="changes">Changes since Lua 5.1</A></H2>
  232. <P>
  233. Here are the main changes introduced in Lua 5.2.
  234. The
  235. <A HREF="contents.html">reference manual</A>
  236. lists the
  237. <A HREF="manual.html#8">incompatibilities</A> that had to be introduced.
  238. <H3>Main changes</H3>
  239. <UL>
  240. <LI> yieldable pcall and metamethods
  241. <LI> new lexical scheme for globals
  242. <LI> ephemeron tables
  243. <LI> new library for bitwise operations
  244. <LI> light C functions
  245. <LI> emergency garbage collector
  246. <LI> <CODE>goto</CODE> statement
  247. <LI> finalizers for tables
  248. </UL>
  249. Here are the other changes introduced in Lua 5.2:
  250. <H3>Language</H3>
  251. <UL>
  252. <LI> no more fenv for threads or functions
  253. <LI> tables honor the <CODE>__len</CODE> metamethod
  254. <LI> hex and <CODE>\z</CODE> escapes in strings
  255. <LI> support for hexadecimal floats
  256. <LI> order metamethods work for different types
  257. <LI> no more verification of opcode consistency
  258. <LI> hook event "tail return" replaced by "tail call"
  259. <LI> empty statement
  260. <LI> <CODE>break</CODE> statement may appear in the middle of a block
  261. </UL>
  262. <H3>Libraries</H3>
  263. <UL>
  264. <LI> arguments for function called through <CODE>xpcall</CODE>
  265. <LI> optional 'mode' argument to load and loadfile (to control binary x text)
  266. <LI> optional 'env' argument to load and loadfile (environment for loaded chunk)
  267. <LI> <CODE>loadlib</CODE> may load libraries with global names (RTLD_GLOBAL)
  268. <LI> new function <CODE>package.searchpath</CODE>
  269. <LI> modules receive their paths when loaded
  270. <LI> optional base in <CODE>math.log</CODE>
  271. <LI> optional separator in <CODE>string.rep</CODE>
  272. <LI> <CODE>file:write</CODE> returns <CODE>file</CODE>
  273. <LI> closing a pipe returns exit status
  274. <LI> <CODE>os.exit</CODE> may close state
  275. <LI> new metamethods <CODE>__pairs</CODE> and <CODE>__ipairs</CODE>
  276. <LI> new option 'isrunning' for <CODE>collectgarbage</CODE> and <CODE>lua_gc</CODE>
  277. <LI> frontier patterns
  278. <LI> <CODE>\0</CODE> in patterns
  279. <LI> new option <CODE>*L</CODE> for <CODE>io.read</CODE>
  280. <LI> options for <CODE>io.lines</CODE>
  281. <LI> <CODE>debug.getlocal</CODE> can access function varargs
  282. </UL>
  283. <H3>C API</H3>
  284. <UL>
  285. <LI> main thread predefined in the registry
  286. <LI> new functions
  287. <CODE>lua_absindex</CODE>,
  288. <CODE>lua_arith</CODE>,
  289. <CODE>lua_compare</CODE>,
  290. <CODE>lua_copy</CODE>,
  291. <CODE>lua_len</CODE>,
  292. <CODE>lua_rawgetp</CODE>,
  293. <CODE>lua_rawsetp</CODE>,
  294. <CODE>lua_upvalueid</CODE>,
  295. <CODE>lua_upvaluejoin</CODE>,
  296. <CODE>lua_version</CODE>.
  297. <LI> new functions
  298. <CODE>luaL_checkversion</CODE>,
  299. <CODE>luaL_setmetatable</CODE>,
  300. <CODE>luaL_testudata</CODE>,
  301. <CODE>luaL_tolstring</CODE>.
  302. <LI> <CODE>lua_pushstring</CODE> and <CODE>pushlstring</CODE> return string
  303. <LI> <CODE>nparams</CODE> and <CODE>isvararg</CODE> available in debug API
  304. <LI> new <CODE>lua_Unsigned</CODE>
  305. </UL>
  306. <H3>Implementation</H3>
  307. <UL>
  308. <LI> max constants per function raised to 2<SUP>26</SUP>
  309. <LI> generational mode for garbage collection (experimental)
  310. <LI> NaN trick (experimental)
  311. <LI> internal (immutable) version of ctypes
  312. <LI> simpler implementation for string buffers
  313. <LI> parser uses much less C-stack space (no more auto arrays)
  314. </UL>
  315. <H3>Lua standalone interpreter</H3>
  316. <UL>
  317. <LI> new <CODE>-E</CODE> option to avoid environment variables
  318. <LI> handling of non-string error messages
  319. </UL>
  320. <H2><A NAME="license">License</A></H2>
  321. <A HREF="http://www.opensource.org/docs/definition.php">
  322. <IMG SRC="osi-certified-72x60.png" ALIGN="right" BORDER="0" ALT="[osi certified]" STYLE="padding-left: 30px ;">
  323. </A>
  324. <P>
  325. Lua is free software distributed under the terms of the
  326. <A HREF="http://www.opensource.org/licenses/mit-license.html">MIT license</A>
  327. reproduced below;
  328. it may be used for any purpose, including commercial purposes,
  329. at absolutely no cost without having to ask us.
  330. The only requirement is that if you do use Lua,
  331. then you should give us credit by including the appropriate copyright notice somewhere in your product or its documentation.
  332. For details, see
  333. <A HREF="http://www.lua.org/license.html">this</A>.
  334. <BLOCKQUOTE STYLE="padding-bottom: 0em">
  335. Copyright &copy; 1994&ndash;2013 Lua.org, PUC-Rio.
  336. <P>
  337. Permission is hereby granted, free of charge, to any person obtaining a copy
  338. of this software and associated documentation files (the "Software"), to deal
  339. in the Software without restriction, including without limitation the rights
  340. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  341. copies of the Software, and to permit persons to whom the Software is
  342. furnished to do so, subject to the following conditions:
  343. <P>
  344. The above copyright notice and this permission notice shall be included in
  345. all copies or substantial portions of the Software.
  346. <P>
  347. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  348. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  349. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  350. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  351. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  352. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  353. THE SOFTWARE.
  354. </BLOCKQUOTE>
  355. <P>
  356. <HR>
  357. <SMALL CLASS="footer">
  358. Last update:
  359. Sat Nov 9 22:39:16 BRST 2013
  360. </SMALL>
  361. <!--
  362. Last change: revised for Lua 5.2.3
  363. -->
  364. </BODY>
  365. </HTML>