<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/src/nvim/lua, branch v0.3.7</title>
<subtitle>Neovim fork with Rahm's personal hacks.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/'/>
<entry>
<title>add func_attr_printf in :</title>
<updated>2018-09-24T19:28:04+00:00</updated>
<author>
<name>MichaHoffmann</name>
<email>michoffmann.potsdam@gmail.com</email>
</author>
<published>2018-09-23T13:44:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=affef0aab81aa8b811f829c0fab0b9f1bf5ebbb3'/>
<id>affef0aab81aa8b811f829c0fab0b9f1bf5ebbb3</id>
<content type='text'>
log.c
message.c
strings.c

fixed some printf warnings in:

src/nvim/undo.c
src/nvim/eval.c
src/nvim/eval/encode.c
src/nvim/eval/typval.c
src/nvim/ex_getln.c
src/nvim/fileio.c
src/nvim/lua/executor.c
src/nvim/main.c
src/nvim/regexp_nfa.c
src/nvim/shada.c
src/nvim/spellfile.c
src/nvim/tui/terminfo.c
src/nvim/garray.h
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
log.c
message.c
strings.c

fixed some printf warnings in:

src/nvim/undo.c
src/nvim/eval.c
src/nvim/eval/encode.c
src/nvim/eval/typval.c
src/nvim/ex_getln.c
src/nvim/fileio.c
src/nvim/lua/executor.c
src/nvim/main.c
src/nvim/regexp_nfa.c
src/nvim/shada.c
src/nvim/spellfile.c
src/nvim/tui/terminfo.c
src/nvim/garray.h
</pre>
</div>
</content>
</entry>
<entry>
<title>API: Remove path prefix from command name in nvim_get_proc()</title>
<updated>2018-08-18T12:37:33+00:00</updated>
<author>
<name>Lucas Hoffmann</name>
<email>lucc@posteo.de</email>
</author>
<published>2018-08-18T12:37:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=4d10024a561a20cb2291f5615e4b01957dd955b9'/>
<id>4d10024a561a20cb2291f5615e4b01957dd955b9</id>
<content type='text'>
On macOS the output from `ps -o comm` might contain the full path of the
executable.  The `ucomm` would be the basename only but is less portable
(see previous commit).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On macOS the output from `ps -o comm` might contain the full path of the
executable.  The `ucomm` would be the basename only but is less portable
(see previous commit).
</pre>
</div>
</content>
</entry>
<entry>
<title>API: Use `ps -o comm` in nvim_get_proc()</title>
<updated>2018-08-15T10:39:10+00:00</updated>
<author>
<name>Lucas Hoffmann</name>
<email>l-m-h@web.de</email>
</author>
<published>2018-08-15T10:39:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=794e7b43599b4ecb3786de401725ba99087a501e'/>
<id>794e7b43599b4ecb3786de401725ba99087a501e</id>
<content type='text'>
- The POSIX version of ps(1) only specifies "comm" for the "-o" option
  but not "ucomm".  See
  http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ps.html
- On Linux (with the procps-ng package) "ucomm" is an alias for "comm".
  See https://gitlab.com/procps-ng/procps
- OpenBSD also has "ucomm" as an alias for "comm" (with the extra note
  "Name to be used for accounting."). See https://man.openbsd.org/ps
- FreeBSD describes "ucomm" as "Name to be used for accounting." but
  does not say that it should be an alias for "comm". See
  https://www.freebsd.org/cgi/man.cgi?query=ps
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- The POSIX version of ps(1) only specifies "comm" for the "-o" option
  but not "ucomm".  See
  http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ps.html
- On Linux (with the procps-ng package) "ucomm" is an alias for "comm".
  See https://gitlab.com/procps-ng/procps
- OpenBSD also has "ucomm" as an alias for "comm" (with the extra note
  "Name to be used for accounting."). See https://man.openbsd.org/ps
