00001
00002
00003
00004
00005 #ifndef BALL_COMMON_GLOBAL_H
00006 #define BALL_COMMON_GLOBAL_H
00007
00008 #ifndef BALL_CONFIG_CONFIG_H
00009 # include <BALL/CONFIG/config.h>
00010 #endif
00011
00012 #include <limits.h>
00013 #include <time.h>
00014
00015 #ifdef BALL_HAS_BASETSD_H
00016 # include <basetsd.h>
00017 #endif
00018
00019
00020
00021 #ifdef BALL_HAS_STDINT_H
00022 # include <stdint.h>
00023 #endif
00024
00025
00026 #ifdef BALL_COMPILER_MSVC
00027 # pragma warning( disable : 4290 )
00028 # pragma warning( disable : 4251 ) // Warnings about DLL interface
00029 # pragma warning( disable : 4275 ) // Warnings about DLL interface (we should do something about them, though)
00030 #endif
00031
00032 #ifdef BALL_COMPILER_MSVC
00033 # define BALL_HIDE
00034 # ifdef BALL_BUILD_DLL
00035 # define BALL_EXPORT __declspec(dllexport)
00036 # define BALL_EXTERN_VARIABLE __declspec(dllexport) extern
00037 # else
00038 # define BALL_EXPORT __declspec(dllimport)
00039 # define BALL_EXTERN_VARIABLE __declspec(dllimport) extern
00040 # endif
00041 # ifdef BALL_VIEW_BUILD_DLL
00042 # define BALL_VIEW_EXPORT __declspec(dllexport)
00043 # else
00044 # define BALL_VIEW_EXPORT __declspec(dllimport)
00045 # endif
00046 #elif defined(BALL_COMPILER_GXX) && (BALL_COMPILER_VERSION_MAJOR > 4 || (BALL_COMPILER_VERSION_MAJOR == 4 && BALL_COMPILER_VERSION_MINOR >= 3))
00047 # define BALL_EXPORT __attribute((visibility ("default")))
00048 # define BALL_HIDE __attribute((visibility ("hidden")))
00049 # define BALL_VIEW_EXPORT __attribute((visibility ("default")))
00050 # define BALL_EXTERN_VARIABLE extern __attribute((visibility ("default")))
00051 #else
00052 # define BALL_EXPORT
00053 # define BALL_HIDE
00054 # define BALL_VIEW_EXPORT
00055 # define BALL_EXTERN_VARIABLE extern
00056 #endif
00057
00058
00059
00060
00061 #if defined(BALL_COMPILER_MSVC) && (_MSC_VER >= 1300)
00062 #define BALL_DEPRECATED __declspec(deprecated)
00063 #elif defined(BALL_COMPILER_GXX) && (BALL_COMPILER_VERSION_MAJOR - 0 > 3 || (BALL_COMPILER_VERSION_MAJOR - 0 == 3 && BALL_COMPILER_VERSION_MINOR - 0 >= 2))
00064 #define BALL_DEPRECATED __attribute__((deprecated))
00065 #else
00066 #define BALL_DEPRECATED
00067 #endif
00068
00069 namespace BALL
00070 {
00071
00072 typedef int (*ComparatorType)(const void *, const void *);
00073
00081
00088 typedef BALL_INDEX_TYPE Distance;
00089
00098 typedef BALL_SIZE_TYPE Handle;
00099
00107 typedef BALL_INDEX_TYPE Index;
00108
00116 typedef BALL_SIZE_TYPE Size;
00117
00125 typedef time_t Time;
00126
00133 typedef BALL_SIZE_TYPE HashIndex;
00134
00142 typedef BALL_SIZE_TYPE Position;
00143
00150 typedef float Real;
00151
00158 typedef double DoubleReal;
00159
00167 typedef BALL_SIZE_TYPE Property;
00168
00175 typedef BALL_INDEX_TYPE ErrorCode;
00176
00177
00185 typedef unsigned char Byte;
00186
00194 typedef BALL_ULONG64_TYPE LongSize;
00195
00203 typedef BALL_LONG64_TYPE LongIndex;
00204
00209 typedef BALL_POINTERSIZEUINT_TYPE PointerSizeUInt;
00210
00212
00213 enum ASCII
00214 {
00215 ASCII__BACKSPACE = '\b',
00216 ASCII__BELL = '\a',
00217 ASCII__CARRIAGE_RETURN = '\r',
00218 ASCII__HORIZONTAL_TAB = '\t',
00219 ASCII__NEWLINE = '\n',
00220 ASCII__RETURN = ASCII__NEWLINE,
00221 ASCII__SPACE = ' ',
00222 ASCII__TAB = ASCII__HORIZONTAL_TAB,
00223 ASCII__VERTICAL_TAB = '\v',
00224
00225 ASCII__COLON = ':',
00226 ASCII__COMMA = ',',
00227 ASCII__EXCLAMATION_MARK = '!',
00228 ASCII__POINT = '.',
00229 ASCII__QUESTION_MARK = '?',
00230 ASCII__SEMICOLON = ';'
00231 };
00232
00233 static const Distance INVALID_DISTANCE = INT_MIN;
00234 static const Distance DISTANCE_MIN = (INT_MIN + 1);
00235 static const Distance DISTANCE_MAX = INT_MAX;
00236
00237 static const Handle INVALID_HANDLE = INT_MAX;
00238 static const Handle HANDLE_MIN = 0 ;
00239 static const Handle HANDLE_MAX = INT_MAX - 1;
00240
00241 static const Index INVALID_INDEX = -1;
00242 static const Index INDEX_MIN = 0;
00243 static const Index INDEX_MAX = INT_MAX;
00244
00245 static const Position INVALID_POSITION = INT_MAX;
00246 static const Position POSITION_MIN = 0;
00247 static const Position POSITION_MAX = INT_MAX - 1;
00248
00249 # undef SIZE_MAX
00250 static const Size INVALID_SIZE = INT_MAX;
00251 static const Size SIZE_MIN = 0;
00252 static const Size SIZE_MAX = INT_MAX - 1;
00253
00254
00255 }
00256
00257 #endif // BALL_COMMON_GLOBAL_H