FGETTR - Routines to get an SU trace from a file fgettr get a fixed-length segy trace from a file by file pointer fvgettr get a variable-length segy trace from a file by file pointer fgettra get a fixed-length trace from disk file by trace number gettr macro using fgettr to get a trace from stdin vgettr macro using vfgettr to get a trace from stdin gettra macro using fgettra to get a trace from stdin by trace number Function Prototype: int fgettr(FILE *fp, segy *tp); int fvgettr(FILE *fp, segy *tp); int fgettra(FILE *fp, segy *tp, int itr); Returns: fgettr, fvgettr: int: number of bytes read on current trace (0 after last trace) fgettra: int: number of traces in disk file Macros defined in segy.h define gettr(x) fgettr(stdin, (x)) define vgettr(x) fgettr(stdin, (x)) Usage example: segy tr; ... while (gettr(&tr)) { tr.offset = abs(tr.offset); puttr(&tr); } ... Authors: SEP: Einar Kjartansson, Stew Levin CWP: Shuki Ronen, Jack Cohen Revised: 7/2/95 Stewart A. Levin Mobil Major rewrite: Use xdr library for portable su output file format. Merge fgettr and fgettra into same source file. Make input from multiple streams work (at long last!). Revised: 11/22/95 Stewart A. Levin Mobil Always set ntr for DISK input. This fixes susort failure. Revised: 1/9/96 jkc CWP Set lastfp on nread <=0 return, too.