• Main Page
  • Related Pages
  • Classes
  • Files
  • File List
  • File Members

src/ccp4_types.h

Go to the documentation of this file.
00001 /*
00002      ccp4_types.h: CCP4 library.c macro definitions etc
00003      Copyright (C) 2001  CCLRC
00004      Copyright (C) 2007  Morten Kjeldgaard
00005 
00006      This library is free software; you can redistribute it and/or
00007      modify it under the terms of the GNU Lesser General Public
00008      License as published by the Free Software Foundation; either
00009      version 2.1 of the License, or (at your option) any later
00010      version.
00011 
00012      This library is distributed in the hope that it will be useful,
00013      but WITHOUT ANY WARRANTY; without even the implied warranty of
00014      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015      Lesser General Public License for more details.
00016 
00017      You should have received a copy of the GNU Lesser General Public
00018      License along with this library; if not, write to the Free
00019      Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020      Boston, MA 02110-1301 USA
00021 
00022 */
00023 
00029 #ifndef __CCP4_TYPES
00030 #define __CCP4_TYPES
00031 
00032 #include "ccp4_sysdep.h"
00033 
00034 typedef unsigned short uint16;
00035 #ifdef SIXTEENBIT
00036 typedef unsigned long uint32;
00037 #else
00038 typedef unsigned int uint32;
00039 #endif
00040 typedef float float32;
00041 typedef unsigned char uint8;
00042 
00046 union float_uint_uchar {
00047   float32 f;                    
00048   uint32 i;                     
00049   uint8 c[4];                   
00050   };
00051 
00053 typedef char *pstr;             
00054 
00055 /* CCP4 library.c macro definitions */
00056 
00057 #ifndef FALSE
00058 #define FALSE 0
00059 #define TRUE 1
00060 #endif
00061 
00065 typedef struct { double r;             
00066                  double i;             
00067                } COMPLEX;              
00072 typedef struct { double r;             
00073                  double phi;           
00074                } POLAR;                
00076 /* some simple macros, which may exist anyway */
00077 
00081 #ifndef SQR
00082 #define SQR(x) ((x)*(x))
00083 #endif
00084 
00089 #ifndef DEGREE
00090 #define DEGREE(x) ((((x < 0)?(x)+2*M_PI:(x))*360)/(2*M_PI))
00091 #endif
00092 
00097 #ifndef RADIAN
00098 #define RADIAN(x) ((((x<0)?(x)+360:(x))*2*M_PI)/360)
00099 #endif
00100 
00104 #ifndef MAX
00105 #define MAX(x, y) (((x)>(y))?(x):(y))
00106 #endif
00107 
00111 #ifndef MIN
00112 #define MIN(x, y) (((x)<(y))?(x):(y))
00113 #endif
00114 
00118 #ifndef ABS
00119 #define ABS(x) (((x)<0)?-(x):(x))
00120 #endif
00121 
00125 #ifndef SIGN
00126 #define SIGN(x) (((x)<0)?-1:1)
00127 #endif
00128 
00129 #endif   /* __CCP4_TYPES */
00130 
00131 /*
00132   Local variables:
00133   mode: font-lock
00134   End:
00135 */

Generated on Mon Aug 22 2011 for gpp4 by  doxygen 1.7.1