projects
/
uffi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r1539: *** empty log message ***
[uffi.git]
/
tests
/
strtol.cl
diff --git
a/tests/strtol.cl
b/tests/strtol.cl
index 850542223cd606a6659aeb943603c740a43d549d..518eb2909fa102b95ef93f48a3e7136199d98bd3 100644
(file)
--- a/
tests/strtol.cl
+++ b/
tests/strtol.cl
@@
-9,7
+9,7
@@
;;;;
;;;; Copyright (c) 2002 Kevin M. Rosenberg
;;;;
;;;;
;;;; 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.
6 2002/03/10 11:13:07
kevin Exp $
;;;;
;;;; This file is part of UFFI.
;;;;
;;;;
;;;; This file is part of UFFI.
;;;;
@@
-31,11
+31,11
@@
(uffi:def-type char-ptr (* :char))
(uffi:def-type char-ptr (* :char))
-;; This example does not use :c
-
string to pass the input string since
+;; This example does not use :cstring to pass the input string since
;; the routine needs to do pointer arithmetic to see how many characters
;; were parsed
;; 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))
((nptr (* :char))
(endptr (* char-ptr))
(base :int))
@@
-63,3
+63,13
@@
of first non-valid character"
(t
(values value chars-parsed)))))
(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")))
+