--- pgp/src/usuals.h 2018/04/24 16:37:54 1.1 +++ pgp/src/usuals.h 2018/04/24 16:40:27 1.1.1.4 @@ -1,24 +1,41 @@ -/* usuals.h - The usual typedefs, etc. -*/ -#ifndef USUALS /* Assures no redefinitions of usual types...*/ -#define USUALS - -typedef unsigned char boolean; /* values are TRUE or FALSE */ -typedef unsigned char byte; /* values are 0-255 */ -typedef byte *byteptr; /* pointer to byte */ -typedef char *string; /* pointer to ASCII character string */ -typedef unsigned short word16; /* values are 0-65535 */ -typedef unsigned long word32; /* values are 0-4294967295 */ - -#ifndef TRUE -#define FALSE 0 -#define TRUE (!FALSE) -#endif /* if TRUE not already defined */ - -#ifndef min /* if min macro not already defined */ -#define min(a,b) ( (a)<(b) ? (a) : (b) ) -#define max(a,b) ( (a)>(b) ? (a) : (b) ) -#endif /* if min macro not already defined */ - -#endif /* if USUALS not already defined */ - +/* usuals.h - The usual typedefs, etc. +*/ +#ifndef USUALS /* Assures no redefinitions of usual types...*/ +#define USUALS + +typedef unsigned char boolean; /* values are TRUE or FALSE */ +typedef unsigned char byte; /* values are 0-255 */ +typedef byte *byteptr; /* pointer to byte */ +typedef char *string; /* pointer to ASCII character string */ +typedef unsigned short word16; /* values are 0-65535 */ +#ifdef __alpha +typedef unsigned int word32; /* values are 0-4294967295 */ +#else +typedef unsigned long word32; /* values are 0-4294967295 */ +#endif + +#ifndef TRUE +#define FALSE 0 +#define TRUE (!FALSE) +#endif /* if TRUE not already defined */ + +#ifndef min /* if min macro not already defined */ +#define min(a,b) (((a)<(b)) ? (a) : (b) ) +#define max(a,b) (((a)>(b)) ? (a) : (b) ) +#endif /* if min macro not already defined */ + +/* void for use in pointers */ +#ifndef NO_VOID_STAR +#define VOID void +#else +#define VOID char +#endif + + /* Zero-fill the byte buffer. */ +#define fill0(buffer,count) memset( buffer, 0, count ) + + /* This macro is for burning sensitive data. Many of the + file I/O routines use it for zapping buffers */ +#define burn(x) fill0((VOID *)&(x),sizeof(x)) + +#endif /* if USUALS not already defined */