00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef ERRCODE_H
00021 #define ERRCODE_H
00022
00023 #include "host.h"
00024
00025
00026 #define DBG -1
00027 #define TESSLOG 0
00028 #define EXIT 1
00029 #define ABORT 2
00030
00031
00032 #define NO_ABORT_CODE 0
00033 #define LIST_ABORT 1
00034 #define MEMORY_ABORT 2
00035 #define FILE_ABORT 3
00036
00037
00038 #define LOC_UNUSED0 0
00039 #define LOC_UNUSED1 1
00040 #define LOC_UNUSED2 2
00041 #define LOC_INIT 3
00042 #define LOC_EDGE_PROG 4
00043 #define LOC_TEXT_ORD_ROWS 5
00044 #define LOC_TEXT_ORD_WORDS 6
00045 #define LOC_PASS1 7
00046 #define LOC_PASS2 8
00047
00048 #define LOC_FUZZY_SPACE 14
00049
00050 #define LOC_MM_ADAPT 21
00051 #define LOC_DOC_BLK_REJ 22
00052 #define LOC_WRITE_RESULTS 23
00053 #define LOC_ADAPTIVE 24
00054
00055
00056
00057 #define SUBLOC_NORM 0
00058 #define SUBLOC_FIX_XHT 3
00059
00060
00061
00062
00063 #define SUBSUBLOC_OTHER 0
00064 #define SUBSUBLOC_TESS 1
00065 #define SUBSUBLOC_NN 2
00066
00067 class DLLSYM ERRCODE
00068 {
00069 const char *message;
00070 public:
00071 void error (
00072 const char *caller,
00073 inT8 action,
00074 const char *format, ...
00075 ) const;
00076 ERRCODE(const char *string) {
00077 message = string;
00078 }
00079 };
00080
00081 const ERRCODE ASSERT_FAILED = "Assert failed";
00082
00083 #define ASSERT_HOST(x) if (!(x)) \
00084 { \
00085 ASSERT_FAILED.error(#x,ABORT,"in file %s, line %d", \
00086 __FILE__,__LINE__); \
00087 }
00088
00089 void signal_exit(
00090 int signal_code
00091 );
00092 extern "C"
00093 {
00094 void err_exit();
00095
00096 void signal_termination_handler(int sig);
00097 };
00098
00099 void set_global_loc_code(int loc_code);
00100
00101 void set_global_subloc_code(int loc_code);
00102
00103 void set_global_subsubloc_code(int loc_code);
00104 #endif