The Battle for Wesnoth  1.15.12+dev
Classes | Macros | Typedefs | Functions | Variables
lua.h File Reference
#include <stdarg.h>
#include <stddef.h>
#include "luaconf.h"
Include dependency graph for lua.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  lua_Debug
 

Macros

#define LUA_VERSION_MAJOR   "5"
 
#define LUA_VERSION_MINOR   "4"
 
#define LUA_VERSION_RELEASE   "2"
 
#define LUA_VERSION_NUM   504
 
#define LUA_VERSION_RELEASE_NUM   (LUA_VERSION_NUM * 100 + 0)
 
#define LUA_VERSION   "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
 
#define LUA_RELEASE   LUA_VERSION "." LUA_VERSION_RELEASE
 
#define LUA_COPYRIGHT   LUA_RELEASE " Copyright (C) 1994-2020 Lua.org, PUC-Rio"
 
#define LUA_AUTHORS   "R. Ierusalimschy, L. H. de Figueiredo, W. Celes"
 
#define LUA_SIGNATURE   "\x1bLua"
 
#define LUA_MULTRET   (-1)
 
#define LUA_REGISTRYINDEX   (-LUAI_MAXSTACK - 1000)
 
#define lua_upvalueindex(i)   (LUA_REGISTRYINDEX - (i))
 
#define LUA_OK   0
 
#define LUA_YIELD   1
 
#define LUA_ERRRUN   2
 
#define LUA_ERRSYNTAX   3
 
#define LUA_ERRMEM   4
 
#define LUA_ERRERR   5
 
#define LUA_TNONE   (-1)
 
#define LUA_TNIL   0
 
#define LUA_TBOOLEAN   1
 
#define LUA_TLIGHTUSERDATA   2
 
#define LUA_TNUMBER   3
 
#define LUA_TSTRING   4
 
#define LUA_TTABLE   5
 
#define LUA_TFUNCTION   6
 
#define LUA_TUSERDATA   7
 
#define LUA_TTHREAD   8
 
#define LUA_NUMTYPES   9
 
#define LUA_MINSTACK   20
 
#define LUA_RIDX_MAINTHREAD   1
 
#define LUA_RIDX_GLOBALS   2
 
#define LUA_RIDX_LAST   LUA_RIDX_GLOBALS
 
#define LUA_OPADD   0 /* ORDER TM, ORDER OP */
 
#define LUA_OPSUB   1
 
#define LUA_OPMUL   2
 
#define LUA_OPMOD   3
 
#define LUA_OPPOW   4
 
#define LUA_OPDIV   5
 
#define LUA_OPIDIV   6
 
#define LUA_OPBAND   7
 
#define LUA_OPBOR   8
 
#define LUA_OPBXOR   9
 
#define LUA_OPSHL   10
 
#define LUA_OPSHR   11
 
#define LUA_OPUNM   12
 
#define LUA_OPBNOT   13
 
#define LUA_OPEQ   0
 
#define LUA_OPLT   1
 
#define LUA_OPLE   2
 
#define lua_call(L, n, r)   lua_callk(L, (n), (r), 0, NULL)
 
#define lua_pcall(L, n, r, f)   lua_pcallk(L, (n), (r), (f), 0, NULL)
 
#define lua_yield(L, n)   lua_yieldk(L, (n), 0, NULL)
 
#define LUA_GCSTOP   0
 
#define LUA_GCRESTART   1
 
#define LUA_GCCOLLECT   2
 
#define LUA_GCCOUNT   3
 
#define LUA_GCCOUNTB   4
 
#define LUA_GCSTEP   5
 
#define LUA_GCSETPAUSE   6
 
#define LUA_GCSETSTEPMUL   7
 
#define LUA_GCISRUNNING   9
 
#define LUA_GCGEN   10
 
#define LUA_GCINC   11
 
#define lua_getextraspace(L)   ((void *)((char *)(L) - LUA_EXTRASPACE))
 
#define lua_tonumber(L, i)   lua_tonumberx(L,(i),NULL)
 
#define lua_tointeger(L, i)   lua_tointegerx(L,(i),NULL)
 
#define lua_pop(L, n)   lua_settop(L, -(n)-1)
 
#define lua_newtable(L)   lua_createtable(L, 0, 0)
 
#define lua_register(L, n, f)   (lua_pushcfunction(L, (f)), lua_setglobal(L, (n)))
 
#define lua_pushcfunction(L, f)   lua_pushcclosure(L, (f), 0)
 
#define lua_isfunction(L, n)   (lua_type(L, (n)) == LUA_TFUNCTION)
 
#define lua_istable(L, n)   (lua_type(L, (n)) == LUA_TTABLE)
 
#define lua_islightuserdata(L, n)   (lua_type(L, (n)) == LUA_TLIGHTUSERDATA)
 
#define lua_isnil(L, n)   (lua_type(L, (n)) == LUA_TNIL)
 
#define lua_isboolean(L, n)   (lua_type(L, (n)) == LUA_TBOOLEAN)
 
#define lua_isthread(L, n)   (lua_type(L, (n)) == LUA_TTHREAD)
 
#define lua_isnone(L, n)   (lua_type(L, (n)) == LUA_TNONE)
 
#define lua_isnoneornil(L, n)   (lua_type(L, (n)) <= 0)
 
#define lua_pushliteral(L, s)   lua_pushstring(L, "" s)
 
#define lua_pushglobaltable(L)   ((void)lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS))
 
#define lua_tostring(L, i)   lua_tolstring(L, (i), NULL)
 
#define lua_insert(L, idx)   lua_rotate(L, (idx), 1)
 
#define lua_remove(L, idx)   (lua_rotate(L, (idx), -1), lua_pop(L, 1))
 
#define lua_replace(L, idx)   (lua_copy(L, -1, (idx)), lua_pop(L, 1))
 
#define lua_newuserdata(L, s)   lua_newuserdatauv(L,s,1)
 
#define lua_getuservalue(L, idx)   lua_getiuservalue(L,idx,1)
 
#define lua_setuservalue(L, idx)   lua_setiuservalue(L,idx,1)
 
#define LUA_NUMTAGS   LUA_NUMTYPES
 
#define LUA_HOOKCALL   0
 
#define LUA_HOOKRET   1
 
#define LUA_HOOKLINE   2
 
#define LUA_HOOKCOUNT   3
 
#define LUA_HOOKTAILCALL   4
 
#define LUA_MASKCALL   (1 << LUA_HOOKCALL)
 
#define LUA_MASKRET   (1 << LUA_HOOKRET)
 
#define LUA_MASKLINE   (1 << LUA_HOOKLINE)
 
#define LUA_MASKCOUNT   (1 << LUA_HOOKCOUNT)
 

Typedefs

typedef struct lua_State lua_State
 
typedef LUA_NUMBER lua_Number
 
typedef LUA_INTEGER lua_Integer
 
typedef LUA_UNSIGNED lua_Unsigned
 
typedef LUA_KCONTEXT lua_KContext
 
typedef int(* lua_CFunction) (lua_State *L)
 
typedef int(* lua_KFunction) (lua_State *L, int status, lua_KContext ctx)
 
typedef const char *(* lua_Reader) (lua_State *L, void *ud, size_t *sz)
 
typedef int(* lua_Writer) (lua_State *L, const void *p, size_t sz, void *ud)
 
typedef void *(* lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize)
 
typedef void(* lua_WarnFunction) (void *ud, const char *msg, int tocont)
 
typedef struct lua_Debug lua_Debug
 
typedef void(* lua_Hook) (lua_State *L, lua_Debug *ar)
 

Functions

LUA_API lua_State *() lua_newstate (lua_Alloc f, void *ud)
 
LUA_API void() lua_close (lua_State *L)
 
LUA_API lua_State *() lua_newthread (lua_State *L)
 
LUA_API int() lua_resetthread (lua_State *L)
 
LUA_API lua_CFunction() lua_atpanic (lua_State *L, lua_CFunction panicf)
 
LUA_API lua_Number() lua_version (lua_State *L)
 
LUA_API int() lua_absindex (lua_State *L, int idx)
 
LUA_API int() lua_gettop (lua_State *L)
 
LUA_API void() lua_settop (lua_State *L, int idx)
 
LUA_API void() lua_pushvalue (lua_State *L, int idx)
 
LUA_API void() lua_rotate (lua_State *L, int idx, int n)
 
LUA_API void() lua_copy (lua_State *L, int fromidx, int toidx)
 
LUA_API int() lua_checkstack (lua_State *L, int n)
 
LUA_API void() lua_xmove (lua_State *from, lua_State *to, int n)
 
LUA_API int() lua_isnumber (lua_State *L, int idx)
 
LUA_API int() lua_isstring (lua_State *L, int idx)
 
LUA_API int() lua_iscfunction (lua_State *L, int idx)
 
LUA_API int() lua_isinteger (lua_State *L, int idx)
 
LUA_API int() lua_isuserdata (lua_State *L, int idx)
 
LUA_API int() lua_type (lua_State *L, int idx)
 
LUA_API const char *() lua_typename (lua_State *L, int tp)
 
