4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Can't get the process ID of Vim.
12 Solution: Implement getpid().
13 Files: src/eval.c, runtime/doc/eval.txt
16 *** ../vim-7.1.261/src/eval.c Wed Feb 20 12:22:59 2008
17 --- src/eval.c Wed Feb 20 11:08:21 2008
21 static void f_getftype __ARGS((typval_T *argvars, typval_T *rettv));
22 static void f_getline __ARGS((typval_T *argvars, typval_T *rettv));
23 static void f_getmatches __ARGS((typval_T *argvars, typval_T *rettv));
24 + static void f_getpid __ARGS((typval_T *argvars, typval_T *rettv));
25 static void f_getpos __ARGS((typval_T *argvars, typval_T *rettv));
26 static void f_getqflist __ARGS((typval_T *argvars, typval_T *rettv));
27 static void f_getreg __ARGS((typval_T *argvars, typval_T *rettv));
31 {"getline", 1, 2, f_getline},
32 {"getloclist", 1, 1, f_getqflist},
33 {"getmatches", 0, 0, f_getmatches},
34 + {"getpid", 0, 0, f_getpid},
35 {"getpos", 1, 1, f_getpos},
36 {"getqflist", 0, 0, f_getqflist},
37 {"getreg", 0, 2, f_getreg},
47 + * "getpid()" function
51 + f_getpid(argvars, rettv)
55 + rettv->vval.v_number = mch_get_pid();
59 *** ../vim-7.1.261/runtime/doc/eval.txt Wed Feb 13 12:41:30 2008
60 --- runtime/doc/eval.txt Wed Feb 20 11:10:17 2008
63 ! *eval.txt* For Vim version 7.1. Last change: 2008 Feb 13
66 VIM REFERENCE MANUAL by Bram Moolenaar
68 ! *eval.txt* For Vim version 7.1. Last change: 2008 Feb 20
71 VIM REFERENCE MANUAL by Bram Moolenaar
75 getline( {lnum}, {end}) List lines {lnum} to {end} of current buffer
76 getloclist({nr}) List list of location list items
77 getmatches() List list of current matches
78 + getpid() Number process ID of Vim
79 getpos( {expr}) List position of cursor, mark, etc.
80 getqflist() List list of quickfix items
81 getreg( [{regname} [, 1]]) String contents of register
85 characters. nr2char(0) is a real NUL and terminates the
86 string, thus results in an empty string.
89 + getpid() Return a Number which is the process ID of the Vim process.
90 + On Unix this is a unique number. On MS-DOS it's always zero.
93 getpos({expr}) Get the position for {expr}. For possible values of {expr}
95 *** ../vim-7.1.261/src/version.c Wed Feb 20 18:14:25 2008
96 --- src/version.c Wed Feb 20 20:04:14 2008
100 { /* Add new patch number below this line */
106 Those who live by the sword get shot by those who don't.
108 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
109 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
110 \\\ download, build and distribute -- http://www.A-A-P.org ///
111 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///