aboutsummaryrefslogtreecommitdiff
path: root/src/lua/lua.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lua/lua.h (renamed from src/lua-5.3/lua.h)65
1 files changed, 48 insertions, 17 deletions
diff --git a/src/lua-5.3/lua.h b/src/lua/lua.h
index c236e36..b348c14 100644
--- a/src/lua-5.3/lua.h
+++ b/src/lua/lua.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.h,v 1.332.1.2 2018/06/13 16:58:17 roberto Exp $ 2** $Id: lua.h $
3** Lua - A Scripting Language 3** 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 file 5** See Copyright Notice at the end of this file
@@ -17,13 +17,15 @@
17 17
18 18
19#define LUA_VERSION_MAJOR "5" 19#define LUA_VERSION_MAJOR "5"
20#define LUA_VERSION_MINOR "3" 20#define LUA_VERSION_MINOR "4"
21#define LUA_VERSION_NUM 503 21#define LUA_VERSION_RELEASE "0"
22#define LUA_VERSION_RELEASE "5" 22
23#define LUA_VERSION_NUM 504
24#define LUA_VERSION_RELEASE_NUM (LUA_VERSION_NUM * 100 + 0)
23 25
24#define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR 26#define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
25#define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE 27#define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE
26#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2018 Lua.org, PUC-Rio" 28#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2020 Lua.org, PUC-Rio"
27#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes" 29#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes"
28 30
29 31
@@ -49,8 +51,7 @@
49#define LUA_ERRRUN 2 51#define LUA_ERRRUN 2
50#define LUA_ERRSYNTAX 3 52#define LUA_ERRSYNTAX 3
51#define LUA_ERRMEM 4 53#define LUA_ERRMEM 4
52#define LUA_ERRGCMM 5 54#define LUA_ERRERR 5
53#define LUA_ERRERR 6
54 55
55 56
56typedef struct lua_State lua_State; 57typedef struct lua_State lua_State;
@@ -71,7 +72,7 @@ typedef struct lua_State lua_State;
71#define LUA_TUSERDATA 7 72#define LUA_TUSERDATA 7
72#define LUA_TTHREAD 8 73#define LUA_TTHREAD 8
73 74
74#define LUA_NUMTAGS 9 75#define LUA_NUMTYPES 9
75 76
76 77
77 78
@@ -124,6 +125,13 @@ typedef int (*lua_Writer) (lua_State *L, const void *p, size_t sz, void *ud);
124typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize); 125typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize);
125 126
126 127
128/*
129** Type for warning functions
130*/
131typedef void (*lua_WarnFunction) (void *ud, const char *msg, int tocont);
132
133
134
127 135
128/* 136/*
129** generic extra include file 137** generic extra include file
@@ -145,11 +153,12 @@ extern const char lua_ident[];
145LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud); 153LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud);
146LUA_API void (lua_close) (lua_State *L); 154LUA_API void (lua_close) (lua_State *L);
147LUA_API lua_State *(lua_newthread) (lua_State *L); 155LUA_API lua_State *(lua_newthread) (lua_State *L);
156LUA_API int (lua_resetthread) (lua_State *L);
148 157
149LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf); 158LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf);
150 159
151 160
152LUA_API const lua_Number *(lua_version) (lua_State *L); 161LUA_API lua_Number (lua_version) (lua_State *L);
153 162
154 163
155/* 164/*
@@ -182,7 +191,7 @@ LUA_API lua_Number (lua_tonumberx) (lua_State *L, int idx, int *isnum);
182LUA_API lua_Integer (lua_tointegerx) (lua_State *L, int idx, int *isnum); 191LUA_API lua_Integer (lua_tointegerx) (lua_State *L, int idx, int *isnum);
183LUA_API int (lua_toboolean) (lua_State *L, int idx); 192LUA_API int (lua_toboolean) (lua_State *L, int idx);
184LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len); 193LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len);
185LUA_API size_t (lua_rawlen) (lua_State *L, int idx); 194LUA_API lua_Unsigned (lua_rawlen) (lua_State *L, int idx);
186LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx); 195LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx);
187LUA_API void *(lua_touserdata) (lua_State *L, int idx); 196LUA_API void *(lua_touserdata) (lua_State *L, int idx);
188LUA_API lua_State *(lua_tothread) (lua_State *L, int idx); 197LUA_API lua_State *(lua_tothread) (lua_State *L, int idx);
@@ -247,9 +256,9 @@ LUA_API int (lua_rawgeti) (lua_State *L, int idx, lua_Integer n);
247LUA_API int (lua_rawgetp) (lua_State *L, int idx, const void *p); 256LUA_API int (lua_rawgetp) (lua_State *L, int idx, const void *p);
248 257
249LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); 258LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec);
250LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz); 259LUA_API void *(lua_newuserdatauv) (lua_State *L, size_t sz, int nuvalue);
251LUA_API int (lua_getmetatable) (lua_State *L, int objindex); 260LUA_API int (lua_getmetatable) (lua_State *L, int objindex);
252LUA_API int (lua_getuservalue) (lua_State *L, int idx); 261LUA_API int (lua_getiuservalue) (lua_State *L, int idx, int n);
253 262
254 263
255/* 264/*
@@ -263,7 +272,7 @@ LUA_API void (lua_rawset) (lua_State *L, int idx);
263LUA_API void (lua_rawseti) (lua_State *L, int idx, lua_Integer n); 272LUA_API void (lua_rawseti) (lua_State *L, int idx, lua_Integer n);
264LUA_API void (lua_rawsetp) (lua_State *L, int idx, const void *p); 273LUA_API void (lua_rawsetp) (lua_State *L, int idx, const void *p);
265LUA_API int (lua_setmetatable) (lua_State *L, int objindex); 274LUA_API int (lua_setmetatable) (lua_State *L, int objindex);
266LUA_API void (lua_setuservalue) (lua_State *L, int idx); 275LUA_API int (lua_setiuservalue) (lua_State *L, int idx, int n);
267 276
268 277
269/* 278/*
@@ -288,7 +297,8 @@ LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data, int strip);
288*/ 297*/
289LUA_API int (lua_yieldk) (lua_State *L, int nresults, lua_KContext ctx, 298LUA_API int (lua_yieldk) (lua_State *L, int nresults, lua_KContext ctx,
290 lua_KFunction k); 299 lua_KFunction k);
291LUA_API int (lua_resume) (lua_State *L, lua_State *from, int narg); 300LUA_API int (lua_resume) (lua_State *L, lua_State *from, int narg,
301 int *nres);
292LUA_API int (lua_status) (lua_State *L); 302LUA_API int (lua_status) (lua_State *L);
293LUA_API int (lua_isyieldable) (lua_State *L); 303LUA_API int (lua_isyieldable) (lua_State *L);
294 304
@@ -296,6 +306,13 @@ LUA_API int (lua_isyieldable) (lua_State *L);
296 306
297 307
298/* 308/*
309** Warning-related functions
310*/
311LUA_API void (lua_setwarnf) (lua_State *L, lua_WarnFunction f, void *ud);
312LUA_API void (lua_warning) (lua_State *L, const char *msg, int tocont);
313
314
315/*
299** garbage-collection function and options 316** garbage-collection function and options
300*/ 317*/
301 318
@@ -308,8 +325,10 @@ LUA_API int (lua_isyieldable) (lua_State *L);
308#define LUA_GCSETPAUSE 6 325#define LUA_GCSETPAUSE 6
309#define LUA_GCSETSTEPMUL 7 326#define LUA_GCSETSTEPMUL 7
310#define LUA_GCISRUNNING 9 327#define LUA_GCISRUNNING 9
328#define LUA_GCGEN 10
329#define LUA_GCINC 11
311 330
312LUA_API int (lua_gc) (lua_State *L, int what, int data); 331LUA_API int (lua_gc) (lua_State *L, int what, ...);
313 332
314 333
315/* 334/*
@@ -328,6 +347,7 @@ LUA_API size_t (lua_stringtonumber) (lua_State *L, const char *s);
328LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud); 347LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud);
329LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud); 348LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud);
330 349
350LUA_API void (lua_toclose) (lua_State *L, int idx);
331 351
332 352
333/* 353/*
@@ -377,7 +397,7 @@ LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud);
377 397
378/* 398/*
379** {============================================================== 399** {==============================================================
380** compatibility macros for unsigned conversions 400** compatibility macros
381** =============================================================== 401** ===============================================================
382*/ 402*/
383#if defined(LUA_COMPAT_APIINTCASTS) 403#if defined(LUA_COMPAT_APIINTCASTS)
@@ -387,6 +407,13 @@ LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud);
387#define lua_tounsigned(L,i) lua_tounsignedx(L,(i),NULL) 407#define lua_tounsigned(L,i) lua_tounsignedx(L,(i),NULL)
388 408
389#endif 409#endif
410
411#define lua_newuserdata(L,s) lua_newuserdatauv(L,s,1)
412#define lua_getuservalue(L,idx) lua_getiuservalue(L,idx,1)
413#define lua_setuservalue(L,idx) lua_setiuservalue(L,idx,1)
414
415#define LUA_NUMTAGS LUA_NUMTYPES
416
390/* }============================================================== */ 417/* }============================================================== */
391 418
392/* 419/*
@@ -437,6 +464,7 @@ LUA_API lua_Hook (lua_gethook) (lua_State *L);
437LUA_API int (lua_gethookmask) (lua_State *L); 464LUA_API int (lua_gethookmask) (lua_State *L);
438LUA_API int (lua_gethookcount) (lua_State *L); 465LUA_API int (lua_gethookcount) (lua_State *L);
439 466
467LUA_API int (lua_setcstacklimit) (lua_State *L, unsigned int limit);
440 468
441struct lua_Debug { 469struct lua_Debug {
442 int event; 470 int event;
@@ -444,6 +472,7 @@ struct lua_Debug {
444 const char *namewhat; /* (n) 'global', 'local', 'field', 'method' */ 472 const char *namewhat; /* (n) 'global', 'local', 'field', 'method' */
445 const char *what; /* (S) 'Lua', 'C', 'main', 'tail' */ 473 const char *what; /* (S) 'Lua', 'C', 'main', 'tail' */
446 const char *source; /* (S) */ 474 const char *source; /* (S) */
475 size_t srclen; /* (S) */
447 int currentline; /* (l) */ 476 int currentline; /* (l) */
448 int linedefined; /* (S) */ 477 int linedefined; /* (S) */
449 int lastlinedefined; /* (S) */ 478 int lastlinedefined; /* (S) */
@@ -451,6 +480,8 @@ struct lua_Debug {
451 unsigned char nparams;/* (u) number of parameters */ 480 unsigned char nparams;/* (u) number of parameters */
452 char isvararg; /* (u) */ 481 char isvararg; /* (u) */
453 char istailcall; /* (t) */ 482 char istailcall; /* (t) */
483 unsigned short ftransfer; /* (r) index of first value transferred */
484 unsigned short ntransfer; /* (r) number of transferred values */
454 char short_src[LUA_IDSIZE]; /* (S) */ 485 char short_src[LUA_IDSIZE]; /* (S) */
455 /* private part */ 486 /* private part */
456 struct CallInfo *i_ci; /* active function */ 487 struct CallInfo *i_ci; /* active function */
@@ -460,7 +491,7 @@ struct lua_Debug {
460 491
461 492
462/****************************************************************************** 493/******************************************************************************
463* Copyright (C) 1994-2018 Lua.org, PUC-Rio. 494* Copyright (C) 1994-2020 Lua.org, PUC-Rio.
464* 495*
465* Permission is hereby granted, free of charge, to any person obtaining 496* Permission is hereby granted, free of charge, to any person obtaining
466* a copy of this software and associated documentation files (the 497* a copy of this software and associated documentation files (the