tesseract  5.0.0-alpha-619-ge9db
errcode.h File Reference

Go to the source code of this file.

Classes

class  ERRCODE
 

Macros

#define NO_ABORT_CODE   0
 
#define LIST_ABORT   1
 
#define MEMORY_ABORT   2
 
#define FILE_ABORT   3
 
#define LOC_UNUSED0   0
 
#define LOC_UNUSED1   1
 
#define LOC_UNUSED2   2
 
#define LOC_INIT   3
 
#define LOC_EDGE_PROG   4
 
#define LOC_TEXT_ORD_ROWS   5
 
#define LOC_TEXT_ORD_WORDS   6
 
#define LOC_PASS1   7
 
#define LOC_PASS2   8
 
#define LOC_FUZZY_SPACE   14
 
#define LOC_MM_ADAPT   21
 
#define LOC_DOC_BLK_REJ   22
 
#define LOC_WRITE_RESULTS   23
 
#define LOC_ADAPTIVE   24
 
#define SUBLOC_NORM   0
 
#define SUBLOC_FIX_XHT   3
 
#define SUBSUBLOC_OTHER   0
 
#define SUBSUBLOC_TESS   1
 
#define SUBSUBLOC_NN   2
 
#define DO_NOTHING   (void)(0)
 
#define ASSERT_HOST(x)
 
#define ASSERT_HOST_MSG(x, ...)
 

Enumerations

enum  TessErrorLogCode { DBG = -1, TESSLOG = 0, TESSEXIT = 1, ABORT = 2 }
 

Functions

constexpr ERRCODE ASSERT_FAILED ("Assert failed")
 
void signal_exit (int signal_code)
 
void set_global_loc_code (int loc_code)
 
void set_global_subloc_code (int loc_code)
 
void set_global_subsubloc_code (int loc_code)
 

Macro Definition Documentation

◆ ASSERT_HOST

#define ASSERT_HOST (   x)
Value:
(x) \
: ASSERT_FAILED.error(#x, ABORT, "in file %s, line %d", __FILE__, __LINE__)

Definition at line 87 of file errcode.h.

◆ ASSERT_HOST_MSG

#define ASSERT_HOST_MSG (   x,
  ... 
)
Value:
if (!(x)) { \
tprintf(__VA_ARGS__); \
ASSERT_FAILED.error(#x, ABORT, "in file %s, line %d", __FILE__, __LINE__); \
}

Definition at line 91 of file errcode.h.

◆ DO_NOTHING

#define DO_NOTHING   (void)(0)

Definition at line 84 of file errcode.h.

◆ FILE_ABORT

#define FILE_ABORT   3

Definition at line 35 of file errcode.h.

◆ LIST_ABORT

#define LIST_ABORT   1

Definition at line 33 of file errcode.h.

◆ LOC_ADAPTIVE

#define LOC_ADAPTIVE   24

Definition at line 53 of file errcode.h.

◆ LOC_DOC_BLK_REJ

#define LOC_DOC_BLK_REJ   22

Definition at line 51 of file errcode.h.

◆ LOC_EDGE_PROG

#define LOC_EDGE_PROG   4

Definition at line 42 of file errcode.h.

◆ LOC_FUZZY_SPACE

#define LOC_FUZZY_SPACE   14

Definition at line 48 of file errcode.h.

◆ LOC_INIT

#define LOC_INIT   3

Definition at line 41 of file errcode.h.

◆ LOC_MM_ADAPT

#define LOC_MM_ADAPT   21

Definition at line 50 of file errcode.h.

◆ LOC_PASS1

#define LOC_PASS1   7

Definition at line 45 of file errcode.h.

◆ LOC_PASS2

#define LOC_PASS2   8

Definition at line 46 of file errcode.h.

◆ LOC_TEXT_ORD_ROWS

#define LOC_TEXT_ORD_ROWS   5

Definition at line 43 of file errcode.h.

◆ LOC_TEXT_ORD_WORDS

#define LOC_TEXT_ORD_WORDS   6

Definition at line 44 of file errcode.h.

◆ LOC_UNUSED0

#define LOC_UNUSED0   0

Definition at line 38 of file errcode.h.

◆ LOC_UNUSED1

#define LOC_UNUSED1   1

Definition at line 39 of file errcode.h.

◆ LOC_UNUSED2

#define LOC_UNUSED2   2

Definition at line 40 of file errcode.h.

◆ LOC_WRITE_RESULTS

#define LOC_WRITE_RESULTS   23

Definition at line 52 of file errcode.h.

◆ MEMORY_ABORT

#define MEMORY_ABORT   2

Definition at line 34 of file errcode.h.

◆ NO_ABORT_CODE

#define NO_ABORT_CODE   0

Definition at line 32 of file errcode.h.

◆ SUBLOC_FIX_XHT

#define SUBLOC_FIX_XHT   3

Definition at line 58 of file errcode.h.

◆ SUBLOC_NORM

#define SUBLOC_NORM   0

Definition at line 57 of file errcode.h.

◆ SUBSUBLOC_NN

#define SUBSUBLOC_NN   2

Definition at line 65 of file errcode.h.

◆ SUBSUBLOC_OTHER

#define SUBSUBLOC_OTHER   0

Definition at line 63 of file errcode.h.

◆ SUBSUBLOC_TESS

#define SUBSUBLOC_TESS   1

Definition at line 64 of file errcode.h.

Enumeration Type Documentation

◆ TessErrorLogCode

Enumerator
DBG 
TESSLOG 
TESSEXIT 
ABORT 

Definition at line 24 of file errcode.h.

25  {
26  DBG = -1, /*log without alert */
27  TESSLOG = 0, /*alert user */
28  TESSEXIT = 1, /*exit after error */
29  ABORT = 2 /*abort after error */

Function Documentation

◆ ASSERT_FAILED()

constexpr ERRCODE ASSERT_FAILED ( "Assert failed"  )
constexpr

◆ set_global_loc_code()

void set_global_loc_code ( int  loc_code)

Definition at line 25 of file globaloc.cpp.

25  {
26  // global_loc_code = loc_code;
27 }

◆ set_global_subloc_code()

void set_global_subloc_code ( int  loc_code)

Definition at line 30 of file globaloc.cpp.

30  {
31  // global_subloc_code = loc_code;
32 }

◆ set_global_subsubloc_code()

void set_global_subsubloc_code ( int  loc_code)

Definition at line 35 of file globaloc.cpp.

35  {
36  // global_subsubloc_code = loc_code;
37 }

◆ signal_exit()

void signal_exit ( int  signal_code)
TESSEXIT
Definition: errcode.h:42
ASSERT_FAILED
constexpr ERRCODE ASSERT_FAILED("Assert failed")
TESSLOG
Definition: errcode.h:41
ERRCODE::error
void error(const char *caller, TessErrorLogCode action, const char *format,...) const
Definition: errcode.cpp:33
DO_NOTHING
#define DO_NOTHING
Definition: errcode.h:84
ABORT
Definition: errcode.h:43
DBG
Definition: errcode.h:40