[Vala] vala-gen-introspect does not add my struct to *.gi file
- From: Anatol Pomozov <anatol pomozov gmail com>
- To: vala-list gnome org
- Subject: [Vala] vala-gen-introspect does not add my struct to *.gi file
- Date: Fri, 29 Oct 2010 18:10:45 -0700
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]