File src/lua/vlua.c changed (mode: 100644) (index f6fc0a9dc..53b3100f2) |
... |
... |
static int VLUA_API(opts_global_index)(lua_State *lua); |
64 |
64 |
static int VLUA_API(opts_global_newindex)(lua_State *lua); |
static int VLUA_API(opts_global_newindex)(lua_State *lua); |
65 |
65 |
static int VLUA_API(vifm_errordialog)(lua_State *lua); |
static int VLUA_API(vifm_errordialog)(lua_State *lua); |
66 |
66 |
static int VLUA_API(vifm_fnamemodify)(lua_State *lua); |
static int VLUA_API(vifm_fnamemodify)(lua_State *lua); |
|
67 |
|
static int VLUA_API(vifm_escape)(lua_State *lua); |
67 |
68 |
static int VLUA_API(vifm_exists)(lua_State *lua); |
static int VLUA_API(vifm_exists)(lua_State *lua); |
68 |
69 |
static int VLUA_API(vifm_makepath)(lua_State *lua); |
static int VLUA_API(vifm_makepath)(lua_State *lua); |
69 |
70 |
static int VLUA_API(vifm_expand)(lua_State *lua); |
static int VLUA_API(vifm_expand)(lua_State *lua); |
|
... |
... |
VLUA_DECLARE_SAFE(opts_global_index); |
83 |
84 |
VLUA_DECLARE_UNSAFE(opts_global_newindex); |
VLUA_DECLARE_UNSAFE(opts_global_newindex); |
84 |
85 |
VLUA_DECLARE_SAFE(vifm_errordialog); |
VLUA_DECLARE_SAFE(vifm_errordialog); |
85 |
86 |
VLUA_DECLARE_SAFE(vifm_fnamemodify); |
VLUA_DECLARE_SAFE(vifm_fnamemodify); |
|
87 |
|
VLUA_DECLARE_SAFE(vifm_escape); |
86 |
88 |
VLUA_DECLARE_SAFE(vifm_exists); |
VLUA_DECLARE_SAFE(vifm_exists); |
87 |
89 |
VLUA_DECLARE_SAFE(vifm_makepath); |
VLUA_DECLARE_SAFE(vifm_makepath); |
88 |
90 |
VLUA_DECLARE_SAFE(vifm_expand); |
VLUA_DECLARE_SAFE(vifm_expand); |
|
... |
... |
VLUA_DECLARE_SAFE(vifm_addhandler); |
103 |
105 |
static const struct luaL_Reg vifm_methods[] = { |
static const struct luaL_Reg vifm_methods[] = { |
104 |
106 |
{ "errordialog", VLUA_REF(vifm_errordialog) }, |
{ "errordialog", VLUA_REF(vifm_errordialog) }, |
105 |
107 |
{ "fnamemodify", VLUA_REF(vifm_fnamemodify) }, |
{ "fnamemodify", VLUA_REF(vifm_fnamemodify) }, |
|
108 |
|
{ "escape", VLUA_REF(vifm_escape) }, |
106 |
109 |
{ "exists", VLUA_REF(vifm_exists) }, |
{ "exists", VLUA_REF(vifm_exists) }, |
107 |
110 |
{ "makepath", VLUA_REF(vifm_makepath) }, |
{ "makepath", VLUA_REF(vifm_makepath) }, |
108 |
111 |
{ "startjob", VLUA_REF(vifmjob_new) }, |
{ "startjob", VLUA_REF(vifmjob_new) }, |
|
... |
... |
VLUA_API(vifm_fnamemodify)(lua_State *lua) |
358 |
361 |
return 1; |
return 1; |
359 |
362 |
} |
} |
360 |
363 |
|
|
|
364 |
|
/* Member of `vifm` that escapes its input string. Returns escaped string. */ |
|
365 |
|
static int |
|
366 |
|
VLUA_API(vifm_escape)(lua_State *lua) |
|
367 |
|
{ |
|
368 |
|
const char *what = luaL_checkstring(lua, 1); |
|
369 |
|
lua_pushstring(lua, enclose_in_dquotes(what)); |
|
370 |
|
return 1; |
|
371 |
|
} |
|
372 |
|
|
361 |
373 |
/* Member of `vifm` that checks whether specified path exists without resolving |
/* Member of `vifm` that checks whether specified path exists without resolving |
362 |
374 |
* symbolic links. Returns a boolean, which is true when path does exist. */ |
* symbolic links. Returns a boolean, which is true when path does exist. */ |
363 |
375 |
static int |
static int |