X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=examples%2Fgetenv.lisp;h=776413be9790a17c502cd1ab4911b2f63d38790e;hb=f5e6a5198989a460c4787041830d66fa76ebcdab;hp=17d2758be1fe504343b059da0a7c2f346f717f0c;hpb=a95b9a217335917d96b8c0cced4f49c3e4846115;p=uffi.git diff --git a/examples/getenv.lisp b/examples/getenv.lisp index 17d2758..776413b 100644 --- a/examples/getenv.lisp +++ b/examples/getenv.lisp @@ -7,19 +7,16 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: getenv.lisp,v 1.1 2002/09/30 10:02:36 kevin Exp $ +;;;; $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) -(uffi:def-function ("getenv" c-getenv) +(uffi:def-function ("getenv" c-getenv) ((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)))) - + #+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_"))) @@ -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")) - (< 0 (length (my-getenv "USER")))) - t :fail-info "Error retrieving getenv") + (< 0 (length (my-getenv "USER")))) + t :fail-info "Error retrieving getenv") )