LUA_API lua_Number() lua_tonumberx (lua_State *L, int idx, int *isnum)
 
LUA_API lua_Integer() lua_tointegerx (lua_State *L, int idx, int *isnum)
 
LUA_API int() lua_toboolean (lua_State *L, int idx)
 
LUA_API const char *() lua_tolstring (lua_State *L, int idx, size_t *len)
 
LUA_API lua_Unsigned() lua_rawlen (lua_State *L, int idx)
 
LUA_API lua_CFunction() lua_tocfunction (lua_State *L, int idx)
 
LUA_API void *() lua_touserdata (lua_State *L, int idx)
 
LUA_API lua_State *() lua_tothread (lua_State *L, int idx)
 
LUA_API const void *() lua_topointer (lua_State *L, int idx)
 
LUA_API void() lua_arith (lua_State *L, int op)
 
LUA_API int() lua_rawequal (lua_State *L, int idx1, int idx2)
 
LUA_API int() lua_compare (lua_State *L, int idx1, int idx2, int op)
 
LUA_API void() lua_pushnil (lua_State *L)
 
LUA_API void() lua_pushnumber (lua_State *L, lua_Number n)
 
LUA_API void() lua_pushinteger (lua_State *L, lua_Integer n)
 
LUA_API const char *() lua_pushlstring (lua_State *L, const char *s, size_t len)
 
LUA_API const char *() lua_pushstring (lua_State *L, const char *s)
 
LUA_API const char *() lua_pushvfstring (lua_State *L, const char *fmt, va_list argp)
 
LUA_API const char *() lua_pushfstring (lua_State *L, const char *fmt,...)
 
LUA_API void() lua_pushcclosure (lua_State *L, lua_CFunction fn, int n)
 
LUA_API void() lua_pushboolean (lua_State *L, int b)
 
LUA_API void() lua_pushlightuserdata (lua_State *L, void *p)
 
LUA_API int() lua_pushthread (lua_State *L)
 
LUA_API int() lua_getglobal (lua_State *L, const char *name)
 
LUA_API int() lua_gettable (lua_State *L, int idx)
 
LUA_API int() lua_getfield (lua_State *L, int idx, const char *k)
 
LUA_API int() lua_geti (lua_State *L, int idx, lua_Integer n)
 
LUA_API int() lua_rawget (lua_State *L, int idx)
 
LUA_API int() lua_rawgeti (lua_State *L, int idx, lua_Integer n)
 
LUA_API int() lua_rawgetp (lua_State *L, int idx, const void *p)
 
LUA_API void() lua_createtable (lua_State *L, int narr, int nrec)
 
LUA_API void *() lua_newuserdatauv (lua_State *L, size_t sz, int nuvalue)
 
LUA_API int() lua_getmetatable (lua_State *L, int objindex)
 
LUA_API int() lua_getiuservalue (lua_State *L, int idx, int n)
 
LUA_API void() lua_setglobal (lua_State *L, const char *name)
 
LUA_API void() lua_settable (lua_State *L, int idx)
 
LUA_API void() lua_setfield (lua_State *L, int idx, const char *k)
 
LUA_API void() lua_seti (lua_State *L, int idx, lua_Integer n)
 
LUA_API void() lua_rawset (lua_State *L, int idx)
 
LUA_API void() lua_rawseti (lua_State *L, int idx, lua_Integer n)
 
LUA_API void() lua_rawsetp (lua_State *L, int idx, const void *p)
 
LUA_API int() lua_setmetatable (lua_State *L, int objindex)
 
LUA_API int() lua_setiuservalue (lua_State *L, int idx, int n)
 
LUA_API void() lua_callk (lua_State *L, int nargs, int nresults, lua_KContext ctx, lua_KFunction k)
 
LUA_API int() lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc, lua_KContext ctx, lua_KFunction k)
 
LUA_API int() lua_load (lua_State *L, lua_Reader reader, void *dt, const char *chunkname, const char *mode)
 
LUA_API int() lua_dump (lua_State *L, lua_Writer writer, void *data, int strip)
 
LUA_API int() lua_yieldk (lua_State *L, int nresults, lua_KContext ctx, lua_KFunction k)
 
LUA_API int() lua_resume (lua_State *L, lua_State *from, int narg, int *nres)
 
LUA_API int() lua_status (lua_State *L)
 
LUA_API int() lua_isyieldable (lua_State *L)
 
LUA_API void() lua_setwarnf (lua_State *L, lua_WarnFunction f, void *ud)
 
LUA_API void() lua_warning (lua_State *L, const char *msg, int tocont)
 
LUA_API int() lua_gc (lua_State *L, int what,...)
 
LUA_API int() lua_error (lua_State *L)
 
LUA_API int() lua_next (lua_State *L, int idx)
 
LUA_API void() lua_concat (lua_State *L, int n)
 
LUA_API void() lua_len (lua_State *L, int idx)
 
LUA_API size_t() lua_stringtonumber (lua_State *L, const char *s)
 
LUA_API lua_Alloc() lua_getallocf (lua_State *L, void **ud)
 
LUA_API void() lua_setallocf (lua_State *L, lua_Alloc f, void *ud)
 
LUA_API void() lua_toclose (lua_State *L, int idx)
 
LUA_API int() lua_getstack (lua_State *L, int level, lua_Debug *ar)
 
LUA_API int() lua_getinfo (lua_State *L, const char *what, lua_Debug *ar)
 
LUA_API const char *() lua_getlocal (lua_State *L, const lua_Debug *ar, int n)
 
LUA_API const char *() lua_setlocal (lua_State *L, const lua_Debug *ar, int n)
 
LUA_API const char *() lua_getupvalue (lua_State *L, int funcindex, int n)
 
LUA_API const char *() lua_setupvalue (lua_State *L, int funcindex, int n)
 
LUA_API void *() lua_upvalueid (lua_State *L, int fidx, int n)
 
LUA_API void() lua_upvaluejoin (lua_State *L, int fidx1, int n1, int fidx2, int n2)
 
LUA_API void() lua_sethook (lua_State *L, lua_Hook func, int mask, int count)
 
LUA_API lua_Hook() lua_gethook (lua_State *L)
 
LUA_API int() lua_gethookmask (lua_State *L)
 
LUA_API int() lua_gethookcount (lua_State *L)
 
LUA_API int() lua_setcstacklimit (lua_State *L, unsigned int limit)
 

Variables

const char lua_ident []
 

Macro Definition Documentation

◆ LUA_AUTHORS

#define LUA_AUTHORS   "R. Ierusalimschy, L. H. de Figueiredo, W. Celes"

Definition at line 29 of file lua.h.

◆ lua_call

#define lua_call (   L,
  n,
 
)    lua_callk(L, (n), (r), 0, NULL)

◆ LUA_COPYRIGHT

#define LUA_COPYRIGHT   LUA_RELEASE " Copyright (C) 1994-2020 Lua.org, PUC-Rio"

Definition at line 28 of file lua.h.

◆ LUA_ERRERR

#define LUA_ERRERR   5

◆ LUA_ERRMEM

#define LUA_ERRMEM   4

◆ LUA_ERRRUN

#define LUA_ERRRUN   2

◆ LUA_ERRSYNTAX

#define LUA_ERRSYNTAX   3

◆ LUA_GCCOLLECT

#define LUA_GCCOLLECT   2

Definition at line 321 of file lua.h.

Referenced by lua_gc(), and luaB_collectgarbage().

◆ LUA_GCCOUNT

#define LUA_GCCOUNT   3

Definition at line 322 of file lua.h.

Referenced by lua_gc(), and luaB_collectgarbage().

◆ LUA_GCCOUNTB

#define LUA_GCCOUNTB   4

Definition at line 323 of file lua.h.

Referenced by lua_gc(), and luaB_collectgarbage().

◆ LUA_GCGEN

#define LUA_GCGEN   10

Definition at line 328 of file lua.h.

Referenced by lua_gc(), and luaB_collectgarbage().

◆ LUA_GCINC

#define LUA_GCINC   11

Definition at line 329 of file lua.h.

Referenced by lua_gc(), luaB_collectgarbage(), and pushmode().

◆ LUA_GCISRUNNING

#define LUA_GCISRUNNING   9

Definition at line 327 of file lua.h.

Referenced by lua_gc(), and luaB_collectgarbage().

◆ LUA_GCRESTART

#define LUA_GCRESTART   1

Definition at line 320 of file lua.h.

Referenced by lua_gc(), and luaB_collectgarbage().

◆ LUA_GCSETPAUSE

#define LUA_GCSETPAUSE   6

Definition at line 325 of file lua.h.

Referenced by lua_gc(), and luaB_collectgarbage().

◆ LUA_GCSETSTEPMUL

#define LUA_GCSETSTEPMUL   7

Definition at line 326 of file lua.h.

Referenced by lua_gc(), and luaB_collectgarbage().

◆ LUA_GCSTEP

#define LUA_GCSTEP   5

Definition at line 324 of file lua.h.

Referenced by lua_gc(), and luaB_collectgarbage().

◆ LUA_GCSTOP

#define LUA_GCSTOP   0

