http://qs1969.pair.com?node_id=11148279


in reply to Perl XS binding to a struct with an array of chars*

It might also be worth looking at FFI::Platypus. A recent update includes the ability to handle structs: https://metacpan.org/pod/FFI::Platypus#Structured-Data-Records-(by-pointer-or-by-reference).

Just a data point, as you might already have a decent sized code base written beyond what you have shown.