Luis Oliveira | 27 Sep 05:56

New patches: 26-Sep-2008


Fri Sep 26 16:51:12 EDT 2008  Luis Oliveira <loliveira <at> common-lisp.net>
  * gendocs.sh fix: pass --no-userinit to sbcl

    M ./doc/colorize-lisp-examples.lisp -12 +11
    M ./doc/gendocs.sh -2 +4

Fri Sep 26 15:50:08 EDT 2008  Luis Oliveira <loliveira <at> common-lisp.net>
  * Update SCL port.

  Patch courtesy of Douglas Crosher.

    M ./grovel/grovel.lisp -1 +1
    M ./src/cffi-scl.lisp -1 +1
    M ./tests/defcfun.lisp -1 +1

An updated tarball of CFFI's source can be downloaded here:
http://common-lisp.net/project/cffi/tarballs/cffi-080926.tar.gz

Darcsweb URL:
http://common-lisp.net/cgi-bin/darcsweb/darcsweb.cgi?r=cffi-cffi;a=summary
Chaitanya Gupta | 26 Sep 22:45

Documentation bug (DEFINE-PARSE-METHOD)

Hi,

The CFFI user manual seems to be incorrect for DEFINE-PARSE-METHOD --
http://common-lisp.net/project/cffi/manual/cffi-manual.html#define_002dparse_002dmethod

The examples are the same as for DEFINE-FOREIGN-TYPE (which is the
previous symbol described in the manual), and the description is
missing. Also, the descriptions given for Arguments and Values are
either incorrect, or they are not very clear..

Chaitanya
elliott | 25 Sep 09:04

A question about adding gcc flags in groveling.

Hi,

I need to add an additional flag to a file being groveled for iolib 
(net.sockets/grovel.c uses struct ucred, which needs "-D_GNU_SOURCE" in 
my case).  I was wondering if there is a standard way to add flags, like 
binding cffi-grovel::*cc-flags* to a different value?

Elliott
Luis Oliveira | 13 Sep 05:56

New patches: 12-Sep-2008


Fri Sep 12 09:35:00 EDT 2008  Luis Oliveira <loliveira <at> common-lisp.net>
  tagged 0.10.2

Fri Sep 12 09:34:56 EDT 2008  Luis Oliveira <loliveira <at> common-lisp.net>
  * update cffi.asd for version 0.10.2

    M ./cffi.asd -1 +1

Fri Sep 12 09:34:24 EDT 2008  Luis Oliveira <loliveira <at> common-lisp.net>
  * TODO cleanup

    M ./TODO -2

Fri Sep 12 09:33:50 EDT 2008  Luis Oliveira <loliveira <at> common-lisp.net>
  * Fix handling of the T clause in DEFINE-FOREIGN-LIBRARY

  - Added regression test: LIBRARY.T-CLAUSE.

  Bug report and initial patch courtesy of Kalyanov Dmitry.

    M ./src/libraries.lisp -1 +4
    M ./tests/misc.lisp +13

An updated tarball of CFFI's source can be downloaded here:
http://common-lisp.net/project/cffi/tarballs/cffi-080912.tar.gz

Darcsweb URL:
http://common-lisp.net/cgi-bin/darcsweb/darcsweb.cgi?r=cffi-cffi;a=summary
(Continue reading)

Andy Chambers | 10 Sep 23:32

foreign strings

Hi,

I'm still plugging away on sqlite

I've got a problem creating a binding for the following function

int sqlite3_bind_text(sqlite3_stmt*, int, const char*, int n, void(*)(void*));

I tried the following....

(defcfun ("sqlite3_bind_text" %sqlite-bind-text) :int
  (stmt :pointer)
  (index :int)
  (value :string)
  (len :int)
  ;; not really an int but cffi takes care of this for us
  (destructor :int))

