aboutsummaryrefslogtreecommitdiff
path: root/lua.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lua.h46
1 files changed, 33 insertions, 13 deletions
diff --git a/lua.h b/lua.h
index 040cc8e4..58f31646 100644
--- a/lua.h
+++ b/lua.h
@@ -18,8 +18,8 @@
18 18
19 19
20#define LUA_VERSION_MAJOR_N 5 20#define LUA_VERSION_MAJOR_N 5
21#define LUA_VERSION_MINOR_N 4 21#define LUA_VERSION_MINOR_N 5
22#define LUA_VERSION_RELEASE_N 6 22#define LUA_VERSION_RELEASE_N 0
23 23
24#define LUA_VERSION_NUM (LUA_VERSION_MAJOR_N * 100 + LUA_VERSION_MINOR_N) 24#define LUA_VERSION_NUM (LUA_VERSION_MAJOR_N * 100 + LUA_VERSION_MINOR_N)
25#define LUA_VERSION_RELEASE_NUM (LUA_VERSION_NUM * 100 + LUA_VERSION_RELEASE_N) 25#define LUA_VERSION_RELEASE_NUM (LUA_VERSION_NUM * 100 + LUA_VERSION_RELEASE_N)
@@ -80,9 +80,10 @@ typedef struct lua_State lua_State;
80 80
81 81
82/* predefined values in the registry */ 82/* predefined values in the registry */
83#define LUA_RIDX_MAINTHREAD 1 83/* index 1 is reserved for the reference mechanism */
84#define LUA_RIDX_GLOBALS 2 84#define LUA_RIDX_GLOBALS 2
85#define LUA_RIDX_LAST LUA_RIDX_GLOBALS 85#define LUA_RIDX_MAINTHREAD 3
86#define LUA_RIDX_LAST 3
86 87
87 88
88/* type of numbers in Lua */ 89/* type of numbers in Lua */
@@ -159,11 +160,11 @@ extern const char lua_ident[];
159/* 160/*
160** state manipulation 161** state manipulation
161*/ 162*/
162LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud); 163LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud,
164 unsigned int seed);
163LUA_API void (lua_close) (lua_State *L); 165LUA_API void (lua_close) (lua_State *L);
164LUA_API lua_State *(lua_newthread) (lua_State *L); 166LUA_API lua_State *(lua_newthread) (lua_State *L);
165LUA_API int (lua_closethread) (lua_State *L, lua_State *from); 167LUA_API int (lua_closethread) (lua_State *L, lua_State *from);
166LUA_API int (lua_resetthread) (lua_State *L); /* Deprecated! */
167 168
168LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf); 169LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf);
169 170
@@ -244,6 +245,8 @@ LUA_API void (lua_pushnil) (lua_State *L);
244LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n); 245LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n);
245LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n); 246LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n);
246LUA_API const char *(lua_pushlstring) (lua_State *L, const char *s, size_t len); 247LUA_API const char *(lua_pushlstring) (lua_State *L, const char *s, size_t len);
248LUA_API const char *(lua_pushextlstring) (lua_State *L,
249 const char *s, size_t len, lua_Alloc falloc, void *ud);
247LUA_API const char *(lua_pushstring) (lua_State *L, const char *s); 250LUA_API const char *(lua_pushstring) (lua_State *L, const char *s);
248LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt, 251LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt,
249 va_list argp); 252 va_list argp);
@@ -323,7 +326,7 @@ LUA_API void (lua_warning) (lua_State *L, const char *msg, int tocont);
323 326
324 327
325/* 328/*
326** garbage-collection function and options 329** garbage-collection options
327*/ 330*/
328 331
329#define LUA_GCSTOP 0 332#define LUA_GCSTOP 0
@@ -332,11 +335,28 @@ LUA_API void (lua_warning) (lua_State *L, const char *msg, int tocont);
332#define LUA_GCCOUNT 3 335#define LUA_GCCOUNT 3
333#define LUA_GCCOUNTB 4 336#define LUA_GCCOUNTB 4
334#define LUA_GCSTEP 5 337#define LUA_GCSTEP 5
335#define LUA_GCSETPAUSE 6 338#define LUA_GCISRUNNING 6
336#define LUA_GCSETSTEPMUL 7 339#define LUA_GCGEN 7
337#define LUA_GCISRUNNING 9 340#define LUA_GCINC 8
338#define LUA_GCGEN 10 341#define LUA_GCPARAM 9
339#define LUA_GCINC 11 342
343
344/*
345** garbage-collection parameters
346*/
347/* parameters for generational mode */
348#define LUA_GCPMINORMUL 0 /* control minor collections */
349#define LUA_GCPMAJORMINOR 1 /* control shift major->minor */
350#define LUA_GCPMINORMAJOR 2 /* control shift minor->major */
351
352/* parameters for incremental mode */
353#define LUA_GCPPAUSE 3 /* size of pause between successive GCs */
354#define LUA_GCPSTEPMUL 4 /* GC "speed" */
355#define LUA_GCPSTEPSIZE 5 /* GC granularity */
356
357/* number of parameters */
358#define LUA_GCPN 6
359
340 360
341LUA_API int (lua_gc) (lua_State *L, int what, ...); 361LUA_API int (lua_gc) (lua_State *L, int what, ...);
342 362
@@ -423,7 +443,7 @@ LUA_API void (lua_closeslot) (lua_State *L, int idx);
423#define lua_getuservalue(L,idx) lua_getiuservalue(L,idx,1) 443#define lua_getuservalue(L,idx) lua_getiuservalue(L,idx,1)
424#define lua_setuservalue(L,idx) lua_setiuservalue(L,idx,1) 444#define lua_setuservalue(L,idx) lua_setiuservalue(L,idx,1)
425 445
426#define LUA_NUMTAGS LUA_NUMTYPES 446#define lua_resetthread(L) lua_closethread(L,NULL)
427 447
428/* }============================================================== */ 448/* }============================================================== */
429 449