Main API now uses cstruct

The Unix sub-API has not yet been converted.