History

scripting (lua/js): utils.getpid: make wrapper of pid property

We now have at least 3 scripting APIs which are trivial wrappers around properties: mp.get_mouse_pos, utils.getcwd, utils.getpid. After some discussion on IRC it was decided that it's easier for us to maintain them as trivial wrappers than to deprecate them and inflict pain on users and script authors, so currently no plan to deprecate.

Avi Halachmi (:avih) committed 5 years ago

Commit 02fbdf81 parent f3b2ea94 files · +5 −16Browse files

Showing the changes to player/javascript.c (1 of 4 files). Show all

Unified · Split

player/javascript.c+0−8
@@ -40,7 +40,6 @@ · 39 unmodified lines
4040 #include "misc/bstr.h"
4141 #include "osdep/timer.h"
4242 #include "osdep/threads.h"
43−#include "osdep/getpid.h"
4443 #include "stream/stream.h"
4544 #include "sub/osd.h"
4645 #include "core.h"
@@ -925,12 +924,6 @@ static void script_get_user_path(js_State *J, void *af) · 878 unmodified lines
925924 js_pushstring(J, mp_get_user_path(af, jctx(J)->mpctx->global, path));
926925 }
927926
928−// args: none
929−static void script_getpid(js_State *J)
930−{
931− js_pushnumber(J, mp_getpid());
932−}
933−
934927 // args: prefixed file name, data (c-str)
935928 static void script_write_file(js_State *J, void *af)
936929 {
@@ -1183,7 +1176,6 @@ static const struct fn_entry utils_fns[] = { · 246 unmodified lines
11831176 FN_ENTRY(split_path, 1),
11841177 AF_ENTRY(join_path, 2),
11851178 AF_ENTRY(get_user_path, 1),
1186− FN_ENTRY(getpid, 0),
11871179 FN_ENTRY(get_env_list, 0),
11881180
11891181 FN_ENTRY(read_file, 2),

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t