Esempio n. 1
0
static CSTR_rast ed_end_word(CSTR_rast cs,uchar *str,uchar *word_len)
{
CSTR_rast       c=cs;
CSTR_rast_attr  attr;
int16_t           i;
RecVersions     vers;

CSTR_GetCollection(c,&vers);
*str++  = vers.Alt[0].Code;
i=1;
do{
  c=CSTR_GetNext(c);
  CSTR_GetCollection(c,&vers);
  *str++  = vers.Alt[0].Code;
  CSTR_GetAttr(c,&attr);
  i++;
  }while( c && !memchr(right_limit_word,vers.Alt[0].Code,sizeof(right_limit_word)) &&
          !(attr.flg&CSTR_f_fict) && i<MAX_LEN_WORD-1);
c=c ? c : CSTR_GetLastRaster(CSTR_GetRasterLine(cs));
if( i )
    {
    i--;
    str--;
    }
*str='\0';
*word_len = (uchar)i;
return c;
}
Esempio n. 2
0
static void show_spell(CSTR_rast c)
{
uchar   wrd[80],buf[160],*w=wrd, lang;
Bool32  nonrec=FALSE;
CSTR_rast_attr  attr;
UniVersions     uni;
CSTR_rast       co=c;
*w=0;
do{
    CSTR_GetAttr(c, &attr);
    c=CSTR_GetPrev(c);
    }
    while( c && attr.flg&(CSTR_f_let|CSTR_f_bad) );
if( !c )
    c=CSTR_GetNext(CSTR_GetFirstRaster(CSTR_GetRasterLine(co)));
else
    c=CSTR_GetNext(CSTR_GetNext(c));
CSTR_GetAttr(c,&attr);
for(lang=attr.language;c;c=CSTR_GetNext(c))
    {
    CSTR_GetAttr(c,&attr);
    if(!(attr.flg&(CSTR_f_let|CSTR_f_bad)) )
        break;
    if( attr.flg&CSTR_f_bad )
        nonrec=TRUE;
    CSTR_GetCollectionUni(c,&uni);
    strcat(w,uni.Alt[0].Code);
    }

strcpy(buf,"<");
strcat(buf,wrd);
strcat(buf,"> static : ");
if( rpstr_txt_spell(wrd,lang)        )
    strcat(buf,"y");
else
    strcat(buf," n");
Snap_Console(buf);
return;
}