ccutil/errcode.h File Reference

#include "host.h"

Go to the source code of this file.

Classes

Defines

Functions

Variables


Define Documentation

#define ABORT   2

Definition at line 29 of file errcode.h.

Referenced by ELIST2_ITERATOR::add_after_stay_put(), ELIST_ITERATOR::add_after_stay_put(), CLIST_ITERATOR::add_after_stay_put(), ELIST2_ITERATOR::add_after_then_move(), ELIST_ITERATOR::add_after_then_move(), CLIST_ITERATOR::add_after_then_move(), ELIST2_ITERATOR::add_before_stay_put(), ELIST_ITERATOR::add_before_stay_put(), CLIST_ITERATOR::add_before_stay_put(), ELIST2_ITERATOR::add_before_then_move(), ELIST_ITERATOR::add_before_then_move(), CLIST_ITERATOR::add_before_then_move(), ELIST2_ITERATOR::add_list_after(), ELIST_ITERATOR::add_list_after(), CLIST_ITERATOR::add_list_after(), ELIST2_ITERATOR::add_list_before(), ELIST_ITERATOR::add_list_before(), CLIST_ITERATOR::add_list_before(), ELIST2_ITERATOR::add_to_end(), ELIST_ITERATOR::add_to_end(), CLIST_ITERATOR::add_to_end(), MEM_ALLOCATOR::alloc(), MEM_ALLOCATOR::alloc_p(), ELIST2::assign_to_sublist(), ELIST::assign_to_sublist(), CLIST::assign_to_sublist(), ELIST2_ITERATOR::at_first(), ELIST_ITERATOR::at_first(), CLIST_ITERATOR::at_first(), ELIST2_ITERATOR::at_last(), ELIST_ITERATOR::at_last(), CLIST_ITERATOR::at_last(), ELIST2_ITERATOR::backward(), WERD::baseline_denormalise(), WERD::baseline_normalise_x(), WERD::blob_list(), WERD::cblob_list(), MEM_ALLOCATOR::check(), IMAGE::check_legal_access(), check_struct(), compress_region_list(), compute_page_skew(), compute_row_stats(), IMAGE::convolver(), IMAGE::create(), ELIST2_ITERATOR::cycled_list(), ELIST_ITERATOR::cycled_list(), CLIST_ITERATOR::cycled_list(), ELIST2_ITERATOR::data(), ELIST_ITERATOR::data(), CLIST_ITERATOR::data(), ELIST2_ITERATOR::data_relative(), ELIST_ITERATOR::data_relative(), CLIST_ITERATOR::data_relative(), ELIST_LINK::de_serialise_asc(), de_serialise_bytes(), de_serialise_FLOAT64(), de_serialise_INT32(), MEM_ALLOCATOR::dealloc(), delete_non_dropout_rows(), ELIST2_ITERATOR::empty(), ELIST_ITERATOR::empty(), CLIST_ITERATOR::empty(), ERRCODE::error(), ELIST2_ITERATOR::exchange(), ELIST_ITERATOR::exchange(), CLIST_ITERATOR::exchange(), ELIST2_ITERATOR::extract(), ELIST_ITERATOR::extract(), CLIST_ITERATOR::extract(), ELIST2_ITERATOR::extract_sublist(), ELIST_ITERATOR::extract_sublist(), CLIST_ITERATOR::extract_sublist(), find_band(), ELIST2_ITERATOR::forward(), ELIST_ITERATOR::forward(), CLIST_ITERATOR::forward(), BLOCK_LINE_IT::get_line(), init_tesseract(), ELIST2::internal_clear(), ELIST::internal_clear(), ELIST2::internal_de_dump(), ELIST::internal_de_dump(), CLIST::internal_de_dump(), CLIST::internal_deep_clear(), ELIST2::internal_deep_copy(), ELIST::internal_deep_copy(), CLIST::internal_deep_copy(), ELIST2::internal_dump(), ELIST::internal_dump(), CLIST::internal_dump(), ELIST2_ITERATOR::length(), ELIST2::length(), ELIST_ITERATOR::length(), ELIST::length(), CLIST_ITERATOR::length(), CLIST::length(), main_setup(), ELIST2_ITERATOR::mark_cycle_pt(), ELIST_ITERATOR::mark_cycle_pt(), CLIST_ITERATOR::mark_cycle_pt(), median_block_xheight(), ELIST2_ITERATOR::move_to_first(), ELIST_ITERATOR::move_to_first(), CLIST_ITERATOR::move_to_first(), ELIST2_ITERATOR::move_to_last(), ELIST_ITERATOR::move_to_last(), CLIST_ITERATOR::move_to_last(), ELIST2::prep_serialise(), ELIST::prep_serialise(), CLIST::prep_serialise(), RADIO_MENU::press_radio_button(), IMAGE::read(), MENU_NODE::recalc_bounding_box(), WERD::rej_blob_list(), WERD::rej_cblob_list(), QLSQ::remove(), LLSQ::remove(), WERD::scale(), ELIST_LINK::serialise_asc(), serialise_bytes(), serialise_FLOAT64(), serialise_INT32(), ELIST2_ITERATOR::set_to_list(), ELIST_ITERATOR::set_to_list(), CLIST_ITERATOR::set_to_list(), CLIST::shallow_clear(), ELIST2_ITERATOR::sort(), ELIST2::sort(), ELIST_ITERATOR::sort(), ELIST::sort(), CLIST_ITERATOR::sort(), CLIST::sort(), and IMAGE::write().

