ccutil/host.h

Go to the documentation of this file.
00001 
00041 #ifndef   __HOST__
00042 #define   __HOST__
00043 
00044 /*
00045 ** Include automatically generated configuration file if running autoconf
00046 */
00047 #ifdef HAVE_CONFIG_H
00048 #include "config_auto.h"
00049 #if defined(MOTOROLA_BYTE_ORDER) || defined(WORDS_BIGENDIAN)
00050 #define __MOTO__  // Big-endian.
00051 #endif
00052 #endif
00053 
00054 
00069 #include "platform.h"
00070 /* __MSW32__ */
00071 #ifdef __MSW32__
00072 #include <windows.h>
00073 #include <winbase.h>             // winbase.h contains windows.h
00074 
00075 #define DLLIMPORT __declspec( dllimport)
00076 #define DLLEXPORT __declspec( dllexport)
00077 
00078 typedef HANDLE FILE_HANDLE;
00079 typedef HANDLE MEMORY_HANDLE;
00080 
00081 #else
00082 /********************************************************/
00083 /* __MSW__ */
00084 #ifdef __MSW__
00085 #include <windows.h>             // provides standard definitions (like HANDLE)
00086 
00087 #define DLLIMPORT __import
00088 #define DLLEXPORT __export
00089 /* =============================== */
00090 typedef HANDLE FILE_HANDLE;
00091 typedef HANDLE MEMORY_HANDLE;
00092 /* =============================== */
00093 #ifndef BOOLEAN
00094 typedef UINT16 BOOLEAN;
00095 #endif                           // BOOLEAN
00096 #endif
00097 #endif
00098 
00099 /********************************************************/
00100 /* __MAC__ */
00101 #ifdef __MAC__
00102 #include <Types.h>
00103 /* =============================== */
00104 #define DLLIMPORT
00105 #define DLLEXPORT
00106 
00107 // definitions of handles to relocatable blocks
00108 typedef Handle HANDLE;           // a handle to a relocatable memory block
00109 
00110 typedef short FILE_HANDLE;
00111 typedef Handle MEMORY_HANDLE;
00112 /* =============================== */
00113 #ifndef BOOLEAN
00114 #define BOOLEAN        Boolean
00115 #endif
00116 #endif
00117 /********************************************************/
00118 #if defined(__UNIX__) || defined( __DOS__ ) || defined(__OS2__) || defined(__PM__)
00119 /* =============================== */
00120 /* FarProc and FarData */
00121 /* =============================== */
00122 #define DLLIMPORT
00123 #define DLLEXPORT
00124 
00128 typedef void *HANDLE;
00133 typedef HANDLE FILE_HANDLE;
00138 typedef HANDLE MEMORY_HANDLE;
00139 /* =============================== */
00140 #ifndef BOOLEAN
00141 
00145 typedef unsigned short BOOLEAN;
00146 #endif                           // BOOLEAN
00147 #endif
00148 
00149 /*
00150 Standard GHC Definitions
00151 */
00152 #ifdef __MOTO__
00153 #define __NATIVE__   MOTO
00154 #else
00155 #define __NATIVE__   INTEL
00156 #endif
00157 
00158 //typedef HANDLE FD*  PHANDLE;
00159 
00160 // definitions of portable data types (numbers and characters)
00161 #if (_MSC_VER < 1400)  // For VC 8.0.
00162 typedef SIGNED char INT8;
00163 #endif
00164 typedef unsigned char UINT8;
00165 typedef short INT16;
00166 typedef unsigned short UINT16;
00167 #if (_MSC_VER < 1200)            //%%% vkr for VC 6.0
00168 typedef int INT32;
00169 typedef unsigned int UINT32;
00170 #endif                           //%%% vkr for VC 6.0
00171 typedef float FLOAT32;
00172 typedef double FLOAT64;
00173 typedef unsigned char BOOL8;
00174 
00175 // definitions of pointers to portable data types
00176 #if (_MSC_VER < 1400)  // For VC 8.0.
00177 typedef SIGNED char *PINT8;
00178 #endif
00179 typedef unsigned char *PUINT8;
00180 typedef short *PINT16;
00181 typedef unsigned short *PUINT16;
00182 #if (_MSC_VER < 1200)            //%%% vkr for VC 6.0
00183 typedef int *PINT32;
00184 typedef unsigned int *PUINT32;
00185 #endif                           //%%% vkr for VC 6.0
00186 typedef float *PFLOAT32;
00187 typedef double *PFLOAT64;
00188 
00189 // these are pointers to constant values (not constant pointers)
00190 
00191 typedef const SIGNED char *PCINT8;
00192 typedef const unsigned char *PCUINT8;
00193 typedef const short *PCINT16;
00194 typedef const unsigned short *PCUINT16;
00195 typedef const int *PCINT32;
00196 typedef const unsigned int *PCUINT32;
00197 typedef const float *PCFLOAT32;
00198 typedef const double *PCFLOAT64;
00199 
00200 typedef void *PVOID;
00201 
00202 #define INT32FORMAT "%d"
00203 
00204 #define MAX_INT8  0x7f
00205 #define MAX_INT16 0x7fff
00206 #define MAX_INT32 0x7fffffff
00207 #define MAX_UINT8 0xff
00208 #define MAX_UINT16  0xffff
00209 #define MAX_UINT32  0xffffffff
00210 #define MAX_FLOAT32 ((float)3.40282347e+38)
00211 
00212 #define MIN_INT8  0x80
00213 #define MIN_INT16 0x8000
00214 #define MIN_INT32 0x80000000
00215 #define MIN_UINT8 0x00
00216 #define MIN_UINT16  0x0000
00217 #define MIN_UINT32  0x00000000
00218 #define MIN_FLOAT32 ((float)1.17549435e-38)
00219 
00220 // Defines
00221 
00222 #ifndef OKAY
00223 #define OKAY            0
00224 #endif
00225 
00226 #ifndef HPERR
00227 #define HPERR           -1
00228 #endif
00229 
00230 #ifndef TRUE
00231 #define TRUE            1
00232 #endif
00233 
00234 #ifndef FALSE
00235 #define FALSE           0
00236 #endif
00237 
00238 #ifndef NULL
00239 #define NULL            0L
00240 #endif
00241 
00242 /*
00243 ===============================================================
00244                            WARNING!!
00245 Below are definition that will be obsoleted in the next version.
00246 Please do not continue to use the definition under __OLDCODE__.
00247 ===============================================================
00248 */
00249 #ifdef __OLDCODE__
00250 #ifdef __MSW32__
00251 
00252 #ifdef  ERROR                    // Use HPERR
00253 #undef  ERROR
00254 #define ERROR -1
00255 #endif
00256 
00257 typedef double FLOATHP;
00258 #else
00259 
00260 #ifdef __MSW__
00261 #ifdef  ERROR                    // Use HPERR
00262 #undef  ERROR
00263 #define ERROR -1
00264 #endif
00265 typedef double FLOAT;
00266 typedef double FLOATHP;
00267 typedef FLOAT FD *PFLOAT;
00268 #endif
00269 #endif
00270 #ifdef __MAC__
00271 typedef float FLOAT;
00272 typedef float FLOATHP;
00273 typedef FLOAT FD *PFLOAT;
00274 #endif
00275 
00276 #ifdef __UNIX__
00277 typedef float FLOAT;
00278 typedef float FLOATHP;
00279 typedef FLOAT FD *PFLOAT;
00280 #endif
00281 
00282 #ifdef __DOS__
00283 typedef float FLOAT;
00284 typedef float FLOATHP;
00285 typedef FLOAT FD *PFLOAT;
00286 #endif
00287 
00288 // definitions of pointers to functions that take no parameters
00289 // specific definitions should be provided for functions that take parameters
00290 
00291 typedef void (far * PFVOID) ();  /* pointer to function */
00292 typedef INT16 (*PFINT16) (void);
00293 typedef INT32 (*PFINT32) (void);
00294 
00295 typedef BOOLEAN *PBOOLEAN;       // a pointer to a Boolean
00296 #endif
00297 #endif

Generated on Wed Feb 28 19:49:09 2007 for Tesseract by  doxygen 1.5.1