cutil/debug.cpp File Reference

#include <stdio.h>
#include "debug.h"
#include "callcpp.h"

Go to the source code of this file.

Functions

Variables


Function Documentation

void make_menu_item ( int  menu,
int  menu_item,
const char *  menu_string,
int_void  menu_funct 
)

Create an entry in the menu handler table that will create a menu entry; which, when selected, will invoke the requested function.

Definition at line 79 of file debug.cpp.

References MENU_ITEM::menu_function, MENU_ITEM::menu_string, and menu_table.

00082                                          {
00083   menu_table[menu][menu_item].menu_string = menu_string;
00084   menu_table[menu][menu_item].menu_function = (void_proc) menu_funct;
00085 }

int set_float_value ( const char *  message,
float *  variable 
)

Set the value of a floating point variable from the break handler.

Definition at line 38 of file debug.cpp.

References CHARS_PER_LINE, cprintf(), and NULL.

00038                                                           { 
00039   char this_string[CHARS_PER_LINE];
00040 
00041   cprintf ("%s (%7.5f) ? ", message, *variable);
00042   fflush(stdout); 
00043 
00044   if (fgets (this_string, CHARS_PER_LINE, stdin) == NULL)
00045     return (1);
00046 
00047   if (fgets (this_string, CHARS_PER_LINE, stdin) != NULL) {
00048     sscanf (this_string, "%f", variable);
00049     cprintf ("%s = %7.5f\n", message, *variable);
00050   }
00051   return (1);
00052 }

int set_int_value ( const char *  message,
int *  variable 
)

Set the value of a floating point variable from the break handler.

Definition at line 58 of file debug.cpp.

References CHARS_PER_LINE, cprintf(), and NULL.

00058                                                       { 
00059   char this_string[CHARS_PER_LINE];
00060 
00061   cprintf ("%s (%d) ? ", message, *variable);
00062   fflush(stdout); 
00063 
00064   if (fgets (this_string, CHARS_PER_LINE, stdin) == NULL)
00065     return (1);
00066 
00067   if (fgets (this_string, CHARS_PER_LINE, stdin) != NULL) {
00068     sscanf (this_string, "%d", variable);
00069     cprintf ("%s = %d\n", message, *variable);
00070   }
00071   return (1);
00072 }


Variable Documentation

MENU_ITEM menu_table[NUM_MENUS][NUM_MENU_ITEMS]

Note:
File: debug.cpp (Formerly debug.c)
Combinatorial Splitter
Author:
Mark Seaman, OCR Technology
Date:
Thu Jul 27 08:59:01 1989 Tue Feb 19 10:34:36 1991 (Mark Seaman) marks
 * (c) Copyright 1989, Hewlett-Packard Company.
 ** 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 30 of file debug.cpp.

Referenced by make_menu_item().


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