lua头文件翻译之lauxlib
2008-04-09 04:21:58来源:互联网 阅读 ()
{
** $Id: lauxlib.h,v 1.60 2003/04/03 13:35:34 roberto Exp $
** Auxiliary functions for building Lua libraries
** See Copyright Notice in lua.h
}
{
this .h header file is translated by melice
}
unit lauxlib;
interface
uses lua;
type
luaL_reg = record
name: pchar;
func: lua_CFunction;
end;
procedure luaL_openlib(L: lua_State; libname: pchar; lr: luaL_reg;
nup: int); stdcall; external Luadll;
function luaL_getmetafield(L: lua_State; obj: int;
e: pchar): int; stdcall; external Luadll;
function luaL_callmeta(L: lua_State; obj: int;
e: pchar): int; stdcall; external Luadll;
function luaL_typerror(L: lua_State; narg: int;
tname: pchar): int; stdcall; external Luadll;
function luaL_argerror(L: lua_State; numarg: int;
extramsg: pchar): int; stdcall; external Luadll;
function luaL_checklstring(L: lua_State; numArg: int;
st: size_t): pchar; stdcall; external Luadll;
function luaL_optlstring(L: lua_State; numArg: int; def: pchar;
sz: size_t): pchar; stdcall; external Luadll;
function luaL_checknumber(L: lua_State;
numArg: int): lua_Number; stdcall; external Luadll;
function luaL_optnumber(L: lua_State; nArg: int;
def: lua_Number): lua_Number; stdcall; external Luadll;
procedure luaL_checkstack(L: lua_State; sz: int;
msg: pchar); stdcall; external Luadll;
procedure luaL_checktype(L: lua_State; narg: int;
t: int); stdcall; external Luadll;
procedure luaL_checkany(L: lua_State; narg: int); stdcall; external Luadll;
function luaL_newmetatable(L: lua_State;
tname: pchar): int; stdcall; external Luadll;
procedure luaL_getmetatable(L: lua_State;
tname: pchar); stdcall; external Luadll;
procedure luaL_checkudata(L: lua_State; ud: int;
tname: pchar); stdcall; external Luadll;
procedure luaL_where(L: lua_State; lvl: int); stdcall; external Luadll;
function luaL_error(L: lua_State; fmt: pchar): int; stdcall; external Luadll;
function luaL_findstring(st: pchar; lst: pchar): int; stdcall; external Luadll;
function luaL_ref(L: lua_State; t: int): int; stdcall; external Luadll;
procedure luaL_unref(L: lua_State; t: int; ref: int); stdcall; external Luadll;
function luaL_getn(L: lua_State; t: int): int; stdcall; external Luadll;
procedure luaL_setn(L: lua_State; t: int; n: int); stdcall; external Luadll;
function luaL_loadfile(L: lua_State;
filename: pchar): int; stdcall; external Luadll;
function luaL_loadbuffer(L: lua_State; buff: pchar; sz: size_t;
name: pchar): int; stdcall; external Luadll;
{
** ===============================================================
** some useful macros
** ===============================================================
}
{
#define luaL_argcheck(L, cond,numarg,extramsg) if (!(cond)) \
luaL_argerror(L, numarg,extramsg)
#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL))
#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL))
#define luaL_checkint(L,n) ((int)luaL_checknumber(L, n))
#define luaL_checklong(L,n) ((long)luaL_checknumber(L, n))
#define luaL_optint(L,n,d) ((int)luaL_optnumber(L, n,(lua_Number)(d)))
#define luaL_optlong(L,n,d) ((long)luaL_optnumber(L, n,(lua_Number)(d)))
}
{
** {======================================================
** Generic Buffer manipulation
** =======================================================
}
const
BUFSIZ = 60;
LUAL_BUFFERSIZE = BUFSIZ;
type
luaL_Buffer = record
p: pchar; { current position in buffer }
lvl: int; { number of strings in the stack (level) }
L: lua_State;
buffer: array[0..LUAL_BUFFERSIZE] of pchar;
end;
var
LualBuffer: luaL_Buffer;
{
#define luaL_putchar(B,c) \
((void)((B)->p < ((B)->buffer LUAL_BUFFERSIZE) || luaL_prepbuffer(B)), \
(*(B)->p = (pchar)(c)))
#define luaL_addsize(B,n) ((B)->p = (n))
}
procedure luaL_buffinit(L: lua_State; B: luaL_Buffer); stdcall; external Luadll;
function luaL_prepbuffer(B: luaL_Buffer): pchar; stdcall; external Luadll;
procedure luaL_addlstring(B: luaL_Buffer; s: pchar;
l: size_t); stdcall; external Luadll;
procedure luaL_addstring(B: luaL_Buffer; s: pchar); stdcall; external Luadll;
procedure luaL_addvalue(B: luaL_Buffer); stdcall; external Luadll;
procedure luaL_pushresult(B: luaL_Buffer); stdcall; external Luadll;
{ ====================================================== }
{
** Compatibility macros and functions
}
function lua_dofile(L: lua_State;
filename: pchar): int; stdcall; external Luadll;
function lua_dostring(L: lua_State; str: pchar): int; stdcall; external Luadll;
function lua_dobuffer(L: lua_State; buff: pchar; sz: size_t;
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
下一篇:用 Delphi 下载网页
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash