~ubuntu-branches/ubuntu/trusty/cuneiform/trusty

« back to all changes in this revision

Viewing changes to cuneiform_src/Kern/rstr/src/punct.c

  • Committer: Bazaar Package Importer
  • Author(s): Jakub Wilk, c-assert.diff, slovenian-slv.diff
  • Date: 2011-01-26 21:53:07 UTC
  • mfrom: (5.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20110126215307-62x61mcesr607qb7
Tags: 1.0.0+dfsg-2
* Upload to unstable.
* Explicitly build-depend on pkg-config. Thanks to Stefano Rivera for the
  bug report.
* Add Vcs-* fields.
* Use the standard C assert() macro, rather than custom Cuneiform one.
  [c-assert.diff]
* Pass CFLAGS, CXXFLAGS and LDFLAGS (get from dpkg-buildflags) to cmake
  (closes: #608345). Thanks to Sami Liedes for the bug report.
  + Build depend on dpkg-dev (>= 1.15.7).
* Pass --parallel to dh.
  + Bump debhelper minimum version to 7.4.10.
* Update debian/copyright to the latest DEP-5 version.
* Bump year in debian/copyright.
* Explicitly link to GraphicsMagick (rather than via the ImageMagick
  compatibility layer).
* Don't ship /usr/lib/cuneiform/*.so symlinks. These libraries are
  considered private, at least until #598616 is fixed.
* Rename some private variables in debian/rules to make them lowercase.
* Update patch headers.
* Provide proper ‘build-arch’ and ‘build-indep’ targets in debian/rules.
* Document input format in the manual page (closes: #572061). Thanks to
  Janusz S. Bień for the bug report.
* Use ‘slv’ (rather than ‘slo’) as language code for Slovenian.
  [slovenian-slv.diff]
* Fix package description: Slovenian is supported, Slovak is not.
* Improve documentation of the language (-l) option (closes: #602512).
  Thanks to Jari Aalto for the bug report.
* Install reasons file for vrms.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
Copyright (c) 1993-2008, Cognitive Technologies
3
3
All rights reserved.
4
4
 
5
 
����������� ��������� ��������������� � ������������� ��� � ���� ��������� ����,
6
 
��� � � �������� �����, � ����������� ��� ���, ��� ���������� ��������� �������:
7
 
 
8
 
      * ��� ��������� ��������������� ��������� ���� ������ ���������� ���������
9
 
        ���� ����������� �� ��������� �����, ���� ������ ������� � �����������
10
 
        ����� �� ��������.
11
 
      * ��� ��������� ��������������� ��������� ���� � ������������ �/��� �
12
 
        ������ ����������, ������������ ��� ���������������, ������ �����������
13
 
        ��������� ���� ���������� �� ��������� �����, ���� ������ ������� �
14
 
        ����������� ����� �� ��������.
15
 
      * �� �������� Cognitive Technologies, �� ����� �� ����������� �� �����
16
 
        ���� ������������ � �������� �������� ��������� �/��� �����������
17
 
        ���������, ���������� �� ���� ��, ��� ���������������� �����������
18
 
        ����������.
19
 
 
20
 
��� ��������� ������������� ����������� ��������� ���� �/��� ������� ������ "���
21
 
��� ����" ��� ������-���� ���� ��������, ���������� ���� ��� ���������������,
22
 
������� �������� ������������ �������� � ����������� ��� ���������� ����, �� ��
23
 
������������� ���. �� �������� ��������� ���� � �� ���� ������ ����, �������
24
 
����� �������� �/��� �������� �������������� ���������, �� � ���� ������ ��
25
 
��Ѩ� ���������������, ������� ����� �����, ���������, ����������� ���
26
 
������������� ������, ��������� � �������������� ��� ���������� ����������
27
 
������������� ������������� ��������� (������� ������ ������, ��� ������,
28
 
������� ���������, ��� ������ �/��� ������ �������, ���������� ��-�� ��������
29
 
������� ��� �/��� ������ ��������� �������� ��������� � ������� �����������,
30
 
�� �� ������������� ����� ��������), �� �� ������������� ���, ���� ���� �����
31
 
�������� ��� ������ ���� ���� �������� � ����������� ����� ������� � ������.
 
5
Разрешается повторное распространение и использование как в виде исходного кода,
 
6
так и в двоичной форме, с изменениями или без, при соблюдении следующих условий:
 
7
 
 
8
      * При повторном распространении исходного кода должны оставаться указанное
 
9
        выше уведомление об авторском праве, этот список условий и последующий
 
10
        отказ от гарантий.
 
11
      * При повторном распространении двоичного кода в документации и/или в
 
12
        других материалах, поставляемых при распространении, должны сохраняться
 
13
        указанная выше информация об авторском праве, этот список условий и
 
14
        последующий отказ от гарантий.
 
15
      * Ни название Cognitive Technologies, ни имена ее сотрудников не могут
 
16
        быть использованы в качестве средства поддержки и/или продвижения
 
17
        продуктов, основанных на этом ПО, без предварительного письменного
 
18
        разрешения.
 
19
 
 
20
ЭТА ПРОГРАММА ПРЕДОСТАВЛЕНА ВЛАДЕЛЬЦАМИ АВТОРСКИХ ПРАВ И/ИЛИ ДРУГИМИ ЛИЦАМИ "КАК
 
21
ОНА ЕСТЬ" БЕЗ КАКОГО-ЛИБО ВИДА ГАРАНТИЙ, ВЫРАЖЕННЫХ ЯВНО ИЛИ ПОДРАЗУМЕВАЕМЫХ,
 
22
ВКЛЮЧАЯ ГАРАНТИИ КОММЕРЧЕСКОЙ ЦЕННОСТИ И ПРИГОДНОСТИ ДЛЯ КОНКРЕТНОЙ ЦЕЛИ, НО НЕ
 
23
ОГРАНИЧИВАЯСЬ ИМИ. НИ ВЛАДЕЛЕЦ АВТОРСКИХ ПРАВ И НИ ОДНО ДРУГОЕ ЛИЦО, КОТОРОЕ
 
24
МОЖЕТ ИЗМЕНЯТЬ И/ИЛИ ПОВТОРНО РАСПРОСТРАНЯТЬ ПРОГРАММУ, НИ В КОЕМ СЛУЧАЕ НЕ
 
25
НЕСЁТ ОТВЕТСТВЕННОСТИ, ВКЛЮЧАЯ ЛЮБЫЕ ОБЩИЕ, СЛУЧАЙНЫЕ, СПЕЦИАЛЬНЫЕ ИЛИ
 
26
ПОСЛЕДОВАВШИЕ УБЫТКИ, СВЯЗАННЫЕ С ИСПОЛЬЗОВАНИЕМ ИЛИ ПОНЕСЕННЫЕ ВСЛЕДСТВИЕ
 
27
НЕВОЗМОЖНОСТИ ИСПОЛЬЗОВАНИЯ ПРОГРАММЫ (ВКЛЮЧАЯ ПОТЕРИ ДАННЫХ, ИЛИ ДАННЫЕ,
 
28
СТАВШИЕ НЕГОДНЫМИ, ИЛИ УБЫТКИ И/ИЛИ ПОТЕРИ ДОХОДОВ, ПОНЕСЕННЫЕ ИЗ-ЗА ДЕЙСТВИЙ
 
29
ТРЕТЬИХ ЛИЦ И/ИЛИ ОТКАЗА ПРОГРАММЫ РАБОТАТЬ СОВМЕСТНО С ДРУГИМИ ПРОГРАММАМИ,
 
30
НО НЕ ОГРАНИЧИВАЯСЬ ЭТИМИ СЛУЧАЯМИ), НО НЕ ОГРАНИЧИВАЯСЬ ИМИ, ДАЖЕ ЕСЛИ ТАКОЙ
 
31
ВЛАДЕЛЕЦ ИЛИ ДРУГОЕ ЛИЦО БЫЛИ ИЗВЕЩЕНЫ О ВОЗМОЖНОСТИ ТАКИХ УБЫТКОВ И ПОТЕРЬ.
32
32
 
33
33
Redistribution and use in source and binary forms, with or without modification,
34
34
are permitted provided that the following conditions are met:
64
64
#include <stdlib.h>
65
65
#include <stdio.h>
66
66
#include <string.h>
67
 
#include "nt_types.h"
 
67
 
68
68
#include "struct.h"
69
69
#include "func.h"
70
70
#define PUNCT_CORRECTION0 //Loginov
77
77
 
78
78
#include"compat_defs.h"
79
79
 
80
 
extern BYTE fax1x2;
81
 
extern INT pitchsize;
82
 
extern BYTE db_status;
83
 
extern INT line_number;
 
80
extern uchar fax1x2;
 
81
extern int16_t pitchsize;
 
82
extern uchar db_status;
 
83
extern int16_t line_number;
84
84
extern cell *accadr1;
85
85
extern cell *accadr2;
86
 
extern BYTE line_tabcell;
 
86
extern uchar line_tabcell;
87
87
 
88
88
#define HPERMIN 4
89
89
#define KEGM    14
90
90
#define FEAT_SIZE 40
91
91
 
92
 
static PBYTE rstr;
93
 
static INT italic;
 
92
static puchar rstr;
 
93
static int16_t italic;
94
94
static B_LINES bl;
95
95
static cell *clist[4];
96
 
PBYTE sv_fantom=NULL;
 
96
puchar sv_fantom=NULL;
97
97
 
98
98
static void order();
99
99
static void bad_to_dust();
100
100
static void glue_dust();
101
 
static INT exclam (cell *,cell *,B_LINES *);
 
101
static int16_t exclam (cell *,cell *,B_LINES *);
102
102
static cell *let_gl(cell *,cell *,cell *,cell *,B_LINES *);
103
103
static void dots();
104
104
static void quockets();
106
106
static void punctsign(cell **,cell **);
107
107
static void intval (cell *,cell *);
108
108
static void no_cut(cell *);
109
 
static INT dustpos(INT,cell *);
 
109
static int16_t dustpos(int16_t,cell *);
110
110
#ifdef PUNCT_CORRECTION
111
 
 //static INT exist_prev_next(cell *c,INT *dif1,INT *dif2);
112
 
//static INT get_dust_status(cell *c,BYTE *dust_st);
113
 
//static INT dust_pos_new(cell *);
114
 
INT is_dash(cell *c);
115
 
INT is_dust_2(cell *c);
116
 
INT is_dust(cell *);
117
 
INT is_point_stop(cell *c);
 
111
 //static int16_t exist_prev_next(cell *c,int16_t *dif1,int16_t *dif2);
 
112
//static int16_t get_dust_status(cell *c,uchar *dust_st);
 
113
//static int16_t dust_pos_new(cell *);
 
114
int16_t is_dash(cell *c);
 
115
int16_t is_dust_2(cell *c);
 
116
int16_t is_dust(cell *);
 
117
int16_t is_point_stop(cell *c);
118
118
#endif
119
 
static INT chkquot(INT,INT,cell *);
120
 
static INT chkstar(INT,INT,cell *);
121
 
static INT chkdotcom(INT,INT,cell *);
122
 
static INT chkdash(INT,INT,cell *);
123
 
static INT chkplus(INT,INT,cell *);
124
 
static INT chkslash(INT,INT,cell *);
125
 
static INT chkcircle(INT,INT,cell *);
126
 
static INT chkquock(INT,INT,cell *);
127
 
static INT chkquocks(INT,INT,cell *);
128
 
static INT contain(cell *new, cell *old);
 
119
static int16_t chkquot(int16_t,int16_t,cell *);
 
120
static int16_t chkstar(int16_t,int16_t,cell *);
 
121
static int16_t chkdotcom(int16_t,int16_t,cell *);
 
122
static int16_t chkdash(int16_t,int16_t,cell *);
 
123
static int16_t chkplus(int16_t,int16_t,cell *);
 
124
static int16_t chkslash(int16_t,int16_t,cell *);
 
125
static int16_t chkcircle(int16_t,int16_t,cell *);
 
126
static int16_t chkquock(int16_t,int16_t,cell *);
 
127
static int16_t chkquocks(int16_t,int16_t,cell *);
 
128
static int16_t contain(cell *new, cell *old);
129
129
cell *hide(cell *C);
130
130
 
131
131
static void czech_dt_glue_apostroph(); // 07.09.2000 E.P.
132
132
 
133
133
 
134
 
INT check_shevron(cell *c,INT flag_qual); //Alik
 
134
int16_t check_shevron(cell *c,int16_t flag_qual); //Alik
135
135
 
136
136
//
137
137
// kill temporary twin flags BAD+DUST for pass4
152
152
void punct()
153
153
 {
154
154
 cell *c1,*c2,*c;
155
 
 BYTE l;
156
 
 INT x,d;
 
155
 uchar l;
 
156
 int16_t x,d;
157
157
 
158
158
 if (language == LANG_RUSSIAN)  sv_fantom=NULL;
159
159
 snap_newpass('e');
160
160
 quockets();
161
161
 
162
 
 // ACC_ROOF_INF ��� d,t � ������� ����� �� ��������. 07.09.2000 E.P.
 
162
 // ACC_ROOF_INF над d,t в Чешском похож на апостроф. 07.09.2000 E.P.
163
163
 if (language==LANG_CZECH)
164
164
        czech_dt_glue_apostroph();
165
165
 
214
214
              x-=(c1->w)/4;
215
215
            if (((c1->font|c1->font_new)&c_fp_it || italic) && memchr("dlEHIJMNSUZ1t6",l,14))
216
216
              x-=(c1->w)/4;
217
 
              // Interference i_left_accent ~ �
 
217
              // Interference i_left_accent ~ м
218
218
            if (
219
 
                                // ����������� ��� 07.09.2000 E.P.
 
219
                                // Конфликтный код 07.09.2000 E.P.
220
220
                            !is_baltic_language(language) &&    // 17.07.2001 E.P.
221
221
                            !is_turkish_language(language) && ( // 30.05.2002 E.P.
222
222
                                !is_cen_language(language) && l==i_left_accent ||
223
223
                                l==i_right_accent ) ||
224
224
 
225
 
                                // ���������� �����. 10.07.2001 E.P.
 
225
                                // Балтийские палки. 10.07.2001 E.P.
226
226
                                is_baltic_language(language) &&
227
227
                                        (
228
228
                                        l==II_bottom_accent || l==i_bottom_accent ||
229
229
                                        l==l_bottom_accent
230
230
                                        ) ||
231
 
                                // �������� �����. 30.05.2002 E.P.
 
231
                                // Турецкие палки. 30.05.2002 E.P.
232
232
                                is_turkish_palka(l)
233
233
                                )
234
234
              x-=(c1->w)/4;
235
235
        }
236
236
        else
237
237
        {
238
 
            //    if (memchr("���",(l=c1->vers[0].let),5))  Paul  10-14-96
239
 
            if (memchr("����",(l=c1->vers[0].let),4))
 
238
            //    if (memchr("Ј’ђ",(l=c1->vers[0].let),5))  Paul  10-14-96
 
239
            if (memchr("ѓЈ’ђ",(l=c1->vers[0].let),4))
240
240
              x-=(c1->w)/2;
241
 
            if (memchr("�7",l,7))
 
241
            if (memchr("г“7",l,7))
242
242
              x-=(c1->w)/4;
243
 
            //    if ((c1->font&c_fp_it || italic) && memchr("���16�",l,14))Paul  10-14-96
 
243
            //    if ((c1->font&c_fp_it || italic) && memchr("€ЌЏ16Ў",l,14))Paul  10-14-96
244
244
            if (((c1->font|c1->font_new)&c_fp_it || italic) &&
245
 
                                !(memchr("����������",l,10) &&
 
245
                                !(memchr("Ђ„†Љ•–™љ›њ",l,10) &&
246
246
                                        !is_russian_turkish_conflict(l) // 21.05.2002 E.P.
247
247
                                 )
248
248
                                )
249
249
              x-=(c1->w)/4;
250
 
              // Interference i_left_accent ~ �
 
250
              // Interference i_left_accent ~ м
251
251
            if (
252
 
                                // ����������� ��� 07.09.2000 E.P.
 
252
                                // Конфликтный код 07.09.2000 E.P.
253
253
                                !is_baltic_language(language) &&        // 17.07.2001 E.P.
254
254
                                !is_turkish_language(language) && (     // 30.05.2002 E.P.
255
255
                                !is_cen_language(language) && l==i_left_accent
256
256
                                || l==i_right_accent
257
257
                                ) ||
258
258
 
259
 
                                // ���������� �����. 10.07.2001 E.P.
 
259
                                // Балтийские палки. 10.07.2001 E.P.
260
260
                                is_baltic_language(language) &&
261
261
                                        (
262
262
                                        l==II_bottom_accent || l==i_bottom_accent ||
263
263
                                        l==l_bottom_accent
264
264
                                        ) ||
265
 
                                // �������� �����. 30.05.2002 E.P.
 
265
                                // Турецкие палки. 30.05.2002 E.P.
266
266
                                is_turkish_palka(l)
267
267
                           )
268
268
              x-=(c1->w)/4;
405
405
static void bad_to_dust()
406
406
 {
407
407
 cell *c, *cc;
408
 
 INT r;
 
408
 int16_t r;
409
409
 
410
410
 for (c=cell_f()->nextl; c->next!=NULL; c=c->nextl)
411
411
  {
418
418
      (c->flg&c_f_bad ||
419
419
       c->vers[0].prob<PROBOK ||                // Oleg
420
420
       memchr("ceo<>",c->vers[0].let,4) && c->vers[0].prob<PROBOK_ceo ||
421
 
       language==LANG_RUSSIAN && memchr("������",c->vers[0].let,6) &&
 
421
       language==LANG_RUSSIAN && memchr("Єўбэкн",c->vers[0].let,6) &&
422
422
                                 c->vers[0].prob<PROBOK_ceo ||
423
 
       language==LANG_RUSSIAN && memchr("��",c->vers[0].let,2) &&
 
423
       language==LANG_RUSSIAN && memchr("ўн",c->vers[0].let,2) &&
424
424
       c->stick_inc>300 && c->vers[0].prob<PROBOK_ceo+10     ||
425
 
       language==LANG_RUSSIAN && memchr("���",c->vers[0].let,3) &&
 
425
       language==LANG_RUSSIAN && memchr("ЁҐ®",c->vers[0].let,3) &&
426
426
       c->vers[0].prob<PROBOK_ceo-20
427
427
     ) && c->h<=bl.ps && c->row+2>=bl.b2 && c->row+c->h-2<=bl.b3 &&
428
428
          (r=chkquocks(bl.ps,2,c))!=0 && check_shevron(c,1)>=3)
461
461
static void glue_dust()
462
462
 {
463
463
 cell *c1,*c2,*c3,*c4;cell *cc1;
464
 
 INT h,s,m1,m2,m3,m4;
 
464
 int16_t h,s,m1,m2,m3,m4;
465
465
 
466
466
 for (c1=(cell_f())->next; c1 && (c2=c1->next)!=NULL; c1=c1->next)
467
467
  if (c1->flg&c2->flg&c_f_dust)
537
537
   }
538
538
 }
539
539
 
540
 
static INT exclam(cell *c1,cell *c2,B_LINES *bl)
 
540
static int16_t exclam(cell *c1,cell *c2,B_LINES *bl)
541
541
 {
542
542
 cell *c,*cc;
543
543
 
576
576
static cell *let_gl(cell *c1,cell *c2,cell *c3,cell *c4,B_LINES *bl)
577
577
 {
578
578
 cell *c, *cp;
579
 
 INT r,n;
 
579
 int16_t r,n;
580
580
#define MBI 1
581
581
#define MBE 2
582
582
 
627
627
 c->difflg=0;
628
628
 c->cg_flag=0;
629
629
 c->dens=255;
630
 
 c->keg=(BYTE)bl->ps;
 
630
 c->keg=(uchar)bl->ps;
631
631
 c->nvers=0;
632
632
 // AL-JOE decicion-making was here; all c1-c4 were deleted
633
633
 if( (r&MBI) && !(language==LANG_RUSSIAN&&!langUkr&&!langSer))
661
661
static void dots()
662
662
 {
663
663
 cell *c,*cc,csv;
664
 
 BYTE let;
665
 
 INT i,nv;
 
664
 uchar let;
 
665
 int16_t i,nv;
666
666
 version vers[VERS_IN_CELL];
667
667
 
668
668
 for (c=(cell_f())->next; c->next!=NULL; c=c->next)
830
830
static void quockets()
831
831
 {
832
832
 cell *c;
833
 
 BYTE let;
834
 
 INT h;
 
833
 uchar let;
 
834
 int16_t h;
835
835
 
836
836
 for (c=(cell_f())->nextl; c->next!=NULL; c=c->nextl)
837
837
  {
873
873
 
874
874
static void punctsign(cell **ac1,cell **ac2)
875
875
 {
876
 
 INT h,d,dd,dp,fl,dc,p,lr,a;
877
 
 BYTE let,str[80];
 
876
 int16_t h,d,dd,dp,fl,dc,p,lr,a;
 
877
 uchar let,str[80];
878
878
 cell *c;
879
879
 cell *c1;
880
880
 cell *c2;
933
933
     {
934
934
     if (chkquot(h,dp,c2))
935
935
      c2->vers[0].let=(dp<=1)?'"':
936
 
                        low_quotes;     // ������ 31.05.2001 E.P.
 
936
                        low_quotes;     // Макрос 31.05.2001 E.P.
937
937
     else
938
938
      {
939
939
      if ((lr=chkquock(h,dp,c2))!=0)
1134
1134
#define BASEOK 15
1135
1135
/////////////////
1136
1136
/////////////////
1137
 
static INT dustpos(INT h,cell *c)
 
1137
static int16_t dustpos(int16_t h,cell *c)
1138
1138
 
1139
1139
/***********************************************************
1140
1140
 
1150
1150
***********************************************************/
1151
1151
 
1152
1152
 {
1153
 
 INT mid,a,d;
 
1153
 int16_t mid,a,d;
1154
1154
 
1155
1155
 get_b_lines(c,&bl);
1156
1156
 mid=c->row+c->h/2;
1186
1186
  }
1187
1187
 }
1188
1188
///////////////////
1189
 
static INT chkdotcom(INT h,INT dp,cell *c)
 
1189
static int16_t chkdotcom(int16_t h,int16_t dp,cell *c)
1190
1190
 {
1191
 
 INT x,y,dt,cm,hc,wc,wm,i,j,k,ls,s;
1192
 
 BYTE str[80];
 
1191
 int16_t x,y,dt,cm,hc,wc,wm,i,j,k,ls,s;
 
1192
 uchar str[80];
1193
1193
 B_LINES bl;
1194
1194
 
1195
1195
 if (snap_activity('e'))
1342
1342
 return (dt+(cm<<1));
1343
1343
 }
1344
1344
 
1345
 
static INT chkdash(INT h,INT dp,cell *c)
 
1345
static int16_t chkdash(int16_t h,int16_t dp,cell *c)
1346
1346
 {
1347
 
 INT r;
1348
 
 BYTE str[80];
 
1347
 int16_t r;
 
1348
 uchar str[80];
1349
1349
 
1350
1350
 r=(dp<=3 && /*9*(c->h)<=4*h*/27*c->h<=13*h && c->w>=MIN(4,h/3) &&
1351
1351
    (5*(c->w)>=2*h || dp==2 && c->w>c->h))?1:0;
1359
1359
 return r;
1360
1360
 }
1361
1361
 
1362
 
static INT chkquot(INT h,INT dp,cell *c)
 
1362
static int16_t chkquot(int16_t h,int16_t dp,cell *c)
1363
1363
 {
1364
 
 WORD ls,i,j,k,i1,j1,k1,min,l,s,r,lu,ru,ld,rd;
1365
 
 BYTE str[80];
 
1364
 uint16_t ls,i,j,k,i1,j1,k1,min,l,s,r,lu,ru,ld,rd;
 
1365
 uchar str[80];
1366
1366
 
1367
1367
 if (snap_activity('e'))
1368
1368
  {
1424
1424
 return(r);
1425
1425
 }
1426
1426
 
1427
 
static INT chkstar(INT h,INT dp,cell *c)
 
1427
static int16_t chkstar(int16_t h,int16_t dp,cell *c)
1428
1428
 {
1429
 
 INT ls,i,j,l,r,x,y,n,p;
1430
 
 BYTE str[80];
 
1429
 int16_t ls,i,j,l,r,x,y,n,p;
 
1430
 uchar str[80];
1431
1431
 
1432
1432
 if (snap_activity('e'))
1433
1433
  {
1509
1509
 return(r);
1510
1510
 }
1511
1511
 
1512
 
static INT chkplus(INT h,INT dp,cell *c)
 
1512
static int16_t chkplus(int16_t h,int16_t dp,cell *c)
1513
1513
 {
1514
 
 INT ls,i,j,l,r,x,y,lu,ru,ld,rd;
1515
 
 BYTE str[80];
 
1514
 int16_t ls,i,j,l,r,x,y,lu,ru,ld,rd;
 
1515
 uchar str[80];
1516
1516
 
1517
1517
 if (snap_activity('e'))
1518
1518
  {
1569
1569
 return(r);
1570
1570
 }
1571
1571
 
1572
 
static INT chkslash(INT h,INT dp,cell *c)
 
1572
static int16_t chkslash(int16_t h,int16_t dp,cell *c)
1573
1573
 {
1574
 
 INT r,ls,i,j,s;
1575
 
 BYTE str[80];
 
1574
 int16_t r,ls,i,j,s;
 
1575
 uchar str[80];
1576
1576
 
1577
1577
 r=0;
1578
1578
 if ((dp==1 || dp==2) && c->h>=4 && c->h>=h/2-2 && c->w>=h-2)
1598
1598
 return r;
1599
1599
 }
1600
1600
 
1601
 
static INT chkcircle(INT h,INT dp,cell *c)
 
1601
static int16_t chkcircle(int16_t h,int16_t dp,cell *c)
1602
1602
 {
1603
 
 INT r,i;
1604
 
 BYTE flgsv,str[80];
 
1603
 int16_t r,i;
 
1604
 uchar flgsv,str[80];
1605
1605
 
1606
1606
 r=0;
1607
1607
 if (dp<4 && c->h>=h/2-1)
1608
1608
  {
1609
 
  flgsv=(BYTE)c->flg;
 
1609
  flgsv=(uchar)c->flg;
1610
1610
  short_recog_cell(c);
1611
1611
  c->flg=flgsv;
1612
1612
  for (i=0; i<c->nvers; i++)
1622
1622
 return r;
1623
1623
 }
1624
1624
 
1625
 
static INT chkquock(INT h,INT dp,cell *c)
 
1625
static int16_t chkquock(int16_t h,int16_t dp,cell *c)
1626
1626
 {
1627
 
 INT r,sl,sr,i,j,l;
1628
 
 BYTE str[80];
 
1627
 int16_t r,sl,sr,i,j,l;
 
1628
 uchar str[80];
1629
1629
 
1630
1630
 r=0;
1631
1631
 if (dp==2 && 11*c->h>=4*h && c->h>=c->w)
1677
1677
 return r;
1678
1678
 }
1679
1679
 
1680
 
INT chkquocks2(cell*c,PBYTE r,INT h,INT w,INT d);
1681
 
static INT chkquocks(INT h,INT dp,cell *c)
 
1680
int16_t chkquocks2(cell*c,puchar r,int16_t h,int16_t w,int16_t d);
 
1681
static int16_t chkquocks(int16_t h,int16_t dp,cell *c)
1682
1682
 {
1683
 
 INT i,di,i1,i2,j,j1,j2,l,d,r;
1684
 
 BYTE str[80];
 
1683
 int16_t i,di,i1,i2,j,j1,j2,l,d,r;
 
1684
 uchar str[80];
1685
1685
 
1686
1686
 d=0;
1687
1687
 if (dp==2 && 11*c->h>=4*h && 3*c->w>=2*c->h &&
1712
1712
   }
1713
1713
   if(chkquocks2(c,rstr,c->h,c->w,d)) goto ret;
1714
1714
{
1715
 
extern BYTE multy_language;
1716
 
   // >> similar � , << similar �,�
 
1715
extern uchar multy_language;
 
1716
   // >> similar з , << similar Є,­
1717
1717
   if( multy_language && d!=0 && c->h>12 )
1718
1718
    {
1719
 
    INT ii,jj,ll;
 
1719
    int16_t ii,jj,ll;
1720
1720
    if( d>0 && j1*8<c->w )
1721
1721
      {
1722
1722
      d=0;
1789
1789
 
1790
1790
static void dust_to_bad(cell *c)
1791
1791
 {
1792
 
 INT i;
 
1792
 int16_t i;
1793
1793
 cell *c1;
1794
1794
 
1795
1795
 if (db_status)
1831
1831
static void intval(cell *c,cell *cb)
1832
1832
 {
1833
1833
 cell *c1,*c2,*c3,/* *sav1,*sav2, */ *cbb;
1834
 
 BYTE l1,l2,l3;
1835
 
 INT fe,fm;
1836
 
 INT h,d,max,s,hh,ww;
 
1834
 uchar l1,l2,l3;
 
1835
 int16_t fe,fm;
 
1836
 int16_t h,d,max,s,hh,ww;
1837
1837
 
1838
1838
 cbb=cb->prev;
1839
1839
 for (c1=cbb->next; c1!=c; c1=c1->next)
1912
1912
     if (l1==',' && l2==',' && abs(c1->h-c2->h)<=(c1->h+c2->h)/4 &&
1913
1913
         abs(c1->row+c1->h/2-(c2->row+c2->h/2))<=h/4 &&
1914
1914
         c2->col-(c1->col+c1->w)<=h/2 && !line_tabcell)
1915
 
      c2->vers[0].let=low_quotes;       // ������ 31.05.2001 E.P.
 
1915
      c2->vers[0].let=low_quotes;       // Макрос 31.05.2001 E.P.
1916
1916
     else
1917
1917
      {
1918
1918
      if ((l1=='/' && (l2==0x27 || l2==':' || l2=='O') ||
2143
2143
       if (fm==2)
2144
2144
        no_cut(c3);
2145
2145
       // AL OK
2146
 
       compose_cell((INT)(fm+1),clist,c2);
 
2146
       compose_cell((int16_t)(fm+1),clist,c2);
2147
2147
       c2->left=c2->col;
2148
2148
       c2->right=c2->col+c2->w;
2149
2149
       c1=c2;
2288
2288
void clean_punct()
2289
2289
{
2290
2290
  cell *L,*R,*C=cell_f()->next;
2291
 
  CHAR str[80];
2292
 
  INT gap=get_gap();
 
2291
  char str[80];
 
2292
  int16_t gap=get_gap();
2293
2293
 
2294
2294
  for (; C->next; C=C->next)
2295
2295
  {
2336
2336
  }
2337
2337
}
2338
2338
 
2339
 
static INT contain(cell *new, cell *old)
 
2339
static int16_t contain(cell *new, cell *old)
2340
2340
//
2341
2341
//      This procedure check whether new cell contains old one.
2342
2342
//
2374
2374
        return C;
2375
2375
}
2376
2376
///////////////////////////////////////////////////////////////////////////////////////////
2377
 
void hide_dusts(BYTE mode)
 
2377
void hide_dusts(uchar mode)
2378
2378
{
2379
2379
        cell *C;
2380
2380
 
2392
2392
  while (sv_fantom)
2393
2393
  {
2394
2394
    B=rest_cell(sv_fantom,B);
2395
 
    sv_fantom=(PBYTE)(B->complist);
 
2395
    sv_fantom=(puchar)(B->complist);
2396
2396
  }
2397
2397
}
2398
2398
void clear_twin_flags(void)
2410
2410
//*******************************************************************
2411
2411
void czech_dt_glue_apostroph()
2412
2412
{
2413
 
// ACC_ROOF_INF ��� d,t � ������� ����� �� ��������. 07.09.2000 E.P.
 
2413
// ACC_ROOF_INF над d,t в Чешском похож на апостроф. 07.09.2000 E.P.
2414
2414
 
2415
2415
 cell *c,*cc;
2416
 
 BYTE let;
2417
 
 INT gap=get_gap();
2418
 
 INT d;
 
2416
 uchar let;
 
2417
 int16_t gap=get_gap();
 
2418
 int16_t d;
2419
2419
 
2420
2420
for (c=(cell_f())->next; (cc=c->next)!=NULL; c=c->next)
2421
2421
        {
2431
2431
        if (let != 'd' && let != 't')
2432
2432
                continue;
2433
2433
 
2434
 
        // �������� ����� d, t
 
2434
        // Апостроф после d, t
2435
2435
        if (cc->vers[0].let != '\'')
2436
2436
                continue;
2437
2437
 
2438
 
        // ���������� �� ������
 
2438
        // Достаточно ли близко
2439
2439
        d= cc->col - c->right;
2440
2440
        if (d >= gap)
2441
2441
                continue;
2442
2442
 
2443
 
        // �������
 
2443
        // Склеить
2444
2444
        clist[0]=c;
2445
2445
        clist[1]=cc;
2446
2446
        compose_cell(2,clist,c);
2447
2447
 
2448
 
        // �������� ������
 
2448
        // Заменить версию
2449
2449
        switch(let)
2450
2450
                {
2451
2451
                case 'd': c->vers[0].let = d_inv_roof; break;