FFI: ct::valid-callback-arg-type doesn't like :struct

John Pallister <[email protected]> Wed, 16 Apr 2003 21:31:49 +1200
Newsgroups gmane.lisp.corman
Message-ID <5.2.0.9.0.20030416201139.00acf758@goatboy>
Hi,

Is there any particular reason why ct::valid-callback-arg-type (called by 
defun-callback etc.) doesn't like pointers to (or arrays of) structures? I.e.:

   ?(ct::valid-callback-arg-type '((:struct mystruct :long) *))
   NIL

I'm forging ahead with a slightly modified version:

(defun valid-callback-arg-type (ctype)
   (setq ctype (ctypeexpand-all ctype))
   (if (member ctype simple-c-types)
       t
     (and (consp ctype)
          (consp (cdr ctype))
          ; 16 Apr 03 JDP A pointer to/array of anything is fine...
          ;(valid-callback-arg-type (first ctype))
          (or (integerp (second ctype))(eq (second ctype) '*)))))

If I can get the rest of my code to actually run, I'll know whether this 
has worked.

This is one of those things where you wonder, "am I really the first one to 
strike this problem? Or am I just on the wrong track altogether?" ;)

Cheers,

John :^P

--
John Pallister
[email protected] 


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/xaxhjB/hdqFAA/VygGAA/SyjtlB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[email protected]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/