Updates for html sitedocs

This commit is contained in:
Michiel Broek 2004-03-28 19:36:30 +00:00
parent 421bd6cf93
commit 6ef385afb2
7 changed files with 290 additions and 122 deletions

3
TODO
View File

@ -170,14 +170,11 @@ mbsetup:
N: When a message area is deleted, delete the rulesfile too.
X: Generate crossreference document:
File Areas <=> BBS groups
File Areas <=> Newfiles groups
Filefind flags <=> TIC Areas
Echomail <=> Nodes
Fileechos <=> Groups
Fileechos <=> Nodes
Fileechos <=> Magic processing
Fileechos <=> Hatch
Newfiles <=> BBS Areas
Newfiles <=> Newfiles groups

View File

@ -809,8 +809,8 @@ int bbs_file_doc(FILE *fp, FILE *toc, int page)
add_webtable(wp, (char *)"Allow filerequest", getboolean(area.FileReq));
fprintf(wp, "<TR><TH align='left'>BBS (tic) file group</TH><TD><A HREF=\"filegroup_%s.html\">%s</A></TD></TH>\n",
area.BbsGroup, area.BbsGroup);
fprintf(wp, "<TR><TH align='left'>Newfiles announce group</TH><TD><A HREF=\"newfilegroup_%s.html\">%s</A></TD></TH>\n",
area.NewGroup, area.NewGroup);
fprintf(wp, "<TR><TH align='left'>Newfiles announce group</TH><TD><A HREF=\"newgroup.html\">%s</A></TD></TH>\n",
area.NewGroup);
add_webdigit(wp, (char *)"Minimum age for access", area.Age);
add_webtable(wp, (char *)"Area password", area.Password);
add_webdigit(wp, (char *)"Kill Download days", area.DLdays);

View File

