X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=examples%2Fstrtol.cl;h=98131602bc57d65629c8d1e479011af10d08c905;hb=bd00c8ed506689d49306569634294446e0a017e5;hp=850542223cd606a6659aeb943603c740a43d549d;hpb=192193db6e4fbda90a840474d4aa2e8762597927;p=uffi.git diff --git a/examples/strtol.cl b/examples/strtol.cl index 8505422..9813160 100644 --- a/examples/strtol.cl +++ b/examples/strtol.cl @@ -9,7 +9,7 @@ ;;;; ;;;; Copyright (c) 2002 Kevin M. Rosenberg ;;;; -;;;; $Id: strtol.cl,v 1.1 2002/03/09 19:55:33 kevin Exp $ +;;;; $Id: strtol.cl,v 1.5 2002/03/10 05:09:00 kevin Exp $ ;;;; ;;;; This file is part of UFFI. ;;;; @@ -35,7 +35,7 @@ ;; the routine needs to do pointer arithmetic to see how many characters ;; were parsed -(uffi:def-routine ("strtol" c-strtol) +(uffi:def-function ("strtol" c-strtol) ((nptr (* :char)) (endptr (* char-ptr)) (base :int)) @@ -63,3 +63,13 @@ of first non-valid character" (t (values value chars-parsed))))) + +#+test-uffi +(progn + (flet ((print-results (str) + (multiple-value-bind (result flag) (strtol str) + (format t "~&(strtol ~S) => ~S,~S" str result flag)))) + (print-results "55") + (print-results "55.3") + (print-results "a"))) +