- FreeBSD describes "ucomm" as "Name to be used for accounting." but
  does not say that it should be an alias for "comm". See
  https://www.freebsd.org/cgi/man.cgi?query=ps
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge #8107 'jobs: separate process-group'</title>
<updated>2018-03-18T17:36:02+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2018-03-18T17:36:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=4e02f1ab871f30d80250537877924d522497493b'/>
<id>4e02f1ab871f30d80250537877924d522497493b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>build/MSVC: fix "C4003: not enough actual parameters for macro"</title>
<updated>2018-03-18T13:30:05+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2018-03-16T06:34:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=26b84a8b3e99d9dce2ad9f34e1663f119cd1c558'/>
<id>26b84a8b3e99d9dce2ad9f34e1663f119cd1c558</id>
<content type='text'>
For the case of TV_DICTITEM_STRUCT, we can't just pass `1` because:
https://github.com/neovim/neovim/pull/8142#discussion_r175262436
&gt; this variant will trigger array overrun warnings from various static analyzers.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For the case of TV_DICTITEM_STRUCT, we can't just pass `1` because:
https://github.com/neovim/neovim/pull/8142#discussion_r175262436
&gt; this variant will trigger array overrun warnings from various static analyzers.
</pre>
</div>
</content>
</entry>
<entry>
<title>API: nvim_get_proc()</title>
<updated>2018-03-17T23:11:45+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2018-03-16T04:13:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=a034d4b69d6032b3431c10b8a11c998551700fc2'/>
<id>a034d4b69d6032b3431c10b8a11c998551700fc2</id>
<content type='text'>
TODO: "exepath" field (win32: QueryFullProcessImageName())

On unix-likes `ps` is used because the platform-specific APIs are
a nightmare.  For reference, below is a (incomplete) attempt:

diff --git a/src/nvim/os/process.c b/src/nvim/os/process.c
index 09769925aca5..99afbbf290c1 100644
--- a/src/nvim/os/process.c
+++ b/src/nvim/os/process.c
@@ -208,3 +210,60 @@ int os_proc_children(int ppid, int **proc_list, size_t *proc_count)
   return 0;
 }

+/// Gets various properties of the process identified by `pid`.
+///
+/// @param pid Process to inspect.
+/// @return Map of process properties, empty on error.
+Dictionary os_proc_info(int pid)
+{
+  Dictionary pinfo = ARRAY_DICT_INIT;
+#ifdef WIN32
+
+#elif defined(__APPLE__)
+  char buf[PROC_PIDPATHINFO_MAXSIZE];
+  if (proc_pidpath(pid, buf, sizeof(buf))) {
+    name = getName(buf);
+    PUT(pinfo, "exepath", STRING_OBJ(cstr_to_string(buf)));
+    return name;
+  } else {
+    ILOG("proc_pidpath() failed for pid: %d", pid);
+  }
+#elif defined(BSD)
+# if defined(__FreeBSD__)
+#  define KP_COMM(o) o.ki_comm
+# else
+#  define KP_COMM(o) o.p_comm
+# endif
+  struct kinfo_proc *proc = kinfo_getproc(pid);
+  if (proc) {
+    PUT(pinfo, "name", cstr_to_string(KP_COMM(proc)));
+    xfree(proc);
+  } else {
+    ILOG("kinfo_getproc() failed for pid: %d", pid);
+  }
+
+#elif defined(__linux__)
+  char fname[256] = { 0 };
+  char buf[MAXPATHL];
+  snprintf(fname, sizeof(fname), "/proc/%d/comm", pid);
+  FILE *fp = fopen(fname, "r");
+  // FileDescriptor *f = file_open_new(&amp;error, fname, kFileReadOnly, 0);
+  // ptrdiff_t file_read(FileDescriptor *const fp, char *const ret_buf,
+  //                     const size_t size)
+  if (fp == NULL) {
+    ILOG("fopen() of /proc/%d/comm failed", pid);
+  } else {
+    size_t n = fread(buf, sizeof(char), sizeof(buf) - 1, fp);
+    if (n == 0) {
+      WLOG("fread() of /proc/%d/comm failed", pid);
+    } else {
+      size_t end = MIN(sizeof(buf) - 1, n);
+      end = (end &gt; 0 &amp;&amp; buf[end - 1] == '\n') ? end - 1 : end;
+      buf[end] = '\0';
+      PUT(pinfo, "name", STRING_OBJ(cstr_to_string(buf)));
+    }
+  }
+  fclose(fp);
+#endif
+  return pinfo;
+}
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
TODO: "exepath" field (win32: QueryFullProcessImageName())

On unix-likes `ps` is used because the platform-specific APIs are
a nightmare.  For reference, below is a (incomplete) attempt:

diff --git a/src/nvim/os/process.c b/src/nvim/os/process.c
index 09769925aca5..99afbbf290c1 100644
--- a/src/nvim/os/process.c
+++ b/src/nvim/os/process.c
@@ -208,3 +210,60 @@ int os_proc_children(int ppid, int **proc_list, size_t *proc_count)
   return 0;
 }

