charset code
Gregory Kozlovsky <[email protected]> Tue, 18 Mar 2003 18:45:28 +0100
| Newsgroups | gmane.comp.web.aspseek.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello, Kir,
Do you know, at least something about what the following code from
charset.cpp mean?
Is it some kind of hashing? Why is the assignement repeated twice?
void MakeWordRange(TCHARSET* charset)
{
mdemset(charset->wordch, 0, sizeof(charset->wordch));
unsigned char* pc = charset->chars;
while (*pc)
{
charset->wordch[*pc >> 3] |= (1 << (*pc & 7));
pc++;
}
pc = (unsigned char*)WORDCHAR;
while (*pc)
{
charset->wordch[*pc >> 3] |= (1 << (*pc & 7));
pc++;
}
}
and
int WordChar(unsigned char s, int charset)
{
return Charsets[charset].wordch[s >> 3] & (1 << (s & 7)) ? 1 : 0;
}
Gregory Kozlovsky
Project Manager for Information Systems Tel: +41 (0)1 632 63
70
International Relations and Security Network (ISN) Fax: +41 (0)1 632 14
13
Center for Security Studies Email:
[email protected]
ETH Zürich (Swiss Federal Institute of Technology Zurich)
http://www.isn.ch/
Leonhardshalde 21, ETH-Zentrum / LEH
CH-8092 Zürich, Switzerland