mx and eng function specification and c error handling