1 (******************************************************************************
4 * Authors: TeCGraf (C headers + actual Lua libraries) *
5 * Lavergne Thomas (original translation to Pascal) *
6 * Bram Kuijvenhoven (update to Lua 5.1.1 for FreePascal) *
7 * Description: Standard Lua libraries *
9 ******************************************************************************)
12 ** $Id: lualib.h,v 1.28 2003/03/18 12:24:26 roberto Exp $
13 ** Lua standard libraries
14 ** See Copyright Notice in lua.h
17 ** Translated to pascal by Lavergne Thomas
19 ** - thomas.lavergne@laposte.net
20 ** In french or in english
23 {$IFDEF FPC}{$MODE OBJFPC}{$H+}{$ENDIF}
33 LUA_COLIBNAME
= 'coroutine';
34 LUA_TABLIBNAME
= 'table';
37 LUA_STRLIBNAME
= 'string';
38 LUA_MATHLIBNAME
= 'math';
39 LUA_DBLIBNAME
= 'debug';
40 LUA_LOADLIBNAME
= 'package';
42 function luaopen_base(L
: Plua_State
): Integer; cdecl;
43 function luaopen_table(L
: Plua_State
): Integer; cdecl;
44 function luaopen_io(L
: Plua_State
): Integer; cdecl;
45 function luaopen_os(L
: Plua_State
): Integer; cdecl;
46 function luaopen_string(L
: Plua_State
): Integer; cdecl;
47 function luaopen_math(L
: Plua_State
): Integer; cdecl;
48 function luaopen_debug(L
: Plua_State
): Integer; cdecl;
49 function luaopen_package(L
: Plua_State
): Integer; cdecl;
51 (* open all previous libraries *)
52 procedure luaL_openlibs(L
: Plua_State
); cdecl;
54 (* compatibility code *)
56 function lua_baselibopen(L
: Plua_State
): LongBool;
57 function lua_tablibopen(L
: Plua_State
): LongBool;
58 function lua_iolibopen(L
: Plua_State
): LongBool;
59 function lua_strlibopen(L
: Plua_State
): LongBool;
60 function lua_mathlibopen(L
: Plua_State
): LongBool;
61 function lua_dblibopen(L
: Plua_State
): LongBool;
65 function luaopen_base(L
: Plua_State
): Integer; cdecl; external LUA_LIB_NAME
;
66 function luaopen_table(L
: Plua_State
): Integer; cdecl; external LUA_LIB_NAME
;
67 function luaopen_io(L
: Plua_State
): Integer; cdecl; external LUA_LIB_NAME
;
68 function luaopen_os(L
: Plua_State
): Integer; cdecl; external LUA_LIB_NAME
;
69 function luaopen_string(L
: Plua_State
): Integer; cdecl; external LUA_LIB_NAME
;
70 function luaopen_math(L
: Plua_State
): Integer; cdecl; external LUA_LIB_NAME
;
71 function luaopen_debug(L
: Plua_State
): Integer; cdecl; external LUA_LIB_NAME
;
72 function luaopen_package(L
: Plua_State
): Integer; cdecl; external LUA_LIB_NAME
;
74 procedure luaL_openlibs(L
: Plua_State
); cdecl; external LUA_LIB_NAME
;
76 function lua_baselibopen(L
: Plua_State
): LongBool;
78 Result
:= LongBool(luaopen_base(L
));
81 function lua_tablibopen(L
: Plua_State
): LongBool;
83 Result
:= LongBool(luaopen_table(L
));
86 function lua_iolibopen(L
: Plua_State
): LongBool;
88 Result
:= LongBool(luaopen_io(L
));
91 function lua_strlibopen(L
: Plua_State
): LongBool;
93 Result
:= LongBool(luaopen_string(L
));
96 function lua_mathlibopen(L
: Plua_State
): LongBool;
98 Result
:= LongBool(luaopen_math(L
));
101 function lua_dblibopen(L
: Plua_State
): LongBool;
103 Result
:= LongBool(luaopen_debug(L
));