hedgewars/LuaPas.pas
changeset 5549 ccfb9b8ab9d1
parent 5089 90266b67fff8
child 5551 0897b947e7a0
equal deleted inserted replaced
5547:2fe1d68a102c 5549:ccfb9b8ab9d1
   414 procedure lua_pushliteral(L : Plua_State; s : PChar);
   414 procedure lua_pushliteral(L : Plua_State; s : PChar);
   415 
   415 
   416 procedure lua_setglobal(L : Plua_State; s : PChar);
   416 procedure lua_setglobal(L : Plua_State; s : PChar);
   417 procedure lua_getglobal(L : Plua_State; s : PChar);
   417 procedure lua_getglobal(L : Plua_State; s : PChar);
   418 
   418 
   419 function lua_tostring(L : Plua_State; idx : LongInt) : PChar;
   419 function lua_tostring(L : Plua_State; idx : LongInt) : shortstring;
   420 
   420 
   421 
   421 
   422 (*
   422 (*
   423 ** compatibility macros and functions
   423 ** compatibility macros and functions
   424 *)
   424 *)
   755 (******************************************************************************)
   755 (******************************************************************************)
   756 
   756 
   757 implementation
   757 implementation
   758 
   758 
   759 uses
   759 uses
   760   SysUtils;
   760   SysUtils, Strings;
   761 
   761 
   762 (*****************************************************************************)
   762 (*****************************************************************************)
   763 (*                            luaconfig.h                                    *)
   763 (*                            luaconfig.h                                    *)
   764 (*****************************************************************************)
   764 (*****************************************************************************)
   765 
   765 
   870 procedure lua_getglobal(L: Plua_State; s: PChar);
   870 procedure lua_getglobal(L: Plua_State; s: PChar);
   871 begin
   871 begin
   872   lua_getfield(L, LUA_GLOBALSINDEX, s);
   872   lua_getfield(L, LUA_GLOBALSINDEX, s);
   873 end;
   873 end;
   874 
   874 
   875 function lua_tostring(L : Plua_State; idx : LongInt) : PChar;
   875 function lua_tostring(L : Plua_State; idx : LongInt) : shortstring;
   876 begin
   876 begin
   877   lua_tostring := lua_tolstring(L, idx, nil);
   877   lua_tostring := Strings.StrPas(lua_tolstring(L, idx, nil));
   878 end;
   878 end;
   879 
   879 
   880 function lua_open : Plua_State;
   880 function lua_open : Plua_State;
   881 begin
   881 begin
   882   lua_open := luaL_newstate;
   882   lua_open := luaL_newstate;