00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __DEFS_INCLUDED
00018 #define __DEFS_INCLUDED
00019
00020
00021
00022
00023
00024
00025
00026 #ifdef HAVE_CONFIG_H // for unix systems only
00027 #include "../config.h"
00028 #define OS_UNIX
00029 #else // windows
00030 #define VERSION "0.1.2"
00031 #define PACKAGE "stellarlegacy"
00032 #define OS_WINDOWS
00033 #endif
00034
00035
00036
00037
00038
00039 #define SECURE_MODE
00040
00041 #define LOG_ENABLED // comment if you don't want to have a lock file
00042
00043
00044
00045 #ifdef LOG_ENABLED // switch on the log system
00046 #include <fstream>
00047
00048
00049 extern int iIndentNumber;
00050 extern std::ofstream* logout;
00051
00052 #define LOG(x,y) if ( logout == 0 ) logout = new ofstream("log.out"); \
00053 *logout << ":::" << x << ", " << y << ", normal, " << iIndentNumber << ", "
00054 #define WLOG(x,y) if ( logout == 0 ) logout = new ofstream("log.out"); \
00055 *logout << ":::" << x << ", " << y << ", warning, " << iIndentNumber << ", "
00056 #define ELOG(x,y) if ( logout == 0 ) logout = new ofstream("log.out"); \
00057 *logout << ":::" << x << ", " << y << ", error, " << iIndentNumber << ", "
00058 #define LOG_BEGIN_INDENT(); iIndentNumber++;
00059 #define LOG_END_INDENT(); if ( iIndentNumber > 0 ) iIndentNumber--;
00060 #else // all log output to stderr
00061 #define LOG(x,y) cerr << x << ", " << y << ", normal, "
00062 #define LOG_BEGIN_INDENT(); ;
00063 #define LOG_END_INDENT(); ;
00064 #define WLOG(x,y) cerr << x << ", " << y << ", warning, "
00065 #define ELOG(x,y) cerr << x << ", " << y << ", error, "
00066 #endif
00067
00068
00069
00070
00071
00072
00073
00074 const int FAILED = -1;
00075
00076
00077
00078
00079
00080
00081
00082 typedef unsigned char byte;
00087 typedef short int int2;
00088 typedef long int int4;
00089 typedef unsigned short int uint2;
00090 typedef unsigned long int uint4;
00091
00092
00093
00094
00095
00096 #endif // __DEFS_INCLUDED