#include "oldlist.h"
#include "intproto.h"
#include <stdio.h>
Go to the source code of this file.
Macro Definition Documentation
#define ConfigIsPermanent |
( |
|
Class, |
|
|
|
ConfigId |
|
) |
| (test_bit ((Class)->PermConfigs, ConfigId)) |
#define IncreaseConfidence |
( |
|
TempConfig | ) |
((TempConfig)->NumTimesSeen++) |
#define IsEmptyAdaptedClass |
( |
|
Class | ) |
|
Value:((Class)->NumPermConfigs == 0 && \
Definition at line 90 of file adaptive.h.
#define MakeConfigPermanent |
( |
|
Class, |
|
|
|
ConfigId |
|
) |
| (SET_BIT ((Class)->PermConfigs, ConfigId)) |
#define MakeProtoPermanent |
( |
|
Class, |
|
|
|
ProtoId |
|
) |
| (SET_BIT ((Class)->PermProtos, ProtoId)) |
#define NumNonEmptyClassesIn |
( |
|
Template | ) |
((Template)->NumNonEmptyClasses) |
#define PermConfigFor |
( |
|
Class, |
|
|
|
ConfigId |
|
) |
| ((Class)->Config[ConfigId].Perm) |
#define TempConfigFor |
( |
|
Class, |
|
|
|
ConfigId |
|
) |
| ((Class)->Config[ConfigId].Temp) |
Typedef Documentation
Function Documentation
This routine adds a new adapted class to an existing set of adapted templates.
- Parameters:
-
Templates | set of templates to add new class to |
Class | new class to add to templates |
ClassId | class id to associate with new class |
- Note:
- Globals: none
-
Exceptions: none
-
History: Thu Mar 14 13:06:09 1991, DSJ, Created.
Definition at line 49 of file adaptive.cpp.
{
assert (Templates !=
NULL);
Templates->
Class[ClassId] = Class;
}
This routine frees all memory consumed by a temporary configuration.
- Parameters:
-
- Note:
- Globals: none
-
Exceptions: none
-
History: Thu Mar 14 13:34:23 1991, DSJ, Created.
Definition at line 80 of file adaptive.cpp.
void FreeTempProto |
( |
void * |
arg | ) |
|
This operation allocates and initializes a new adapted class data structure and returns a ptr to it.
- Returns:
- Ptr to new class data structure.
- Note:
- Globals: none
-
Exceptions: none
-
History: Thu Mar 14 12:58:13 1991, DSJ, Created.
Definition at line 113 of file adaptive.cpp.
{
int i;
return (Class);
}
TEMP_CONFIG NewTempConfig |
( |
int |
MaxProtoId, |
|
|
int |
FontinfoId |
|
) |
| |
This routine allocates and returns a new temporary config.
- Parameters:
-
MaxProtoId | max id of any proto in new config |
FontinfoId | font information from pre-trained templates |
- Returns:
- Ptr to new temp config.
- Note:
- Globals: none
-
Exceptions: none
-
History: Thu Mar 14 13:28:21 1991, DSJ, Created.
Definition at line 223 of file adaptive.cpp.
{
int NumProtos = MaxProtoId + 1;
Config =
"TEMP_CONFIG_STRUCT");
return (Config);
}
This routine allocates and returns a new temporary proto.
- Returns:
- Ptr to new temporary proto.
- Note:
- Globals: none
-
Exceptions: none
-
History: Thu Mar 14 13:31:31 1991, DSJ, Created.
Definition at line 254 of file adaptive.cpp.
Read an adapted class description from File and return a ptr to the adapted class.
- Parameters:
-
File | open file to read adapted class from |
- Returns:
- Ptr to new adapted class.
- Note:
- Globals: none
-
Exceptions: none
-
History: Tue Mar 19 14:11:01 1991, DSJ, Created.
Definition at line 315 of file adaptive.cpp.
{
int NumTempProtos;
int NumConfigs;
int i;
fread ((char *) &NumTempProtos, sizeof (int), 1, File);
for (i = 0; i < NumTempProtos; i++) {
TempProto =
"TEMP_PROTO_STRUCT");
}
fread ((char *) &NumConfigs, sizeof (int), 1, File);
for (i = 0; i < NumConfigs; i++)
else
return (Class);
}
Read a permanent configuration description from File and return a ptr to it.
- Parameters:
-
File | open file to read permanent config from |
- Returns:
- Ptr to new permanent configuration description.
- Note:
- Globals: none
-
Exceptions: none
-
History: Tue Mar 19 14:25:26 1991, DSJ, Created.
Definition at line 404 of file adaptive.cpp.
{
"PERM_CONFIG_STRUCT");
fread ((
char *) &NumAmbigs,
sizeof(
uinT8), 1, File);
Config->
Ambigs[NumAmbigs] = -1;
fread(&(Config->
FontinfoId),
sizeof(
int), 1, File);
return (Config);
}
Read a temporary configuration description from File and return a ptr to it.
- Parameters:
-
File | open file to read temporary config from |
- Returns:
- Ptr to new temporary configuration description.
- Note:
- Globals: none
-
Exceptions: none
-
History: Tue Mar 19 14:29:59 1991, DSJ, Created.
Definition at line 431 of file adaptive.cpp.
{
Config =
"TEMP_CONFIG_STRUCT");
return (Config);
}
void WriteAdaptedClass |
( |
FILE * |
File, |
|
|
ADAPT_CLASS |
Class, |
|
|
int |
NumConfigs |
|
) |
| |
This routine writes a binary representation of Class to File.
- Parameters:
-
File | open file to write Class to |
Class | adapted class to write to File |
NumConfigs | number of configs in Class |
- Note:
- Globals: none
-
Exceptions: none
-
History: Tue Mar 19 13:33:51 1991, DSJ, Created.
Definition at line 461 of file adaptive.cpp.
{
int NumTempProtos;
int i;
fwrite ((char *) &NumTempProtos, sizeof (int), 1, File);
}
fwrite ((char *) &NumConfigs, sizeof (int), 1, File);
for (i = 0; i < NumConfigs; i++)
else
}
void WritePermConfig |
( |
FILE * |
File, |
|
|
PERM_CONFIG |
Config |
|
) |
| |
This routine writes a binary representation of a permanent configuration to File.
- Parameters:
-
File | open file to write Config to |
Config | permanent config to write to File |
- Note:
- Globals: none
-
Exceptions: none
-
History: Tue Mar 19 13:55:44 1991, DSJ, Created.
Definition at line 537 of file adaptive.cpp.
{
while (Config->
Ambigs[NumAmbigs] > 0) ++NumAmbigs;
fwrite((
char *) &NumAmbigs,
sizeof(
uinT8), 1, File);
fwrite(&(Config->
FontinfoId),
sizeof(
int), 1, File);
}
void WriteTempConfig |
( |
FILE * |
File, |
|
|
TEMP_CONFIG |
Config |
|
) |
| |
This routine writes a binary representation of a temporary configuration to File.
- Parameters:
-
File | open file to write Config to |
Config | temporary config to write to File |
- Note:
- Globals: none
-
Exceptions: none
-
History: Tue Mar 19 14:00:28 1991, DSJ, Created.
Definition at line 561 of file adaptive.cpp.