--- /dev/null
+;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
+;;;; *************************************************************************
+;;;; FILE IDENTIFICATION
+;;;;
+;;;; Name: atoifl.cl
+;;;; Purpose: UFFI Example file to atoi/atof/atol
+;;;; Programmer: Kevin M. Rosenberg
+;;;; Date Started: Mar 2002
+;;;;
+;;;; $Id: atoifl.cl,v 1.1 2002/03/25 01:24:35 kevin Exp $
+;;;;
+;;;; This file, part of UFFI, is Copyright (c) 2002 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 ("atoi" c-atoi)
+ ((str :cstring))
+ :returning :int)
+
+(defun atoi (str)
+ "Returns a int from a string."
+ (uffi:with-cstring (str-cstring str)
+ (c-atoi str-cstring)))
+
+#+test-uffi
+(progn
+ (flet ((print-results (str)
+ (format t "~&(atoi ~S) => ~S" str (atoi str))))
+ (print-results "55")))
+
+
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: test-examples.cl,v 1.7 2002/03/21 07:56:45 kevin Exp $
+;;;; $Id: test-examples.cl,v 1.8 2002/03/25 01:24:35 kevin Exp $
;;;;
;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
(load-test "arrays")
(load-test "union")
(load-test "strtol")
+ (load-test "atoifl")
(load-test "gettime")
(load-test "getenv")
(load-test "gethostname")
--- /dev/null
+;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
+;;;; *************************************************************************
+;;;; FILE IDENTIFICATION
+;;;;
+;;;; Name: atoifl.cl
+;;;; Purpose: UFFI Example file to atoi/atof/atol
+;;;; Programmer: Kevin M. Rosenberg
+;;;; Date Started: Mar 2002
+;;;;
+;;;; $Id: atoifl.cl,v 1.1 2002/03/25 01:24:35 kevin Exp $
+;;;;
+;;;; This file, part of UFFI, is Copyright (c) 2002 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 ("atoi" c-atoi)
+ ((str :cstring))
+ :returning :int)
+
+(defun atoi (str)
+ "Returns a int from a string."
+ (uffi:with-cstring (str-cstring str)
+ (c-atoi str-cstring)))
+
+#+test-uffi
+(progn
+ (flet ((print-results (str)
+ (format t "~&(atoi ~S) => ~S" str (atoi str))))
+ (print-results "55")))
+
+