From: D P Long
Subject: Franz Allegro Common Lisp 6.0: FFI
Date: 
Message-ID: <3B29DDA5.E64C27B4@dur.ac.uk>
I have been experimenting with ACL 6.0, attempting to link a foreign
library. Most of it is fine, but I am having real problems with the
passing of an array of strings to the library. Documentation appears to
imply that the automatic conversions apply to arrays of strings as well
as individual strings, but I have been unable to get it to behave for
me. The receiving end is seeing complete garbage (presumably there is a
pattern in it, but I have not been able to find it). I have tried
passing arrays of void * to switch off the string conversion, and then
using string-to-native conversions, but this is not doing it for me.

Has anyone else tried this and with any success or not?

Derek
From: Gavin E. Mendel-Gleason
Subject: Re: Franz Allegro Common Lisp 6.0: FFI
Date: 
Message-ID: <m3k82cdlvo.fsf@xerxes.carthage>
D P Long <········@durham.ac.uk> writes:

> I have been experimenting with ACL 6.0, attempting to link a foreign
> library. Most of it is fine, but I am having real problems with the
> passing of an array of strings to the library. Documentation appears to
> imply that the automatic conversions apply to arrays of strings as well
> as individual strings, but I have been unable to get it to behave for
> me. The receiving end is seeing complete garbage (presumably there is a
> pattern in it, but I have not been able to find it). I have tried
> passing arrays of void * to switch off the string conversion, and then
> using string-to-native conversions, but this is not doing it for me.
> 
> Has anyone else tried this and with any success or not?
> 
> Derek
> 

I did something along these lines a while ago, and the only solution that I 
found was to convert manually with native-to-string and string-to-native.


-- 
Gavin E. Mendel-Gleason 
(apply #'concatenate 'string
       (reverse `("com"
		  ,(make-string 1 :initial-element 
				(code-char (* 2 23)))
		  "mdli"
		  ,(make-string 1 :initial-element
				(code-char (expt 2 6)))
		  "ggleason")))