From gnurag at gmail.com Tue Sep 18 14:35:21 2007 From: gnurag at gmail.com (Anurag) Date: Tue, 18 Sep 2007 20:05:21 +0530 Subject: [fetter-devel] generating bindings for librrd Message-ID: <5a383a5b0709180735u78515c95yfb25085a4012f5ac@mail.gmail.com> Hello, I've been trying to generate bindings for librrd using verrazano. I added the header file entries for librrd in generate-bindings and ran the file to get the librrd-bindings file. However when i try to include it in a package and load the package, i get this error mesage. --- Unknown CFFI type: LIBRRD-CFFI-BINDINGS::_-OFF-T. [Condition of type SIMPLE-ERROR] ---- Any idea where i am going wrong? I am using AllegroCL 8.0 on an amd64 box. I'll be happy to provide more information if required. Anurag -- -- Anurag <0xB20A82C1> From attila.lendvai at gmail.com Tue Sep 18 15:12:07 2007 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Tue, 18 Sep 2007 17:12:07 +0200 Subject: [fetter-devel] generating bindings for librrd In-Reply-To: <5a383a5b0709180735u78515c95yfb25085a4012f5ac@mail.gmail.com> References: <5a383a5b0709180735u78515c95yfb25085a4012f5ac@mail.gmail.com> Message-ID: > Any idea where i am going wrong? I am using AllegroCL 8.0 on an amd64 darcs pull cffi -- attila From christian.lynbech at tietoenator.com Wed Sep 19 14:39:59 2007 From: christian.lynbech at tietoenator.com (Lynbech Christian) Date: Wed, 19 Sep 2007 16:39:59 +0200 Subject: [fetter-devel] generating bindings for librrd In-Reply-To: <5a383a5b0709180735u78515c95yfb25085a4012f5ac@mail.gmail.com> (Anurag's message of "Tue, 18 Sep 2007 20:05:21 +0530") References: <5a383a5b0709180735u78515c95yfb25085a4012f5ac@mail.gmail.com> Message-ID: >>>>> "Anurag" == Anurag writes: Anurag> --- Anurag> Unknown CFFI type: LIBRRD-CFFI-BINDINGS::_-OFF-T. Anurag> [Condition of type SIMPLE-ERROR] Anurag> ---- This looks like a problem with derived types that I have been battling with the last time I tried to use Verranzano (which is like a year back so things may have changed). Suppose you have a type in the manner of (C syntax not precise): struct { ... enum YYY { ...} } XXX you are effectively defining a new type YYY within the definition of XXX. Verranzano does handle this but to avoid nameclashes, it adds a running number to these definitions such that you get something like (defctype YYY12345 ...) but usages of the type will stil refer to YYY which is defined nowhere. Try searching the generated CFFI bindings for OFF-T to see whether this is indeed the problem. If it the case, I believe that you can easily define a new CFFI type as an alias pointing _-OFF-T to _OFF-Txyz as necessary, but beware that this must be updated every the number changes. The version I was using did not reset the number variable between runs so it would change each and every time you called generate-bindings. This is easily fixable but the numbwer will still change every time anything changes within the collection of header files involved in the generation. A better solution would be to change the name generation such that the first such an internal type is met, it would be named "YYY" and if another internal type was encountered using the same name, that would be named "YYY2". I think that would catch the vast majority of cases. Alternatively one should fix all usages of the type YYY to refer to the correct calculated name which I think would be very hard to do. As I said, things might have changed in current versions of Verranzano. ------------------------+----------------------------------------------------- Christian Lynbech | christian #\@ defun #\. dk ------------------------+----------------------------------------------------- Hit the philistines three times over the head with the Elisp reference manual. - petonic at hal.com (Michael A. Petonic) From gnurag at gmail.com Thu Sep 20 10:53:34 2007 From: gnurag at gmail.com (Anurag) Date: Thu, 20 Sep 2007 16:23:34 +0530 Subject: [fetter-devel] generating bindings for librrd In-Reply-To: References: <5a383a5b0709180735u78515c95yfb25085a4012f5ac@mail.gmail.com> Message-ID: <5a383a5b0709200353u19811d59rbaa8d11391e27fe9@mail.gmail.com> On 9/19/07, Lynbech Christian wrote: > This looks like a problem with derived types that I have been battling > with the last time I tried to use Verranzano (which is like a year back > so things may have changed). Hi! You are right, things have changed a lot in the cffi's darcs repository. As per Attila's suggestion i used the latest version of CFFI from the darcs tree, and the issue with OFF-T seems to be solved. Now, when i am calling any foreign function which does not require any parameter, it returns me proper string output (for example calling a function which returns version of library) But the foreign function doesnt seem to do work when i use normal lisp strings. (rrd-last "/path/to/test.rrd" 1) gives me, The value "/path/to/test.rrd" is not of type (SIGNED-BYTE 32) I understand that i should use, (cffi:with-foreign-string (rrdfile "/path/to/test.rrd") (rrd-last rrdfile 1)) i still get, The value #.(SB-SYS:INT-SAP #X08185508) is not of type (SIGNED-BYTE 32). [Condition of type TYPE-ERROR] Is there something i can do to convert the string to 32byte signed type? Anurag -- Anurag <0xB20A82C1> From attila.lendvai at gmail.com Thu Sep 20 13:14:58 2007 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Thu, 20 Sep 2007 15:14:58 +0200 Subject: [fetter-devel] generating bindings for librrd In-Reply-To: <5a383a5b0709200353u19811d59rbaa8d11391e27fe9@mail.gmail.com> References: <5a383a5b0709180735u78515c95yfb25085a4012f5ac@mail.gmail.com> <5a383a5b0709200353u19811d59rbaa8d11391e27fe9@mail.gmail.com> Message-ID: > I understand that i should use, > (cffi:with-foreign-string (rrdfile "/path/to/test.rrd") > (rrd-last rrdfile 1)) > > i still get, > The value #.(SB-SYS:INT-SAP #X08185508) is not of type (SIGNED-BYTE 32). > [Condition of type TYPE-ERROR] last time i checked it worked for me with cffi and babel from http://common-lisp.net/~loliveira/soc07/ -- attila