hedgewars/LuaPas.pas
author sheepluva
Thu, 23 Jan 2014 13:56:53 +0100
changeset 10061 b7161f00a6ca
parent 10015 4feced261c68
child 10124 aabd1b75d5a3
permissions -rw-r--r--
hide complete IP of other users, when non-admin requests player info. showing the first two parts of the IP was kinda pointless to begin with (what for?) and has recently lead to increased abuse and lobby flooding due to bots collecting/posting IP tracking information
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3407
dcc129c4352e Engine:
smxx
parents: 3043
diff changeset
     1
{$HINTS OFF}
7151
ec15d9e1a7e3 pas2c stuff
unc0rr
parents: 7073
diff changeset
     2
{$INCLUDE "options.inc"}
3407
dcc129c4352e Engine:
smxx
parents: 3043
diff changeset
     3
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
     4
unit LuaPas;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
     5
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
     6
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
     7
 * A complete Pascal wrapper for Lua 5.1 DLL module.
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
     8
 *
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
     9
 * Created by Geo Massar, 2006
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    10
 * Distributed as free/open source.
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    11
 *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    12
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    13
interface
7043
7c080e5ac8d0 Some work to make more units compile after conversion to c
unc0rr
parents: 6817
diff changeset
    14
uses uConsts;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    15
{.$DEFINE LUA_GETHOOK}
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    16
9208
acb2492288e5 heavily rework lua discovery and linking, needs testing but it's more similar to what we do for other libraries now
koda
parents: 9205
diff changeset
    17
const LuaLibName = {$IFDEF LUA_INTERNAL}'libhwlua'{$ELSE}'liblua'{$ENDIF};
acb2492288e5 heavily rework lua discovery and linking, needs testing but it's more similar to what we do for other libraries now
koda
parents: 9205
diff changeset
    18
acb2492288e5 heavily rework lua discovery and linking, needs testing but it's more similar to what we do for other libraries now
koda
parents: 9205
diff changeset
    19
{$IFNDEF WIN32}
acb2492288e5 heavily rework lua discovery and linking, needs testing but it's more similar to what we do for other libraries now
koda
parents: 9205
diff changeset
    20
    {$linklib lua}
acb2492288e5 heavily rework lua discovery and linking, needs testing but it's more similar to what we do for other libraries now
koda
parents: 9205
diff changeset
    21
{$ENDIF}
9205
abce6011f86c aaaaand let's not forget about lua, which has also a slightly revised build process
koda
parents: 8838
diff changeset
    22
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    23
type
8847
ff7fbab7cd56 update branch again
koda
parents: 8026 8838
diff changeset
    24
{$IFNDEF PAS2C}
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
    25
    size_t   = Cardinal;
