hedgewars/LuaPas.pas
changeset 6453 11c578d30bd3
parent 5551 0897b947e7a0
child 6580 6155187bf599
equal deleted inserted replaced
6452:7c6f9b6672dc 6453:11c578d30bd3
    13 
    13 
    14 {.$DEFINE LUA_GETHOOK}
    14 {.$DEFINE LUA_GETHOOK}
    15 {$INCLUDE "config.inc"}
    15 {$INCLUDE "config.inc"}
    16 
    16 
    17 type
    17 type
    18   size_t   = type Cardinal;
    18   size_t   = Cardinal;
    19   Psize_t  = ^size_t;
    19   Psize_t  = ^size_t;
    20   PPointer = ^Pointer;
    20   PPointer = ^Pointer;
    21 
    21 
    22   lua_State = record end;
    22   lua_State = record end;
    23   Plua_State = ^lua_State;
    23   Plua_State = ^lua_State;
    43 ** with a number type different from double. You may also need to
    43 ** with a number type different from double. You may also need to
    44 ** change lua_number2int & lua_number2integer.
    44 ** change lua_number2int & lua_number2integer.
    45 ** ===================================================================
    45 ** ===================================================================
    46 *)
    46 *)
    47 type
    47 type
    48   LUA_NUMBER_  = type Double;            // ending underscore is needed in Pascal
    48   LUA_NUMBER_  = Double;            // ending underscore is needed in Pascal
    49   LUA_INTEGER_ = type PtrInt;
    49   LUA_INTEGER_ = PtrInt;
    50 
    50 
    51 (*
    51 (*
    52 @@ LUA_IDSIZE gives the maximum size for the description of the source
    52 @@ LUA_IDSIZE gives the maximum size for the description of the source
    53 @* of a function in debug information.
    53 @* of a function in debug information.
    54 ** CHANGE it if you want a different size.
    54 ** CHANGE it if you want a different size.
   113   LUA_VERSION_NUM = 501;
   113   LUA_VERSION_NUM = 501;
   114   LUA_COPYRIGHT   = 'Copyright (C) 1994-2006 Tecgraf, PUC-Rio';
   114   LUA_COPYRIGHT   = 'Copyright (C) 1994-2006 Tecgraf, PUC-Rio';
   115   LUA_AUTHORS     = 'R. Ierusalimschy, L. H. de Figueiredo & W. Celes';
   115   LUA_AUTHORS     = 'R. Ierusalimschy, L. H. de Figueiredo & W. Celes';
   116 
   116 
   117   (* mark for precompiled code (`<esc>Lua') *)
   117   (* mark for precompiled code (`<esc>Lua') *)
   118   LUA_SIGNATURE = #27'Lua';
   118   LUA_SIGNATURE = #27 + 'Lua';
   119 
   119 
   120   (* option for multiple returns in `lua_pcall' and `lua_call' *)
   120   (* option for multiple returns in `lua_pcall' and `lua_call' *)
   121   LUA_MULTRET = -1;
   121   LUA_MULTRET = -1;
   122 
   122 
   123   (*
   123   (*
   427 procedure lua_getregistry(L : Plua_State);
   427 procedure lua_getregistry(L : Plua_State);
   428 
   428 
   429 function lua_getgccount(L : Plua_State) : LongInt;
   429 function lua_getgccount(L : Plua_State) : LongInt;
   430 
   430 
   431 type
   431 type
   432   lua_Chuckreader = type lua_Reader;
   432   lua_Chuckreader = lua_Reader;
   433   lua_Chuckwriter = type lua_Writer;
   433   lua_Chuckwriter = lua_Writer;
   434 
   434 
   435 (* ====================================================================== *)
   435 (* ====================================================================== *)
   436 
   436 
   437 (*
   437 (*
   438 ** {======================================================================
   438 ** {======================================================================
   981 
   981 
   982 procedure luaL_addchar(B : PluaL_Buffer; c : Char);
   982 procedure luaL_addchar(B : PluaL_Buffer; c : Char);
   983 begin
   983 begin
   984   if not(B^.p < B^.buffer + LUAL_BUFFERSIZE) then
   984   if not(B^.p < B^.buffer + LUAL_BUFFERSIZE) then
   985     luaL_prepbuffer(B);
   985     luaL_prepbuffer(B);
   986   B^.p^ := c;
   986   (B^.p^) := c;
   987   Inc(B^.p);
   987   Inc(B^.p);
   988 end;
   988 end;
   989 
   989 
   990 procedure luaL_putchar(B : PluaL_Buffer; c : Char);
   990 procedure luaL_putchar(B : PluaL_Buffer; c : Char);
   991 begin
   991 begin