home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 April / PCO_04_97.ISO / filesbbs / os2 / vsoup127.arj / VSOUP127.ZIP / kill.hh < prev    next >
Encoding:
Text File  |  1997-01-20  |  1.7 KB  |  65 lines

  1. //  $Id: kill.hh 1.10 1997/01/20 16:06:22 hardy Exp $
  2. //
  3. //  This progam/module was written by Hardy Griech based on ideas and
  4. //  pieces of code from Chin Huang (cthuang@io.org).  Bug reports should
  5. //  be submitted to rgriech@ibm.net.
  6. //
  7. //  This file is part of soup++ for OS/2.  Soup++ including this file
  8. //  is freeware.  There is no warranty of any kind implied.  The terms
  9. //  of the GNU Gernal Public Licence are valid for this piece of software.
  10. //
  11.  
  12.  
  13. #ifndef __KILL_HH__
  14. #define __KILL_HH__
  15.  
  16.  
  17. #include <regexp.h>
  18.  
  19. #include "mts.hh"
  20.  
  21.  
  22. class TKillFile {
  23. private:
  24.     //
  25.     // kill regular expression
  26.     //
  27.     typedef struct aExp {
  28.     struct aExp *next;    // next in list
  29.     regexp *re;        // compiled regular expression
  30.     } Exp;
  31.  
  32.     //
  33.     // kill file entry for a newsgroup
  34.     //
  35.     typedef struct aGroup {
  36.     struct aGroup *next;    // next in list
  37.     regexp *grpPat;     // newsgroup pattern
  38.     Exp *expList;        // list of kill expressions
  39.     } Group;
  40.  
  41.     Group *groupKillList;    // list of group specific kills
  42.     TSemaphor sema;
  43.     Group *actGroupList;
  44.     const char *actGroupName;
  45.  
  46.     void killGroup( Group *gp );
  47.     Exp *genRegExp(const char *searchIn, const char *searchFor);
  48.     Group *buildActGroupList( const char *groupName );
  49.     void stripBlanks( char *line );
  50.     int readLine( char *buf, int n, TFile &inf, int &lineNum );
  51.  
  52. public:
  53.     TKillFile( void );
  54.     ~TKillFile();
  55.     TKillFile( const TKillFile &right );    // copy constructor not allowed !
  56.     operator = (const TKillFile &right);    // assignment operator not allowed !
  57.  
  58.     int readFile( const char *killFile );
  59.     int matchLine( const char *groupName, const char *line );
  60.     int doKillQ( const char *groupName );
  61. };
  62.     
  63.  
  64. #endif   // __KILL_HH__
  65.