Alias typedef of struct pointer: testData* => testDataPtr
It's a common practice to typedef a struct pointer into a new pointer type. giscanner does not recognize this. It treats types like testData
and testDataPtr
as different types (Record). The (type TestData)
tag has to be used. e.g.
G_DEFINE_BOXED_TYPE (TestData, test_data, test_data_copy, test_data_free)
GType test_data_get_type ();
typedef struct _testData TestData;
typedef struct _testData {
gchar *item1;
gchar *item2;
}* testDataPtr;
void test_data_connect(testDataPtr tdata);
Here the test_data_connect()
will not accept TestData
object as the parameter.
It seems https://gitlab.gnome.org/GNOME/gobject-introspection/-/blob/9e329e9b7bc2f29d4265af87abfc41db1348f24c/giscanner/transformer.py#L806 doesn't recognize pointer ctype and even if it does, a new compound node was created to solve a bug at L818.
It might be better to somehow create an alias to the promoted struct if the ctype of the symbol is a pointer.
Edited by mozbugbox