Definition at line 319 of file lua.h.

Referenced by lua_gc(), and luaB_collectgarbage().

◆ lua_getextraspace

#define lua_getextraspace (   L)    ((void *)((char *)(L) - LUA_EXTRASPACE))

Definition at line 359 of file lua.h.

Referenced by lua_kernel_base::get_lua_kernel_base_ptr(), and lua_newthread().

◆ lua_getuservalue

#define lua_getuservalue (   L,
  idx 
)    lua_getiuservalue(L,idx,1)

Definition at line 412 of file lua.h.

◆ LUA_HOOKCALL

#define LUA_HOOKCALL   0

Definition at line 429 of file lua.h.

Referenced by luaD_hookcall(), and luaD_precall().

◆ LUA_HOOKCOUNT

#define LUA_HOOKCOUNT   3

Definition at line 432 of file lua.h.

Referenced by luaG_traceexec().

◆ LUA_HOOKLINE

#define LUA_HOOKLINE   2

Definition at line 431 of file lua.h.

Referenced by luaG_traceexec().

◆ LUA_HOOKRET

#define LUA_HOOKRET   1

Definition at line 430 of file lua.h.

Referenced by rethook().

◆ LUA_HOOKTAILCALL

#define LUA_HOOKTAILCALL   4

Definition at line 433 of file lua.h.

Referenced by luaD_hookcall().

◆ lua_insert

#define lua_insert (   L,
  idx 
)    lua_rotate(L, (idx), 1)

◆ lua_isboolean

#define lua_isboolean (   L,
  n 
)    (lua_type(L, (n)) == LUA_TBOOLEAN)

◆ lua_isfunction

#define lua_isfunction (   L,
  n 
)    (lua_type(L, (n)) == LUA_TFUNCTION)

◆ lua_islightuserdata

#define lua_islightuserdata (   L,
  n 
)    (lua_type(L, (n)) == LUA_TLIGHTUSERDATA)

Definition at line 374 of file lua.h.

◆ lua_isnil

#define lua_isnil (   L,
  n 
)    (lua_type(L, (n)) == LUA_TNIL)

◆ lua_isnone

#define lua_isnone (   L,
  n 
)    (lua_type(L, (n)) == LUA_TNONE)

◆ lua_isnoneornil

#define lua_isnoneornil (   L,
  n 
)    (lua_type(L, (n)) <= 0)

◆ lua_istable

#define lua_istable (   L,
  n 
)    (lua_type(L, (n)) == LUA_TTABLE)

◆ lua_isthread

#define lua_isthread (   L,
  n 
)    (lua_type(L, (n)) == LUA_TTHREAD)

Definition at line 377 of file lua.h.

Referenced by getthread().

◆ LUA_MASKCALL

#define LUA_MASKCALL   (1 << LUA_HOOKCALL)

Definition at line 439 of file lua.h.

Referenced by luaD_hookcall(), luaD_precall(), makemask(), and unmakemask().

◆ LUA_MASKCOUNT

#define LUA_MASKCOUNT   (1 << LUA_HOOKCOUNT)

Definition at line 442 of file lua.h.

Referenced by luaG_traceexec(), and makemask().

◆ LUA_MASKLINE

#define LUA_MASKLINE   (1 << LUA_HOOKLINE)

Definition at line 441 of file lua.h.

Referenced by luaG_traceexec(), makemask(), and unmakemask().

◆ LUA_MASKRET

#define LUA_MASKRET   (1 << LUA_HOOKRET)

Definition at line 440 of file lua.h.

Referenced by makemask(), rethook(), and unmakemask().

◆ LUA_MINSTACK

#define LUA_MINSTACK   20

◆ LUA_MULTRET

#define LUA_MULTRET   (-1)

◆ lua_newtable

#define lua_newtable (   L)    lua_createtable(L, 0, 0)

◆ lua_newuserdata

#define lua_newuserdata (   L,
  s 
)    lua_newuserdatauv(L,s,1)

Definition at line 411 of file lua.h.

◆ LUA_NUMTAGS

#define LUA_NUMTAGS   LUA_NUMTYPES

Definition at line 415 of file lua.h.

Referenced by lua_newstate(), and markmt().

◆ LUA_NUMTYPES

#define LUA_NUMTYPES   9

Definition at line 75 of file lua.h.

Referenced by lua_typename().

◆ LUA_OK

#define LUA_OK   0

◆ LUA_OPADD

#define LUA_OPADD   0 /* ORDER TM, ORDER OP */

Definition at line 205 of file lua.h.

Referenced by arith_add(), intarith(), luaK_posfix(), luaO_arith(), and numarith().

◆ LUA_OPBAND

#define LUA_OPBAND   7

Definition at line 212 of file lua.h.

Referenced by intarith(), luaO_rawarith(), and validop().

◆ LUA_OPBNOT

#define LUA_OPBNOT   13

Definition at line 218 of file lua.h.

Referenced by intarith(), lua_arith(), luaO_rawarith(), and validop().

◆ LUA_OPBOR

#define LUA_OPBOR   8

Definition at line 213 of file lua.h.

Referenced by intarith(), luaO_rawarith(), and validop().

◆ LUA_OPBXOR

#define LUA_OPBXOR   9

Definition at line 214 of file lua.h.

Referenced by intarith(), luaO_rawarith(), and validop().

◆ LUA_OPDIV

#define LUA_OPDIV   5

Definition at line 210 of file lua.h.

Referenced by arith_div(), luaO_rawarith(), numarith(), and validop().

◆ LUA_OPEQ

#define LUA_OPEQ   0

Definition at line 222 of file lua.h.

Referenced by lua_callable::do_compare(), lua_compare(), and tmove().

◆ LUA_OPIDIV

#define LUA_OPIDIV   6

Definition at line 211 of file lua.h.

Referenced by arith_idiv(), intarith(), numarith(), and validop().

◆ LUA_OPLE

#define LUA_OPLE   2

Definition at line 224 of file lua.h.

Referenced by lua_compare().

◆ LUA_OPLT

#define LUA_OPLT   1

Definition at line 223 of file lua.h.

Referenced by lua_callable::do_compare(), lua_compare(), math_max(), math_min(), and sort_comp().

◆ LUA_OPMOD

#define LUA_OPMOD   3

Definition at line 208 of file lua.h.

Referenced by arith_mod(), intarith(), numarith(), and validop().

◆ LUA_OPMUL

#define LUA_OPMUL   2

Definition at line 207 of file lua.h.

Referenced by arith_mul(), intarith(), and numarith().

◆ LUA_OPPOW

#define LUA_OPPOW   4

Definition at line 209 of file lua.h.

Referenced by arith_pow(), luaO_rawarith(), and numarith().

◆ LUA_OPSHL

#define LUA_OPSHL   10

Definition at line 215 of file lua.h.

Referenced by intarith(), luaO_rawarith(), and validop().

◆ LUA_OPSHR

#define LUA_OPSHR   11

Definition at line 216 of file lua.h.

Referenced by intarith(), luaO_rawarith(), and validop().

◆ LUA_OPSUB

#define LUA_OPSUB   1

Definition at line 206 of file lua.h.

Referenced by arith_sub(), intarith(), and numarith().

◆ LUA_OPUNM

#define LUA_OPUNM   12

Definition at line 217 of file lua.h.

Referenced by arith_unm(), intarith(), lua_arith(), luaK_prefix(), and numarith().

◆ lua_pcall

#define lua_pcall (   L,
  n,
  r,
  f 
)    lua_pcallk(L, (n), (r), (f), 0, NULL)

◆ lua_pop

#define lua_pop (   L,
  n 
)    lua_settop(L, -(n)-1)

Definition at line 364 of file lua.h.

