Reputation: 379
I want to pass the address of a structure to a C program. In C I would use something like fun(&vendorRecord). I have tried various forms I have found on the internet but nothing works. Can someone give me a suggestion?
My structure looks like this:
class vendrRecord(Structure):
_pack_ = 1 # pack the struct
_fields_ = [
("vendorListNumber" ,c_ubyte *(5)),
("vendorNumber" ,c_ubyte *(5)),
]
My C structure looks like this:
struct {
unsigned char vendorListNumber[5];
unsigned char vendorNumber[5];
} vendrRecord;
My C prototype looks like this:
void fun(void *record);
My C call looks like this:
fun(&vendrRecord);
Upvotes: 1
Views: 61