Fixed name collision with jpeg library

git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@162 d0cd1f9f-072b-0410-8dd7-cf729c803f20
This commit is contained in:
theraysmith 2008-04-22 00:39:51 +00:00
parent e3b507b15e
commit d696477537
13 changed files with 308 additions and 500 deletions

View File

@ -115,7 +115,7 @@ void AddToNormProtosList(
void WriteProtos(
FILE *File,
UINT16 N,
uinT16 N,
LIST ProtoList,
BOOL8 WriteSigProtos,
BOOL8 WriteInsigProtos);
@ -758,11 +758,11 @@ CLUSTERER *SetUpForClustering(
*/
{
UINT16 N;
uinT16 N;
int i, j;
FLOAT32 *Sample = NULL;
CLUSTERER *Clusterer;
INT32 CharID;
inT32 CharID;
LIST FeatureList = NULL;
FEATURE_SET FeatureSet = NULL;
FEATURE_DESC FeatureDesc = NULL;
@ -818,7 +818,7 @@ void AddToNormProtosList(
/*-------------------------------------------------------------------------*/
void WriteProtos(
FILE *File,
UINT16 N,
uinT16 N,
LIST ProtoList,
BOOL8 WriteSigProtos,
BOOL8 WriteInsigProtos)

View File

@ -37,8 +37,8 @@ RSC=rc.exe
# PROP BASE Target_Dir ""
# PROP Use_MFC 2
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "."
# PROP Intermediate_Dir "cntrain.Release"
# PROP Output_Dir "cntrain.Release6"
# PROP Intermediate_Dir "cntrain.Release6"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
@ -50,7 +50,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 /nologo /subsystem:console /profile /debug /machine:I386 /out:"cnTraining.exe"
# ADD LINK32 ws2_32.lib /nologo /subsystem:console /profile /debug /machine:I386 /out:"./cnTraining.exe"
!ELSEIF "$(CFG)" == "cnTraining - Win32 Debug"
@ -61,8 +61,8 @@ LINK32=link.exe
# PROP BASE Target_Dir ""
# PROP Use_MFC 2
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../bin.dbg"
# PROP Intermediate_Dir "cntrain.Debug"
# PROP Output_Dir "cntrain.Debug6"
# PROP Intermediate_Dir "cntrain.Debug6"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
@ -74,7 +74,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../bin.dbg6/cnTraining.exe" /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
!ENDIF
@ -129,14 +129,6 @@ SOURCE=..\ccutil\errcode.cpp
# End Source File
# Begin Source File
SOURCE=..\viewer\evntlst.cpp
# End Source File
# Begin Source File
SOURCE=..\viewer\evnts.cpp
# End Source File
# Begin Source File
SOURCE=..\classify\featdefs.cpp
# End Source File
# Begin Source File
@ -153,14 +145,6 @@ SOURCE=..\cutil\globals.cpp
# End Source File
# Begin Source File
SOURCE=..\viewer\grphics.cpp
# End Source File
# Begin Source File
SOURCE=..\viewer\grphshm.cpp
# End Source File
# Begin Source File
SOURCE=..\ccutil\hashfn.cpp
# End Source File
# Begin Source File
@ -201,6 +185,14 @@ SOURCE=..\cutil\oldlist.cpp
# End Source File
# Begin Source File
SOURCE=..\viewer\scrollview.cpp
# End Source File
# Begin Source File
SOURCE=..\ccutil\serialis.cpp
# End Source File
# Begin Source File
SOURCE=..\ccutil\strngs.cpp
# End Source File
# Begin Source File
@ -209,6 +201,14 @@ SOURCE=..\cutil\structures.cpp
# End Source File
# Begin Source File
SOURCE=..\viewer\svmnode.cpp
# End Source File
# Begin Source File
SOURCE=..\viewer\svutil.cpp
# End Source File
# Begin Source File
SOURCE=..\ccutil\tessopt.cpp
# End Source File
# Begin Source File
@ -221,6 +221,10 @@ SOURCE=..\training\training.cpp
# End Source File
# Begin Source File
SOURCE=..\ccutil\unichar.cpp
# End Source File
# Begin Source File
SOURCE=..\ccutil\unicharmap.cpp
# End Source File
# Begin Source File

View File

@ -75,7 +75,7 @@
OutputFile="cnTraining.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
GenerateDebugInformation="false"
SubSystem="1"
TargetMachine="1"
/>
@ -443,50 +443,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\viewer\evntlst.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\viewer\evnts.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\classify\featdefs.cpp"
>
@ -575,50 +531,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\viewer\grphics.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\viewer\grphshm.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\ccutil\hashfn.cpp"
>
@ -839,6 +751,18 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\viewer\scrollview.cpp"
>
</File>
<File
RelativePath="..\viewer\scrollview.h"
>
</File>
<File
RelativePath="..\ccutil\serialis.cpp"
>
</File>
<File
RelativePath="..\ccutil\strngs.cpp"
>
@ -883,6 +807,22 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\viewer\svmnode.cpp"
>
</File>
<File
RelativePath="..\viewer\svmnode.h"
>
</File>
<File
RelativePath="..\viewer\svutil.cpp"
>
</File>
<File
RelativePath="..\viewer\svutil.h"
>
</File>
<File
RelativePath="..\ccutil\tessopt.cpp"
>
@ -949,6 +889,10 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\ccutil\unichar.cpp"
>
</File>
<File
RelativePath="..\ccutil\unicharmap.cpp"
>

View File

@ -54,6 +54,11 @@
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#ifdef WIN32
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#endif
#define MAXNAMESIZE 80
#define MAX_NUM_SAMPLES 10000
@ -581,9 +586,9 @@ LIST ReadTrainingSamples (
for (int feature = 0; feature < FeatureSamples->NumFeatures; ++feature) {
FEATURE f = FeatureSamples->Features[feature];
for (int dim =0; dim < f->Type->NumParams; ++dim)
f->Params[dim] += dim == MFDirection ?
UniformRandomNumber(-MINSD_ANGLE, MINSD_ANGLE) :
UniformRandomNumber(-MINSD, MINSD);
f->Params[dim] += dim == MFDirection ?
UniformRandomNumber(-MINSD_ANGLE, MINSD_ANGLE) :
UniformRandomNumber(-MINSD, MINSD);
}
CharSample->List = push (CharSample->List, FeatureSamples);
CharSample->SampleCount++;
@ -1040,11 +1045,11 @@ CLUSTERER *SetUpForClustering(
*/
{
UINT16 N;
uinT16 N;
int i, j;
FLOAT32 *Sample = NULL;
CLUSTERER *Clusterer;
INT32 CharID;
inT32 CharID;
LIST FeatureList = NULL;
FEATURE_SET FeatureSet = NULL;
FEATURE_DESC FeatureDesc = NULL;
@ -1131,7 +1136,7 @@ void MergeInsignificantProtos(LIST ProtoList, const char* label,
}
}
// Mark significant those that now have enough samples.
int min_samples = (INT32) (Config->MinSamples * Clusterer->NumChar);
int min_samples = (inT32) (Config->MinSamples * Clusterer->NumChar);
pProtoList = ProtoList;
iterate(pProtoList) {
Prototype = (PROTOTYPE *) first_node (pProtoList);

View File

@ -37,8 +37,8 @@ RSC=rc.exe
# PROP BASE Target_Dir ""
# PROP Use_MFC 2
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "."
# PROP Intermediate_Dir "mftrain.Release"
# PROP Output_Dir "mftrain.Release6"
# PROP Intermediate_Dir "mftrain.Release6"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
@ -50,7 +50,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 /nologo /subsystem:console /profile /debug /machine:I386 /out:"mfTraining.exe"
# ADD LINK32 ws2_32.lib /nologo /subsystem:console /profile /debug /machine:I386 /out:"./mfTraining.exe"
!ELSEIF "$(CFG)" == "mfTraining - Win32 Debug"
@ -61,8 +61,8 @@ LINK32=link.exe
# PROP BASE Target_Dir ""
# PROP Use_MFC 2
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../bin.dbg"
# PROP Intermediate_Dir "mftrain.Debug"
# PROP Output_Dir "mftrain.Debug6"
# PROP Intermediate_Dir "mftrain.Debug6"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
@ -74,7 +74,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 /nologo /subsystem:console /profile /debug /machine:I386
# ADD LINK32 ws2_32.lib /nologo /subsystem:console /profile /debug /machine:I386 /out:"../bin.dbg6/mfTraining.exe"
!ENDIF
@ -128,14 +128,6 @@ SOURCE=..\ccutil\errcode.cpp
# End Source File
# Begin Source File
SOURCE=..\viewer\evntlst.cpp
# End Source File
# Begin Source File
SOURCE=..\viewer\evnts.cpp
# End Source File
# Begin Source File
SOURCE=..\classify\featdefs.cpp
# End Source File
# Begin Source File
@ -152,14 +144,6 @@ SOURCE=..\cutil\globals.cpp
# End Source File
# Begin Source File
SOURCE=..\viewer\grphics.cpp
# End Source File
# Begin Source File
SOURCE=..\viewer\grphshm.cpp
# End Source File
# Begin Source File
SOURCE=..\ccutil\hashfn.cpp
# End Source File
# Begin Source File
@ -243,6 +227,14 @@ SOURCE=..\classify\protos.cpp
# End Source File
# Begin Source File
SOURCE=..\viewer\scrollview.cpp
# End Source File
# Begin Source File
SOURCE=..\ccutil\serialis.cpp
# End Source File
# Begin Source File
SOURCE=..\ccutil\strngs.cpp
# End Source File
# Begin Source File
@ -251,6 +243,14 @@ SOURCE=..\cutil\structures.cpp
# End Source File
# Begin Source File
SOURCE=..\viewer\svmnode.cpp
# End Source File
# Begin Source File
SOURCE=..\viewer\svutil.cpp
# End Source File
# Begin Source File
SOURCE=..\ccutil\tessopt.cpp
# End Source File
# Begin Source File

View File

@ -69,7 +69,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="user32.lib"
AdditionalDependencies="user32.lib ws2_32.lib"
OutputFile=".\../bin.dbg/mfTraining.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
@ -161,11 +161,11 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="user32.lib"
AdditionalDependencies="user32.lib ws2_32.lib"
OutputFile="mfTraining.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
GenerateDebugInformation="false"
SubSystem="1"
TargetMachine="1"
/>
@ -442,50 +442,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\viewer\evntlst.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\viewer\evnts.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\classify\featdefs.cpp"
>
@ -574,50 +530,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\viewer\grphics.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\viewer\grphshm.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\ccutil\hashfn.cpp"
>
@ -926,6 +838,18 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\viewer\scrollview.cpp"
>
</File>
<File
RelativePath="..\viewer\scrollview.h"
>
</File>
<File
RelativePath="..\ccutil\serialis.cpp"
>
</File>
<File
RelativePath="..\ccutil\strngs.cpp"
>
@ -970,6 +894,22 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\viewer\svmnode.cpp"
>
</File>
<File
RelativePath="..\viewer\svmnode.h"
>
</File>
<File
RelativePath="..\viewer\svutil.cpp"
>
</File>
<File
RelativePath="..\viewer\svutil.h"
>
</File>
<File
RelativePath="..\ccutil\tessopt.cpp"
>

View File

@ -13,173 +13,172 @@
#include "training.h"
#include "debug.h"
#include "memry.h"
#include "grphics.h"
#include "evnts.h"
#include "scrollview.h"
make_int_var (LearningDebugLevel, 0, MakeLearningDebugLevel,
18, 5, SetLearningDebugLevel,
"Learning Debug Level: ");
18, 5, SetLearningDebugLevel,
"Learning Debug Level: ");
make_int_var (NormMethod, character, MakeNormMethod,
15, 10, SetNormMethod, "Normalization Method ...")
15, 10, SetNormMethod, "Normalization Method ...")
//char *demodir; /*demo home directory */
void cprintf( //Trace printf
const char *format,... //special message
void cprintf( //Trace printf
const char *format,... //special message
)
{
}
char *c_alloc_string( //allocate string
INT32 count //no of chars required
char *c_alloc_string( //allocate string
inT32 count //no of chars required
)
{
return alloc_string(count);
return alloc_string(count);
}
void c_free_string( //free a string
char *string //string to free
void c_free_string( //free a string
char *string //string to free
)
{
free_string(string);
free_string(string);
}
void *c_alloc_mem_p( //allocate permanent space
INT32 count //block size to allocate
void *c_alloc_mem_p( //allocate permanent space
inT32 count //block size to allocate
)
{
return alloc_mem_p(count);
return alloc_mem_p(count);
}
void *c_alloc_mem( //get some memory
INT32 count //no of bytes to get
void *c_alloc_mem( //get some memory
inT32 count //no of bytes to get
)
{
return alloc_mem(count);
return alloc_mem(count);
}
void c_free_mem( //free mem from alloc_mem
void *oldchunk //chunk to free
void c_free_mem( //free mem from alloc_mem
void *oldchunk //chunk to free
)
{
free_mem(oldchunk);
free_mem(oldchunk);
}
void c_check_mem( //check consistency
const char *string, //context message
INT8 level //level of check
void c_check_mem( //check consistency
const char *string, //context message
inT8 level //level of check
)
{
check_mem(string,level);
check_mem(string,level);
}
void* c_alloc_struct( //allocate memory
INT32 count, //no of chars required
const char* name //class name
void* c_alloc_struct( //allocate memory
inT32 count, //no of chars required
const char* name //class name
)
{
return alloc_struct(count,name);
return alloc_struct(count,name);
}
void c_free_struct( //free a structure
void* deadstruct, //structure to free
INT32 count, //no of bytes
const char* name //class name
void c_free_struct( //free a structure
void* deadstruct, //structure to free
inT32 count, //no of bytes
const char* name //class name
)
{
free_struct(deadstruct,count,name);
free_struct(deadstruct,count,name);
}
void c_make_current( /*move pen*/
void* win
void c_make_current( /*move pen*/
void* win
)
{
ScrollView* window = (ScrollView*) win;
window->Update();
}
void reverse32(
void* ptr
void reverse32(
void* ptr
)
{
char tmp;
char* cptr=(char*)ptr;
char tmp;
char* cptr=(char*)ptr;
tmp=*cptr;
*cptr=*(cptr+3);
*(cptr+3)=tmp;
tmp=*(cptr+1);
*(cptr+1)=*(cptr+2);
*(cptr+2)=tmp;
tmp=*cptr;
*cptr=*(cptr+3);
*(cptr+3)=tmp;
tmp=*(cptr+1);
*(cptr+1)=*(cptr+2);
*(cptr+2)=tmp;
}
void reverse16(
void* ptr
void reverse16(
void* ptr
)
{
char tmp;
char* cptr=(char*)ptr;
char tmp;
char* cptr=(char*)ptr;
tmp=*cptr;
*cptr=*(cptr+1);
*(cptr+1)=tmp;
tmp=*cptr;
*cptr=*(cptr+1);
*(cptr+1)=tmp;
}
void* 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*/
double xmin, /*scrolling limits*/
double xmax, /*to stop users*/
double ymin, /*getting lost in*/
double ymax /*empty space*/
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*/
double xmin, /*scrolling limits*/
double xmax, /*to stop users*/
double ymin, /*getting lost in*/
double ymax /*empty space*/
)
{
return new ScrollView(name, xpos, ypos, xsize, ysize, xmin + xmax, ymin + ymax, true);
}
void c_line_color_index( /*set color*/
void* win,
C_COL index
void c_line_color_index( /*set color*/
void* win,
C_COL index
)
{
// The colors are the same as the SV ones except that SV has COLOR:NONE --> offset of 1
ScrollView* window = (ScrollView*) win;
window->Pen((ScrollView::Color) (index + 1));
}
void c_move( /*move pen*/
void* win,
double x,
double y
void c_move( /*move pen*/
void* win,
double x,
double y
)
{
ScrollView* window = (ScrollView*) win;
window->SetCursor((int) x, (int) y);
}
void c_draw( /*move pen*/
void* win,
double x,
double y
void c_draw( /*move pen*/
void* win,
double x,
double y
)
{
ScrollView* window = (ScrollView*) win;
window->DrawTo((int) x, (int) y);
}
void c_clear_window( /*move pen*/
void* win
void c_clear_window( /*move pen*/
void* win
)
{
ScrollView* window = (ScrollView*) win;
window->Clear();
}
char window_wait( /*move pen*/
void* win
char window_wait( /*move pen*/
void* win
)
{
ScrollView* window = (ScrollView*) win;
ScrollView* window = (ScrollView*) win;
SVEvent* ev;
// Wait till an input event (all others are thrown away)

View File

@ -43,7 +43,7 @@ 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
@ -51,11 +51,11 @@ char *string //string to free
);
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
@ -64,17 +64,17 @@ void *oldchunk //chunk to free
void c_check_mem( //check consistency
char *string, //context message
INT8 level //level of check
inT8 level //level of check
);
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
);
@ -90,12 +90,12 @@ void reverse16(
void* ptr
);
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*/

View File

@ -37,8 +37,8 @@ RSC=rc.exe
# PROP BASE Target_Dir ""
# PROP Use_MFC 2
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "."
# PROP Intermediate_Dir "uce.Release"
# PROP Output_Dir "uce.Release6"
# PROP Intermediate_Dir "uce.Release6"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
@ -50,7 +50,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 /nologo /subsystem:console /machine:I386
# ADD LINK32 /nologo /subsystem:console /machine:I386 /out:"./unicharset_extractor.exe"
!ELSEIF "$(CFG)" == "unicharset_extractor - Win32 Debug"
@ -61,8 +61,8 @@ LINK32=link.exe
# PROP BASE Target_Dir ""
# PROP Use_MFC 2
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../bin.dbg"
# PROP Intermediate_Dir "uce.Debug"
# PROP Output_Dir "uce.Debug6"
# PROP Intermediate_Dir "uce.Debug6"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
@ -74,7 +74,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /out:"../bin.dbg6/unicharset_extractor.exe" /pdbtype:sept
!ENDIF
@ -130,6 +130,10 @@ SOURCE=..\ccutil\mfcpch.cpp
# End Source File
# Begin Source File
SOURCE=..\ccutil\serialis.cpp
# End Source File
# Begin Source File
SOURCE=..\ccutil\strngs.cpp
# ADD CPP /Yu"mfcpch.h"
# End Source File
@ -167,17 +171,7 @@ SOURCE=..\ccutil\varable.cpp
# Begin Source File
SOURCE=..\ccutil\boxread.cpp
!IF "$(CFG)" == "unicharset_extractor - Win32 Release"
# ADD CPP /Yu"mfcpch.h"
!ELSEIF "$(CFG)" == "unicharset_extractor - Win32 Debug"
# ADD CPP /Yu"mfcpch.h"
!ENDIF
# End Source File
# Begin Source File

View File

@ -205,6 +205,10 @@
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="..\ccutil\serialis.cpp"
>
</File>
<File
RelativePath="unicharset_extractor.cpp"
>

View File

@ -24,39 +24,46 @@
#include "dawg.h"
#include "makedawg.h"
#include "lookdawg.h"
#include "reduce.h"
#include "freelist.h"
#include "emalloc.h"
int main(int argc, char** argv) {
if (argc != 3) {
printf("Usage: %s word_list_file dawg_file\n", argv[0]);
return 1;
if (argc == 3) {
const char* wordlist_filename = argv[1];
const char* dawg_filename = argv[2];
EDGE_ARRAY dawg;
inT32 max_num_edges = 100000000;
inT32 reserved_edges = 1000000;
dawg = (EDGE_ARRAY) Emalloc(sizeof (EDGE_RECORD) * max_num_edges);
if (dawg == NULL) {
printf("error: Could not allocate enough memory for DAWG ");
printf("(%d ,%d bytes needed)\n",
static_cast<int>(sizeof (EDGE_RECORD) * max_num_edges / 1000),
static_cast<int>(sizeof (EDGE_RECORD) * max_num_edges % 1000));
exit(1);
}
printf("Building DAWG from word list in file, '%s'\n", wordlist_filename);
read_word_list(wordlist_filename, dawg, max_num_edges, reserved_edges);
trie_to_dawg(dawg, max_num_edges, reserved_edges);
printf("Writing squished DAWG file, '%s'\n", dawg_filename);
write_squished_dawg(dawg_filename, dawg, max_num_edges, reserved_edges);
return 0;
} else if (argc == 4 && strcmp(argv[1], "-t") == 0) {
EDGE_ARRAY words = read_squished_dawg(argv[3]);
check_for_words(words, argv[2]);
memfree(words);
return 0;
}
const char* wordlist_filename = argv[1];
const char* dawg_filename = argv[2];
EDGE_ARRAY dawg;
INT32 max_num_edges = 100000000;
INT32 reserved_edges = 1000000;
dawg = (EDGE_ARRAY) Emalloc(sizeof (EDGE_RECORD) * max_num_edges);
if (dawg == NULL) {
printf("error: Could not allocate enough memory for DAWG ");
printf("(%d,%d bytes needed)\n",
sizeof (EDGE_RECORD) * max_num_edges / 1000,
sizeof (EDGE_RECORD) * max_num_edges % 1000);
exit(1);
}
printf("Building DAWG from word list in file, '%s'\n", wordlist_filename);
read_word_list(wordlist_filename, dawg, max_num_edges, reserved_edges);
trie_to_dawg(dawg, max_num_edges, reserved_edges);
printf("Writing squished DAWG file, '%s'\n", dawg_filename);
write_squished_dawg(dawg_filename, dawg, max_num_edges, reserved_edges);
return 0;
printf("Usage: %s [-t] word_list_file dawg_file\n", argv[0]);
return 1;
}

View File

@ -37,8 +37,8 @@ RSC=rc.exe
# PROP BASE Target_Dir ""
# PROP Use_MFC 2
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "."
# PROP Intermediate_Dir "w2d.Release"
# PROP Output_Dir "w2d.Release6"
# PROP Intermediate_Dir "w2d.Release6"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
@ -49,8 +49,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386 /out:"./wordlist2dawg.exe"
!ELSEIF "$(CFG)" == "wordlist2dawg - Win32 Debug"
@ -61,20 +61,20 @@ LINK32=link.exe
# PROP BASE Target_Dir ""
# PROP Use_MFC 2
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../bin.dbg"
# PROP Intermediate_Dir "w2d.Debug"
# PROP Output_Dir "w2d.Debug6"
# PROP Intermediate_Dir "w2d.Debug6"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../ccutil" /I "../cutil" /I "../dict" /I "../viewer" /I "../ccstruct" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__MSW32__" /D "_AFXDLL" /Yu"mfcpch.h" /FD /GZ /c
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../ccutil" /I "../cutil" /I "../dict" /I "../viewer" /I "../ccstruct" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__MSW32__" /D "_AFXDLL" /Yu"mfcpch.h" /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../bin.dbg6/wordlist2dawg.exe" /pdbtype:sept
!ENDIF
@ -91,107 +91,37 @@ LINK32=link.exe
# Begin Source File
SOURCE=..\ccutil\clst.cpp
!IF "$(CFG)" == "wordlist2dawg - Win32 Release"
# ADD CPP /Yu"mfcpch.h"
!ELSEIF "$(CFG)" == "wordlist2dawg - Win32 Debug"
# ADD CPP /Yu"mfcpch.h"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\ccutil\debugwin.cpp
!IF "$(CFG)" == "wordlist2dawg - Win32 Release"
# ADD CPP /Yu"mfcpch.h"
!ELSEIF "$(CFG)" == "wordlist2dawg - Win32 Debug"
# ADD CPP /Yu"mfcpch.h"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\ccutil\errcode.cpp
!IF "$(CFG)" == "wordlist2dawg - Win32 Release"
# ADD CPP /Yu"mfcpch.h"
!ELSEIF "$(CFG)" == "wordlist2dawg - Win32 Debug"
# ADD CPP /Yu"mfcpch.h"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\ccutil\globaloc.cpp
!IF "$(CFG)" == "wordlist2dawg - Win32 Release"
# ADD CPP /Yu"mfcpch.h"
!ELSEIF "$(CFG)" == "wordlist2dawg - Win32 Debug"
# ADD CPP /Yu"mfcpch.h"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\ccutil\hashfn.cpp
!IF "$(CFG)" == "wordlist2dawg - Win32 Release"
# ADD CPP /Yu"mfcpch.h"
!ELSEIF "$(CFG)" == "wordlist2dawg - Win32 Debug"
# ADD CPP /Yu"mfcpch.h"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\ccutil\memblk.cpp
!IF "$(CFG)" == "wordlist2dawg - Win32 Release"
# ADD CPP /Yu"mfcpch.h"
!ELSEIF "$(CFG)" == "wordlist2dawg - Win32 Debug"
# ADD CPP /Yu"mfcpch.h"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\ccutil\memry.cpp
!IF "$(CFG)" == "wordlist2dawg - Win32 Release"
# ADD CPP /Yu"mfcpch.h"
!ELSEIF "$(CFG)" == "wordlist2dawg - Win32 Debug"
# ADD CPP /Yu"mfcpch.h"
!ENDIF
# End Source File
# Begin Source File
@ -200,6 +130,10 @@ SOURCE=..\ccutil\mfcpch.cpp
# End Source File
# Begin Source File
SOURCE=..\ccutil\serialis.cpp
# End Source File
# Begin Source File
SOURCE=..\ccutil\strngs.cpp
# End Source File
# Begin Source File
@ -209,17 +143,7 @@ SOURCE=..\ccutil\tessopt.cpp
# Begin Source File
SOURCE=..\ccutil\tprintf.cpp
!IF "$(CFG)" == "wordlist2dawg - Win32 Release"
# ADD CPP /Yu"mfcpch.h"
!ELSEIF "$(CFG)" == "wordlist2dawg - Win32 Debug"
# ADD CPP /Yu"mfcpch.h"
!ENDIF
# End Source File
# Begin Source File
@ -347,19 +271,18 @@ SOURCE=..\ccstruct\callcpp.cpp
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\viewer\evntlst.cpp
SOURCE=..\viewer\scrollview.cpp
# SUBTRACT CPP /YX /Yc /Yu
# End Source File
# Begin Source File
SOURCE=..\viewer\evnts.cpp
SOURCE=..\viewer\svmnode.cpp
# SUBTRACT CPP /YX /Yc /Yu
# End Source File
# Begin Source File
SOURCE=..\viewer\grphics.cpp
# End Source File
# Begin Source File
SOURCE=..\viewer\grphshm.cpp
SOURCE=..\viewer\svutil.cpp
# SUBTRACT CPP /YX /Yc /Yu
# End Source File
# End Group
# Begin Source File

View File

@ -414,6 +414,10 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\ccutil\serialis.cpp"
>
</File>
<File
RelativePath="..\ccutil\strngs.cpp"
>
@ -1021,15 +1025,14 @@
Name="viewer"
>
<File
RelativePath="..\viewer\evntlst.cpp"
RelativePath="..\viewer\scrollview.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="0"
/>
</FileConfiguration>
<FileConfiguration
@ -1037,21 +1040,23 @@
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="0"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\viewer\evnts.cpp"
RelativePath="..\viewer\scrollview.h"
>
</File>
<File
RelativePath="..\viewer\svmnode.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="0"
/>
</FileConfiguration>
<FileConfiguration
@ -1059,21 +1064,23 @@
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="0"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\viewer\grphics.cpp"
RelativePath="..\viewer\svmnode.h"
>
</File>
<File
RelativePath="..\viewer\svutil.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="0"
/>
</FileConfiguration>
<FileConfiguration
@ -1081,32 +1088,13 @@
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="0"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\viewer\grphshm.cpp"
RelativePath="..\viewer\svutil.h"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
</Filter>
</Filter>