Skip to content
  1. Feb 23, 2013
  2. Feb 21, 2013
  3. Jun 07, 2012
  4. May 06, 2012
  5. May 01, 2012
    • Luís Oliveira's avatar
      Rewrite backwards-compatibility mode for bare struct types. · be626770
      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.
      be626770
  6. Apr 14, 2012
    • Liam M. Healy's avatar
      Fix expand-to-foreign-dyn-indirect · 7bcee389
      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.
      7bcee389
  7. Mar 25, 2012
    • Liam M. Healy's avatar
      New function expand-to-foreign-dyn-indirect · c5aea35f
      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.
      c5aea35f
  8. Feb 04, 2012
    • Liam M. Healy's avatar
      Use hash table for libffi-type-pointer · 95052e59
      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.
      95052e59
  9. Jan 29, 2012
  10. Nov 24, 2011
  11. Nov 13, 2011
    • Liam M. Healy's avatar
      Additional methods for translate-into-foreign-memory and expand-to-foreign-dyn · 4108e4f9
      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
      4108e4f9
    • Liam M. Healy's avatar
      Indirecting foreign objects for libffi · 36694971
      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.
      36694971
  12. Oct 09, 2011
  13. Sep 18, 2011
  14. Sep 17, 2011
    • Liam M. Healy's avatar
      Fixes to libffi-type-pointer · eb46382b
      Liam M. Healy authored
      eb46382b
    • Luís Oliveira's avatar
      Implement (:STRUCT foo) and (:UNION foo) type parsing. · 61a230b5
      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.
      61a230b5
    • Liam M. Healy's avatar
      Make libffi-type-pointer a slot and method, define for built-in types · 418a998e
      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*.
      418a998e
    • Liam M. Healy's avatar
      Define *built-in-foreign-types* · b472c1f1
      Liam M. Healy authored
      b472c1f1
  15. Sep 12, 2011
    • Liam M. Healy's avatar
      New function cstruct-libffi-type-pointer · 186a29be
      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.
      186a29be
  16. Sep 10, 2011
  17. Dec 31, 2008
  18. Apr 06, 2008
    • Luís Oliveira's avatar
      Small optimization in PARSE-TYPE · 5f21070b
      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.
      5f21070b
  19. Sep 01, 2007
  20. Jun 25, 2007
  21. Jul 19, 2007
  22. Jun 08, 2007
  23. Jun 07, 2007
  24. Jun 05, 2007
  25. Jun 01, 2007
  26. Mar 17, 2007
  27. Feb 19, 2007
  28. Feb 14, 2007
    • Luís Oliveira's avatar
      stdcall, namespaces, close-foreign-library · 4f37c6d9
      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.
      4f37c6d9
  29. May 07, 2006
    • James Bielman's avatar
      Make :POINTER a parameterized foreign type. · d4596a91
      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.
      d4596a91
  30. May 03, 2006
  31. Mar 27, 2006
    • Stephen Compall's avatar
      remove *runtime-translator-form* from the interface · 760c0145
      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.
      760c0145
  32. Mar 01, 2006
    • Stephen Compall's avatar
      demonstrate differing behavior between foreign-dyn expansions · 6973ba6b
      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
      6973ba6b
  33. Feb 25, 2006
    • Luís Oliveira's avatar
      foreign-alloc changes · 1d25ce17
      Luís Oliveira authored
      - bugfix, foreign-alloc doesn't need to call translate-type-to-foreign
        explicitly since mem-aref already does. Bug reported by Greg Pfeil.
      - new keyword argument: NULL-TERMINATE-P.
      - new regression tests for the bug described above and new tests for
        the new keyword argument.
      - document new argument.
      1d25ce17