-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmsgbase.h
833 lines (745 loc) · 22.8 KB
/
msgbase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
// LoraBBS Version 2.99 Free Edition
// Copyright (C) 1987-98 Marco Maccaferri
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef _MSGBASE_H
#define _MSGBASE_H
#include "collect.h"
#include "combase.h"
#include "jam.h"
#define MAX_LINE_LENGTH 512
#define ST_JAM 0
#define ST_SQUISH 1
#define ST_USENET 2
#define ST_FIDO 3
#define ST_ADEPT 4
#define ST_HUDSON 5
#define ST_GOLDBASE 6
#define ST_PASSTHROUGH 7
typedef struct {
UCHAR Day;
UCHAR Month;
USHORT Year;
UCHAR Hour;
UCHAR Minute;
UCHAR Second;
} MDATE;
class DLL_EXPORT TMsgBase
{
public:
TMsgBase () {};
virtual ~TMsgBase () {};
ULONG Id, Current;
CHAR From[64];
CHAR To[64];
CHAR Subject[72];
UCHAR Crash, Direct, FileAttach, FileRequest, Hold, Immediate;
UCHAR Intransit, KillSent, Local, Private, ReceiptRequest, Received;
UCHAR Sent;
MDATE Written;
MDATE Arrived;
CHAR FromAddress[64];
CHAR ToAddress[64];
ULONG Reply, Original;
class TCollection Text;
virtual USHORT Add () = 0;
virtual USHORT Add (class TMsgBase *MsgBase) = 0;
virtual USHORT Add (class TCollection &MsgText) = 0;
virtual VOID Close () = 0;
virtual USHORT Delete (ULONG ulMsg) = 0;
virtual ULONG Highest () = 0;
virtual USHORT GetHWM (ULONG &ulMsg) = 0;
virtual USHORT Lock (ULONG ulTimeout = 0) = 0;
virtual ULONG Lowest () = 0;
virtual ULONG MsgnToUid (ULONG ulMsg) = 0;
virtual VOID New () = 0;
virtual USHORT Next (ULONG &ulMsg) = 0;
virtual ULONG Number () = 0;
virtual VOID Pack () = 0;
virtual USHORT Previous (ULONG &ulMsg) = 0;
virtual USHORT ReadHeader (ULONG ulMsg) = 0;
virtual USHORT Read (ULONG ulMsg, class TCollection &MsgText, SHORT nWidth = 79) = 0;
virtual USHORT Read (ULONG ulMsg, SHORT nWidth = 79) = 0;
virtual VOID SetHWM (ULONG ulMsg) = 0;
virtual ULONG UidToMsgn (ULONG ulMsg) = 0;
virtual VOID UnLock () = 0;
virtual USHORT WriteHeader (ULONG ulMsg) = 0;
protected:
CHAR szBuff[MAX_LINE_LENGTH + 1];
CHAR szLine[MAX_LINE_LENGTH + 1];
CHAR szWrp[MAX_LINE_LENGTH + 1];
CHAR *pLine, *pBuff;
};
class DLL_EXPORT JAM : public TMsgBase
{
public:
JAM ();
JAM (PSZ pszName);
~JAM ();
USHORT Add ();
USHORT Add (class TMsgBase *MsgBase);
USHORT Add (class TCollection &MsgText);
VOID Close ();
USHORT Delete (ULONG ulMsg);
USHORT GetHWM (ULONG &ulMsg);
ULONG Highest ();
USHORT Lock (ULONG ulTimeout = 0);
ULONG Lowest ();
ULONG MsgnToUid (ULONG ulMsg);
VOID New ();
USHORT Next (ULONG &ulMsg);
ULONG Number ();
USHORT Open (PSZ pszName);
VOID Pack ();
USHORT Previous (ULONG &ulMsg);
USHORT ReadHeader (ULONG ulMsg);
USHORT Read (ULONG ulMsg, class TCollection &MsgText, SHORT nWidth = 79);
USHORT Read (ULONG ulMsg, SHORT nWidth = 79);
VOID SetHWM (ULONG ulMsg);
ULONG UidToMsgn (ULONG ulMsg);
VOID UnLock ();
USHORT WriteHeader (ULONG ulMsg);
private:
INT fdHdr;
INT fdJdt;
INT fdJdx;
UCHAR *pSubfield;
CHAR BaseName[128];
JAMHDRINFO jamHdrInfo;
JAMHDR jamHdr;
};
// --------------------------------------------------------------------------
typedef struct {
USHORT Len; // LENGTH OF THIS STRUCTURE!
USHORT Rsvd1; // reserved
ULONG NumMsg; // Number of messages in area
ULONG HighMsg; // Highest msg in area. Same as num_msg
ULONG SkipMsg; // Skip killing first x msgs in area
ULONG HighWater; // Msg# (not umsgid) of HWM
ULONG Uid; // Number of the next UMSGID to use
CHAR Base[80]; // Base name of SquishFile
ULONG BeginFrame; // Offset of first frame in file
ULONG LastFrame; // Offset to last frame in file
ULONG FreeFrame; // Offset of first FREE frame in file
ULONG LastFreeFrame; // Offset of last free frame in file
ULONG EndFrame; // Pointer to end of file
ULONG MaxMsg; // Max # of msgs to keep in area
USHORT KeepDays; // Max age of msgs in area (SQPack)
USHORT SzSqhdr; // sizeof (SQHDR)
UCHAR Rsvd2[124]; // Reserved by Squish for future use
} SQBASE;
#define SQHDRID 0xAFAE4453L
#define FRAME_NORMAL 0x00
#define FRAME_FREE 0x01
#define FRAME_RLE 0x02 // not implemented
#define FRAME_LZW 0x03 // not implemented
typedef struct {
ULONG Id; // sqhdr.id must always equal SQHDRID
ULONG NextFrame;
ULONG PrevFrame;
ULONG FrameLength;
ULONG MsgLength;
ULONG CLen;
USHORT FrameType;
USHORT Rsvd;
} SQHDR;
typedef struct {
USHORT Zone;
USHORT Net;
USHORT Node;
USHORT Point;
} NADDR;
#define MSGPRIVATE 0x0001
#define MSGCRASH 0x0002
#define MSGREAD 0x0004
#define MSGSENT 0x0008
#define MSGFILE 0x0010
#define MSGFWD 0x0020
#define MSGORPHAN 0x0040
#define MSGKILL 0x0080
#define MSGLOCAL 0x0100
#define MSGHOLD 0x0200
#define MSGXX2 0x0400
#define MSGFRQ 0x0800
#define MSGRRQ 0x1000
#define MSGCPT 0x2000
#define MSGARQ 0x4000
#define MSGURQ 0x8000
#define MSGSCANNED 0x00010000L
#define MSGUID 0x00020000L
#define XMSG_FROM_SIZE 36
#define XMSG_TO_SIZE 36
#define XMSG_SUBJ_SIZE 72
#define MAX_REPLY 9 // Max number of stored replies to one msg
typedef struct {
ULONG Attr;
CHAR From[XMSG_FROM_SIZE];
CHAR To[XMSG_TO_SIZE];
CHAR Subject[XMSG_SUBJ_SIZE];
NADDR Orig; // Origination and destination addresses */
NADDR Dest;
ULONG DateWritten; // When user wrote the msg (UTC)
ULONG DateArrived; // When msg arrived on-line (UTC)
SHORT UtcOfs; // Offset from UTC of message writer, in minutes.
ULONG ReplyTo;
ULONG Replies[MAX_REPLY];
ULONG MsgId;
CHAR FtscDate[20]; // Obsolete date information
} XMSG;
typedef struct {
ULONG Ofs;
ULONG MsgId;
ULONG Hash;
} SQIDX;
class DLL_EXPORT SQUISH : public TMsgBase
{
public:
SQUISH ();
SQUISH (PSZ pszName);
~SQUISH ();
USHORT Add ();
USHORT Add (class TMsgBase *MsgBase);
USHORT Add (class TCollection &MsgText);
VOID Close ();
USHORT Delete (ULONG ulMsg);
USHORT GetHWM (ULONG &ulMsg);
ULONG Hash (PSZ f);
ULONG Highest ();
USHORT Lock (ULONG ulTimeout = 0);
ULONG Lowest ();
ULONG MsgnToUid (ULONG ulMsg);
VOID New ();
USHORT Next (ULONG &ulMsg);
ULONG Number ();
USHORT Open (PSZ pszName);
VOID Pack ();
USHORT Previous (ULONG &ulMsg);
USHORT ReadHeader (ULONG ulMsg);
USHORT Read (ULONG ulMsg, class TCollection &MsgText, SHORT nWidth = 79);
USHORT Read (ULONG ulMsg, SHORT nWidth = 79);
VOID SetHWM (ULONG ulMsg);
ULONG UidToMsgn (ULONG ulMsg);
VOID UnLock ();
USHORT WriteHeader (ULONG ulMsg);
private:
FILE *fpDat, *fpIdx;
USHORT Locked;
SQBASE SqBase;
SQIDX SqIdx, *pSqIdx;
SQHDR SqHdr;
XMSG XMsg;
};
// --------------------------------------------------------------------------
class DLL_EXPORT USENET : public TMsgBase
{
public:
USENET ();
USENET (PSZ pszServer, PSZ pszGroup);
~USENET ();
CHAR HostName[32], Organization[64];
CHAR NewsGroup[64], User[32];
CHAR ProgramID[32];
CHAR Error[128];
USHORT Add ();
USHORT Add (class TMsgBase *MsgBase);
USHORT Add (class TCollection &MsgText);
VOID Close ();
USHORT Delete (ULONG ulMsg);
ULONG Highest ();
USHORT GetHWM (ULONG &ulMsg);
USHORT Lock (ULONG ulTimeout = 0);
ULONG Lowest ();
ULONG MsgnToUid (ULONG ulMsg);
VOID New ();
USHORT Next (ULONG &ulMsg);
ULONG Number ();
USHORT Open (PSZ pszServer, PSZ pszGroup);
VOID Pack ();
USHORT Previous (ULONG &ulMsg);
USHORT ReadHeader (ULONG ulMsg);
USHORT Read (ULONG ulMsg, class TCollection &MsgText, SHORT nWidth = 79);
USHORT Read (ULONG ulMsg, SHORT nWidth = 79);
VOID SetHWM (ULONG ulMsg);
ULONG UidToMsgn (ULONG ulMsg);
VOID UnLock ();
USHORT WriteHeader (ULONG ulMsg);
private:
CHAR szBuffer[1024];
ULONG ulHighest;
ULONG ulFirst;
ULONG ulTotal;
ULONG LastReaded;
class TTcpip *Tcp;
USHORT GetResponse (PSZ pszResponse, USHORT usMaxLen);
};
// --------------------------------------------------------------------------
typedef struct {
USHORT OrigNode;
USHORT DestNode;
USHORT Year;
USHORT Month;
USHORT Day;
USHORT Hour;
USHORT Minute;
USHORT Second;
USHORT Rate;
USHORT Version;
USHORT OrigNet;
USHORT DestNet;
UCHAR ProductL;
UCHAR Serial;
CHAR Password[8];
USHORT OrigZone;
USHORT DestZone;
USHORT Auxnet;
USHORT CWValidation;
UCHAR ProductH;
UCHAR Revision;
USHORT Capability;
USHORT OrigZone2;
USHORT DestZone2;
USHORT OrigPoint;
USHORT DestPoint;
UCHAR Filler[4];
} PKT2HDR;
typedef struct {
USHORT OrigNode;
USHORT DestNode;
USHORT OrigPoint;
USHORT DestPoint;
CHAR Reserved[8];
USHORT SubVersion;
USHORT Version;
USHORT OrigNet;
USHORT DestNet;
UCHAR Product;
UCHAR Serial;
CHAR Password[8];
USHORT OrigZone;
USHORT DestZone;
CHAR OrigDomain[8];
CHAR DestDomain[8];
UCHAR Filler[4];
} PKT22HDR;
typedef struct {
USHORT Version;
USHORT OrigNode;
USHORT DestNode;
USHORT OrigNet;
USHORT DestNet;
USHORT Attrib;
USHORT Cost;
} MSGHDR;
class DLL_EXPORT PACKET : public TMsgBase
{
public:
PACKET ();
PACKET (PSZ pszName);
~PACKET ();
CHAR Password[16];
MDATE Date;
USHORT Add ();
USHORT Add (class TMsgBase *MsgBase);
USHORT Add (class TCollection &MsgText);
VOID Close ();
USHORT Delete (ULONG ulMsg);
USHORT GetHWM (ULONG &ulMsg);
ULONG Highest ();
VOID Kill ();
USHORT Lock (ULONG ulTimeout = 0);
ULONG Lowest ();
ULONG MsgnToUid (ULONG ulMsg);
VOID New ();
USHORT Next (ULONG &ulMsg);
ULONG Number ();
USHORT Open (PSZ pszName, USHORT doScan = TRUE);
VOID Pack ();
USHORT Previous (ULONG &ulMsg);
USHORT ReadHeader (ULONG ulMsg);
USHORT Read (ULONG ulMsg, class TCollection &MsgText, SHORT nWidth = 79);
USHORT Read (ULONG ulMsg, SHORT nWidth = 79);
VOID SetHWM (ULONG ulMsg);
ULONG UidToMsgn (ULONG ulMsg);
VOID UnLock ();
USHORT WriteHeader (ULONG ulMsg);
private:
PKT2HDR pkt2Hdr;
PKT22HDR pkt22Hdr;
MSGHDR msgHdr;
FILE *fp;
CHAR LastRead, Line[256];
CHAR FileName[128], WasScanned;
ULONG TotalMsgs;
class TCollection Index;
USHORT GetLine ();
};
// --------------------------------------------------------------------------
typedef struct {
CHAR From[36];
CHAR To[36];
CHAR Subject[72];
CHAR Date[20];
USHORT TimesRead;
USHORT DestNode;
USHORT OrigNode;
USHORT Cost;
USHORT OrigNet;
USHORT DestNet;
USHORT BinDate[4];
USHORT Reply;
USHORT Attrib;
USHORT Up;
} FIDOMSG;
class DLL_EXPORT FIDOSDM : public TMsgBase
{
public:
FIDOSDM ();
FIDOSDM (PSZ pszName);
~FIDOSDM ();
USHORT Add ();
USHORT Add (class TMsgBase *MsgBase);
USHORT Add (class TCollection &MsgText);
VOID Close ();
USHORT Delete (ULONG ulMsg);
USHORT GetHWM (ULONG &ulMsg);
ULONG Highest ();
USHORT Lock (ULONG ulTimeout = 0);
ULONG Lowest ();
ULONG MsgnToUid (ULONG ulMsg);
VOID New ();
USHORT Next (ULONG &ulMsg);
ULONG Number ();
USHORT Open (PSZ pszName);
VOID Pack ();
USHORT Previous (ULONG &ulMsg);
USHORT ReadHeader (ULONG ulMsg);
USHORT Read (ULONG ulMsg, class TCollection &MsgText, SHORT nWidth = 79);
USHORT Read (ULONG ulMsg, SHORT nWidth = 79);
VOID SetHWM (ULONG ulMsg);
ULONG UidToMsgn (ULONG ulMsg);
VOID UnLock ();
USHORT WriteHeader (ULONG ulMsg);
private:
FILE *fp;
CHAR BasePath[128];
CHAR LastFile[128];
ULONG TotalMsgs;
FIDOMSG msgHdr;
class TCollection Index;
};
// --------------------------------------------------------------------------
#define MSGDELETED 0x0001 /* deleted message, */
typedef struct {
CHAR MajorVersion; /* Minor revision number of this message style */
CHAR MinorVersion; /* Minor revision number of this message style */
USHORT StructLen; /* The length of this data structure */
CHAR from[60]; /* Who the message is from */
CHAR to[60]; /* Who the message is to */
CHAR subj[70]; /* The subject of the message */
CHAR date[35]; /* Date the message was written */
CHAR indate[4]; /* Import date */
ULONG msgnum; /* Current message number */
ULONG timesread; /* Number of times the message has been read */
time_t timerecv; /* Time user received this message */
ULONG length; /* Length of message stored in .Text Data file */
LONG start; /* Pointer to starting byte in .Text Data file */
ULONG Extra1; /* Extra space Was going to be for reply */
ULONG Extra2; /* Extra space linking instead came up with */
ULONG Extra3; /* Extra space a better method */
USHORT o_zone; /* Messages origin zone */
USHORT o_net; /* Messages origin net */
USHORT o_node; /* Messages origin node */
USHORT o_point; /* Messages origin point */
USHORT d_zone; /* Messages destination zone */
USHORT d_net; /* Messages destination net */
USHORT d_node; /* Messages destination node */
USHORT d_point; /* Messages destination point */
USHORT cost; /* Cost to send this message */
USHORT fflags; /* FidoNet related flags */
USHORT xflags; /* XBBS related flags */
ULONG iflags; /* Internet related flags */
ULONG oflags; /* Other network related flags */
} ADEPTDATA, *PADEPTDATA;
typedef struct {
SHORT to; /* Checksum of the to field */
SHORT from; /* Checksum of the from field */
SHORT subj; /* Checksum of the subject field */
LONG msgidcrc; /* 32-bit CRC of the MSGID */
LONG msgidserialno; /* MSGID Serial Number */
LONG replycrc; /* REPLYID 32-bit CRC */
LONG replyserialno; /* REPLYID Serial Numver */
} ADEPTINDEXES, *PADEPTINDEXES;
class DLL_EXPORT ADEPT : public TMsgBase
{
public:
ADEPT ();
ADEPT (PSZ pszName);
~ADEPT ();
USHORT Add ();
USHORT Add (class TMsgBase *MsgBase);
USHORT Add (class TCollection &MsgText);
VOID Close ();
USHORT Delete (ULONG ulMsg);
USHORT GetHWM (ULONG &ulMsg);
ULONG Highest ();
USHORT Lock (ULONG ulTimeout = 0);
ULONG Lowest ();
ULONG MsgnToUid (ULONG ulMsg);
VOID New ();
USHORT Next (ULONG &ulMsg);
ULONG Number ();
USHORT Open (PSZ pszName);
VOID Pack ();
USHORT Previous (ULONG &ulMsg);
USHORT ReadHeader (ULONG ulMsg);
USHORT Read (ULONG ulMsg, class TCollection &MsgText, SHORT nWidth = 79);
USHORT Read (ULONG ulMsg, SHORT nWidth = 79);
VOID SetHWM (ULONG ulMsg);
ULONG UidToMsgn (ULONG ulMsg);
VOID UnLock ();
USHORT WriteHeader (ULONG ulMsg);
private:
int fdHdr;
int fdIdx;
int fdTxt;
CHAR BaseName[128];
ULONG TotalMsgs;
ADEPTDATA Data;
};
// --------------------------------------------------------------------------
class DLL_EXPORT PASSTHR : public TMsgBase
{
public:
PASSTHR ();
~PASSTHR ();
USHORT Add ();
USHORT Add (class TMsgBase *MsgBase);
USHORT Add (class TCollection &MsgText);
VOID Close ();
USHORT Delete (ULONG ulMsg);
USHORT GetHWM (ULONG &ulMsg);
ULONG Highest ();
USHORT Lock (ULONG ulTimeout = 0);
ULONG Lowest ();
ULONG MsgnToUid (ULONG ulMsg);
VOID New ();
USHORT Next (ULONG &ulMsg);
ULONG Number ();
VOID Pack ();
USHORT Previous (ULONG &ulMsg);
USHORT ReadHeader (ULONG ulMsg);
USHORT Read (ULONG ulMsg, class TCollection &MsgText, SHORT nWidth = 79);
USHORT Read (ULONG ulMsg, SHORT nWidth = 79);
VOID SetHWM (ULONG ulMsg);
ULONG UidToMsgn (ULONG ulMsg);
VOID UnLock ();
USHORT WriteHeader (ULONG ulMsg);
};
// --------------------------------------------------------------------------
class DLL_EXPORT COMBO : public TMsgBase
{
public:
COMBO ();
~COMBO ();
USHORT Add ();
USHORT Add (class TMsgBase *MsgBase);
USHORT Add (class TCollection &MsgText);
USHORT Add (PSZ pszPath, USHORT usStorage, ULONG ulNumber);
VOID Close ();
USHORT Delete (ULONG ulMsg);
USHORT GetHWM (ULONG &ulMsg);
ULONG Highest ();
USHORT Lock (ULONG ulTimeout = 0);
ULONG Lowest ();
ULONG MsgnToUid (ULONG ulMsg);
VOID New ();
USHORT Next (ULONG &ulMsg);
ULONG Number ();
VOID Pack ();
USHORT Previous (ULONG &ulMsg);
USHORT ReadHeader (ULONG ulMsg);
USHORT Read (ULONG ulMsg, class TCollection &MsgText, SHORT nWidth = 79);
USHORT Read (ULONG ulMsg, SHORT nWidth = 79);
VOID SetHWM (ULONG ulMsg);
ULONG UidToMsgn (ULONG ulMsg);
VOID UnLock ();
USHORT WriteHeader (ULONG ulMsg);
private:
CHAR LastPath[64];
ULONG TotalMsgs, NextNumber;
class TMsgBase *Msg;
class TCollection Index;
};
// --------------------------------------------------------------------------
class DLL_EXPORT INETMAIL : public TMsgBase
{
public:
INETMAIL ();
INETMAIL (PSZ pszServer, PSZ pszUser, PSZ pszPwd);
~INETMAIL ();
CHAR HostName[64], SMTPHostName[64];
CHAR Error[128];
USHORT Add ();
USHORT Add (class TMsgBase *MsgBase);
USHORT Add (class TCollection &MsgText);
VOID Close ();
USHORT Delete (ULONG ulMsg);
ULONG Highest ();
USHORT GetHWM (ULONG &ulMsg);
USHORT Lock (ULONG ulTimeout = 0);
ULONG Lowest ();
ULONG MsgnToUid (ULONG ulMsg);
VOID New ();
USHORT Next (ULONG &ulMsg);
ULONG Number ();
USHORT Open (PSZ pszServer, PSZ pszUser, PSZ pszPwd);
VOID Pack ();
USHORT Previous (ULONG &ulMsg);
USHORT ReadHeader (ULONG ulMsg);
USHORT Read (ULONG ulMsg, class TCollection &MsgText, SHORT nWidth = 79);
USHORT Read (ULONG ulMsg, SHORT nWidth = 79);
VOID SetHWM (ULONG ulMsg);
ULONG UidToMsgn (ULONG ulMsg);
VOID UnLock ();
USHORT WriteHeader (ULONG ulMsg);
private:
CHAR szBuffer[1024];
ULONG TotalMsgs;
ULONG LastReaded;
class TTcpip *Tcp;
USHORT GetResponse (PSZ pszResponse, USHORT usMaxLen);
USHORT GetLine (PSZ pszResponse, USHORT usMaxLen);
};
// --------------------------------------------------------------------------
#define HUD_RECKILL 1
#define HUD_NETMAIL 4
#define HUD_PRIVATE 8
#define HUD_RECEIVED 16
#define HUD_LOCAL 32+64
#define HUD_KILL 1
#define HUD_SENT 2
#define HUD_FILE 4
#define HUD_CRASH 8
#define HUD_FRQ 16
#define HUD_ARQ 32
#define HUD_CPT 64
typedef struct {
USHORT LowMsg;
USHORT HighMsg;
USHORT TotalMsgs;
USHORT TotalOnBoard[200];
} HMSGINFO;
typedef struct {
USHORT MsgNum;
UCHAR Board;
} HMSGIDX;
typedef struct {
CHAR String[36];
} HMSGTOIDX;
typedef struct {
USHORT MsgNum;
USHORT PrevReply;
USHORT NextReply;
USHORT TimesRead;
USHORT StartBlock;
USHORT NumBlocks;
USHORT DestNet;
USHORT DestNode;
USHORT OrigNet;
USHORT OrigNode;
UCHAR DestZone;
UCHAR OrigZone;
USHORT Cost;
UCHAR MsgAttr;
UCHAR NetAttr;
UCHAR Board;
CHAR Time[6];
CHAR Date[9];
CHAR WhoTo[36];
CHAR WhoFrom[36];
CHAR Subject[73];
} HMSGHDR;
class DLL_EXPORT HUDSON : public TMsgBase
{
public:
HUDSON ();
HUDSON (PSZ pszName, UCHAR board);
~HUDSON ();
USHORT Add ();
USHORT Add (class TMsgBase *MsgBase);
USHORT Add (class TCollection &MsgText);
VOID Close ();
USHORT Delete (ULONG ulMsg);
USHORT GetHWM (ULONG &ulMsg);
ULONG Highest ();
USHORT Lock (ULONG ulTimeout = 0);
ULONG Lowest ();
ULONG MsgnToUid (ULONG ulMsg);
VOID New ();
USHORT Next (ULONG &ulMsg);
ULONG Number ();
USHORT Open (PSZ pszName, UCHAR board);
VOID Pack ();
USHORT Previous (ULONG &ulMsg);
USHORT ReadHeader (ULONG ulMsg);
USHORT Read (ULONG ulMsg, class TCollection &MsgText, SHORT nWidth = 79);
USHORT Read (ULONG ulMsg, SHORT nWidth = 79);
VOID SetHWM (ULONG ulMsg);
ULONG UidToMsgn (ULONG ulMsg);
VOID UnLock ();
USHORT WriteHeader (ULONG ulMsg);
private:
int fdHdr;
int fdTxt;
int fdToIdx;
USHORT Locked;
CHAR BaseName[128];
UCHAR BoardNum;
ULONG TotalMsgs;
HMSGINFO msgInfo;
HMSGIDX *msgIdx;
HMSGHDR msgHdr;
VOID Pascal2C (PSZ strp, PSZ strc);
VOID C2Pascal (PSZ strp, PSZ strc);
};
// --------------------------------------------------------------------------
#define MAX_DUPES 1000
typedef struct {
CHAR EchoTag[64];
USHORT Position;
ULONG Dupes[MAX_DUPES];
} DUPEDATA;
typedef struct {
CHAR EchoTag[64];
ULONG Position;
} DUPEIDX;
class DLL_EXPORT TDupes
{
public:
TDupes ();
TDupes (PSZ pszDataPath);
~TDupes ();
VOID Add (PSZ pszEchoTag, class TMsgBase *Msg);
USHORT Check (PSZ pszEchoTag, class TMsgBase *Msg);
VOID Delete ();
ULONG GetEID (class TMsgBase *Msg);
USHORT Load (PSZ pszEchoTag);
VOID Save ();
private:
CHAR DataFile[128];
CHAR IndexFile[128];
DUPEDATA dd;
};
#endif