#define ASSERT_HOST (  ) 

Value:

if (!(x))                     \
{                                            \
   ASSERT_FAILED.error(#x,LOG,"in file %s, line %d",     \
      __FILE__,__LINE__);                          \
}

Definition at line 87 of file errcode.h.

Referenced by CHAR_PROTO::add_sample(), apply_box_testing(), assert(), bin_to_pieces(), char_clip_word(), CHAR_SAMPLES::CHAR_SAMPLES(), check_pitch_sync(), check_pitch_sync2(), check_pitch_sync3(), classify_word_pass1(), clip_sample(), compute_block_pitch(), compute_rows_pitch(), convert_vec_block(), cutline(), edgesteps_to_edgepts(), CHAR_PROTO::enlarge_prototype(), find_underlined_blobs(), free_struct(), insert_rej_cblobs(), make_epaper_choice(), make_illegal_segment(), CHAR_PROTO::make_image(), make_real_words(), CHAR_PROTO::match(), match1(), match_word_pass2(), matrix_match(), median_block_xheight(), merge_tess_fails(), REJMAP::operator[](), recog_word(), REJMAP::remove_pos(), restore_underlined_blobs(), ROW_RES::ROW_RES(), split_and_recog_word(), try_rows_fixed(), worst_noise_blob(), write_map(), and write_results().

#define DBG   -1

Note:
File: errcode.h (Formerly error.h)
Header file for generic error handler class
Author:
Ray Smith
Date:
Tue May 1 16:23:36 BST 1990
 * (C) Copyright 1990, Hewlett-Packard Ltd.
 ** Licensed under the Apache License, Version 2.0 (the "License");
 ** you may not use this file except in compliance with the License.
 ** You may obtain a copy of the License at
 ** http://www.apache.org/licenses/LICENSE-2.0
 ** Unless required by applicable law or agreed to in writing, software
 ** distributed under the License is distributed on an "AS IS" BASIS,
 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 ** See the License for the specific language governing permissions and
 ** limitations under the License.

Definition at line 26 of file errcode.h.

Referenced by ERRCODE::error(), init_tesseract(), and main_setup().

#define EXIT   1

Definition at line 28 of file errcode.h.

Referenced by apply_boxes(), choice_dump_tester(), edges_and_textord(), ERRCODE::error(), get_pd_vertex(), init_net(), kick_daemon(), main(), open_outfile(), pgeditor_read_file(), pgeditor_write_file(), read_and_textord(), read_pd_file(), read_vec_file(), write_cooked_text(), write_map(), and write_unlv_text().

#define FILE_ABORT   3

Definition at line 35 of file errcode.h.

Referenced by ERRCODE::error().

#define LIST_ABORT   1

Definition at line 33 of file errcode.h.

Referenced by ERRCODE::error().

#define LOC_ADAPTIVE   24

Definition at line 53 of file errcode.h.

Referenced by edges_and_textord().

#define LOC_DOC_BLK_REJ   22

Definition at line 51 of file errcode.h.

Referenced by recog_all_words().

#define LOC_EDGE_PROG   4

Definition at line 42 of file errcode.h.

Referenced by edges_and_textord().

#define LOC_FUZZY_SPACE   14

Definition at line 48 of file errcode.h.

Referenced by recog_all_words(), and signal_exit().

#define LOC_INIT   3

Definition at line 41 of file errcode.h.

#define LOC_MM_ADAPT   21

Definition at line 50 of file errcode.h.

Referenced by recog_all_words().

#define LOC_PASS1   7

Definition at line 45 of file errcode.h.

Referenced by recog_all_words().

#define LOC_PASS2   8

Definition at line 46 of file errcode.h.

Referenced by recog_all_words(), and signal_exit().

#define LOC_TEXT_ORD_ROWS   5

Definition at line 43 of file errcode.h.

Referenced by textord_page().

#define LOC_TEXT_ORD_WORDS   6

Definition at line 44 of file errcode.h.

Referenced by textord_page().

#define LOC_UNUSED0   0

Definition at line 38 of file errcode.h.

#define LOC_UNUSED1   1

Definition at line 39 of file errcode.h.

#define LOC_UNUSED2   2

Definition at line 40 of file errcode.h.

#define LOC_WRITE_RESULTS   23