@ -717,8 +717,8 @@ int tic_group_doc(FILE *fp, FILE *toc, int page)
if ((wp = open_webdoc(temp, (char *)"File group", fgroup.Comment))) {
fprintf(wp, "<A HREF=\"index.html\">Main</A>&nbsp;<A HREF=\"filegroup.html\">Back</A>\n");
fprintf(wp, "<P>\n");
fprintf(wp, "<TABLE width='400' border='0' cellspacing='0' cellpadding='2'>\n");
fprintf(wp, "<COL width='50%%'><COL width='50%%'>\n");
fprintf(wp, "<TABLE width='600' border='0' cellspacing='0' cellpadding='2'>\n");
fprintf(wp, "<COL width='30%%'><COL width='70%%'>\n");
fprintf(wp, "<TBODY>\n");
add_webtable(wp, (char *)"Group name", fgroup.Name);
add_webtable(wp, (char *)"Comment", fgroup.Comment);
@ -750,8 +750,8 @@ int tic_group_doc(FILE *fp, FILE *toc, int page)
add_webtable(wp, (char *)"Default tic security", getflag(fgroup.LinkSec.flags, fgroup.LinkSec.notflags));
fprintf(wp, "<TR><TH align='left'>BBS (tic) file group</TH><TD><A HREF=\"filegroup_%s.html\">%s</A></TD></TH>\n",
fgroup.BbsGroup, fgroup.BbsGroup);
fprintf(wp, "<TR><TH align='left'>Newfiles announce group</TH><TD><A HREF=\"newfilegroup_%s.html\">%s</A></TD></TH>\n",
fgroup.AnnGroup, fgroup.AnnGroup);
fprintf(wp, "<TR><TH align='left'>Newfiles announce group</TH><TD><A HREF=\"newgroup.html\">%s</A></TD></TH>\n",
fgroup.AnnGroup);
sprintf(temp, "%d", fgroup.Upload);
add_webtable(wp, (char *)"Upload area", temp);
add_webtable(wp, (char *)"Start date", ctime(&fgroup.StartDate));

View File

@ -683,50 +683,120 @@ char *PickModem(char *shdr)
int modem_doc(FILE *fp, FILE *toc, int page)
{
char temp[PATH_MAX];
FILE *mdm;
int i, j;
char temp[PATH_MAX];
FILE *ti, *wp, *ip, *mdm;
int refs, nr = 0, i, j;
sprintf(temp, "%s/etc/modem.data", getenv("MBSE_ROOT"));
if ((mdm = fopen(temp, "r")) == NULL)
return page;
sprintf(temp, "%s/etc/modem.data", getenv("MBSE_ROOT"));
if ((mdm = fopen(temp, "r")) == NULL)
return page;
page = newpage(fp, page);
addtoc(fp, toc, 5, 0, page, (char *)"Modem types information");
j = 0;
page = newpage(fp, page);
addtoc(fp, toc, 5, 0, page, (char *)"Modem types information");
j = 0;
fprintf(fp, "\n\n");
fread(&modemhdr, sizeof(modemhdr), 1, mdm);
fprintf(fp, "\n\n");
fread(&modemhdr, sizeof(modemhdr), 1, mdm);
while ((fread(&modem, modemhdr.recsize, 1, mdm)) == 1) {
if (j == 1) {
page = newpage(fp, page);
fprintf(fp, "\n");
j = 0;
}
fprintf(fp, " Modem type %s\n", modem.modem);
for (i = 0; i < 3; i++)
fprintf(fp, " Init string %s\n", modem.init[i]);
fprintf(fp, " OK string %s\n", modem.ok);
fprintf(fp, " Hangup %s\n", modem.hangup);
fprintf(fp, " Info command %s\n", modem.info);
fprintf(fp, " Dial command %s\n", modem.dial);
for (i = 0; i < 20; i++)
fprintf(fp, " Connect %s\n", modem.connect[i]);
fprintf(fp, " Reset cmd %s\n", modem.reset);
for (i = 0; i < 10; i++)
fprintf(fp, " Error string %s\n", modem.error[i]);
fprintf(fp, " Cost offset %d\n", modem.costoffset);
fprintf(fp, " EMSI speed %s\n", modem.speed);
fprintf(fp, " Strip dashes %s\n", getboolean(modem.stripdash));
fprintf(fp, " Available %s\n", getboolean(modem.available));
fprintf(fp, "\n\n\n");
j++;
ip = open_webdoc((char *)"modem.html", (char *)"Modems", NULL);
fprintf(ip, "<A HREF=\"index.html\">Main</A>\n");
fprintf(ip, "<UL>\n");
while ((fread(&modem, modemhdr.recsize, 1, mdm)) == 1) {
if (j == 1) {
page = newpage(fp, page);
fprintf(fp, "\n");
j = 0;
}
fclose(mdm);
return page;
nr++;
fprintf(ip, " <LI><A HREF=\"modem_%d.html\">%s</A></LI>\n", nr, modem.modem);
sprintf(temp, "modem_%d.html", nr);
if ((wp = open_webdoc(temp, (char *)"Modem", modem.modem))) {
fprintf(wp, "<A HREF=\"index.html\">Main</A>&nbsp;<A HREF=\"modem.html\">Back</A>\n");
fprintf(wp, "<P>\n");
fprintf(wp, "<TABLE width='600' border='0' cellspacing='0' cellpadding='2'>\n");
fprintf(wp, "<COL width='30%%'><COL width='70%%'>\n");
fprintf(wp, "<TBODY>\n");
add_webtable(wp, (char *)"Modem type", modem.modem);
for (i = 0; i < 3; i++)
if (strlen(modem.init[i])) {
sprintf(temp, "Init string %d", i+1);
add_webtable(wp, temp, modem.init[i]);
}
add_webtable(wp, (char *)"OK string", modem.ok);
add_webtable(wp, (char *)"Hangup", modem.hangup);
add_webtable(wp, (char *)"Info command", modem.info);
add_webtable(wp, (char *)"Dial command", modem.dial);
for (i = 0; i < 20; i++)
if (strlen(modem.connect[i]))
add_webtable(wp, (char *)"Connect", modem.connect[i]);
add_webtable(wp, (char *)"Reset", modem.reset);
for (i = 0; i < 10; i++)
if (strlen(modem.error[i]))
add_webtable(wp, (char *)"Error string", modem.error[i]);
add_webdigit(wp, (char *)"Cost offset", modem.costoffset);
add_webtable(wp, (char *)"EMSI speed", modem.speed);
add_webtable(wp, (char *)"Strip dashes", getboolean(modem.stripdash));
add_webtable(wp, (char *)"Available", getboolean(modem.available));
fprintf(wp, "</TBODY>\n");
fprintf(wp, "</TABLE>\n");
fprintf(wp, "<HR>\n");
fprintf(wp, "<H3>TTY Lines Reference</H3>\n");
refs = 0;
sprintf(temp, "%s/etc/ttyinfo.data", getenv("MBSE_ROOT"));
if ((ti = fopen(temp, "r"))) {
fread(&ttyinfohdr, sizeof(ttyinfohdr), 1, ti);
fseek(ti, 0, SEEK_SET);
fread(&ttyinfo, ttyinfohdr.hdrsize, 1, ti);
while ((fread(&ttyinfo, ttyinfohdr.recsize, 1, ti)) == 1) {
if (ttyinfo.available && (strcmp(modem.modem, ttyinfo.modem) == 0)) {
if (refs == 0) {
fprintf(wp, "<TABLE width='600' border='0' cellspacing='0' cellpadding='2'>\n");
fprintf(wp, "<COL width='20%%'><COL width='80%%'>\n");
fprintf(wp, "<TBODY>\n");
}
fprintf(wp, "<TR><TD><A HREF=\"ttyinfo_%s.html\">%s</A></TD><TD>%s</TD></TR>\n",
ttyinfo.tty, ttyinfo.tty, ttyinfo.comment);
refs++;
}
}
fclose(ti);
}
if (refs == 0)
fprintf(wp, "No TTY Lines References\n");
else {
fprintf(wp, "</TBODY>\n");
fprintf(wp, "</TABLE>\n");
}
close_webdoc(wp);
}
fprintf(fp, " Modem type %s\n", modem.modem);
for (i = 0; i < 3; i++)
fprintf(fp, " Init string %s\n", modem.init[i]);
fprintf(fp, " OK string %s\n", modem.ok);
fprintf(fp, " Hangup %s\n", modem.hangup);
fprintf(fp, " Info command %s\n", modem.info);
fprintf(fp, " Dial command %s\n", modem.dial);
for (i = 0; i < 20; i++)
fprintf(fp, " Connect %s\n", modem.connect[i]);
fprintf(fp, " Reset cmd %s\n", modem.reset);
for (i = 0; i < 10; i++)
fprintf(fp, " Error string %s\n", modem.error[i]);
fprintf(fp, " Cost offset %d\n", modem.costoffset);
fprintf(fp, " EMSI speed %s\n", modem.speed);
fprintf(fp, " Strip dashes %s\n", getboolean(modem.stripdash));
fprintf(fp, " Available %s\n", getboolean(modem.available));
fprintf(fp, "\n\n\n");
j++;
}
fprintf(ip, "</UL>\n");
close_webdoc(ip);
fclose(mdm);
return page;
}

View File

@ -539,57 +539,92 @@ void InitNewfiles(void)
int new_doc(FILE *fp, FILE *toc, int page)
{
char temp[PATH_MAX], group[13];
FILE *no;
int groups, i, j;
char temp[PATH_MAX], group[13];
FILE *wp, *ip, *no;
int groups, i, j, nr = 0;
sprintf(temp, "%s/etc/newfiles.data", getenv("MBSE_ROOT"));
if ((no = fopen(temp, "r")) == NULL)
return page;
page = newpage(fp, page);
addtoc(fp, toc, 12, 0, page, (char *)"Newfiles reports");
j = 0;
fprintf(fp, "\n\n");
fread(&newfileshdr, sizeof(newfileshdr), 1, no);
while ((fread(&newfiles, newfileshdr.recsize, 1, no)) == 1) {
if (j == 3) {
page = newpage(fp, page);
fprintf(fp, "\n");
j = 0;
}
fprintf(fp, " Area comment %s\n", newfiles.Comment);
fprintf(fp, " Message area %s\n", newfiles.Area);
fprintf(fp, " Origin line %s\n", newfiles.Origin);
fprintf(fp, " From name %s\n", newfiles.From);
fprintf(fp, " To name %s\n", newfiles.Too);
fprintf(fp, " Subject %s\n", newfiles.Subject);
fprintf(fp, " Language %c\n", newfiles.Language);
fprintf(fp, " Aka to use %s\n", aka2str(newfiles.UseAka));
fprintf(fp, " Active %s\n", getboolean(newfiles.Active));
fprintf(fp, " Allow High ASCII %s\n", getboolean(newfiles.HiAscii));
fprintf(fp, "\n File groups:\n ");
groups = newfileshdr.grpsize / sizeof(group);
for (i = 0; i < groups; i++) {
fread(&group, sizeof(group), 1, no);
if (strlen(group)) {
fprintf(fp, "%-12s ", group);
if (((i+1) %5) == 0)
fprintf(fp, "\n ");
}
}
if ((i+1) % 5)
fprintf(fp, "\n");
fprintf(fp, "\n\n\n");
j++;
}
fclose(no);
sprintf(temp, "%s/etc/newfiles.data", getenv("MBSE_ROOT"));
if ((no = fopen(temp, "r")) == NULL)
return page;
page = newpage(fp, page);
addtoc(fp, toc, 12, 0, page, (char *)"Newfiles reports");
j = 0;
fprintf(fp, "\n\n");
fread(&newfileshdr, sizeof(newfileshdr), 1, no);
ip = open_webdoc((char *)"newfiles.html", (char *)"Newfiles Reports", NULL);
fprintf(ip, "<A HREF=\"index.html\">Main</A>\n");
fprintf(ip, "<UL>\n");
while ((fread(&newfiles, newfileshdr.recsize, 1, no)) == 1) {
if (j == 3) {
page = newpage(fp, page);
fprintf(fp, "\n");
j = 0;
}
nr++;
sprintf(temp, "newfiles_%d.html", nr);
fprintf(ip, " <LI><A HREF=\"%s\">Report %d</A> %s</LI>\n", temp, nr, newfiles.Comment);
if ((wp = open_webdoc(temp, (char *)"Newfiles report", newfiles.Comment))) {
fprintf(wp, "<A HREF=\"index.html\">Main</A>&nbsp;<A HREF=\"newfiles.html\">Back</A>\n");
fprintf(wp, "<P>\n");
fprintf(wp, "<TABLE width='600' border='0' cellspacing='0' cellpadding='2'>\n");
fprintf(wp, "<COL width='30%%'><COL width='70%%'>\n");
fprintf(wp, "<TBODY>\n");
add_webtable(wp, (char *)"Area comment", newfiles.Comment);
add_webtable(wp, (char *)"Message area", newfiles.Area);
add_webtable(wp, (char *)"Origin line", newfiles.Origin);
add_webtable(wp, (char *)"From name", newfiles.From);
add_webtable(wp, (char *)"To name", newfiles.Too);
add_webtable(wp, (char *)"Subject", newfiles.Subject);
sprintf(temp, "%c", newfiles.Language);
add_webtable(wp, (char *)"Language", temp);
add_webtable(wp, (char *)"Aka to use", aka2str(newfiles.UseAka));
add_webtable(wp, (char *)"Active", getboolean(newfiles.Active));
add_webtable(wp, (char *)"Allow High ASCII", getboolean(newfiles.HiAscii));
fprintf(fp, " Area comment %s\n", newfiles.Comment);
fprintf(fp, " Message area %s\n", newfiles.Area);
fprintf(fp, " Origin line %s\n", newfiles.Origin);
fprintf(fp, " From name %s\n", newfiles.From);
fprintf(fp, " To name %s\n", newfiles.Too);
fprintf(fp, " Subject %s\n", newfiles.Subject);
fprintf(fp, " Language %c\n", newfiles.Language);
fprintf(fp, " Aka to use %s\n", aka2str(newfiles.UseAka));
fprintf(fp, " Active %s\n", getboolean(newfiles.Active));
fprintf(fp, " Allow High ASCII %s\n", getboolean(newfiles.HiAscii));
fprintf(fp, "\n File groups:\n ");
groups = newfileshdr.grpsize / sizeof(group);
for (i = 0; i < groups; i++) {
fread(&group, sizeof(group), 1, no);
if (strlen(group)) {
if (i)
fprintf(wp, "<TR><TH>&nbsp;</TH><TD><A HREF=\"newgroup_%s.html\">%s</A></TD></TR>\n", group, group);
else
fprintf(wp, "<TR><TH align='left'>File groups</TH><TD><A HREF=\"newgroup_%s.html\">%s</A></TD></TR>\n",
group, group);
fprintf(fp, "%-12s ", group);
if (((i+1) %5) == 0)
fprintf(fp, "\n ");
}
}
if ((i+1) % 5)
fprintf(fp, "\n");
fprintf(fp, "\n\n\n");
j++;
fprintf(wp, "</TBODY>\n");
fprintf(wp, "</TABLE>\n");
close_webdoc(wp);
}
}
fprintf(ip, "</UL>\n");
close_webdoc(ip);
fclose(no);
return page;
}

View File

@ -496,32 +496,97 @@ char *PickNGroup(char *shdr)
int newf_group_doc(FILE *fp, FILE *toc, int page)
{
char *temp;
FILE *no;
char *temp;
FILE *ip, *wp, *no;
int refs, nr;
temp = calloc(PATH_MAX, sizeof(char));
sprintf(temp, "%s/etc/ngroups.data", getenv("MBSE_ROOT"));
if ((no = fopen(temp, "r")) == NULL) {
free(temp);
return page;
}
temp = calloc(PATH_MAX, sizeof(char));
sprintf(temp, "%s/etc/ngroups.data", getenv("MBSE_ROOT"));
if ((no = fopen(temp, "r")) == NULL) {
free(temp);
page = newpage(fp, page);
addtoc(fp, toc, 11, 0, page, (char *)"Newfiles announce groups");
fprintf(fp, "\n");
fprintf(fp, " Name Act Comment\n");
fprintf(fp, " ------------ --- --------------------------------------------------\n");
fread(&ngrouphdr, sizeof(ngrouphdr), 1, no);
fseek(no, 0, SEEK_SET);
fread(&ngrouphdr, ngrouphdr.hdrsize, 1, no);
while ((fread(&ngroup, ngrouphdr.recsize, 1, no)) == 1)
fprintf(fp, " %-12s %s %s\n", ngroup.Name, getboolean(ngroup.Active), ngroup.Comment);
fclose(no);
return page;
}
wp = open_webdoc((char *)"newgroup.html", (char *)"Newfiles groups", NULL);
fprintf(wp, "<A HREF=\"index.html\">Main</A>\n");
page = newpage(fp, page);
addtoc(fp, toc, 11, 0, page, (char *)"Newfiles announce groups");
fprintf(fp, "\n");
fprintf(fp, " Name Act Comment\n");
fprintf(fp, " ------------ --- --------------------------------------------------\n");
fread(&ngrouphdr, sizeof(ngrouphdr), 1, no);
fseek(no, 0, SEEK_SET);
fread(&ngrouphdr, ngrouphdr.hdrsize, 1, no);
fprintf(wp, "<P>\n");
fprintf(wp, "<TABLE width='600' border='0' cellspacing='0' cellpadding='2'>\n");
fprintf(wp, "<COL width='20%%'><COL width='5%%'><COL width='75%%'>\n");
fprintf(wp, "<TBODY>\n");
fprintf(wp, "<TR><TH align='left'>Name</TH><TH align='left'>Act</TH><TH align='left'>Comment</TH></TR>\n");
while ((fread(&ngroup, ngrouphdr.recsize, 1, no)) == 1) {
fprintf(fp, " %-12s %s %s\n", ngroup.Name, getboolean(ngroup.Active), ngroup.Comment);
fprintf(wp, "<TR><TD>%s</TD><TD>%s</TD><TD>%s</TD></TR>\n", ngroup.Name, getboolean(ngroup.Active), ngroup.Comment);
}
fprintf(wp, "</TBODY>\n");
fprintf(wp, "</TABLE>\n");
fseek(no, ngrouphdr.hdrsize, SEEK_SET);
while ((fread(&ngroup, ngrouphdr.recsize, 1, no)) == 1) {
refs = 0;
sprintf(temp, "%s/etc/fareas.data", getenv("MBSE_ROOT"));
if ((ip = fopen(temp, "r"))) {
fread(&areahdr, sizeof(areahdr), 1, ip);
nr = 0;
while ((fread(&area, areahdr.recsize, 1, ip)) == 1) {
nr++;
if (area.Available && (strcmp(ngroup.Name, area.NewGroup) == 0)) {
if (refs == 0) {
fprintf(wp, "<HR>\n");
fprintf(wp, "<H3>References for group %s</H3>\n", ngroup.Name);
fprintf(wp, "<TABLE width='600' border='0' cellspacing='0' cellpadding='2'>\n");
fprintf(wp, "<COL width='20%%'><COL width='80%%'>\n");
fprintf(wp, "<TBODY>\n");
}
refs++;
fprintf(wp, "<TR><TD><A HREF=\"filearea_%d.html\">File area %d</A></TD><TD>%s</TD></TR>\n", nr, nr, area.Name);
}
}
fclose(ip);
}
sprintf(temp, "%s/etc/fgroups.data", getenv("MBSE_ROOT"));
if ((ip = fopen(temp, "r"))) {
fread(&fgrouphdr, fgrouphdr.hdrsize, 1, ip);
while ((fread(&fgroup, fgrouphdr.recsize, 1, ip)) == 1) {
if (strcmp(ngroup.Name, fgroup.AnnGroup) == 0) {
if (refs == 0) {
fprintf(wp, "<HR>\n");
fprintf(wp, "<H3>References for group %s</H3>\n", ngroup.Name);
fprintf(wp, "<TABLE width='600' border='0' cellspacing='0' cellpadding='2'>\n");
fprintf(wp, "<COL width='20%%'><COL width='80%%'>\n");
fprintf(wp, "<TBODY>\n");
}
refs++;
fprintf(wp, "<TR><TD><A HREF=\"filegroup_%s.html\">File group %s</A></TD><TD>%s</TD></TR>\n",
fgroup.Name, fgroup.Name, fgroup.Comment);
}
}
fclose(ip);
}
if (refs) {
fprintf(wp, "</TBODY>\n");
fprintf(wp, "</TABLE>\n");
}
}
close_webdoc(wp);
free(temp);
fclose(no);
return page;
}

View File

@ -189,6 +189,7 @@ int horiz;
void dotter(void);
void dotter(void)
{
Nopper();
mvprintw(8, horiz++, (char *)".");
fflush(stdout);
}
@ -235,7 +236,7 @@ void site_docs(void)
fprintf(hp, " <LI><A HREF=\"fidonet.html\">Fido Networks</A></LI>\n");
fprintf(hp, " <LI><A HREF=\"archivers.html\">Archivers</A></LI>\n");
fprintf(hp, " <LI>Virus Scaners</LI>\n");
fprintf(hp, " <LI>Modem Types</LI>\n");
fprintf(hp, " <LI><A HREF=\"modem.html\">Modem Types</A></LI>\n");
fprintf(hp, " <LI>TTY Lines Info</LI>\n");
fprintf(hp, " <LI>Fidonet Nodes</LI>\n");
fprintf(hp, " <LI>BBS: <A HREF=\"limits.html\">Security Limits</A></LI>\n");
@ -250,8 +251,8 @@ void site_docs(void)
fprintf(hp, " <LI>TIC: Fileecho Areas</LI>\n");
fprintf(hp, " <LI>TIC: <A HREF=\"hatch.html\">Hatch Manager</A></LI>\n");
fprintf(hp, " <LI>TIC: <A HREF=\"magic.html\">Magic Files</A></LI>\n");
fprintf(hp, " <LI>Newfiles Groups</LI>\n");
fprintf(hp, " <LI>Newfiles Reports</LI>\n");
fprintf(hp, " <LI><A HREF=\"newgroup.html\">Newfiles Groups</A></LI>\n");
fprintf(hp, " <LI><A HREF=\"newfiles.html\">Newfiles Reports</A></LI>\n");
fprintf(hp, " <LI><A HREF=\"filefind.html\">Filefind Setup</A></LI>\n");
fprintf(hp, " <LI>BBS Users</LI>\n");
fprintf(hp, " <LI>Mail Services</LI>\n");