Karsten Hopp c138b8
To: vim-dev@vim.org
Karsten Hopp c138b8
Subject: Patch 7.1.262
Karsten Hopp c138b8
Fcc: outbox
Karsten Hopp c138b8
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp c138b8
Mime-Version: 1.0
Karsten Hopp c138b8
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp c138b8
Content-Transfer-Encoding: 8bit
Karsten Hopp c138b8
------------
Karsten Hopp c138b8
Karsten Hopp c138b8
Patch 7.1.262
Karsten Hopp c138b8
Problem:    Can't get the process ID of Vim.
Karsten Hopp c138b8
Solution:   Implement getpid().
Karsten Hopp c138b8
Files:	    src/eval.c, runtime/doc/eval.txt
Karsten Hopp c138b8
Karsten Hopp c138b8
Karsten Hopp c138b8
*** ../vim-7.1.261/src/eval.c	Wed Feb 20 12:22:59 2008
Karsten Hopp c138b8
--- src/eval.c	Wed Feb 20 11:08:21 2008
Karsten Hopp c138b8
***************
Karsten Hopp c138b8
*** 532,537 ****
Karsten Hopp c138b8
--- 532,538 ----
Karsten Hopp c138b8
  static void f_getftype __ARGS((typval_T *argvars, typval_T *rettv));
Karsten Hopp c138b8
  static void f_getline __ARGS((typval_T *argvars, typval_T *rettv));
Karsten Hopp c138b8
  static void f_getmatches __ARGS((typval_T *argvars, typval_T *rettv));
Karsten Hopp c138b8
+ static void f_getpid __ARGS((typval_T *argvars, typval_T *rettv));
Karsten Hopp c138b8
  static void f_getpos __ARGS((typval_T *argvars, typval_T *rettv));
Karsten Hopp c138b8
  static void f_getqflist __ARGS((typval_T *argvars, typval_T *rettv));
Karsten Hopp c138b8
  static void f_getreg __ARGS((typval_T *argvars, typval_T *rettv));
Karsten Hopp c138b8
***************
Karsten Hopp c138b8
*** 7132,7137 ****
Karsten Hopp c138b8
--- 7133,7139 ----
Karsten Hopp c138b8
      {"getline",		1, 2, f_getline},
Karsten Hopp c138b8
      {"getloclist",	1, 1, f_getqflist},
Karsten Hopp c138b8
      {"getmatches",	0, 0, f_getmatches},
Karsten Hopp c138b8
+     {"getpid",		0, 0, f_getpid},
Karsten Hopp c138b8
      {"getpos",		1, 1, f_getpos},
Karsten Hopp c138b8
      {"getqflist",	0, 0, f_getqflist},
Karsten Hopp c138b8
      {"getreg",		0, 2, f_getreg},
Karsten Hopp c138b8
***************
Karsten Hopp c138b8
*** 10371,10376 ****
Karsten Hopp c138b8
--- 10373,10390 ----
Karsten Hopp c138b8
  	}
Karsten Hopp c138b8
      }
Karsten Hopp c138b8
  #endif
Karsten Hopp c138b8
+ }
Karsten Hopp c138b8
+ 
Karsten Hopp c138b8
+ /*
Karsten Hopp c138b8
+  * "getpid()" function
Karsten Hopp c138b8
+  */
Karsten Hopp c138b8
+ /*ARGSUSED*/
Karsten Hopp c138b8
+     static void
Karsten Hopp c138b8
+ f_getpid(argvars, rettv)
Karsten Hopp c138b8
+     typval_T	*argvars;
Karsten Hopp c138b8
+     typval_T	*rettv;
Karsten Hopp c138b8
+ {
Karsten Hopp c138b8
+     rettv->vval.v_number = mch_get_pid();
Karsten Hopp c138b8
  }
Karsten Hopp c138b8
  
Karsten Hopp c138b8
  /*
Karsten Hopp c138b8
*** ../vim-7.1.261/runtime/doc/eval.txt	Wed Feb 13 12:41:30 2008
Karsten Hopp c138b8
--- runtime/doc/eval.txt	Wed Feb 20 11:10:17 2008
Karsten Hopp c138b8
***************
Karsten Hopp c138b8
*** 1,4 ****
Karsten Hopp c138b8
! *eval.txt*      For Vim version 7.1.  Last change: 2008 Feb 13
Karsten Hopp c138b8
  
Karsten Hopp c138b8
  
Karsten Hopp c138b8
  		  VIM REFERENCE MANUAL    by Bram Moolenaar
Karsten Hopp c138b8
--- 1,4 ----
Karsten Hopp c138b8
! *eval.txt*      For Vim version 7.1.  Last change: 2008 Feb 20
Karsten Hopp c138b8
  
Karsten Hopp c138b8
  
Karsten Hopp c138b8
  		  VIM REFERENCE MANUAL    by Bram Moolenaar
Karsten Hopp c138b8
***************
Karsten Hopp c138b8
*** 1638,1643 ****
Karsten Hopp c138b8
--- 1638,1644 ----
Karsten Hopp c138b8
  getline( {lnum}, {end})		List	lines {lnum} to {end} of current buffer
Karsten Hopp c138b8
  getloclist({nr})		List	list of location list items
Karsten Hopp c138b8
  getmatches()			List	list of current matches
Karsten Hopp c138b8
+ getpid()			Number	process ID of Vim
Karsten Hopp c138b8
  getpos( {expr})			List	position of cursor, mark, etc.
Karsten Hopp c138b8
  getqflist()			List	list of quickfix items
Karsten Hopp c138b8
  getreg( [{regname} [, 1]])	String	contents of register
Karsten Hopp c138b8
***************
Karsten Hopp c138b8
*** 3833,3838 ****
Karsten Hopp c138b8
--- 3837,3846 ----
Karsten Hopp c138b8
  		characters.  nr2char(0) is a real NUL and terminates the
Karsten Hopp c138b8
  		string, thus results in an empty string.
Karsten Hopp c138b8
  
Karsten Hopp c138b8
+ 							*getpid()*
Karsten Hopp c138b8
+ getpid()	Return a Number which is the process ID of the Vim process.
Karsten Hopp c138b8
+ 		On Unix this is a unique number.  On MS-DOS it's always zero.
Karsten Hopp c138b8
+ 
Karsten Hopp c138b8
  							*getpos()*
Karsten Hopp c138b8
  getpos({expr})	Get the position for {expr}.  For possible values of {expr}
Karsten Hopp c138b8
  		see |line()|.
Karsten Hopp c138b8
*** ../vim-7.1.261/src/version.c	Wed Feb 20 18:14:25 2008
Karsten Hopp c138b8
--- src/version.c	Wed Feb 20 20:04:14 2008
Karsten Hopp c138b8
***************
Karsten Hopp c138b8
*** 668,669 ****
Karsten Hopp c138b8
--- 668,671 ----
Karsten Hopp c138b8
  {   /* Add new patch number below this line */
Karsten Hopp c138b8
+ /**/
Karsten Hopp c138b8
+     262,
Karsten Hopp c138b8
  /**/
Karsten Hopp c138b8
Karsten Hopp c138b8
-- 
Karsten Hopp c138b8
Those who live by the sword get shot by those who don't.
Karsten Hopp c138b8
Karsten Hopp c138b8
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp c138b8
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp c138b8
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp c138b8
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///