7073
26f960656cc9 help pas2c
unc0rr
parents: 7043
diff changeset
    26
{$ENDIF}
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
    27
    Psize_t  = ^size_t;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
    28
    PPointer = ^Pointer;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    29
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
    30
    lua_State = record end;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
    31
    Plua_State = ^lua_State;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    32
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    33
(*****************************************************************************)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    34
(*                               luaconfig.h                                 *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    35
(*****************************************************************************)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    36
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    37
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    38
** $Id: luaconf.h,v 1.81 2006/02/10 17:44:06 roberto Exp $
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    39
** Configuration file for Lua
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    40
** See Copyright Notice in lua.h
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    41
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    42
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    43
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    44
** {==================================================================
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    45
@@ LUA_NUMBER is the type of numbers in Lua.
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    46
** CHANGE the following definitions only if you want to build Lua
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    47
** with a number type different from double. You may also need to
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    48
** change lua_number2int & lua_number2integer.
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    49
** ===================================================================
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    50
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    51
type
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
    52
    LUA_NUMBER_  = Double;            // ending underscore is needed in Pascal
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
    53
    LUA_INTEGER_ = PtrInt;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    54
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    55
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    56
@@ LUA_IDSIZE gives the maximum size for the description of the source
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    57
@* of a function in debug information.
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    58
** CHANGE it if you want a different size.
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    59
*)
8026
4a4f21070479 merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents: 7151
diff changeset
    60
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    61
const
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
    62
    LUA_IDSIZE = 60;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    63
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    64
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    65
@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system.
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    66
*)
8026
4a4f21070479 merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents: 7151
diff changeset
    67
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    68
const
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
    69
    LUAL_BUFFERSIZE = 1024;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    70
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    71
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    72
@@ LUA_PROMPT is the default prompt used by stand-alone Lua.
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    73
@@ LUA_PROMPT2 is the default continuation prompt used by stand-alone Lua.
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    74
** CHANGE them if you want different prompts. (You can also change the
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    75
** prompts dynamically, assigning to globals _PROMPT/_PROMPT2.)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    76
*)
8026
4a4f21070479 merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents: 7151
diff changeset
    77
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    78
const
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
    79
    LUA_PROMPT  = '> ';
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
    80
    LUA_PROMPT2 = '>> ';
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    81
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    82
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    83
@@ lua_readline defines how to show a prompt and then read a line from
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    84
@* the standard input.
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    85
@@ lua_saveline defines how to "save" a read line in a "history".
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    86
@@ lua_freeline defines how to free a line read by lua_readline.
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    87
** CHANGE them if you want to improve this functionality (e.g., by using
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    88
** GNU readline and history facilities).
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    89
*)
7151
ec15d9e1a7e3 pas2c stuff
unc0rr
parents: 7073
diff changeset
    90
{function  lua_readline(L : Plua_State;
ec15d9e1a7e3 pas2c stuff
unc0rr
parents: 7073
diff changeset
    91
var b : PChar; p : PChar): Boolean;}
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
    92
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    93
procedure lua_saveline(L : Plua_State; idx : LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
    94
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    95
procedure lua_freeline(L : Plua_State; b : PChar);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    96
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    97
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    98
@@ lua_stdin_is_tty detects whether the standard input is a 'tty' (that
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
    99
@* is, whether we're running lua interactively).
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   100
** CHANGE it if you have a better definition for non-POSIX/non-Windows
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   101
** systems.
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   102
*/
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   103
#include <io.h>
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   104
#include <stdio.h>
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   105
#define lua_stdin_is_tty()  _isatty(_fileno(stdin))
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   106
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   107
const
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   108
    lua_stdin_is_tty = TRUE;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   109
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   110
(*****************************************************************************)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   111
(*                                  lua.h                                    *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   112
(*****************************************************************************)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   113
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   114
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   115
** $Id: lua.h,v 1.216 2006/01/10 12:50:13 roberto Exp $
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   116
** Lua - An Extensible Extension Language
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   117
** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   118
** See Copyright Notice at the end of this file
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   119
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   120
8026
4a4f21070479 merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents: 7151
diff changeset
   121
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   122
const
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   123
    LUA_VERSION     = 'Lua 5.1';
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   124
    LUA_VERSION_NUM = 501;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   125
    LUA_COPYRIGHT   = 'Copyright (C) 1994-2006 Tecgraf, PUC-Rio';
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   126
    LUA_AUTHORS     = 'R. Ierusalimschy, L. H. de Figueiredo & W. Celes';
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   127
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   128
    (* mark for precompiled code (`<esc>Lua') *)
7151
ec15d9e1a7e3 pas2c stuff
unc0rr
parents: 7073
diff changeset
   129
    //LUA_SIGNATURE = #27'Lua';
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   130
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   131
    (* option for multiple returns in `lua_pcall' and `lua_call' *)
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   132
    LUA_MULTRET = -1;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   133
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   134
    (*
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   135
    ** pseudo-indices
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   136
    *)
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   137
    LUA_REGISTRYINDEX = -10000;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   138
    LUA_ENVIRONINDEX  = -10001;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   139
    LUA_GLOBALSINDEX  = -10002;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   140
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   141
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   142
function lua_upvalueindex(idx : LongInt) : LongInt;   // a marco
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   143
8026
4a4f21070479 merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents: 7151
diff changeset
   144
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   145
const
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   146
   (* thread status; 0 is OK *)
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   147
    LUA_YIELD_    = 1;     // Note: the ending underscore is needed in Pascal
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   148
    LUA_ERRRUN    = 2;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   149
    LUA_ERRSYNTAX = 3;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   150
    LUA_ERRMEM    = 4;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   151
    LUA_ERRERR    = 5;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   152
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   153
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   154
type
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   155
   lua_CFunction = function(L : Plua_State) : LongInt; cdecl;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   156
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   157
    (*
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   158
    ** functions that read/write blocks when loading/dumping Lua chunks
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   159
    *)
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   160
    lua_Reader = function (L : Plua_State; ud : Pointer; sz : Psize_t) : PChar; cdecl;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   161
    lua_Writer = function (L : Plua_State; const p : Pointer; sz : size_t; ud : Pointer) : LongInt; cdecl;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   162
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   163
  (*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   164
  ** prototype for memory-allocation functions
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   165
  *)
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   166
  lua_Alloc = function (ud, ptr : Pointer; osize, nsize : size_t) : Pointer; cdecl;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   167
8026
4a4f21070479 merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents: 7151
diff changeset
   168
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   169
const
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   170
    (*
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   171
    ** basic types
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   172
    *)
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   173
    LUA_TNONE          = -1;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   174
    LUA_TNIL           = 0;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   175
    LUA_TBOOLEAN       = 1;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   176
    LUA_TLIGHTUSERDATA = 2;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   177
    LUA_TNUMBER        = 3;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   178
    LUA_TSTRING        = 4;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   179
    LUA_TTABLE         = 5;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   180
    LUA_TFUNCTION      = 6;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   181
    LUA_TUSERDATA      = 7;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   182
    LUA_TTHREAD        = 8;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   183
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   184
    (* minimum Lua stack available to a C function *)
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   185
    LUA_MINSTACK = 20;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   186
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   187
type
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   188
    (* type of numbers in Lua *)
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   189
    lua_Number = LUA_NUMBER_;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   190
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   191
    (* type for integer functions *)
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   192
    lua_Integer = LUA_INTEGER_;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   193
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   194
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   195
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   196
** state manipulation
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   197
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   198
function  lua_newstate(f : lua_Alloc; ud : Pointer) : Plua_State;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   199
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   200
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   201
procedure lua_close(L: Plua_State);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   202
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   203
function  lua_newthread(L : Plua_State) : Plua_State;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   204
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   205
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   206
function  lua_atpanic(L : Plua_State; panicf : lua_CFunction) : lua_CFunction;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   207
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   208
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   209
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   210
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   211
** basic stack manipulation
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   212
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   213
function  lua_gettop(L : Plua_State) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   214
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   215
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   216
procedure lua_settop(L : Plua_State; idx : LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   217
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   218
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   219
procedure lua_pushvalue(L : Plua_State; idx : LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   220
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   221
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   222
procedure lua_remove(L : Plua_State; idx : LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   223
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   224
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   225
procedure lua_insert(L : Plua_State; idx : LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   226
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   227
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   228
procedure lua_replace(L : Plua_State; idx : LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   229
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   230
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   231
function  lua_checkstack(L : Plua_State; sz : LongInt) : LongBool;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   232
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   233
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   234
procedure lua_xmove(src, dest : Plua_State; n : LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   235
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   236
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   237
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   238
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   239
** access functions (stack -> C)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   240
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   241
function lua_isnumber(L : Plua_State; idx : LongInt) : LongBool;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   242
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   243
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   244
function lua_isstring(L : Plua_State; idx : LongInt) : LongBool;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   245
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   246
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   247
function lua_iscfunction(L : Plua_State; idx : LongInt) : LongBool;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   248
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   249
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   250
function lua_isuserdata(L : Plua_State; idx : LongInt) : LongBool;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   251
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   252
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   253
function lua_type(L : Plua_State; idx : LongInt) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   254
    cdecl; external LuaLibName;
8026
4a4f21070479 merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents: 7151
diff changeset
   255
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   256
function lua_typename(L : Plua_State; tp : LongInt) : PChar;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   257
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   258
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   259
function lua_equal(L : Plua_State; idx1, idx2 : LongInt) : LongBool;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   260
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   261
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   262
function lua_rawequal(L : Plua_State; idx1, idx2 : LongInt) : LongBool;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   263
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   264
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   265
function lua_lessthan(L : Plua_State; idx1, idx2 : LongInt) : LongBool;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   266
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   267
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   268
function lua_tonumber(L : Plua_State; idx : LongInt) : lua_Number;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   269
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   270
5089
90266b67fff8 This better matches lua headers
nemo
parents: 5088
diff changeset
   271
function lua_tointeger(L : Plua_State; idx : LongInt) : lua_Integer;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   272
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   273
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   274
function lua_toboolean(L : Plua_State; idx : LongInt) : LongBool;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   275
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   276
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   277
function lua_tolstring(L : Plua_State; idx : LongInt; len : Psize_t) : PChar;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   278
    cdecl; external LuaLibName;
8026
4a4f21070479 merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents: 7151
diff changeset
   279
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   280
function lua_objlen(L : Plua_State; idx : LongInt) : size_t;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   281
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   282
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   283
function lua_tocfunction(L : Plua_State; idx : LongInt) : lua_CFunction;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   284
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   285
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   286
function lua_touserdata(L : Plua_State; idx : LongInt) : Pointer;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   287
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   288
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   289
function lua_tothread(L : Plua_State; idx : LongInt) : Plua_State;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   290
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   291
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   292
function lua_topointer(L : Plua_State; idx : LongInt) : Pointer;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   293
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   294
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   295
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   296
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   297
** push functions (C -> stack)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   298
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   299
procedure lua_pushnil(L : Plua_State);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   300
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   301
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   302
procedure lua_pushnumber(L : Plua_State; n : lua_Number);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   303
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   304
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   305
procedure lua_pushinteger(L : Plua_State; n : lua_Integer);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   306
    cdecl; external LuaLibName;
8026
4a4f21070479 merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents: 7151
diff changeset
   307
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   308
procedure lua_pushlstring(L : Plua_State; const s : PChar; ls : size_t);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   309
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   310
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   311
procedure lua_pushstring(L : Plua_State; const s : PChar);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   312
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   313
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   314
function  lua_pushvfstring(L : Plua_State;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   315
    const fmt : PChar; argp : Pointer) : PChar;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   316
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   317
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   318
function  lua_pushfstring(L : Plua_State; const fmt : PChar) : PChar; varargs;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   319
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   320
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   321
procedure lua_pushcclosure(L : Plua_State; fn : lua_CFunction; n : LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   322
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   323
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   324
procedure lua_pushboolean(L : Plua_State; b : LongBool);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   325
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   326
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   327
procedure lua_pushlightuserdata(L : Plua_State; p : Pointer);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   328
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   329
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   330
function  lua_pushthread(L : Plua_state) : Cardinal;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   331
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   332
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   333
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   334
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   335
** get functions (Lua -> stack)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   336
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   337
procedure lua_gettable(L : Plua_State ; idx : LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   338
    cdecl; external LuaLibName;
8026
4a4f21070479 merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents: 7151
diff changeset
   339
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   340
procedure lua_getfield(L : Plua_State; idx : LongInt; k : PChar);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   341
    cdecl; external LuaLibName;
8026
4a4f21070479 merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents: 7151
diff changeset
   342
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   343
procedure lua_rawget(L : Plua_State; idx : LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   344
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   345
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   346
procedure lua_rawgeti(L : Plua_State; idx, n : LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   347
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   348
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   349
procedure lua_createtable(L : Plua_State; narr, nrec : LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   350
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   351
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   352
function  lua_newuserdata(L : Plua_State; sz : size_t) : Pointer;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   353
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   354
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   355
function  lua_getmetatable(L : Plua_State; objindex : LongInt) : LongBool;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   356
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   357
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   358
procedure lua_getfenv(L : Plua_State; idx : LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   359
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   360
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   361
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   362
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   363
** set functions (stack -> Lua)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   364
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   365
procedure lua_settable(L : Plua_State; idx : LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   366
    cdecl; external LuaLibName;
8026
4a4f21070479 merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents: 7151
diff changeset
   367
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   368
procedure lua_setfield(L : Plua_State; idx : LongInt; const k : PChar);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   369
    cdecl; external LuaLibName;
8026
4a4f21070479 merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents: 7151
diff changeset
   370
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   371
procedure lua_rawset(L : Plua_State; idx : LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   372
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   373
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   374
procedure lua_rawseti(L : Plua_State; idx , n: LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   375
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   376
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   377
function lua_setmetatable(L : Plua_State; objindex : LongInt): LongBool;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   378
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   379
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   380
function lua_setfenv(L : Plua_State; idx : LongInt): LongBool;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   381
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   382
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   383
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   384
** `load' and `call' functions (load and run Lua code)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   385
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   386
procedure lua_call(L : Plua_State; nargs, nresults : LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   387
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   388
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   389
function  lua_pcall(L : Plua_State; nargs, nresults, errfunc : LongInt) : LongInt;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   390
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   391
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   392
function  lua_cpcall(L : Plua_State; func : lua_CFunction; ud : Pointer) : LongInt;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   393
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   394
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   395
function  lua_load(L : Plua_State; reader : lua_Reader; dt : Pointer; const chunkname : PChar) : LongInt;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   396
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   397
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   398
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   399
function lua_dump(L : Plua_State; writer : lua_Writer; data: Pointer) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   400
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   401
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   402
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   403
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   404
** coroutine functions
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   405
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   406
function lua_yield(L : Plua_State; nresults : LongInt) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   407
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   408
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   409
function lua_resume(L : Plua_State; narg : LongInt) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   410
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   411
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   412
function lua_status(L : Plua_State) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   413
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   414
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   415
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   416
** garbage-collection functions and options
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   417
*)
8026
4a4f21070479 merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents: 7151
diff changeset
   418
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   419
const
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   420
    LUA_GCSTOP       = 0;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   421
    LUA_GCRESTART    = 1;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   422
    LUA_GCCOLLECT    = 2;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   423
    LUA_GCCOUNT      = 3;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   424
    LUA_GCCOUNTB     = 4;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   425
    LUA_GCSTEP       = 5;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   426
    LUA_GCSETPAUSE   = 6;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   427
    LUA_GCSETSTEPMUL = 7;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   428
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   429
function lua_gc(L : Plua_State; what, data : LongInt) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   430
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   431
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   432
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   433
** miscellaneous functions
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   434
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   435
function lua_error(L : Plua_State) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   436
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   437
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   438
function lua_next(L : Plua_State; idx : LongInt) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   439
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   440
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   441
procedure lua_concat(L : Plua_State; n : LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   442
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   443
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   444
function  lua_getallocf(L : Plua_State; ud : PPointer) : lua_Alloc;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   445
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   446
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   447
procedure lua_setallocf(L : Plua_State; f : lua_Alloc; ud : Pointer);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   448
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   449
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   450
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   451
** ===============================================================
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   452
** some useful macros
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   453
** ===============================================================
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   454
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   455
procedure lua_pop(L : Plua_State; n : LongInt);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   456
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   457
procedure lua_newtable(L : Plua_State);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   458
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   459
procedure lua_register(L : Plua_State; n : PChar; f : lua_CFunction);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   460
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   461
procedure lua_pushcfunction(L : Plua_State; f : lua_CFunction);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   462
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   463
function  lua_strlen(L : Plua_State; idx : LongInt) : LongInt;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   464
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   465
function lua_isfunction(L : Plua_State; n : LongInt) : Boolean;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   466
function lua_istable(L : Plua_State; n : LongInt) : Boolean;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   467
function lua_islightuserdata(L : Plua_State; n : LongInt) : Boolean;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   468
function lua_isnil(L : Plua_State; n : LongInt) : Boolean;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   469
function lua_isboolean(L : Plua_State; n : LongInt) : Boolean;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   470
function lua_isthread(L : Plua_State; n : LongInt) : Boolean;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   471
function lua_isnone(L : Plua_State; n : LongInt) : Boolean;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   472
function lua_isnoneornil(L : Plua_State; n : LongInt) : Boolean;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   473
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   474
procedure lua_pushliteral(L : Plua_State; s : PChar);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   475
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   476
procedure lua_setglobal(L : Plua_State; s : PChar);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   477
procedure lua_getglobal(L : Plua_State; s : PChar);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   478
5551
0897b947e7a0 use ansistring instead
nemo
parents: 5549
diff changeset
   479
function lua_tostring(L : Plua_State; idx : LongInt) : AnsiString;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   480
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   481
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   482
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   483
** compatibility macros and functions
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   484
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   485
function lua_open : Plua_State;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   486
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   487
procedure lua_getregistry(L : Plua_State);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   488
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   489
function lua_getgccount(L : Plua_State) : LongInt;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   490
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   491
type
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   492
    lua_Chuckreader = lua_Reader;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   493
    lua_Chuckwriter = lua_Writer;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   494
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   495
(* ====================================================================== *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   496
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   497
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   498
** {======================================================================
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   499
** Debug API
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   500
** =======================================================================
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   501
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   502
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   503
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   504
** Event codes
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   505
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   506
const
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   507
    LUA_HOOKCALL    = 0;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   508
    LUA_HOOKRET     = 1;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   509
    LUA_HOOKLINE    = 2;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   510
    LUA_HOOKCOUNT   = 3;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   511
    LUA_HOOKTAILRET = 4;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   512
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   513
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   514
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   515
** Event masks
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   516
*)
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   517
    LUA_MASKCALL  = 1 shl LUA_HOOKCALL;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   518
    LUA_MASKRET   = 1 shl LUA_HOOKRET;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   519
    LUA_MASKLINE  = 1 shl LUA_HOOKLINE;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   520
    LUA_MASKCOUNT = 1 shl LUA_HOOKCOUNT;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   521
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   522
type
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   523
    lua_Debug = packed record
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   524
    event : LongInt;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   525
    name : PChar;          (* (n) *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   526
    namewhat : PChar;      (* (n) `global', `local', `field', `method' *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   527
    what : PChar;          (* (S) `Lua', `C', `main', `tail' *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   528
    source : PChar;        (* (S) *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   529
    currentline : LongInt; (* (l) *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   530
    nups : LongInt;        (* (u) number of upvalues *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   531
    linedefined : LongInt; (* (S) *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   532
    short_src : array [0..LUA_IDSIZE-1] of Char; (* (S) *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   533
    (* private part *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   534
    i_ci : LongInt;        (* active function *)
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   535
    end;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   536
    Plua_Debug = ^lua_Debug;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   537
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   538
  (* Functions to be called by the debuger in specific events *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   539
  lua_Hook = procedure (L : Plua_State; ar : Plua_Debug); cdecl;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   540
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   541
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   542
function lua_getstack(L : Plua_State; level : LongInt; ar : Plua_Debug) : LongInt;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   543
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   544
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   545
function lua_getinfo(L : Plua_State; const what : PChar; ar: Plua_Debug): LongInt;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   546
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   547
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   548
function lua_getlocal(L : Plua_State; ar : Plua_Debug; n : LongInt) : PChar;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   549
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   550
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   551
function lua_setlocal(L : Plua_State; ar : Plua_Debug; n : LongInt) : PChar;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   552
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   553
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   554
function lua_getupvalue(L : Plua_State; funcindex, n : LongInt) : PChar;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   555
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   556
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   557
function lua_setupvalue(L : Plua_State; funcindex, n : LongInt) : PChar;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   558
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   559
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   560
function lua_sethook(L : Plua_State; func : lua_Hook; mask, count: LongInt): LongInt;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   561
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   562
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   563
{$IFDEF LUA_GETHOOK}
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   564
function lua_gethook(L : Plua_State) : lua_Hook;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   565
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   566
{$ENDIF}
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   567
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   568
function lua_gethookmask(L : Plua_State) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   569
    cdecl; external LuaLibName;
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9236
diff changeset
   570
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   571
function lua_gethookcount(L : Plua_State) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   572
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   573
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   574
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   575
(*****************************************************************************)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   576
(*                                  lualib.h                                 *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   577
(*****************************************************************************)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   578
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   579
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   580
** $Id: lualib.h,v 1.36 2005/12/27 17:12:00 roberto Exp $
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   581
** Lua standard libraries
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   582
** See Copyright Notice at the end of this file
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   583
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   584
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   585
const
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   586
    (* Key to file-handle type *)
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   587
    LUA_FILEHANDLE  = 'FILE*';
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   588
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   589
    LUA_COLIBNAME   = 'coroutine';
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   590
    LUA_TABLIBNAME  = 'table';
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   591
    LUA_IOLIBNAME   = 'io';
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   592
    LUA_OSLIBNAME   = 'os';
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   593
    LUA_STRLIBNAME  = 'string';
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   594
    LUA_MATHLIBNAME = 'math';
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   595
    LUA_DBLIBNAME   = 'debug';
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   596
    LUA_LOADLIBNAME = 'package';
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   597
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   598
function luaopen_base(L : Plua_State) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   599
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   600
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   601
function luaopen_table(L : Plua_State) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   602
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   603
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   604
function luaopen_io(L : Plua_State) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   605
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   606
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   607
function luaopen_os(L : Plua_State) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   608
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   609
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   610
function luaopen_string(L : Plua_State) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   611
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   612
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   613
function luaopen_math(L : Plua_State) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   614
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   615
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   616
function luaopen_debug(L : Plua_State) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   617
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   618
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   619
function luaopen_package(L : Plua_State) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   620
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   621
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   622
procedure luaL_openlibs(L : Plua_State);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   623
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   624
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   625
procedure lua_assert(x : Boolean);    // a macro
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   626
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   627
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   628
(*****************************************************************************)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   629
(*                                  lauxlib.h                                *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   630
(*****************************************************************************)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   631
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   632
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   633
** $Id: lauxlib.h,v 1.87 2005/12/29 15:32:11 roberto Exp $
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   634
** Auxiliary functions for building Lua libraries
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   635
** See Copyright Notice at the end of this file.
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   636
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   637
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   638
// not compatibility with the behavior of setn/getn in Lua 5.0
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   639
function  luaL_getn(L : Plua_State; idx : LongInt) : LongInt;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   640
procedure luaL_setn(L : Plua_State; i, j : LongInt);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   641
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   642
const
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   643
    LUA_ERRFILE = LUA_ERRERR + 1;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   644
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   645
type
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   646
    luaL_Reg = packed record
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   647
    name : PChar;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   648
    func : lua_CFunction;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   649
    end;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   650
    PluaL_Reg = ^luaL_Reg;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   651
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   652
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   653
procedure luaL_openlib(L : Plua_State; const libname : PChar; const lr : PluaL_Reg; nup : LongInt);
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   654
    cdecl; external LuaLibName;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   655
procedure luaL_register(L : Plua_State; const libname : PChar; const lr : PluaL_Reg);
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   656
    cdecl; external LuaLibName;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   657
function luaL_getmetafield(L : Plua_State; obj : LongInt; const e : PChar) : LongInt;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   658
    cdecl; external LuaLibName;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   659
function luaL_callmeta(L : Plua_State; obj : LongInt; const e : PChar) : LongInt;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   660
    cdecl; external LuaLibName;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   661
function luaL_typerror(L : Plua_State; narg : LongInt; const tname : PChar) : LongInt;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   662
    cdecl; external LuaLibName;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   663
function luaL_argerror(L : Plua_State; numarg : LongInt; const extramsg : PChar) : LongInt;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   664
    cdecl; external LuaLibName;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   665
function luaL_checklstring(L : Plua_State; numArg : LongInt; ls : Psize_t) : PChar;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   666
    cdecl; external LuaLibName;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   667
function luaL_optlstring(L : Plua_State; numArg : LongInt; const def: PChar; ls: Psize_t) : PChar;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   668
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   669
function luaL_checknumber(L : Plua_State; numArg : LongInt) : lua_Number;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   670
    cdecl; external LuaLibName;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   671
function luaL_optnumber(L : Plua_State; nArg : LongInt; def : lua_Number) : lua_Number;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   672
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   673
5089
90266b67fff8 This better matches lua headers
nemo
parents: 5088
diff changeset
   674
function luaL_checkinteger(L : Plua_State; numArg : LongInt) : lua_Integer;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   675
    cdecl; external LuaLibName;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   676
function luaL_optinteger(L : Plua_State; nArg : LongInt; def : lua_Integer) : lua_Integer;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   677
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   678
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   679
procedure luaL_checkstack(L : Plua_State; sz : LongInt; const msg : PChar);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   680
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   681
procedure luaL_checktype(L : Plua_State; narg, t : LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   682
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   683
procedure luaL_checkany(L : Plua_State; narg : LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   684
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   685
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   686
function luaL_newmetatable(L : Plua_State; const tname : PChar) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   687
    cdecl; external LuaLibName;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   688
function luaL_checkudata(L : Plua_State; ud : LongInt; const tname : PChar) : Pointer;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   689
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   690
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   691
procedure luaL_where(L : Plua_State; lvl : LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   692
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   693
function  luaL_error(L : Plua_State; const fmt : PChar) : LongInt; varargs;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   694
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   695
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   696
function luaL_checkoption(L : Plua_State; narg : LongInt; const def : PChar; const lst : array of PChar) : LongInt;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   697
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   698
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   699
function  luaL_ref(L : Plua_State; t : LongInt) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   700
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   701
procedure luaL_unref(L : Plua_State; t, ref : LongInt);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   702
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   703
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   704
function luaL_loadfile(L : Plua_State; const filename : PChar) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   705
    cdecl; external LuaLibName;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   706
function luaL_loadbuffer(L : Plua_State; const buff : PChar; sz : size_t; const name: PChar) : LongInt;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   707
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   708
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   709
function luaL_loadstring(L : Plua_State; const s : Pchar) : LongInt;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   710
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   711
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   712
function luaL_newstate : Plua_State;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   713
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   714
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   715
function luaL_gsub(L : Plua_State; const s, p, r : PChar) : PChar;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   716
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   717
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   718
function luaL_findtable(L : Plua_State; idx : LongInt; const fname : PChar; szhint : LongInt) : PChar;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   719
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   720
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   721
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   722
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   723
** ===============================================================
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   724
** some useful macros
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   725
** ===============================================================
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   726
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   727
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   728
function luaL_argcheck(L : Plua_State; cond : Boolean; numarg : LongInt; extramsg : PChar): LongInt;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   729
function luaL_checkstring(L : Plua_State; n : LongInt) : PChar;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   730
function luaL_optstring(L : Plua_State; n : LongInt; d : PChar) : PChar;
5089
90266b67fff8 This better matches lua headers
nemo
parents: 5088
diff changeset
   731
function luaL_checkint(L : Plua_State; n : LongInt) : lua_Integer;
90266b67fff8 This better matches lua headers
nemo
parents: 5088
diff changeset
   732
function luaL_optint(L : Plua_State; n : LongInt; d : lua_Integer): lua_Integer;
90266b67fff8 This better matches lua headers
nemo
parents: 5088
diff changeset
   733
function luaL_checklong(L : Plua_State; n : LongInt) : lua_Integer;
90266b67fff8 This better matches lua headers
nemo
parents: 5088
diff changeset
   734
function luaL_optlong(L : Plua_State; n : LongInt; d : lua_Integer) : lua_Integer;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   735
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   736
function luaL_typename(L : Plua_State; idx : LongInt) : PChar;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   737
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   738
function luaL_dofile(L : Plua_State; fn : PChar) : LongInt;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   739
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   740
function luaL_dostring(L : Plua_State; s : PChar) : LongInt;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   741
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   742
procedure luaL_getmetatable(L : Plua_State; n : PChar);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   743
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   744
(* not implemented yet
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   745
#define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n)))
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   746
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   747
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   748
(*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   749
** {======================================================
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   750
** Generic Buffer manipulation
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   751
** =======================================================
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   752
*)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   753
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   754
type
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   755
    luaL_Buffer = packed record
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   756
    p : PChar;       (* current position in buffer *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   757
    lvl : LongInt;   (* number of strings in the stack (level) *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   758
    L : Plua_State;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   759
    buffer : array [0..LUAL_BUFFERSIZE-1] of Char;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   760
    end;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   761
    PluaL_Buffer = ^luaL_Buffer;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   762
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   763
procedure luaL_addchar(B : PluaL_Buffer; c : Char);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   764
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   765
(* compatibility only *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   766
procedure luaL_putchar(B : PluaL_Buffer; c : Char);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   767
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   768
procedure luaL_addsize(B : PluaL_Buffer; n : LongInt);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   769
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   770
procedure luaL_buffinit(L : Plua_State; B : PluaL_Buffer);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   771
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   772
function  luaL_prepbuffer(B : PluaL_Buffer) : PChar;
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   773
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   774
procedure luaL_addlstring(B : PluaL_Buffer; const s : PChar; ls : size_t);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   775
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   776
procedure luaL_addstring(B : PluaL_Buffer; const s : PChar);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   777
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   778
procedure luaL_addvalue(B : PluaL_Buffer);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   779
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   780
procedure luaL_pushresult(B : PluaL_Buffer);
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   781
    cdecl; external LuaLibName;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   782
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   783
(* ====================================================== *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   784
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   785
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   786
(* compatibility with ref system *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   787
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   788
(* pre-defined references *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   789
const
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   790
    LUA_NOREF  = -2;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   791
    LUA_REFNIL = -1;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   792
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   793
function lua_ref(L : Plua_State; lock : Boolean) : LongInt;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   794
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   795
procedure lua_unref(L : Plua_State; ref : LongInt);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   796
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   797
procedure lua_getref(L : Plua_State; ref : LongInt);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   798
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   799
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   800
(******************************************************************************)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   801
(******************************************************************************)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   802
(******************************************************************************)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   803
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   804
implementation
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   805
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   806
uses
5551
0897b947e7a0 use ansistring instead
nemo
parents: 5549
diff changeset
   807
  SysUtils;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   808
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   809
(*****************************************************************************)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   810
(*                            luaconfig.h                                    *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   811
(*****************************************************************************)
7151
ec15d9e1a7e3 pas2c stuff
unc0rr
parents: 7073
diff changeset
   812
{
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   813
function  lua_readline(L : Plua_State;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   814
var
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   815
    b : PChar; p : PChar): Boolean;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   816
var
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   817
    s : AnsiString;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   818
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   819
    Write(p);                        // show prompt
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   820
    ReadLn(s);                       // get line
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   821
    b := PChar(s);                   //   and return it
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   822
    lua_readline := (b[0] <> #4);          // test for ctrl-D
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   823
end;
7151
ec15d9e1a7e3 pas2c stuff
unc0rr
parents: 7073
diff changeset
   824
}
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   825
procedure lua_saveline(L : Plua_State; idx : LongInt);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   826
begin
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   827
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   828
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   829
procedure lua_freeline(L : Plua_State; b : PChar);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   830
begin
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   831
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   832
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   833
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   834
(*****************************************************************************)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   835
(*                                  lua.h                                    *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   836
(*****************************************************************************)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   837
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   838
function lua_upvalueindex(idx : LongInt) : LongInt;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   839
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   840
lua_upvalueindex := LUA_GLOBALSINDEX - idx;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   841
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   842
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   843
procedure lua_pop(L : Plua_State; n : LongInt);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   844
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   845
lua_settop(L, -n - 1);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   846
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   847
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   848
procedure lua_newtable(L : Plua_State);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   849
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   850
lua_createtable(L, 0, 0);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   851
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   852
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   853
procedure lua_register(L : Plua_State; n : PChar; f : lua_CFunction);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   854
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   855
lua_pushcfunction(L, f);
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   856
lua_setglobal(L, n);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   857
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   858
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   859
procedure lua_pushcfunction(L : Plua_State; f : lua_CFunction);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   860
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   861
    lua_pushcclosure(L, f, 0);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   862
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   863
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   864
function  lua_strlen(L : Plua_State; idx : LongInt) : LongInt;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   865
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   866
    lua_strlen := lua_objlen(L, idx);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   867
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   868
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   869
function lua_isfunction(L : Plua_State; n : LongInt) : Boolean;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   870
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   871
    lua_isfunction := lua_type(L, n) = LUA_TFUNCTION;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   872
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   873
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   874
function lua_istable(L : Plua_State; n : LongInt) : Boolean;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   875
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   876
    lua_istable := lua_type(L, n) = LUA_TTABLE;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   877
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   878
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   879
function lua_islightuserdata(L : Plua_State; n : LongInt) : Boolean;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   880
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   881
    lua_islightuserdata := lua_type(L, n) = LUA_TLIGHTUSERDATA;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   882
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   883
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   884
function lua_isnil(L : Plua_State; n : LongInt) : Boolean;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   885
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   886
    lua_isnil := lua_type(L, n) = LUA_TNIL;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   887
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   888
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   889
function lua_isboolean(L : Plua_State; n : LongInt) : Boolean;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   890
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   891
    lua_isboolean := lua_type(L, n) = LUA_TBOOLEAN;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   892
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   893
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   894
function lua_isthread(L : Plua_State; n : LongInt) : Boolean;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   895
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   896
    lua_isthread := lua_type(L, n) = LUA_TTHREAD;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   897
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   898
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   899
function lua_isnone(L : Plua_State; n : LongInt) : Boolean;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   900
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   901
    lua_isnone := lua_type(L, n) = LUA_TNONE;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   902
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   903
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   904
function lua_isnoneornil(L : Plua_State; n : LongInt) : Boolean;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   905
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   906
    lua_isnoneornil := lua_type(L, n) <= 0;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   907
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   908
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   909
procedure lua_pushliteral(L : Plua_State; s : PChar);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   910
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   911
    lua_pushlstring(L, s, StrLen(s));
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   912
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   913
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   914
procedure lua_setglobal(L : Plua_State; s : PChar);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   915
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   916
    lua_setfield(L, LUA_GLOBALSINDEX, s);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   917
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   918
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   919
procedure lua_getglobal(L: Plua_State; s: PChar);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   920
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   921
    lua_getfield(L, LUA_GLOBALSINDEX, s);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   922
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   923
5551
0897b947e7a0 use ansistring instead
nemo
parents: 5549
diff changeset
   924
function lua_tostring(L : Plua_State; idx : LongInt) : AnsiString;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   925
begin
6817
daaf0834c4d2 - Apply unit's namespace to current scope when referencing unit name
unc0rr
parents: 6580
diff changeset
   926
    lua_tostring := StrPas(lua_tolstring(L, idx, nil));
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   927
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   928
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   929
function lua_open : Plua_State;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   930
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   931
    lua_open := luaL_newstate;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   932
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   933
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   934
procedure lua_getregistry(L : Plua_State);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   935
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   936
    lua_pushvalue(L, LUA_REGISTRYINDEX);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   937
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   938
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   939
function lua_getgccount(L : Plua_State) : LongInt;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   940
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   941
    lua_getgccount := lua_gc(L, LUA_GCCOUNT, 0);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   942
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   943
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   944
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   945
(*****************************************************************************)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   946
(*                                  lualib.h                                 *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   947
(*****************************************************************************)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   948
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   949
procedure lua_assert(x : Boolean);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   950
begin
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   951
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   952
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   953
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   954
(*****************************************************************************)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   955
(*                                  lauxlib.h    n                           *)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   956
(*****************************************************************************)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   957
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   958
function luaL_getn(L : Plua_State; idx : LongInt) : LongInt;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   959
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   960
    luaL_getn := lua_objlen(L, idx);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   961
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   962
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   963
procedure luaL_setn(L : plua_State; i, j : LongInt);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   964
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   965
    (* no op *)
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   966
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   967
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   968
function luaL_argcheck(L : Plua_State; cond : Boolean; numarg : LongInt; extramsg : PChar): LongInt;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   969
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   970
    if not cond then
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   971
        luaL_argcheck := luaL_argerror(L, numarg, extramsg)
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   972
    else
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   973
        luaL_argcheck := 0;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   974
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   975
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   976
function luaL_checkstring(L : Plua_State; n : LongInt) : PChar;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   977
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   978
    luaL_checkstring := luaL_checklstring(L, n, nil);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   979
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   980
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   981
function luaL_optstring(L : Plua_State; n : LongInt; d : PChar) : PChar;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   982
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   983
    luaL_optstring := luaL_optlstring(L, n, d, nil);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   984
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   985
5089
90266b67fff8 This better matches lua headers
nemo
parents: 5088
diff changeset
   986
function luaL_checkint(L : Plua_State; n : LongInt) : lua_Integer;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   987
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   988
    luaL_checkint := luaL_checkinteger(L, n);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   989
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   990
5089
90266b67fff8 This better matches lua headers
nemo
parents: 5088
diff changeset
   991
function luaL_optint(L : Plua_State; n : LongInt; d : lua_Integer): lua_Integer;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   992
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   993
    luaL_optint := luaL_optinteger(L, n, d);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   994
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   995
5089
90266b67fff8 This better matches lua headers
nemo
parents: 5088
diff changeset
   996
function luaL_checklong(L : Plua_State; n : LongInt) : lua_Integer;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   997
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
   998
    luaL_checklong := luaL_checkinteger(L, n);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
   999
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1000
5089
90266b67fff8 This better matches lua headers
nemo
parents: 5088
diff changeset
  1001
function luaL_optlong(L : Plua_State; n : LongInt; d : lua_Integer) : lua_Integer;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1002
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1003
    luaL_optlong := luaL_optinteger(L, n, d);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1004
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1005
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1006
function luaL_typename(L : Plua_State; idx : LongInt) : PChar;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1007
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1008
    luaL_typename := lua_typename( L, lua_type(L, idx) );
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1009
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1010
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1011
function luaL_dofile(L : Plua_State; fn : PChar) : LongInt;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1012
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1013
    luaL_dofile := luaL_loadfile(L, fn);
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1014
    if luaL_dofile = 0 then
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1015
        luaL_dofile := lua_pcall(L, 0, 0, 0);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1016
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1017
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1018
function luaL_dostring(L : Plua_State; s : PChar) : LongInt;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1019
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1020
    luaL_dostring := luaL_loadstring(L, s);
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1021
    if luaL_dostring = 0 then
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1022
        luaL_dostring := lua_pcall(L, 0, 0, 0);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1023
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1024
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1025
procedure luaL_getmetatable(L : Plua_State; n : PChar);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1026
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1027
    lua_getfield(L, LUA_REGISTRYINDEX, n);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1028
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1029
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1030
procedure luaL_addchar(B : PluaL_Buffer; c : Char);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1031
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1032
    if not(B^.p < B^.buffer + LUAL_BUFFERSIZE) then
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1033
        luaL_prepbuffer(B);
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1034
    (B^.p^) := c;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1035
    Inc(B^.p);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1036
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1037
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1038
procedure luaL_putchar(B : PluaL_Buffer; c : Char);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1039
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1040
    luaL_addchar(B, c);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1041
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1042
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1043
procedure luaL_addsize(B : PluaL_Buffer; n : LongInt);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1044
begin
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1045
  Inc(B^.p, n);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1046
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1047
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1048
function lua_ref(L : Plua_State; lock : Boolean) : LongInt;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1049
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1050
    if lock then
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1051
        lua_ref := luaL_ref(L, LUA_REGISTRYINDEX)
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1052
    else
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1053
        begin
7151
ec15d9e1a7e3 pas2c stuff
unc0rr
parents: 7073
diff changeset
  1054
        lua_pushstring(L, _P'unlocked references are obsolete');
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1055
        lua_error(L);
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1056
        lua_ref := 0;
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1057
        end;
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1058
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1059
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1060
procedure lua_unref(L : Plua_State; ref : LongInt);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1061
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1062
    luaL_unref(L, LUA_REGISTRYINDEX, ref);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1063
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1064
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1065
procedure lua_getref(L : Plua_State; ref : LongInt);
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1066
begin
6580
6155187bf599 A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents: 6453
diff changeset
  1067
    lua_rawgeti(L, LUA_REGISTRYINDEX, ref);
3043
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1068
end;
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1069
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1070
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1071
(******************************************************************************
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1072
* Original copyright for the lua source and headers:
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1073
*  1994-2004 Tecgraf, PUC-Rio.
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1074
*  www.lua.org.
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1075
*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1076
*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1077
* Permission is hereby granted, free of charge, to any person obtaining
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1078
* a copy of this software and associated documentation files (the
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1079
* "Software"), to deal in the Software without restriction, including
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1080
* without limitation the rights to use, copy, modify, merge, publish,
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1081
* distribute, sublicense, and/or sell copies of the Software, and to
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1082
* permit persons to whom the Software is furnished to do so, subject to
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1083
* the following conditions:
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1084
*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1085
* The above copyright notice and this permission notice shall be
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1086
* included in all copies or substantial portions of the Software.
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1087
*
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1088
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1089
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1090
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1091
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1092
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1093
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1094
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1095
******************************************************************************)
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1096
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1097
end.
3acdb4dac6eb Just tidying up a bit. Comments, moving uMisc to end of frees in case ones above it need logging
nemo
parents: 2948
diff changeset
  1098
3407
dcc129c4352e Engine:
smxx
parents: 3043
diff changeset
  1099
{$HINTS ON}