- Feb 23, 2013
-
-
Stelian Ionescu authored
-
Stelian Ionescu authored
-
- Feb 21, 2013
-
-
- 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 14, 2012
-
-
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.
-
- 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 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
-
- 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.
-
- 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.
-
- Oct 09, 2011
-
-
Liam M. Healy authored
Add :argument-precedence-order to defgenerics translate-into-foreign-memory and translate-to-foreign, and removed the 'cons specializer in the tests.
-
- Sep 18, 2011
-
-
Luís Oliveira authored
Add respective struct tests, one of which fails. Also, missing union tests.
-
- Sep 17, 2011
-
-
Liam M. Healy authored
-
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.
-
Liam M. Healy authored
1. Idea: Make a slot for libffi-type-pointer and define for all built-in types, then define methods to make the pointer on demand for other type classes. 2. Add slot [libffi-type-pointer] with generic function to defclass foreign-type. 3. New file [built-in-types.lisp] defines all built-in types, and libffi-type-pointer :around method for typedefs/aliases. 4. New [libffi-type-pointer :around method] for foreign-struct-type. 5. New lists exported from CFFI for possible other uses, and needed here: *other-builtin-types* *built-in-integer-types* *built-in-float-types*.
-
Liam M. Healy authored
-
- Sep 12, 2011
-
-
Liam M. Healy authored
Created a function cstruct-libffi-type-pointer that generates the libffi-type structure for any foreign structure type, so that this structure may be used as an argument or return call by value to a foreign function. It replaces the automatic generation of this structure when defstruct is compiled or loaded (via *defcstruct-hook*), so that it is only made when needed and cffi-fsbv need not be loaded when the defcstruct is compiled. The structure will only be made once; it is bound to the plist of the type symbol (as before), and is reused if needed again. This function compiles but has not yet been tested.
-
- Sep 10, 2011
-
-
Luís Oliveira authored
-
Luís Oliveira authored
Said expansion breaks the protocol between TRANSLATE-TO-FOREIGN and FREE-TRANSLATED-OBJECT. This wasn't an issue when using EXPAND-TO-FOREIGN-DYN since it discards the default expansion of EXPAND-TO-FOREIGN. Only CONVERT-OBJECT-FOREIGN and DEFCALLBACK call EXPAND-TO-FOREIGN directly and the latter has to discard the second value anyway.
-
- Dec 31, 2008
-
-
Luís Oliveira authored
Implemented a new generic function TRANSLATE-AGGREGATE-TO-FOREIGN to support (SETF FOREIGN-SLOT-VALUE) for aggregate slots.
-
Luís Oliveira authored
-
- Apr 06, 2008
-
-
Luís Oliveira authored
Don't need to check for cycles (which starts off by consing up a hash table) when not dealing with foreign-typedefs. Initial patch courtesy of Greg Pfeil.
-
- Sep 01, 2007
-
-
Luís Oliveira authored
-
- Jun 25, 2007
-
-
tomi.borbely authored
-
- Jul 19, 2007
-
-
Luís Oliveira authored
-
- Jun 08, 2007
-
-
Luís Oliveira authored
Patch courtesy of Douglas Crosher.
-
- Jun 07, 2007
-
-
Luís Oliveira authored
Bug reported by Attila Lendvai.
-
- Jun 05, 2007
-
-
Luís Oliveira authored
-
- Jun 01, 2007
-
-
Luís Oliveira authored
-
- Mar 17, 2007
-
-
Luís Oliveira authored
-
- 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 07, 2006
-
-
James Bielman authored
- :POINTER without arguments is a void pointer. - (:POINTER :INT) is a pointer to an :INT. - These nest properly: (:POINTER (:POINTER :INT)). - Pointers are not type checked yet---an optional pointer type checker will be added someday.
-
- May 03, 2006
-
-
James Bielman authored
-
- Mar 27, 2006
-
-
Stephen Compall authored
- Remove *runtime-translator-form* from the public interface, in favor of (call-next-method). - Describe this change in the manual, including some text from the option 1 patch. - Be clear that ALLOC-PARAM is thrown out by %expand-type-to-foreign.
-
- Mar 01, 2006
-
-
Stephen Compall authored
- change expand-type-to-foreign-dyn for foreign-typedef to not short-circuit expand-type-to-foreign when falling back (see paste 17379) - add tests showing that you can change the foreign-dyn expansion semantics by providing an expand-to-foreign method that falls back
-