Export message and general marshaling functions