Skip to content
  1. Jan 18, 2013
  2. 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
  3. Apr 14, 2012
  4. 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
  5. Feb 05, 2012
  6. Nov 24, 2011
  7. Nov 13, 2011
    • 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
  8. Oct 22, 2011
    • Liam M. Healy's avatar
      Tests for CFFI-FSBV libffi; fix return value translation in ffcall-body-libffi · b41e37be
      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.
      b41e37be
  9. Oct 05, 2011
  10. Sep 27, 2011
  11. Sep 26, 2011
    • Liam M. Healy's avatar
      Simplified ffcall-body-libffi (was callable-function) · 8a1c3bd8
      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.
      8a1c3bd8
    • Liam M. Healy's avatar
      CFFI-FSBV with foreign-funcall-pointer · 670b55a9
      Liam M. Healy authored
      Structures by value should work with foreign-funcall-pointer, untested.
      670b55a9
  12. Sep 22, 2011
  13. Sep 19, 2011
  14. Sep 18, 2011
  15. Sep 17, 2011
    • 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
  16. Apr 17, 2011
  17. Oct 24, 2010
  18. Sep 19, 2010
  19. Sep 06, 2010
  20. Aug 08, 2009
  21. Jul 20, 2009
  22. May 26, 2009
    • Luís Oliveira's avatar
      Fix bug in FOREIGN-FUNCALL. · 4a07b08a
      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."
      4a07b08a
  23. Dec 30, 2007
  24. Aug 20, 2007
  25. Jul 30, 2007
  26. Feb 19, 2007
  27. 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
  28. May 14, 2006
  29. May 07, 2006
  30. May 03, 2006
  31. Mar 16, 2006
    • Luís Oliveira's avatar
      SCL update + new cffi-sys primitive · 0c8f86aa
      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.
      0c8f86aa
  32. Feb 23, 2006
    • Luís Oliveira's avatar
      SCL port, courtesy of Douglas Crosher · 3ce10a0c
      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.
      3ce10a0c
  33. Feb 14, 2006
    • Luís Oliveira's avatar
      Fix float varargs promotion. · 38b7dbbf
      Luís Oliveira authored
      - Convert floats to doubles in foreign-funcall-varargs. Test
        DEFCFUN.VARARGS.FLOAT now passes.
      38b7dbbf
    • Luís Oliveira's avatar
      Macroexpansion-time translators · 85a72367
      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).
      85a72367
  34. Feb 03, 2006