su.h

Go to the documentation of this file.
00001 /* Copyright (c) Colorado School of Mines, 2006.*/
00002 /* All rights reserved.                       */
00003 
00004 /* su.h - include file for SU programs
00005  *
00006  * $Author: john $
00007  * $Source: /usr/local/cwp/src/su/include/RCS/su.h,v $
00008  * $Revision: 1.33 $ ; $Date: 1997/10/15 15:18:21 $
00009  */
00010 
00011 #ifndef SU_H
00012 #define SU_H
00013 
00014 #include "par.h"
00015 
00016 /* TYPEDEFS */
00017 typedef union { /* storage for arbitrary type */
00018     char s[8];
00019     short h;
00020     unsigned short u;
00021     long l;
00022     unsigned long v;
00023     int i;
00024     unsigned int p;
00025     float f;
00026     double d;
00027     unsigned int U:16;
00028     unsigned int P:32;
00029 } Value;
00030 
00031 
00032 /* DEFINES */
00033 #define CHECK_NT(label,nt) \
00034     if(nt > SU_NFLTS) suerr("%s=%d must not exceed %d",label,nt,SU_NFLTS)
00035 #define NALLOC  (524288)
00036 #define NFALLOC (NALLOC/FSIZE)
00037 #define NIALLOC (NALLOC/ISIZE)
00038 #define NDALLOC (NALLOC/DSIZE)
00039 #define LOWBYTE(w) ((w) & 0xFF)
00040 #define HIGHBYTE(w) LOWBYTE((w) >>8)
00041 #define LOWWORD(w) ((w) & 0xFFFF)
00042 #define HIGHWORD(w) LOWWORD((w) >>16)
00043 #define ISNEGCHAR(c) ((c) & 0x80)
00044 #define SIGNEXTEND(c) (~0xFF | (int) (c))
00045 
00046 /*  READ_OK  - read  permission for access(2)
00047  *  WRITE_OK - write permission for access(2)
00048  *  EXEC_OK  - exec  permission for access(2)
00049  *  FILE_OK  - file  existence  for access(2)
00050  *  Note: these are changed from the usual defines in file.h
00051  *        because this include exists on some machines and
00052  *        not others, often overlaps fcntl.h, etc.  Lint is
00053  *            happier with a fresh start.
00054  *  Note: Post-ANSI sometimes R_OK in unistd.h (this isn't
00055  *        an ANSI file).
00056  */
00057 #define     READ_OK     4
00058 #define     WRITE_OK    2
00059 #define     EXEC_OK     1
00060 #define     FILE_OK     0
00061 
00062 /* For plotting by keyword */
00063 #define  IS_DEPTH(str)  ((  STREQ(str,"gelev")  || \
00064                STREQ(str,"selev")   || \
00065                STREQ(str,"sdepth")  || \
00066                STREQ(str,"gdel")    || \
00067                STREQ(str,"sdel")    || \
00068                STREQ(str,"swdep")   || \
00069                STREQ(str,"gwdep")         )?cwp_true:cwp_false)
00070 
00071 #define  IS_COORD(str)  (( STREQ(str,"sx")   || \
00072                STREQ(str,"sy")   || \
00073                STREQ(str,"gx")   || \
00074                STREQ(str,"gy")     )?cwp_true:cwp_false)
00075 
00076 /* FUNCTION PROTOTYPES */
00077 #ifdef __cplusplus /* if C++, specify external linkage to C functions */
00078 extern "C" {
00079 #endif
00080 
00081 /* valpkge */
00082 int vtoi(register cwp_String type, Value val);
00083 long vtol(register cwp_String type, Value val);
00084 float vtof(register cwp_String type, Value val);
00085 double vtod(register cwp_String type, Value val);
00086 int valcmp(register cwp_String type, Value val1, Value val2);
00087 void printfval(register cwp_String type, Value val);
00088 void fprintfval(FILE *stream, register cwp_String type, Value val);
00089 void scanfval(register cwp_String type, Value *valp);
00090 void atoval(cwp_String type, cwp_String keyval, Value *valp);
00091 void getparval(cwp_String name, cwp_String type, int n, Value *valp);
00092 Value valtoabs(cwp_String type, Value val);
00093 
00094 #ifdef __cplusplus /* if C++, end external linkage specification */
00095 }
00096 #endif
00097 
00098 #endif

Generated on 5 Jan 2017 for IWAVE by  doxygen 1.4.7