r21531: Use pidl-specific utility functions. Patch from Ronnie Sahlberg