Referenced by add_value(), addtoclib(), auxresume(), auxsort(), ai::call_lua_filter_fcn(), cfun_exec_candidate_action(), cfun_exec_stage(), checkclib(), checktab(), lua_pathfind_cost_calculator::cost(), ai::lua_ai_context::create(), ai::lua_ai_action_handler::create(), mapgen_lua_kernel::create_map(), mapgen_lua_kernel::create_scenario(), createmeta(), createmetatable(), db_setlocal(), lua_mapgen::filter::filter(), findfield(), findloader(), g_read(), game_lua_kernel::game_lua_kernel(), gctm(), generic_reader(), ai::unit_advancements_aspect::get_advancements(), lua_kernel_base::get_attribute_names(), lua_kernel_base::get_global_var_names(), lua_callable::get_inputs(), get_new_thread(), lua_callable::get_value(), getboolfield(), getfield(), impl_add_animation(), ai::impl_ai_get(), impl_source_set(), game_lua_kernel::initialize(), lua_kernel_base::interactive_run(), intf_debug_ai(), game_lua_kernel::intf_find_cost_map(), game_lua_kernel::intf_find_path(), game_lua_kernel::intf_find_reach(), lua_map_location::intf_get_direction(), game_lua_kernel::intf_get_time_of_day(), intf_load(), lua_wml::intf_load_wml(), intf_name_generator(), lua_kernel_base::intf_print(), lua_kernel_base::intf_require(), lua_map_location::intf_rotate_right_around_center(), game_lua_kernel::intf_scroll(), intf_terrain_mask(), ll_require(), load_aux(), lua_kernel_base::load_string(), ai::lua_ai_load::lua_ai_load(), lua_check_impl::lua_check(), lua_kernel_base::lua_kernel_base(), luaB_print(), luaL_addvalue(), luaL_getmetafield(), luaL_getsubtable(), luaL_len(), luaL_newmetatable(), luaL_pushresult(), luaL_ref(), luaL_requiref(), luaL_setfuncs(), luaL_testudata(), luaopen_package(), luaW_clearwindowtable(), luaW_getglobal(), lua_stringx::luaW_open(), luaW_pcall(), luaW_pushwidgettable(), luaW_pushwidgettablecontainer(), luaW_pushwindowtable(), luaW_setwidgetcallback(), luaW_table_get_def(), luaW_tableget(), luaW_to_locationset(), luaW_toconfig(), luaW_tolocation(), mapgen_lua_kernel::mapgen_lua_kernel(), noenv(), operator delete(), partition(), lua_kernel_base::protected_call(), read_rules_vector(), lua_cpp::register_metatable(), lua_colors::register_metatables(), lua_preferences::register_table(), lua_unit_type::register_table(), lua_audio::register_table(), game_lua_kernel::run_filter(), game_lua_kernel::run_wml_conditional(), game_lua_kernel::save_game(), lua_cpp::set_functions(), game_lua_kernel::set_wml_action(), game_lua_kernel::set_wml_condition(), setpath(), setrandfunc(), lua_gui2::show_message_dialog(), sort_comp(), str_format(), lua_kernel_base::throwing_run(), ai::lua_object< T >::to_type(), ai::lua_ai_context::update_state(), filter_impl::~filter_impl(), ai::lua_ai_action_handler::~lua_ai_action_handler(), ai::lua_ai_context::~lua_ai_context(), and ai::lua_ai_load::~lua_ai_load().

◆ lua_pushcfunction

#define lua_pushcfunction (   L,
  f 
)    lua_pushcclosure(L, (f), 0)

◆ lua_pushglobaltable

#define lua_pushglobaltable (   L)    ((void)lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS))

Definition at line 383 of file lua.h.

Referenced by luaopen_base(), luaopen_package(), and luaW_getglobal().

◆ lua_pushliteral

#define lua_pushliteral (   L,
  s 
)    lua_pushstring(L, "" s)

◆ lua_register

#define lua_register (   L,
  n,
  f 
)    (lua_pushcfunction(L, (f)), lua_setglobal(L, (n)))

Definition at line 368 of file lua.h.

◆ LUA_REGISTRYINDEX

#define LUA_REGISTRYINDEX   (-LUAI_MAXSTACK - 1000)

◆ LUA_RELEASE

#define LUA_RELEASE   LUA_VERSION "." LUA_VERSION_RELEASE

Definition at line 27 of file lua.h.

◆ lua_remove

#define lua_remove (   L,
  idx 
)    (lua_rotate(L, (idx), -1), lua_pop(L, 1))

◆ lua_replace

#define lua_replace (   L,
  idx 
)    (lua_copy(L, -1, (idx)), lua_pop(L, 1))

◆ LUA_RIDX_GLOBALS

#define LUA_RIDX_GLOBALS   2

Definition at line 85 of file lua.h.

Referenced by init_registry(), lua_getglobal(), lua_load(), and lua_setglobal().

◆ LUA_RIDX_LAST

#define LUA_RIDX_LAST   LUA_RIDX_GLOBALS

Definition at line 86 of file lua.h.

Referenced by init_registry().

◆ LUA_RIDX_MAINTHREAD

#define LUA_RIDX_MAINTHREAD   1

Definition at line 84 of file lua.h.

Referenced by init_registry().

◆ lua_setuservalue

#define lua_setuservalue (   L,
  idx 
)    lua_setiuservalue(L,idx,1)

Definition at line 413 of file lua.h.

◆ LUA_SIGNATURE

#define LUA_SIGNATURE   "\x1bLua"

Definition at line 33 of file lua.h.

Referenced by checkHeader(), checkliteral(), dumpHeader(), f_parser(), luaL_loadfilex(), and luaU_undump().

◆ LUA_TBOOLEAN

#define LUA_TBOOLEAN   1

◆ LUA_TFUNCTION

#define LUA_TFUNCTION   6

◆ LUA_TLIGHTUSERDATA

#define LUA_TLIGHTUSERDATA   2

Definition at line 67 of file lua.h.

Referenced by luaL_typeerror(), and touserdata().

◆ LUA_TNIL

#define LUA_TNIL   0

◆ LUA_TNONE

#define LUA_TNONE   (-1)

◆ LUA_TNUMBER

#define LUA_TNUMBER   3

◆ lua_tointeger

#define lua_tointeger (   L,
  i 
)    lua_tointegerx(L,(i),NULL)

◆ lua_tonumber

#define lua_tonumber (   L,
  i 
)    lua_tonumberx(L,(i),NULL)

◆ lua_tostring

#define lua_tostring (   L,
  i 
)    lua_tolstring(L, (i), NULL)

Definition at line 386 of file lua.h.

Referenced by game_lua_kernel::apply_effect(), game_lua_kernel::cfun_builtin_effect(), checkload(), ai::lua_ai_context::create(), ai::lua_ai_action_handler::create(), mapgen_lua_kernel::create_map(), db_traceback(), errfile(), find_widget_impl(), findfile(), findloader(), g_iofile(), ai::unit_advancements_aspect::get_advancements(), lua_kernel_base::get_attribute_names(), lua_kernel_base::get_global_var_names(), lua_callable::get_inputs(), impl_add_animation(), ai::impl_ai_get(), impl_animator_get(), impl_unit_attacks_set(), lua_formula_bridge::intf_compile_formula(), lua_stringx::intf_format(), lua_wml::intf_load_wml(), intf_make_version(), intf_name_generator(), lua_kernel_base::intf_print(), game_lua_kernel::intf_remove_tile_overlay(), game_lua_kernel::intf_set_time_of_day(), game_lua_kernel::intf_shroud_op(), intf_transform_unit(), io_readline(), load_fake_units(), application_lua_kernel::load_script_from_string(), lua_kernel_base::load_string(), lua_kernel_base::lua_kernel_base(), luaB_select(), luaB_warn(), luaL_argerror(), luaL_gsub(), luaL_loadfilex(), luaL_tolstring(), luaL_typeerror(), luaW_checkrace(), luaW_checkvariable(), luaW_pcall(), luaW_toconfig(), luaW_tofaivariant(), luaW_toscalar(), luaW_totstring(), panic(), lua_kernel_base::protected_call(), pushfuncname(), pushglobalfuncname(), application_lua_kernel::thread::run_script(), searcher_Croot(), searchpath(), ai::lua_object< T >::to_type(), lua_common::tstring_concat_aux(), and WIDGET_SETTER().

◆ LUA_TSTRING

#define LUA_TSTRING   4

◆ LUA_TTABLE

#define LUA_TTABLE   5

◆ LUA_TTHREAD

#define LUA_TTHREAD   8

Definition at line 73 of file lua.h.

Referenced by lua_newstate(), and lua_newthread().

◆ LUA_TUSERDATA

#define LUA_TUSERDATA   7

◆ lua_upvalueindex

#define lua_upvalueindex (   i)    (LUA_REGISTRYINDEX - (i))

◆ LUA_VERSION

#define LUA_VERSION   "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR

Definition at line 26 of file lua.h.

Referenced by luaopen_base().

◆ LUA_VERSION_MAJOR

#define LUA_VERSION_MAJOR   "5"

Definition at line 19 of file lua.h.

◆ LUA_VERSION_MINOR

#define LUA_VERSION_MINOR   "4"

Definition at line 20 of file lua.h.

◆ LUA_VERSION_NUM

#define LUA_VERSION_NUM   504

Definition at line 23 of file lua.h.

Referenced by lua_version().

◆ LUA_VERSION_RELEASE

#define LUA_VERSION_RELEASE   "2"

Definition at line 21 of file lua.h.

◆ LUA_VERSION_RELEASE_NUM

#define LUA_VERSION_RELEASE_NUM   (LUA_VERSION_NUM * 100 + 0)

Definition at line 24 of file lua.h.

◆ LUA_YIELD

#define LUA_YIELD   1

◆ lua_yield

#define lua_yield (   L,
  n 
)    lua_yieldk(L, (n), 0, NULL)

Definition at line 305 of file lua.h.

Referenced by luaB_yield().

Typedef Documentation

◆ lua_Alloc

typedef void*(* lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize)

Definition at line 125 of file lua.h.

◆ lua_CFunction

typedef int(* lua_CFunction) (lua_State *L)

Definition at line 106 of file lua.h.

◆ lua_Debug

typedef struct lua_Debug lua_Debug

Definition at line 444 of file lua.h.

◆ lua_Hook

typedef void(* lua_Hook) (lua_State *L, lua_Debug *ar)

Definition at line 448 of file lua.h.

