VALPKGE - routines to handle variables of type Value vtoi cast Value variable as an int vtol cast Value variable as a long vtof cast Value variable as a float vtod cast Value variable as a double atoval convert ascii to Value valtoabs take absolute value of a Value variable valcmp compare Value variables printfval printf a Value variable fprintfval fprintf a Value variable scanfval scanf a Value variable printftype printf for the type of a segy header word Function Prototypes: int vtoi(register cwp_String type, Value val); long vtol(register cwp_String type, Value val); float vtof(register cwp_String type, Value val); double vtod(register cwp_String type, Value val); void atoval(cwp_String type, cwp_String keyval, Value *valp); Value valtoabs(cwp_String type, Value val); int valcmp(register cwp_String type, Value val1, Value val2); void printfval(register cwp_String type, Value val); void fprintfval(FILE *stream, register cwp_String type, Value val); void scanfval(register cwp_String type, Value *valp); Notes: A Value is defined by the following in .../su/include/su.h: typedef union { * storage for arbitrary type * char s[8]; short h; unsigned short u; long l; unsigned long v; int i; unsigned int p; float f; double d; unsigned int U:16; unsigned int P:32; } Value; The use of the valpkge routines, as well as the hdrpkge routines, permits the user to change the definition of the types of the various fields of the segy data type, without breaking codes that look at part or all of these fields. Authors: CWP: Jack K. Cohen, Shuki Ronen