00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00029 #ifndef __CCP4_TYPES
00030 #define __CCP4_TYPES
00031
00032 #include "ccp4_sysdep.h"
00033
00034 #ifdef HAVE_STDINT_H
00035 #include <stdint.h>
00036 typedef uint16_t uint16;
00037 typedef uint32_t uint32;
00038 typedef unsigned char uint8;
00039
00040 #else
00041
00042 typedef unsigned short uint16;
00043 #ifdef SIXTEENBIT
00044 typedef unsigned long uint32;
00045 #else
00046 typedef unsigned int uint32;
00047 #endif
00048 typedef unsigned char uint8;
00049 #endif
00050
00051 typedef float float32;
00052
00056 union float_uint_uchar {
00057 float32 f;
00058 uint32 i;
00059 uint8 c[4];
00060 };
00061
00063 typedef char *pstr;
00064
00065
00066
00067 #ifndef FALSE
00068 # define FALSE 0
00069 # define TRUE 1
00070 #endif
00071
00075 typedef struct { double r;
00076 double i;
00077 } COMPLEX;
00082 typedef struct { double r;
00083 double phi;
00084 } POLAR;
00086
00087
00091 #ifndef SQR
00092 # define SQR(x) ((x)*(x))
00093 #endif
00094
00099 #ifndef DEGREE
00100 # define DEGREE(x) ((((x < 0)?(x)+2*M_PI:(x))*360)/(2*M_PI))
00101 #endif
00102
00107 #ifndef RADIAN
00108 # define RADIAN(x) ((((x<0)?(x)+360:(x))*2*M_PI)/360)
00109 #endif
00110
00114 #ifndef MAX
00115 # define MAX(x, y) (((x)>(y))?(x):(y))
00116 #endif
00117
00121 #ifndef MIN
00122 # define MIN(x, y) (((x)<(y))?(x):(y))
00123 #endif
00124
00128 #ifndef ABS
00129 # define ABS(x) (((x)<0)?-(x):(x))
00130 #endif
00131
00135 #ifndef SIGN
00136 # define SIGN(x) (((x)<0)?-1:1)
00137 #endif
00138
00139 #endif
00140
00141
00142
00143
00144
00145