00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00030 #ifndef __CCP4_BITS
00031 #define __CCP4_BITS
00032
00033 #if defined (_AIX) || defined(___AIX)
00034 # define KNOWN_MACHINE
00035 # define CALL_LIKE_HPUX 1
00036 #endif
00037
00038 #if defined (__hpux)
00039 # define KNOWN_MACHINE
00040 # define CALL_LIKE_HPUX 1
00041 #endif
00042
00043 #ifdef __sgi
00044 # ifndef sgi
00045 # define sgi
00046 # endif
00047 #endif
00048
00049 #if defined (sgi)
00050 # define KNOWN_MACHINE
00051 # define CALL_LIKE_SUN 1
00052 #endif
00053
00054 #if defined (sun) || defined (__sun)
00055 # define KNOWN_MACHINE
00056 # define CALL_LIKE_SUN 1
00057 # if !defined(__STDC__) || defined(__GNUC__)
00058 # if !defined(G77)
00059 extern char *sys_errlist [];
00060 # define strerror(i) sys_errlist[i]
00061 # endif
00062 # endif
00063 #endif
00064
00065 #if defined(__OSF1__) || defined(__osf__)
00066 # define KNOWN_MACHINE
00067 # define CALL_LIKE_SUN 1
00068 #endif
00069
00070 #ifndef VMS
00071 # if defined (vms) || defined (__vms) || defined (__VMS)
00072 # define VMS
00073 # endif
00074 #endif
00075 #if defined (VMS)
00076 # define KNOWN_MACHINE
00077 # define CALL_LIKE_VMS 1
00078 #endif
00079
00080 #if defined(_MSC_VER) || defined (WIN32)
00081 # if defined (_MSC_VER) && (_MSC_VER >= 800)
00082 # define CALL_LIKE_MVS 2
00083 # else
00084 # define CALL_LIKE_MVS 1
00085 # endif
00086 # define KNOWN_MACHINE
00087 #endif
00088
00089 #if defined (linux) || defined __linux__ || defined (__CYGWIN__)
00090 # undef CALL_LIKE_SUN
00091 # define KNOWN_MACHINE
00092 # define CALL_LIKE_SUN 1
00093 #endif
00094
00095 #if defined __linux__ && ( defined __PPC || defined __PPC__ )
00096 # undef CALL_LIKE_SUN
00097 # define KNOWN_MACHINE
00098 # define CALL_LIKE_SUN 1
00099 #endif
00100
00101 #if defined (__FreeBSD__)
00102 # undef CALL_LIKE_SUN
00103 # define KNOWN_MACHINE
00104 # define CALL_LIKE_SUN 1
00105 #endif
00106
00107 #if defined(F2C) || defined(G77)
00108 # undef CALL_LIKE_SUN
00109 # define CALL_LIKE_SUN 1
00110 # define KNOWN_MACHINE
00111 #endif
00112
00113 #if defined(__APPLE__)
00114 # undef CALL_LIKE_SUN
00115 # define CALL_LIKE_SUN 1
00116 # define KNOWN_MACHINE
00117 #endif
00118
00119 #if defined (_CALL_SYSV) && ! defined (__APPLE__)
00120 # undef CALL_LIKE_SUN
00121 # define CALL_LIKE_SUN 1
00122 # define KNOWN_MACHINE
00123 #endif
00124
00125 #if ! defined (KNOWN_MACHINE)
00126 # error System type is not known -- see the Installation Guide
00127 #else
00128
00129 #ifndef _POSIX_SOURCE
00130 #define _POSIX_SOURCE
00131 #endif
00132
00133
00134 #ifndef _XOPEN_SOURCE
00135 #define _XOPEN_SOURCE
00136 #endif
00137
00138 #include <stdio.h>
00139
00140 #if defined (VMS)
00141 # include <descrip.h>
00142 # define NOUNISTD
00143 #else
00144 # include <sys/types.h>
00145 # include <sys/stat.h>
00146 # if !defined (_WIN32) && !defined (_MSC_VER)
00147 # include <sys/times.h>
00148 # endif
00149 # ifdef _MSC_VER
00150 # define NOUNISTD
00151 # endif
00152 #endif
00153
00154 #include <stddef.h>
00155 #include <string.h>
00156
00157 #ifndef NOUNISTD
00158 # include <unistd.h>
00159 #else
00160 # ifndef VMS
00161 # ifndef _MSC_VER
00162 # include <sys/file.h>
00163 # endif
00164 # endif
00165 #endif
00166 #ifndef NOSTDLIB
00167 # include <stdlib.h>
00168 #endif
00169
00170 #include <errno.h>
00171 #include <ctype.h>
00172
00173 #if defined(_AIX) || defined (__hpux) || defined(F2C) ||\
00174 defined(G77) || defined(_WIN32) || defined (sun)
00175 # include <time.h>
00176 #endif
00177
00178 #include <limits.h>
00179 #include <float.h>
00180
00181 #if defined (F2C)
00182 # define Skip_f2c_Undefs
00183 # include "f2c.h"
00184 #endif
00185 #if defined (G77)
00186 # define Skip_f2c_Undefs
00187 # if defined (HAVE_G2C_H)
00188 # include "g2c.h"
00189 # endif
00190 #endif
00191
00192
00193
00194 # if ((defined _WIN32) || (defined _MSC_VER)) && (!defined rint)
00195 double rint(double x);
00196 #endif
00197
00198 #ifdef _MSC_VER
00199 #define M_PI 3.14159265358979323846
00200 #endif
00201
00202 #ifdef _MSC_VER
00203 # define PATH_SEPARATOR '\\'
00204 # define EXT_SEPARATOR '.'
00205 #else
00206 # define PATH_SEPARATOR '/'
00207 # define EXT_SEPARATOR '.'
00208 #endif
00209
00210 #define MAXFLEN 512
00211 #define MAXFILES 16
00212 #define DEFMODE 2
00214 #define IRRELEVANT_OP 0
00215 #define READ_OP 1
00216 #define WRITE_OP 2
00217
00218 #include<fcntl.h>
00219 #ifndef SEEK_SET
00220 # define SEEK_SET 0
00221 # define SEEK_CUR 1
00222 # define SEEK_END 2
00223 #endif
00224 #ifndef O_WRONLY
00225 #define O_RDONLY 0x0000
00226 #define O_WRONLY 0x0001
00227 #define O_RDWR 0x0002
00228 #define O_APPEND 0x0008
00229 #define O_CREAT 0x0200
00230 #define O_TRUNC 0x0400
00231 #endif
00232 #define O_TMP 0x0010
00234 #define BYTE 0
00235 #define INT16 1
00236 #define INT32 6
00237 #define FLOAT32 2
00238 #define COMP32 3
00239 #define COMP64 4
00240
00241 #define DFNTI_MBO 1
00242 #define DFNTI_IBO 4
00244 #define DFNTF_BEIEEE 1
00245 #define DFNTF_VAX 2
00246 #define DFNTF_CONVEXNATIVE 5
00247 #define DFNTF_LEIEEE 4
00249 #if defined (VAX) || defined (vax)
00250 # define NATIVEFT DFNTF_VAX
00251 # define NATIVEIT DFNTI_IBO
00252 #endif
00253
00254 #if defined(MIPSEL) || defined(i386) || defined(i860) || defined(__ia64__) || defined(__amd64__) || defined(__x86_64__) || defined(WIN32)
00255 # define NATIVEIT DFNTI_IBO
00256 # define NATIVEFT DFNTF_LEIEEE
00257 #endif
00258
00259 #if defined(__ARMEL__)
00260 # define NATIVEIT DFNTI_IBO
00261 # define NATIVEFT DFNTF_LEIEEE
00262 #endif
00263
00264 #if defined (powerpc) || defined (__ppc__) || defined __PPC
00265 # define NATIVEIT DFNTI_MBO
00266 # define NATIVEFT DFNTF_BEIEEE
00267 #endif
00268
00269 #ifdef __alpha
00270 # ifdef VMS
00271 # if __IEEE_FLOAT == 1
00272 # define NATIVEFT DFNTF_LEIEEE
00273 # else
00274 # define NATIVEFT DFNTF_VAX
00275 # endif
00276 # else
00277 # define NATIVEFT DFNTF_LEIEEE
00278 # endif
00279 # define NATIVEIT DFNTI_IBO
00280 #endif
00281
00282 #if defined(MIPSEB) || defined(__hpux) || defined(_AIX) || defined(m68k) || defined(mc68000) || defined(sparc) || defined (__sparc__)
00283 # define NATIVEIT DFNTI_MBO
00284 # define NATIVEFT DFNTF_BEIEEE
00285 #endif
00286
00287 #if defined (__hppa__)
00288 # define NATIVEIT DFNTI_MBO
00289 # define NATIVEFT DFNTF_BEIEEE
00290 #endif
00291
00292 #ifndef NATIVEFT
00293 # error "Can't determine machine number format"
00294 #endif
00295
00296 #define DFNT_UINT 0
00297 #define DFNT_SINT 1
00298 #define DFNT_INT 2
00299 #define DFNT_UCHAR 3
00300 #define DFNT_CHAR 4
00301 #define DFNT_FLOAT 5
00302 #define DFNT_DOUBLE 6
00304 #endif
00305
00306 #endif
00307
00308
00309
00310
00311
00312