Next: translate-name-to-foreign, Previous: translate-camelcase-name, Up: Functions [Contents][Index]
A string denoting a foreign function.
A Lisp package
A generalized boolean.
The Lisp symbol to be used a function name.
translate-name-from-foreign
is used by defcfun to handle
the conversion of foreign names to lisp names. By default, it
translates using translate-underscore-separated-name. However,
you can create specialized methods on this function to make
translating more closely match the foreign library’s naming
conventions.
Specialize package on some package. This allows other packages to load libraries with different naming conventions.
CFFI> (defcfun "someXmlFunction" ...) ⇒ SOMEXMLFUNCTION CFFI> (defmethod translate-name-from-foreign ((spec string) (package (eql *package*)) &optional varp) (let ((name (translate-camelcase-name spec))) (if varp (intern (format nil "*~a*" name)) name))) ⇒ #<STANDARD-METHOD TRANSLATE-NAME-FROM-FOREIGN (STRING (EQL #<Package "SOME-PACKAGE">))> CFFI> (defcfun "someXmlFunction" ...) ⇒ SOME-XML-FUNCTION
defcfun
translate-camelcase-name
translate-name-to-foreign
translate-underscore-separated-name