/
gmoezyc5.cpp
116 lines (95 loc) · 4.22 KB
/
gmoezyc5.cpp
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
// This may look like C code, but it is really -*- C++ -*-
// ------------------------------------------------------------------
// The Goldware Library
// Copyright (C) 1990-1999 Odinn Sorensen
// ------------------------------------------------------------------
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library 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
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this program; if not, write to the Free
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
// MA 02111-1307, USA
// ------------------------------------------------------------------
// $Id$
// ------------------------------------------------------------------
// Ezycom msgbase handling
// ------------------------------------------------------------------
#include <gdbgtrk.h>
#include <gmemall.h>
#include <gutlmisc.h>
#include <gmoezyc.h>
// ------------------------------------------------------------------
char* EzycomArea::user_lookup(char* __lookfor)
{
wide->user->gufh = ::sopen(AddPath(wide->userbasepath, "USERS.BBS"), O_RDWR|O_BINARY, WideSharemode, S_STDRW);
if (wide->user->gufh)
{
wide->user->findwild(__lookfor, __lookfor);
::close(wide->user->gufh);
}
if(wide->user->found)
return __lookfor;
else
return NULL;
}
// ------------------------------------------------------------------
int EzycomArea::renumber()
{
return false;
}
// ------------------------------------------------------------------
Line* EzycomArea::make_dump_msg(Line*& lin, gmsg* msg, char* lng_head)
{
GFTRK("EzycomMakeDump");
EzycHdr _hdr;
load_message(GMSG_HDRTXT, msg, _hdr);
char buf[100];
Line* line = lin =
AddLine (NULL, "Hexdump of Ezycom-style message header and text");
AddLineF(line, "------------------------------------------------------------------------------");
line = AddLine(line, "");
AddLineF(line, "Msgbase : %s", wide->msgbasepath);
AddLineF(line, "BoardNo : %u", board());
AddLineF(line, "From : %-35.35s", msg->by);
AddLineF(line, "To : %-35.35s", msg->to);
AddLineF(line, "Subject : %-72.72s", msg->re);
AddLineF(line, "Orig : %u:%u/%u.%u", _hdr.orignet.zone, _hdr.orignet.net, _hdr.orignet.node, _hdr.orignet.point);
AddLineF(line, "Dest : %u:%u/%u.%u", _hdr.destnet.zone, _hdr.destnet.net, _hdr.destnet.node, _hdr.destnet.point);
AddLineF(line, "Reply : %u See : %u", _hdr.replyto, _hdr.reply1st);
AddLineF(line, "Cost : %u", _hdr.cost);
AddLineF(line, "MsgAttr : %02Xh (%sb)", _hdr.msgattr, ltob(buf, _hdr.msgattr, 8));
AddLineF(line, "NetAttr : %02Xh (%sb)", _hdr.netattr, ltob(buf, _hdr.netattr, 8));
AddLineF(line, "ExtAttr : %02Xh (%sb)", _hdr.extattr, ltob(buf, _hdr.extattr, 8));
AddLineF(line, "PostDate : %s (%08Xh)", FTimeToStr(buf, _hdr.posttimedate), *(dword*)&_hdr.posttimedate);
AddLineF(line, "RecvDate : %s (%08Xh)", FTimeToStr(buf, _hdr.recvtimedate), *(dword*)&_hdr.recvtimedate);
AddLineF(line, "StartPos : %u", _hdr.startposition);
AddLineF(line, "MsgLength: %u", _hdr.messagelength);
AddLineF(line, "UserRecno: %u (%s)", wide->userno, WideUsername[0]);
line = AddLine(line, "");
AddLine(line, lng_head);
line = AddLine(line, "");
uint _count = 0;
char* _ptr = (char*)&_hdr;
while(_count < sizeof(EzycHdr))
{
sprintf(buf, "%04X ", _count);
HexDump16(buf+7, _ptr, 16, HEX_DUMP2);
line = AddLine(line, buf);
_count += 16;
_ptr += 16;
}
sprintf(buf, "%04X ", _count);
HexDump16(buf+7, _ptr, sizeof(EzycHdr)%16, HEX_DUMP2);
line = AddLine(line, buf);
GFTRK(0);
return line;
}
// ------------------------------------------------------------------