转至繁体中文版     | 网站首页 | 图文教程 | 资源下载 | 站长博客 | 图片素材 | 武汉seo | 武汉网站优化 | 
最新公告:     敏韬网|教学资源学习资料永久免费分享站!  [mintao  2008年9月2日]        
您现在的位置: 学习笔记 >> 图文教程 >> 软件开发 >> Delphi程序 >> 正文
lua头文件的pas翻译_lua.h         ★★★★

lua头文件的pas翻译_lua.h

作者:闵涛 文章来源:闵涛的学习笔记 点击数:2022 更新时间:2009/4/23 18:27:20
eferences }
const
  LUA_NOREF = -2;
  LUA_REFNIL = -1;
  {
  #DEF ine lua_ref(L, lock)((lock)? luaL_ref(L, LUA_REGISTRYINDEX): \
    (lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0))

  #DEF ine lua_unref(L, ref)luaL_unref(L, LUA_REGISTRYINDEX, (ref))

  #DEF ine lua_getref(L, ref)lua_rawgeti(L, LUA_REGISTRYINDEX, ref)
  }
  {
  ** {======================================================================
  ** useful definitions for Lua kernel and libraries
  ** =======================================================================
  }

  { formats for Lua numbers }
const
  LUA_NUMBER_SCAN = ''''%lf'''';
  LUA_NUMBER_FMT = ''''%.14 g'''';

  { = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
  = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = }

  {
  ** {======================================================================
  ** Debug API
  ** =======================================================================
  }

  {
  ** Event codes
  }
  LUA_HOOKCALL = 0;
  LUA_HOOKRET = 1;
  LUA_HOOKLINE = 2;
  LUA_HOOKCOUNT = 3;
  LUA_HOOKTAILRET = 4;

  {
  ** Event masks
  }

  LUA_MASKCALL = (1 shl LUA_HOOKCALL);
  LUA_MASKRET = (1 shl LUA_HOOKRET);
  LUA_MASKLINE = (1 shl LUA_HOOKLINE);
  LUA_MASKCOUNT = (1 shl LUA_HOOKCOUNT);

  LUA_IDSIZE = 60;
type

  lua_Debug = record
    event: int;
    name: pchar; // (n)
    namewhat: pchar; // (n) `global'''', `local'''', `field'''', `method''''
    what: pchar; /// (S) `Lua'''', `C'''', `main'''', `tail''''
    source: pchar; // (S)
    currentline: int; // (l)
    nups: int; // (u) number of upvalues
    linedefined: int; // (S)
    short_src: array[0..LUA_IDSIZE] of char; // (S)
    // private part
    i_ci: int; // active function
  end;

  lua_Hook = procedure(L: lua_state; ar: lua_debug);

function lua_getstack(L: lua_State; level: int;
  ar: lua_Debug): int; stdcall; external Luadll;
function lua_getinfo(L: lua_State; what: pchar;
  ar: lua_Debug): int; stdcall; external Luadll;
function lua_getlocal(L: lua_State; ar: lua_Debug;
  n: int): pchar; stdcall; external Luadll;
function lua_setlocal(L: lua_State; ar: lua_Debug;
  n: int): pchar; stdcall; external Luadll;
function lua_getupvalue(L: lua_State; funcindex: int;
  n: int): pchar; stdcall; external Luadll;
function lua_setupvalue(L: lua_State; funcindex: int;
  n: int): pchar; stdcall; external Luadll;

function lua_sethook(L: lua_State; func: lua_Hook; mask: int;
  count: int): int; stdcall; external Luadll;
function lua_gethook(L: lua_State): lua_Hook; stdcall; external Luadll;
function lua_gethookmask(L: lua_State): int; stdcall; external Luadll;
function lua_gethookcount(L: lua_State): int; stdcall; external Luadll;

var
  luaState: lua_state;
  luaDebug: lua_Debug; { activation record }

implementation

procedure lua_getregistry(L: lua_state);
begin
  lua_pushvalue(L, LUA_REGISTRYINDEX);
end;

procedure lua_setglobal(L: lua_state; s: pchar);
begin
  lua_pushstring(L, s);
  lua_insert(L, -2);
  lua_settable(L, LUA_GLOBALSINDEX);
end;

procedure lua_getglobal(L: lua_state; s: pchar);
begin
  lua_pushstring(L, s);
  lua_gettable(L, LUA_GLOBALSINDEX);
end;

end.

{ ====================================================================== }

{*****************************************************************************
* Copyright (C) 1994-2004 Tecgraf, PUC-Rio.  All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*****************************************************************************}

上一页  [1] [2] 


[Delphi程序]转贴:Conversion to Delphi 6: Missing unit Pro…  [Delphi程序]AXScript.pas,从官方站点找到的IActivsScript接口
[Delphi程序]提高FastReplace速度 (fStrRep.pas)  
教程录入:mintao    责任编辑:mintao 
  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      注:本站部分文章源于互联网,版权归原作者所有!如有侵权,请原作者与本站联系,本站将立即删除! 本站文章除特别注明外均可转载,但需注明出处! [MinTao学以致用网]
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

    同类栏目
    · C语言系列  · VB.NET程序
    · JAVA开发  · Delphi程序
    · 脚本语言
    更多内容
    热门推荐 更多内容
  • 没有教程
  • 赞助链接
    更多内容
    闵涛博文 更多关于武汉SEO的内容
    500 - 内部服务器错误。

    500 - 内部服务器错误。

    您查找的资源存在问题,因而无法显示。

    | 设为首页 |加入收藏 | 联系站长 | 友情链接 | 版权申明 | 广告服务
    MinTao学以致用网

    Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved.
    闵涛 投放广告、内容合作请Q我! E_mail:admin@mintao.net(欢迎提供学习资源)

    站长:MinTao ICP备案号:鄂ICP备11006601号-18

    闵涛站盟:医药大全-武穴网A打造BCD……
    咸宁网络警察报警平台