On 27/02/07, Heiko Schröter <[EMAIL PROTECTED]> wrote:
The docs state that there is no :array type.

Not yet, no.


If it is possible it would be nice to have one or two examples in the docs.

This should help: <http://article.gmane.org/gmane.lisp.cffi.devel/283/>

Also I've attached a patch that incorporates the code above into CFFI.
Largely untested and it's a patch against the cffi-newtypes branch
located at <http://common-lisp.net/~loliveira/darcs/cffi-newtypes/>

Not much documentation, sorry. Here's a silly example. Couldn't think
of a stdc function that returns an array (other than strings):

CFFI> (foreign-funcall "strdup" :string "hello" (:auto-array :char 5))
#(104 101 108 108 111)

;; couldn't miss the opportunity to use the mostly useless :wrapper type
CFFI> (foreign-funcall "strdup" :string "hello"
                      (:auto-array (:wrapper :char :from-c code-char) 5))
#(#\h #\e #\l #\l #\o)

--
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/

Attachment: foreign-aref.diff
Description: Binary data

_______________________________________________
cffi-devel mailing list
cffi-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel

Reply via email to