X-Git-Url: http://git.kpe.io/?p=uffi.git;a=blobdiff_plain;f=examples%2Fgetenv.lisp;h=ff85777eaf29e2e81209d40db0647170abd91823;hp=a96fc2bf70f6e71af8623174da3478468e102efd;hb=b86fdf882156aa45dc6e8e93a158dedf506f4233;hpb=3ade95bab16abe09642554e9cbf56f117f01e507 diff --git a/examples/getenv.lisp b/examples/getenv.lisp index a96fc2b..ff85777 100644 --- a/examples/getenv.lisp +++ b/examples/getenv.lisp @@ -7,16 +7,14 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id$ -;;;; -;;;; This file, part of UFFI, is Copyright (c) 2002-2005 by Kevin M. Rosenberg +;;;; This file, part of UFFI, is Copyright (c) 2002-2010 by Kevin M. Rosenberg ;;;; ;;;; ************************************************************************* (in-package :cl-user) -(uffi:def-function ("getenv" c-getenv) +(uffi:def-function ("getenv" c-getenv) ((name :cstring)) :returning :cstring) @@ -25,11 +23,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_"))) @@ -38,7 +36,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") )