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