From: David Richards

Subject: Foreign Function Interface Question

Date: 2001-2-25 12:19

  I have a question having to do with the foreign Function Interface. I 
defined a 'C' function as follows:
char *tststring(char *s);

I compiled the code and made a shared library out of it (I'm on a Linux 
system).  Then in lisp I loaded it with:
(load "libtststring.so")

And then using the Foreign Function interface I created my lisp function 
for calling it as follows:

(ff:def-foreign-call (tst-string "tststring") ((s (* :char) string))
  :returning ((* :char) string))

Now the string that is returned to me by my function call is correct but 
the string that is being passed into my 'C' function is not. When I 
enter the 'C' function I am only seeing the first character of the 
string I am trying to pass to it ( I have confirmed this by having 
included some debugging code).  I tried to redefine my lisp function as 
follows but still with out success:

(ff:def-foreign-call (tst-string "tststring") ((s (* :char) 
with-native-string)) ;; doesn't work either!
  :returning ((* :char) string))

Can someone give me some insight as to what I am doing wrong?
Many thanks!
Dave Richards