Warning fixes
This commit is contained in:
parent
c57e3b2863
commit
f79327b384
@ -25,7 +25,8 @@ assistance!
|
|||||||
14. € § 祬 ¬¥ íâ®â <censored> । ªâ®à 㦥? “ Ž¤¨ ¡ë«® «ãçè¥!
|
14. € § 祬 ¬¥ íâ®â <censored> । ªâ®à 㦥? “ Ž¤¨ ¡ë«® «ãçè¥!
|
||||||
15. € ¢®â ï å®çã «®£ MCITY ¢áâ஥ë©.
|
15. € ¢®â ï å®çã «®£ MCITY ¢áâ஥ë©.
|
||||||
16. $^%$^*! —â® âë ᤥ« « á á®åà ¥¨¥¬ á®®¡é¥¨© ¢ 1.1.5?
|
16. $^%$^*! —â® âë ᤥ« « á á®åà ¥¨¥¬ á®®¡é¥¨© ¢ 1.1.5?
|
||||||
17. ’¨¯ íâ ... € ¯¨á âì ªã¤ ¢â®àã? ;-)
|
17. <20>®á«¥ ãáâ ®¢ª¨ GoldED+ ã ¬¥ï ç «¨ à §¤ ¢ âìáï áâ㪨 ¨§-¯®¤ ¯®« .
|
||||||
|
18. ’¨¯ íâ ... € ¯¨á âì ªã¤ ¢â®àã? ;-)
|
||||||
|
|
||||||
>==============================================================================
|
>==============================================================================
|
||||||
|
|
||||||
@ -39,11 +40,16 @@ assistance!
|
|||||||
¥¯à ¢¨«ì®¥.
|
¥¯à ¢¨«ì®¥.
|
||||||
*A:* —⮡ë GoldED+ £«î稫 ¯®¬¥ìè¥, ¤® áâநâì ॣ¨® «ìë¥ ãáâ ®¢ª¨:
|
*A:* —⮡ë GoldED+ £«î稫 ¯®¬¥ìè¥, ¤® áâநâì ॣ¨® «ìë¥ ãáâ ®¢ª¨:
|
||||||
¤«ï DPMI32: country.sys, ¯¥à¥¬¥ ï TZ
|
¤«ï DPMI32: country.sys, ¯¥à¥¬¥ ï TZ
|
||||||
¤«ï Win32: control panel
|
¤«ï Win32: control panel, ¯¥à¥¬¥ ï TZ
|
||||||
¤«ï OS/2: [¥ § î £¤¥ áâà ¨¢ ¥âáï, ® ॣ¨® «ìë¥ áâனª¨ - ᢮¨],
|
¤«ï OS/2: [¥ § î £¤¥ áâà ¨¢ ¥âáï, ® ॣ¨® «ìë¥ áâனª¨ - ᢮¨],
|
||||||
¯¥à¥¬¥ ï TZ
|
¯¥à¥¬¥ ï TZ
|
||||||
¤«ï UNIX: ¯¥à¥¬¥ë¥ LANG ¨ TZ.
|
¤«ï UNIX: ¯¥à¥¬¥ë¥ LANG ¨ TZ.
|
||||||
|
|
||||||
|
‚<>ˆŒ€<C592>ˆ…: â®, çâ® GoldED+/w32 ¯®ª §ë¢ ¥â ¥¯à ¢¨«ì®¥ ¢à¥¬ï ¤¢¥ ¥¤¥«¨ ¢
|
||||||
|
£®¤ã ¥ ï¥âáï ¡ £®¬ GoldED+, íâ® ¯à®¡«¥¬ CRTDLL.DLL, ¯®áâ ¢«ï¥¬®£®
|
||||||
|
ä¨à¬®© Microsoft ¢ á®áâ ¢¥ ¢ 襩 ®¯¥à 樮®© á¨á⥬ë. Ž¡à â¨â¥áì ª
|
||||||
|
¯à®¨§¢®¤¨â¥«î ¢ 襩 Ž‘ á ¯à®áì¡®© ¨á¯à ¢¨âì íâ㠮訡ªã.
|
||||||
|
|
||||||
*Q:* € ª ª ¦¥ ¢á¥-â ª¨ ¯à ¢¨«ì® ¬¥ïâì SoftCR ¯à¨ ¡®à¥ ¨ ¨¬¥âì á í⨬
|
*Q:* € ª ª ¦¥ ¢á¥-â ª¨ ¯à ¢¨«ì® ¬¥ïâì SoftCR ¯à¨ ¡®à¥ ¨ ¨¬¥âì á í⨬
|
||||||
¬¥ìè¥ ¢á¥£® ¯à®¡«¥¬?
|
¬¥ìè¥ ¢á¥£® ¯à®¡«¥¬?
|
||||||
*A:* —â®¡ë § ¬¥ïâì SoftCR (¤«ï ç ©¨ª®¢ - íâ® ¡®«ìè ï àãááª ï ¡ãª¢ "H")
|
*A:* —â®¡ë § ¬¥ïâì SoftCR (¤«ï ç ©¨ª®¢ - íâ® ¡®«ìè ï àãááª ï ¡ãª¢ "H")
|
||||||
@ -136,6 +142,10 @@ assistance!
|
|||||||
ª á®åà ¥¨î ⥫ á®®¡é¥¨ï, ® § 祬 ®® ¬®¦¥â ¯® ¤®¡¨âìáï ï ¥
|
ª á®åà ¥¨î ⥫ á®®¡é¥¨ï, ® § 祬 ®® ¬®¦¥â ¯® ¤®¡¨âìáï ï ¥
|
||||||
¯à¨¤ã¬ «. <20> §¢¥ çâ® ®¯¨á âì ¯¥à¢ãî áâà®çªã ª ª @write ;)
|
¯à¨¤ã¬ «. <20> §¢¥ çâ® ®¯¨á âì ¯¥à¢ãî áâà®çªã ª ª @write ;)
|
||||||
|
|
||||||
|
*Q:* <20>®á«¥ ãáâ ®¢ª¨ GoldED+ ã ¬¥ï ç «¨ à §¤ ¢ âìáï áâ㪨 ¨§-¯®¤ ¯®« .
|
||||||
|
*A:* Žâªà®©â¥ ¯®£à¥¡ ¨ ¯®á¬®âà¨â¥, ¬®¦¥â ¡ëâì ã ¯ à⨧ , á¯àïâ ëå ¢ 訬
|
||||||
|
¤¥¤®¬ ¢® ¢à¥¬ï ¢®©ë, ª®ç¨«¨áì ¯à®¤ãªâë.
|
||||||
|
|
||||||
*Q:* ’¨¯ íâ ... € ¯¨á âì ªã¤ ¢â®àã? ;-)
|
*Q:* ’¨¯ íâ ... € ¯¨á âì ªã¤ ¢â®àã? ;-)
|
||||||
*A:* <20>¨á âì «ãçè¥ ¢á¥£® ¢ Ru.GoldED. „ ¦¥ «ãçè¥ á ç « ¥£® ¯®ç¨â âì, ¤®¦¤ âìáï
|
*A:* <20>¨á âì «ãçè¥ ¢á¥£® ¢ Ru.GoldED. „ ¦¥ «ãçè¥ á ç « ¥£® ¯®ç¨â âì, ¤®¦¤ âìáï
|
||||||
¬¥á⮣® FAQ, ¡ £«¨áâ ¨ ⮫쪮 ¯®â®¬ ¯¨á âì. …᫨ ã¦ á¨«ì® ¯à¨á¯¨ç¨â, â®
|
¬¥á⮣® FAQ, ¡ £«¨áâ ¨ ⮫쪮 ¯®â®¬ ¯¨á âì. …᫨ ã¦ á¨«ì® ¯à¨á¯¨ç¨â, â®
|
||||||
|
@ -277,7 +277,7 @@ void CfgScreensize() {
|
|||||||
}
|
}
|
||||||
else if(CFG->screensize == 0) {
|
else if(CFG->screensize == 0) {
|
||||||
if(strnieql(val, "Mode", 4)) {
|
if(strnieql(val, "Mode", 4)) {
|
||||||
sscanf(val+4, " %x", &CFG->screensize);
|
sscanf(val+4, " %x", (uint *)&CFG->screensize);
|
||||||
CFG->screensize <<= 8;
|
CFG->screensize <<= 8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -204,7 +204,7 @@ int TemplateToText(int mode, GMsg* msg, GMsg* oldmsg, const char* tpl, int origa
|
|||||||
}
|
}
|
||||||
if(strieql(tplfile, "built-in") or not fexist(tplfile) or CFG->tpl.empty()) {
|
if(strieql(tplfile, "built-in") or not fexist(tplfile) or CFG->tpl.empty()) {
|
||||||
tmptpl = YES; // Create a temporary template
|
tmptpl = YES; // Create a temporary template
|
||||||
mktemp(strcpy(tplfile, AddPath(CFG->templatepath, "GDXXXXXX")));
|
mktemp(strcpy(tplfile, AddPath(CFG->goldpath, "GDXXXXXX")));
|
||||||
fp = fsopen(tplfile, "wt", CFG->sharemode);
|
fp = fsopen(tplfile, "wt", CFG->sharemode);
|
||||||
if(fp) {
|
if(fp) {
|
||||||
fputs("@header= @oecho (@caddr) @align{79}{=}\n", fp);
|
fputs("@header= @oecho (@caddr) @align{79}{=}\n", fp);
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
char* CvtPrnstr(char* str, char* prn) {
|
char* CvtPrnstr(char* str, char* prn) {
|
||||||
|
|
||||||
int value;
|
uint value;
|
||||||
byte len=0;
|
byte len=0;
|
||||||
char buf[256];
|
char buf[256];
|
||||||
char* ptr=prn;
|
char* ptr=prn;
|
||||||
@ -54,8 +54,8 @@ char* CvtPrnstr(char* str, char* prn) {
|
|||||||
break;
|
break;
|
||||||
case '#':
|
case '#':
|
||||||
ptr++;
|
ptr++;
|
||||||
value = atoi(ptr);
|
value = (byte)atoi(ptr);
|
||||||
buf[len++] = (byte)value;
|
buf[len++] = value;
|
||||||
while(isdigit(*ptr) and *ptr)
|
while(isdigit(*ptr) and *ptr)
|
||||||
ptr++;
|
ptr++;
|
||||||
break;
|
break;
|
||||||
|
@ -148,7 +148,7 @@ void gareafile::replace_slashes(char **key) {
|
|||||||
if(*p == '\\') {
|
if(*p == '\\') {
|
||||||
|
|
||||||
int size = 1;
|
int size = 1;
|
||||||
int chr = p[1];
|
uint chr = p[1];
|
||||||
|
|
||||||
if(isxdigit(p[1])) {
|
if(isxdigit(p[1])) {
|
||||||
if(isxdigit(p[2])) {
|
if(isxdigit(p[2])) {
|
||||||
|
@ -906,7 +906,7 @@ Line* SMBArea::make_dump_msg(Line*& lin, gmsg* msg, char* lng_head)
|
|||||||
line = AddLineF(line, "Written : %s", buf);
|
line = AddLineF(line, "Written : %s", buf);
|
||||||
stpcpy(buf, ctime((time_t *)&smsg.hdr.when_imported.time))[-1] = NUL;
|
stpcpy(buf, ctime((time_t *)&smsg.hdr.when_imported.time))[-1] = NUL;
|
||||||
line = AddLineF(line, "Imported : %s", buf);
|
line = AddLineF(line, "Imported : %s", buf);
|
||||||
line = AddLineF(line, "Number : %ld (%ld)", smsg.hdr.number, ftell(data->sid_fp) / sizeof(idxrec_t));
|
line = AddLineF(line, "Number : %ld (%ld)", smsg.hdr.number, (long)(ftell(data->sid_fp)/sizeof(idxrec_t)));
|
||||||
line = AddLineF(line, "Thread orig : %ld", smsg.hdr.thread_orig);
|
line = AddLineF(line, "Thread orig : %ld", smsg.hdr.thread_orig);
|
||||||
line = AddLineF(line, "Thread next : %ld", smsg.hdr.thread_next);
|
line = AddLineF(line, "Thread next : %ld", smsg.hdr.thread_next);
|
||||||
line = AddLineF(line, "Thread first : %ld", smsg.hdr.thread_first);
|
line = AddLineF(line, "Thread first : %ld", smsg.hdr.thread_first);
|
||||||
|
@ -487,6 +487,7 @@ _FP_fgets (char *buf, int n, FILE *stream)
|
|||||||
return obp;
|
return obp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
/*
|
/*
|
||||||
* A replacement strerror function that just returns the error code
|
* A replacement strerror function that just returns the error code
|
||||||
*/
|
*/
|
||||||
@ -510,3 +511,4 @@ _FP_tempnam (char *dir, char *pfx)
|
|||||||
{
|
{
|
||||||
return _FP_strdup (tmpnam (NULL));
|
return _FP_strdup (tmpnam (NULL));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -51,8 +51,10 @@ char * TOOLEXPORT _FP_fgets _ANSI_ARGS_((char *, int, FILE *));
|
|||||||
char * TOOLEXPORT _FP_strpbrk _ANSI_ARGS_((char *, char *));
|
char * TOOLEXPORT _FP_strpbrk _ANSI_ARGS_((char *, char *));
|
||||||
char * TOOLEXPORT _FP_strtok _ANSI_ARGS_((char *, char *));
|
char * TOOLEXPORT _FP_strtok _ANSI_ARGS_((char *, char *));
|
||||||
char * TOOLEXPORT _FP_cutdir _ANSI_ARGS_((char *));
|
char * TOOLEXPORT _FP_cutdir _ANSI_ARGS_((char *));
|
||||||
|
#if 0
|
||||||
char * TOOLEXPORT _FP_strerror _ANSI_ARGS_((int));
|
char * TOOLEXPORT _FP_strerror _ANSI_ARGS_((int));
|
||||||
char * TOOLEXPORT _FP_tempnam _ANSI_ARGS_((char *, char *));
|
char * TOOLEXPORT _FP_tempnam _ANSI_ARGS_((char *, char *));
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
// The Goldware Utilities.
|
// The Goldware Utilities.
|
||||||
// Copyright (C) 1990-1999 Odinn Sorensen
|
// Copyright (C) 1990-1999 Odinn Sorensen
|
||||||
// Copyright (C) 1999-2000 Alexander S. Aganichev
|
// Copyright (C) 1999-2001 Alexander S. Aganichev
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
// This program is free software; you can redistribute it and/or
|
// This program is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU General Public License as
|
// modify it under the terms of the GNU General Public License as
|
||||||
@ -42,6 +42,7 @@
|
|||||||
#include <gdirposx.h>
|
#include <gdirposx.h>
|
||||||
#include <gutlos.h>
|
#include <gutlos.h>
|
||||||
#include <glog.h>
|
#include <glog.h>
|
||||||
|
#include <iomanip>
|
||||||
|
|
||||||
//#define GOLDNODE_STATS 1
|
//#define GOLDNODE_STATS 1
|
||||||
|
|
||||||
@ -128,16 +129,11 @@ struct nl_stat {
|
|||||||
nl_stat statistic;
|
nl_stat statistic;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
|
||||||
|
|
||||||
#define fast_printf if(not quiet) printf
|
|
||||||
#define fast_putchar if(not quiet) putchar
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
// Display a "twirly"
|
// Display a "twirly"
|
||||||
|
|
||||||
#define TWIRLY_FACTOR 511
|
#define TWIRLY_FACTOR 511
|
||||||
#define ISTWIRLY(n) (((n)&TWIRLY_FACTOR)==0)
|
#define ISTWIRLY(n) (not quiet and (((n)&TWIRLY_FACTOR)==0))
|
||||||
|
|
||||||
static void twirly() {
|
static void twirly() {
|
||||||
|
|
||||||
@ -145,14 +141,11 @@ static void twirly() {
|
|||||||
|
|
||||||
n = (++n)%4;
|
n = (++n)%4;
|
||||||
switch(n) {
|
switch(n) {
|
||||||
case 0: fast_putchar('|'); break;
|
case 0: cout << "|\b" << flush; break;
|
||||||
case 1: fast_putchar('/'); break;
|
case 1: cout << "/\b" << flush; break;
|
||||||
case 2: fast_putchar('-'); break;
|
case 2: cout << "-\b" << flush; break;
|
||||||
case 3: fast_putchar('\\'); break;
|
case 3: cout << "\\\b" << flush; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fast_putchar('\b');
|
|
||||||
fflush(stdout);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -467,17 +460,17 @@ static char* CvtName(char* inp) {
|
|||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
#ifdef GOLDNODE_STATS
|
#ifdef GOLDNODE_STATS
|
||||||
void calc_statistic(FILE* ofp, int* observation, float N) {
|
void calc_statistic(ofstream &ofp, int* observation, float N) {
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
float mean = 0.0;
|
float mean = 0.0;
|
||||||
float sumfrekvens = 0.0;
|
float sumfrekvens = 0.0;
|
||||||
float varians = 0.0;
|
float varians = 0.0;
|
||||||
|
|
||||||
// 12 12345 12345 123456 123456789012
|
// 12 12345 12345 123456 123456789012
|
||||||
fprintf(ofp, ".---------------------------------------------.\n");
|
ofp << ".---------------------------------------------." << endl
|
||||||
fprintf(ofp, "| x | h(x) | f(x) | x*f(x) | (x-m)^2*f(x) |\n");
|
<< "| x | h(x) | f(x) | x*f(x) | (x-m)^2*f(x) |" << endl
|
||||||
fprintf(ofp, "|-----+-------+-------+--------+--------------|\n");
|
<< "|-----+-------+-------+--------+--------------|" << endl;
|
||||||
|
|
||||||
for(i=0; i<100; i++) {
|
for(i=0; i<100; i++) {
|
||||||
float x = i;
|
float x = i;
|
||||||
@ -496,18 +489,18 @@ void calc_statistic(FILE* ofp, int* observation, float N) {
|
|||||||
float frekvens = hyppighed / N;
|
float frekvens = hyppighed / N;
|
||||||
float vartmp = (x-mean)*(x-mean)*frekvens;
|
float vartmp = (x-mean)*(x-mean)*frekvens;
|
||||||
varians += vartmp;
|
varians += vartmp;
|
||||||
fprintf(ofp, "| %3i | %5i | %5.3f | %6.3f | %12.3f | \n", i, observation[i], frekvens, x*frekvens, vartmp);
|
ofp << "| " << setw(3) << i << " | " << setw(5) << observation[i] << " | " << setprecision(3) << setw(5) << frekvens << " | " << setw(6) << x*frekvens << " | " << setw(12) << vartmp << " | " << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(ofp, "|-----+-------+-------+--------+--------------|\n");
|
ofp << "|-----+-------+-------+--------+--------------|" << endl
|
||||||
fprintf(ofp, "| sum | %5.0f | %5.3f | %5.3f | %12.3f |\n", N, sumfrekvens, mean, varians);
|
<< "| sum | " << setprecision(0) << setw(5) << N << " | " << setprecision(3) << setw(5) << sumfrekvens << " | " << setw(5) << mean << " | " << setw(12) << varians << " |" << endl
|
||||||
fprintf(ofp, "`---------------------------------------------'\n");
|
<< "`---------------------------------------------'" << endl
|
||||||
fprintf(ofp, "\n");
|
<< endl
|
||||||
fprintf(ofp, "Mean: %.1f\n", mean);
|
<< "Mean: " << setprecision(1) << mean << endl
|
||||||
fprintf(ofp, "Variance = %.1f\n", varians);
|
<< "Variance = " << varians << endl
|
||||||
fprintf(ofp, "Standard deviation = %.1f\n", sqrt(varians));
|
<< "Standard deviation = " << sqrt(varians) << endl
|
||||||
fprintf(ofp, "\n");
|
<< endl;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -555,7 +548,7 @@ static void read_nodelists() {
|
|||||||
|
|
||||||
nodes = 0;
|
nodes = 0;
|
||||||
|
|
||||||
fast_printf("\n* Compiling nodelists:\n");
|
if(not quiet) cout << endl << "* Compiling nodelists:" << endl;
|
||||||
|
|
||||||
// Delete the current indexfiles so they don't take up space
|
// Delete the current indexfiles so they don't take up space
|
||||||
remove(addrindex.c_str());
|
remove(addrindex.c_str());
|
||||||
@ -597,7 +590,10 @@ static void read_nodelists() {
|
|||||||
ptr = buf+llen-1;
|
ptr = buf+llen-1;
|
||||||
while(llen and not (*ptr == '\r' or *ptr == '\n' or *ptr == '\x1A')) {
|
while(llen and not (*ptr == '\r' or *ptr == '\n' or *ptr == '\x1A')) {
|
||||||
buf[llen] = ' ';
|
buf[llen] = ' ';
|
||||||
fast_printf("\r* |-%-12s Warning line %u - Invalid NUL char encountered.\n", name, line);
|
if(not quiet) {
|
||||||
|
int len = 16-strlen(name);
|
||||||
|
cout << "\r* |--" << name << setw((len > 0) ? len : 1) << " " << "Warning line " << line << " - Invalid NUL char encountered." << endl;
|
||||||
|
}
|
||||||
llen = strlen(buf);
|
llen = strlen(buf);
|
||||||
ptr = buf+llen-1;
|
ptr = buf+llen-1;
|
||||||
}
|
}
|
||||||
@ -688,7 +684,8 @@ static void read_nodelists() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(ISTWIRLY(no)) {
|
if(ISTWIRLY(no)) {
|
||||||
fast_printf("\r* \\--%-12s Zone %-5u Net %-5u Nodes %6lu", name, nlst.addr.zone, nlst.addr.net, (ulong)no);
|
int len = 16-strlen(name);
|
||||||
|
cout << "\r* \\--" << name << setw((len > 0) ? len : 1) << " " << "Zone " << nlst.addr.zone << "\tNet " << nlst.addr.net << "\tNodes " << (ulong)no << flush;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool include = true;
|
bool include = true;
|
||||||
@ -733,20 +730,16 @@ static void read_nodelists() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fast_printf("\r* %c--%-12s Nodes read: %6lu Total read: %6lu", fno==nodelist.end()-1?'\\':'|', name, (ulong)no, (ulong)nodes);
|
if(not quiet) {
|
||||||
|
int len = 16-strlen(name);
|
||||||
if(nodes >= maxnodes) {
|
cout << "\r* " << ((fno == nodelist.end()-1) ? '\\' : '|') << "--" << name << setw((len > 0) ? len : 1) << " " << "Nodes read: " << (ulong)no << "\tTotal read: " << (ulong)nodes << ((nodes >= maxnodes) ? " (Limit reached)" : " ") << endl;
|
||||||
fast_printf(" (Limit reached)\n");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
fast_printf(" \n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(lfp);
|
fclose(lfp);
|
||||||
++realfno;
|
++realfno;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fast_printf("Error Opening nodelist %s!\n", fno->fn);
|
if(not quiet) cout << "Error opening nodelist " << fno->fn << '!' << endl;
|
||||||
*(fno->fn) = NUL;
|
*(fno->fn) = NUL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -754,7 +747,7 @@ static void read_nodelists() {
|
|||||||
|
|
||||||
// Compile userlists
|
// Compile userlists
|
||||||
if(userlist.size()) {
|
if(userlist.size()) {
|
||||||
fast_printf("\n* Compiling userlists:\n");
|
if(not quiet) cout << endl << "* Compiling userlists:" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(fno=userlist.begin(), zno=userzone.begin(); fno != userlist.end() and nodes < maxnodes; fno++, zno++) {
|
for(fno=userlist.begin(), zno=userzone.begin(); fno != userlist.end() and nodes < maxnodes; fno++, zno++) {
|
||||||
@ -819,8 +812,10 @@ static void read_nodelists() {
|
|||||||
|
|
||||||
if(include) { // Address was okay
|
if(include) { // Address was okay
|
||||||
|
|
||||||
if(ISTWIRLY(nodes))
|
if(ISTWIRLY(nodes)) {
|
||||||
fast_printf("\r* \\--%s: %6lu", name, (ulong)nodes);
|
int len = 16-strlen(name);
|
||||||
|
cout << "\r* \\--" << name << setw((len > 0) ? len : 1) << " " << "Nodes: " << (ulong)nodes << flush;
|
||||||
|
}
|
||||||
|
|
||||||
// Indicate userlist
|
// Indicate userlist
|
||||||
nlst.pos = (long)0xFFFFFFFFL;
|
nlst.pos = (long)0xFFFFFFFFL;
|
||||||
@ -839,40 +834,36 @@ static void read_nodelists() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fast_printf("\r* %c--%-12s Nodes read: %6lu Total read: %6lu", fno==userlist.end()-1?'\\':'|', name, (ulong)no, (ulong)nodes);
|
if(not quiet) {
|
||||||
|
int len = 16-strlen(name);
|
||||||
if(nodes >= maxnodes) {
|
cout << "\r* " << ((fno == userlist.end()-1) ? '\\' : '|') << "--" << name << setw((len > 0) ? len : 1) << " " << "Nodes read: " << (ulong)no << "\tTotal read: " << (ulong)nodes << ((nodes >= maxnodes) ? " (Limit reached)" : " ") << endl;
|
||||||
fast_printf(" (Limit reached)\n");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
fast_printf(" \n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(lfp);
|
fclose(lfp);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fast_printf("Error Opening Userlist %s!\n", fno->fn);
|
if(not quiet) cout << "Error opening userlist " << fno->fn << '!' << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GOLDNODE_STATS
|
#ifdef GOLDNODE_STATS
|
||||||
if(make_stats) {
|
if(make_stats) {
|
||||||
|
|
||||||
fast_printf("* Writing statistics to %s\n", statfilename);
|
if(not quiet) cout << "* Writing statistics to " << statfilename << endl;
|
||||||
|
|
||||||
FILE *ofp = fopen(statfilename, "wt");
|
ofstream ofp(statfilename);
|
||||||
if(ofp) {
|
if(not ofp) {
|
||||||
|
if(not quiet) cout << "Error opening statfile " << statfilename << '!' << endl;
|
||||||
fprintf(ofp, "Nodename size statistics:\n");
|
}
|
||||||
|
else
|
||||||
|
ofp << "Nodename size statistics:" << endl;
|
||||||
calc_statistic(ofp, statistic.nodename, nodes);
|
calc_statistic(ofp, statistic.nodename, nodes);
|
||||||
|
|
||||||
fprintf(ofp, "\nLocation size statistics:\n");
|
ofp << endl << "Location size statistics:" << endl;
|
||||||
calc_statistic(ofp, statistic.location, nodes);
|
calc_statistic(ofp, statistic.location, nodes);
|
||||||
|
|
||||||
fprintf(ofp, "\nSysopname size statistics:\n");
|
ofp << endl << "Sysopname size statistics:" << endl;
|
||||||
calc_statistic(ofp, statistic.sysopname, nodes);
|
calc_statistic(ofp, statistic.sysopname, nodes);
|
||||||
|
|
||||||
fclose(ofp);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -883,7 +874,7 @@ static void read_nodelists() {
|
|||||||
map<long, dword> namepos;
|
map<long, dword> namepos;
|
||||||
|
|
||||||
// Sort by name
|
// Sort by name
|
||||||
fast_printf("\n* Sorting by name ");
|
if(not quiet) cout << endl << "* Sorting by name " << flush;
|
||||||
nodeidx.sort(cmp_nnlsts);
|
nodeidx.sort(cmp_nnlsts);
|
||||||
|
|
||||||
// Write the name-sorted .GXN
|
// Write the name-sorted .GXN
|
||||||
@ -894,11 +885,11 @@ static void read_nodelists() {
|
|||||||
if(fidouser)
|
if(fidouser)
|
||||||
fido = fsopen(fidouserlst, "wt", sh_mod);
|
fido = fsopen(fidouserlst, "wt", sh_mod);
|
||||||
if(fido == NULL) {
|
if(fido == NULL) {
|
||||||
fast_printf("\b, writing %s ", name);
|
if(not quiet) cout << "\b, writing " << name << ' ' << flush;
|
||||||
fidouser = false;
|
fidouser = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fast_printf("\b, writing %s and %s ", name, fidouserlst);
|
if(not quiet) cout << "\b, writing " << name << " and " << fidouserlst << ' ' << flush;
|
||||||
}
|
}
|
||||||
|
|
||||||
int nn = 0;
|
int nn = 0;
|
||||||
@ -912,7 +903,7 @@ static void read_nodelists() {
|
|||||||
if(prev != nodeidx.end() && match_addr_mask(&curr->addr, &prev->addr)) {
|
if(prev != nodeidx.end() && match_addr_mask(&curr->addr, &prev->addr)) {
|
||||||
if(strieql(curr->name, prev->name)) {
|
if(strieql(curr->name, prev->name)) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fast_printf("* Dupe: %d:%d/%d.%d %s\n",curr->addr.zone,curr->addr.net,curr->addr.node,curr->addr.point,curr->name);
|
if(not quiet) cout << "* Dupe: " << curr->addr.zone << ':' << curr->addr.net << '/' << curr->addr.node << '.' << curr->addr.point << ' ' << curr->name << endl;
|
||||||
#endif
|
#endif
|
||||||
nodeidx.erase(curr);
|
nodeidx.erase(curr);
|
||||||
curr = prev;
|
curr = prev;
|
||||||
@ -936,14 +927,14 @@ static void read_nodelists() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Sort by address
|
// Sort by address
|
||||||
fast_printf(" \n* Sorting by node ");
|
if(not quiet) cout << ' ' << endl << "* Sorting by node " << flush;
|
||||||
nodeidx.sort(cmp_anlsts);
|
nodeidx.sort(cmp_anlsts);
|
||||||
|
|
||||||
// Write the address-sorted .GXA
|
// Write the address-sorted .GXA
|
||||||
fp = fsopen(addrindex.c_str(), "wb", sh_mod);
|
fp = fsopen(addrindex.c_str(), "wb", sh_mod);
|
||||||
if(fp) {
|
if(fp) {
|
||||||
name = CleanFilename(addrindex.c_str());
|
name = CleanFilename(addrindex.c_str());
|
||||||
fast_printf("\b, writing %s ", name);
|
if(not quiet) cout << "\b, writing " << name << ' ' << flush;
|
||||||
int nn = 0;
|
int nn = 0;
|
||||||
for(curr = nodeidx.begin(); curr != nodeidx.end(); curr++) {
|
for(curr = nodeidx.begin(); curr != nodeidx.end(); curr++) {
|
||||||
if(ISTWIRLY(nn++))
|
if(ISTWIRLY(nn++))
|
||||||
@ -957,7 +948,7 @@ static void read_nodelists() {
|
|||||||
fp = fsopen(listindex.c_str(), "wt", sh_mod);
|
fp = fsopen(listindex.c_str(), "wt", sh_mod);
|
||||||
if(fp) {
|
if(fp) {
|
||||||
name = CleanFilename(listindex.c_str());
|
name = CleanFilename(listindex.c_str());
|
||||||
fast_printf(" \n* Writing %s\n", name);
|
if(not quiet) cout << ' ' << endl << "* Writing " << name << endl;
|
||||||
for(fno=nodelist.begin(); fno != nodelist.end(); fno++) {
|
for(fno=nodelist.begin(); fno != nodelist.end(); fno++) {
|
||||||
if(*(fno->fn))
|
if(*(fno->fn))
|
||||||
fprintf(fp, "%s %lu\n", fno->fn, fno->ft);
|
fprintf(fp, "%s %lu\n", fno->fn, fno->ft);
|
||||||
@ -968,10 +959,12 @@ static void read_nodelists() {
|
|||||||
// Note compile time
|
// Note compile time
|
||||||
runtime = time(NULL) - runtime;
|
runtime = time(NULL) - runtime;
|
||||||
|
|
||||||
if(dups) {
|
if(not quiet) {
|
||||||
fast_printf("\n* Total duplicate nodes: %6lu.\n", (ulong)dups);
|
if(dups) {
|
||||||
|
cout << endl << "* Total duplicate nodes: " << (ulong)dups << '.' << endl;
|
||||||
|
}
|
||||||
|
cout << endl << "* Nodelist compile completed. Compile time: " << (ulong)(runtime/60) << " min, " << (ulong)(runtime%60) << " sec." << endl;
|
||||||
}
|
}
|
||||||
fast_printf("\n* Nodelist compile completed. Compile time: %lu min, %lu sec.\n", (ulong)(runtime/60), (ulong)(runtime%60));
|
|
||||||
#ifdef GOLDNODE_STATS
|
#ifdef GOLDNODE_STATS
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1044,11 +1037,13 @@ static void check_nodelists(bool force) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(compilen) {
|
if(not quiet) {
|
||||||
fast_printf("* %u new nodelist file%s found.\n", compilen, compilen==1?"":"s");
|
if(compilen) {
|
||||||
}
|
cout << "* " << compilen << " new nodelist file" << ((compilen == 1) ? "" : "s") << " found." << endl;
|
||||||
else if(nodelist.size()) {
|
}
|
||||||
fast_printf("* The nodelist file%s up-to-date.\n", nodelist.size()==1?" is":"s are");
|
else if(nodelist.size()) {
|
||||||
|
cout << "* The nodelist file" << ((nodelist.size() == 1) ? " is" : "s are") << " up-to-date." << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check userlists
|
// Check userlists
|
||||||
@ -1059,11 +1054,13 @@ static void check_nodelists(bool force) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(compileu) {
|
if(not quiet) {
|
||||||
fast_printf("* %u new userlist file%s found.\n", compileu, compileu==1?"":"s");
|
if(compileu) {
|
||||||
}
|
cout << "* " << compileu << " new userlist file" << ((compileu == 1) ? "" : "s") << " found." << endl;
|
||||||
else if(userlist.size()) {
|
}
|
||||||
fast_printf("* The userlist file%s up-to-date.\n", userlist.size()==1?" is":"s are");
|
else if(userlist.size()) {
|
||||||
|
cout << "* The userlist file" << ((userlist.size() == 1) ? " is" : "s are") << " up-to-date." << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(force or compilen or compileu)
|
if(force or compilen or compileu)
|
||||||
@ -1075,8 +1072,7 @@ static void check_nodelists(bool force) {
|
|||||||
|
|
||||||
static void fatal_error(const char* what) {
|
static void fatal_error(const char* what) {
|
||||||
|
|
||||||
fast_printf(what);
|
if(not quiet) cout << what << endl;
|
||||||
fast_printf("\n");
|
|
||||||
exit(5);
|
exit(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1169,7 +1165,7 @@ static int parse_config(const char *__configfile, Addr& zoneaddr) {
|
|||||||
switch(crc) {
|
switch(crc) {
|
||||||
case CRC_IF:
|
case CRC_IF:
|
||||||
if(in_if) {
|
if(in_if) {
|
||||||
fast_printf("* %s: Misplaced IF at line %u. IF's cannot be nested.\n", __configfile, line);
|
if(not quiet) cout << "* " << __configfile << ": Misplaced IF at line " << line << ". IF's cannot be nested." << endl;
|
||||||
}
|
}
|
||||||
in_if = YES;
|
in_if = YES;
|
||||||
cond_status = do_if(value);
|
cond_status = do_if(value);
|
||||||
@ -1177,20 +1173,20 @@ static int parse_config(const char *__configfile, Addr& zoneaddr) {
|
|||||||
case CRC_ELIF:
|
case CRC_ELIF:
|
||||||
case CRC_ELSEIF:
|
case CRC_ELSEIF:
|
||||||
if((not in_if) or in_else) {
|
if((not in_if) or in_else) {
|
||||||
fast_printf("* %s: Misplaced ELIF/ELSEIF at line %u.\n", __configfile, line);
|
if(not quiet) cout << "* " << __configfile << ": Misplaced ELIF/ELSEIF at line " << line << '.' << endl;
|
||||||
}
|
}
|
||||||
cond_status = do_if(value);
|
cond_status = do_if(value);
|
||||||
break;
|
break;
|
||||||
case CRC_ELSE:
|
case CRC_ELSE:
|
||||||
if((not in_if) or in_else) {
|
if((not in_if) or in_else) {
|
||||||
fast_printf("* %s: Misplaced ELSE at line %u.\n", __configfile, line);
|
if(not quiet) cout << "* " << __configfile << "Misplaced ELSE at line " << line << '.' << endl;
|
||||||
}
|
}
|
||||||
in_else = YES;
|
in_else = YES;
|
||||||
cond_status ^= YES;
|
cond_status ^= YES;
|
||||||
break;
|
break;
|
||||||
case CRC_ENDIF:
|
case CRC_ENDIF:
|
||||||
if(not in_if) {
|
if(not in_if) {
|
||||||
fast_printf("* %s: Misplaced ENDIF at line %u.\n", __configfile, line);
|
if(not quiet) cout << "* " << __configfile << ": Misplaced ENDIF at line " << line << '.' << endl;
|
||||||
}
|
}
|
||||||
in_if = in_else = NO;
|
in_if = in_else = NO;
|
||||||
cond_status = YES;
|
cond_status = YES;
|
||||||
@ -1283,7 +1279,7 @@ static int parse_config(const char *__configfile, Addr& zoneaddr) {
|
|||||||
case CRC_INCLUDE:
|
case CRC_INCLUDE:
|
||||||
strschg_environ(value);
|
strschg_environ(value);
|
||||||
if(not parse_config(value,zoneaddr)) // NOTE! This is a recursive call!
|
if(not parse_config(value,zoneaddr)) // NOTE! This is a recursive call!
|
||||||
fast_printf("* Could not read configuration file '%s' !\n",value);
|
if(not quiet) cout << "* Could not read configuration file " << value << '!' << endl;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -1467,45 +1463,44 @@ static void run_gn(int argc, char* argv[]) {
|
|||||||
cfg = argv[n];
|
cfg = argv[n];
|
||||||
}
|
}
|
||||||
|
|
||||||
fast_printf(
|
if(not quiet) {
|
||||||
__GPID__ " " __GVER__ " Nodelist Compiler.\n"
|
cout << __GPID__ " " __GVER__ " Nodelist Compiler." << endl
|
||||||
"Copyright (C) 1990-1999 Odinn Sorensen\n"
|
<< "Copyright (C) 1990-1999 Odinn Sorensen" << endl
|
||||||
"Copyright (C) 1999-2000 Alexander S. Aganichev\n"
|
<< "Copyright (C) 1999-2001 Alexander S. Aganichev" << endl
|
||||||
"-------------------------------------------------------------------------------\n"
|
<< "-------------------------------------------------------------------------------" << endl
|
||||||
"\n"
|
<< endl;
|
||||||
);
|
}
|
||||||
|
|
||||||
if(not(force or conditional)) {
|
if(not(force or conditional)) {
|
||||||
fast_printf(
|
if(not quiet) {
|
||||||
"Commandline syntax: %s [-options] [configfile]\n"
|
cout << "Commandline syntax: " << CleanFilename(argv[0]) << " [-options] [configfile]" << endl
|
||||||
"\n"
|
<< endl
|
||||||
"[-options] = -C Conditional compile.\n"
|
<< "[-options] =\t-C\t Conditional compile." << endl
|
||||||
" -F Forced compile.\n"
|
<< "\t\t-F\t Forced compile." << endl
|
||||||
" -D Remove duplicate nodes from index while compiling.\n"
|
<< "\t\t-D\t Remove duplicate nodes from index while compiling." << endl
|
||||||
" -Q Quiet compile. No screen output improves speed.\n"
|
<< "\t\t-Q\t Quiet compile. No screen output improves speed." << endl
|
||||||
" -S<size> Set max size of a name in the index.\n"
|
<< "\t\t-S<size> Set max size of a name in the index." << endl
|
||||||
" -U<file> Create sorted FIDOUSER.LST userlist file.\n"
|
<< "\t\t-U<file> Create sorted FIDOUSER.LST userlist file." << endl
|
||||||
#ifdef GOLDNODE_STATS
|
#ifdef GOLDNODE_STATS
|
||||||
" -T Make statistics.\n"
|
<< "\t\t-T\t Make statistics." << endl
|
||||||
#endif
|
#endif
|
||||||
""
|
<< endl
|
||||||
"[configfile] = The path AND filename of GOLDED.CFG\n"
|
<< "[configfile] =\t\t The path AND filename of GOLDED.CFG" << endl
|
||||||
" configuration file to read.\n"
|
<< "\t\t\t configuration file to read." << endl
|
||||||
"\n",
|
<< endl;
|
||||||
CleanFilename(argv[0])
|
}
|
||||||
);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
if(force)
|
if(force)
|
||||||
fast_printf("* Forced compile.\n");
|
if(not quiet) cout << "* Forced compile." << endl;
|
||||||
|
|
||||||
if(read_config(cfg, argv[0])) {
|
if(read_config(cfg, argv[0])) {
|
||||||
if(force or conditional)
|
if(force or conditional)
|
||||||
check_nodelists(force);
|
check_nodelists(force);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fast_printf("\nCould not find the configuration file!\n");
|
if(not quiet) cout << endl << "Could not find the configuration file!" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user