Definition at line 52 of file errcode.h.

Referenced by recog_all_words().

#define LOG   0

Definition at line 27 of file errcode.h.

Referenced by add_event(), IMAGE::bufread(), check_legal_image_size(), check_path_legal(), ERRCODE::error(), name_to_image_type(), MEM_ALLOCATOR::new_block(), R_BITSTREAM::open(), open_tif_image(), IMAGE::read(), R_BITSTREAM::read_code(), IMAGE::read_header(), read_poly_blocks(), start_variables_editor(), IMAGE::write(), W_BITSTREAM::write_code(), and write_tif_image().

#define MEMORY_ABORT   2

Definition at line 34 of file errcode.h.

Referenced by ERRCODE::error().

#define NO_ABORT_CODE   0

Definition at line 32 of file errcode.h.

Referenced by ERRCODE::error().

#define SUBLOC_FIX_XHT   3

Definition at line 58 of file errcode.h.

Referenced by classify_word_pass2().

#define SUBLOC_NORM   0

Definition at line 57 of file errcode.h.

Referenced by classify_word_pass2().

#define SUBSUBLOC_NN   2

Definition at line 65 of file errcode.h.

#define SUBSUBLOC_OTHER   0

Definition at line 63 of file errcode.h.

Referenced by match_word_pass2().

#define SUBSUBLOC_TESS   1

Definition at line 64 of file errcode.h.

Referenced by match_word_pass2().


Function Documentation

void err_exit (  ) 

All program exits should go through this point; allows a meaningful status code to be generated for the real exit() call.

The status code is made up as follows:

Bit  0    : 1 = Program Abort   0 = System Abort
Bits 1,2  : IF bit 0 = 1 THEN ERRCODE::abort_code
            ELSE    0 = Bus Err or Seg Vi
                    1 = Floating point exception
                    2 = TimeOut (Signal 15 from command timer)
                    3 = Any other signal
Bits 3..7 : Location code NEVER 0 !

Definition at line 75 of file globaloc.cpp.

Referenced by dyn_exit(), ERRCODE::error(), and scale_image().

00075                 { 
00076   signal_exit (-1);
00077 }

void set_global_loc_code ( int  loc_code  ) 

FIX:.

Definition at line 107 of file globaloc.cpp.

Referenced by edges_and_textord(), recog_all_words(), and textord_page().

00107                                        { 
00108   global_loc_code = loc_code;
00109 
00110 }

void set_global_subloc_code ( int  loc_code  ) 

FIX:.

Definition at line 116 of file globaloc.cpp.

Referenced by classify_word_pass2().

00116                                           { 
00117   global_subloc_code = loc_code;
00118 
00119 }

void set_global_subsubloc_code ( int  loc_code  ) 

FIX:.

Definition at line 125 of file globaloc.cpp.

Referenced by match_word_pass2().

00125                                              { 
00126   global_subsubloc_code = loc_code;
00127 
00128 }

void signal_exit ( int  signal_code  ) 

Definition at line 35 of file globaloc.cpp.

Referenced by err_exit(), and signal_termination_handler().

00037                   {
00038   int exit_status;
00039 
00040   if ((global_loc_code == LOC_PASS2) || (global_loc_code == LOC_FUZZY_SPACE))
00041     global_loc_code += global_subloc_code + global_subsubloc_code;
00042 
00043   if (signal_code < 0) {
00044     exit_status = global_loc_code * 8 + global_abort_code * 2 + 1;
00045     tprintf ("Signal_exit %d ABORT. LocCode: %d  AbortCode: %d\n",
00046       exit_status, global_loc_code, global_abort_code);
00047   }
00048   else {
00049     exit_status = global_loc_code * 8 + signal_code * 2;
00050     tprintf ("Signal_exit %d SIGNAL ABORT. LocCode: %d  SignalCode: %d\n",
00051       exit_status, global_loc_code, signal_code);
00052   }
00053 
00054   exit(exit_status); 
00055 }

void signal_termination_handler ( int  sig  ) 

The real signal.

Definition at line 83 of file globaloc.cpp.

Referenced by DoError().

00084                                          {
00085   tprintf ("Signal_termination_handler called with signal %d\n", sig);
00086   switch (sig) {
00087     case SIGABRT:
00088       signal_exit (-1);          //use abort code
00089       //         case SIGBUS:
00090     case SIGSEGV:
00091       signal_exit (0);
00092     case SIGFPE:
00093       signal_exit (1);           //floating point
00094     case SIGTERM:
00095       signal_exit (2);           //timeout by cmdtimer
00096     default:
00097       signal_exit (3);           //Anything else
00098   }
00099 }


Variable Documentation

const ERRCODE ASSERT_FAILED = "Assert failed"

Definition at line 85 of file errcode.h.


Generated on Wed Feb 28 19:49:16 2007 for Tesseract by  doxygen 1.5.1