blob: 202a5d658c504b1c324b11872b3e1ff0f45ebfc3 [file] [log] [blame]
Dees_Troy83bd4832013-05-04 12:39:56 +00001/*
2------------------------------------------------------------------------------
3Standard definitions and types, Bob Jenkins
4------------------------------------------------------------------------------
5*/
6#ifndef STANDARD
7# define STANDARD
8# ifndef STDIO
9# include <stdio.h>
10# define STDIO
11# endif
12# ifndef STDDEF
13# include <stddef.h>
14# define STDDEF
15# endif
16typedef unsigned long long ub8;
17#define UB8MAXVAL 0xffffffffffffffffLL
18#define UB8BITS 64
19typedef signed long long sb8;
20#define SB8MAXVAL 0x7fffffffffffffffLL
21typedef unsigned long int ub4; /* unsigned 4-byte quantities */
22#define UB4MAXVAL 0xffffffff
23typedef signed long int sb4;
24#define UB4BITS 32
25#define SB4MAXVAL 0x7fffffff
26typedef unsigned short int ub2;
27#define UB2MAXVAL 0xffff
28#define UB2BITS 16
29typedef signed short int sb2;
30#define SB2MAXVAL 0x7fff
31typedef unsigned char ub1;
32#define UB1MAXVAL 0xff
33#define UB1BITS 8
34typedef signed char sb1; /* signed 1-byte quantities */
35#define SB1MAXVAL 0x7f
36typedef int word; /* fastest type available */
37
38#define bis(target,mask) ((target) |= (mask))
39#define bic(target,mask) ((target) &= ~(mask))
40#define bit(target,mask) ((target) & (mask))
41#ifndef min
42# define min(a,b) (((a)<(b)) ? (a) : (b))
43#endif /* min */
44#ifndef max
45# define max(a,b) (((a)<(b)) ? (b) : (a))
46#endif /* max */
47#ifndef align
48# define align(a) (((ub4)a+(sizeof(void *)-1))&(~(sizeof(void *)-1)))
49#endif /* align */
50#ifndef abs
51# define abs(a) (((a)>0) ? (a) : -(a))
52#endif
53#define TRUE 1
54#define FALSE 0
55#define SUCCESS 0 /* 1 on VAX */
56
57#endif /* STANDARD */