CMUCL commit: src/code (unix-glibc2.lisp unix.lisp)

Raymond Toy rtoy at common-lisp.net
Thu Oct 15 16:07:36 CEST 2009


    Date: Thursday, October 15, 2009 @ 10:07:36
  Author: rtoy
    Path: /project/cmucl/cvsroot/src/code

Modified: unix-glibc2.lisp unix.lisp

Add docstrings for the new alien functions getenv, setenv, putenv, and
unsetenv. 


------------------+
 unix-glibc2.lisp |   28 +++++++++++++++++++---------
 unix.lisp        |   31 ++++++++++++++++++++++---------
 2 files changed, 41 insertions(+), 18 deletions(-)


Index: src/code/unix-glibc2.lisp
diff -u src/code/unix-glibc2.lisp:1.48 src/code/unix-glibc2.lisp:1.49
--- src/code/unix-glibc2.lisp:1.48	Tue Oct 13 23:42:21 2009
+++ src/code/unix-glibc2.lisp	Thu Oct 15 10:07:35 2009
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /project/cmucl/cvsroot/src/code/unix-glibc2.lisp,v 1.48 2009-10-14 03:42:21 agoncharov Exp $")
+  "$Header: /project/cmucl/cvsroot/src/code/unix-glibc2.lisp,v 1.49 2009-10-15 14:07:35 rtoy Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -2184,19 +2184,29 @@
   (int-syscall ("fork")))
 
 ;; Environment maninpulation; man getenv(3)
-(alien:def-alien-routine ("getenv" unix-getenv) c-call:c-string
-  (name c-call:c-string))
+(def-alien-routine ("getenv" unix-getenv) c-call:c-string
+  (name c-call:c-string) 
+  "Get the value of the environment variable named Name.  If no such
+  variable exists, Nil is returned.")
 
-(alien:def-alien-routine ("setenv" unix-setenv) c-call:int
+(def-alien-routine ("setenv" unix-setenv) c-call:int
   (name c-call:c-string)
   (value c-call:c-string)
-  (overwrite c-call:int))
+  (overwrite c-call:int)
+  "Adds the environment variable named Name to the environment with
+  the given Value if Name does not already exist. If Name does exist,
+  the value is changed to Value if Overwrite is non-zero.  Otherwise,
+  the value is not changed.")
 
-(alien:def-alien-routine ("putenv" unix-putenv) c-call:int
-			 (name c-call:c-string))
+(def-alien-routine ("putenv" unix-putenv) c-call:int
+  (name c-call:c-string)
+  "Adds or changes the environment.  Name-value must be a string of
+  the form \"name=value\".  If the name does not exist, it is added.
+  If name does exist, the value is updated to the given value.")
 
-(alien:def-alien-routine ("unsetenv" unix-unsetenv) c-call:int
-			 (name c-call:c-string))
+(def-alien-routine ("unsetenv" unix-unsetenv) c-call:int
+  (name c-call:c-string)
+  "Removes the variable Name from the environment")
 
 (def-alien-routine ("ttyname" unix-ttyname) c-string
   (fd int))
Index: src/code/unix.lisp
diff -u src/code/unix.lisp:1.123 src/code/unix.lisp:1.124
--- src/code/unix.lisp:1.123	Tue Oct 13 23:42:21 2009
+++ src/code/unix.lisp	Thu Oct 15 10:07:35 2009
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /project/cmucl/cvsroot/src/code/unix.lisp,v 1.123 2009-10-14 03:42:21 agoncharov Exp $")
+  "$Header: /project/cmucl/cvsroot/src/code/unix.lisp,v 1.124 2009-10-15 14:07:35 rtoy Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -2451,19 +2451,32 @@
   (int-syscall ("fork")))
 
 ;; Environment maninpulation; man getenv(3)
-(alien:def-alien-routine ("getenv" unix-getenv) c-call:c-string
-  (name c-call:c-string))
+(def-alien-routine ("getenv" unix-getenv) c-call:c-string
+  (name c-call:c-string) 
+  "Get the value of the environment variable named Name.  If no such
+  variable exists, Nil is returned.")
 
-(alien:def-alien-routine ("setenv" unix-setenv) c-call:int
+;; This doesn't exist in Solaris 8 but does exist in Solaris 10.
+(def-alien-routine ("setenv" unix-setenv) c-call:int
   (name c-call:c-string)
   (value c-call:c-string)
-  (overwrite c-call:int))
+  (overwrite c-call:int)
+  "Adds the environment variable named Name to the environment with
+  the given Value if Name does not already exist. If Name does exist,
+  the value is changed to Value if Overwrite is non-zero.  Otherwise,
+  the value is not changed.")
 
-(alien:def-alien-routine ("putenv" unix-putenv) c-call:int
-			 (name c-call:c-string))
 
-(alien:def-alien-routine ("unsetenv" unix-unsetenv) c-call:int
-			 (name c-call:c-string))
+(def-alien-routine ("putenv" unix-putenv) c-call:int
+  (name-value c-call:c-string)
+  "Adds or changes the environment.  Name-value must be a string of
+  the form \"name=value\".  If the name does not exist, it is added.
+  If name does exist, the value is updated to the given value.")
+
+;; This doesn't exist in Solaris 8 but does exist in Solaris 10.
+(def-alien-routine ("unsetenv" unix-unsetenv) c-call:int
+  (name c-call:c-string)
+  "Removes the variable Name from the environment")
 
 
 ;;; Operations on Unix Directories.



More information about the cmucl-commit mailing list