[fetter-devel] generating bindings for librrd

Lynbech Christian christian.lynbech at tietoenator.com
Wed Sep 19 14:39:59 UTC 2007


>>>>> "Anurag" == Anurag  <gnurag at gmail.com> 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)





More information about the fetter-devel mailing list