Skip to content

Commit

Permalink
Fixed name collision with jpeg library
Browse files Browse the repository at this point in the history
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@160 d0cd1f9f-072b-0410-8dd7-cf729c803f20
  • Loading branch information
theraysmith committed Apr 22, 2008
1 parent f04ff61 commit f734888
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 76 deletions.
47 changes: 24 additions & 23 deletions cutil/callcpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "varable.h"
#include "unichar.h"

class ScrollView;

#ifdef __cplusplus
//extern "C" {
#endif
Expand Down Expand Up @@ -101,20 +103,20 @@ extern double_VAR_H (newcp_prune_threshold, 1.2, "Ratio of best to prune");
extern double_VAR_H (tessedit_cp_ratio, 0.0, "Ratio from best to prune");

//Global matcher info from the class pruner.
extern INT32 cp_classes;
extern INT32 cp_bestindex;
extern INT32 cp_bestrating;
extern INT32 cp_bestconf;
extern inT32 cp_classes;
extern inT32 cp_bestindex;
extern inT32 cp_bestrating;
extern inT32 cp_bestconf;
extern char cp_chars[2];
extern INT32 cp_ratings[2];
extern INT32 cp_confs[2];
extern INT32 cp_maps[4];
extern inT32 cp_ratings[2];
extern inT32 cp_confs[2];
extern inT32 cp_maps[4];
//Global info to control writes of matcher info
extern INT32 blob_type; //write control
extern inT32 blob_type; //write control
extern char blob_answer[UNICHAR_LEN + 1]; //correct char
extern char *word_answer; //correct word
extern INT32 matcher_pass; //pass in chopper.c
extern INT32 bits_in_states; //no of bits in states
extern inT32 matcher_pass; //pass in chopper.c
extern inT32 bits_in_states; //no of bits in states

