[List.External:Policy4] int mask[0x100]; void init() { int c; mask[0] = 0x100; c = 1; while (c < 0x100) mask[c++] = 0x80; c = 'a'; while (c <= 'z') mask[c++] = 1; c = 'A'; while (c <= 'Z') mask[c++] = 2; c = '0'; while (c <= '9') mask[c++] = 4; } void filter() { int i, seen; /* This loop ends when we see NUL (sets 0x100) */ i = seen = 0; while ((seen |= mask[word[i++]]) < 0x100) continue; /* * We should have seen at least one character of each type (which "add up" * to 0x87) and then a NUL (adds 0x100). */ if (seen != 0x187) word = 0; // Does not conform to policy }