~ubuntu-branches/ubuntu/precise/cuneiform/precise

« back to all changes in this revision

Viewing changes to cuneiform_src/Kern/rling/sources/c/speledf1.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:
90
90
/**********************************************************************/
91
91
/******** L o k a l    f u n c t i o n s   p r o t o t y p e s ********/
92
92
/**********************************************************************/
93
 
 static INT mvbuf(WORD l);
94
 
 static INT set_descr(CHAR c);
95
 
 static INT do_fragm(void);
96
 
 static void move_from_near_to_huge(CHAR  *a, CHAR *b, INT l);
97
 
 static INT create_segm(struct segm *prev_adr,WORD segm_size,WORD type);
98
 
 static INT n_l(void);
99
 
 static INT p_l(void);
100
 
 static INT prev_letter(void);
 
93
 static int16_t mvbuf(uint16_t l);
 
94
 static int16_t set_descr(char c);
 
95
 static int16_t do_fragm(void);
 
96
 static void move_from_near_to_huge(char  *a, char *b, int16_t l);
 
97
 static int16_t create_segm(struct segm *prev_adr,uint16_t segm_size,uint16_t type);
 
98
 static int16_t n_l(void);
 
99
 static int16_t p_l(void);
 
100
 static int16_t prev_letter(void);
101
101
 
102
102
/***********************************************************************/
103
103
/*
106
106
                b/ engendering all the necessaries structures
107
107
                c/ setting up the pointers
108
108
*/
109
 
INT begin(BYTE batch_run)
 
109
int16_t begin(uchar batch_run)
110
110
{
111
 
        /* INT  *p;*/
112
 
        WORD i;
113
 
        WORD i1;
114
 
        /*  DWORD l;*/
 
111
        /* int16_t  *p;*/
 
112
        uint16_t i;
 
113
        uint16_t i1;
 
114
        /*  uint32_t l;*/
115
115
 
116
116
        SPQ.real_num        = 0;
117
117
        SPQ.sw_symb         = 0;
160
160
 }
161
161
/*********************************************************************/
162
162
 
163
 
define_lth(BYTE  *symb)
 
163
define_lth(uchar  *symb)
164
164
/*
165
165
    This procedure calculates length of letter.
166
166
*/
167
167
 {
168
168
  LT  *let;
169
 
  INT n;
 
169
  int16_t n;
170
170
 
171
171
  let=(LT  *)symb;
172
172
  n=0;
182
182
  return(n);
183
183
 }
184
184
/***********************************************************************/
185
 
 struct segm  *next_line(CHAR tt,struct segm  *cur_segm)
 
185
 struct segm  *next_line(char tt,struct segm  *cur_segm)
186
186
/*
187
187
    This procedure gives address of next line.
188
188
*/
212
212
  return(cur_segm);
213
213
 }
214
214
/**********************************************************************/
215
 
INT processEdSymb(void)
 
215
int16_t processEdSymb(void)
216
216
{
217
 
        INT ret = YES;
218
 
        INT n;
 
217
        int16_t ret = YES;
 
218
        int16_t n;
219
219
 
220
220
        switch (*SPQ.buff_ptr)
221
221
        {
239
239
                                                        break;
240
240
                case SS_TABUL     : ret=mvbuf(sizeof(struct tabul));
241
241
                                                        break;
242
 
                case SS_TABL_TABUL: if (SPQ.buff_ptr-(BYTE*)SPQ.text_buff >= SPQ.buff_l-1)
 
242
                case SS_TABL_TABUL: if (SPQ.buff_ptr-(uchar*)SPQ.text_buff >= SPQ.buff_l-1)
243
243
                                                                ret=NO;
244
244
                                                        else
245
245
                                                         {
246
246
                                                                n=*(SPQ.buff_ptr+1); /* length of tabl */
247
 
                                                                ret=mvbuf((WORD)(n+1));
 
247
                                                                ret=mvbuf((uint16_t)(n+1));
248
248
                                                         }
249
249
                                                        break;
250
250
                case SS_SHEET_DESCR:
272
272
                                                        break;
273
273
                default           :
274
274
                                if(*SPQ.buff_ptr<0x20)
275
 
                                  ret=mvbuf((WORD)(ED_LREC(SPQ.buff_ptr)));
 
275
                                  ret=mvbuf((uint16_t)(ED_LREC(SPQ.buff_ptr)));
276
276
                                else
277
 
                                  ret=mvbuf((WORD)(sizeof(LT)));/* letter */
 
277
                                  ret=mvbuf((uint16_t)(sizeof(LT)));/* letter */
278
278
                                                        break;
279
279
       }                             /* end of switch */
280
280
 
293
293
 check_free_mem();
294
294
}
295
295
/************************************************************************/
296
 
INT mvbuf(WORD l)
 
296
int16_t mvbuf(uint16_t l)
297
297
/*
298
298
     This subroutine is in charge with setting down symbols
299
299
     into string of concerned segm.
300
300
*/
301
301
 {
302
302
  if( l==0 )  return -1; // Oleg : need stop if unknown tag in ED
303
 
  if (SPQ.buff_ptr-(BYTE*)SPQ.text_buff+l > SPQ.buff_l)
 
303
  if (SPQ.buff_ptr-(uchar*)SPQ.text_buff+l > SPQ.buff_l)
304
304
    return(NO);
305
305
  SPQ.l+=l;
306
306
  move_from_near_to_huge(SPQ.str_ptr, SPQ.buff_ptr,l);
312
312
  return(YES);
313
313
 }
314
314
/*************************************************************************/
315
 
void fill_fragm(INT n_fragm)
 
315
void fill_fragm(int16_t n_fragm)
316
316
/*
317
317
     This procedure fills out fragment description table.
318
318
*/
333
333
 }                                     /* end of fill_fragm */
334
334
 
335
335
/************************************************************************/
336
 
INT set_descr(CHAR c)
 
336
int16_t set_descr(char c)
337
337
/*
338
338
    This procedure sets up sheet_descr or head of line.
339
339
    c=SHEET means sheet_descriptor; c=LINE means line_descriptor.
340
340
*/
341
341
 {
342
 
  INT i  /*,k*/;
 
342
  int16_t i  /*,k*/;
343
343
  struct segm  *segm_ptr;
344
 
  /* CHAR * return_str_ptr;*/
 
344
  /* char * return_str_ptr;*/
345
345
  check_free_mem();
346
346
  if (c == SHEET)
347
347
   {                                   /* sheet */
348
348
    SPQ.sheet_disk_descr_ptr=(struct sheet_disk_descr *)SPQ.buff_ptr;
349
349
 
350
 
    if ((DWORD)(SPQ.buff_ptr - (BYTE*)SPQ.text_buff) > (DWORD)(SPQ.buff_l - sizeof(struct sheet_disk_descr)))
 
350
    if ((uint32_t)(SPQ.buff_ptr - (uchar*)SPQ.text_buff) > (uint32_t)(SPQ.buff_l - sizeof(struct sheet_disk_descr)))
351
351
      return(NO);
352
352
 
353
353
        SPQ.qt_fm=SPQ.sheet_disk_descr_ptr->quant_fragm;
354
354
    if(SPQ.qt_fm >= MAX_FRAGM )                         return TOO_MANY_FRAGMS;
355
355
 
356
 
    if (SPQ.buff_ptr-(BYTE*)SPQ.text_buff >=
 
356
    if (SPQ.buff_ptr-(uchar*)SPQ.text_buff >=
357
357
         SPQ.buff_l-SPQ.sheet_disk_descr_ptr->descr_lth)
358
358
                         /* not enough room in buffer for all fragm descr */
359
359
      return(NO);
373
373
     SPQ.st.cur_segm->string_lth+=DELTA;
374
374
     SPQ.free_alloc_mem+=DELTA;
375
375
   check_free_mem();
376
 
    if ( (DWORD)(SPQ.buff_ptr - (BYTE*)SPQ.text_buff) > (DWORD)(SPQ.buff_l - sizeof(struct line_beg)) )
 
376
    if ( (uint32_t)(SPQ.buff_ptr - (uchar*)SPQ.text_buff) > (uint32_t)(SPQ.buff_l - sizeof(struct line_beg)) )
377
377
      return(NO);
378
378
    SPQ.ptr_next_segm=(struct segm *)SPQ.free_alloc_mem;
379
379
    SPQ.str_ptr=SPQ.ptr_next_segm->string;
380
 
    SPQ.free_alloc_mem=( CHAR  *)(SPQ.ptr_next_segm+1);
 
380
    SPQ.free_alloc_mem=( char  *)(SPQ.ptr_next_segm+1);
381
381
    segm_ptr=(struct segm *) SPQ.tab_ptr->
382
382
                tab_fragm[SPQ.cur_sheet][SPQ.cur_fragm].last_segm;
383
383
    segm_ptr->next_in_fragm=SPQ.ptr_next_segm;
404
404
 
405
405
 
406
406
/*------------------------------------------------------------------*/
407
 
INT do_fragm(void)
 
407
int16_t do_fragm(void)
408
408
/*
409
409
    This procedure sets up fragm_descr or head of line.
410
410
*/
414
414
 
415
415
  check_free_mem();
416
416
 
417
 
  if ( (DWORD)(SPQ.buff_ptr - (BYTE*)SPQ.text_buff) > (DWORD)(SPQ.buff_l - sizeof(struct fragm_disk)) )
 
417
  if ( (uint32_t)(SPQ.buff_ptr - (uchar*)SPQ.text_buff) > (uint32_t)(SPQ.buff_l - sizeof(struct fragm_disk)) )
418
418
    return(NO);
419
419
  SPQ.fragm_disk_ptr=(struct fragm_disk *)SPQ.buff_ptr;
420
420
  SPQ.cur_fragm=SPQ.fragm_disk_ptr->fragm_numb;
421
421
  SPQ.ptr_next_segm=(struct segm  *)SPQ.free_alloc_mem;
422
422
  SPQ.str_ptr=SPQ.ptr_next_segm->string;
423
423
  SPQ.st.cur_segm->next_in_fragm=SPQ.ptr_next_segm;
424
 
  SPQ.free_alloc_mem=(CHAR  *)(SPQ.ptr_next_segm+1);
 
424
  SPQ.free_alloc_mem=(char  *)(SPQ.ptr_next_segm+1);
425
425
  SPQ.ptr_next_segm->prev_in_fragm=
426
426
            SPQ.tab_ptr->tab_fragm[SPQ.cur_sheet][SPQ.cur_fragm].last_segm;
427
427
  if ((SPQ.sheet_flag[SPQ.cur_sheet] == EXIST) &&
451
451
/*
452
452
    This procedure gives address of first segment in current line.
453
453
*/
454
 
struct segm  *cur_line(CHAR tt, struct segm * cur_segm)
 
454
struct segm  *cur_line(char tt, struct segm * cur_segm)
455
455
 {
456
456
  if (tt == FRAGM)
457
457
   {                                   /* fragm */
475
475
 }
476
476
 
477
477
 
478
 
void skip_letter_in_line(struct segm  *segm_ptr,INT x)
 
478
void skip_letter_in_line(struct segm  *segm_ptr,int16_t x)
479
479
/*
480
480
    This procedure sets up to SPQ.ns_symb adrress of letter
481
481
    with given x-coordinate in line.
485
485
    SPQ.skip_line_x - actual x-coordinate.
486
486
*/
487
487
 {
488
 
  INT i;
489
 
  INT max;
 
488
  int16_t i;
 
489
  int16_t max;
490
490
 
491
 
  BYTE  *symb,  *c;
 
491
  uchar  *symb,  *c;
492
492
  struct segm  *segm_c;
493
493
  SPQ.end_l=NO;
494
494
  segm_ptr=cur_line(FRAGM,segm_ptr);
529
529
    SPQ.skip_line_x=0;
530
530
 }
531
531
/*****************************************************/
532
 
void move_from_near_to_huge(CHAR  *a, CHAR *b, INT l)
 
532
void move_from_near_to_huge(char  *a, char *b, int16_t l)
533
533
{
534
534
 while (l--) *a++=*b++;
535
535
}
536
 
void move_from_cur_to_new(struct segm  *cur_segm, CHAR  *cur_symb)
 
536
void move_from_cur_to_new(struct segm  *cur_segm, char  *cur_symb)
537
537
/*
538
538
    This procedure relocates string from current segm to new,
539
539
    as well as changes busy and string lengths & SPQ.free_alloc_mem
540
540
    if it's necessary.
541
541
*/
542
542
 {
543
 
 BYTE  *s_old;
544
 
 BYTE  *s;
545
 
 BYTE  * s_new;
 
543
 uchar  *s_old;
 
544
 uchar  *s;
 
545
 uchar  * s_new;
546
546
 
547
547
  s_new=&SPQ.new_segm->string[SPQ.new_segm->busy_lth];
548
548
  s_old=&cur_segm->string[cur_segm->busy_lth];
560
560
   }
561
561
 }
562
562
 /*------------------------*/
563
 
void shift(CHAR dir,INT v_s,struct segm *cur_segm,CHAR *cur_symb)
 
563
void shift(char dir,int16_t v_s,struct segm *cur_segm,char *cur_symb)
564
564
/*
565
565
    This procedure transfers text.
566
566
    dir - RIGHT/LEFT.
568
568
    cur_symb - address of cut.
569
569
*/
570
570
 {
571
 
  CHAR  *c;
572
 
  /*INT l;*/
573
 
  CHAR  *from;
574
 
  CHAR  *to;
575
 
  CHAR  *end;
 
571
  char  *c;
 
572
  /*int16_t l;*/
 
573
  char  *from;
 
574
  char  *to;
 
575
  char  *end;
576
576
 
577
577
  c=cur_symb;
578
578
  if (c == NULL)
584
584
   }
585
585
  if (dir == RIGHT)
586
586
   {
587
 
    from=(CHAR  *)cur_segm;
 
587
    from=(char  *)cur_segm;
588
588
    from+=sizeof(struct segm)+cur_segm->busy_lth-1;
589
589
    to=from+v_s;
590
590
    while (from >= cur_symb)
593
593
   }
594
594
  else
595
595
   {
596
 
    end=(CHAR  *)cur_segm;
 
596
    end=(char  *)cur_segm;
597
597
    end+=sizeof(struct segm)+cur_segm->busy_lth;
598
 
    from=(CHAR  *)cur_symb;
 
598
    from=(char  *)cur_symb;
599
599
    to=from-v_s;
600
600
    while (from < end)
601
601
      *to++=*from++;
603
603
   }
604
604
 }
605
605
 
606
 
 INT create_segm(struct segm *prev_adr,WORD segm_size,WORD type)
 
606
 int16_t create_segm(struct segm *prev_adr,uint16_t segm_size,uint16_t type)
607
607
/*
608
608
    This procedure allocates new segment and connects it with old ones.
609
609
*/
637
637
  sNew->prev_in_sheet=prev_adr;
638
638
  sNew->string_lth=segm_size;
639
639
  sNew->busy_lth=0;
640
 
  sNew->type=(CHAR)type;
 
640
  sNew->type=(char)type;
641
641
  SPQ.new_segm=sNew;
642
642
  SPQ.free_alloc_mem += sizeof(struct segm)+segm_size;
643
643
  return(YES);
644
644
 }
645
645
 
646
 
INT insert_symb(cur_segm, cur_symb,new_symb)
 
646
int16_t insert_symb(cur_segm, cur_symb,new_symb)
647
647
/*
648
648
    This procedure inserts symbol in current position.
649
649
    If the string doesn't contain letters we place new letter
652
652
    cur_segm & cur_symb addresse ,that new symb'll be placed after it.
653
653
*/
654
654
 struct segm  *cur_segm;
655
 
 CHAR  * cur_symb;
 
655
 char  * cur_symb;
656
656
 LT  *new_symb;
657
657
 {
658
 
  INT l;
659
 
  CHAR shift_flag;
 
658
  int16_t l;
 
659
  char shift_flag;
660
660
 LT  *new_symb1;
661
 
  INT flag_n;
662
 
  INT flag_b;
 
661
  int16_t flag_n;
 
662
  int16_t flag_b;
663
663
  flag_b=NO;
664
664
  flag_n=NO;
665
665
  if (SPQ.ins_status == NO)
669
669
           (LT *)next_symb(YES,YES,YES,cur_segm,cur_symb)) != NULL))