◆ lua_Integer

typedef LUA_INTEGER lua_Integer

Definition at line 94 of file lua.h.

◆ lua_KContext

Definition at line 100 of file lua.h.

◆ lua_KFunction

typedef int(* lua_KFunction) (lua_State *L, int status, lua_KContext ctx)

Definition at line 111 of file lua.h.

◆ lua_Number

Definition at line 90 of file lua.h.

◆ lua_Reader

typedef const char*(* lua_Reader) (lua_State *L, void *ud, size_t *sz)

Definition at line 117 of file lua.h.

◆ lua_State

typedef struct lua_State lua_State

Definition at line 57 of file lua.h.

◆ lua_Unsigned

Definition at line 97 of file lua.h.

◆ lua_WarnFunction

typedef void(* lua_WarnFunction) (void *ud, const char *msg, int tocont)

Definition at line 131 of file lua.h.

◆ lua_Writer

typedef int(* lua_Writer) (lua_State *L, const void *p, size_t sz, void *ud)

Definition at line 119 of file lua.h.

Function Documentation

◆ lua_absindex()

LUA_API int() lua_absindex ( lua_State L,
int  idx 
)

◆ lua_arith()

LUA_API void() lua_arith ( lua_State L,
int  op 
)

Definition at line 311 of file lapi.cpp.

References api_checknelems, api_incr_top, lua_lock, LUA_OPBNOT, LUA_OPUNM, lua_unlock, luaO_arith(), s2v, setobjs2s, and lua_State::top.

Referenced by arith().

◆ lua_atpanic()

LUA_API lua_CFunction() lua_atpanic ( lua_State L,
lua_CFunction  panicf 
)

Definition at line 136 of file lapi.cpp.

References G, lua_lock, and lua_unlock.

Referenced by luaL_newstate().

◆ lua_callk()

LUA_API void() lua_callk ( lua_State L,
int  nargs,
int  nresults,
lua_KContext  ctx,
lua_KFunction  k 
)

◆ lua_checkstack()

LUA_API int() lua_checkstack ( lua_State L,
int  n 
)

◆ lua_close()

LUA_API void() lua_close ( lua_State L)

Definition at line 405 of file lstate.cpp.

References close_state(), G, and lua_lock.

Referenced by os_exit(), and lua_kernel_base::~lua_kernel_base().

◆ lua_compare()

LUA_API int() lua_compare ( lua_State L,
int  idx1,
int  idx2,
int  op 
)

◆ lua_concat()

LUA_API void() lua_concat ( lua_State L,
int  n 
)

◆ lua_copy()

LUA_API void() lua_copy ( lua_State L,
int  fromidx,
int  toidx 
)

◆ lua_createtable()

LUA_API void() lua_createtable ( lua_State L,
int  narr,
int  nrec 
)

Definition at line 728 of file lapi.cpp.

References api_incr_top, lua_lock, lua_unlock, luaC_checkGC, luaH_new(), luaH_resize(), sethvalue2s, t, and lua_State::top.

Referenced by ai::cfun_ai_get_attacks(), ai::cfun_ai_get_leader_goal(), ai::cfun_ai_get_recruitment_pattern(), ai::cfun_ai_get_targets(), createclibstable(), createsearcherstable(), ai::lua_object< T >::from_type(), game_lua_kernel::game_lua_kernel(), ai::impl_ai_aspect_get(), impl_side_get(), impl_source_get(), lua_common::impl_vconfig_get(), lua_common::impl_vconfig_ipairs_iter(), intf_default_generate_height_map(), game_lua_kernel::intf_find_cost_map(), game_lua_kernel::intf_find_path(), intf_find_path(), game_lua_kernel::intf_find_reach(), game_lua_kernel::intf_find_vision_range(), game_lua_kernel::intf_get_locations(), game_lua_kernel::intf_get_sides(), game_lua_kernel::intf_get_villages(), game_lua_kernel::load_game(), lua_kernel_base::lua_kernel_base(), lua_check_impl::lua_push(), luaL_newmetatable(), luaW_filltable(), lua_mathx::luaW_open(), lua_stringx::luaW_open(), luaW_push_locationset(), luaW_pushlocation(), luaW_pushrace(), luaW_pushracetable(), luaW_pushsimdata(), luaW_pushsimweapon(), luaW_pushsinglecolor(), luaW_pushwidgettable(), luaW_pushwidgettablecontainer(), luaW_pushwindowtable(), os_date(), push_component(), ai::push_move_map(), ai::push_movements(), push_unit_attacks_table(), lua_colors::register_metatables(), lua_audio::register_table(), lua_common::register_tstring_metatable(), and tpack().

◆ lua_dump()

LUA_API int() lua_dump ( lua_State L,
lua_Writer  writer,
void *  data,
int  strip 
)

Definition at line 1078 of file lapi.cpp.

References api_checknelems, getproto, isLfunction, lua_lock, lua_unlock, luaU_dump(), s2v, and lua_State::top.

Referenced by str_dump().

◆ lua_error()

LUA_API int() lua_error ( lua_State L)

◆ lua_gc()

LUA_API int() lua_gc ( lua_State L,
int  what,
  ... 
)

◆ lua_getallocf()

LUA_API lua_Alloc() lua_getallocf ( lua_State L,
void **  ud 
)

Definition at line 1277 of file lapi.cpp.

References f, G, lua_lock, and lua_unlock.

Referenced by resizebox().

◆ lua_getfield()

LUA_API int() lua_getfield ( lua_State L,
int  idx,
const char *  k 
)

◆ lua_getglobal()

LUA_API int() lua_getglobal ( lua_State L,
const char *  name 
)

◆ lua_gethook()

LUA_API lua_Hook() lua_gethook ( lua_State L)

Definition at line 149 of file ldebug.cpp.

References lua_State::hook.

Referenced by db_gethook().

◆ lua_gethookcount()

LUA_API int() lua_gethookcount ( lua_State L)

Definition at line 159 of file ldebug.cpp.

References lua_State::basehookcount.

Referenced by db_gethook().

◆ lua_gethookmask()

LUA_API int() lua_gethookmask ( lua_State L)

Definition at line 154 of file ldebug.cpp.

References lua_State::hookmask.

Referenced by db_gethook().

◆ lua_geti()

LUA_API int() lua_geti ( lua_State L,
int  idx,
lua_Integer  n 
)

◆ lua_getinfo()

LUA_API int() lua_getinfo ( lua_State L,
const char *  what,
lua_Debug ar 
)

◆ lua_getiuservalue()

LUA_API int() lua_getiuservalue ( lua_State L,
int  idx,
int  n 
)

◆ lua_getlocal()

LUA_API const char*() lua_getlocal ( lua_State L,
const lua_Debug ar,
int  n 
)

◆ lua_getmetatable()

LUA_API int() lua_getmetatable ( lua_State L,
int  objindex 
)

◆ lua_getstack()

LUA_API int() lua_getstack ( lua_State L,
int  level,
lua_Debug ar 
)

◆ lua_gettable()

LUA_API int() lua_gettable ( lua_State L,
int  idx 
)

◆ lua_gettop()

LUA_API int() lua_gettop ( lua_State L)

◆ lua_getupvalue()

LUA_API const char*() lua_getupvalue ( lua_State L,
int  funcindex,
int  n 
)

Definition at line 1352 of file lapi.cpp.

References api_incr_top, aux_upvalue(), index2value(), lua_lock, lua_unlock, setobj2s, and lua_State::top.

Referenced by auxupvalue().

◆ lua_iscfunction()

LUA_API int() lua_iscfunction ( lua_State L,
int  idx 
)

Definition at line 273 of file lapi.cpp.

References index2value(), ttisCclosure, and ttislcf.

Referenced by db_upvaluejoin().

◆ lua_isinteger()

LUA_API int() lua_isinteger ( lua_State L,
int  idx 
)

◆ lua_isnumber()

LUA_API int() lua_isnumber ( lua_State L,
int  idx 
)

◆ lua_isstring()

LUA_API int() lua_isstring ( lua_State L,
int  idx 
)

◆ lua_isuserdata()

LUA_API int() lua_isuserdata ( lua_State L,
int  idx 
)

◆ lua_isyieldable()

LUA_API int() lua_isyieldable ( lua_State L)

Definition at line 736 of file ldo.cpp.

References yieldable.

Referenced by luaB_yieldable().

◆ lua_len()

LUA_API void() lua_len ( lua_State L,
int  idx 
)

◆ lua_load()

LUA_API int() lua_load ( lua_State L,
lua_Reader  reader,
void *  dt,
const char *  chunkname,
const char *  mode 
)

◆ lua_newstate()

LUA_API lua_State*() lua_newstate ( lua_Alloc  f,
void *  ud 
)

Definition at line 349 of file lstate.cpp.

