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
/********************************************************************/
67
67
#include "extract.h"
70
extern BYTE *let_linpos, *let_lindef,
71
*let_lincomp, *let_linshape,
72
*let_sans_acc, *let_lindef3,
70
extern uchar *let_linpos, *let_lindef, *let_lincomp, *let_linshape,
71
*let_sans_acc, *let_lindef3, *accent_tab;
76
74
void r_criteria(cell *c, const s_glue * gl);
79
INT brigt(INT,INT,INT,INT);
77
int16_t brigt(int16_t, int16_t, int16_t, int16_t);
82
PCHAR full_name(PCHAR w, PCHAR n);
80
pchar full_name(pchar w, pchar n);
85
void correct_dir_path (PBYTE p);
83
void correct_dir_path(puchar p);
87
85
// module proimage.c
88
86
void image_file_close();
89
BOOL image_file_open();
90
INT source_read (PBYTE start, PBYTE ptr, PBYTE end);
87
Bool image_file_open();
88
int16_t source_read(puchar start, puchar ptr, puchar end);
92
90
// module progress.c
93
91
void set_percentage(void);
94
92
void progress_next_step(void);
95
DWORD progress_set_step (DWORD volume);
96
DWORD progress_set_percent (DWORD volume);
93
uint32_t progress_set_step(uint32_t volume);
94
uint32_t progress_set_percent(uint32_t volume);
97
95
void progress_finish(void);
100
98
void matrix_open();
101
99
void matrix_close();
102
INT matrix_read(PBYTE buff, WORD lth);
100
int16_t matrix_read(puchar buff, uint16_t lth);
104
102
// module rules.c
105
103
void rules_open();
108
106
void rules_closed();
109
107
void short_undln();
110
void del_root(INT,INT,INT,INT);
108
void del_root(int16_t, int16_t, int16_t, int16_t);
112
110
// module rulsh.c
113
LONG rules_shaving(MN *,INT);
111
int32_t rules_shaving(MN *, int16_t);
112
int16_t shaving_let();
116
114
// module rulbr.c
119
117
// module sweeper.c
120
118
void sweeper_ini();
119
uint16_t sweeper(int16_t);
122
120
void sweeper_end();
123
void read_comp(DWORD,PCHAR,LONG);
121
void read_comp(uint32_t, pchar, int32_t);
124
122
void comp_file_close();
129
void skew_corr(str *, INT);
127
void skew_corr(str *, int16_t);
131
129
void ideal_rc(cell *);
133
131
// module pass3.c
134
void pass3(INT nCall);
135
void accept_cell(cell *,c_comp *);
132
void pass3(int16_t nCall);
133
void accept_cell(cell *, c_comp *);
137
135
// module alphabet.c
138
BOOL is_digital_string(void);
136
Bool is_digital_string(void);
139
137
void serbian_J2j(void);
145
BOOL snap_newpass(BYTE);
146
BOOL snap_show_text(PBYTE);
147
BOOL snap_show_text1(PBYTE);
149
BOOL snap_newcell(cell *);
150
BOOL snap_stopcell(cell *,cell *);
151
BOOL snap_activity(BYTE);
152
BOOL snap_show_raster(PBYTE,INT,INT);
153
BOOL Alik_snap_show_raster(PBYTE,PBYTE,PBYTE,INT,INT,PCHAR,PCHAR,PINT);
143
Bool snap_newpass(uchar);
144
Bool snap_show_text(puchar);
145
Bool snap_show_text1(puchar);
147
Bool snap_newcell(cell *);
148
Bool snap_stopcell(cell *, cell *);
149
Bool snap_activity(uchar);
150
Bool snap_show_raster(puchar, int16_t, int16_t);
151
Bool Alik_snap_show_raster(puchar, puchar, puchar, int16_t, int16_t, pchar, pchar, pint16_t);
154
152
void snap_newcut();
155
153
void snap_show_cuts(cell *C, struct cut_elm *cut_points);
156
void snap_newpoint(INT i);
154
void snap_newpoint(int16_t i);
157
155
void snap_stop_cuts();
161
INT prop_index(INT h, INT w);
159
int16_t prop_index(int16_t h, int16_t w);
162
int16_t ij_dot(cell *);
165
163
void criteries();
166
164
void criteria(cell *);
167
165
cell *dot_ri(cell *);
168
166
cell *dot_ij(cell *);
169
167
cell *dot_excl(cell *);
170
168
cell *dot_inv(cell *);
172
void v_to_y(cell * c, BYTE compose);
173
void c_to_ctail(cell * c, BYTE compose);
169
int16_t ij_test(cell *);
170
void v_to_y(cell * c, uchar compose);
171
void c_to_ctail(cell * c, uchar compose);
175
173
// module accents.c
176
174
void pass_accent(void);
177
INT bottom_accent(cell *c);
179
INT type_acc(cell *);
180
INT find_bottom_accent(cell *c);
175
int16_t bottom_accent(cell *c);
176
int16_t accent(cell *);
177
int16_t type_acc(cell *);
178
int16_t find_bottom_accent(cell *c);
182
180
// module findiff.c
183
181
void final_crit();
185
183
// module linpos.c
186
INT obtain_diff(INT);
187
INT def_locbas(cell *);
184
int16_t obtain_diff(int16_t);
185
int16_t def_locbas(cell *);
188
186
void inter_diff(cell *);
190
INT if_dust_size(cell *);
187
int16_t if_dust(cell *);
188
int16_t if_dust_size(cell *);
191
189
void linpos(str *);
192
190
void cell_by_base();
193
191
void cell_position(cell *);
194
INT levcut(cell *, INT);
195
void get_b_lines(cell *,B_LINES *);
197
INT get_bsm(); //AK 04.03.97 ? to LONG
198
INT is_defis(cell *);
192
int16_t levcut(cell *, int16_t);
193
void get_b_lines(cell *, B_LINES *);
195
int16_t get_bsm(); //AK 04.03.97 ? to int32_t
196
int16_t is_defis(cell *);
199
197
void basedraft(str *);
200
198
void basefin(str *);
201
INT cut_by_pos(cell *C, BYTE c, INT wp, BYTE fl, BYTE arg);
199
int16_t cut_by_pos(cell *C, uchar c, int16_t wp, uchar fl, uchar arg);
203
201
// module dmacc.c
204
INT try_cut_accent(cell *C1, B_LINES *my_bases, INT flag);
205
INT try_cut_top_accent(cell *C1, B_LINES *my_bases, INT flag);
206
INT try_cut_bot_accent(cell *C1, B_LINES *my_bases, INT flag);
202
int16_t try_cut_accent(cell *C1, B_LINES *my_bases, int16_t flag);
203
int16_t try_cut_top_accent(cell *C1, B_LINES *my_bases, int16_t flag);
204
int16_t try_cut_bot_accent(cell *C1, B_LINES *my_bases, int16_t flag);
210
INT discrid(cell *, INT);
211
INT decidust(cell *);
213
(CHAR,cell *,SVERS *,INT,INT,INT,s_glue *,cut_pos*,cut_pos*,CHAR,CHAR,CHAR);
208
int16_t discrid(cell *, int16_t);
209
int16_t decidust(cell *);
210
int16_t estcomp(char, cell *, SVERS *, int16_t, int16_t, int16_t, s_glue *, cut_pos*, cut_pos*,
214
212
void snBOX(cell *);
215
void est_snap(CHAR user,cell *C,PCHAR txt);
216
void promote(BYTE, cell *, BYTE, INT);
213
void est_snap(char user, cell *C, pchar txt);
214
void promote(uchar, cell *, uchar, int16_t);
217
215
void collect_pat(cell *, s_glue *, cell *);
221
void glsnap(CHAR,cell *,PCHAR);
219
void glsnap(char, cell *, pchar);
224
void save_vers(cell *,SVERS *);
225
void min3(v_val *,BYTE,v_val *);
226
void rest_vers(cell *,SVERS *);
227
INT signif_line_count(cell*);
228
INT compare_vect(v_val *,v_val *);
229
INT cell_is_BOX_solid (cell*);
222
void save_vers(cell *, SVERS *);
223
void min3(v_val *, uchar, v_val *);
224
void rest_vers(cell *, SVERS *);
225
int16_t signif_line_count(cell*);
226
int16_t compare_vect(v_val *, v_val *);
227
int16_t cell_is_BOX_solid(cell*);
231
229
// module locomp.asm
232
230
/*#define c_locomp(a, b, c, d, e) EVN_CLocomp((a), (b), (c), (d), (e))*/
233
MN *c_locomp(PBYTE,LONG,LONG,INT,INT);
231
MN *c_locomp(puchar, int32_t, int32_t, int16_t, int16_t);
235
233
// module v0compgl.asm
236
void invert_tiff(PBYTE c, WORD lth);
234
void invert_tiff(puchar c, uint16_t lth);
238
236
// module cutgraph.c
237
int16_t make_graph();
240
238
void excl_connect();
241
239
void find_path();
243
241
// module cutpoint.c
244
INT cut_points(INT,INT,PBYTE,struct cut_elm *);
245
INT Alik_cut_points(INT,INT,PBYTE,struct cut_elm *, INT);
246
MN* cut_rast(PBYTE,INT,INT,INT,INT,struct cut_elm *,CHAR,CHAR,PCHAR,cut_pos*);
242
int16_t cut_points(int16_t, int16_t, puchar, struct cut_elm *);
243
int16_t Alik_cut_points(int16_t, int16_t, puchar, struct cut_elm *, int16_t);
244
MN* cut_rast(puchar, int16_t, int16_t, int16_t, int16_t, struct cut_elm *, char, char, pchar,
248
247
// module alcutfun.c
249
void Alik_def_cut_flg(cell *,struct cut_elm *,struct cut_elm *,INT,BYTE);
248
void Alik_def_cut_flg(cell *, struct cut_elm *, struct cut_elm *, int16_t, uchar);
252
MN *glue(c_comp **, INT);
251
MN *glue(c_comp **, int16_t);
254
253
// module dmBOX.c
255
INT dmBOX(cell *,s_glue *);
256
INT dmiBOX(cell *,s_glue *,INT);
257
servBOX *make_broken_raster(s_glue *,INT);
258
INT crecell(cell *,s_glue *,INT);
259
INT crepat(cell *,s_glue *,INT,INT);
254
int16_t dmBOX(cell *, s_glue *);
255
int16_t dmiBOX(cell *, s_glue *, int16_t);
256
servBOX *make_broken_raster(s_glue *, int16_t);
257
int16_t crecell(cell *, s_glue *, int16_t);
258
int16_t crepat(cell *, s_glue *, int16_t, int16_t);
260
259
void SBOX_to_static();
261
260
void SBOX_to_GL(s_glue *);
262
261
void GL_to_SBOX(s_glue *);
291
290
// module atlant.c
292
void atlant(cell *,s_glue *,INT,INT);
291
void atlant(cell *, s_glue *, int16_t, int16_t);
294
293
// module ltmain.c
295
void LayoutPart1 (void);
296
void LayoutPart2 (void);
294
void LayoutPart1(void);
295
void LayoutPart2(void);
298
297
// module ltpage.c
299
void SpecCompPut (MN *mn);
298
void SpecCompPut(MN *mn);
301
300
// module spec_sym.c
305
BOOL abris_curve(BYTE fun[],INT n,INT w);
306
INT find_minimum(BYTE fun[],INT n,BYTE *_imin);
303
int16_t chkbullet(uchar);
304
Bool abris_curve(uchar fun[], int16_t n, int16_t w);
305
int16_t find_minimum(uchar fun[], int16_t n, uchar *_imin);
309
307
// module S_TOOLS.C
310
void new_vers( cell *c, BYTE vers, BYTE prob);
311
void down_all_versions(cell *c, INT monus);
312
void filtr_shave(BYTE fun[],INT len);
313
BOOL set_prob(cell *c, CHAR let, BYTE prob);
314
BOOL check_let(cell *c, CHAR let );
315
void add_stick_vers(cell *c,CHAR let,BYTE prob);
316
void filtr_short(BYTE fun[],INT n,INT lev);
317
void filtr121(BYTE fun[],INT n);
318
void filtr_bullet(BYTE fun[],INT len);
319
void add_thick_stick_versions(cell *c,INT dx,INT wide,INT inc,
321
STICK_CHARS *left_chars,STICK_CHARS *right_chars,
322
STICK_SIGNUMS *signums);
323
void add_thin_stick_versions(cell *c,BYTE left[],BYTE right[],
324
INT dy,INT dx,INT typ_inc,
325
STICK_CHARS *left_chars,STICK_CHARS *right_chars,
326
STICK_SIGNUMS *signums);
327
BOOL sign_neck(BYTE left[],BYTE right[],INT n,INT base,INT mode);
328
INT conv_prob(INT prob);
329
INT shift_raster(BYTE *r,INT dy,INT dx,INT tab[],INT max_shift,BYTE *res,INT dir);
308
void new_vers(cell *c, uchar vers, uchar prob);
309
void down_all_versions(cell *c, int16_t monus);
310
void filtr_shave(uchar fun[], int16_t len);
311
Bool set_prob(cell *c, char let, uchar prob);
312
Bool check_let(cell *c, char let);
313
void add_stick_vers(cell *c, char let, uchar prob);
314
void filtr_short(uchar fun[], int16_t n, int16_t lev);
315
void filtr121(uchar fun[], int16_t n);
316
void filtr_bullet(uchar fun[], int16_t len);
317
void add_thick_stick_versions(cell *c, int16_t dx, int16_t wide, int16_t inc, int16_t typ_snap,
318
STICK_CHARS *left_chars, STICK_CHARS *right_chars,
319
STICK_SIGNUMS *signums);
320
void add_thin_stick_versions(cell *c, uchar left[], uchar right[], int16_t dy,
321
int16_t dx, int16_t typ_inc, STICK_CHARS *left_chars, STICK_CHARS *right_chars,
322
STICK_SIGNUMS *signums);
323
Bool sign_neck(uchar left[], uchar right[], int16_t n, int16_t base, int16_t mode);
324
int16_t conv_prob(int16_t prob);
325
int16_t shift_raster(uchar *r, int16_t dy, int16_t dx, int16_t tab[], int16_t max_shift, uchar *res,
330
327
/******************************
331
void full_snap(cell *c,STICK_CHARS *l,STICK_CHARS *r,STICK_SIGNUMS *s,
333
INT left_mode,INT right_mode,INT opt,INT wide,
335
void short_snap(CHAR *s,INT t);
336
*******************************/
328
void full_snap(cell *c,STICK_CHARS *l,STICK_CHARS *r,STICK_SIGNUMS *s,
330
int16_t left_mode,int16_t right_mode,int16_t opt,int16_t wide,
331
int16_t inc_v,int16_t t);
332
void short_snap(char *s,int16_t t);
333
*******************************/
338
335
// module dis_stic.c
339
INT discrim_all_sticks(cell *c,
340
STICK_CHARS *left_chars,STICK_CHARS *right_chars,
341
STICK_SIGNUMS *signums);
342
INT discrim_stick(BYTE,STICK_CHARS *,STICK_CHARS *,STICK_SIGNUMS *,
344
INT del_sticks(cell *c ,CHAR let);
345
INT similar_0xBA (STICK_CHARS *, STICK_CHARS *, STICK_SIGNUMS *);
346
INT similar_0xBB (STICK_CHARS *l,STICK_CHARS *r,STICK_SIGNUMS *s);
347
INT similar_1(STICK_CHARS *,STICK_CHARS *,STICK_SIGNUMS *);
348
INT similar_l_stroked(STICK_CHARS *,STICK_CHARS *,STICK_SIGNUMS *);
349
INT similar_lcb(STICK_CHARS *,STICK_CHARS *,STICK_SIGNUMS *);
350
INT similar_rcb(STICK_CHARS *,STICK_CHARS *,STICK_SIGNUMS *);
351
INT similar_excl(STICK_CHARS *,STICK_CHARS *,STICK_SIGNUMS *);
352
INT similar_excl_with_dot(STICK_CHARS *,STICK_CHARS *,STICK_SIGNUMS *);
353
BYTE similar_wide_frt1(STICK_CHARS *left_chars,STICK_CHARS *right_chars);
336
int16_t discrim_all_sticks(cell *c, STICK_CHARS *left_chars,
337
STICK_CHARS *right_chars, STICK_SIGNUMS *signums);
338
int16_t discrim_stick(uchar, STICK_CHARS *, STICK_CHARS *, STICK_SIGNUMS *, int16_t);
339
int16_t del_sticks(cell *c, char let);
340
int16_t similar_0xBA(STICK_CHARS *, STICK_CHARS *, STICK_SIGNUMS *);
341
int16_t similar_0xBB(STICK_CHARS *l, STICK_CHARS *r, STICK_SIGNUMS *s);
342
int16_t similar_1(STICK_CHARS *, STICK_CHARS *, STICK_SIGNUMS *);
343
int16_t similar_l_stroked(STICK_CHARS *, STICK_CHARS *, STICK_SIGNUMS *);
344
int16_t similar_lcb(STICK_CHARS *, STICK_CHARS *, STICK_SIGNUMS *);
345
int16_t similar_rcb(STICK_CHARS *, STICK_CHARS *, STICK_SIGNUMS *);
346
int16_t similar_excl(STICK_CHARS *, STICK_CHARS *, STICK_SIGNUMS *);
347
int16_t similar_excl_with_dot(STICK_CHARS *, STICK_CHARS *, STICK_SIGNUMS *);
348
uchar similar_wide_frt1(STICK_CHARS *left_chars, STICK_CHARS *right_chars);
356
350
// module def_stic.c
357
INT stick_center_study(cell *c,s_glue *GL,INT typ );
358
WORD typ_thin_stick(lnhead *lin,INT dy,INT dx);
359
INT erector(cell *c, INT enable_erect, INT enable_shave, INT enable_snap);
351
int16_t stick_center_study(cell *c, s_glue *GL, int16_t typ);
352
uint16_t typ_thin_stick(lnhead *lin, int16_t dy, int16_t dx);
353
int16_t erector(cell *c, int16_t enable_erect, int16_t enable_shave, int16_t enable_snap);
361
355
// module cha_stic.c
362
INT set_stick_char(BYTE left[],BYTE right[],INT tails[],
363
INT dy,INT dx,INT opt,INT wid,INT corr_mode,
364
INT skip_ul,INT skip_dl,INT skip_ur,INT skip_dr, INT inc,
365
STICK_CHARS *left_chars, STICK_CHARS *right_chars,
366
STICK_SIGNUMS *signums,
367
INT *l_mode,INT *r_mode);
368
INT calc_right_f_symptom(BYTE fun[],INT n,INT m);
369
INT calc_left_f_symptom (BYTE fun[],INT n,INT nx,BOOL c_ft);
370
void num_of_skip_line(BYTE left[],BYTE right[],INT dy,INT opt,INT wide,
371
INT *up_l,INT *up_r,INT *down_l,INT *down_r);
373
void set_stick_aux_signums(cell *c,BYTE left[],BYTE right[],
375
STICK_CHARS *left_chars,STICK_CHARS *right_chars,
376
STICK_SIGNUMS *signums,
377
INT dis_left_brace,INT dis_right_brace,INT dis_slash,
378
INT l_f_sym,INT r_f_sym,
383
INT nlines,INT incline);
385
void calc_skipped_lines(INT hist_int[],BYTE left[],BYTE right[],
386
INT dy,INT dx,INT wide,INT opt,BOOL c_r,
387
INT *ul,INT *ur,INT *dl,INT *dr);
388
void correct_f_symptoms(INT hist_int[],INT dy,INT *l_f_sym,INT *r_f_sym);
389
void correct_upper_peaks(STICK_CHARS *l,STICK_CHARS *r,INT dy);
356
int16_t set_stick_char(uchar left[], uchar right[], int16_t tails[], int16_t dy, int16_t dx,
357
int16_t opt, int16_t wid, int16_t corr_mode, int16_t skip_ul, int16_t skip_dl, int16_t skip_ur,
358
int16_t skip_dr, int16_t inc, STICK_CHARS *left_chars,
359
STICK_CHARS *right_chars, STICK_SIGNUMS *signums, int16_t *l_mode,
361
int16_t calc_right_f_symptom(uchar fun[], int16_t n, int16_t m);
362
int16_t calc_left_f_symptom(uchar fun[], int16_t n, int16_t nx, Bool c_ft);
363
void num_of_skip_line(uchar left[], uchar right[], int16_t dy, int16_t opt, int16_t wide,
364
int16_t *up_l, int16_t *up_r, int16_t *down_l, int16_t *down_r);
366
void set_stick_aux_signums(cell *c, uchar left[], uchar right[], int16_t dy,
367
int16_t wide_up, STICK_CHARS *left_chars, STICK_CHARS *right_chars,
368
STICK_SIGNUMS *signums, int16_t dis_left_brace, int16_t dis_right_brace,
369
int16_t dis_slash, int16_t l_f_sym, int16_t r_f_sym, int16_t T_c, uint16_t T_2_3,
370
uint16_t T_skok, B_LINES *bl, int16_t nlines, int16_t incline);
373
calc_skipped_lines(int16_t hist_int[], uchar left[], uchar right[], int16_t dy,
374
int16_t dx, int16_t wide, int16_t opt, Bool c_r, int16_t *ul, int16_t *ur, int16_t *dl,
376
void correct_f_symptoms(int16_t hist_int[], int16_t dy, int16_t *l_f_sym, int16_t *r_f_sym);
377
void correct_upper_peaks(STICK_CHARS *l, STICK_CHARS *r, int16_t dy);
391
379
// module differ.c
395
BOOL boldshave(cell *,INT); //AK: at .ms as BOOL
396
BOOL pimpleshave(cell *C, INT shave, INT inc); //AK: at .ms as BOOL
383
Bool boldshave(cell *, int16_t); //AK: at .ms as Bool
384
Bool pimpleshave(cell *C, int16_t shave, int16_t inc); //AK: at .ms as Bool
399
387
// module shaving.c
388
int16_t shaving(int16_t);
402
390
// module punct.c
476
464
// module tools.c
477
465
void set_bad_cell(cell *);
478
466
void sort_vers(cell *);
479
void sort_v_vect(INT,version *);
467
void sort_v_vect(int16_t, version *);
480
468
void setup_string();
482
PBYTE il1_pool_ptr();
470
puchar il1_pool_ptr();
484
472
c_comp * comp_vers_to_kit(MN * mn, c_comp *c);
485
473
c_comp * dust_to_kit(dust_comp *);
486
c_comp * comp_from_file(DWORD,LONG);
487
c_comp * compose_comp(INT,c_comp **);
488
BOOL compose_cell(INT,cell **,cell *);
489
BOOL compose_cell_save(INT,cell **,cell *);
474
c_comp * comp_from_file(uint32_t, int32_t);
475
c_comp * compose_comp(int16_t, c_comp **);
476
Bool compose_cell(int16_t, cell **, cell *);
477
Bool compose_cell_save(int16_t, cell **, cell *);
490
478
void del_retain_cell(cell *);
491
479
cell *del_cell(cell *);
492
PBYTE del_save_cell(cell *);
493
cell *rest_cell(void *,cell *);
480
puchar del_save_cell(cell *);
481
cell *rest_cell(void *, cell *);
496
484
////////////////////////////////////////////////
497
485
//AK add 3 funcs for check chain of cells:
498
void AKTryChainRecover( cell ** );
486
void AKTryChainRecover(cell **);
499
487
void AKCheckChain();
500
INT AKCellInChain( cell * );
488
int16_t AKCellInChain(cell *);
501
489
void AKClearVers(void);
502
490
////////////////////////////////////////////////
503
491
cell *new_cell();
504
492
void free_cell(cell *c);
505
493
void insert_cell(cell *c, cell *ci);
506
void insert_cell1(cell *c,cell *ci);
507
void adjust_links (cell *c);
508
cell *create_cell (MN *,cell *,CHAR, CHAR);
509
cell *create_cell1(MN *,cell *,CHAR, CHAR);
510
cell *create_cell_work(MN * mn, cell * ci, CHAR bdiff, CHAR dflag);
511
INT short_recog_cell(cell *);
512
INT recog_cell(cell *);
513
INT recop_cell(cell *);
514
INT reco2_cell(cell *);
515
PBYTE save_raster(cell *);
516
PBYTE give_kit_addr();
517
void take_kit_addr(PBYTE a);
494
void insert_cell1(cell *c, cell *ci);
495
void adjust_links(cell *c);
496
cell *create_cell(MN *, cell *, char, char);
497
cell *create_cell1(MN *, cell *, char, char);
498
cell *create_cell_work(MN * mn, cell * ci, char bdiff, char dflag);
499
int16_t short_recog_cell(cell *);
500
int16_t recog_cell(cell *);
501
int16_t recop_cell(cell *);
502
int16_t reco2_cell(cell *);
503
puchar save_raster(cell *);
504
puchar give_kit_addr();
505
void take_kit_addr(puchar a);
518
506
void add_vers(cell *, version *);
519
void del_version( cell *c, BYTE let);
507
void del_version(cell *c, uchar let);
520
508
void online_comp(c_comp *);
522
void cell_bonus_let(cell *C, CHAR Let, INT BonVal);
523
void cell_bonus(cell *C, version *pVer, INT BonVal);
510
void cell_bonus_let(cell *C, char Let, int16_t BonVal);
511
void cell_bonus(cell *C, version *pVer, int16_t BonVal);
525
513
// module baton.c
526
INT sticks_in_letter(cell *,INT,STICK **);
514
int16_t sticks_in_letter(cell *, int16_t, STICK **);
527
515
void set_tab_incl();
529
517
// module filesys.c
530
void file_string(STRING *); // accept string into file
518
void file_string(STRING *); // accept string into file
531
519
str *first_string();
532
520
str *next_string();
521
int16_t read_string();
534
522
void setup_memory();
535
523
void convert_rtf();
536
void maden_comp(PBYTE,INT,INT,INT,INT);
524
void maden_comp(puchar, int16_t, int16_t, int16_t, int16_t);
537
525
c_comp *get_comp(PROOT);
538
526
void Pass2(void);
539
void read_rec_file(INT seqn, PBYTE pool, PBYTE * end);
540
///////////////////INT cond_open(INT seqn, PCHAR name, WORD b1, WORD b2);
541
PBYTE seq_nam(INT seqn);
527
void read_rec_file(int16_t seqn, puchar pool, puchar * end);
528
///////////////////int16_t cond_open(int16_t seqn, pchar name, uint16_t b1, uint16_t b2);
529
puchar seq_nam(int16_t seqn);
530
int16_t to_voc(void);
543
531
void to_edp(void);
544
532
void make_rtf(void);
545
533
void make_ASCII(void);
546
534
void make_smart_ASCII(void);
547
void LayoutSetup (void);
535
void LayoutSetup(void);
548
536
void load_vocs(void);
551
void error_exit(INT group, INT element);
552
void error_exit_asm(INT element);
539
void error_exit(int16_t group, int16_t element);
540
void error_exit_asm(int16_t element);
553
541
void clear_error_status(void);
555
543
// module testsnap
557
545
void write_events(cell *);
558
546
void * snap_ev_res();
559
547
void snap_ev_reset();
560
void snap_keep(BYTE user, PBYTE addr, WORD lth);
548
void snap_keep(uchar user, puchar addr, uint16_t lth);
561
549
void snap_sticks(cell *);
563
551
// module v0compmn.asm
564
void extrcomp (void);
566
554
// module v0comprq.asm
555
int16_t recog_letter();
568
556
void recog_save_maden();
570
558
// module proport.c
571
559
void v2_pidx_crit(cell *);
572
560
void pidx_crit();
573
BOOL pidx_skip(INT h, INT w,BYTE t_let);
574
WORD el_pidx_crit(WORD t_let,INT pidx);
561
Bool pidx_skip(int16_t h, int16_t w, uchar t_let);
562
uint16_t el_pidx_crit(uint16_t t_let, int16_t pidx);
576
564
// module lang_fil.c
577
565
void ev_lang_filter();
580
568
// module compkit.c
581
INT MN_to_line(MN *);
583
PBYTE make_extended_raster(c_comp *);
584
void save_dust_comp(dust_comp *, c_comp *, PBYTE);
585
INT read_dust_comp(dust_comp *, PBYTE);
569
int16_t MN_to_line(MN *);
570
puchar make_raster();
571
puchar make_extended_raster(c_comp *);
572
void save_dust_comp(dust_comp *, c_comp *, puchar);
573
int16_t read_dust_comp(dust_comp *, puchar);
587
575
// module picture.c
588
INT scaled(INT value, BYTE scale);
576
int16_t scaled(int16_t value, uchar scale);
590
578
// module large.asm
591
PBYTE compress_component(c_comp *c, BYTE scale);
592
PBYTE compress_large_component(c_comp *c, BYTE scale);
593
PBYTE compress_dust_component(c_comp *c, BYTE scale);
594
INT filling_MN(MN *mn, WORD h, WORD w);
579
puchar compress_component(c_comp *c, uchar scale);
580
puchar compress_large_component(c_comp *c, uchar scale);
581
puchar compress_dust_component(c_comp *c, uchar scale);
582
int16_t filling_MN(MN *mn, uint16_t h, uint16_t w);
596
584
// module tg_spell
597
INT spelling(PBYTE memory, LONG size);
585
int16_t spelling(puchar memory, int32_t size);
599
587
// module in_treei.c
600
BYTE * load_stat_dict (PBYTE ptr);
601
void load_user_dicts (PSTR list_name, PBYTE ptr);
602
void user_voc_init (void);
588
uchar * load_stat_dict(puchar ptr);
589
void load_user_dicts(char * list_name, puchar ptr);
590
void user_voc_init(void);
604
592
// module corners.c
605
void discrim_un( cell *, s_glue *, INT );
593
void discrim_un(cell *, s_glue *, int16_t);
608
void rtf_main(PBYTE memory, LONG memory_lth);
596
void rtf_main(puchar memory, int32_t memory_lth);
610
598
// module rtfdebug.c
611
599
void print_fragments();
613
601
// module ascisave.c
614
void smart_ascii_save(PBYTE pool, LONG lth);
615
void ascii_save(PBYTE pool, LONG lth);
602
void smart_ascii_save(puchar pool, int32_t lth);
603
void ascii_save(puchar pool, int32_t lth);
617
605
// module writepro
618
606
void write_prot(cell *);
620
608
// module scanjet
621
INT give_scan_handle(void);
622
WORD scan_close(void);
609
int16_t give_scan_handle(void);
610
uint16_t scan_close(void);
624
612
// module dllentry or run
625
void write_text(BYTE);
613
void write_text(uchar);
627
615
// module celldump.c
628
616
void setup_dump(void);
633
621
void trade_marks(void);
636
cell * end_word(cell *cs,BYTE *str,BYTE *word_len);
624
cell * end_word(cell *cs, uchar *str, uchar *word_len);
637
625
cell * next_word(cell *cs);
638
BOOL russian_word(BYTE *wrd);
626
Bool russian_word(uchar *wrd);
640
628
//module erection.c
641
BYTE erection_incline_words(void);
642
BYTE erection_one_incline_word(cell *c, cell *e);
643
void erection_delete(void);
644
void erection_restore(void);
645
void erection_delete_seq(cell *b, cell *e);
646
void erection_restore_seq(cell *b, cell *e);
647
INT erection_compose_inc(INT n,cell **clist);
648
INT erect_original_dens (cell *c);
649
INT erect_original_width (cell *c);
650
cell* erect_cell_value (cell *c, INT inc, INT shave, BOOL cutting);
651
cell* erect_cell_table (cell *c, INT tab_angle[], INT shave, BOOL cutting);
652
BOOL erect_make_tab(cell *c, INT tab_angle[]);
653
void erect_shift_intervals(void *addr, INT h, INT tab_angle[] );
654
INT erect_raster_value (BYTE *raster, INT dx, INT dy, INT inc);
629
uchar erection_incline_words(void);
630
uchar erection_one_incline_word(cell *c, cell *e);
631
void erection_delete(void);
632
void erection_restore(void);
633
void erection_delete_seq(cell *b, cell *e);
634
void erection_restore_seq(cell *b, cell *e);
635
int16_t erection_compose_inc(int16_t n, cell **clist);
636
int16_t erect_original_dens(cell *c);
637
int16_t erect_original_width(cell *c);
638
cell* erect_cell_value(cell *c, int16_t inc, int16_t shave, Bool cutting);
639
cell* erect_cell_table(cell *c, int16_t tab_angle[], int16_t shave, Bool cutting);
640
Bool erect_make_tab(cell *c, int16_t tab_angle[]);
641
void erect_shift_intervals(void *addr, int16_t h, int16_t tab_angle[]);
642
int16_t erect_raster_value(uchar *raster, int16_t dx, int16_t dy, int16_t inc);
656
644
// module shevron.c
657
void shevron(cell* );
658
646
/*-------------------------- Extern -------------------*/
660
BOOL check_cancel(WORD perc);
648
Bool check_cancel(uint16_t perc);
664
650
MN *cell_cut(cell *);
667
void set_page_name(PBYTE);
671
void c_rastror(PBYTE,PBYTE,WORD,WORD);
652
void set_page_name(puchar);
654
void setdrmode(int16_t);
656
void c_rastror(puchar, puchar, uint16_t, uint16_t);
673
658
lnhead *c_boxln(MN *);
676
void html_main(PBYTE memory, LONG memory_lth);
661
void html_main(puchar memory, int32_t memory_lth);
678
663
// virtual function...
679
WORD Tiger_BIOSKEY(WORD);
664
uint16_t Tiger_BIOSKEY(uint16_t);