00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00026 #ifndef DEFS_H
00027 #define DEFS_H
00028
00029
00030 #ifdef __WIN32__
00031 # include "winconfig.h"
00032 #else
00033 # ifdef HAVE_CONFIG_H
00034 # include <config.h>
00035 # endif
00036 #endif
00037
00038 #include <iostream>
00039 #include <iomanip>
00040
00041 #include "debug.h"
00042
00043
00044
00046 #define DEFAULT_FILE_SUFFIX ".e"
00047
00048
00049
00055 #define FILE_STAMP "EX"
00056
00057
00058
00059
00063
00064
00065
00066
00070 #define B_BITS 32
00071
00072
00073
00077 #define F_BITS 27
00078
00079 #if B_BITS < F_BITS + 2
00080 #error : Code bits must be at least freq bits + 2
00081 #endif
00082
00083
00084
00094 #define FRUGAL_BITS 1
00095
00096
00097
00101 #define SEQUENTIAL_ALGORITHM
00102
00103
00104
00105
00106
00112 enum UserAction
00113 {
00119 Compress,
00120
00126 Decompress,
00127
00133 WellFormed,
00134 };
00135
00136
00137
00139
00140
00141
00149 #define OUTPUT(x) std::cout << x
00150
00151
00152
00160 #define OUTPUTNL(x) OUTPUT(x << std::endl)
00161
00162
00163
00169 #define OUTPUTENDLINE std::cout << std::endl
00170
00171
00172
00180 #define OUTPUTE(x) std::cerr << x
00181
00182
00183
00191 #define OUTPUTENL(x) OUTPUTE(x << std::endl)
00192
00193
00194
00202 #define OUTPUTEENDLINE std::cerr << std::endl
00203
00204
00205
00213 #define WRN(x) std::cerr << "[WARNING] " << x << std::endl
00214
00215
00216
00224 #define ERR(x) std::cerr << "[ERROR] " << x << std::endl
00225
00226
00227
00235 #define FATAL(x) \
00236 { \
00237 PRINT_SOURCE_POSITION; \
00238 std::cerr << "[FATAL ERROR] " << x << std::endl \
00239 << "Aborting." << std::endl; \
00240 throw ExaltFatalErrorException(); \
00241 }
00242
00243
00244
00252 #define PARSERERR(x) std::cerr << std::endl << "[PARSE ERROR] " << x << std::endl
00253
00254
00256 #define AMP_REPLACEMENT 6
00257
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277 #endif //DEFS_H