References global_State::allgc, global_State::allweak, bitmask, cast, close_state(), global_State::currentwhite, global_State::ephemeron, f, f_luaopen(), global_State::finobj, global_State::finobjold1, global_State::finobjrold, global_State::finobjsur, global_State::firstold1, global_State::fixedgc, global_State::frealloc, LG::g, g, global_State::GCdebt, global_State::gcemergency, global_State::gckind, global_State::gcpause, global_State::gcrunning, GCSpause, global_State::gcstate, global_State::gcstepmul, global_State::gcstepsize, global_State::genmajormul, global_State::genminormul, global_State::gray, global_State::grayagain, stringtable::hash, i, incnny, KGC_INC, LX::l, LG::l, global_State::l_registry, global_State::lastatomic, LUA_NUMTAGS, LUA_OK, LUA_TTHREAD, LUA_VTHREAD, luaC_white, luaD_rawrunprotected(), LUAI_GCMUL, LUAI_GCPAUSE, LUAI_GCSTEPSIZE, LUAI_GENMAJORMUL, LUAI_GENMINORMUL, luai_makeseed(), global_State::mainthread, global_State::mt, lua_State::nCcalls, global_State::nilvalue, stringtable::nuse, obj2gco, global_State::old1, global_State::panic, preinit_thread(), global_State::reallyold, global_State::seed, setgcparam, setivalue, setnilvalue, stringtable::size, global_State::strt, global_State::survival, global_State::sweepgc, global_State::tobefnz, global_State::totalbytes, global_State::twups, global_State::ud, global_State::ud_warn, global_State::warnf, global_State::weak, and WHITE0BIT.

Referenced by luai_makeseed(), and luaL_newstate().

◆ lua_newthread()

LUA_API lua_State*() lua_newthread ( lua_State L)

◆ lua_newuserdatauv()

LUA_API void*() lua_newuserdatauv ( lua_State L,
size_t  sz,
int  nuvalue 
)

◆ lua_next()

LUA_API int() lua_next ( lua_State L,
int  idx 
)

◆ lua_pcallk()

LUA_API int() lua_pcallk ( lua_State L,
int  nargs,
int  nresults,
int  errfunc,
lua_KContext  ctx,
lua_KFunction  k 
)

◆ lua_pushboolean()

LUA_API void() lua_pushboolean ( lua_State L,
int  b 
)

Definition at line 581 of file lapi.cpp.

References api_incr_top, lua_lock, lua_unlock, s2v, setbfvalue, setbtvalue, and lua_State::top.

Referenced by aux_lines(), ai::cfun_ai_get_leader_goal(), ai::cfun_ai_get_simple_targeting(), ai::cfun_ai_get_support_villages(), ai::cfun_ai_is_dst_src_enemy_valid(), ai::cfun_ai_is_dst_src_valid(), ai::cfun_ai_is_src_dst_enemy_valid(), ai::cfun_ai_is_src_dst_valid(), cfun_wml_condition(), db_getuservalue(), finishpcall(), ai::lua_object< T >::from_type(), impl_color_equality(), game_lua_kernel::impl_get_terrain_info(), impl_source_eq(), impl_track_eq(), lua_common::impl_tstring_eq(), lua_common::impl_tstring_le(), lua_common::impl_tstring_lt(), impl_unit_attack_equal(), impl_unit_attack_match(), impl_unit_equality(), impl_unit_status_get(), impl_unit_type_equal(), impl_version_compare(), intf_eval_conditional(), game_lua_kernel::intf_fire_event(), game_lua_kernel::intf_fire_wml_menu_item(), game_lua_kernel::intf_get_fog_or_shroud(), intf_get_viewing_side(), intf_have_asset(), lua_fileops::intf_have_file(), game_lua_kernel::intf_is_enemy(), game_lua_kernel::intf_is_skipping_messages(), game_lua_kernel::intf_match_location(), game_lua_kernel::intf_match_side(), game_lua_kernel::intf_match_unit(), intf_on_board(), intf_on_border(), lua_map_location::intf_tiles_adjacent(), game_lua_kernel::intf_unit_ability(), game_lua_kernel::intf_view_locked(), lua_wml::intf_wml_equal(), lua_wml::intf_wml_matches_filter(), lua_wml::intf_wml_valid(), ll_require(), lookforfunc(), ai::lua_ai_load::lua_ai_load(), lua_check_impl::lua_push(), luaB_close(), luaB_collectgarbage(), luaB_coresume(), luaB_corunning(), luaB_pcall(), luaB_rawequal(), luaB_xpcall(), luaB_yieldable(), luaL_execresult(), luaL_fileresult(), luaL_setfuncs(), luaW_pushsimweapon(), luaW_pushtstring(), math_ult(), os_execute(), ai::push_attack_analysis(), game_lua_kernel::push_builtin_effect(), setboolfield(), settabsb(), lua_gui2::show_message_box(), ai::transform_ai_action(), and ai::lua_ai_load::~lua_ai_load().

◆ lua_pushcclosure()

LUA_API void() lua_pushcclosure ( lua_State L,
lua_CFunction  fn,
int  n 
)

◆ lua_pushfstring()

LUA_API const char*() lua_pushfstring ( lua_State L,
const char *  fmt,
  ... 
)

◆ lua_pushinteger()

LUA_API void() lua_pushinteger ( lua_State L,
lua_Integer  n 
)

Definition at line 489 of file lapi.cpp.

References api_incr_top, lua_lock, lua_unlock, s2v, setivalue, and lua_State::top.

Referenced by aux_lines(), byteoffset(), ai::cfun_ai_get_recruitment_pattern(), ai::cfun_ai_get_targets(), cfun_exec_candidate_action(), codepoint(), lua_pathfind_cost_calculator::cost(), db_gethook(), db_setcstacklimit(), f_seek(), ai::unit_advancements_aspect::get_advancements(), get_new_thread(), get_onecapture(), lua_callable::get_value(), hookf(), ai::impl_ai_aspect_get(), ai::impl_ai_get(), game_lua_kernel::impl_get_terrain_info(), impl_music_get(), impl_music_len(), impl_terrainmap_iter(), impl_unit_attacks_len(), lua_common::impl_vconfig_ipairs(), lua_common::impl_vconfig_ipairs_iter(), lua_common::impl_vconfig_size(), impl_version_get(), impl_warn(), game_lua_kernel::intf_create_side(), intf_default_generate_height_map(), lua_map_location::intf_distance_between(), game_lua_kernel::intf_find_cost_map(), game_lua_kernel::intf_find_path(), intf_find_path(), game_lua_kernel::intf_find_reach(), game_lua_kernel::intf_find_vacant_tile(), game_lua_kernel::intf_find_vision_range(), intf_get_image_size(), lua_map_location::intf_get_in_basis_N_NE(), game_lua_kernel::intf_get_locations(), game_lua_kernel::intf_get_max_liminal_bonus(), game_lua_kernel::intf_get_mouseover_tile(), game_lua_kernel::intf_get_selected_tile(), game_lua_kernel::intf_get_time_of_day(), intf_get_viewing_side(), game_lua_kernel::intf_get_village_owner(), game_lua_kernel::intf_get_villages(), intf_ms_since_init(), intf_replace_if_failed(), lua_mathx::intf_round(), intf_show_dialog(), intf_unit_defense(), intf_unit_jamming_cost(), intf_unit_movement_cost(), intf_unit_resistance(), intf_unit_vision_cost(), ipairsaux(), iter_aux(), iter_codes(), lua_check_impl::lua_push(), luaB_collectgarbage(), luaB_ipairs(), luaB_rawlen(), luaB_select(), luaB_tonumber(), luaL_execresult(), luaL_fileresult(), luaL_unref(), luaopen_math(), luaW_push_locationset(), luaW_pushfaivariant(), luaW_pushlocation(), luaW_pushtstring(), math_abs(), math_fmod(), math_random(), math_toint(), ai::push_attack_analysis(), ai::push_move_map(), pushnumint(), game_lua_kernel::run_filter(), setfield(), setrandfunc(), setseed(), settabsi(), lua_gui2::show_menu(), lua_gui2::show_message_dialog(), str_byte(), str_find_aux(), str_gsub(), str_len(), str_packsize(), str_unpack(), ai::lua_object< T >::to_type(), tpack(), ai::transform_ai_action(), and utflen().

◆ lua_pushlightuserdata()

LUA_API void() lua_pushlightuserdata ( lua_State L,
void *  p 
)

◆ lua_pushlstring()

LUA_API const char*() lua_pushlstring ( lua_State L,
const char *  s,
size_t  len 
)

◆ lua_pushnil()

LUA_API void() lua_pushnil ( lua_State L)

◆ lua_pushnumber()

LUA_API void() lua_pushnumber ( lua_State L,
lua_Number  n 
)

◆ lua_pushstring()

LUA_API const char*() lua_pushstring ( lua_State L,
const char *  s 
)

Definition at line 514 of file lapi.cpp.

References api_incr_top, getstr, lua_lock, lua_unlock, luaC_checkGC, luaS_new(), s, s2v, setnilvalue, setsvalue2s, and lua_State::top.

