00001
00019 #include "globals.h"
00020 #include "variables.h"
00021
00022 #include <math.h>
00023 #include <signal.h>
00024 #include "tessinit.h"
00025
00026
00027
00028
00029 int corner_0;
00030 int corner_1;
00031 int corner_2;
00032 int corner_3;
00033
00034 int row_number;
00035
00036
00037
00038
00039
00043 void program_variables() {
00044 VALUE dummy;
00045
00046 int_variable (plots_fx, "plots_fx", 0);
00047 int_variable (plots_ocr, "plots_ocr", 0);
00048 int_variable (debugs_fx, "debugs_fx", 0);
00049 int_variable (debugs_ocr, "debugs_ocr", 0);
00050
00051 int_variable (acts_fx, "acts_fx", 2048);
00052
00053 int_variable (acts_ocr, "acts_ocr", 32);
00054 int_variable (corner_0, "corner_0", 0);
00055 int_variable (corner_1, "corner_1", 0);
00056 int_variable (corner_2, "corner_2", 2550);
00057 int_variable (corner_3, "corner_3", 3508);
00058 int_variable (resolution, "resolution", 300);
00059 string_variable (debugfile, "debugfile", "");
00060 }
00061
00062
00063
00067 void program_init() {
00068
00069 plots[OCR] = plots_ocr;
00070 debugs[OCR] = debugs_ocr;
00071 acts[OCR] = acts_ocr;
00072 plots[FX] = plots_fx;
00073 debugs[FX] = debugs_fx;
00074 acts[FX] = acts_fx;
00075
00076 corners[0] = corner_0;
00077 corners[1] = corner_1;
00078 corners[2] = corner_2;
00079 corners[3] = corner_3;
00080 }
00081
00082
00083
00087 #ifdef __UNIX
00088 int
00089 matherr (error)
00090 struct exception *error;
00091 {
00092 if (error->type == DOMAIN) {
00093 if (!strcmp (error->name, "sqrt")) {
00094 cprintf ("Sqrt:Domain error!!\n");
00095 abort();
00096 }
00097 if (!strcmp (error->name, "atan2")) {
00098 cprintf ("Arc Tangent error: atan2 (%ld, %ld)\n",
00099 error->arg1, error->arg2);
00100 abort();
00101 }
00102 }
00103 return 0;
00104 }
00105 #endif