/*--------------------------------------------------------------------* * G L O B A L D I G I T A L S E I S M I C N E T W O R K * * * * gdsnstd.h - Standards and constants definition for project * *--------------------------------------------------------------------*/ /*--------------------------------------------------------------------* * Albuquerque Seismological Laboratory - USGS - US Dept of Interior * *--------------------------------------------------------------------*/ /*--------------------------------------------------------------------* * Modification and history * * * *---Edit---Date----Who-------Description of changes------------------* * 001 24-Apr-86 SH Set up standards file * * 002 9-Jul-86 SH Add mfree to free for UNIX29 * * 003 22-Dec-86 SH Tailor VMS definitions * *--------------------------------------------------------------------*/ /*---------------------Determine System Dependancies------------------*/ #ifdef VMS #define QUAD_UWORDSIZE /* Ints and pointers are 32 bit */ #define UNSGND unsigned /* Non-Ints can be specified as unsigned */ #define VOIDER void /* The compiler really has a void type */ #define STDFLT double /* Standard floating */ #endif #ifdef UNIX29 #define DUAL_UWORDSIZE /* Ints and pointers are 16 bit */ #define UNSGND /* You cannot have unsigned non-ints */ #define VOIDER int /* The compiler does not have real void */ #define STDFLT float /* Standard single precision floating */ #define mfree(a) free(a) /* no mfree in unix 2.9 */ #endif /*------------------------Define Data types---------------------------*/ #define VOID VOIDER /* For functions which return nothing */ #define BOOL UNSGND char /* Flag quantities */ #define TEXT UNSGND char /* For character strings */ /*--------------------------------------------* * 8-Bit 16-Bit 32-Bit * * Numbers: BYTE WORD LONG * * Unsigned: UBYTE UWORD ULONG * *--------------------------------------------*/ /* 8-Bit quantities */ #define UBYTE UNSGND char /* An 8-Bit definition */ #define BYTE char /* Numeric 8-bit definition */ /* 16-Bit quantities */ #ifdef QUAD_UWORDSIZE #define UWORD UNSGND short /* 16 bit unsigned */ #define WORD short /* 16 bit numeric quantity */ #endif #ifdef DUAL_UWORDSIZE #define UWORD unsigned int /* Assume an int is a 16 bit number */ #define WORD int /* 16 bit numeric quantity */ #endif /* 32-Bit quantities */ #ifdef QUAD_UWORDSIZE #define ULONG unsigned int /* Definition of a 32 bit mask */ #define LONG int /* A 32 bit number */ #endif #ifdef DUAL_UWORDSIZE #define ULONG UNSGND long /* 32 bit mask */ #define LONG long /* 32 bit number */ #endif #define DSKREC ULONG /* Pointer to a disk record */ /*------------Define some macros and contants we will use-----------------*/ #define FOREVER for(;;) /* Infinite loop */ #include <stdio.h> /* Get from standard include library */ #ifndef NULL #define NULL (0) /* Impossible pointer */ #endif #define TRUE 1 /* if (TRUE) */ #define FALSE 0 /* if (!TRUE) */ #define EOS '\0' /* End of string */ #define min(a,b) ((a)<(b)?(a):(b)) #define max(a,b) ((a)>(b)?(a):(b)) #ifdef UNIX29 #include <macros.h> /* Get from UNIX include library */ #endif #define IUBYTE(x) (((WORD) x)&0xFF)