Referenced by auxupvalue(), ai::cfun_ai_get_grouping(), ai::cfun_ai_get_recruitment_pattern(), ai::cfun_ai_get_targets(), game_lua_kernel::cfun_builtin_effect(), checkfield(), checkload(), db_gethook(), db_getlocal(), db_sethook(), db_setlocal(), findloader(), game_lua_kernel::game_lua_kernel(), hookf(), ai::impl_ai_aspect_set(), ai::impl_ai_get(), game_lua_kernel::impl_get_terrain_info(), impl_name_generator_call(), lua_rng::impl_rng_destroy(), impl_side_get(), impl_slocs_next(), lua_common::impl_tstring_tostring(), impl_unit_type_new(), impl_unit_type_next(), lua_common::impl_vconfig_get(), lua_cpp::intf_cleanup(), game_lua_kernel::intf_create_animator(), intf_debug_ai(), intf_describe_plugins(), lua_map_location::intf_distance_between(), game_lua_kernel::intf_find_cost_map(), game_lua_kernel::intf_find_path(), game_lua_kernel::intf_find_reach(), lua_map_location::intf_get_relative_dir(), game_lua_kernel::intf_get_time_of_day(), intf_get_traits(), intf_name_generator(), lua_kernel_base::intf_require(), lua_map_location::intf_rotate_right_around_center(), lua_map_location::intf_tiles_adjacent(), lua_cpp::intf_tostring(), lua_map_location::intf_vector_diff(), lua_map_location::intf_vector_sum(), lua_wml::intf_wml_tostring(), ll_loadlib(), lua_kernel_base::load_core(), game_lua_kernel::load_game(), lua_kernel_base::load_package(), application_lua_kernel::load_script_from_file(), ai::lua_ai_load::lua_ai_load(), lua_kernel_base::lua_kernel_base(), luaB_costatus(), luaB_type(), luaL_execresult(), luaL_fileresult(), luaL_getmetafield(), luaL_newmetatable(), luaL_requiref(), luaL_tolstring(), luaW_checkrace(), luaW_filltable(), lua_gui2::luaW_open(), luaW_push_terrain(), luaW_pushfaivariant(), luaW_pushrace(), luaW_pushsimweapon(), luaW_pushtstring(), luaW_tableget(), math_type(), os_getenv(), os_setlocale(), os_tmpname(), ai::push_attack_analysis(), game_lua_kernel::push_builtin_effect(), push_component(), ai::push_movements(), pushglobalfuncname(), pushmode(), lua_units::register_attacks_metatables(), lua_common::register_gettext_metatable(), lua_cpp::register_metatable(), lua_race::register_metatable(), lua_widget::register_metatable(), lua_unit_type::register_metatable(), lua_formula_bridge::register_metatables(), lua_colors::register_metatables(), lua_terrainmap::register_metatables(), lua_units::register_metatables(), lua_terrainfilter::register_metatables(), lua_preferences::register_table(), lua_unit_type::register_table(), lua_audio::register_table(), lua_common::register_tstring_metatable(), lua_common::register_vconfig_metatable(), game_lua_kernel::run_event(), application_lua_kernel::thread::run_script(), searcher_Croot(), searchpath(), game_lua_kernel::set_wml_action(), game_lua_kernel::set_wml_condition(), setpath(), settabss(), ai::lua_object< T >::to_type(), ai::transform_ai_action(), and ai::lua_ai_load::~lua_ai_load().

◆ lua_pushthread()

LUA_API int() lua_pushthread ( lua_State L)

Definition at line 600 of file lapi.cpp.

References api_incr_top, G, lua_lock, lua_unlock, s2v, setthvalue, and lua_State::top.

Referenced by db_gethook(), db_sethook(), hookf(), and luaB_corunning().

◆ lua_pushvalue()

LUA_API void() lua_pushvalue ( lua_State L,
int  idx 
)

Definition at line 246 of file lapi.cpp.

References api_incr_top, index2value(), lua_lock, lua_unlock, setobj2s, and lua_State::top.

Referenced by add_value(), addtoclib(), game_lua_kernel::apply_effect(), aux_lines(), auxsort(), lua_pathfind_cost_calculator::cost(), ai::lua_ai_context::create(), ai::lua_ai_action_handler::create(), createmetatable(), createsearcherstable(), createstdfile(), db_getinfo(), db_getlocal(), db_getregistry(), db_sethook(), db_traceback(), f_write(), lua_mapgen::filter::filter(), finishpcall(), g_iofile(), ai::generate_and_push_ai_state(), generic_reader(), lua_kernel_base::get_attribute_names(), lua_callable::get_inputs(), get_new_thread(), ai::impl_ai_get(), impl_side_get(), impl_slocs_iter(), lua_stringx::impl_str_index(), game_lua_kernel::impl_theme_items_get(), game_lua_kernel::impl_theme_items_set(), impl_unit_attacks_iter(), impl_unit_attacks_next(), impl_unit_type_pairs(), lua_common::impl_vconfig_ipairs(), lua_common::impl_vconfig_pairs(), lua_kernel_base::interactive_run(), intf_describe_plugins(), intf_do_unsynced(), intf_load(), lua_kernel_base::intf_print(), intf_replace_if_failed(), lua_kernel_base::intf_require(), intf_set_dialog_callback(), intf_show_dialog(), game_lua_kernel::intf_skip_messages(), lua_stringx::intf_str_format(), lua_stringx::intf_str_join_map(), io_lines(), io_readline(), iter_codes(), ll_require(), load_aux(), lua_rng::load_tables(), luaB_cocreate(), luaB_error(), luaB_ipairs(), luaB_pairs(), luaB_xpcall(), luaL_callmeta(), luaL_getsubtable(), luaL_newmetatable(), luaL_requiref(), luaL_setfuncs(), luaL_tolstring(), luaopen_base(), luaopen_package(), luaW_pushwidgettable(), luaW_pushwidgettablecontainer(), luaW_pushwindowtable(), luaW_to_locationset(), math_max(), math_min(), game_lua_kernel::push_builtin_effect(), push_unit_attacks_table(), lua_cpp::register_metatable(), lua_preferences::register_table(), game_lua_kernel::run_filter(), lua_cpp::set_functions(), sort_comp(), str_gsub(), tmove(), tonum(), WIDGET_GETTER(), and WIDGET_SETTER().

◆ lua_pushvfstring()

LUA_API const char*() lua_pushvfstring ( lua_State L,
const char *  fmt,
va_list  argp 
)

Definition at line 531 of file lapi.cpp.

References lua_lock, lua_unlock, luaC_checkGC, and luaO_pushvfstring().

Referenced by luaL_error().

◆ lua_rawequal()

LUA_API int() lua_rawequal ( lua_State L,
int  idx1,
int  idx2 
)

Definition at line 304 of file lapi.cpp.

References index2value(), isvalid, and luaV_rawequalobj.

Referenced by findfield(), luaB_rawequal(), and luaL_testudata().

◆ lua_rawget()

LUA_API int() lua_rawget ( lua_State L,
int  idx 
)

◆ lua_rawgeti()

LUA_API int() lua_rawgeti ( lua_State L,
int  idx,
lua_Integer  n 
)

◆ lua_rawgetp()

LUA_API int() lua_rawgetp ( lua_State L,
int  idx,
const void *  p 
)

Definition at line 718 of file lapi.cpp.

References cast_voidp, finishrawget(), gettable(), lua_lock, luaH_get(), setpvalue, and t.

◆ lua_rawlen()

LUA_API lua_Unsigned() lua_rawlen ( lua_State L,
int  idx 
)

◆ lua_rawset()

LUA_API void() lua_rawset ( lua_State L,
int  idx 
)

◆ lua_rawseti()

LUA_API void() lua_rawseti ( lua_State L,
int  idx,
lua_Integer  n 
)

◆ lua_rawsetp()

LUA_API void() lua_rawsetp ( lua_State L,
int  idx,
const void *  p 
)

Definition at line 882 of file lapi.cpp.

References aux_rawset(), cast_voidp, and setpvalue.

◆ lua_resetthread()

LUA_API int() lua_resetthread ( lua_State L)

◆ lua_resume()

LUA_API int() lua_resume ( lua_State L,
lua_State from,
int  narg,
int *  nres 
)

◆ lua_rotate()

LUA_API void() lua_rotate ( lua_State L,
int  idx,
int  n 
)

◆ lua_setallocf()

LUA_API void() lua_setallocf ( lua_State L,
lua_Alloc  f,
void *  ud 
)

Definition at line 1287 of file lapi.cpp.

References f, G, lua_lock, and lua_unlock.

◆ lua_setcstacklimit()

LUA_API int() lua_setcstacklimit ( lua_State L,
unsigned int  limit 
)

Definition at line 99 of file lstate.cpp.

References LUAI_MAXCCALLS, and UNUSED.

Referenced by db_setcstacklimit().

◆ lua_setfield()

LUA_API void() lua_setfield ( lua_State L,
int  idx,
const char *  k 
)

Definition at line 837 of file lapi.cpp.

References auxsetstr(), index2value(), and lua_lock.

