Next: translate-underscore-separated-name, Previous: translate-name-from-foreign, Up: Functions [Contents][Index]
A symbol naming the Lisp function to be created.
A Lisp package
A generalized boolean.
The string representing the foreign function name.
translate-name-to-foreign
is used by defcfun to handle
the conversion of lisp names to foreign 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 some-xml-function ...) ⇒ "some_xml_function" CFFI> (defmethod translate-name-to-foreign ((spec symbol) (package (eql *package*)) &optional varp) (let ((name (translate-camelcase-name spec))) (if varp (subseq name 1 (1- (length name))) name))) ⇒ #<STANDARD-METHOD TRANSLATE-NAME-TO-FOREIGN (STRING (EQL #<Package "SOME-PACKAGE">))> CFFI> (defcfun some-xml-function ...) ⇒ "someXmlFunction"
defcfun
translate-camelcase-name
translate-name-from-foreign
translate-underscore-separated-name