Skip to content
  1. Nov 04, 2012
  2. Jun 07, 2012
  3. May 06, 2012
  4. 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
  5. Apr 30, 2012
  6. Apr 19, 2012
  7. Apr 14, 2012
  8. Apr 12, 2012
  9. 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
  10. Mar 23, 2012
  11. Mar 16, 2012
  12. Mar 11, 2012
  13. Mar 10, 2012
  14. Mar 01, 2012
    • Liam M. Healy's avatar
      Define mem-aptr; untested · 53ce2e07
      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.
      53ce2e07
  15. Feb 05, 2012
  16. 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
  17. Jan 29, 2012
  18. Jan 26, 2012
  19. Jan 13, 2012
  20. Jan 10, 2012
  21. Nov 24, 2011
  22. Nov 16, 2011
  23. 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
  24. Nov 10, 2011
  25. Oct 31, 2011
    • Liam M. Healy's avatar
      Use structure specification (:struct foo) in defcstruct expansion · 153bbe2e
      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.
      153bbe2e
  26. Oct 29, 2011
    • Liam M. Healy's avatar
      Relocate default type class name in defcfun · bb9a8ba8
      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.
      bb9a8ba8
    • Liam M. Healy's avatar
      Groveler fixes for new structure syntax · a185898a
      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.
      a185898a
  27. Oct 26, 2011
    • Liam M. Healy's avatar
      Default type class, define-translation-method · ab9cdb38
      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.
      ab9cdb38
  28. Oct 23, 2011
    • Liam M. Healy's avatar
      Fix mem-set: for aggregates, pointer is incremented by offset · 12d94e20
      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)
      12d94e20
    • Liam M. Healy's avatar
      Test foreign function calls with recursive structure by value · a227e3be
      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.
      a227e3be
  29. 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