Re: [Vala] vala-gen-introspect does not add my struct to *.gi file



Hi,

I have a smaller repo case. On my Ubuntu 10.04 I run

/usr/local/lib/vala-0.10/gen-introspect-0.10 --namespace=Thrift
-I/usr/local/include/thrift -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include
/usr/local/include/thrift/protocol/thrift_protocol.h
/usr/local/lib/libthrift_c_glib.so

It generates metadata for only 2 structures ThriftProtocolError and
ThriftProtocol. Why the tool does not generate information for other
structures such as ThriftType, ThriftMessageType and
ThriftProtocolClass.

http://github.com/anatol/thrift/blob/c_glib/lib/c_glib/src/protocol/thrift_protocol.h

I am really new to gtk OO style so I don't understand what is going on here.

On Fri, Oct 29, 2010 at 6:10 PM, Anatol Pomozov
<anatol pomozov gmail com> wrote:
Hi, everyone. I have a question related to vala-gen-introspect tool.

I am trying to add a Vala support for Apache Thrift
http://incubator.apache.org/thrift/
https://issues.apache.org/jira/browse/THRIFT-764

Instead of writing a library I want to reuse glib based c based
library for Thrift
http://github.com/anatol/thrift/tree/c_glib/lib/c_glib/test/ and now I
am working on Vala binding for this great library from Apache.

I use http://live.gnome.org/Vala/Bindings page that shows how to
create a .vapi file step-by-step. So I run

$ vala-gen-introspect thrift_c_glib thrift

It generates *.gi file http://pastie.org/1259281 which seems
incorrect. What makes me think that it is incorrect is following
command

anatol:vala $ vapigen --library thrift thrift/thrift_c_glib.gi
error: The type name `Thrift.ProtocolClass' could not be found
error: The type name `Thrift.ProtocolFactoryClass' could not be found
error: The type name `Thrift.ServerClass' could not be found
error: The type name `Thrift.Type' could not be found
.....
error: The type name `Thrift.Type' could not be found
error: The type name `Thrift.MessageType' could not be found
Generation failed: 16 error(s), 0 warning(s)

So vapigen cannot find Thrift.ProtocolClass class. If we look into
*.gi file (see the pastie link) gi mentions it only once

<struct name="ThriftBinaryProtocolClass">
 <field name="parent" type="ThriftProtocolClass"/>
</struct>

But if you look at its definition here
http://github.com/anatol/thrift/blob/c_glib/lib/c_glib/src/protocol/thrift_protocol.h
you'll see

/*!
 * Thrift Protocol object
 */
struct _ThriftProtocol
{
 GObject parent;

 /* protected */
 ThriftTransport *transport;
};
typedef struct _ThriftProtocol ThriftProtocol;

Which seems fine to me (it looks the same as ThriftBinaryProtocol definition).

Could you help me to understand why the tool does not add
ThriftProtocolClass to the known structures?




One more question here: why this process has 2 steps? Why it generates
*.gi file. Is it used some where else (outside of Vala API
generation)?




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]