1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
6 ;;;; Purpose: UFFI Example file use 2-dimensional arrays
7 ;;;; Programmer: Kevin M. Rosenberg
8 ;;;; Date Started: Mar 2002
10 ;;;; $Id: array-2d.cl,v 1.2 2002/03/18 22:47:57 kevin Exp $
12 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
14 ;;;; UFFI users are granted the rights to distribute and use this software
15 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
16 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
17 ;;;; *************************************************************************
21 (uffi:def-constant +column-length+ 10)
23 (defun test-array-2d ()
25 (let ((a (uffi:allocate-foreign-object :long +column-length+)))
26 (dotimes (i +column-length+)
27 (setf (uffi:deref-array a '(:array :long) i) (* i i)))
28 (dotimes (i +column-length+)
29 (format t "~&~D => ~D" i (uffi:deref-array a '(:array :long) i)))
30 (uffi:free-foreign-object a))