FILE * variables are called "fp" rather than "fd". Better (safer) temporary-file handling.
Also add RCSIDs.