fixes
This commit is contained in:
parent
feb27a793a
commit
b7e2b155af
@ -12,6 +12,13 @@ ______________________________________________________________________
|
|||||||
Notes for GoldED+ 1.1.5, March xx 2001
|
Notes for GoldED+ 1.1.5, March xx 2001
|
||||||
______________________________________________________________________
|
______________________________________________________________________
|
||||||
|
|
||||||
|
- Fixed EDITHARDLINE keyword operation.
|
||||||
|
|
||||||
|
- Fixed QUOTEWRAPHARD keyword operation.
|
||||||
|
|
||||||
|
! Freed lot of stack on displaying message header. Please report
|
||||||
|
(cosmetic?) bugs if any.
|
||||||
|
|
||||||
- Fixed small bug in parser.
|
- Fixed small bug in parser.
|
||||||
|
|
||||||
+ Added new keyword INTERNETGATEEXP to configure expansion of UUCP
|
+ Added new keyword INTERNETGATEEXP to configure expansion of UUCP
|
||||||
|
@ -77,15 +77,13 @@ assistance!
|
|||||||
|
|
||||||
*Q:* € £¤¥ ¬®¦® ¢§ïâì GoldED+? € ¬®¦® ¯®¨¬¥âì ¨á室¨ª¨? € 祬 ¯®â®¬
|
*Q:* € £¤¥ ¬®¦® ¢§ïâì GoldED+? € ¬®¦® ¯®¨¬¥âì ¨á室¨ª¨? € 祬 ¯®â®¬
|
||||||
ᮡ¨à âì?
|
ᮡ¨à âì?
|
||||||
*A:* <20>®¤¨ GoldED+ 室¨âáï http://asa.i-connect.com. ’ ¬ ¦¥ ¢ë ¬®¦¥â¥
|
*A:* <20>®¤¨ GoldED+ 室¨âáï http://golded-plus.sourceforge.net. ’ ¬ ¦¥ ¢ë
|
||||||
©â¨ ᯨ᮪ ¬¨àà®à®¢ ¨ ¢§ïâì ¨á室¨ª¨. ‘®¡¨à âì ¤® GNU C/C++ (¥ ¤®
|
¬®¦¥â¥ ©â¨ ᯨ᮪ ¬¨àà®à®¢ ¨ ¢§ïâì ¨á室¨ª¨. ‘®¡¨à âì ¤® GNU C/C++
|
||||||
¡à âì ¥çâ® ¤à¥¢¥¥ 2.8.x, «ãçè¥ ¢á¥£® ª ªãî-¨¡ã¤ì ᢥ¦ãî ¢¥àá¨î) ¨ ¥£®
|
(¥ ¤® ¡à âì ¥çâ® ¤à¥¢¥¥ 2.8.x, «ãçè¥ ¢á¥£® ª ªãî-¨¡ã¤ì ᢥ¦ãî
|
||||||
¯à®¨§¢®¤ë¬¨ (djgpp, emx, mingw32). „à㣨¥ ª®¬¯¨«ïâ®àë ¡®«¥¥ ¥
|
¢¥àá¨î) ¨ ¥£® ¯à®¨§¢®¤ë¬¨ (djgpp, emx, mingw32). „à㣨¥ ª®¬¯¨«ïâ®àë ¡®«¥¥
|
||||||
¯®¤¤¥à¦¨¢ îâáï. —â®¡ë ¢á¥ ª®¬¯¨«¨à®¢ «®áì ¡¥§ ª ª¨å-«¨¡® ¯à®¡«¥¬ - ¡¥à¨â¥
|
¥ ¯®¤¤¥à¦¨¢ îâáï. —â®¡ë ¢á¥ ª®¬¯¨«¨à®¢ «®áì ¡¥§ ª ª¨å-«¨¡® ¯à®¡«¥¬ -
|
||||||
çâ®-â® ®¢¥¥ gcc 2.95 (¨«¨ ⥠egcs, ¢ ª®â®àëå #pragma implementaion,
|
¡¥à¨â¥ çâ®-â® ®¢¥¥ gcc 2.95 (¨«¨ ⥠egcs, ¢ ª®â®àëå #pragma
|
||||||
#pragma interface 㦥 ¡ë«¨ obsolete). ‚®¢á¥ ¥ ¤® ª®¬¯¨«¨à®¢ âì ¢á¥
|
implementaion, #pragma interface 㦥 ¡ë«¨ obsolete).
|
||||||
ª®¬ ¤®© "make 2>&1 | mail -s VERSION asa@eed.miee.ru", ¢á¥ à ¢® ï íâ®
|
|
||||||
ç¨â âì ¥ ¡ã¤ã - ¬¥ «¥ì à §¡¨à âì íâ®â ᯠ¬.
|
|
||||||
|
|
||||||
*Q:* € ª ª-â® ¯®¨áª ¥âਢ¨ «ì® à ¡®â ¥â...
|
*Q:* € ª ª-â® ¯®¨áª ¥âਢ¨ «ì® à ¡®â ¥â...
|
||||||
*A:* € ¢ë 㢥à¥ë, çâ® ¯à®ç¨â «¨ Notework.txt ¤® ¯à¥¤ë¤ã饩 ¢¥àᨨ, ¢ ª®â®à®©
|
*A:* € ¢ë 㢥à¥ë, çâ® ¯à®ç¨â «¨ Notework.txt ¤® ¯à¥¤ë¤ã饩 ¢¥àᨨ, ¢ ª®â®à®©
|
||||||
|
@ -296,7 +296,7 @@ void AreaList::WriteAreaDef(const char* file) {
|
|||||||
strcpy(addr, ".");
|
strcpy(addr, ".");
|
||||||
tmp = strlen(addr);
|
tmp = strlen(addr);
|
||||||
maxaddr = MaxV(maxaddr, tmp);
|
maxaddr = MaxV(maxaddr, tmp);
|
||||||
tmp = strlen(MakeAttrStr(attr, &(*aa)->attr()));
|
tmp = strlen(MakeAttrStr(attr, sizeof(attr), &(*aa)->attr()));
|
||||||
maxattr = MaxV(maxattr, tmp+2);
|
maxattr = MaxV(maxattr, tmp+2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -371,7 +371,7 @@ void AreaList::WriteAreaDef(const char* file) {
|
|||||||
else
|
else
|
||||||
strcpy(addr, ".");
|
strcpy(addr, ".");
|
||||||
*attr = '('; /*)*/
|
*attr = '('; /*)*/
|
||||||
MakeAttrStr(attr+1, &(*aa)->attr());
|
MakeAttrStr(attr+1, sizeof(attr)-2, &(*aa)->attr());
|
||||||
strcat(attr, /*(*/ ")");
|
strcat(attr, /*(*/ ")");
|
||||||
if((*aa)->originno())
|
if((*aa)->originno())
|
||||||
sprintf(origin, " \"%.*s\"", (int)sizeof(origin)-4, CFG->origin[(*aa)->originno()].c_str());
|
sprintf(origin, " \"%.*s\"", (int)sizeof(origin)-4, CFG->origin[(*aa)->originno()].c_str());
|
||||||
|
@ -51,7 +51,7 @@ void CfgDispmsgsize() {
|
|||||||
else if(strieql("KBYTES", val))
|
else if(strieql("KBYTES", val))
|
||||||
CFG->dispmsgsize = DISPMSGSIZE_KBYTES;
|
CFG->dispmsgsize = DISPMSGSIZE_KBYTES;
|
||||||
else if(strieql("LINES", val))
|
else if(strieql("LINES", val))
|
||||||
CFG->dispmsgsize = DISPMSGSIZE_KBYTES+1;
|
CFG->dispmsgsize = DISPMSGSIZE_LINES;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
@ -222,6 +222,7 @@ const int BLANK_SLIDEWIN = 1;
|
|||||||
|
|
||||||
const int DISPMSGSIZE_BYTES = 1;
|
const int DISPMSGSIZE_BYTES = 1;
|
||||||
const int DISPMSGSIZE_KBYTES = 2;
|
const int DISPMSGSIZE_KBYTES = 2;
|
||||||
|
const int DISPMSGSIZE_LINES = 3;
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
@ -27,6 +27,18 @@
|
|||||||
#include "golded.h"
|
#include "golded.h"
|
||||||
|
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
|
bool strncont(const char *beginword, const char *stylestopchars, int n)
|
||||||
|
{
|
||||||
|
for(; (n > 0) and (*beginword != NUL); n--, beginword++) {
|
||||||
|
if(strchr(stylestopchars, *beginword) != NULL)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
inline int isstylechar(char c) { return (c == '*') or (c == '/') or (c == '_') or (c == '#'); }
|
inline int isstylechar(char c) { return (c == '*') or (c == '/') or (c == '_') or (c == '#'); }
|
||||||
@ -34,7 +46,7 @@ inline int isstylechar(char c) { return (c == '*') or (c == '/') or (c == '_') o
|
|||||||
void Container::StyleCodeHighlight(const char* text, int row, int col, bool dohide, int color) {
|
void Container::StyleCodeHighlight(const char* text, int row, int col, bool dohide, int color) {
|
||||||
|
|
||||||
uint sclen = 0;
|
uint sclen = 0;
|
||||||
char* txptr = text;
|
const char* txptr = text;
|
||||||
char buf[200];
|
char buf[200];
|
||||||
const char* ptr = text;
|
const char* ptr = text;
|
||||||
const char* stylemargins = " -|\\"; // we probably have to make a keyword for it
|
const char* stylemargins = " -|\\"; // we probably have to make a keyword for it
|
||||||
@ -59,19 +71,15 @@ void Container::StyleCodeHighlight(const char* text, int row, int col, bool dohi
|
|||||||
}
|
}
|
||||||
if((bb <= 1) and (bi <= 1) and (br <= 1) and (bu <= 1) and *ptr) {
|
if((bb <= 1) and (bi <= 1) and (br <= 1) and (bu <= 1) and *ptr) {
|
||||||
const char* beginword = ptr; // _/*>another*/_
|
const char* beginword = ptr; // _/*>another*/_
|
||||||
char endchar = NUL;
|
const char* end = ptr;
|
||||||
char* end = ptr;
|
|
||||||
do {
|
do {
|
||||||
end = strpbrk(++end, punctchars);
|
end = strpbrk(++end, punctchars);
|
||||||
} while ((end) and not isstylechar(*(end-1)));
|
} while ((end != NULL) and not isstylechar(*(end-1)));
|
||||||
if(end)
|
if(end == NULL)
|
||||||
endchar = *end;
|
|
||||||
else
|
|
||||||
end = ptr+strlen(ptr);
|
end = ptr+strlen(ptr);
|
||||||
*end = NUL;
|
const char* endstyle = end-1; // _/*another*/>_
|
||||||
char* endstyle = end-1; // _/*another*/>_
|
|
||||||
if(isstylechar(*endstyle) and not strchr(stylemargins, *beginword)) {
|
if(isstylechar(*endstyle) and not strchr(stylemargins, *beginword)) {
|
||||||
char* endword = endstyle;
|
const char* endword = endstyle;
|
||||||
int eb = 0, ei = 0, eu = 0, er = 0;
|
int eb = 0, ei = 0, eu = 0, er = 0;
|
||||||
while(isstylechar(*endword)) {
|
while(isstylechar(*endword)) {
|
||||||
switch(*endword) {
|
switch(*endword) {
|
||||||
@ -84,10 +92,7 @@ void Container::StyleCodeHighlight(const char* text, int row, int col, bool dohi
|
|||||||
} // _/*anothe>r*/_
|
} // _/*anothe>r*/_
|
||||||
if(endword >= beginword and not strchr(stylemargins, *endword)) {
|
if(endword >= beginword and not strchr(stylemargins, *endword)) {
|
||||||
if((bb == eb) and (bi == ei) and (bu == eu) and (br == er)) {
|
if((bb == eb) and (bi == ei) and (bu == eu) and (br == er)) {
|
||||||
char endwordchar = *endword;
|
bool style_stops_present = strncont(beginword, stylestopchars, endword-beginword);
|
||||||
*endword = NUL;
|
|
||||||
char* style_stops_present = strpbrk(beginword, stylestopchars);
|
|
||||||
*endword = endwordchar;
|
|
||||||
if(not style_stops_present) {
|
if(not style_stops_present) {
|
||||||
int colorindex = (bb ? 1 : 0) | (bi ? 2 : 0) | (bu ? 4 : 0) | (br ? 8 : 0);
|
int colorindex = (bb ? 1 : 0) | (bi ? 2 : 0) | (bu ? 4 : 0) | (br ? 8 : 0);
|
||||||
strxcpy(buf, txptr, (uint)(beginstyle-txptr)+1);
|
strxcpy(buf, txptr, (uint)(beginstyle-txptr)+1);
|
||||||
@ -104,7 +109,6 @@ void Container::StyleCodeHighlight(const char* text, int row, int col, bool dohi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*end = endchar;
|
|
||||||
ptr = end-1;
|
ptr = end-1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,21 +30,18 @@
|
|||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
static FILE* prnfp;
|
static FILE* prnfp;
|
||||||
static int prnmargin;
|
|
||||||
static int prnheader;
|
static int prnheader;
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
void SaveLines(int mode, const char* savefile, GMsg* msg, bool clip) {
|
void SaveLines(int mode, const char* savefile, GMsg* msg, int margin, bool clip) {
|
||||||
|
|
||||||
int prn=NO;
|
int prn=NO;
|
||||||
char fnam[GMAXPATH];
|
char fnam[GMAXPATH];
|
||||||
char* prnacc;
|
char* prnacc;
|
||||||
|
|
||||||
if(mode == MODE_SAVE or mode == MODE_SAVENOCTRL)
|
if(mode == MODE_APPEND) {
|
||||||
prnacc = "wt";
|
|
||||||
else if(mode == MODE_APPEND) {
|
|
||||||
prnacc = "at";
|
prnacc = "at";
|
||||||
mode = MODE_WRITE;
|
mode = MODE_WRITE;
|
||||||
}
|
}
|
||||||
@ -63,18 +60,19 @@ void SaveLines(int mode, const char* savefile, GMsg* msg, bool clip) {
|
|||||||
if(prnfp) {
|
if(prnfp) {
|
||||||
#ifdef OLD_STYLE_HEADER
|
#ifdef OLD_STYLE_HEADER
|
||||||
if(mode == MODE_WRITE) {
|
if(mode == MODE_WRITE) {
|
||||||
if(prnheader)
|
if(prnheader) {
|
||||||
DispHeader(msg, prn, prnfp, prnmargin);
|
DispHeader(msg, prn, prnfp, margin);
|
||||||
if(prn)
|
if(prn)
|
||||||
lines = 6;
|
lines = 6;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
TemplateToText(((mode == MODE_WRITE) && prnheader) ? MODE_WRITEHEADER : ((prnheader & WRITE_ONLY_HEADER) ? MODE_HEADER : MODE_WRITE), msg, msg, AA->Tpl(), CurrArea);
|
TemplateToText(((mode == MODE_WRITE) and prnheader) ? ((prnheader & WRITE_ONLY_HEADER) ? MODE_HEADER : MODE_WRITEHEADER) : MODE_WRITE, msg, msg, AA->Tpl(), CurrArea);
|
||||||
msg->TextToLines(-prnmargin);
|
msg->TextToLines(-margin);
|
||||||
#endif
|
#endif
|
||||||
int n = 0;
|
int n = 0;
|
||||||
Line** lin = msg->line;
|
Line** lin = msg->line;
|
||||||
if(lin and not (prnheader & WRITE_ONLY_HEADER)) {
|
if(lin) {
|
||||||
Line* line = lin[n];
|
Line* line = lin[n];
|
||||||
while(line) {
|
while(line) {
|
||||||
uint lineisctrl = line->type & (GLINE_TEAR|GLINE_ORIG|GLINE_KLUDGE);
|
uint lineisctrl = line->type & (GLINE_TEAR|GLINE_ORIG|GLINE_KLUDGE);
|
||||||
@ -142,6 +140,8 @@ void SaveLines(int mode, const char* savefile, GMsg* msg, bool clip) {
|
|||||||
|
|
||||||
static void WriteMsgs(GMsg* msg) {
|
static void WriteMsgs(GMsg* msg) {
|
||||||
|
|
||||||
|
int prnmargin;
|
||||||
|
|
||||||
if(AA->Msgn.Tags() == 0)
|
if(AA->Msgn.Tags() == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -222,10 +222,10 @@ static void WriteMsgs(GMsg* msg) {
|
|||||||
AA->LoadMsg(msg, AA->Mark[n], prnmargin);
|
AA->LoadMsg(msg, AA->Mark[n], prnmargin);
|
||||||
if(target & WRITE_PRINTER) {
|
if(target & WRITE_PRINTER) {
|
||||||
if(prnfp)
|
if(prnfp)
|
||||||
SaveLines(MODE_WRITE, "\001PRN", msg);
|
SaveLines(MODE_WRITE, "\001PRN", msg, prnmargin);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SaveLines(overwrite ? MODE_WRITE : MODE_APPEND, AA->Outputfile(), msg, (target & WRITE_CLIPBRD) ? true : false);
|
SaveLines(overwrite ? MODE_WRITE : MODE_APPEND, AA->Outputfile(), msg, prnmargin, (target & WRITE_CLIPBRD) ? true : false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(prnfp)
|
if(prnfp)
|
||||||
@ -277,7 +277,7 @@ static void WriteMsgs(GMsg* msg) {
|
|||||||
sprintf(buf, LNG->WritingFile, AA->Outputfile());
|
sprintf(buf, LNG->WritingFile, AA->Outputfile());
|
||||||
w_info(buf);
|
w_info(buf);
|
||||||
AA->LoadMsg(msg, msg->msgno, prnmargin);
|
AA->LoadMsg(msg, msg->msgno, prnmargin);
|
||||||
SaveLines(overwrite ? MODE_WRITE : MODE_APPEND, AA->Outputfile(), msg);
|
SaveLines(overwrite ? MODE_WRITE : MODE_APPEND, AA->Outputfile(), msg, prnmargin);
|
||||||
w_info(NULL);
|
w_info(NULL);
|
||||||
}
|
}
|
||||||
} while(overwrite == -1);
|
} while(overwrite == -1);
|
||||||
@ -292,7 +292,7 @@ static void WriteMsgs(GMsg* msg) {
|
|||||||
#endif
|
#endif
|
||||||
if(prnfp) {
|
if(prnfp) {
|
||||||
fwrite(CFG->printinit+1, CFG->printinit[0], 1, prnfp);
|
fwrite(CFG->printinit+1, CFG->printinit[0], 1, prnfp);
|
||||||
SaveLines(MODE_WRITE, "\001PRN", msg);
|
SaveLines(MODE_WRITE, "\001PRN", msg, prnmargin);
|
||||||
fwrite(CFG->printreset+1, CFG->printreset[0], 1, prnfp);
|
fwrite(CFG->printreset+1, CFG->printreset[0], 1, prnfp);
|
||||||
}
|
}
|
||||||
w_info(NULL);
|
w_info(NULL);
|
||||||
@ -303,7 +303,7 @@ static void WriteMsgs(GMsg* msg) {
|
|||||||
mktemp(strcpy(fname, AddPath(CFG->goldpath, "GDXXXXXX")));
|
mktemp(strcpy(fname, AddPath(CFG->goldpath, "GDXXXXXX")));
|
||||||
|
|
||||||
AA->LoadMsg(msg, msg->msgno, prnmargin);
|
AA->LoadMsg(msg, msg->msgno, prnmargin);
|
||||||
SaveLines(MODE_WRITE, fname, msg, true);
|
SaveLines(MODE_WRITE, fname, msg, prnmargin, true);
|
||||||
|
|
||||||
gclipbrd clipbrd;
|
gclipbrd clipbrd;
|
||||||
gfile fp;
|
gfile fp;
|
||||||
|
@ -313,7 +313,7 @@ bool GMsgHeaderEdit::validate() {
|
|||||||
|
|
||||||
vcurshow();
|
vcurshow();
|
||||||
char bot2[200];
|
char bot2[200];
|
||||||
MakeAttrStr(bot2, &msg->attr);
|
MakeAttrStr(bot2, sizeof(bot2), &msg->attr);
|
||||||
strsetsz(bot2, EDIT->HdrNodeLen());
|
strsetsz(bot2, EDIT->HdrNodeLen());
|
||||||
window.prints(1, EDIT->HdrNodePos(), C_HEADW, bot2);
|
window.prints(1, EDIT->HdrNodePos(), C_HEADW, bot2);
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ void DispHeader(GMsg* msg, bool prn, FILE* fp, int width) {
|
|||||||
fwrite(buf, strlen(buf), 1, fp);
|
fwrite(buf, strlen(buf), 1, fp);
|
||||||
|
|
||||||
// Generate message attributes string
|
// Generate message attributes string
|
||||||
MakeAttrStr(buf2, &msg->attr);
|
MakeAttrStr(buf2, sizeof(buf2), &msg->attr);
|
||||||
int len2 = strlen(buf2);
|
int len2 = strlen(buf2);
|
||||||
if(len2 > width-CFG->disphdrnodeset.pos) {
|
if(len2 > width-CFG->disphdrnodeset.pos) {
|
||||||
len2 = width-CFG->disphdrnodeset.pos;
|
len2 = width-CFG->disphdrnodeset.pos;
|
||||||
|
@ -1962,7 +1962,10 @@ void MakeLineIndex(GMsg* msg, int margin, bool header_recode) {
|
|||||||
for(n=0; n<qlen; n++) {
|
for(n=0; n<qlen; n++) {
|
||||||
*(++bp) = *qptr++;
|
*(++bp) = *qptr++;
|
||||||
}
|
}
|
||||||
|
if(quotewraphard) {
|
||||||
|
*qbuf = NUL;
|
||||||
|
qlen = 0;
|
||||||
|
}
|
||||||
ptr = spanfeeds(ptr);
|
ptr = spanfeeds(ptr);
|
||||||
line->type |= GLINE_QUOT|GLINE_HARD;
|
line->type |= GLINE_QUOT|GLINE_HARD;
|
||||||
}
|
}
|
||||||
@ -2372,7 +2375,7 @@ void MakeLineIndex(GMsg* msg, int margin, bool header_recode) {
|
|||||||
else {
|
else {
|
||||||
wraps++;
|
wraps++;
|
||||||
if(para == GLINE_QUOT)
|
if(para == GLINE_QUOT)
|
||||||
reflow = quotewraphard;
|
reflow = true;
|
||||||
line->type |= GLINE_WRAP;
|
line->type |= GLINE_WRAP;
|
||||||
ptr = spanfeeds(ptr);
|
ptr = spanfeeds(ptr);
|
||||||
if((*bp == ' ') or (isspace(*ptr) && (*ptr != LF)))
|
if((*bp == ' ') or (isspace(*ptr) && (*ptr != LF)))
|
||||||
@ -2388,10 +2391,10 @@ void MakeLineIndex(GMsg* msg, int margin, bool header_recode) {
|
|||||||
else
|
else
|
||||||
line->type |= GLINE_HARD;
|
line->type |= GLINE_HARD;
|
||||||
|
|
||||||
*(++bp/*+1*/) = NUL;
|
*(++bp) = NUL;
|
||||||
|
|
||||||
// Get line length
|
// Get line length
|
||||||
uint tmplinelength = (uint)((long)bp-(long)bptr);
|
uint tmplinelength = (uint)(bp-bptr);
|
||||||
if(tmplinelength > (uint)(margin + 512)) {
|
if(tmplinelength > (uint)(margin + 512)) {
|
||||||
LOG.ErrPointer();
|
LOG.ErrPointer();
|
||||||
LOG.printf("! A message line length (%u bytes) exceeded an internal buffer limit of %u bytes", tmplinelength, margin+512);
|
LOG.printf("! A message line length (%u bytes) exceeded an internal buffer limit of %u bytes", tmplinelength, margin+512);
|
||||||
@ -2400,7 +2403,7 @@ void MakeLineIndex(GMsg* msg, int margin, bool header_recode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Store line
|
// Store line
|
||||||
line->txt = linetmp+1; // .assign(linetmp+1, tmplinelength+5);
|
line->txt = linetmp+1;
|
||||||
prev_ptr[0] = line->txt.empty() ? 0xFF : line->txt[0];
|
prev_ptr[0] = line->txt.empty() ? 0xFF : line->txt[0];
|
||||||
prev_ptr[1] = line->txt.length() < 2 ? 0xFF : line->txt[1];
|
prev_ptr[1] = line->txt.length() < 2 ? 0xFF : line->txt[1];
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ GMsg* MenuMsgPtr;
|
|||||||
void DispHeadAttrs(GMsg* msg) {
|
void DispHeadAttrs(GMsg* msg) {
|
||||||
|
|
||||||
char atrs[200];
|
char atrs[200];
|
||||||
MakeAttrStr(atrs, &msg->attr);
|
MakeAttrStr(atrs, sizeof(atrs), &msg->attr);
|
||||||
strsetsz(atrs, MAXCOL-CFG->disphdrnodeset.pos);
|
strsetsz(atrs, MAXCOL-CFG->disphdrnodeset.pos);
|
||||||
|
|
||||||
HeaderView->window.prints(1, CFG->disphdrnodeset.pos, HeaderView->window_color, atrs);
|
HeaderView->window.prints(1, CFG->disphdrnodeset.pos, HeaderView->window_color, atrs);
|
||||||
|
@ -215,7 +215,7 @@ static void mlst_get_mlst(MLst* ml, PInf* p, int n) {
|
|||||||
AA->LoadHdr(msg, ml->msgno);
|
AA->LoadHdr(msg, ml->msgno);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
AA->LoadMsg(msg, ml->msgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar));
|
AA->LoadMsg(msg, ml->msgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar), GMSG_COPY); // do quick load
|
||||||
}
|
}
|
||||||
ml->goldmark = goldmark;
|
ml->goldmark = goldmark;
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
|
|||||||
sprintf(revbuf, "%02d%02d", str2mon(__gver_date__), atoi(&__gver_date__[4]));
|
sprintf(revbuf, "%02d%02d", str2mon(__gver_date__), atoi(&__gver_date__[4]));
|
||||||
|
|
||||||
char attr[80];
|
char attr[80];
|
||||||
MakeAttrStr(attr, &msg->attr);
|
MakeAttrStr(attr, sizeof(attr), &msg->attr);
|
||||||
|
|
||||||
const char *xmailer = get_informative_string();
|
const char *xmailer = get_informative_string();
|
||||||
|
|
||||||
|
@ -526,7 +526,7 @@ static void MakeMsg2(int& mode, int& status, int& forwstat, int& topline, GMsg*
|
|||||||
line = line->next;
|
line = line->next;
|
||||||
}
|
}
|
||||||
if(*EDIT->External() and not EDIT->Internal()) {
|
if(*EDIT->External() and not EDIT->Internal()) {
|
||||||
SaveLines(MODE_SAVE, AddPath(CFG->goldpath, EDIT->File()), msg);
|
SaveLines(MODE_NEW, AddPath(CFG->goldpath, EDIT->File()), msg, 79);
|
||||||
}
|
}
|
||||||
int loop = 0;
|
int loop = 0;
|
||||||
w_info(NULL);
|
w_info(NULL);
|
||||||
|
@ -108,7 +108,7 @@ const char* get_informative_string(void);
|
|||||||
|
|
||||||
void CmfMsgs(GMsg* msg);
|
void CmfMsgs(GMsg* msg);
|
||||||
void LoadText(GMsg* msg, const char* textfile);
|
void LoadText(GMsg* msg, const char* textfile);
|
||||||
void SaveLines(int mode, const char* savefile, GMsg* msg, bool clip=false);
|
void SaveLines(int mode, const char* savefile, GMsg* msg, int margin, bool clip=false);
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
@ -1141,7 +1141,7 @@ void GotoReplies() {
|
|||||||
uint reln = AA->Msgn.ToReln(msgn);
|
uint reln = AA->Msgn.ToReln(msgn);
|
||||||
if(reln) {
|
if(reln) {
|
||||||
if(CFG->replylinklist == REPLYLINKLIST_FULL)
|
if(CFG->replylinklist == REPLYLINKLIST_FULL)
|
||||||
AA->LoadMsg(rmsg, msgn, CFG->dispmargin-(int)CFG->switches.get(disppagebar));
|
AA->LoadMsg(rmsg, msgn, CFG->dispmargin-(int)CFG->switches.get(disppagebar), GMSG_COPY); // do quick load
|
||||||
else
|
else
|
||||||
AA->LoadHdr(rmsg, msgn);
|
AA->LoadHdr(rmsg, msgn);
|
||||||
rlist[replies].isread = ((0 == rmsg->timesread) and CFG->switches.get(highlightunread)) ? '\x10' : ' ';
|
rlist[replies].isread = ((0 == rmsg->timesread) and CFG->switches.get(highlightunread)) ? '\x10' : ' ';
|
||||||
|
@ -534,9 +534,9 @@ int ExternUtil(GMsg* msg, int utilno) {
|
|||||||
strcpy(cmdline, extutil->cmdline);
|
strcpy(cmdline, extutil->cmdline);
|
||||||
|
|
||||||
int mode = (extutil->options & EXTUTIL_KEEPCTRL) ? MODE_SAVE : MODE_SAVENOCTRL;
|
int mode = (extutil->options & EXTUTIL_KEEPCTRL) ? MODE_SAVE : MODE_SAVENOCTRL;
|
||||||
SaveLines(mode, editorfile, msg);
|
SaveLines(mode, editorfile, msg, 79);
|
||||||
if(striinc("@tmpfile", cmdline))
|
if(striinc("@tmpfile", cmdline))
|
||||||
SaveLines(mode, tmpfile, msg);
|
SaveLines(mode, tmpfile, msg, 79);
|
||||||
|
|
||||||
strcpy(buf, CFG->goldpath);
|
strcpy(buf, CFG->goldpath);
|
||||||
strchg(buf, GOLD_WRONG_SLASH_CHR, GOLD_SLASH_CHR);
|
strchg(buf, GOLD_WRONG_SLASH_CHR, GOLD_SLASH_CHR);
|
||||||
@ -633,13 +633,13 @@ void UUDecode(GMsg* msg) {
|
|||||||
overwrite = false; // Overwrite only the first time
|
overwrite = false; // Overwrite only the first time
|
||||||
w_progress(MODE_UPDATE, C_INFOW, n+1, AA->Mark.Count(), LNG->Preparing);
|
w_progress(MODE_UPDATE, C_INFOW, n+1, AA->Mark.Count(), LNG->Preparing);
|
||||||
AA->LoadMsg(msg, AA->Mark[n], 79);
|
AA->LoadMsg(msg, AA->Mark[n], 79);
|
||||||
SaveLines(overwrite ? MODE_WRITE : MODE_APPEND, infile, msg);
|
SaveLines(overwrite ? MODE_WRITE : MODE_APPEND, infile, msg, 79);
|
||||||
}
|
}
|
||||||
if(AA->Mark.Count())
|
if(AA->Mark.Count())
|
||||||
w_progress(MODE_QUIT, 0, 0, 0, NULL);
|
w_progress(MODE_QUIT, 0, 0, 0, NULL);
|
||||||
}
|
}
|
||||||
else if(source == WRITE_CURRENT)
|
else if(source == WRITE_CURRENT)
|
||||||
SaveLines(MODE_WRITE, infile, msg);
|
SaveLines(MODE_WRITE, infile, msg, 79);
|
||||||
|
|
||||||
uulist* item;
|
uulist* item;
|
||||||
int i, res;
|
int i, res;
|
||||||
|
@ -203,7 +203,10 @@ int TemplateToText(int mode, GMsg* msg, GMsg* oldmsg, const char* tpl, int origa
|
|||||||
if(fp) {
|
if(fp) {
|
||||||
fputs("@header= @oecho (@caddr) @align{79}{=}\n", fp);
|
fputs("@header= @oecho (@caddr) @align{79}{=}\n", fp);
|
||||||
fputs("@header Msg : @msgno of @msgs@align{44}@attr\n", fp);
|
fputs("@header Msg : @msgno of @msgs@align{44}@attr\n", fp);
|
||||||
fputs("@header From : @_oname @_oaddr @odate @otime\n", fp);
|
if(AA->isinternet())
|
||||||
|
fputs("@header From : @ofrom@align{64}@odate @otime\n", fp);
|
||||||
|
else
|
||||||
|
fputs("@header From : @oname@align{44}@oaddr@align{64}@odate @otime\n", fp);
|
||||||
fputs("@header To : @dname\n", fp);
|
fputs("@header To : @dname\n", fp);
|
||||||
fputs("@header Subj : @subject\n", fp);
|
fputs("@header Subj : @subject\n", fp);
|
||||||
fputs("@header@align{79}{=}\n", fp);
|
fputs("@header@align{79}{=}\n", fp);
|
||||||
@ -759,7 +762,7 @@ int TemplateToText(int mode, GMsg* msg, GMsg* oldmsg, const char* tpl, int origa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if((mode == MODE_CHANGE) or (mode == MODE_WRITEHEADER) or (mode == MODE_WRITE))
|
if((mode == MODE_CHANGE) or (mode == MODE_WRITEHEADER) or (mode == MODE_WRITE) or (mode == MODE_HEADER))
|
||||||
if(chg == NO)
|
if(chg == NO)
|
||||||
continue;
|
continue;
|
||||||
if((mode == MODE_QUOTEBUF) and not quotebufline)
|
if((mode == MODE_QUOTEBUF) and not quotebufline)
|
||||||
|
@ -754,12 +754,16 @@ void guserbase::update_addressbook(GMsg* msg, bool reverse, bool force) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 6. If it is already an email address
|
// 6. It's a UUCP name
|
||||||
|
if(strieql("UUCP", name) or (*AA->Internetgate().name and strieql(AA->Internetgate().name, name)))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// 7. If it is already an email address
|
||||||
if(AA->isemail() and strchr(name, '@'))
|
if(AA->isemail() and strchr(name, '@'))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
// 7. User listed in nodelist
|
// 8. User listed in nodelist
|
||||||
const char *nlname = lookup_nodelist(&fidoaddr);
|
const char *nlname = lookup_nodelist(&fidoaddr);
|
||||||
if(nlname and strieql(nlname, name))
|
if(nlname and strieql(nlname, name))
|
||||||
return;
|
return;
|
||||||
@ -845,6 +849,9 @@ bool guserbase::lookup_addressbook(GMsg* msg, char* name, char* aka, bool browse
|
|||||||
|
|
||||||
void guserbase::build_pseudo(GMsg* msg, char* name, char* aka, bool direction) {
|
void guserbase::build_pseudo(GMsg* msg, char* name, char* aka, bool direction) {
|
||||||
|
|
||||||
|
if(*msg->iaddr and strieql("UUCP", name) or (*AA->Internetgate().name and strieql(AA->Internetgate().name, name)))
|
||||||
|
strcpy(direction ? msg->pseudoto : msg->pseudofrom, strlword(msg->iaddr, " @"));
|
||||||
|
else
|
||||||
strcpy(direction ? msg->pseudoto : msg->pseudofrom, strlword(name, " @"));
|
strcpy(direction ? msg->pseudoto : msg->pseudofrom, strlword(name, " @"));
|
||||||
|
|
||||||
if(find_entry(name, true) and not entry.is_deleted) {
|
if(find_entry(name, true) and not entry.is_deleted) {
|
||||||
@ -864,7 +871,6 @@ void guserbase::build_pseudo(GMsg* msg, char* name, char* aka, bool direction) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
strcpy(direction ? msg->pseudoto : msg->pseudofrom, entry.pseudo);
|
strcpy(direction ? msg->pseudoto : msg->pseudofrom, entry.pseudo);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,76 +91,56 @@ void GMsgHeaderView::Use(Area *areaptr, GMsg *msgptr) {
|
|||||||
|
|
||||||
void GMsgHeaderView::Paint() {
|
void GMsgHeaderView::Paint() {
|
||||||
|
|
||||||
|
ISub buf;
|
||||||
int namewidth = CFG->disphdrnodeset.pos - CFG->disphdrnameset.pos;
|
int namewidth = CFG->disphdrnodeset.pos - CFG->disphdrnameset.pos;
|
||||||
int nodewidth = CFG->disphdrdateset.pos - CFG->disphdrnodeset.pos;
|
int nodewidth = CFG->disphdrdateset.pos - CFG->disphdrnodeset.pos;
|
||||||
int datewidth = width - CFG->disphdrdateset.pos;
|
int datewidth = MinV(width - CFG->disphdrdateset.pos, CFG->disphdrdateset.len);
|
||||||
|
|
||||||
vchar headerline[200];
|
|
||||||
for(int c = 0; c < width; c++)
|
|
||||||
headerline[c] = _box_table(W_BHEAD, 1);
|
|
||||||
headerline[width] = NUL;
|
|
||||||
|
|
||||||
INam whofrom;
|
|
||||||
if(not area->isecho() and *msg->ifrom and *msg->realby)
|
|
||||||
sprintf(whofrom, "%s <%s>", msg->realby, msg->iorig);
|
|
||||||
else if(not area->isecho() and *msg->ifrom and *msg->iorig)
|
|
||||||
strcpy(whofrom, msg->iorig);
|
|
||||||
else
|
|
||||||
strcpy(whofrom, msg->By());
|
|
||||||
strsetsz(whofrom, (area->isinternet() or *msg->ifrom) ? (namewidth+nodewidth) : namewidth);
|
|
||||||
|
|
||||||
INam whoto;
|
|
||||||
if(not area->isecho() and *msg->ito and *msg->realto)
|
|
||||||
sprintf(whoto, "%s <%s>", msg->realto, msg->idest);
|
|
||||||
else if(not area->isecho() and *msg->ito and *msg->idest)
|
|
||||||
strcpy(whoto, msg->idest);
|
|
||||||
else
|
|
||||||
strcpy(whoto, msg->To());
|
|
||||||
strsetsz(whoto, (area->isinternet() or *msg->ito) ? (namewidth+nodewidth) : namewidth);
|
|
||||||
|
|
||||||
// Generate top line fields
|
|
||||||
ISub buf;
|
|
||||||
char top1[200];
|
|
||||||
strtrim(strcpy(buf, area->desc()));
|
|
||||||
if((CFG->dispareano == ALWAYS) or (CFG->dispareano and area->board()))
|
|
||||||
sprintf(top1, " [%u] %s ", area->board(), buf);
|
|
||||||
else
|
|
||||||
sprintf(top1, " %s ", buf);
|
|
||||||
strtrim(top1);
|
|
||||||
strcat(top1, " (" /*)*/);
|
|
||||||
if(area->isinternet())
|
|
||||||
strcpy(buf, area->Internetaddress());
|
|
||||||
else
|
|
||||||
area->Aka().addr.make_string(buf);
|
|
||||||
strcat(top1, buf);
|
|
||||||
strcat(top1, /*(*/ ") ");
|
|
||||||
|
|
||||||
char top2[200];
|
|
||||||
if(msg->areakludgeid)
|
|
||||||
sprintf(top2, " %s (%s) ", area->echoid(), msg->areakludgeid);
|
|
||||||
else
|
|
||||||
sprintf(top2, " %s ", area->echoid());
|
|
||||||
|
|
||||||
#if defined(GUTLOS_FUNCS)
|
#if defined(GUTLOS_FUNCS)
|
||||||
g_set_ostitle_name(struplow(strtmp(area->echoid())), 0);
|
g_set_ostitle_name(struplow(strtmp(area->echoid())), 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Get marks
|
// Generate top line fields
|
||||||
int bookmark = (area->bookmark == msg->msgno);
|
char buf1[16];
|
||||||
int markmark = (area->Mark.Count() ? (area->Mark.Find(msg->msgno) ? 1 : 0) : NO);
|
if((CFG->dispareano == ALWAYS) or (CFG->dispareano and area->board()))
|
||||||
|
sprintf(buf1, "[%u] ", area->board());
|
||||||
|
else
|
||||||
|
*buf1 = NUL;
|
||||||
|
|
||||||
|
__extension__ char top[width+1];
|
||||||
|
strxmerge(top, width+1, " ", buf1, strtrim(strtmp(area->desc())), " (",
|
||||||
|
area->isinternet() ? area->Internetaddress() : area->Aka().addr.make_string(buf),
|
||||||
|
") ", NULL);
|
||||||
|
|
||||||
|
int desclen = strlen(top);
|
||||||
|
|
||||||
|
window.printc(0, 0, border_color|ACSET, _box_table(W_BHEAD, 1));
|
||||||
|
window.prints(0, 1, title_color, top);
|
||||||
|
|
||||||
|
if(msg->areakludgeid)
|
||||||
|
strxmerge(top, width+1, " ", area->echoid(), " (", msg->areakludgeid, ") ", NULL);
|
||||||
|
else
|
||||||
|
strxmerge(top, width+1, " ", area->echoid(), " ", NULL);
|
||||||
|
|
||||||
|
int taglen = strlen(top);
|
||||||
|
|
||||||
|
if((width - (desclen + taglen + 2)) > 0)
|
||||||
|
window.fill(0, desclen+1, 0, width-(taglen+1)-1, _box_table(W_BHEAD, 1), border_color|ACSET);
|
||||||
|
|
||||||
|
window.prints(0, width-taglen-1, title_color, top);
|
||||||
|
window.printc(0, width-1, border_color|ACSET, _box_table(W_BHEAD, 1));
|
||||||
|
|
||||||
// Generate message attributes string
|
// Generate message attributes string
|
||||||
char bot2[200];
|
bool attrsgenerated = false;
|
||||||
MakeAttrStr(bot2, &msg->attr);
|
MakeAttrStr(buf, width-CFG->disphdrnodeset.pos, &msg->attr);
|
||||||
int len2 = strlen(bot2);
|
if(*buf) {
|
||||||
if(len2 > width-CFG->disphdrnodeset.pos) {
|
attrsgenerated = true;
|
||||||
len2 = width-CFG->disphdrnodeset.pos;
|
strsetsz(buf, width-CFG->disphdrnodeset.pos);
|
||||||
strsetsz(bot2, len2);
|
window.prints(1, CFG->disphdrnodeset.pos, window_color, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate message number and reply links string
|
// Generate message number and reply links string
|
||||||
char bot1[200];
|
char* ptr = buf;
|
||||||
char* ptr = bot1;
|
|
||||||
int list_max = msg->link.list_max();
|
int list_max = msg->link.list_max();
|
||||||
ulong* replies = (ulong*)throw_calloc(list_max+1, sizeof(ulong));
|
ulong* replies = (ulong*)throw_calloc(list_max+1, sizeof(ulong));
|
||||||
ulong replyto, replynext;
|
ulong replyto, replynext;
|
||||||
@ -183,98 +163,106 @@ void GMsgHeaderView::Paint() {
|
|||||||
}
|
}
|
||||||
if(replyto)
|
if(replyto)
|
||||||
ptr += sprintf(ptr, " -%lu", replyto);
|
ptr += sprintf(ptr, " -%lu", replyto);
|
||||||
for(int replyn=0,plus=0; replyn<list_max+1; replyn++)
|
for(int replyn=0,plus=0; (replyn<(list_max+1)) and (not attrsgenerated or ((ptr-buf)<CFG->disphdrnodeset.pos)); replyn++)
|
||||||
if(replies[replyn])
|
if(replies[replyn])
|
||||||
ptr += sprintf(ptr, " %s%lu", (plus++?"":"+"), replies[replyn]);
|
ptr += sprintf(ptr, " %s%lu", (plus++?"":"+"), replies[replyn]);
|
||||||
if(replynext)
|
if(replynext and (not attrsgenerated or ((ptr-buf)<CFG->disphdrnodeset.pos)))
|
||||||
sprintf(ptr, " *%lu", replynext);
|
sprintf(ptr, " *%lu", replynext);
|
||||||
int len1 = strlen(bot1) - 8;
|
|
||||||
if((CFG->disphdrnameset.pos + len1) > CFG->disphdrnodeset.pos) {
|
|
||||||
if(8 + len1 + len2 > width) {
|
|
||||||
strsetsz(bot1, width-len2-1);
|
|
||||||
strtrim(bot1);
|
|
||||||
}
|
|
||||||
strcat(bot1, " ");
|
|
||||||
strcat(bot1, bot2);
|
|
||||||
*bot2 = NUL;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
strsetsz(bot1, namewidth+8);
|
|
||||||
strcat(bot1, bot2);
|
|
||||||
*bot2 = NUL;
|
|
||||||
}
|
|
||||||
strsetsz(bot1, width);
|
|
||||||
throw_free(replies);
|
throw_free(replies);
|
||||||
|
|
||||||
// Generate orig node data
|
strsetsz(buf, attrsgenerated ? CFG->disphdrnodeset.pos : width);
|
||||||
char node1[200];
|
window.prints(1, 0, window_color, buf);
|
||||||
if(msg->orig.net)
|
|
||||||
msg->orig.make_string(node1);
|
|
||||||
else
|
|
||||||
*node1 = NUL;
|
|
||||||
strsetsz(node1, nodewidth);
|
|
||||||
|
|
||||||
char date1[25] = "";
|
// Get marks
|
||||||
|
if(area->bookmark == msg->msgno)
|
||||||
|
window.prints(1, 5, highlight_color, "\x11");
|
||||||
|
if(area->Mark.Count() and area->Mark.Find(msg->msgno))
|
||||||
|
window.prints(1, 7, highlight_color, "\x10");
|
||||||
|
|
||||||
|
// Generate from info
|
||||||
|
bool nodegenerated = false;
|
||||||
|
if(not area->isinternet()) {
|
||||||
|
if(area->isecho() or not (*msg->ifrom and (*msg->realby or *msg->iorig))) {
|
||||||
|
// Generate orig node data
|
||||||
|
if(msg->orig.net)
|
||||||
|
msg->orig.make_string(buf);
|
||||||
|
else
|
||||||
|
*buf = NUL;
|
||||||
|
nodegenerated = true;
|
||||||
|
strsetsz(buf, nodewidth);
|
||||||
|
window.prints(2, CFG->disphdrnodeset.pos, from_color, buf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(not area->isecho() and *msg->ifrom and *msg->realby)
|
||||||
|
strxmerge(buf, (namewidth+nodewidth), msg->realby, " <", msg->iorig, ">", NULL);
|
||||||
|
else if(not area->isecho() and *msg->ifrom and *msg->iorig)
|
||||||
|
strxcpy(buf, msg->iorig, (namewidth+nodewidth));
|
||||||
|
else
|
||||||
|
strxcpy(buf, msg->By(), (namewidth+nodewidth));
|
||||||
|
strsetsz(buf, nodegenerated ? namewidth : (namewidth+nodewidth));
|
||||||
|
|
||||||
|
window.prints(2, 0, window_color, LNG->From);
|
||||||
|
window.prints(2, CFG->disphdrnameset.pos, ((msg->foundwhere&GFIND_FROM) or msg->attr.fmu() or (msg->attr.loc() and CFG->switches.get(displocalhigh))) ? highlight_color : from_color, buf);
|
||||||
|
|
||||||
|
if(datewidth > 0) {
|
||||||
if(msg->written)
|
if(msg->written)
|
||||||
strftimei(date1, CFG->disphdrdateset.len, LNG->DateTimeFmt, gmtime(&msg->written));
|
strftimei(buf, datewidth, LNG->DateTimeFmt, gmtime(&msg->written));
|
||||||
strsetsz(date1, datewidth);
|
else
|
||||||
|
*buf = NUL;
|
||||||
|
strsetsz(buf, datewidth);
|
||||||
|
window.prints(2, CFG->disphdrdateset.pos, from_color, buf);
|
||||||
|
}
|
||||||
|
|
||||||
// Generate dest node data
|
// Generate dest node data
|
||||||
char node2[200];
|
nodegenerated = false;
|
||||||
|
if(not area->isinternet()) {
|
||||||
|
if(area->isecho() or not (*msg->ito and (*msg->realto or *msg->idest))) {
|
||||||
if(msg->dest.net and area->isnet()) {
|
if(msg->dest.net and area->isnet()) {
|
||||||
msg->dest.make_string(node2);
|
msg->dest.make_string(buf);
|
||||||
if(msg->odest.net) {
|
if(msg->odest.net) {
|
||||||
if(msg->odest.net != msg->dest.net or msg->odest.node != msg->dest.node) {
|
if((msg->odest.net != msg->dest.net) or (msg->odest.node != msg->dest.node)) {
|
||||||
sprintf(buf, " %s %u/%u", LNG->Via, msg->odest.net, msg->odest.node);
|
sprintf(buf+strlen(buf), " %s %u/%u", LNG->Via, msg->odest.net, msg->odest.node);
|
||||||
strcat(node2, buf);
|
}
|
||||||
|
}
|
||||||
|
nodegenerated = true;
|
||||||
|
strsetsz(buf, nodewidth);
|
||||||
|
window.prints(3, CFG->disphdrnodeset.pos, to_color, buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
*node2 = NUL;
|
|
||||||
strsetsz(node2, nodewidth);
|
|
||||||
|
|
||||||
char date2[25] = "";
|
if(not area->isecho() and *msg->ito and *msg->realto)
|
||||||
|
strxmerge(buf, (namewidth+nodewidth), msg->realto, " <", msg->idest, ">", NULL);
|
||||||
|
else if(not area->isecho() and *msg->ito and *msg->idest)
|
||||||
|
strxcpy(buf, msg->idest, (namewidth+nodewidth));
|
||||||
|
else
|
||||||
|
strxcpy(buf, msg->To(), (namewidth+nodewidth));
|
||||||
|
strsetsz(buf, nodegenerated ? namewidth : (namewidth+nodewidth));
|
||||||
|
|
||||||
|
window.prints(3, 0, window_color, LNG->To);
|
||||||
|
window.prints(3, CFG->disphdrnameset.pos, ((msg->foundwhere&GFIND_TO) or msg->attr.tou()) ? highlight_color : to_color, buf);
|
||||||
|
|
||||||
|
if(datewidth > 0) {
|
||||||
if(msg->arrived)
|
if(msg->arrived)
|
||||||
strftimei(date2, CFG->disphdrdateset.len, LNG->DateTimeFmt, gmtime(&msg->arrived));
|
strftimei(buf, datewidth, LNG->DateTimeFmt, gmtime(&msg->arrived));
|
||||||
strsetsz(date2, datewidth);
|
else
|
||||||
|
*buf = NUL;
|
||||||
|
strsetsz(buf, datewidth);
|
||||||
|
window.prints(3, CFG->disphdrdateset.pos, to_color, buf);
|
||||||
|
}
|
||||||
|
|
||||||
// Generate subjectline
|
// Generate subjectline
|
||||||
char subj[200], lngsubj[10];
|
strxcpy(buf, (msg->attr.att() or msg->attr.frq() or msg->attr.urq()) ? LNG->File : LNG->Subj, 10);
|
||||||
strcpy(lngsubj, (msg->attr.att() or msg->attr.frq() or msg->attr.urq()) ? LNG->File : LNG->Subj);
|
int lngsubjlen = strlen(buf);
|
||||||
strxcpy(subj, msg->re, sizeof(subj));
|
window.prints(4, 0, window_color, buf);
|
||||||
strsetsz(subj, width-strlen(lngsubj));
|
|
||||||
|
|
||||||
// Paint the total header in the window
|
strxcpy(buf, msg->re, width-lngsubjlen);
|
||||||
vchar borderchar[2] = { (vchar)' ', 0 };
|
strsetsz(buf, width-lngsubjlen);
|
||||||
*borderchar = _box_table(W_BHEAD, 1);
|
window.prints(4, lngsubjlen, (msg->foundwhere&GFIND_SUBJECT) ? highlight_color : subject_color, buf);
|
||||||
window.printvs(0, 0, border_color|ACSET, borderchar);
|
|
||||||
window.prints(0, 1, title_color, top1);
|
// Generate bottom line
|
||||||
window.printvs(0, strlen(top1)+1, border_color|ACSET, headerline+strlen(top1)+strlen(top2)-2);
|
window.fill(5, 0, 5, width-1, _box_table(W_BHEAD, 1), border_color|ACSET);
|
||||||
window.prints(0, width-strlen(top2)-1, title_color, top2);
|
|
||||||
window.printvs(0, width-1, border_color|ACSET, borderchar);
|
|
||||||
window.printvs(5, 0, border_color|ACSET, headerline);
|
|
||||||
window.prints(1, 0, window_color, bot1);
|
|
||||||
if(bookmark)
|
|
||||||
window.prints(1, 5, highlight_color, "\x11");
|
|
||||||
if(markmark)
|
|
||||||
window.prints(1, 7, highlight_color, "\x10");
|
|
||||||
if(*bot2)
|
|
||||||
window.prints(1, CFG->disphdrnodeset.pos, window_color, bot2);
|
|
||||||
window.prints(2, 0, window_color, LNG->From);
|
|
||||||
window.prints(2, CFG->disphdrnameset.pos, ((msg->foundwhere&GFIND_FROM) or msg->attr.fmu() or (msg->attr.loc() and CFG->switches.get(displocalhigh))) ? highlight_color : from_color, whofrom);
|
|
||||||
window.prints(3, 0, window_color, LNG->To);
|
|
||||||
window.prints(3, CFG->disphdrnameset.pos, ((msg->foundwhere&GFIND_TO) or msg->attr.tou()) ? highlight_color : to_color, whoto);
|
|
||||||
if(not area->isinternet()) {
|
|
||||||
if(area->isecho() or not (*msg->ifrom and (*msg->realby or *msg->iorig)))
|
|
||||||
window.prints(2, CFG->disphdrnodeset.pos, from_color, node1);
|
|
||||||
if(area->isecho() or not (*msg->ito and (*msg->realto or *msg->idest)))
|
|
||||||
window.prints(3, CFG->disphdrnodeset.pos, to_color, node2);
|
|
||||||
}
|
|
||||||
window.prints(2, CFG->disphdrdateset.pos, from_color, date1);
|
|
||||||
window.prints(3, CFG->disphdrdateset.pos, to_color, date2);
|
|
||||||
window.prints(4, 0, window_color, lngsubj);
|
|
||||||
window.prints(4, strlen(lngsubj), (msg->foundwhere&GFIND_SUBJECT) ? highlight_color : subject_color, subj);
|
|
||||||
|
|
||||||
// Calculate attach file sizes
|
// Calculate attach file sizes
|
||||||
if(msg->attr.att()) {
|
if(msg->attr.att()) {
|
||||||
@ -292,18 +280,18 @@ void GMsgHeaderView::Paint() {
|
|||||||
sprintf(buf2, "%s%s", CFG->inboundpath, ptr);
|
sprintf(buf2, "%s%s", CFG->inboundpath, ptr);
|
||||||
long sz = GetFilesize(MapPath(buf2));
|
long sz = GetFilesize(MapPath(buf2));
|
||||||
if(sz == -1)
|
if(sz == -1)
|
||||||
sprintf(subj, " %s ", LNG->n_a);
|
sprintf(buf1, " %s ", LNG->n_a);
|
||||||
else {
|
else {
|
||||||
switch(CFG->dispattachsize) {
|
switch(CFG->dispattachsize) {
|
||||||
case ATTACH_BYTES:
|
case ATTACH_BYTES:
|
||||||
sprintf(subj, " %li ", sz);
|
sprintf(buf1, " %li ", sz);
|
||||||
break;
|
break;
|
||||||
case ATTACH_KBYTES:
|
case ATTACH_KBYTES:
|
||||||
sprintf(subj, " %lik ", (sz+512L)/1024L);
|
sprintf(buf1, " %lik ", (sz+512L)/1024L);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
window.prints(5, begpos+int(ptr-buf)-1, title_color, subj);
|
window.prints(5, begpos+int(ptr-buf)-1, title_color, buf1);
|
||||||
ptr = strtok(NULL, " ");
|
ptr = strtok(NULL, " ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -313,19 +301,19 @@ void GMsgHeaderView::Paint() {
|
|||||||
uint len = strlen(msg->txt);
|
uint len = strlen(msg->txt);
|
||||||
switch(CFG->dispmsgsize) {
|
switch(CFG->dispmsgsize) {
|
||||||
case DISPMSGSIZE_BYTES:
|
case DISPMSGSIZE_BYTES:
|
||||||
sprintf(subj, "%u", len);
|
sprintf(buf1, "%u", len);
|
||||||
break;
|
break;
|
||||||
case DISPMSGSIZE_KBYTES:
|
case DISPMSGSIZE_KBYTES:
|
||||||
sprintf(subj, "%uk", (len+512)/1024);
|
sprintf(buf1, "%uk", (len+512)/1024);
|
||||||
break;
|
break;
|
||||||
case DISPMSGSIZE_KBYTES+1:
|
case DISPMSGSIZE_LINES:
|
||||||
sprintf(subj, "%u", msg->lines);
|
sprintf(buf1, "%u", msg->lines);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
*subj = NUL;
|
*buf1 = NUL;
|
||||||
}
|
}
|
||||||
if(*subj)
|
if(*buf1)
|
||||||
window.prints(5, 1, title_color, subj);
|
window.prints(5, 1, title_color, buf1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,11 +38,14 @@
|
|||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
// Define portability and shorthand notation
|
// Define portability and shorthand notation
|
||||||
|
|
||||||
|
// GCC after 2.95.x have "and", "not", and "or" predefined
|
||||||
|
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
|
||||||
#ifndef and
|
#ifndef and
|
||||||
#define not !
|
#define not !
|
||||||
#define and &&
|
#define and &&
|
||||||
#define or ||
|
#define or ||
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef true
|
#ifndef true
|
||||||
#define true 1
|
#define true 1
|
||||||
|
@ -1189,7 +1189,7 @@ gkey kbxget_raw(int mode) {
|
|||||||
|
|
||||||
if(alt_pressed)
|
if(alt_pressed)
|
||||||
special_key = is_numpad_key(inp); // Alt-<numpad key>
|
special_key = is_numpad_key(inp); // Alt-<numpad key>
|
||||||
else if(not gkbd_nt and not (CKS & ENHANCED_KEY) and (ascii and not ctrl_pressed) and not (iscntrl(ascii) and shift_pressed))
|
else if(not gkbd_nt and not (CKS & ENHANCED_KEY) and not (VKC == VK_CLEAR) and (ascii and not ctrl_pressed) and not (iscntrl(ascii) and shift_pressed))
|
||||||
special_key = true; // It is alphanumeric key under Win9x
|
special_key = true; // It is alphanumeric key under Win9x
|
||||||
if(special_key) {
|
if(special_key) {
|
||||||
ReadConsole(gkbd_hin, &ascii, 1, &nread, NULL);
|
ReadConsole(gkbd_hin, &ascii, 1, &nread, NULL);
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <gdefs.h>
|
#include <gdefs.h>
|
||||||
|
#include <gstrall.h>
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
@ -484,7 +485,7 @@ typedef ftn_attr Attr;
|
|||||||
|
|
||||||
inline void AttrAdd(Attr* a, Attr* b) { a->add(*b); }
|
inline void AttrAdd(Attr* a, Attr* b) { a->add(*b); }
|
||||||
inline void GetAttribstr(Attr* attr, const char* attrs) { attr->get(attrs); }
|
inline void GetAttribstr(Attr* attr, const char* attrs) { attr->get(attrs); }
|
||||||
inline char* MakeAttrStr(char* str, const Attr* attr) { string tmp; attr->make_string(tmp); strcpy(str, tmp.c_str()); return str; }
|
inline char* MakeAttrStr(char* str, size_t maxlen, const Attr* attr) { string tmp; attr->make_string(tmp); strxcpy(str, tmp.c_str(), maxlen); return str; }
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
@ -1204,10 +1204,16 @@ vatch vgetw(int row, int col) {
|
|||||||
|
|
||||||
void vgetc(int row, int col, int* atr, vchar* chr) {
|
void vgetc(int row, int col, int* atr, vchar* chr) {
|
||||||
|
|
||||||
|
if((row < 0) || (row > gvid->numrows-1) || (col < 0) || (col > gvid->numcols-1)) {
|
||||||
|
*chr = ' ';
|
||||||
|
*atr = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
vatch tmp = vgetw(row, col);
|
vatch tmp = vgetw(row, col);
|
||||||
|
|
||||||
*chr = vgchar(tmp);
|
*chr = vgchar(tmp);
|
||||||
*atr = vgattr(tmp);
|
*atr = vgattr(tmp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user