670
670
     {
671
671
      l=define_lth(cur_symb);
672
 
      shift(LEFT,(INT)(l-sizeof(LT)),cur_segm,cur_symb+l);
 
672
      shift(LEFT,(int16_t)(l-sizeof(LT)),cur_segm,cur_symb+l);
673
673
      new_symb1=(LT  *)cur_symb;
674
674
      return(NO);
675
675
     }
676
676
   }
677
677
  shift_flag=YES;
678
 
  if ((DWORD)(cur_segm->busy_lth + sizeof(LT)) > (DWORD)(cur_segm->string_lth))
 
678
  if ((uint32_t)(cur_segm->busy_lth + sizeof(LT)) > (uint32_t)(cur_segm->string_lth))
679
679
   {                                   /* segment is full */
680
680
   flag_b=YES;
681
681
    create_segm(cur_segm,SIZE_NEW_SEGM,2);
682
682
    SPQ.ns_segm=SPQ.new_segm;
683
 
    SPQ.ns_symb=(CHAR *)(SPQ.ns_segm->string);
 
683
    SPQ.ns_symb=(char *)(SPQ.ns_segm->string);
684
684
    SPQ.ns_symb+=0;
685
685
    flag_n=YES;
686
686
    shift_flag=NO;
717
717
 return(flag_b);
718
718
 }
