<PRE>
I'm glad that you ( Steve•Fabian ) know how to display monospaced but
what about the MANY others ( e.g. Googlers ) who aren't so crafty ?
Without the < PRE> tag, most of them would see the following
in a proportional font:
[ from <A hRef="
http://jeffrelf.f-m.fm/X.CPP">X.CPP, Micro·Soft Visual C++ 9.0</A> ]
#define szStr wcslen
// Given the Beginning of a string (“Bâ€), run a pointer (“Pâ€)
// backwards ( from E to B ) while “Should_Loop†is true.
// “!Ch†is true if P has run past B ( going backwards ).
#define WhileBac( Should_Loop ) \
Ch = Ch2 = 0; if ( !E ) E = B + szStr( B ); P = E ; \
while ( P >= B && \
( Ch2 = *P, ( Ch = --P < B ? 0 : *P ) && ( Should_Loop ) ) )
typedef wchar_t *LnP ; int Ch, Ch2 ;
// g·mID( B, P, E ) gets the last mID in the “References:†line.
// B points to the Beginning of data in the line.
// E points to the latter part of this line, at the end of an mID.
// P starts at E and gets moved one or two mID to the left,
// to the start of an mID.
int sz·mID ;
int g·mID( LnP B, LnP &P, LnP &E ) { int â°â±, cnt·At ;
nx·mID: cnt·At = sz·mID = 0 ;
WhileBac( Ch <= 32 || Ch == ',' );
if ( !Ch )
// No more MIDs on the line.
return 0 ;
E = P ;
if ( !( â°â± = Ch == '>' ) )
// Google Groups doesn't always <> bracket < m@ID>'s.
// (e-mail address removed)
E++ ;
Join:
WhileBac( Ch > 32 && Ch != ',' && Ch != '<' )
if ( Ch == '@' )
// Count the ‘@’ characters in the mID.
cnt·At ++ ;
if ( â°â± && Ch != '<' ) {
// Remove newlines and spaces in the bracketted < m@ID>.
// Believe it or not, this actually happens ( Outlook ).
//
[email protected]
LnP pBlack = P + 1, E· = E ; E = P ;
WhileBac( Ch <= 32 ); if ( !Ch ) return 0 ;
E = E·, wmemmove( ++P, pBlack, E - pBlack ), E -= pBlack - P ;
// Get the rest of the bracketted < m@ID>.
goto Join ; }
if ( cnt·At != 1 || ( sz·mID = E - ++ P ) < 3 ) {
// Skip·Over any mID that's under 3 characters long and/or
// doesn't have one·and·only·one ‘@’ character.
E = -- P ; goto nx·mID ; }
return sz·mID ; }