home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / lora299s.zip / MAIL.H < prev    next >
C/C++ Source or Header  |  1998-05-12  |  4KB  |  181 lines

  1.  
  2. // LoraBBS Version 2.99 Free Edition
  3. // Copyright (C) 1987-98 Marco Maccaferri
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License as published by
  7. // the Free Software Foundation; either version 2 of the License, or
  8. // (at your option) any later version.
  9. //
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. // GNU General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  
  19. #include "collect.h"
  20. #include "lora_api.h"
  21. #include "msgbase.h"
  22.  
  23. #ifndef _MAILER_H
  24. #define _MAILER_H
  25.  
  26. typedef struct {
  27.    USHORT Zone;
  28.    USHORT Net;
  29.    USHORT Node;
  30.    USHORT Point;
  31. } KLUDGES;
  32.  
  33. class TKludges
  34. {
  35. public:
  36.    TKludges (void);
  37.    ~TKludges (void);
  38.  
  39.    USHORT Sort, KeepPoint;
  40.    USHORT Zone, Net, Node, Point;
  41.    CHAR   Address[32], ShortAddress[32];
  42.  
  43.    USHORT Add (VOID);
  44.    USHORT AddString (PSZ pszString);
  45.    USHORT Check (PSZ pszName);
  46.    VOID   Clear (VOID);
  47.    VOID   Delete (VOID);
  48.    USHORT First (VOID);
  49.    VOID   New (VOID);
  50.    USHORT Next (VOID);
  51.  
  52. private:
  53.    class  TCollection Data;
  54. };
  55.  
  56. // ----------------------------------------------------------------------
  57.  
  58. class TMail
  59. {
  60. public:
  61.    TMail (void);
  62.    ~TMail (void);
  63.  
  64.    USHORT Packets;
  65.    CHAR   Inbound[128];
  66.    ULONG  MsgTossed, Duplicate, Bad, NetMail;
  67.    ULONG  MsgSent;
  68.    class  TConfig *Cfg;
  69.    class  TLog *Log;
  70.  
  71.    VOID   Export (VOID);
  72.    VOID   ExportNetMail (VOID);
  73.    VOID   Import (VOID);
  74.    USHORT IsArcmail (VOID);
  75.    USHORT IsMail (VOID);
  76.    USHORT UnpackArcmail (VOID);
  77.  
  78. private:
  79.    USHORT IsAreasBBS;
  80.    CHAR   LastTag[64], PktName[32];
  81.    CHAR   Temp[128], Outbound[128];
  82.    struct stat statbuf;
  83.    class  TMsgBase *Msg;
  84.    class  PACKET *Packet;
  85.    class  TMsgData *Data;
  86.    class  TEchoLink *Forward;
  87.    class  TKludges *SeenBy, *Path;
  88.    class  TNodes *Nodes;
  89.    class  TDupes *Dupes;
  90.  
  91.    USHORT ExportEchoMail (ULONG Number, PSZ pszEchoTag);
  92.    ULONG  ImportEchoMail (VOID);
  93.    USHORT OpenNextPacket (VOID);
  94.    USHORT OpenArea (PSZ pszEchoTag);
  95. };
  96.  
  97. // --------------------------------------------------------------------------
  98.  
  99. class TRoute
  100. {
  101. public:
  102.    TRoute (void);
  103.    ~TRoute (void);
  104.  
  105.    class TConfig *Cfg;
  106.    class TLog *Log;
  107.  
  108.    VOID  Run (PSZ pszFile = "route.cfg");
  109.  
  110. private:
  111.    CHAR  Line[512], Temp[128], Name[128];
  112.    CHAR  ArcMailName[128], Outbound[64];
  113.    class TPacker *Packer;
  114.  
  115.    VOID  MakeArcMailName (PSZ pszAddress, CHAR Flag);
  116.    VOID  RouteTo (VOID);
  117.    VOID  SendTo (VOID);
  118. };
  119.  
  120. // --------------------------------------------------------------------------
  121.  
  122. class TAreaMgr
  123. {
  124. public:
  125.    TAreaMgr (void);
  126.    ~TAreaMgr (void);
  127.  
  128.    class  TConfig *Cfg;
  129.    class  TLog *Log;
  130.    class  TMsgBase *Msg;
  131.  
  132.    VOID   MsgFooter (VOID);
  133.    VOID   MsgHeader (VOID);
  134.    VOID   Process (VOID);
  135.    VOID   Rescan (PSZ pszEchoTag, PSZ pszAddress);
  136.    USHORT SetPacker (PSZ Cmd);
  137.    VOID   UpdateAreasBBS (VOID);
  138.  
  139. private:
  140.    class  TNodes *Nodes;
  141.    class  TEchoLink *EchoLink;
  142.    class  TMsgData *Data;
  143.    class  TCollection Text;
  144. };
  145.  
  146. // --------------------------------------------------------------------------
  147.  
  148. class TTic
  149. {
  150. public:
  151.    TTic (void);
  152.    ~TTic (void);
  153.  
  154.    CHAR   Inbound[128];
  155.    CHAR   Area[64], Name[32], Complete[128];
  156.    CHAR   Password[32];
  157.    ULONG  Size, Crc;
  158.    class  TConfig *Cfg;
  159.    class  TCollection *Description;
  160.    class  TCollection *SeenBy, *Path;
  161.    class  TAddress From;
  162.    class  TAddress Origin;
  163.  
  164.    USHORT Check (VOID);
  165.    VOID   Delete (VOID);
  166.    VOID   Hatch (class TAddress *Dest);
  167.    VOID   Hatch (class TAddress &Dest);
  168.    USHORT Import (VOID);
  169.    USHORT Open (PSZ pszFile);
  170.    USHORT OpenNext (VOID);
  171.  
  172. private:
  173.    CHAR   PktName[32];
  174.    CHAR   CurrentFile[128];
  175. };
  176.  
  177. #endif
  178.  
  179.  
  180.  
  181.