History

Lua 5.2.0-work3

Lua Team committed 16 years ago

Commit d618ddd1 parent be77f2777 files · +3825 −3949Browse files

Showing the changes to src/lua.h (1 of 77 files). Show all

Unified · Split

src/lua.h+18−12
@@ -1,5 +1,5 @@
1/*1/*
2** $Id: lua.h,v 1.261 2010/01/11 17:15:11 roberto Exp $2** $Id: lua.h,v 1.270 2010/05/12 14:09:20 roberto Exp $
3** Lua - A Scripting Language3** Lua - A Scripting Language
4** Lua.org, PUC-Rio, Brazil (http://www.lua.org)4** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
5** See Copyright Notice at the end of this file5** See Copyright Notice at the end of this file
@@ -17,7 +17,7 @@ · 11 unmodified lines
17 17
18 18
19#define LUA_VERSION "Lua 5.2"19#define LUA_VERSION "Lua 5.2"
20#define LUA_RELEASE "Lua 5.2.0 (work2)"20#define LUA_RELEASE "Lua 5.2.0 (work3)"
21#define LUA_VERSION_NUM 50221#define LUA_VERSION_NUM 502
22#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2010 Lua.org, PUC-Rio"22#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2010 Lua.org, PUC-Rio"
23#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes"23#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes"
@@ -34,8 +34,7 @@ · 10 unmodified lines
34** pseudo-indices34** pseudo-indices
35*/35*/
36#define LUA_REGISTRYINDEX LUAI_FIRSTPSEUDOIDX36#define LUA_REGISTRYINDEX LUAI_FIRSTPSEUDOIDX
37#define LUA_ENVIRONINDEX (LUA_REGISTRYINDEX - 1)37#define lua_upvalueindex(i) (LUA_REGISTRYINDEX - (i))
38#define lua_upvalueindex(i) (LUA_ENVIRONINDEX - (i))
39 38
40 39
41/* thread status */40/* thread status */
@@ -82,6 +81,8 @@ typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize); · 40 unmodified lines
82#define LUA_TUSERDATA 781#define LUA_TUSERDATA 7
83#define LUA_TTHREAD 882#define LUA_TTHREAD 8
84 83
84#define LUA_NUMTAGS 9
85
85 86
86 87
87/* minimum Lua stack available to a C function */88/* minimum Lua stack available to a C function */
@@ -90,8 +91,7 @@ typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize); · 2 unmodified lines
90 91
91/* predefined values in the registry */92/* predefined values in the registry */
92#define LUA_RIDX_MAINTHREAD 193#define LUA_RIDX_MAINTHREAD 1
93#define LUA_RIDX_CPCALL 294#define LUA_RIDX_GLOBALS 2
94#define LUA_RIDX_GLOBALS 3
95#define LUA_RIDX_LAST LUA_RIDX_GLOBALS95#define LUA_RIDX_LAST LUA_RIDX_GLOBALS
96 96
97 97
@@ -129,6 +129,7 @@ LUA_API const lua_Number *(lua_version) (lua_State *L); · 31 unmodified lines
129/*129/*
130** basic stack manipulation130** basic stack manipulation
131*/131*/
132LUA_API int (lua_absindex) (lua_State *L, int idx);
132LUA_API int (lua_gettop) (lua_State *L);133LUA_API int (lua_gettop) (lua_State *L);
133LUA_API void (lua_settop) (lua_State *L, int idx);134LUA_API void (lua_settop) (lua_State *L, int idx);
134LUA_API void (lua_pushvalue) (lua_State *L, int idx);135LUA_API void (lua_pushvalue) (lua_State *L, int idx);
@@ -212,7 +213,7 @@ LUA_API void (lua_rawgeti) (lua_State *L, int idx, int n); · 77 unmodified lines
212LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec);213LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec);
213LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz);214LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz);
214LUA_API int (lua_getmetatable) (lua_State *L, int objindex);215LUA_API int (lua_getmetatable) (lua_State *L, int objindex);
215LUA_API void (lua_getfenv) (lua_State *L, int idx);216LUA_API void (lua_getenv) (lua_State *L, int idx);
216 217
217 218
218/*219/*
@@ -223,7 +224,7 @@ LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k); · 4 unmodified lines
223LUA_API void (lua_rawset) (lua_State *L, int idx);224LUA_API void (lua_rawset) (lua_State *L, int idx);
224LUA_API void (lua_rawseti) (lua_State *L, int idx, int n);225LUA_API void (lua_rawseti) (lua_State *L, int idx, int n);
225LUA_API int (lua_setmetatable) (lua_State *L, int objindex);226LUA_API int (lua_setmetatable) (lua_State *L, int objindex);
226LUA_API int (lua_setfenv) (lua_State *L, int idx);227LUA_API void (lua_setenv) (lua_State *L, int idx);
227 228
228 229
229/*230/*
@@ -267,6 +268,8 @@ LUA_API int (lua_status) (lua_State *L); · 37 unmodified lines
267#define LUA_GCSETPAUSE 6268#define LUA_GCSETPAUSE 6
268#define LUA_GCSETSTEPMUL 7269#define LUA_GCSETSTEPMUL 7
269#define LUA_GCISRUNNING 8270#define LUA_GCISRUNNING 8
271#define LUA_GCGEN 9
272#define LUA_GCINC 10
270 273
271LUA_API int (lua_gc) (lua_State *L, int what, int data);274LUA_API int (lua_gc) (lua_State *L, int what, int data);
272 275
@@ -297,11 +300,14 @@ LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud); · 24 unmodified lines
297 300
298#define lua_newtable(L) lua_createtable(L, 0, 0)301#define lua_newtable(L) lua_createtable(L, 0, 0)
299 302
300#define lua_setglobal(L,s) lua_setfield(L, LUA_ENVIRONINDEX, (s))303#define lua_setglobal(L,s) \
301#define lua_getglobal(L,s) lua_getfield(L, LUA_ENVIRONINDEX, (s))304 (lua_pushglobaltable(L), lua_pushvalue(L, -2), \
305 lua_setfield(L, -2, (s)), lua_pop(L, 2))
306
307#define lua_getglobal(L,s) \
308 (lua_pushglobaltable(L), lua_getfield(L, -1, (s)), lua_remove(L, -2))
302 309
303#define lua_register(L,n,f) \310#define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n)))
304 (lua_pushcfunction(L, (f)), lua_setfield(L, LUA_ENVIRONINDEX, (n)))
305 311
306#define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0)312#define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0)
307 313

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t