- Jan 18, 2013
-
-
CrLF0710 authored
-
- May 01, 2012
-
-
Luís Oliveira authored
* Instead of a special variable, the parsed struct type instance is now annotated to let the type system know whether we're dealing with deprecated semantics (struct type canonicalizes to :pointer) or not. This approach should hopefully be much less error-prone. * Disabled translations for bare structs. * Fixed and commented out some bogus tests.
-
- Apr 14, 2012
-
-
Luís Oliveira authored
-
- Mar 25, 2012
-
-
Liam M. Healy authored
New function expand-to-foreign-dyn-indirect split out from expand-to-foreign-dyn, and the latter function returned to its definition as given in the tip of master, ab10be4f. This function is used if the optional argument 'indirect to translate-objects is T, which in turn the case when functions are calling or return structures by value.
-
- Feb 05, 2012
-
-
Liam M. Healy authored
-
- Nov 24, 2011
-
-
Liam M. Healy authored
Argument 'indirect to #'expand-to-foreign-dyn is key instead of optional, so that other systems that define a method can just have &key, and they do not have to add this argument if they don't need to use it.
-
Liam M. Healy authored
In parse-args-and-types, foreign-funcall-form, foreign-funcall-varargs-form, bind (*parse-bare-structs-as-pointers* t) when parsing function definitions so that if a bare structure is specified, the expanded form with have :pointer or (:pointer (:struct foo)) and therefore the type will be correctly recognized.
-
- Nov 13, 2011
-
-
Liam M. Healy authored
The generic function translate-into-foreign-memory has been slightly repurposed and expanded to provide indirection of enums and pointers. The function translate-objects and generic function expand-to-foreign-dyn have a new argument, 'indirect, that when set, expand to with-foreign-object and translate-into-foreign-memory instead of translate-to-foreign, unwind-protect, and free-translated-object. This insures that all arguments to functions passed to libffi are indirected one level, as is required.
-
- Oct 22, 2011
-
-
Liam M. Healy authored
Tests fsbv.1 and fsbv.2 added that test foreign structure call and return by value. This includes the C file and addition to makefile to generate the appropriate library, libfsbv. So that the tests are properly defined, load cffi-fsbv and then cffi-tests. Both tests should pass. The test returning a structure, fsbv.2, exposed an error in the form generated by ffcall-body-libffi; because it always generated a mem-aref on the return value, the subsequent translate-from-foreign was effectively making a double translation. Thus, this form generation has been conditionalized so that if translate-from-foreign will not be applied (e.g., built-in-type) to call mem-aref, otherwise just return the pointer.
-
- Oct 05, 2011
-
-
Luís Oliveira authored
Simplifies DEFCFUN, but due to the ACL-specific DEFCFUN-HELPER-FORMS hack, this complicates %DEFCFUN a little bit.
-
- Sep 27, 2011
-
-
Liam M. Healy authored
Foreign functions defined through defcfun can have structures by value arguments and/or return.
-
- Sep 26, 2011
-
-
Liam M. Healy authored
Removed duplicate translations to and from foreign, and changed function bound to *foreign-structures-by-value* to only return the body, not the entire lambda. Changed the call in foreign-funcall-form to not apply to args, as there is already an applied lambda and cleanup. Funcation is now called ffcall-body-libffi, was callable-function.
-
Liam M. Healy authored
Structures by value should work with foreign-funcall-pointer, untested.
-
- Sep 22, 2011
-
-
Liam M. Healy authored
Make the callable function incorrectly in fsbv, try on complex-double example now in fsbv.
-
- Sep 19, 2011
-
-
Liam M. Healy authored
-
- Sep 18, 2011
-
-
Luís Oliveira authored
-
Liam M. Healy authored
Check in foreign-funcall-form if arguments or return are foreign structures by value, if they are, expand with *foreign-structures-by-value* which will eventually call prepare-function in CFFI-FSBV.
-
- Sep 17, 2011
-
-
Luís Oliveira authored
:STRUCT and :UNION types live one their own namespaces (as in C) and this supported by FIND-TYPE-PARSER itself. (Although one has to manually implement parse methods for each namespace, as we did for :STRUCT and :UNION.) Bare FOO references are parsed to (:STRUCT foo) or (:POINTER (:STRUCT foo)) depending on context and signal a style warning about their deprecation. Note that CANONICALIZE now returns a list like (:STRUCT/:UNION foo) for struct/union types instead of always returning a keyword denoting a built-in type. Unions now have their own FOREIGN-UNION-TYPE, a subclass of FOREIGN-STRUCT-TYPE.
-
- Apr 17, 2011
-
-
Luís Oliveira authored
Patch courtesy of Greg Pfeil. Closes lp:622272.
-
- Oct 24, 2010
-
-
Stelian Ionescu authored
-
- Sep 19, 2010
-
-
Stelian Ionescu authored
Add tests too
-
- Sep 06, 2010
-
-
Luís Oliveira authored
FOREIGN-NAME was looping endlessly on this case. Patch courtesy of Nikodemus Siivola.
-
- Aug 08, 2009
-
-
Stelian Ionescu authored
Declare DEFCALLBACK, DEFCFUN and DEFINE-FOREIGN-LIBRARY's keyword args :CCONV and :CALLING-CONVENTION obsolete, use :CONVENTION instead.
-
- Jul 20, 2009
-
-
Stelian Ionescu authored
Also export: - FOREIGN-LIBRARY - FOREIGN-LIBRARY-PATHNAME - FOREIGN-LIBRARY-TYPE - FOREIGN-LIBRARY-LOADED-P - LIST-FOREIGN-LIBRARIES
-
- May 26, 2009
-
-
Luís Oliveira authored
CFFI::PARSE-ARGS-AND-TYPES was inadvertently suppressing arguments with NIL values. E.g.: (foreign-funcall "foo" :foo a :bar nil :baz b :void) was compiled as (foreign-funcall "foo" :foo a :baz b :void). Reported by "D.I."
-
- Dec 30, 2007
-
-
Stelian Ionescu authored
-
- Aug 20, 2007
-
-
Luís Oliveira authored
- Pass them to the underlying DEFUN or DEFMACRO. - Add tests.
-
- Jul 30, 2007
-
-
Luís Oliveira authored
- DEFCFUN would complain when given a docstring but no argument list. - Add test.
-
- Feb 19, 2007
-
-
Luís Oliveira authored
The changes are summarized here: http://article.gmane.org/gmane.lisp.cffi.devel/1029 Also adapted tests and examples and uffi-compat.
-
- Feb 14, 2007
-
-
Luís Oliveira authored
Three new features: - stdcall (defcfun, foreign-funcall(-pointer), defcallback) - namespaces, associate foreigns vars and functions to a specific library. (CLISP and Lispworks only) - close-foreign-library actually works now. Backwards incompatible changes: - define-foreign-library's syntax changed slightly, can't load more than one foreign library per define-foreign-library form anymore. - defcvar's syntax changed. - foreign-funcall can't funcall pointers anymore. Use foreign-funcall-pointer for that.
-
- May 14, 2006
-
-
Luís Oliveira authored
- Place declarations after the translations take place. - We no longer poke at ignore declarations in defcallback.
-
- May 07, 2006
-
-
James Bielman authored
-
- May 03, 2006
-
-
James Bielman authored
-
- Mar 16, 2006
-
-
Luís Oliveira authored
- New cffi-sys primitive: canonicalize-symbol-name-case. Use this instead of read-from-string. Also new tests for this. - cffi-scl.lisp: correct the evaluation order of %MEM-REF and %MEM-SET. Have 'foreign-symbol-pointer return 'nil if the symbol is not found. - uffi-compat.lisp: better support for SCL. - defcfun.lisp (defcfun.undefined): package at time of eval may differ from the compile time package. Patch courtesy of Douglas Crosher.
-
- Feb 23, 2006
-
-
Luís Oliveira authored
- Makefile: new test-scl target. Add SCL's fasl file extensions to the clean target. - Remove SCL TODO item. - New file: cffi-scl.lisp. - New primitive type :long-double. Since it's only supported by SCL, it's not worth adding a no-long-double feature just yet. - New tests for :long-double. - Add information about SCL and the new :long-double type to the user manual.
-
- Feb 14, 2006
-
-
Luís Oliveira authored
- Convert floats to doubles in foreign-funcall-varargs. Test DEFCFUN.VARARGS.FLOAT now passes.
-
Luís Oliveira authored
- New interface. expand-to-foreign-dyn, expand-to-foreign and expand-from-foreign. - defcfun/foreign-funcall/defcallback/defcvar use this as well as the compiler macros and setf-expanders for mem-ref, mem-aref, and foreign-slot-value. - Also, parse ignore declarations and use them to avoid translating such types (thus avoiding breaking the ignore declaration).
-
- Feb 03, 2006
-
-
James Bielman authored
-
James Bielman authored
- Add a new utility function PARSE-BODY to CFFI-UTILS to pull the documentation string and declarations out of a body of code. - Use CFFI-UTILS:PARSE-BODY in DEFCALLBACK.
-
James Bielman authored
- New generic function on types: TRANSLATE-P. This is true for all types except built-in foreign types and typedefs defined non-translatable. - Incompatible change: DEFCTYPE now accepts keyword arguments :TRANSLATE-P and :DOCUMENTATION instead of an optional docstring. - Define the standard integers types as non-translatable.
-