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

Luís Oliveira luismbo at gmail.com
Tue Jan 26 23:03:24 UTC 2010


On Tue, Jan 26, 2010 at 10:14 PM, Frank Goenninger <frgo at me.com> wrote:
> (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)

You can't define type translators for types defined with DEFCTYPE
anymore. Sections 6.3 and 6.4 of the manual should hopefully guide you
through DEFINE-FOREIGN-TYPE and TRANSLATE-FROM-FOREIGN.

-- 
Luís Oliveira
http://r42.eu/~luis/




More information about the cffi-devel mailing list