12.06.2015 Views

The Annoyance Filter.pdf - Fourmilab

The Annoyance Filter.pdf - Fourmilab

The Annoyance Filter.pdf - Fourmilab

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

§250 ANNOYANCE-FILTER ISO 8859-1 CHARACTER TYPES 201<br />

250. ISO 8859-1 character types.<br />

<strong>The</strong> following definitions provide equivalents for ctype.h macros which work for ISO-8859 8 bit<br />

characters. <strong>The</strong>y require that ctype.h be included before they’re used.<br />

〈 Global variables 226 〉 +≡<br />

#define ISOch (x) (static cast〈unsigned char〉((x) & # FF))<br />

#define isISOspace (x) (isascii (ISOch (x)) ∧ isspace (ISOch (x)))<br />

#define isISOalpha (x) ((isoalpha [ISOch (x)/8] & ( # 80 ≫ (ISOch (x) % 8))) ≠ 0)<br />

#define isISOupper (x) ((isoupper [ISOch (x)/8] & ( # 80 ≫ (ISOch (x) % 8))) ≠ 0)<br />

#define isISOlower (x) ((isolower [ISOch (x)/8] & ( # 80 ≫ (ISOch (x) % 8))) ≠ 0)<br />

#define toISOupper (x) (isISOlower (x) ? (isascii (((unsigned<br />

char)(x))) ? toupper (x) : (((ISOch (x) ≠ # DF)∧(ISOch (x) ≠ # FF)) ? (ISOch (x)− # 20) : (x))) : (x))<br />

#define toISOlower (x) (isISOupper (x) ? (isascii (ISOch (x)) ? tolower (x) : (ISOch (x) + # 20)) : (x))<br />

251. <strong>The</strong> following tables are bit vectors which define membership in the character classes tested for<br />

by the preceding macros.<br />

〈 Global variables 226 〉 +≡<br />

const unsigned char isoalpha [32] = {0, 0, 0, 0, 0, 0, 0, 0, 127, 255, 255, 224, 127, 255, 255, 224, 0, 0, 0, 0,<br />

0, 0, 0, 0, 255, 255, 254, 255, 255, 255, 254, 255};<br />

const unsigned char isoupper [32] = {0, 0, 0, 0, 0, 0, 0, 0, 127, 255, 255, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,<br />

255, 255, 254, 254, 0, 0, 0, 0};<br />

const unsigned char isolower [32] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 255, 255, 224, 0, 0, 0, 0, 0, 0, 0, 0,<br />

0, 0, 0, 1, 255, 255, 254, 255};<br />

252. To perform component tests during the development process we provide a test jig in which<br />

the component may be figuratively mounted and exercised. When compiled with Jig defined, a −−jig<br />

option (without argument) is included to activate the test.<br />

〈 Test component in temporary jig 252 〉 ≡<br />

#ifdef Jig<br />

#endif<br />

This code is used in section 243.<br />

253. <strong>The</strong> component in the temporary test jig may require some items declared in global context.<br />

Here’s where you can put such declarations.<br />

〈 Global declarations used by component in temporary jig 253 〉 ≡<br />

#ifdef Jig<br />

#endif<br />

This code is used in section 223.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!