void AKClearVers() { cell * Count; char Let; //uchar Prob; int i; // проверяем цепочку на случай зацикливания или обрыва AKCheckChain(); for (Count = cell_f()->next; Count != cell_l(); Count=Count->next) { for ( i = 0; /*Count->vers[i].let != 0x0 &&*/ i < VERS_IN_CELL/*Count->nvers*/ ; i++ ) { Let = Count->vers[i].let; if ( !proplet(Let) /*&& Let != bad_char*/ ) { // если символ не от сюда Count->vers[i].let = 0; //bad_char; Count->vers[i].prob = 0; } } sort_vers(Count); /* if (Count->vers[0].let == bad_char) { Count = del_cell(Count); } */ } }
void insert_cell(cell *c,cell *ci) { int16_t col=c->col; if(!(ci->flg & c_f_space)) // Valdemar 02-15-96 00:17am // Paul 10-11-96 /* if (col <= ci->col) while ((ci->prev)->col > col) ci=ci->prev; else while ((ci=ci->next)->col <= col); */ //AK! Crashed line when ci->prev pointed to first_cell or ci // pointed to last_cell if (col <= ci->col) while ( (ci->prev && ci->prev != cell_f()) && ((ci->prev)->flg & c_f_space || (ci->prev)->col > col)) { if ( ci->prev ) ci=ci->prev; else AKCheckChain(); } else while ((ci != cell_l() && ci->next) && (ci->flg & c_f_space || ci->col <= col)) { if ( ci->next ) ci=ci->next; else AKCheckChain(); } // (ci->prev)->next=c; c->prev=ci->prev; c->next=ci; ci->prev=c; if (c->flg & (c_f_let+c_f_bad) && !(c->flg & c_f_dust) ) { ci=c->next; while (!(ci->flg & (c_f_fict+c_f_let+c_f_bad)) || ci->flg & c_f_dust) ci=ci->next; (ci->prevl)->nextl=c; c->prevl=ci->prevl; c->nextl=ci; ci->prevl=c; } else // AL 940318 err_pnlet (c); }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // AK add c/g gor cells cell * del_cell(cell *c) { cell *cc; cc = c->prev; // AK add c/g if (!(c->next)) AKCheckChain(); del_retain_cell(c); free_cell(c); return cc; }
void AKTryChainRecover(cell ** c) { AKCheckChain(); // если правка цепочки не принесла результата, // проверяем, находится ли c в цепочке if ((*c)->next == NULL) { // если нет, попробуем вернуться к предыдущей, иначе к началу if (!AKCellInChain(*c)) { if (AKCellInChain((*c)->prev)) *c = (*c)->prev; else *c = cell_f()->next; } } }
//////////////////////////////////////////////////////////////////////////////////////////////////////////// // смотрим. есть ли такой cell в цепочке int16_t AKCellInChain(cell * Cell) { cell * Count; // проверяем цепочку на случай зацикливания или обрыва AKCheckChain(); for (Count = cell_f(); Count != cell_l(); Count = Count->next) { if (Count == Cell) return TRUE; } if (Cell == cell_l()) return TRUE; return FALSE; }