lua头文件翻译之lauxlib

2016-02-19 18:51 60 1 收藏

今天图老师小编要跟大家分享lua头文件翻译之lauxlib,精心挑选的过程简单易学,喜欢的朋友一起来学习吧!

【 tulaoshi.com - 编程语言 】

 

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

(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/bianchengyuyan/)

  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;

(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/bianchengyuyan/)

  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.
  

来源:http://www.tulaoshi.com/n/20160219/1619209.html

延伸阅读
《寂静岭:暴雨》文件翻译-痴肥男派翠克奈皮尔判决剪报(这篇对剧情很有帮助) 陪审团裁定派翠克奈皮尔一级罪名成立 只花了4小时的审议,今天下午陪审团就在法院大楼就做出派翠克奈皮尔 有罪的判决。奈皮尔42 岁,曾被判过猥亵儿童而且是登记有案的性侵犯者, 被控诱拐. 性侵及谋杀一位8 岁的当地男童丹尼尔˙史戴芬。男童父母曾在 去年一月...
标签: 电脑入门
人在职场,大家都知道办什么事要先请示,领导逐级审批,可套红头时总是跟事先准备好的纸张文字对不上,索性我们就自己做一个,跟自己打印机、纸张相符的红头件。 一、先把隐藏文字不打印设置好。套打隐藏文字。 参考如何设置文档、文字、图片不打印 二、插入文本框 1、设置文本框属性,颜色--无填充色,线条---无线条颜色。 2、版式,...
  C++ Builder是最快的C++编译器之一,从编译速度来说也可以说是最快的win32C++编译器了。除了速度之外,C++builder的性能也在其它C++编译器的之上,但许多Delphi程序员仍受不了C++builder工程的编译速度。的确,delphi的速度要比任和c++的编译器都要快好多。Delphi在编译一个小工程的时候可能不到一秒,大的工程一般也在5秒钟...
标签: 电脑入门
在职场,大家都知道办什么事要先请示,领导逐级审批,可套红头时总是跟事先准备好的纸张文字对不上,索性我们就自己做一个,跟自己打印机、纸张相符的红头件。 一、先把隐藏文字不打印设置好。套打隐藏文字。 二、插入文本框 1、设置文本框属性,颜色--无填充色,线条---无线条颜色。 2、版式,环绕方式---衬于文字下方,水平对齐方式--...
  [原文] That is correct. A BPL is a DLL. (But not all DLLs are BPLs.) But I still found some different, such as that I can create a object from the Host exe and that pass to a BPL and modify it safely, but if I do same to a dll, I can not modify any referenced property of the...

经验教程

284

收藏

23
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部