- Nov 04, 2012
-
-
- Jun 07, 2012
-
-
Liam M. Healy authored
Add method expand-to-foreign-dyn-indirect for type foreign-type-alias so that foreign-string-type will be expanded correctly (as a pointer).
-
- May 06, 2012
-
-
Stelian Ionescu authored
-
Stelian Ionescu 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 30, 2012
-
-
Stelian Ionescu authored
This broke other stuff, so revert until we understand what's happening This reverts commit 944d3318.
-
Stelian Ionescu authored
-
Stelian Ionescu authored
-
- Apr 19, 2012
-
-
Liam M. Healy authored
-
- Apr 14, 2012
-
-
Luís Oliveira authored
-
Liam M. Healy authored
Create a new function #'foreign-expand-runtime-translator-or-binding which is what the methods expand-to-foreign-dyn (value var body (type enhanced-foreign-type)) expand-to-foreign-dyn-indirect (value var body (type translatable-foreign-type)) both call. Previously, the body of that function was the body of the first method, and the second method called that generic function. This did not work as intended however, the result being that libffi calls were passed the actual object instead of the pointer. This change fixes that problem.
-
Luís Oliveira authored
-
-
- Apr 12, 2012
-
-
Stelian Ionescu 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.
-
- Mar 23, 2012
-
-
Liam M. Healy authored
Multi-level optimizations depending what arguments are constantp; the constantp arguments need to be evaled.
-
- Mar 16, 2012
-
-
Liam M. Healy authored
-
- Mar 11, 2012
-
-
Luís Oliveira authored
Patch courtesy of Mark Evenson.
-
Luís Oliveira authored
Patch courtesy of Mark Evenson.
-
- Mar 10, 2012
-
-
Luís Oliveira authored
Patch courtesy of James Anderson.
-
- Mar 01, 2012
-
-
Liam M. Healy authored
New function mem-aptr will return the pointer to the requested element of the array, and add documentation. It is untested.
-
- Feb 05, 2012
-
-
Liam M. Healy authored
-
- Feb 04, 2012
-
-
Liam M. Healy authored
Use hash table for libffi-type-pointer instead of a class slot, and simplify #'libffi-type-pointer methods. Remove obsolete package definition file. Tests in cffi-tests not run due to error in load, but GSLL tests pass.
-
- Jan 29, 2012
-
-
Liam M. Healy authored
-
- Jan 26, 2012
-
-
Luís Oliveira authored
Bug reported by Anton Vodonosov.
-
- Jan 13, 2012
-
-
Luís Oliveira authored
-
- Jan 10, 2012
-
-
- 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 16, 2011
-
-
Implemented automatic accessor lookup for integer types, based on alien type size and CFFI keyword -> alien type mapping.
-
- Nov 13, 2011
-
-
Liam M. Healy authored
In order that structures called by value work correctly (in cffi-fsbv), add methods: translate-into-foreign-memory foreign-built-in-type enhanced-typedef expand-to-foreign-dyn foreign-built-in-type foreign-pointer-type
-
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.
-
- Nov 10, 2011
-
-
- Oct 31, 2011
-
-
Liam M. Healy authored
Modify #'generate-struct-accessors so that when generating accessors, the structure is referred to with the (:struct foo) syntax, rather than just 'foo. While such a reference usually generates only a style warning, if parse-deprecated-struct-type hasn't been called yet, as is the case for slot defintions in the defcstruct expansion, it results in an error. This problem prevented shuffletron from compiling.
-
- Oct 29, 2011
-
-
Liam M. Healy authored
Moved the generation of a default type class name (appending '-tclass) in defcfun so that notice-foreign-struct-definition gets the class name in 'options. Use the proper :struct form for structure.
-
Liam M. Healy authored
Two fixes related to the change to the new syntax (:struct foo): 1) For size-of-* defconstant generation, emit with :struct. 2) Parse name and size in defcunion, not just leaving that to notice-foreign-union-definition, because define-parse-method needs a clean name. Osicat now compiles cleanly.
-
- Oct 26, 2011
-
-
Liam M. Healy authored
Make a default :class argument in defcstruct which is the structure name and '-tclass concatenated. New macro define-translation-method for convenience to define translation methods. It's a first cut, not quite how I'd like, and untested.
-
- Oct 23, 2011
-
-
Liam M. Healy authored
Recently added test struct-values.translation.mem-aref.1 that tested conversion of arrays of structures was failing because mem-set did not increment the pointer by the offset amount, so it was always writing into the first position of the array and the rest was garbage. This is now fixed. (with-foreign-object (p '(:struct struct-pair) 2) (setf (mem-aref p '(:struct struct-pair) 0) '(1 . 2) (mem-aref p '(:struct struct-pair) 1) '(3 . 4)) (values (mem-aref p '(:struct struct-pair) 0) (mem-aref p '(:struct struct-pair) 1))) (1 . 2) (3 . 4)
-
Liam M. Healy authored
Add definition of C functions prodsumpair and doublepairdouble that take, and for the latter, return, the structure struct-pair+double (struct_pair_double) that has a structure struct-pair (struct_pair) in its slot 'pr. Two tests, fsbv.3 and fsbv.4, have been defined, and pass. Fixed argument to libffi-type-pointer call in libffi-type-pointer :around method so that these will work.
-
- 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.
-