SUCOUNTKEY - COUNT the number of unique values for a given KEYword. sucountkey < input.su key=[sx,gx,cdp,...] Example: suplane | sucountkey key=tracl,tracr,offset Credits: Baoniu Han, bhan@mines.edu, Nov, 2000 Globals variables*/ segy tr; internal structure typedef struct { int num; Value *val; } my_Count; int main (int argc, char **argv) { cwp_String key[SU_NKEYS]; /* array of keywords */ cwp_String type[SU_NKEYS]; /* array of keywords */ int index[SU_NKEYS]; /* name of type of getparred key*/ my_Count count_table[SU_NKEYS]; /* count table for keywords */ int ikey; /* key counter */ int nkeys; /* number of header fields set */ int i; /* count index */ Value val0; /* value of key field */ long buf_size; /* Initialize initargs(argc, argv); requestdoc(1); /* Get "key" values if ((nkeys=countparval("key"))!=0) { getparstringarray("key",key); } else { key[0]="cdp"; } /* you can increase this number to change the buffer size for each key word buf_size=100000L; /* get types and indexes corresponding to the keys for (ikey=0; ikey