Main Page   Compound List   File List   Compound Members   File Members   Related Pages  

ccp4_sysdep.h

Go to the documentation of this file.
00001 /*
00002      ccp4_sysdep.h: System-dependent definitions
00003      Copyright (C) 2001  CCLRC
00004 
00005      This library is free software and is distributed under the terms and
00006      conditions of the CCP4 licence agreement as `Part 0' (Annex 2)
00007      software, which is version 2.1 of the GNU Lesser General Public
00008      Licence (LGPL) with the following additional clause:
00009 
00010         `You may also combine or link a "work that uses the Library" to
00011         produce a work containing portions of the Library, and distribute
00012         that work under terms of your choice, provided that you give
00013         prominent notice with each copy of the work that the specified
00014         version of the Library is used in it, and that you include or
00015         provide public access to the complete corresponding
00016         machine-readable source code for the Library including whatever
00017         changes were used in the work. (i.e. If you make changes to the
00018         Library you must distribute those, but you do not need to
00019         distribute source or object code to those portions of the work
00020         not covered by this licence.)'
00021 
00022      Note that this clause grants an additional right and does not impose
00023      any additional restriction, and so does not affect compatibility
00024      with the GNU General Public Licence (GPL). If you wish to negotiate
00025      other terms, please contact the maintainer.
00026 
00027      You can redistribute it and/or modify the library under the terms of
00028      the GNU Lesser General Public License as published by the Free Software
00029      Foundation; either version 2.1 of the License, or (at your option) any
00030      later version.
00031 
00032      This library is distributed in the hope that it will be useful, but
00033      WITHOUT ANY WARRANTY; without even the implied warranty of
00034      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00035      Lesser General Public License for more details.
00036 
00037      You should have received a copy of the CCP4 licence and/or GNU
00038      Lesser General Public License along with this library; if not, write
00039      to the CCP4 Secretary, Daresbury Laboratory, Warrington WA4 4AD, UK.
00040      The GNU Lesser General Public can also be obtained by writing to the
00041      Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00042      MA 02111-1307 USA
00043 */
00044 
00052 #ifndef __CCP4_BITS
00053 #define __CCP4_BITS
00054 
00055 #if defined (_AIX) || defined(___AIX)
00056 #  define KNOWN_MACHINE
00057 #  define CALL_LIKE_SUN 1
00058 #endif
00059 
00060 #if defined (__hpux) 
00061 #  define KNOWN_MACHINE
00062 #  define CALL_LIKE_HPUX 1
00063 #endif
00064 
00065 #ifdef __sgi   /* in ANSI mode */
00066 #  ifndef sgi
00067 #    define sgi
00068 #  endif
00069 #endif
00070 
00071 #if defined (sgi)
00072 #  define KNOWN_MACHINE
00073 #  define CALL_LIKE_SUN 1
00074 #endif
00075 
00076 #if defined (sun) || defined (__sun)
00077 #  define KNOWN_MACHINE
00078 #  define CALL_LIKE_SUN 1
00079 #  if !defined(__STDC__) || defined(__GNUC__)
00080 #    if !defined(G77)
00081       extern char *sys_errlist [];
00082 #     define strerror(i) sys_errlist[i] /* k&r compiler doesn't have it */
00083 #    endif
00084 #  endif
00085 #endif
00086 
00087 #if defined(__OSF1__) || defined(__osf__)
00088 #  define KNOWN_MACHINE
00089 #  define CALL_LIKE_SUN 1
00090 #endif
00091 
00092 #ifndef VMS
00093 #  if defined (vms) || defined (__vms) || defined (__VMS)
00094 #    define VMS
00095 #  endif
00096 #endif
00097 #if defined (VMS)
00098 #  define KNOWN_MACHINE
00099 #  define CALL_LIKE_VMS 1
00100 #endif
00101 
00102 #if defined(_MVS) || defined (WIN32)
00103 #  define CALL_LIKE_MVS 1
00104 #  define KNOWN_MACHINE
00105 #endif
00106 
00107 #if defined (linux)
00108 #  undef CALL_LIKE_SUN
00109 #  define KNOWN_MACHINE
00110 #  define CALL_LIKE_SUN 1
00111 #endif
00112 
00113 #if defined (__FreeBSD__)
00114 #  undef CALL_LIKE_SUN
00115 #  define KNOWN_MACHINE
00116 #  define CALL_LIKE_SUN 1
00117 #endif
00118 
00119 #if defined(F2C) || defined(G77)
00120 #  undef CALL_LIKE_SUN
00121 #  define CALL_LIKE_SUN 1
00122 #  define KNOWN_MACHINE
00123 #endif
00124 
00125 #if defined(__APPLE__)
00126 #  undef CALL_LIKE_SUN
00127 #  define CALL_LIKE_SUN 1
00128 #  define KNOWN_MACHINE
00129 #endif
00130 
00131 #if ! defined (KNOWN_MACHINE)
00132 #  error System type is not known -- see the Installation Guide
00133 #else
00134 
00135 #ifndef _POSIX_SOURCE
00136 #define _POSIX_SOURCE
00137 #endif
00138 
00139 /* include X/Open Unix extensions (e.g. cuserid) */
00140 #ifndef _XOPEN_SOURCE
00141 #define _XOPEN_SOURCE
00142 #endif
00143 
00144 #include <stdio.h>
00145 
00146 #if defined (VMS)
00147 #  include <descrip.h>          /* non-POSIX */
00148 #  define NOUNISTD
00149 #else
00150 #  include <sys/types.h>
00151 #  include <sys/stat.h>
00152 #  if !defined (_WIN32) && !defined (_MVS)
00153 #    include <sys/times.h>
00154 #  endif
00155 #  ifdef _MVS
00156 #    define NOUNISTD
00157 #  endif
00158 #endif
00159 
00160 #include <stddef.h>
00161 #include <string.h>
00162 
00163 #ifndef NOUNISTD
00164 #  include <unistd.h>
00165 #else
00166 #  ifndef VMS 
00167 #    ifndef _MVS
00168 #      include <sys/file.h>     /* ESV, old Concentrix */ /* non-POSIX */
00169 #    endif
00170 #  endif
00171 #endif
00172 #ifndef NOSTDLIB                /* for TitanOS 4.2, at least? */
00173 #  include <stdlib.h>
00174 #endif
00175 
00176 #include <errno.h>
00177 #include <ctype.h>
00178 
00179 #if defined(_AIX) || defined (__hpux) || defined(F2C) ||\
00180     defined(G77) || defined(_WIN32)/* would do no harm on others, though */
00181 #  include <time.h>
00182 #endif
00183 
00184 #include <limits.h>
00185 #include <float.h>
00186 
00187 #if defined (F2C)
00188 #  define Skip_f2c_Undefs
00189 #  include "f2c.h"
00190 #endif
00191 #if defined (G77)
00192 #  define Skip_f2c_Undefs       /* g2c.h infelicity... */
00193 #  if defined (HAVE_G2C_H)
00194 #    include "g2c.h"
00195 #  else
00196 #    include "f2c.h"
00197 #  endif
00198 #endif
00199 
00200 /* rint() function does not seen to exist for mingw32
00201    defined in library_utils.c */
00202 #  if (defined _WIN32) || (defined _MVS)
00203   double rint(double x);
00204 #endif
00205 
00206 #ifdef _MVS
00207 #define  M_PI            3.14159265358979323846
00208 #endif
00209 
00210 #ifdef _MVS
00211 #  define PATH_SEPARATOR '\\'
00212 #  define EXT_SEPARATOR '.'
00213 #else
00214 #  define PATH_SEPARATOR '/'
00215 #  define EXT_SEPARATOR '.'
00216 #endif
00217 
00218 #define MAXFLEN       512    
00219 #define MAXFILES       16    
00220 #define DEFMODE         2    
00222 #define IRRELEVANT_OP   0
00223 #define READ_OP         1
00224 #define WRITE_OP        2
00225 
00226 #include<fcntl.h>
00227 #ifndef SEEK_SET
00228 #  define SEEK_SET 0
00229 #  define SEEK_CUR 1
00230 #  define SEEK_END 2
00231 #endif /* ! SEEK_SET */
00232 #ifndef O_WRONLY
00233 #define O_RDONLY 0x0000       
00234 #define O_WRONLY 0x0001       
00235 #define O_RDWR   0x0002       
00236 #define O_APPEND 0x0008       
00237 #define O_CREAT  0x0200       
00238 #define O_TRUNC  0x0400       
00239 #endif
00240 #define O_TMP    0x0010       
00242 #define BYTE  0
00243 #define INT16 1   
00244 #define INT32 6
00245 #define FLOAT32 2
00246 #define COMP32  3
00247 #define COMP64  4
00248 
00249 #define DFNTI_MBO       1       
00250 #define DFNTI_IBO       4       
00252 #define DFNTF_BEIEEE    1       
00253 #define DFNTF_VAX       2       
00254 #define DFNTF_CONVEXNATIVE 5    
00255 #define DFNTF_LEIEEE    4       
00257 #if defined (VAX) || defined (vax) /* gcc seems to use vax */
00258 #  define NATIVEFT DFNTF_VAX
00259 #  define NATIVEIT DFNTI_IBO
00260 #endif
00261 
00262 #if defined(MIPSEL) || defined(i386) || defined(i860) || defined(__ia64__) || defined(__amd64__) || defined(__x86_64__)
00263 #  define NATIVEIT DFNTI_IBO
00264 #  define NATIVEFT DFNTF_LEIEEE
00265 #endif
00266 
00267 #if defined (powerpc) || defined (__ppc__)
00268 #  define NATIVEIT DFNTI_MBO
00269 #  define NATIVEFT DFNTF_BEIEEE
00270 #endif
00271 
00272 #ifdef __alpha
00273 #  ifdef VMS
00274 #    if __IEEE_FLOAT == 1
00275 #      define NATIVEFT DFNTF_LEIEEE
00276 #    else
00277 #      define NATIVEFT DFNTF_VAX
00278 #    endif
00279 #  else                       /* assume OSF/1 */
00280 #    define NATIVEFT DFNTF_LEIEEE
00281 #  endif
00282 #  define NATIVEIT DFNTI_IBO
00283 #endif
00284 
00285 #if defined(MIPSEB) || defined(__hpux) || defined(_AIX) || defined(m68k) || defined(mc68000) || defined(sparc) || defined (__sparc__)
00286 #  define NATIVEIT DFNTI_MBO
00287 #  define NATIVEFT DFNTF_BEIEEE
00288 #endif
00289 
00290 #ifndef NATIVEFT
00291 #  error "Can't determine machine number format"
00292 #endif
00293 
00294 #define DFNT_UINT       0       
00295 #define DFNT_SINT       1       
00296 #define DFNT_INT        2       
00297 #define DFNT_UCHAR      3       
00298 #define DFNT_CHAR       4       
00299 #define DFNT_FLOAT      5       
00300 #define DFNT_DOUBLE     6       
00302 #endif
00303 
00304 #endif /* __CCP4_BITS */