🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #230526

Vista != Windows != XP

#230526
From: Jeff▲Relf
Date: Sat, 21 Feb 2009 07:28
110 lines
5442 bytes
“ When talking about your sixteen years of experience
  in Windows, why mention Vista? ”, you asked me.

Vista != Windows != XP
A lot of code designed for XP won't run on Vista;
literally, “ backwards compatibility ” was an after thought.

P.S. My newsReader, X.EXE, kills attribution lines outRight
and  >-quoted lines are muffled.  Now, for any block of >-quoted lines,
( up to ) the last two “ >-quoted nonBlank lines ” get printed.

>From JeffRelf.F-M.FM/X.CPP:

  #define  >Quoted  ( Ch == '>' )
  #define  >Snip  ( >Quoted || EqiN( B+1, L"Snip", 4 ) )
  const int _HTML = 2, Filtered_ = 1 ;
Filter( int _Filtered, LnA BB, LnA EE ) {
  LnA  PP = BB - 1 ;  LnP  B, P ;  
  if ( ! _Filtered ) {
    while ( ++ PP < EE && ( B = * PP ) )
      //  Print all lines, unFiltered.
      Sh( L"%s", B );
    return ;  }
  int NeedBB = 1 ;
  Loop( 10 ) {  
    //  Scanning through the first 10 lines of a post or eMail,
    //  looking for a good place to start printing lines.
    if ( ++ PP >= EE || ! ( B = * PP  ) )  break;
    if ( NeedBB ) {
      //  Looking for a nonBlank line to start the post.
      P = B ;  WhileWhite;  if ( ! Ch )  continue ;
      //  BB points to the array of nonBlank lines that starts the post.
      BB = PP, NeedBB = 0 ;  }
    if ( EqN( B, L"-----BEGIN PGP", 14 ) ) {
      //  Xns9BB19489DD7E82362352@127.0.0.1
      //  Kill nonBlank lines.
      while ( ++ PP < EE && ( B = * PP ) && ( Ch = * B ) );
      //  Kill Blank lines.
      while ( ++ PP < EE && ( B = * PP ) && !( Ch = * B ) );
      //  BB starts the post.
      BB = PP ;  }
    if ( EqN( B, L"--", 2 ) ) break;  }
  if ( NeedBB )
    //  No lines to print, we're done.
    return ;  
  if ( _Filtered == _HTML || EqiN( B = * BB, L"<HTML", 5 )
  || EqiN( B, L"<!DOCTYPE", 9 ) || EqiN( B, L"<META", 5 ) )
    //  An HTML-only post or eMail, very rare these days.
    goto HTML_Only ;
    
  if ( MimeHeader )
    //  Handle the MINE attachment, see X.CPP.
    goto Attach ;
    
  MimeSep = 0 ;
  //  1c54b35eae63492f355dfdd8d0274b21np@mypost.invalid
  //  slrngpbe5a.6v5.wookie@aces.localdomain    
  PP = BB - 1 ;  const int MaxAttribLns = 5 ;
  while ( ++ PP < EE && PP - BB <= MaxAttribLns
  && ( B = * PP ) && ( Ch = * B, Ch && !>Snip ) )
    //  looking for a block of nonBlank lines
    //  terminated by either a >-quoted line ( or a <Snip> line )
    //  or a blank line followed by a >-quoted line ( or <Snip> ).
    ;
  if ( >Snip || ++ PP < EE && ( B = * PP ) && ( Ch = * B, >Snip ) )
    //  The post starts here, on the ( soon-to-be-muffled )
    //  >-quoted line or the <Snip> line, after the attribution lines.
    BB = PP + 1 ;
    
  PP = BB - 1 ; int Pgp = 0, prnBL, BL = 0 ; LnP  prnQ1 = 0, prnQ2 = 0 ;
  while ( ++ PP < EE && ( B = * PP ) ) {
    //  Scan though each line of the body, selectively printing.
    //  Find the first nonWhiteSpace.
    P = B ;  WhileWhite;  prnBL = BL ;
    if ( BL = ! Ch )
      //  Remember this Blank Line, it might get printed.
      continue ;

    if ( Ch = * B, >Quoted ) {
      P = B + 1 ;  While( Ch <= 32 || >Quoted );
      if ( Ch )
        //  The >-quoted line wasn't blank.
        //  Remember ( up to ) the last two of these.
        prnQ1 = prnQ2, prnQ2 = B ;
      continue ;  }

    if ( *B == '-' ) {
      if ( B[1] == '-' && ( ! B[2] || B[2] == 32 && ! B[3] ) )
        //  a “ --␣ ” or “ -- ” sigLine, we're done.
        return ;
      if ( Eq( B + 1, L" -- " ) )
        //  a “ -␣--␣ ”sigLine, we're done printing.
        return ;  }
    if ( EqN( B, L"-----BEGIN PGP SIGNA", 20 ) ) {
        Pgp = 1 ; continue ;  }
    if ( Pgp ) {
      if ( EqN( B, L"-----END PGP", 12 ) ) {
        Pgp = 0 ;  Sh( L"_PGP_Killed_" );  }  continue ;  }

    //  A line of original content ! print it.
    if ( prnQ2 ) {
      //  >-quoted line(s) preceeded original content.
      if ( prnQ1 )
        //  Print the second-to-last >-quoted line of the block.
        Sh( L"%s", prnQ1 );
      //  Print the last >-quoted line of the block.
      Sh( L"%s\n\n%s", prnQ2, B ), prnQ1 = prnQ2 = 0 ; continue ;  }

    if ( prnBL )  Sh(L"");  Sh( L"%s", B );  }  return ;
 ...
Technical Details
Message-ID: <Jeff_Relf@Seattle.2009_Feb.20|11.27pm|w>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
References: <gnko6902j0p@news2.newsguy.com> <gnkool$sdb$1@news.motzarella.org> <Jeff_Relf@Seattle.2009_Feb.19|4.53pm|y> <dfmanno-D4AB67.18473620022009@feeder.motzarella.org> <Jeff_Relf@Seattle.2009_Feb.20|4.08pm|I> <709futFnb7hlU1@mid.individual.net>

Show Full Headers
Complete Article Headers
Message-ID: <Jeff_Relf@Seattle.2009_Feb.20|11.27pm|w>
Subject: Vista != Windows != XP
Date: Sat, 21 Feb 2009 07:28:05 +0000
From: Jeff▲Relf <Jeff_Relf@Seattle.TEST>
References: <gnko6902j0p@news2.newsguy.com> <gnkool$sdb$1@news.motzarella.org> <Jeff_Relf@Seattle.2009_Feb.19|4.53pm|y> <dfmanno-D4AB67.18473620022009@feeder.motzarella.org> <Jeff_Relf@Seattle.2009_Feb.20|4.08pm|I> <709futFnb7hlU1@mid.individual.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
Newsgroups: news.software.readers,alt.fan.cecil-adams,rec.food.cooking
Lines: 110
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net HIR9vSOOE6nvC9UjSpJc8AwEHJkt1xBeN133ba7SDTBRAvgVFj
Cancel-Lock: sha1:Sq0CRwomtdA80kPbifsO/dqgTF0=
User-Agent: JeffRelf.F-M.FM/X.ZIP