分享
 
 
 

lua头文件翻译之lauxlib

王朝delphi·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

{

** $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;

n: pchar): int; stdcall; external Luadll;

{

const

luaL_check_lstr=luaL_checklstring;

luaL_opt_lstr=luaL_optlstring;

luaL_check_number=luaL_checknumber;

luaL_opt_number=luaL_optnumber;

luaL_arg_check=luaL_argcheck;

luaL_check_string=luaL_checkstring;

luaL_opt_string=luaL_optstring;

luaL_check_int=luaL_checkint;

luaL_check_long=luaL_checklong;

luaL_opt_int=luaL_optint;

luaL_opt_long=luaL_optlong;

}

implementation

end.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有