2
Copyright (c) 1993-2008, Cognitive Technologies
5
����������� ��������� ��������������� � ������������� ��� � ���� ��������� ����,
6
��� � � �������� �����, � ����������� ��� ���, ��� ���������� ��������� �������:
8
* ��� ��������� ��������������� ��������� ���� ������ ���������� ���������
9
���� ����������� �� ��������� �����, ���� ������ ������� � �����������
11
* ��� ��������� ��������������� ��������� ���� � ������������ �/��� �
12
������ ����������, ������������ ��� ���������������, ������ �����������
13
��������� ���� ���������� �� ��������� �����, ���� ������ ������� �
14
����������� ����� �� ��������.
15
* �� �������� Cognitive Technologies, �� ����� �� ����������� �� �����
16
���� ������������ � �������� �������� ��������� �/��� �����������
17
���������, ���������� �� ���� ��, ��� ���������������� �����������
20
��� ��������� ������������� ����������� ��������� ���� �/��� ������� ������ "���
21
��� ����" ��� ������-���� ���� ��������, ���������� ���� ��� ���������������,
22
������� �������� ������������ �������� � ����������� ��� ���������� ����, �� ��
23
������������� ���. �� �������� ��������� ���� � �� ���� ������ ����, �������
24
����� �������� �/��� �������� �������������� ���������, �� � ���� ������ ��
25
��Ѩ� ���������������, ������� ����� �����, ���������, ����������� ���
26
������������� ������, ��������� � �������������� ��� ���������� ����������
27
������������� ������������� ��������� (������� ������ ������, ��� ������,
28
������� ���������, ��� ������ �/��� ������ �������, ���������� ��-�� ��������
29
������� ��� �/��� ������ ��������� �������� ��������� � ������� �����������,
30
�� �� ������������� ����� ��������), �� �� ������������� ���, ���� ���� �����
31
�������� ��� ������ ���� ���� �������� � ����������� ����� ������� � ������.
33
Redistribution and use in source and binary forms, with or without modification,
34
are permitted provided that the following conditions are met:
36
* Redistributions of source code must retain the above copyright notice,
37
this list of conditions and the following disclaimer.
38
* Redistributions in binary form must reproduce the above copyright notice,
39
this list of conditions and the following disclaimer in the documentation
40
and/or other materials provided with the distribution.
41
* Neither the name of the Cognitive Technologies nor the names of its
42
contributors may be used to endorse or promote products derived from this
43
software without specific prior written permission.
45
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
46
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
47
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
48
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
49
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
50
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
51
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
52
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
53
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
54
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2
Copyright (c) 1993-2008, Cognitive Technologies
5
Разрешается повторное распространение и использование как в виде исходного кода,
6
так и в двоичной форме, с изменениями или без, при соблюдении следующих условий:
8
* При повторном распространении исходного кода должны оставаться указанное
9
выше уведомление об авторском праве, этот список условий и последующий
11
* При повторном распространении двоичного кода в документации и/или в
12
других материалах, поставляемых при распространении, должны сохраняться
13
указанная выше информация об авторском праве, этот список условий и
14
последующий отказ от гарантий.
15
* Ни название Cognitive Technologies, ни имена ее сотрудников не могут
16
быть использованы в качестве средства поддержки и/или продвижения
17
продуктов, основанных на этом ПО, без предварительного письменного
20
ЭТА ПРОГРАММА ПРЕДОСТАВЛЕНА ВЛАДЕЛЬЦАМИ АВТОРСКИХ ПРАВ И/ИЛИ ДРУГИМИ ЛИЦАМИ "КАК
21
ОНА ЕСТЬ" БЕЗ КАКОГО-ЛИБО ВИДА ГАРАНТИЙ, ВЫРАЖЕННЫХ ЯВНО ИЛИ ПОДРАЗУМЕВАЕМЫХ,
22
ВКЛЮЧАЯ ГАРАНТИИ КОММЕРЧЕСКОЙ ЦЕННОСТИ И ПРИГОДНОСТИ ДЛЯ КОНКРЕТНОЙ ЦЕЛИ, НО НЕ
23
ОГРАНИЧИВАЯСЬ ИМИ. НИ ВЛАДЕЛЕЦ АВТОРСКИХ ПРАВ И НИ ОДНО ДРУГОЕ ЛИЦО, КОТОРОЕ
24
МОЖЕТ ИЗМЕНЯТЬ И/ИЛИ ПОВТОРНО РАСПРОСТРАНЯТЬ ПРОГРАММУ, НИ В КОЕМ СЛУЧАЕ НЕ
25
НЕСЁТ ОТВЕТСТВЕННОСТИ, ВКЛЮЧАЯ ЛЮБЫЕ ОБЩИЕ, СЛУЧАЙНЫЕ, СПЕЦИАЛЬНЫЕ ИЛИ
26
ПОСЛЕДОВАВШИЕ УБЫТКИ, СВЯЗАННЫЕ С ИСПОЛЬЗОВАНИЕМ ИЛИ ПОНЕСЕННЫЕ ВСЛЕДСТВИЕ
27
НЕВОЗМОЖНОСТИ ИСПОЛЬЗОВАНИЯ ПРОГРАММЫ (ВКЛЮЧАЯ ПОТЕРИ ДАННЫХ, ИЛИ ДАННЫЕ,
28
СТАВШИЕ НЕГОДНЫМИ, ИЛИ УБЫТКИ И/ИЛИ ПОТЕРИ ДОХОДОВ, ПОНЕСЕННЫЕ ИЗ-ЗА ДЕЙСТВИЙ
29
ТРЕТЬИХ ЛИЦ И/ИЛИ ОТКАЗА ПРОГРАММЫ РАБОТАТЬ СОВМЕСТНО С ДРУГИМИ ПРОГРАММАМИ,
30
НО НЕ ОГРАНИЧИВАЯСЬ ЭТИМИ СЛУЧАЯМИ), НО НЕ ОГРАНИЧИВАЯСЬ ИМИ, ДАЖЕ ЕСЛИ ТАКОЙ
31
ВЛАДЕЛЕЦ ИЛИ ДРУГОЕ ЛИЦО БЫЛИ ИЗВЕЩЕНЫ О ВОЗМОЖНОСТИ ТАКИХ УБЫТКОВ И ПОТЕРЬ.
33
Redistribution and use in source and binary forms, with or without modification,
34
are permitted provided that the following conditions are met:
36
* Redistributions of source code must retain the above copyright notice,
37
this list of conditions and the following disclaimer.
38
* Redistributions in binary form must reproduce the above copyright notice,
39
this list of conditions and the following disclaimer in the documentation
40
and/or other materials provided with the distribution.
41
* Neither the name of the Cognitive Technologies nor the names of its
42
contributors may be used to endorse or promote products derived from this
43
software without specific prior written permission.
45
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
46
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
47
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
48
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
49
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
50
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
51
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
52
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
53
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
54
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
57
57
#include <assert.h>
117
103
// 4) call function spelling
120
void * (*my_alloc)(Word32 )= RLINGAlloc; //rling_alloc;
121
void (*my_free)(void * )= RLINGFree; //rling_free;
122
void user_voc_init(void);
123
void GetRecFileName(Int16 tab,Int16 lang, PInt8 wname);
124
void append_by_lang (Int16 lang, PInt8 src, PInt8 dst);
125
//Word32 LoadUserDict(PChar8 DictName, PChar8 pool, Word32 pool_size, voc_state *user_dict);
106
void * (*my_alloc)(uint32_t) = RLINGAlloc; //rling_alloc;
107
void (*my_free)(void *) = RLINGFree; //rling_free;
108
void user_voc_init(void);
109
void GetRecFileName(int16_t tab, int16_t lang, pchar wname);
110
void append_by_lang(int16_t lang, pchar src, pchar dst);
126
111
///////////////////////////////////////////////////////////
128
113
///////////////////////////////////////////////////////////
129
114
void trees_load_rling(void);
130
static void read_rec_file(Int16 fileno, PWord8 pool, PWord8 * end);
131
static PWord8 preload_font_BOX( PWord8 free );
132
static PWord8 load_BOX(PWord8 free);
133
static PWord8 preload_font_BOX( PWord8 free );
115
static void read_rec_file(int16_t fileno, puchar pool, puchar * end);
116
static puchar preload_font_BOX(puchar free);
117
static puchar load_BOX(puchar free);
118
static puchar preload_font_BOX(puchar free);
134
119
static void reload_lang_vocs();
135
static void correct_let_tables(void); // ��뢠���� � 䠩�� EMBBOX.C: load_BOX()
120
static void correct_let_tables(void); // ўл§лў Ґвбп ў д ©«Ґ EMBBOX.C: load_BOX()
136
121
static void correct_letters_pidx_table(void);
137
static PWord8 list_BOX(PWord8 free, Int16 typl);
138
static void straight_BOX(PWord8 free);
122
static puchar list_BOX(puchar free, int16_t typl);
123
static void straight_BOX(puchar free);
141
Word8 multy_language;
144
Bool16 FlagMixedText;
145
PWord8 ED_file_start = NULL;
146
PWord8 ED_file_end = NULL;
147
PWord8 ED_out_end = NULL;
148
PWord8 svbox_pool = NULL;
149
Int16 CheckOpenBinType = (Int16)(O_RDONLY | O_BINARY);
150
Int16 CheckOpenTxtType = (Int16)(O_RDONLY | O_TEXT);
151
Int16 CheckOpenSubType = (Int16)(S_IREAD);
152
static PWord8 memory_pool = NULL; /* start of memory pool */
153
static PWord8 memory_pool_end = NULL; /* end of memory pool */
154
static PWord8 auto_pool = NULL; /* boxes pool for auto & font tables */
155
static PWord8 box_pool = NULL; /* boxes pool for extr_comp */
156
static PWord8 events_tree = NULL;
157
static PWord8 events_tree_rt = NULL; /* events tree memory start */
158
static Word8 sv_lang = 255;
159
static PWord8 tableBOX = NULL; /* BOX table memory start */
160
static Word8 all_loaded = 0;
161
static PWord8 fontBOX = NULL; /* BOX table for font */
162
static PWord8 omniBOX = NULL; /* BOX save table for omni */
163
static Int32 box_n = BOX_NUM0;
164
static PROOT root_file = NULL; /* start of the root file */
165
static PWord8 full_list[512];
166
static PWord8 font_full_list[512];
167
static PWord8 omni_full_list[512];
168
static Int8 seq_name[] = "rec0";
169
Int8 own_dir[256] = {"./"};
170
static Int8 txt_ext[16] = {"txt"};
171
static Int16 file_handle[16] = { -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};
172
static Int16 file_stream[16] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
173
static Int16 stream_op[10] = {0,0,0,0,0,0,0,0,0,0};
174
static Int8 *lang_suff[LANG_TOTAL] =
176
"","grm","frn","rus","swe","spa","ita","r&e","ukr","ser","cro","pol","dan","por","dut","dig",
177
"uzb","kaz","kaz", // 04.09.2000 E.P.
178
"cze","rom","hun","bul", // 04.09.2000 E.P. LANG_CZECH � �.�.
179
"slo", // LANG_SLOVENIAN 25.05.2001 E.P.
180
"lat","lit","est", // LANG_LATVIAN � �.�.
181
"tur" // 03.06.2002 E.P.
126
uchar multy_language;
129
Bool16 FlagMixedText;
130
puchar ED_file_start = NULL;
131
puchar ED_file_end = NULL;
132
puchar ED_out_end = NULL;
133
puchar svbox_pool = NULL;
134
int16_t CheckOpenBinType = (int16_t) (O_RDONLY | O_BINARY);
135
int16_t CheckOpenTxtType = (int16_t) (O_RDONLY | O_TEXT);
136
int16_t CheckOpenSubType = (int16_t) (S_IREAD);
137
static puchar memory_pool = NULL; /* start of memory pool */
138
static puchar memory_pool_end = NULL; /* end of memory pool */
139
static puchar auto_pool = NULL; /* boxes pool for auto & font tables */
140
static puchar box_pool = NULL; /* boxes pool for extr_comp */
141
static puchar events_tree = NULL;
142
static puchar events_tree_rt = NULL; /* events tree memory start */
143
static uchar sv_lang = 255;
144
static puchar tableBOX = NULL; /* BOX table memory start */
145
static uchar all_loaded = 0;
146
static puchar fontBOX = NULL; /* BOX table for font */
147
static puchar omniBOX = NULL; /* BOX save table for omni */
148
static int32_t box_n = BOX_NUM0;
149
static PROOT root_file = NULL; /* start of the root file */
150
static puchar full_list[512];
151
static puchar font_full_list[512];
152
static puchar omni_full_list[512];
153
static char seq_name[] = "rec0";
154
char own_dir[256] = { "./" };
155
static char txt_ext[16] = { "txt" };
156
static int16_t file_handle[16] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
157
-1, -1, -1, -1, -1 };
158
static int16_t file_stream[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
160
static int16_t stream_op[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
161
static char *lang_suff[] = { "", "grm", "frn", "rus", "swe", "spa", "ita",
162
"r&e", "ukr", "ser", "cro", "pol", "dan", "por", "dut", "dig", "uzb",
163
"kaz", "kaz", // 04.09.2000 E.P.
164
"cze", "rom", "hun", "bul", // 04.09.2000 E.P. LANG_CZECH и т.д.
165
"slo", // LANG_SLOVENIAN 25.05.2001 E.P.
166
"lat", "lit", "est", // LANG_LATVIAN и т.д.
167
"tur" // 03.06.2002 E.P.
183
169
/////////////////////////////////////////////////////////////////////////////////////
184
170
// exit generation functions
185
typedef void(*pExitByCatchFunc)(Int32);
186
pExitByCatchFunc pExitFunc = NULL;
188
void SetErrorExit( pExitByCatchFunc pExternalExitFunc )
190
pExitFunc = pExternalExitFunc;
193
void ErrorExit(int Code)
195
if (pExitFunc != NULL )
198
////////////////////////////////////////////////////////////////////////////////////
200
void TE_make_name (Int16 stream, PInt8 name, PInt8 wname)
209
/* FIXME: own_dir gets changed somewhere so it points to "/" rather than "./".
212
*/ strcpy(wname, "./");
213
strcat (wname, name);
226
strcpy (wname, name);
238
strcat (wname,".ed");
243
strcat (wname,txt_ext);
250
strcpy (wname, name);
254
////////////////////////////////////////////////////////////////////////////////////
256
void GetRecFileName(Int16 tab,Int16 lang, PInt8 wname)
258
seq_name[3] = tab + '0';
259
append_by_lang (lang, seq_name, wname);
260
strcat(wname,".dat");
171
typedef void(*pExitByCatchFunc)(int32_t);
172
pExitByCatchFunc pExitFunc = NULL;
174
void SetErrorExit(pExitByCatchFunc pExternalExitFunc) {
175
pExitFunc = pExternalExitFunc;
178
void ErrorExit(int Code) {
179
if (pExitFunc != NULL)
182
////////////////////////////////////////////////////////////////////////////////////
184
void TE_make_name(int16_t stream, pchar name, pchar wname) {
191
/* FIXME: own_dir gets changed somewhere so it points to "/" rather than "./".
206
if (*(--pn) == '.') {
218
strcat(wname, ".ed");
223
strcat(wname, txt_ext);
234
////////////////////////////////////////////////////////////////////////////////////
236
void GetRecFileName(int16_t tab, int16_t lang, pchar wname) {
237
seq_name[3] = tab + '0';
238
append_by_lang(lang, seq_name, wname);
239
strcat(wname, ".dat");
262
241
////////////////////////////////////////////////////////////////////////////////////
270
if (!spelling(comp_file, comp_lth))
278
////////////////////////////////////////////////////////////////////////////////////
280
void append_by_lang (Int16 lang, PInt8 src, PInt8 dst)
284
if ((lang >= 0) && (lang < LANG_TOTAL))
286
strcat(dst,lang_suff[lang]);
288
/* ������������� 09.07.2001 E.P.
291
if( is_cen_language(language) && // 08.09.2000 E.P.
293
strcat(dst,"CEN"); // rec1,rec2,rec3 for croatian
295
strcat(dst,"R&E"); // rec1,rec2,rec3 for Rus/Eng mode
299
////////////////////////////////////////////////////////////////////////////////////
301
Int16 TE_open(Int16 Stream, PInt8 Name, Int16 Type, Int16 SubType)
307
TE_make_name (Stream, Name, Wname);
309
for (fn = 1; fn < 16; fn++)
311
if (file_handle[fn]==-1)
313
i = open_data_file(Name, Type); /*, SubType); */
319
file_stream[fn] = Stream;
320
stream_op [Stream] ++;
327
////////////////////////////////////////////////////////////////////////////////////
329
Int16 TE_write(Int16 File, PWord8 Data, Word32 Size)
333
if ((i=file_handle[File]) < 0)
336
return write(i, Data, Size);
338
////////////////////////////////////////////////////////////////////////////////////
340
Int16 TE_table_op(Int16 Stream, Int16 Language, Int16 Type, Int16 SubType)
344
GetRecFileName(Stream,Language,Wname);
345
return TE_open (TB_STREAM, Wname, Type, SubType);
348
Int32 TE_read(Int16 File, PInt8 Buffer, Int32 Size)
352
if ((i=file_handle[File]) < 0)
355
return read (i, Buffer, Size);
358
Int16 TE_close(Int16 File)
362
if ((File < 0) || (File > 9))
365
if ((i=file_handle[File]) < 0)
369
s = file_stream [File];
371
file_handle [File] = -1;
372
file_stream [File] = 0;
376
PInt8 TE_handle_fgets ( Int16 Handle, PInt8 Buff, Int16 Lenght )
382
if ( Handle <= 0 || Buff == NULL || Lenght < 1 )
389
ret =(Int16)TE_read( Handle, &ch, 1L );
249
if (!spelling(comp_file, comp_lth))
257
////////////////////////////////////////////////////////////////////////////////////
259
void append_by_lang(int16_t lang, pchar src, pchar dst) {
262
if ((lang >= 0) && (lang < LANG_TOTAL)) {
263
strcat(dst, lang_suff[lang]);
265
/* Закомментарил 09.07.2001 E.P.
268
if( is_cen_language(language) && // 08.09.2000 E.P.
270
strcat(dst,"CEN"); // rec1,rec2,rec3 for croatian
272
strcat(dst,"R&E"); // rec1,rec2,rec3 for Rus/Eng mode
276
////////////////////////////////////////////////////////////////////////////////////
278
int16_t TE_open(int16_t Stream, pchar Name, int16_t Type, int16_t SubType) {
283
TE_make_name(Stream, Name, Wname);
285
for (fn = 1; fn < 16; fn++) {
286
if (file_handle[fn] == -1) {
287
i = open_data_file(Name, Type); /*, SubType); */
293
file_stream[fn] = Stream;
301
////////////////////////////////////////////////////////////////////////////////////
303
int16_t TE_write(int16_t File, puchar Data, uint32_t Size) {
306
if ((i = file_handle[File]) < 0)
309
return write(i, Data, Size);
311
////////////////////////////////////////////////////////////////////////////////////
313
int16_t TE_table_op(int16_t Stream, int16_t Language, int16_t Type,
317
GetRecFileName(Stream, Language, Wname);
318
return TE_open(TB_STREAM, Wname, Type, SubType);
321
int32_t TE_read(int16_t File, pchar Buffer, int32_t Size) {
324
if ((i = file_handle[File]) < 0)
327
return read(i, Buffer, Size);
330
int16_t TE_close(int16_t File) {
333
if ((File < 0) || (File > 9))
336
if ((i = file_handle[File]) < 0)
340
s = file_stream[File];
342
file_handle[File] = -1;
343
file_stream[File] = 0;
347
pchar TE_handle_fgets(int16_t Handle, pchar Buff, int16_t Lenght) {
352
if (Handle <= 0 || Buff == NULL || Lenght < 1) {
357
ret = (int16_t) TE_read(Handle, &ch, 1L);
401
367
/* MinGW file io seems to turn windows file endings into \n
402
so break -- no skip as when the \r is passed through */
368
so break -- no skip as when the \r is passed through */
369
#if defined(WIN32) || defined(__CYGWIN__)
408
if ( ch == '\r' ) /* JussiP: The data files have Windows line endings. */
410
TE_read(Handle, &ch, 1L); /* Skip the following \n. */
374
if (ch == '\r') /* JussiP: The data files have Windows line endings. */
376
TE_read(Handle, &ch, 1L); /* Skip the following \n. */
425
391
///////////////////////////////////////////////////////////////////////////////////////////////////////
427
Int32 TE_file_length(Int16 fn)
431
if ((i=file_handle[fn]) < 0)
434
return filelength (i);
393
int32_t TE_file_length(int16_t fn) {
396
if ((i = file_handle[fn]) < 0)
399
return filelength(i);
437
void ed_out_write(PWord8 p, Word16 size)
441
memcpy (ED_out_end, p, size);
402
void ed_out_write(puchar p, uint16_t size) {
404
memcpy(ED_out_end, p, size);
446
409
///////////////////////////////////////////////////////////////////////////////////
448
void trees_load_rling()
451
//////////////////////////////////////////////////////////////////////
452
// ������ ������ �������, ������ ������ ��� ���
453
memory_pool = svbox_pool;
454
memory_pool_end = memory_pool + SizeTables;
411
void trees_load_rling() {
413
//////////////////////////////////////////////////////////////////////
414
// грузим только словари, память только под них
415
memory_pool = svbox_pool;
416
memory_pool_end = memory_pool + SizeTables;
461
423
////////////////////////////////////////////////////////
463
void read_rec_file(Int16 fileno, PWord8 pool, PWord8 * end)
468
h = TBOPEN(fileno,-1,(Int16)(O_RDONLY|O_BINARY), 0);
471
ErrorExit(RLING_ERROR_CANT_OPEN_TABLE);
473
l=TGREAD(h,pool,0x100000);
425
void read_rec_file(int16_t fileno, puchar pool, puchar * end) {
429
h = TBOPEN(fileno, -1, (int16_t) (O_RDONLY | O_BINARY), 0);
432
ErrorExit(RLING_ERROR_CANT_OPEN_TABLE);
434
l = TGREAD(h, pool, 0x100000);
478
439
//////////////////////////////////////////////////////////////////////////////////////
479
// ��������� �� filesys.c
480
void reload_lang_vocs()
484
correct_letters_pidx_table();
485
correct_let_tables();
489
box_pool = svbox_pool;
490
box_pool = load_stat_dict(box_pool);
491
box_pool += (memory_pool - box_pool) & 0xf;
495
box_pool = svbox_pool;
497
if ((memory_pool+SizeTables)<box_pool)
498
ErrorExit(RLING_ERROR_MEMORY_FAULT);
499
// Max size for recog tables storing
500
box_pool = memory_pool + SizeTables;
503
// roots_lth = box_n;
504
// roots_lth *= BOXSIZE;
505
// root_file = (PROOT)((PWord8)box_pool + roots_lth);
507
// if (memory_pool_end <= (PWord8)root_file)
510
////////////////////////////////////////////////////////////////////////////////////////
511
// ��������� �� acc_tabs.c
512
void correct_let_tables(void) // ��뢠���� � 䠩�� EMBBOX.C: load_BOX()
518
////////////////////////////////////////////////////////////////////////////////////////
519
// ��������� �� proptab.c
520
void correct_letters_pidx_table(void)
440
// протащено из filesys.c
441
void reload_lang_vocs() {
444
correct_letters_pidx_table();
445
correct_let_tables();
449
box_pool = svbox_pool;
450
box_pool = load_stat_dict(box_pool);
451
box_pool += (memory_pool - box_pool) & 0xf;
455
box_pool = svbox_pool;
457
if ((memory_pool + SizeTables) < box_pool)
458
ErrorExit(RLING_ERROR_MEMORY_FAULT);
459
// Max size for recog tables storing
460
box_pool = memory_pool + SizeTables;
463
// roots_lth = box_n;
464
// roots_lth *= BOXSIZE;
465
// root_file = (PROOT)((puchar)box_pool + roots_lth);
467
// if (memory_pool_end <= (puchar)root_file)
470
////////////////////////////////////////////////////////////////////////////////////////
471
// протащено из acc_tabs.c
472
void correct_let_tables(void) // ўл§лў Ґвбп ў д ©«Ґ EMBBOX.C: load_BOX()
478
////////////////////////////////////////////////////////////////////////////////////////
479
// протащено из proptab.c
480
void correct_letters_pidx_table(void) {