void facehash::remove(face *t) { if (toaddset.ismember((long)t)) { toremoveset.add((long)t); } else { dorange(t,(void (*)(short *,face *))&facehash::removecell); } }
void facehash::addall() { //cout << "ADDING ALL (" << level << ") " << toadd.length() << endl; for(int i=0;i<toadd.length();i++) { if (toremoveset.ismember((long)toadd.nth(i))) continue; dorange(toadd[i], (void (*)(short *,face *))&facehash::addcell); } toadd.setlength(0); toaddset.clear(); toremoveset.clear(); }
/* Построение ttb (таблицы трансляции) из array. */ char *makttb(char *a, char *ttb, char *xxx) { int c; char *t = ttb; for (; (c = *a) != 0; ++a) { if ((ttb - t) >= SSIZE) error("Expansion to long for",xxx); if (c == ESCAPE) *ttb++ = esc(&a); else if (c == PCLASS && a[1]) { switch (c = tolower(*++a)) { case 'z': break; case 'n': ttb = insrange('0','9',ttb); case 'a': ttb = insrange('A','Z',ttb); case 'l': ttb = insrange('a','z',ttb); break; case 'u': ttb = insrange('A','Z',ttb); break; case 'r': ttb = insrange('А','Я',ttb); case 'm': ttb = insrange('а','п',ttb); ttb = insrange('р','я',ttb); break; case 'b': ttb = insrange('А','Я',ttb); break; case 'd': ttb = insrange('0','9',ttb); break; case 's': ttb = insrange(1,' ',ttb); break; case '.': ttb = insrange(1,0377,ttb); break; default: error("Unknown class type",a-1); } } else if (*a == RANGE && ttb != t && a[1]) ttb = dorange(&a,ttb); else *ttb++ = *a; } *ttb = 0; return t; }