Subject: [clisp-list] FFI: array of strings?

From: Sam Steingold <[email-masked]>
Date: Tue Feb 17 10:25:06 2004

2 questions:

1. How do I interface to
   <http://www.mathworks.com/access/helpdesk/help/techdoc/apiref/engoutputbuffer.shtml>?
   In addition to the simple

(def-call-out engOutputBuffer (:arguments (ep Engine) (p c-pointer) (n int))
  (:return-type int))

   I will need to allocate and deallocate the buffer, right?
   So, is

(setq z (allocate-shallow '(c-array char 1000)))
(engOutputBuffer ep (c-var-address z) 1000)
...
(engOutputBuffer ep NIL 0)
(foreign-free z)

   the right thing?

2. How do I interface to
   <http://www.mathworks.com/access/helpdesk/help/techdoc/apiref/matgetdir.shtml>?
char **matGetDir(MATFile *mfp, int *num);
   What is the return value?
   Also, the documentation appears to indicate that what is actually
   returned is (char*[mxMAXNAM]), not (char**): why would they mention
   mxCalloc() otherwise?

PS.  Any other matlab victims^H^H^H^H^H^H^Husers out there?

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
Incorrect time syncronization.