[cffi-devel] translate-from-foreign not being called ....

Frank Goenninger frgo at me.com
Tue Jan 26 22:14:00 UTC 2010


Hey all!

I can't seem to figure out why my translate-from-foreign method is not
getting called:

(defconstant +PIB-OK+ 0)

(defctype tPIBAMQPrc          :int)
(defctype tsPIBAMQPContextPtr :pointer)

(defmethod translate-from-foreign (value (type (eql 'tPIBAMQPrc)))
   (if (not (= value +PIB-OK+))
     (error "*** PIB AMQP error: ~d." value))
   value)

Having a foreign function like

(defcfun ("nPIBAMQPConnect" %mq-connect) tPIBAMQPrc
   (mq-context-ptr tsPIBAMQPContextPtr))

return values of > 0 does not trigger the above-mentioned method ... I
haven't looked into CFFI internals yet.

TIA !

Regards
   Frank




More information about the cffi-devel mailing list