diff -r 7de85783b823 -r 4a4f21070479 hedgewars/LuaPas.pas --- a/hedgewars/LuaPas.pas Sun Nov 11 16:53:16 2012 +0100 +++ b/hedgewars/LuaPas.pas Sun Nov 11 17:15:19 2012 +0100 @@ -54,12 +54,14 @@ @* of a function in debug information. ** CHANGE it if you want a different size. *) + const LUA_IDSIZE = 60; (* @@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system. *) + const LUAL_BUFFERSIZE = 1024; @@ -69,6 +71,7 @@ ** CHANGE them if you want different prompts. (You can also change the ** prompts dynamically, assigning to globals _PROMPT/_PROMPT2.) *) + const LUA_PROMPT = '> '; LUA_PROMPT2 = '>> '; @@ -112,6 +115,7 @@ ** See Copyright Notice at the end of this file *) + const LUA_VERSION = 'Lua 5.1'; LUA_VERSION_NUM = 501; @@ -131,8 +135,10 @@ LUA_ENVIRONINDEX = -10001; LUA_GLOBALSINDEX = -10002; + function lua_upvalueindex(idx : LongInt) : LongInt; // a marco + const (* thread status; 0 is OK *) LUA_YIELD_ = 1; // Note: the ending underscore is needed in Pascal @@ -141,6 +147,7 @@ LUA_ERRMEM = 4; LUA_ERRERR = 5; + type lua_CFunction = function(L : Plua_State) : LongInt; cdecl; @@ -155,6 +162,7 @@ *) lua_Alloc = function (ud, ptr : Pointer; osize, nsize : size_t) : Pointer; cdecl; + const (* ** basic types @@ -180,6 +188,7 @@ (* type for integer functions *) lua_Integer = LUA_INTEGER_; + (* ** state manipulation *) @@ -240,10 +249,9 @@ function lua_type(L : Plua_State; idx : LongInt) : LongInt; cdecl; external LuaLibName; - + function lua_typename(L : Plua_State; tp : LongInt) : PChar; cdecl; external LuaLibName; - function lua_equal(L : Plua_State; idx1, idx2 : LongInt) : LongBool; cdecl; external LuaLibName; @@ -263,10 +271,9 @@ function lua_toboolean(L : Plua_State; idx : LongInt) : LongBool; cdecl; external LuaLibName; - function lua_tolstring(L : Plua_State; idx : LongInt; len : Psize_t) : PChar; cdecl; external LuaLibName; - + function lua_objlen(L : Plua_State; idx : LongInt) : size_t; cdecl; external LuaLibName; @@ -294,14 +301,13 @@ procedure lua_pushinteger(L : Plua_State; n : lua_Integer); cdecl; external LuaLibName; - + procedure lua_pushlstring(L : Plua_State; const s : PChar; ls : size_t); cdecl; external LuaLibName; procedure lua_pushstring(L : Plua_State; const s : PChar); cdecl; external LuaLibName; - function lua_pushvfstring(L : Plua_State; const fmt : PChar; argp : Pointer) : PChar; cdecl; external LuaLibName; @@ -327,10 +333,10 @@ *) procedure lua_gettable(L : Plua_State ; idx : LongInt); cdecl; external LuaLibName; - + procedure lua_getfield(L : Plua_State; idx : LongInt; k : PChar); cdecl; external LuaLibName; - + procedure lua_rawget(L : Plua_State; idx : LongInt); cdecl; external LuaLibName; @@ -355,10 +361,10 @@ *) procedure lua_settable(L : Plua_State; idx : LongInt); cdecl; external LuaLibName; - + procedure lua_setfield(L : Plua_State; idx : LongInt; const k : PChar); cdecl; external LuaLibName; - + procedure lua_rawset(L : Plua_State; idx : LongInt); cdecl; external LuaLibName; @@ -406,6 +412,7 @@ (* ** garbage-collection functions and options *) + const LUA_GCSTOP = 0; LUA_GCRESTART = 1; @@ -415,7 +422,7 @@ LUA_GCSTEP = 5; LUA_GCSETPAUSE = 6; LUA_GCSETSTEPMUL = 7; - + function lua_gc(L : Plua_State; what, data : LongInt) : LongInt; cdecl; external LuaLibName;