54 assert (Templates !=
NULL);
55 assert (Class !=
NULL);
63 assert (Templates->
Class[ClassId] ==
NULL);
64 Templates->
Class[ClassId] = Class;
81 assert (Config !=
NULL);
97 assert(Config !=
NULL);
201 if (templates !=
NULL) {
203 for (i = 0; i < (templates->
Templates)->NumClasses; i++)
225 int NumProtos = MaxProtoId + 1;
229 "TEMP_CONFIG_STRUCT");
278 fprintf (File,
"\n\nSUMMARY OF ADAPTED TEMPLATES:\n\n");
279 fprintf (File,
"Num classes = %d; Num permanent classes = %d\n\n",
281 fprintf (File,
" Id NC NPC NP NPP\n");
282 fprintf (File,
"------------------------\n");
284 for (i = 0; i < (Templates->
Templates)->NumClasses; i++) {
286 AClass = Templates->
Class[i];
288 fprintf (File,
"%5d %s %3d %3d %3d %3d\n",
295 fprintf (File,
"\n");
333 fread ((
char *) &NumTempProtos,
sizeof (
int), 1, File);
335 for (i = 0; i < NumTempProtos; i++) {
338 "TEMP_PROTO_STRUCT");
344 fread ((
char *) &NumConfigs,
sizeof (
int), 1, File);
345 for (i = 0; i < NumConfigs; i++)
381 for (i = 0; i < (Templates->
Templates)->NumClasses; i++) {
404 "PERM_CONFIG_STRUCT");
406 fread ((
char *) &NumAmbigs,
sizeof(
uinT8), 1, File);
409 Config->
Ambigs[NumAmbigs] = -1;
410 fread(&(Config->
FontinfoId),
sizeof(
int), 1, File);
434 "TEMP_CONFIG_STRUCT");
475 fwrite ((
char *) &NumTempProtos,
sizeof (
int), 1, File);
483 fwrite ((
char *) &NumConfigs,
sizeof (
int), 1, File);
484 for (i = 0; i < NumConfigs; i++)
515 for (i = 0; i < (Templates->
Templates)->NumClasses; i++) {
538 assert (Config !=
NULL);
539 while (Config->
Ambigs[NumAmbigs] > 0) ++NumAmbigs;
541 fwrite((
char *) &NumAmbigs,
sizeof(
uinT8), 1, File);
543 fwrite(&(Config->
FontinfoId),
sizeof(
int), 1, File);
560 assert (Config !=
NULL);
#define zero_all_bits(array, length)
void memfree(void *element)
void FreeBitVector(BIT_VECTOR BitVector)
void free_adapted_class(ADAPT_CLASS adapt_class)
#define WordsInVectorOfSize(NumBits)
#define PermConfigFor(Class, ConfigId)
INT_CLASS Class[MAX_NUM_CLASSES]
ADAPT_TEMPLATES NewAdaptedTemplates(bool InitFromUnicharset)
TEMP_CONFIG ReadTempConfig(FILE *File)
BIT_VECTOR NewBitVector(int NumBits)
TEMP_PROTO NewTempProto()
TEMP_CONFIG NewTempConfig(int MaxProtoId, int FontinfoId)
ADAPT_TEMPLATES ReadAdaptedTemplates(FILE *File)
PERM_CONFIG_STRUCT * PERM_CONFIG
ADAPT_CLASS NewAdaptedClass()
#define IsEmptyAdaptedClass(Class)
#define ConfigIsPermanent(Class, ConfigId)
INT_CLASS NewIntClass(int MaxNumProtos, int MaxNumConfigs)
#define test_bit(array, bit)
void WriteAdaptedTemplates(FILE *File, ADAPT_TEMPLATES Templates)
void WritePermConfig(FILE *File, PERM_CONFIG Config)
ADAPT_CLASS Class[MAX_NUM_CLASSES]
ADAPTED_CONFIG Config[MAX_NUM_CONFIGS]
ADAPT_CLASS_STRUCT * ADAPT_CLASS
void AddAdaptedClass(ADAPT_TEMPLATES Templates, ADAPT_CLASS Class, CLASS_ID ClassId)
PERM_CONFIG ReadPermConfig(FILE *File)
const char *const id_to_unichar(UNICHAR_ID id) const
INT_TEMPLATES NewIntTemplates()
#define TempConfigFor(Class, ConfigId)
TEMP_PROTO_STRUCT * TEMP_PROTO
void WriteAdaptedClass(FILE *File, ADAPT_CLASS Class, int NumConfigs)
void WriteTempConfig(FILE *File, TEMP_CONFIG Config)
void AddIntClass(INT_TEMPLATES Templates, CLASS_ID ClassId, INT_CLASS Class)
LIST push_last(LIST list, void *item)
void FreePermConfig(PERM_CONFIG Config)
INT_TEMPLATES ReadIntTemplates(FILE *File)
void destroy_nodes(LIST list, void_dest destructor)
ADAPT_TEMPLATES_STRUCT * ADAPT_TEMPLATES
#define UnusedClassIdIn(T, c)
int GetFontinfoId(ADAPT_CLASS Class, uinT8 ConfigId)
ADAPT_CLASS ReadAdaptedClass(FILE *File)
void PrintAdaptedTemplates(FILE *File, ADAPT_TEMPLATES Templates)
void * alloc_struct(inT32 count, const char *)
void free_int_templates(INT_TEMPLATES templates)
void FreeTempProto(void *arg)
void WriteIntTemplates(FILE *File, INT_TEMPLATES Templates, const UNICHARSET &target_unicharset)
void free_adapted_templates(ADAPT_TEMPLATES templates)
void free_struct(void *deadstruct, inT32, const char *)
TEMP_CONFIG_STRUCT * TEMP_CONFIG
void FreeTempConfig(TEMP_CONFIG Config)