+/// Gets various properties of the process identified by `pid`.
+///
+/// @param pid Process to inspect.
+/// @return Map of process properties, empty on error.
+Dictionary os_proc_info(int pid)
+{
+  Dictionary pinfo = ARRAY_DICT_INIT;
+#ifdef WIN32
+
+#elif defined(__APPLE__)
+  char buf[PROC_PIDPATHINFO_MAXSIZE];
+  if (proc_pidpath(pid, buf, sizeof(buf))) {
+    name = getName(buf);
+    PUT(pinfo, "exepath", STRING_OBJ(cstr_to_string(buf)));
+    return name;
+  } else {
+    ILOG("proc_pidpath() failed for pid: %d", pid);
+  }
+#elif defined(BSD)
+# if defined(__FreeBSD__)
+#  define KP_COMM(o) o.ki_comm
+# else
+#  define KP_COMM(o) o.p_comm
+# endif
+  struct kinfo_proc *proc = kinfo_getproc(pid);
+  if (proc) {
+    PUT(pinfo, "name", cstr_to_string(KP_COMM(proc)));
+    xfree(proc);
+  } else {
+    ILOG("kinfo_getproc() failed for pid: %d", pid);
+  }
+
+#elif defined(__linux__)
+  char fname[256] = { 0 };
+  char buf[MAXPATHL];
+  snprintf(fname, sizeof(fname), "/proc/%d/comm", pid);
+  FILE *fp = fopen(fname, "r");
+  // FileDescriptor *f = file_open_new(&amp;error, fname, kFileReadOnly, 0);
+  // ptrdiff_t file_read(FileDescriptor *const fp, char *const ret_buf,
+  //                     const size_t size)
+  if (fp == NULL) {
+    ILOG("fopen() of /proc/%d/comm failed", pid);
+  } else {
+    size_t n = fread(buf, sizeof(char), sizeof(buf) - 1, fp);
+    if (n == 0) {
+      WLOG("fread() of /proc/%d/comm failed", pid);
+    } else {
+      size_t end = MIN(sizeof(buf) - 1, n);
+      end = (end &gt; 0 &amp;&amp; buf[end - 1] == '\n') ? end - 1 : end;
+      buf[end] = '\0';
+      PUT(pinfo, "name", STRING_OBJ(cstr_to_string(buf)));
+    }
+  }
+  fclose(fp);
+#endif
+  return pinfo;
+}
</pre>
</div>
</content>
</entry>
<entry>
<title>nvim_get_proc_children: fallback to shell</title>
<updated>2018-03-16T09:55:12+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2018-03-14T22:26:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=12af7016e23e7b7f507dc99a1b73e64d0bb5ccf3'/>
<id>12af7016e23e7b7f507dc99a1b73e64d0bb5ccf3</id>
<content type='text'>
/proc/…/children may be unavailable because of an unset kernel option.
Fallback to `pgrep` invoked in a shell.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
/proc/…/children may be unavailable because of an unset kernel option.
Fallback to `pgrep` invoked in a shell.
</pre>
</div>
</content>
</entry>
<entry>
<title>lua/executor: Remove all places where lightuserdata is used</title>
<updated>2018-01-20T22:47:46+00:00</updated>
<author>
<name>ZyX</name>
<email>kp-pav@yandex.ru</email>
</author>
<published>2018-01-20T22:47:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=db346b5b48c90d4f3aff7bbbb91f3d7c7e7f3fc5'/>
<id>db346b5b48c90d4f3aff7bbbb91f3d7c7e7f3fc5</id>
<content type='text'>
Should fix problems with luajit+arm64.

Fixes #7879
Ref LuaJIT/LuaJIT#230</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Should fix problems with luajit+arm64.

Fixes #7879
Ref LuaJIT/LuaJIT#230</pre>
</div>
</content>
</entry>
<entry>
<title>*: Provide list length when allocating lists</title>
<updated>2018-01-13T22:33:16+00:00</updated>
<author>
<name>ZyX</name>
<email>kp-pav@yandex.ru</email>
</author>
<published>2018-01-02T21:00:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=9ea1752d60589e8fc5e7184144bc6d1c1b9f16a3'/>
<id>9ea1752d60589e8fc5e7184144bc6d1c1b9f16a3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>eval,lua/converter: Fix problems spotted in review</title>
<updated>2017-12-30T22:00:13+00:00</updated>
<author>
<name>ZyX</name>
<email>kp-pav@yandex.ru</email>
</author>
<published>2017-12-30T21:50:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=c55cf5f4c181856d7ebb6697e8558d71279e7adb'/>
<id>c55cf5f4c181856d7ebb6697e8558d71279e7adb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
