Applied SeqMsgID patch

This commit is contained in:
Alexander S. Aganichev
2003-04-03 14:28:59 +00:00
parent 034d8d2511
commit 8be702a36f
12 changed files with 130 additions and 9 deletions

View File

@@ -3,8 +3,8 @@
TOP=..
SHORTTARGET=ged
TARGET=golded3
GLIBS=gmb3 gall gcfg uulib smblib
INCS=-I. -I$(TOP)/goldlib/gall -I$(TOP)/goldlib/gcfg -I$(TOP)/goldlib/gmb3 -I$(TOP)/goldlib/uulib -I$(TOP)/goldlib/smblib
GLIBS=gmb3 gall gcfg uulib smblib msgidlib
INCS=-I. -I$(TOP)/goldlib/gall -I$(TOP)/goldlib/gcfg -I$(TOP)/goldlib/gmb3 -I$(TOP)/goldlib/uulib -I$(TOP)/goldlib/smblib -I$(TOP)/goldlib/msgidlib
ifeq ($(findstring EMX, $(PATH)), EMX)
STDLIBS=-los2me -lstdcpp

View File

@@ -106,6 +106,9 @@ bool ReadGoldedCfg(int& force) {
MakePathname(CFG->outputfile, CFG->goldpath, CFG->outputfile);
MakePathname(CFG->inputfile, CFG->goldpath, CFG->inputfile);
if(*CFG->seqdir)
MakePathname(CFG->seqdir, CFG->goldpath, CFG->seqdir);
if(*CFG->souptosslog)
MakePathname(CFG->souptosslog, CFG->goldpath, CFG->souptosslog);
@@ -327,7 +330,7 @@ void InstallDetect(char* path) {
if(fexist(cmdlinecfgbak))
remove(cmdlinecfgbak);
rename(CFG->goldcfg, cmdlinecfgbak);
std::cout << "WARNING: Existing config backed up to " << cmdlinecfgbak << "!!!" << std::endl;
std::cout << "Warning: Existing config backed up to " << cmdlinecfgbak << "!!!" << std::endl;
}
std::cout << "Please wait while GoldED+ is detecting your software." << std::endl;
@@ -585,6 +588,7 @@ CfgGed::CfgGed() {
*pathreportfile = 0;
*pcboardpath = 0;
*quotebuffile = 0;
*seqdir = 0;
*soundpath = 0;
*soupexportpath = 0;
*soupimportpath = 0;
@@ -754,6 +758,8 @@ CfgGed::CfgGed() {
screenmaxcol = 0;
screenmaxrow = 0;
screensize = 0;
seqmsgid = MAYBE;
seqoutrun = 0;
sharemode = cmdlinesharemode;
showdeleted = false;
soupexportmargin = 76;

View File

@@ -318,6 +318,9 @@ const word CRC_SCREENUSEBIOS = 0x43DE;
const word CRC_SEARCHFOR = 0x9FA6;
const word CRC_SEMAPHORE = 0x02FB;
const word CRC_SERIALNO = 0x6EDE;
const word CRC_SEQDIR = 0x6426;
const word CRC_SEQMSGID = 0xFAB3;
const word CRC_SEQOUTRUN = 0x46A9;
const word CRC_SHAREMODE = 0x068E;
const word CRC_SHOWDELETED = 0xA9CE;
const word CRC_SOUNDDEVICE = 0x831D;

View File

@@ -511,6 +511,9 @@ SwitchS:
case CRC_SCREENSIZE : CfgScreensize (); break;
case CRC_SEARCHFOR : CfgSearchfor (); break;
case CRC_SEMAPHORE : CfgSemaphore (); break;
case CRC_SEQDIR : CfgSeqDir (); break;
case CRC_SEQMSGID : CfgSeqMsgId (); break;
case CRC_SEQOUTRUN : CfgSeqOutRun (); break;
case CRC_SHAREMODE : CfgSharemode (); break;
case CRC_SHOWDELETED : CfgShowdeleted (); break;
case CRC_SOUNDPATH : CfgSoundpath (); break;

View File

@@ -344,6 +344,74 @@ void CfgSemaphore() {
// ------------------------------------------------------------------
void CfgSeqDir() {
MapPath(PathCopy(CFG->seqdir, val));
}
// ------------------------------------------------------------------
void CfgSeqMsgId() {
CFG->seqmsgid = GetYesno(val);
}
// ------------------------------------------------------------------
void CfgSeqOutRun_Error() {
std::cout << "* Warning: Bad SeqOutrun value \'" << val << "\', ignored."<< std::endl;
}
void CfgSeqOutRun() {
char *p;
ulong s = 0;
if(not isdigit((int)(*val))) {
CfgSeqOutRun_Error();
return;
}
s = (ulong)atol(val);
p = val;
while(isdigit((int)(*p)))
p++;
if(*p == '\0') {
CFG->seqoutrun = s;
if(veryverbose)
std::cout << " SeqOutRun: \'" << val << "\' --> " << CFG->seqoutrun << std::endl;
return;
}
if(p[1]) {
CfgSeqOutRun_Error();
return;
}
switch(tolower(*p)) {
case 'y':
s *= 365;
case 'd':
s *= 24;
case 'h':
s *= 60*60;
break;
case 'w':
s *= 7l*24*60*60;
break;
case 'm':
s *= 31l*24*60*60;
break;
default:
CfgSeqOutRun_Error();
return;
}
CFG->seqoutrun = s;
if(veryverbose)
std::cout << " SeqOutRun: \'" << val << "\' --> " << CFG->seqoutrun << std::endl;
}
// ------------------------------------------------------------------
void CfgSharemode() {
if(atoi(val))

View File

@@ -303,6 +303,9 @@ void CfgScreensize ();
void CfgScreenusebios ();
void CfgSearchfor ();
void CfgSemaphore ();
void CfgSeqDir ();
void CfgSeqMsgId ();
void CfgSeqOutRun ();
void CfgSharemode ();
void CfgShowdeleted ();
void CfgSounddevice ();

View File

@@ -303,6 +303,9 @@ public:
int screensize;
INam searchfor;
Semaphore semaphore;
Path seqdir;
int seqmsgid;
ulong seqoutrun;
int sharemode; // share;
bool showdeleted;
Path soundpath;

View File

@@ -32,7 +32,6 @@
// ------------------------------------------------------------------
static ulong msgcount = 0;
int _use_fwd = true;
@@ -329,7 +328,7 @@ void DoKludges(int mode, GMsg* msg, int kludges) {
strcpy(buf, msg->iorig);
strchg(buf, '@', '.');
}
sprintf(buf2, "<GED%08lX@%s>", time(NULL)+(msgcount++), buf);
sprintf(buf2, "<GED%08lX@%s>", getMsgId(), buf);
throw_release(msg->messageid);
msg->messageid = throw_strdup(buf2);
CvtMessageIDtoMSGID(buf2, buf, AA->echoid(), "MSGID");
@@ -337,7 +336,7 @@ void DoKludges(int mode, GMsg* msg, int kludges) {
}
else {
msg->orig.make_string(buf2, msg->odom);
sprintf(msg->msgids, "%s %08lx", buf2, time(NULL)+(msgcount++));
sprintf(msg->msgids, "%s %08lx", buf2, getMsgId());
}
if(CFG->switches.get(usemsgid) and not AA->ispcboard()) {
sprintf(buf, "\001MSGID: %s", msg->msgids);

View File

@@ -423,6 +423,13 @@ void update_addressbook(GMsg* msg, bool reverse = false, bool force = false);
void edit_addressbook(GMsg* msg);
// ------------------------------------------------------------------
// GEMSGID prototypes
ulong getMsgId();
ulong getClassicMsgId();
// ------------------------------------------------------------------
// SOFTCR management

View File

@@ -64,6 +64,7 @@ gemlst cpp all ovl bcd bco bcx djg emx lnx rsx wcn wco wcx cyg be
gemnus cpp all ovl bcd bco bcx djg emx lnx rsx wcn wco wcx cyg be
gemrks cpp all ovl bcd bco bcx djg emx lnx rsx wcn wco wcx cyg be
gemsgs cpp all ovl bcd bco bcx djg emx lnx rsx wcn wco wcx cyg be
gemsgid cpp all ovl bcd bco bcx djg emx lnx rsx wcn wco wcx cyg be
genode cpp all ovl bcd bco bcx djg emx lnx rsx wcn wco wcx cyg be
geplay cpp all ovl bcd bco bcx djg emx lnx rsx wcn wco wcx cyg be
gepost cpp all ovl bcd bco bcx djg emx lnx rsx wcn wco wcx cyg be