Skip to content

Commit

Permalink
LuaFAR: добавлена функция win.system.
Browse files Browse the repository at this point in the history
  • Loading branch information
shmuz committed Jan 28, 2015
1 parent 8940490 commit 0f2d892
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
27 changes: 26 additions & 1 deletion enc/enc_lua/luafar_manual.tsi
Expand Up @@ -86,7 +86,7 @@ lv=1
dt=Text
nm=Unicode support
ctime=3480525243
mtime=3568137943
mtime=3631634304
<article>
#_<markdown>
#_
Expand Down Expand Up @@ -133,6 +133,7 @@ mtime=3568137943
#_* [`win.SetFileAttr`](434.html)
#_* [`win.ShellExecute`](428.html)
#_* [`win.SHGetFolderPath`](440.html)
#_* [`win.system`](508.html)
#_
</article>
</node>
Expand Down Expand Up @@ -10436,6 +10437,30 @@ mtime=3602449058
</article>
</node>
<node>
id=508
lv=2
dt=Text
nm=win.system
ctime=3631633791
mtime=3631634238
<article>
#_result = win.system ([command])
#_
#_**Parameters:**
#_ command: string
#_
#_**Returns:**
#_ result: integer
#_
#_**Description:**
#_ Executes a command.
#_
#_**Windows API used:**
#_ _wsystem
#_
</article>
</node>
<node>
id=216
lv=2
dt=Text
Expand Down
6 changes: 5 additions & 1 deletion plugins/luamacro/changelog
@@ -1,4 +1,8 @@
shmuel 21.01.2015 23:59:12 +0200 - build 477
shmuel 28.01.2015 19:19:30 +0200 - build 478

1. LuaFAR: добавлена функция win.system.

shmuel 21.01.2015 23:59:12 +0200 - build 477

1. Рефакторинг.

Expand Down
8 changes: 8 additions & 0 deletions plugins/luamacro/luafar/ustring.c
Expand Up @@ -725,6 +725,13 @@ static int ustring_OutputDebugString(lua_State *L)
return 0;
}

static int ustring_system(lua_State *L)
{
const wchar_t *str = opt_utf8_string(L, 1, NULL);
lua_pushinteger(L, _wsystem(str));
return 1;
}

const luaL_Reg ustring_funcs[] =
{
{"EnumSystemCodePages", ustring_EnumSystemCodePages},
Expand All @@ -748,6 +755,7 @@ const luaL_Reg ustring_funcs[] =
{"Uuid", ustring_Uuid},
{"WideCharToMultiByte", ustring_WideCharToMultiByte},
{"subW", ustring_sub},
{"system", ustring_system},
{"lenW", ustring_len},

{NULL, NULL}
Expand Down
2 changes: 1 addition & 1 deletion plugins/luamacro/luamacro.rc
@@ -1,6 +1,6 @@
#include <farversion.hpp>

#define PLUGIN_BUILD 477
#define PLUGIN_BUILD 478
#define PLUGIN_DESC "Lua Macros for Far Manager"
#define PLUGIN_NAME "LuaMacro"
#define PLUGIN_FILENAME "luamacro.dll"
Expand Down

0 comments on commit 0f2d892

Please sign in to comment.