Referenced by addtoclib(), application_lua_kernel::application_lua_kernel(), ai::lua_ai_context::create(), createclibstable(), createmeta(), createmetatable(), createsearcherstable(), createstdfile(), db_getinfo(), db_sethook(), g_iofile(), game_lua_kernel::game_lua_kernel(), ai::generate_and_push_ai_state(), ai::generate_and_push_ai_table(), ai::impl_ai_aspect_get(), ai::impl_ai_get(), game_lua_kernel::impl_get_terrain_info(), lua_common::impl_vconfig_get(), ai::lua_ai_context::init(), game_lua_kernel::initialize(), lua_kernel_base::interactive_run(), game_lua_kernel::intf_create_animator(), game_lua_kernel::intf_get_time_of_day(), lua_fileops::intf_read_file(), ll_require(), lua_rng::load_tables(), lua_kernel_base::lua_kernel_base(), luaL_getsubtable(), luaL_newmetatable(), luaL_requiref(), luaL_setfuncs(), luaopen_base(), luaopen_math(), luaopen_package(), luaopen_utf8(), luaW_filltable(), lua_mathx::luaW_open(), lua_stringx::luaW_open(), luaW_pushrace(), luaW_pushracetable(), luaW_pushsimdata(), luaW_pushsimweapon(), mapgen_lua_kernel::mapgen_lua_kernel(), push_error_handler(), lua_units::register_attacks_metatables(), lua_common::register_gettext_metatable(), lua_cpp::register_metatable(), lua_race::register_metatable(), lua_widget::register_metatable(), lua_unit_type::register_metatable(), lua_formula_bridge::register_metatables(), lua_colors::register_metatables(), lua_terrainmap::register_metatables(), lua_units::register_metatables(), lua_terrainfilter::register_metatables(), lua_preferences::register_table(), lua_unit_type::register_table(), lua_audio::register_table(), lua_common::register_tstring_metatable(), lua_common::register_vconfig_metatable(), ai::lua_ai_context::set_arguments(), lua_cpp::set_functions(), ai::lua_ai_context::set_persistent_data(), setboolfield(), setfield(), setpath(), settabsb(), settabsi(), settabss(), tpack(), ai::transform_ai_action(), treatstackoption(), and ai::lua_ai_context::update_state().

◆ lua_setglobal()

LUA_API void() lua_setglobal ( lua_State L,
const char *  name 
)

◆ lua_sethook()

LUA_API void() lua_sethook ( lua_State L,
lua_Hook  func,
int  mask,
int  count 
)

◆ lua_seti()

LUA_API void() lua_seti ( lua_State L,
int  idx,
lua_Integer  n 
)

◆ lua_setiuservalue()

LUA_API int() lua_setiuservalue ( lua_State L,
int  idx,
int  n 
)

◆ lua_setlocal()

LUA_API const char*() lua_setlocal ( lua_State L,
const lua_Debug ar,
int  n 
)

Definition at line 246 of file ldebug.cpp.

References lua_Debug::i_ci, lua_lock, lua_unlock, luaG_findlocal(), setobjs2s, and lua_State::top.

Referenced by db_setlocal().

◆ lua_setmetatable()

LUA_API int() lua_setmetatable ( lua_State L,
int  objindex 
)

◆ lua_settable()

LUA_API void() lua_settable ( lua_State L,
int  idx 
)

◆ lua_settop()

LUA_API void() lua_settop ( lua_State L,
int  idx 
)

Definition at line 173 of file lapi.cpp.

References api_check, lua_State::ci, CallInfo::func, hastocloseCfunc, lua_lock, LUA_OK, lua_unlock, luaF_close(), CallInfo::nresults, s2v, setnilvalue, and lua_State::top.

Referenced by application_lua_kernel::application_lua_kernel(), game_lua_kernel::apply_effect(), ai::cfun_attack_rating(), db_debug(), db_sethook(), db_setlocal(), db_setmetatable(), db_setuservalue(), lua_callable::do_compare(), game_lua_kernel::game_lua_kernel(), ai::lua_ai_context::get_arguments(), lua_kernel_base::get_attribute_names(), lua_kernel_base::get_global_var_names(), ai::lua_ai_context::get_persistent_data(), gmatch(), ai::lua_ai_action_handler::handle(), impl_slocs_iter(), game_lua_kernel::initialize(), lua_kernel_base::interactive_run(), intf_current_version(), game_lua_kernel::intf_get_recall_units(), game_lua_kernel::intf_get_sides(), game_lua_kernel::intf_get_units(), intf_make_version(), lua_stringx::intf_str_join_map(), intf_terrainmap_iter(), io_readline(), ll_require(), lua_kernel_base::load_core(), load_fake_units(), lua_kernel_base::lua_kernel_base(), luaB_assert(), luaB_dofile(), luaB_error(), luaB_load(), luaB_next(), luaB_rawget(), luaB_rawset(), luaB_setmetatable(), luaB_tonumber(), luaL_loadfilex(), luaW_toconfig(), mapgen_lua_kernel::mapgen_lua_kernel(), math_ceil(), math_floor(), math_modf(), os_time(), pushglobalfuncname(), ai::lua_ai_context::set_arguments(), ai::lua_ai_context::set_persistent_data(), sort(), str_dump(), ai::lua_object< T >::to_type(), trymt(), and ai::unit_advancements_aspect::unit_advancements_aspect().

◆ lua_setupvalue()

LUA_API const char*() lua_setupvalue ( lua_State L,
int  funcindex,
int  n 
)

◆ lua_setwarnf()

LUA_API void() lua_setwarnf ( lua_State L,
lua_WarnFunction  f,
void *  ud 
)

Definition at line 1295 of file lapi.cpp.

References f, G, lua_lock, and lua_unlock.

Referenced by checkcontrol(), lua_kernel_base::lua_kernel_base(), luaL_newstate(), and warnfcont().

◆ lua_status()

LUA_API int() lua_status ( lua_State L)

◆ lua_stringtonumber()

LUA_API size_t() lua_stringtonumber ( lua_State L,
const char *  s 
)

Definition at line 347 of file lapi.cpp.

References api_incr_top, luaO_str2num(), s2v, and lua_State::top.

Referenced by luaB_tonumber(), read_number(), and tonum().

◆ lua_toboolean()

LUA_API int() lua_toboolean ( lua_State L,
int  idx 
)

◆ lua_tocfunction()

LUA_API lua_CFunction() lua_tocfunction ( lua_State L,
int  idx 
)

Definition at line 414 of file lapi.cpp.

References clCvalue, fvalue, index2value(), ttisCclosure, and ttislcf.

◆ lua_toclose()

LUA_API void() lua_toclose ( lua_State L,
int  idx 
)

◆ lua_tointegerx()

LUA_API lua_Integer() lua_tointegerx ( lua_State L,
int  idx,
int *  isnum 
)

◆ lua_tolstring()

LUA_API const char*() lua_tolstring ( lua_State L,
int  idx,
size_t *  len 
)

◆ lua_tonumberx()

LUA_API lua_Number() lua_tonumberx ( lua_State L,
int  idx,
int *  isnum 
)

◆ lua_topointer()

LUA_API const void*() lua_topointer ( lua_State L,
int  idx 
)

◆ lua_tothread()

LUA_API lua_State*() lua_tothread ( lua_State L,
int  idx 
)

Definition at line 438 of file lapi.cpp.

References index2value(), thvalue, and ttisthread.

Referenced by getco(), getthread(), and luaB_auxwrap().

◆ lua_touserdata()

LUA_API void*() lua_touserdata ( lua_State L,
int  idx 
)

◆ lua_type()

LUA_API int() lua_type ( lua_State L,
int  idx 
)

◆ lua_typename()

LUA_API const char*() lua_typename ( lua_State L,
int  tp 
)

◆ lua_upvalueid()

LUA_API void*() lua_upvalueid ( lua_State L,
int  fidx,
int  n 
)

Definition at line 1399 of file lapi.cpp.

References api_check, clCvalue, f, getupvalref(), index2value(), LUA_VCCL, LUA_VLCF, LUA_VLCL, ttypetag, and CClosure::upvalue.

Referenced by checkupval().

◆ lua_upvaluejoin()

LUA_API void() lua_upvaluejoin ( lua_State L,
int  fidx1,
int  n1,
int  fidx2,
int  n2 
)

Definition at line 1421 of file lapi.cpp.

References api_check, getupvalref(), and luaC_objbarrier.

Referenced by db_upvaluejoin().

◆ lua_version()

LUA_API lua_Number() lua_version ( lua_State L)

Definition at line 146 of file lapi.cpp.

References LUA_VERSION_NUM, and UNUSED.

Referenced by luaL_checkversion_().

◆ lua_warning()

LUA_API void() lua_warning ( lua_State L,
const char *  msg,
int  tocont 
)

Definition at line 1303 of file lapi.cpp.

References lua_lock, lua_unlock, and luaE_warning().

Referenced by intf_deprecated_message(), and luaB_warn().

◆ lua_xmove()

LUA_API void() lua_xmove ( lua_State from,
lua_State to,
int  n 
)

◆ lua_yieldk()

LUA_API int() lua_yieldk ( lua_State L,
int  nresults,
lua_KContext  ctx,
lua_KFunction  k 
)

Variable Documentation

◆ lua_ident

const char lua_ident[]

Definition at line 35 of file lapi.cpp.