#ifndef __UNIX__
void assert( //recog one owrd
Expand All @@ -127,39 +129,39 @@ void cprintf ( //Trace printf
const char *format, ... //special message
);
char *c_alloc_string( //allocate string
INT32 count //no of chars required
inT32 count //no of chars required
);
void c_free_string( //free a string
char *string //string to free
);
void *c_alloc_struct( //allocate memory
INT32 count, //no of chars required
inT32 count, //no of chars required
const char *name //class name
);
void c_free_struct( //free a structure
void *deadstruct, //structure to free
INT32 count, //no of bytes
inT32 count, //no of bytes
const char *name //class name
);
void *c_alloc_mem_p( //allocate permanent space
INT32 count //block size to allocate
inT32 count //block size to allocate
);
void *c_alloc_mem( //get some memory
INT32 count //no of bytes to get
inT32 count //no of bytes to get
);
void c_free_mem( //free mem from alloc_mem
void *oldchunk //chunk to free
);
void c_check_mem( //check consistency
const char *string, //context message
INT8 level //level of check
inT8 level //level of check
);
void *c_create_window( /*create a window */
ScrollView *c_create_window( /*create a window */
const char *name, /*name/title of window */
INT16 xpos, /*coords of window */
INT16 ypos, /*coords of window */
INT16 xsize, /*size of window */
INT16 ysize, /*size of window */
inT16 xpos, /*coords of window */
inT16 ypos, /*coords of window */
inT16 xsize, /*size of window */
inT16 ysize, /*size of window */
double xmin, /*scrolling limits */
double xmax, /*to stop users */
double ymin, /*getting lost in */
Expand All @@ -180,8 +182,7 @@ void c_make_current( /*move pen */
void *win);
void c_clear_window( /*move pen */
void *win);
char window_wait( /*move pen */
void *win);
char window_wait(ScrollView* win);
void reverse32(void *ptr);
void reverse16(void *ptr);

Expand Down
2 changes: 1 addition & 1 deletion cutil/danerror.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
----------------------------------------------------------------------------**/
static jmp_buf ErrorTrapStack[MAXTRAPDEPTH];
static VOID_PROC ProcTrapStack[MAXTRAPDEPTH];
static INT32 CurrentTrapDepth = 0;
static inT32 CurrentTrapDepth = 0;

/**----------------------------------------------------------------------------
Public Code
Expand Down
8 changes: 4 additions & 4 deletions cutil/emalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
/**----------------------------------------------------------------------------
Public Function Prototypes
----------------------------------------------------------------------------**/
void *Emalloc(size_t Size);
void *Emalloc(size_t Size);

void *Erealloc(void *ptr, size_t size);
void *Erealloc(void *ptr, size_t size);

void Efree(void *ptr);
void Efree(void *ptr);

/*
#if defined(__STDC__) || defined(__cplusplus)
Expand Down Expand Up @@ -65,7 +65,7 @@ void Efree
//#define alloc_struct c_alloc_struct
/*extern void c_free_struct(void*
deadstruct, //structure to free
INT32 count, //no of bytes
inT32 count, //no of bytes
const char* name //class name
);*/
//#define free_struct c_free_struct
Expand Down
20 changes: 0 additions & 20 deletions cutil/funcdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,6 @@
----------------------------------------------------------------------------**/
#include "general.h"

typedef INT8 (*INT8_FUNC) ();
typedef UINT8 (*UINT8_FUNC) ();
typedef INT16 (*INT16_FUNC) ();
typedef UINT16 (*UINT16_FUNC) ();
typedef INT32 (*INT32_FUNC) ();
typedef UINT32 (*UINT32_FUNC) ();
typedef FLOAT32 (*FLOAT32_FUNC) ();
typedef FLOAT64 (*FLOAT64_FUNC) ();
typedef PINT8 (*PINT8_FUNC) ();
typedef PUINT8 (*PUINT8_FUNC) ();
typedef PINT16 (*PINT16_FUNC) ();
typedef PUINT16 (*PUINT16_FUNC) ();
typedef PINT32 (*PINT32_FUNC) ();
typedef PUINT32 (*PUINT32_FUNC) ();
typedef PFLOAT32 (*PFLOAT32_FUNC) ();
typedef PFLOAT64 (*PFLOAT64_FUNC) ();

typedef CHAR (*CHAR_FUNC) ();
typedef BOOL8 (*BOOL8_FUNC) ();
typedef int (*INT_FUNC) ();
typedef void (*VOID_FUNC) ();

/**----------------------------------------------------------------------------
Expand Down
38 changes: 19 additions & 19 deletions cutil/oldheap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
Public Code
----------------------------------------------------------------------------**/
/*---------------------------------------------------------------------------*/
HEAP *MakeHeap(int Size) {
HEAP *MakeHeap(int Size) {
/*
** Parameters:
** Size maximum number of entries in the heap
Expand Down Expand Up @@ -61,7 +61,7 @@ HEAP *MakeHeap(int Size) {


/*---------------------------------------------------------------------------*/
int HeapPop(HEAP *Heap, FLOAT32 *Key, void *out_ptr) {
int HeapPop(HEAP *Heap, FLOAT32 *Key, void *out_ptr) {
/*
** Parameters:
** Heap ptr to heap whose top is to be removed and returned
Expand All @@ -79,9 +79,9 @@ int HeapPop(HEAP *Heap, FLOAT32 *Key, void *out_ptr) {
** History:
** 5/10/91, DSJ, Created (Modified from GetTopOfHeap).
*/
INT32 Hole;
inT32 Hole;
FLOAT32 HoleKey;
INT32 Son;
inT32 Son;
void **Data = (void **) out_ptr;

if (Heap->FirstFree <= 1)
Expand Down Expand Up @@ -122,17 +122,17 @@ int HeapPop(HEAP *Heap, FLOAT32 *Key, void *out_ptr) {
*
* Remove the largest item from the heap.
**********************************************************************/
int HeapPopWorst(HEAP *Heap, FLOAT32 *Key, void *out_ptr) {
int HeapPopWorst(HEAP *Heap, FLOAT32 *Key, void *out_ptr) {
/*
** Parameters:
** Heap ptr to heap whose top is to be removed and returned
** Key place to put key of top heap item
** Data place to put data of top heap item
*/
INT32 Index; /*current index */
INT32 Hole;
inT32 Index; /*current index */
inT32 Hole;
FLOAT32 HoleKey;
INT32 Father;
inT32 Father;
void *HoleData;
void **Data = (void **) out_ptr;

Expand Down Expand Up @@ -173,7 +173,7 @@ int HeapPopWorst(HEAP *Heap, FLOAT32 *Key, void *out_ptr) {


/*---------------------------------------------------------------------------*/
void HeapPush(HEAP *Heap, FLOAT32 Key, void *Data) {
void HeapPush(HEAP *Heap, FLOAT32 Key, void *Data) {
/*
** Parameters:
** Heap ptr to heap to store new item in
Expand All @@ -193,8 +193,8 @@ void HeapPush(HEAP *Heap, FLOAT32 Key, void *Data) {
** History:
** 5/10/91, DSJ, Created (Modified version of HeapStore).
*/
INT32 Item;
INT32 Father;
inT32 Item;
inT32 Father;

if (Heap->FirstFree > Heap->Size)
DoError (HEAPFULL, "Heap size exceeded");
Expand All @@ -217,7 +217,7 @@ void HeapPush(HEAP *Heap, FLOAT32 Key, void *Data) {


/*---------------------------------------------------------------------------*/
void HeapStore(HEAP *Heap, HEAPENTRY *Entry) {
void HeapStore(HEAP *Heap, HEAPENTRY *Entry) {
/*
** Parameters:
** Heap ptr to heap to store new item in
Expand All @@ -235,8 +235,8 @@ void HeapStore(HEAP *Heap, HEAPENTRY *Entry) {
** History:
** 3/13/89, DSJ, Created.
*/
INT32 Item;
INT32 Father;
inT32 Item;
inT32 Father;

if (Heap->FirstFree > Heap->Size)
DoError (HEAPFULL, "Heap size exceeded");
Expand All @@ -259,7 +259,7 @@ void HeapStore(HEAP *Heap, HEAPENTRY *Entry) {


/*---------------------------------------------------------------------------*/
int GetTopOfHeap(HEAP *Heap, HEAPENTRY *Entry) {
int GetTopOfHeap(HEAP *Heap, HEAPENTRY *Entry) {
/*
** Parameters:
** Heap ptr to heap whose top is to be removed and returned
Expand All @@ -276,9 +276,9 @@ int GetTopOfHeap(HEAP *Heap, HEAPENTRY *Entry) {
** History:
** 3/13/89, DSJ, Created.
*/
INT32 Hole;
inT32 Hole;
FLOAT32 HoleKey;
INT32 Son;
inT32 Son;

if (Heap->FirstFree <= 1)
return (EMPTY);
Expand Down Expand Up @@ -314,7 +314,7 @@ int GetTopOfHeap(HEAP *Heap, HEAPENTRY *Entry) {


/*---------------------------------------------------------------------------*/
void FreeHeapData(HEAP *Heap, void_dest destructor) {
void FreeHeapData(HEAP *Heap, void_dest destructor) {
/*
** Parameters:
** Heap heap whose data is to be freed
Expand All @@ -333,5 +333,5 @@ void FreeHeapData(HEAP *Heap, void_dest destructor) {
while (GetTopOfHeap (Heap, &Entry) != EMPTY)
destructor (Entry.Data);

FreeHeap(Heap);
FreeHeap(Heap);
} /* FreeHeapData */
18 changes: 9 additions & 9 deletions cutil/oldheap.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ HEAPENTRY;

typedef struct
{
INT32 Size;
INT32 FirstFree;
inT32 Size;
inT32 FirstFree;
HEAPENTRY Entry[1];
}

Expand Down Expand Up @@ -69,19 +69,19 @@ HEAP;
/**----------------------------------------------------------------------------
Public Function Prototypes
----------------------------------------------------------------------------**/
HEAP *MakeHeap(int Size);
HEAP *MakeHeap(int Size);

int HeapPop(HEAP *Heap, FLOAT32 *Key, void *out_ptr);
int HeapPop(HEAP *Heap, FLOAT32 *Key, void *out_ptr);

int HeapPopWorst(HEAP *Heap, FLOAT32 *Key, void *out_ptr);
int HeapPopWorst(HEAP *Heap, FLOAT32 *Key, void *out_ptr);

void HeapPush(HEAP *Heap, FLOAT32 Key, void *Data);
void HeapPush(HEAP *Heap, FLOAT32 Key, void *Data);

void HeapStore(HEAP *Heap, HEAPENTRY *Entry);
void HeapStore(HEAP *Heap, HEAPENTRY *Entry);

int GetTopOfHeap(HEAP *Heap, HEAPENTRY *Entry);
int GetTopOfHeap(HEAP *Heap, HEAPENTRY *Entry);

void FreeHeapData(HEAP *Heap, void_dest destructor);
void FreeHeapData(HEAP *Heap, void_dest destructor);

/*
#if defined(__STDC__) || defined(__cplusplus)
Expand Down

0 comments on commit f734888

Please sign in to comment.