In instances where forward declarations are required for structs, such as circular references, the python type slots and fields are not populated for the forward declared struct.
Simple example:
//header.h
typedef struct B B;
typedef struct A
{
B *bptr;
}A;
typedef struct B
{
A *aptr;
}B;
ctypesgen generates:
# header.h: 2
class struct_B(Structure):
pass
B = struct_B# header.h: 2
# header.h: 7
class struct_A(Structure):
pass
struct_A.__slots__ = [
'bptr',
]
struct_A._fields_ = [
('bptr', POINTER(B)),
]
A = struct_A# header.h: 7
B = struct_B# header.h: 2
A = struct_A# header.h: 7