719
719
 
720
 
move_to_first( INT dir,BYTE let,INT num)
 
720
move_to_first( int16_t dir,uchar let,int16_t num)
721
721
/*
722
722
 This procedure moves to first space symbol.
723
723
 dir -- direction
724
724
 num =YES means that we searches in all lines.
725
725
 */
726
726
{
727
 
 /*CHAR  *symb;*/
728
 
/* INT rec;*/
 
727
 /*char  *symb;*/
 
728
/* int16_t rec;*/
729
729
 SPQ.E.miss=NO;
730
730
 if(dir== RIGHT)
731
731
  {
814
814
}
815
815
 
816
816
 
817
 
INT n_l(void)
 
817
int16_t n_l(void)
818
818
{
819
819
SPQ.ns_segm=next_line(SHEET,SPQ.ns_segm);
820
820
if(SPQ.ns_segm== NULL)
830
830
 return(YES);
831
831
}
832
832
 
833
 
INT p_l(void)
 
833
int16_t p_l(void)
834
834
{
835
 
 INT shift,shift1;
 
835
 int16_t shift,shift1;
836
836
 SPQ.ns_segm=cur_line(FRAGM,SPQ.ns_segm)->prev_in_sheet;
837
837
 if(SPQ.ns_segm== NULL)
838
838
  return(NO);
853
853
return(YES);
854
854
}
855
855
 
856
 
INT prev_letter(void)
 
856
int16_t prev_letter(void)
857
857
/*
858
858
 This procedure moves to previos letter in line and changes
859
859
 SPQ.E.x,SPQ.E.x_a,SPQ.E.y,SPQ.E,y_a,SPQ.ns_symb,SPQ.ns_segm.
877
877
      skip_letter_in_line(SPQ.ns_segm,SPQ.E.x_a);
878
878
 return(YES);
879
879
 }
880
 
 INT load_fragm()
 
880
 int16_t load_fragm()
881
881
 /*
882
882
 This procedure loads givev fragm atherwise returns NO.
883
883
 */
909
909
  return(YES);
910
910
 }
911
911
/******************************************************************/
912
 
 INT test_spare_space(struct segm * segm,INT need_size)
 
912
 int16_t test_spare_space(struct segm * segm,int16_t need_size)
913
913
 {
914
914
   return
915
915
     (segm->busy_lth + need_size > segm->string_lth)? NO : YES  ;