projects
/
uffi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* tests/foreign-loader.lisp: Commit patch from Luis Oliveira
[uffi.git]
/
examples
/
getenv.lisp
diff --git
a/examples/getenv.lisp
b/examples/getenv.lisp
index 72201e240b8ec710d2e3646af582e3eb4750023b..776413be9790a17c502cd1ab4911b2f63d38790e 100644
(file)
--- a/
examples/getenv.lisp
+++ b/
examples/getenv.lisp
@@
-9,17
+9,14
@@
;;;;
;;;; $Id$
;;;;
;;;;
;;;; $Id$
;;;;
-;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
+;;;; This file, part of UFFI, is Copyright (c) 2002
-2005
by Kevin M. Rosenberg
;;;;
;;;;
-;;;; UFFI users are granted the rights to distribute and use this software
-;;;; as governed by the terms of the Lisp Lesser GNU Public License
-;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
;;;; *************************************************************************
(in-package :cl-user)
;;;; *************************************************************************
(in-package :cl-user)
-(uffi:def-function ("getenv" c-getenv)
+(uffi:def-function ("getenv" c-getenv)
((name :cstring))
:returning :cstring)
((name :cstring))
:returning :cstring)
@@
-28,11
+25,11
@@
(check-type key string)
(uffi:with-cstring (key-native key)
(uffi:convert-from-cstring (c-getenv key-native))))
(check-type key string)
(uffi:with-cstring (key-native key)
(uffi:convert-from-cstring (c-getenv key-native))))
-
+
#+examples-uffi
(progn
(flet ((print-results (str)
#+examples-uffi
(progn
(flet ((print-results (str)
- (format t "~&(getenv ~S) => ~S" str (my-getenv str))))
+
(format t "~&(getenv ~S) => ~S" str (my-getenv str))))
(print-results "USER")
(print-results "_FOO_")))
(print-results "USER")
(print-results "_FOO_")))
@@
-41,7
+38,7
@@
(progn
(util.test:test (my-getenv "_FOO_") nil :fail-info "Error retrieving non-existent getenv")
(util.test:test (and (stringp (my-getenv "USER"))
(progn
(util.test:test (my-getenv "_FOO_") nil :fail-info "Error retrieving non-existent getenv")
(util.test:test (and (stringp (my-getenv "USER"))
- (< 0 (length (my-getenv "USER"))))
- t :fail-info "Error retrieving getenv")
+
(< 0 (length (my-getenv "USER"))))
+
t :fail-info "Error retrieving getenv")
)
)