mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: Sleep function to Lua
This commit is contained in:
parent
b3714b1b5f
commit
cd4b00c7a5
1 changed files with 7 additions and 0 deletions
|
|
@ -37,6 +37,12 @@ implementation
|
|||
uses
|
||||
Forms, Dialogs, LazUTF8, DCOSUtils, fMain, uFormCommands, uOSUtils, uGlobs;
|
||||
|
||||
function luaSleep(L : Plua_State) : Integer; cdecl;
|
||||
begin
|
||||
Result:= 0;
|
||||
Sleep(lua_tointeger(L, 1));
|
||||
end;
|
||||
|
||||
function luaFileGetAttr(L : Plua_State) : Integer; cdecl;
|
||||
begin
|
||||
Result:= 1;
|
||||
|
|
@ -90,6 +96,7 @@ end;
|
|||
procedure RegisterPackages(L: Plua_State);
|
||||
begin
|
||||
lua_newtable(L);
|
||||
luaP_register(L, 'Sleep', @luaSleep);
|
||||
luaP_register(L, 'FileExists', @luaFileExists);
|
||||
luaP_register(L, 'FileGetAttr', @luaFileGetAttr);
|
||||
luaP_register(L, 'DirectoryExists', @luaDirectoryExists);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue