aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorPhilipp Janda <siffiejoe@gmx.net>2015-01-13 09:07:32 +0100
committerPhilipp Janda <siffiejoe@gmx.net>2015-01-13 09:07:32 +0100
commit305e7f071a48695e82430a948e931a8419998c4d (patch)
tree7cd93965dbd40eed98945cc97f6c47ca8b7c469d /README.md
parent901f1bfdbadc7afa5526ca854a12bdfe8fcb88b3 (diff)
downloadlua-compat-5.3-305e7f071a48695e82430a948e931a8419998c4d.tar.gz
lua-compat-5.3-305e7f071a48695e82430a948e931a8419998c4d.tar.bz2
lua-compat-5.3-305e7f071a48695e82430a948e931a8419998c4d.zip
updated readme
Diffstat (limited to 'README.md')
-rw-r--r--README.md122
1 files changed, 122 insertions, 0 deletions
diff --git a/README.md b/README.md
index ea0a578..96354f3 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,123 @@
1# lua-compat-5.3 1# lua-compat-5.3
2
3Lua-5.3-style APIs for Lua 5.2 and 5.1.
4
5## What is it
6
7This is a small module that aims to make it easier to write code
8in a Lua-5.3-style that is compatible with Lua 5.1, Lua 5.2, and Lua
95.3. This does *not* make Lua 5.2 (or even Lua 5.1) entirely
10compatible with Lua 5.3, but it brings the API closer to that of Lua
115.3.
12
13It includes:
14
15* _For writing C_: A C header and file which can be linked to your
16 Lua module written in C, providing some functions from the C API
17 of Lua 5.3 that do not exist in Lua 5.2 or 5.1, making it easier to
18 write C code that compiles with all three versions of liblua.
19
20## How to use it
21
22### C code
23
24There are two ways of adding the C API compatibility functions/macros to
25your project:
26* If `COMPAT53_PREFIX` is *not* `#define`d, `compat-5.3.h` `#include`s
27 `compat-5.3.c`, and all functions are made `static`. You don't have to
28 compile/link/add `compat-5.3.c` yourself. This is useful for one-file
29 projects.
30* If `COMPAT53_PREFIX` is `#define`d, all exported functions are renamed
31 behind the scenes using this prefix to avoid linker conflicts with other
32 code using this package. This doesn't change the way you call the
33 compatibility functions in your code. You have to compile and link
34 `compat-5.3.c` to your project yourself. You can change the way the
35 functions are exported using the `COMPAT53_API` macro (e.g. if you need
36 some `__declspec` magic).
37
38## What's implemented
39
40### C
41
42* `lua_KContext`
43* `lua_KFunction`
44* `lua_dump` (extra `strip` parameter, ignored)
45* `lua_getfield` (return value)
46* `lua_geti` and `lua_seti`
47* `lua_getglobal` (return value)
48* `lua_getmetafield` (return value)
49* `lua_gettable` (return value)
50* `lua_getuservalue` and `lua_setuservalue` (limited compatibility)
51* `lua_isinteger`
52* `lua_numbertointeger`
53* `lua_callk` and `lua_pcallk` (limited compatibility)
54* `lua_rawget` and `lua_rawgeti` (return values)
55* `lua_rawgetp` and `lua_rawsetp`
56* `luaL_requiref` (now checks `package.loaded`)
57* `lua_rotate`
58* `lua_stringtonumber`
59
60For Lua 5.1 additionally:
61* `LUA_OK`
62* `lua_Unsigned`
63* `luaL_Stream`
64* `LUA_FILEHANDLE`
65* `lua_absindex`
66* `lua_len`, `lua_rawlen`, and `luaL_len`
67* `lua_copy`
68* `lua_pushglobaltable`
69* `luaL_testudata`
70* `luaL_setfuncs`, `luaL_newlibtable`, and `luaL_newlib`
71* `luaL_setmetatable`
72* `luaL_getsubtable`
73* `luaL_traceback`
74* `luaL_fileresult`
75* `luaL_checkversion` (with empty body, only to avoid compile errors)
76* `luaL_tolstring`
77* `luaL_requiref`
78* `lua_pushunsigned`, `lua_tounsignedx`, `lua_tounsigned`,
79 `luaL_checkunsigned`, `luaL_optunsigned`, if
80 `LUA_COMPAT_APIINTCASTS` is defined.
81
82## What's not implemented
83
84* the new Lua functions of Lua 5.3
85* the table library doesn't respect metamethods yet
86* the utf8 library
87* string packing/unpacking
88* Lua 5.1: `_ENV`, `goto`, labels, ephemeron tables, etc.
89* the following C API functions/macros:
90 * `lua_isyieldable`
91 * `lua_getextraspace`
92 * `lua_arith` (not at all in 5.1, operators missing in 5.2)
93 * `lua_pushfstring` (new formats)
94 * `lua_compare` (5.1)
95 * `lua_upvalueid` (5.1)
96 * `lua_upvaluejoin` (5.1)
97 * `lua_version` (5.1)
98 * `lua_yieldk` (5.1)
99 * `luaL_buffinitsize` (5.1)
100 * `luaL_execresult` (5.1)
101 * `luaL_loadbufferx` (5.1)
102 * `luaL_loadfilex` (5.1)
103 * `luaL_prepbuffsize` (5.1)
104 * `luaL_pushresultsize` (5.1)
105
106## See also
107
108* For Lua-5.2-style APIs under Lua 5.1, see
109[lua-compat-5.2](http://github.com/keplerproject/lua-compat-5.2/),
110which also is the basis for most of the code in this project.
111* For Lua-5.1-style APIs under Lua 5.0, see
112[Compat-5.1](http://keplerproject.org/compat/)
113
114## Credits
115
116This package contains code written by:
117
118* [The Lua Team](http://www.lua.org)
119* Philipp Janda ([@siffiejoe](http://github.com/siffiejoe))
120* Tomás Guisasola Gorham ([@tomasguisasola](http://github.com/tomasguisasola))
121* Hisham Muhammad ([@hishamhm](http://github.com/hishamhm))
122* Renato Maia ([@renatomaia](http://github.com/renatomaia))
123