Everything is pretty straightforward apart from the last two
parameters.  Length is supposed to be the length of the value being
passed in (or -1 if the value is null terminated).
The destructor is supposed to be a function that frees the memory
required by `value' after sqlite is finished with it.  For destructor,
you can use the special value 0 if the memory
is in "unmanaged" space.  So I have a few questions...

1. If you specify the type as :string, does cffi pass it through as a
null terminated string?
2. Does cffi take care of freeing a string once the C library is
finished with it or should I define a callback to use for the
(Continue reading)

Kalyanov Dmitry | 10 Sep 20:37

Library specs with T are ignored

Hello, cffi-devel!

Sorry, last message was messed by gpg.

I have found a case when cffi behaves not as documented.
The documentation in page for define-foreign-library says about load-clauses 
list that "Finally, if feature is t, this load-clause is picked 
unconditionally."

But the load-clause with feature set to T is ignored, because function 
%foreign-library-spec uses alexandria:featurep, which does consider T to be 
feature.

This patch should fix this: to return the load-clause that has feature set to 
T.

Test case:
(define-foreign-library libgraphan-wrap
  (t (:default "libgraphan-wrap")))

(equal
  (%foreign-library-spec (get-foreign-library 'libgraphan-wrap))
  (t (:default "libgraphan-wrap")))
=>
 T
Attachment (cffi-spec.patch): text/x-diff, 469 bytes
_______________________________________________
cffi-devel mailing list
(Continue reading)

Kalyanov Dmitry | 10 Sep 20:20

Library specs with T are ignored

Hello, cffi-devel!

I have found a case when cffi behaves not as documented.
The documentation in page for define-foreign-library says about load-clauses 
list that "Finally, if feature is t, this load-clause is picked 
unconditionally."

But the load-clause with feature set to T is ignored, because function 
%foreign-library-spec uses alexandria:featurep, which does consider T to be 
feature.

This patch should fix this: to return the load-clause that has feature set to 
T.

Test case:
(define-foreign-library libgraphan-wrap
  (t (:default "libgraphan-wrap")))

(equal
  (%foreign-library-spec (get-foreign-library 'libgraphan-wrap))
  (t (:default "libgraphan-wrap")))
=>
 T
Attachment (cffi-spec.patch): text/x-diff, 469 bytes
_______________________________________________
cffi-devel mailing list
cffi-devel <at> common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel
(Continue reading)

Andy Chambers | 1 Sep 16:45

Double pointers

Hi,

Please excuse the poor use of terminology in the following message.
I'm stabbing around in the dark when
it comes to C.  I'll need to get a textbook someday and learn it properly.

How do you pass a "double pointer" to a C function.  For example,
here's the signature for sqlite's open

int sqlite3_open(
  const char *filename,   /* Database filename (UTF-8) */
  sqlite3 **ppDb          /* OUT: SQLite db handle */
);

I'd like to define a cffi function that lets me call this and keep a
handle on the ppDb object that gets
created as a result.

I've tried various combinations of (foreign-alloc ..) and
(null-pointer) but always got a memory exception
when trying to use the handle in another function.

The sqlite stuff has lots of these functions that modify input
parameters and return error codes
rather than returning some opaque object like the CFFI example does.

Cheers,
Andy
Luis Oliveira | 31 Aug 05:58

New patches: 30-Aug-2008


Sat Aug 30 04:38:33 EDT 2008  Stelian Ionescu <sionescu <at> common-lisp.net>
  * Add wrapper directives PROCLAIM and DECLAIM.

    M ./grovel/grovel.lisp +6

An updated tarball of CFFI's source can be downloaded here:
http://common-lisp.net/project/cffi/tarballs/cffi-080830.tar.gz

Darcsweb URL:
http://common-lisp.net/cgi-bin/darcsweb/darcsweb.cgi?r=cffi-cffi;a=summary
Luis Oliveira | 23 Aug 05:58

New patches: 22-Aug-2008


Fri Aug 22 10:43:42 EDT 2008  Stelian Ionescu <sionescu <at> common-lisp.net>
  * Add option BASE-TYPE to groveler directives CENUM and CONSTANTENUM.

    M ./doc/cffi-manual.texinfo -4 +4
    M ./grovel/grovel.lisp -5 +12

Fri Aug 22 10:39:56 EDT 2008  Stelian Ionescu <sionescu <at> common-lisp.net>
  * Small fix to the manual: use @var instead of @code in CENUM and CONSTANTENUM docs.

    M ./doc/cffi-manual.texinfo -4 +4

Fri Aug 22 10:18:00 EDT 2008  Stelian Ionescu <sionescu <at> common-lisp.net>
  * Add option DEFINE-CONSTANTS to groveler directives CENUM and CONSTANTENUM.

  If DEFINE-CONSTANTS is non-null, the enum members will also be defined
  as constants.

    M ./doc/cffi-manual.texinfo -2 +8
    M ./grovel/grovel.lisp -43 +60

Fri Aug 22 10:15:27 EDT 2008  Stelian Ionescu <sionescu <at> common-lisp.net>
  * Make groveler directive CONSTANT more robust.

  If a constant's name is a keyword, change it to a symbol
  interned in the current package.

    M ./doc/cffi-manual.texinfo -1 +2
    M ./grovel/grovel.lisp +2

(Continue reading)

Luis Oliveira | 22 Aug 05:56

New patches: 21-Aug-2008


Wed Aug 20 18:59:54 EDT 2008  Luis Oliveira <loliveira <at> common-lisp.net>
  tagged 0.10.1

Wed Aug 20 18:59:50 EDT 2008  Luis Oliveira <loliveira <at> common-lisp.net>
  * update cffi.asd for version 0.10.1

    M ./cffi.asd -1 +1

An updated tarball of CFFI's source can be downloaded here:
http://common-lisp.net/project/cffi/tarballs/cffi-080821.tar.gz

Darcsweb URL:
http://common-lisp.net/cgi-bin/darcsweb/darcsweb.cgi?r=cffi-cffi;a=summary

Gmane