Prettier index pages

This commit is contained in:
Michiel Broek 2005-05-08 21:34:51 +00:00
parent 5e581ad412
commit b5c1bab007
5 changed files with 109 additions and 80 deletions

View File

@ -780,76 +780,82 @@ char *PickArchive(char *shdr)
int archive_doc(FILE *fp, FILE *toc, int page)
{
char temp[PATH_MAX];
FILE *arch, *wp, *ip;
int i, j;
char temp[PATH_MAX];
FILE *arch, *wp, *ip;
int i, j;
sprintf(temp, "%s/etc/archiver.data", getenv("MBSE_ROOT"));
if ((arch = fopen(temp, "r")) == NULL)
return page;
sprintf(temp, "%s/etc/archiver.data", getenv("MBSE_ROOT"));
if ((arch = fopen(temp, "r")) == NULL)
return page;
page = newpage(fp, page);
addtoc(fp, toc, 3, 0, page, (char *)"Archiver programs");
i = j = 0;
page = newpage(fp, page);
addtoc(fp, toc, 3, 0, page, (char *)"Archiver programs");
i = j = 0;
ip = open_webdoc((char *)"archivers.html", (char *)"Archivers", NULL);
fprintf(ip, "<A HREF=\"index.html\">Main</A>\n");
fprintf(ip, "<UL>\n");
ip = open_webdoc((char *)"archivers.html", (char *)"Archivers", NULL);
fprintf(ip, "<A HREF=\"index.html\">Main</A>\n<P>\n");
fprintf(ip, "<TABLE width='400' border='0' cellspacing='0' cellpadding='2'>\n");
fprintf(ip, "<COL width='10%%'><COL width='70%%'><COL width='20%%'>\n");
fprintf(ip, "<TBODY>\n");
fprintf(ip, "<TR><TH align='left'>Name</TH><TH align='left'>Comment</TH><TH align='left'>Available</TH></TR>\n");
fprintf(fp, "\n\n");
fread(&archiverhdr, sizeof(archiverhdr), 1, arch);
while ((fread(&archiver, archiverhdr.recsize, 1, arch)) == 1) {
fprintf(fp, "\n\n");
fread(&archiverhdr, sizeof(archiverhdr), 1, arch);
while ((fread(&archiver, archiverhdr.recsize, 1, arch)) == 1) {
if (j == 4) {
page = newpage(fp, page);
fprintf(fp, "\n");
j = 0;
}
i++;
sprintf(temp, "archiver_%d.html", i);
if ((wp = open_webdoc(temp, (char *)"Archiver", archiver.comment))) {
fprintf(wp, "<A HREF=\"index.html\">Main</A>&nbsp;<A HREF=\"archivers.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 *)"Short name", archiver.name);
add_webtable(wp, (char *)"Available", getboolean(archiver.available));
add_webtable(wp, (char *)"Pack files", archiver.farc);
add_webtable(wp, (char *)"Pack mail", archiver.marc);
add_webtable(wp, (char *)"Pack banners", archiver.barc);
add_webtable(wp, (char *)"Test archive", archiver.tarc);
add_webtable(wp, (char *)"Unpack files", archiver.funarc);
add_webtable(wp, (char *)"Unpack mail", archiver.munarc);
add_webtable(wp, (char *)"Get FILE_ID.DIZ", archiver.iunarc);
add_webtable(wp, (char *)"List archive", archiver.varc);
fprintf(wp, "</TBODY>\n");
fprintf(wp, "</TABLE>\n");
close_webdoc(wp);
}
fprintf(ip, "<LI><A HREF=\"%s\">%s</A></LI>\n", temp, archiver.comment);
fprintf(fp, " Comment %s\n", archiver.comment);
fprintf(fp, " Short name %s\n", archiver.name);
fprintf(fp, " Available %s\n", getboolean(archiver.available));
fprintf(fp, " Pack files %s\n", archiver.farc);
fprintf(fp, " Pack mail %s\n", archiver.marc);
fprintf(fp, " Pack banners %s\n", archiver.barc);
fprintf(fp, " Test archive %s\n", archiver.tarc);
fprintf(fp, " Unpack files %s\n", archiver.funarc);
fprintf(fp, " Unpack mail %s\n", archiver.munarc);
fprintf(fp, " Get FILE_ID.DIZ %s\n", archiver.iunarc);
fprintf(fp, " List archive %s\n", archiver.varc);
fprintf(fp, "\n\n");
j++;
if (j == 4) {
page = newpage(fp, page);
fprintf(fp, "\n");
j = 0;
}
fclose(arch);
fprintf(ip, "</UL>\n");
close_webdoc(ip);
return page;
i++;
sprintf(temp, "archiver_%d.html", i);
if ((wp = open_webdoc(temp, (char *)"Archiver", archiver.comment))) {
fprintf(wp, "<A HREF=\"index.html\">Main</A>&nbsp;<A HREF=\"archivers.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 *)"Short name", archiver.name);
add_webtable(wp, (char *)"Available", getboolean(archiver.available));
add_webtable(wp, (char *)"Pack files", archiver.farc);
add_webtable(wp, (char *)"Pack mail", archiver.marc);
add_webtable(wp, (char *)"Pack banners", archiver.barc);
add_webtable(wp, (char *)"Test archive", archiver.tarc);
add_webtable(wp, (char *)"Unpack files", archiver.funarc);
add_webtable(wp, (char *)"Unpack mail", archiver.munarc);
add_webtable(wp, (char *)"Get FILE_ID.DIZ", archiver.iunarc);
add_webtable(wp, (char *)"List archive", archiver.varc);
fprintf(wp, "</TBODY>\n");
fprintf(wp, "</TABLE>\n");
close_webdoc(wp);
}
fprintf(ip, "<TR><TD><A HREF=\"%s\">%s</A></TD><TD>%s</TD><TD>%s</TD></TR>\n",
temp, archiver.name, archiver.comment, getboolean(archiver.available));
fprintf(fp, " Comment %s\n", archiver.comment);
fprintf(fp, " Short name %s\n", archiver.name);
fprintf(fp, " Available %s\n", getboolean(archiver.available));
fprintf(fp, " Pack files %s\n", archiver.farc);
fprintf(fp, " Pack mail %s\n", archiver.marc);
fprintf(fp, " Pack banners %s\n", archiver.barc);
fprintf(fp, " Test archive %s\n", archiver.tarc);
fprintf(fp, " Unpack files %s\n", archiver.funarc);
fprintf(fp, " Unpack mail %s\n", archiver.munarc);
fprintf(fp, " Get FILE_ID.DIZ %s\n", archiver.iunarc);
fprintf(fp, " List archive %s\n", archiver.varc);
fprintf(fp, "\n\n");
j++;
}
fclose(arch);
fprintf(ip, "</TBODY>\n");
fprintf(ip, "</TABLE>\n");
close_webdoc(ip);
return page;
}

View File

@ -545,8 +545,11 @@ int fido_doc(FILE *fp, FILE *toc, int page)
fread(&fidonethdr, sizeof(fidonethdr), 1, fido);
ip = open_webdoc((char *)"fidonet.html", (char *)"Fidonet networks", NULL);
fprintf(ip, "<A HREF=\"index.html\">Main</A>\n");
fprintf(ip, "<UL>\n");
fprintf(ip, "<A HREF=\"index.html\">Main</A>\n<P>\n");
fprintf(ip, "<TABLE width='400' border='0' cellspacing='0' cellpadding='2'>\n");
fprintf(ip, "<COL width='10%%'><COL width='70%%'><COL width='20%%'>\n");
fprintf(ip, "<TBODY>\n");
fprintf(ip, "<TR><TH align='left'>Zone</TH><TH align='left'>Comment</TH><TH align='left'>Available</TH></TR>\n");
while ((fread(&fidonet, fidonethdr.recsize, 1, fido)) == 1) {
@ -557,7 +560,8 @@ int fido_doc(FILE *fp, FILE *toc, int page)
}
sprintf(temp, "fidonet_%d.html", fidonet.zone[0]);
fprintf(ip, " <LI><A HREF=\"%s\">Zone %d</A> %s</LI>\n", temp, fidonet.zone[0], fidonet.comment);
fprintf(ip, " <TR><TD><A HREF=\"%s\">%d</A></TD><TD>%s</TD><TD>%s</TD></TR>\n",
temp, fidonet.zone[0], fidonet.comment, getboolean(fidonet.available));
if ((wp = open_webdoc(temp, (char *)"Fidonet network", fidonet.comment))) {
fprintf(wp, "<A HREF=\"index.html\">Main</A>&nbsp;<A HREF=\"fidonet.html\">Back</A>\n");
@ -603,7 +607,8 @@ int fido_doc(FILE *fp, FILE *toc, int page)
j++;
}
fprintf(ip, "</UL>\n");
fprintf(ip, "</TBODY>\n");
fprintf(ip, "</TABLE>\n");
close_webdoc(ip);
fclose(fido);

View File

@ -700,7 +700,11 @@ int modem_doc(FILE *fp, FILE *toc, int page)
ip = open_webdoc((char *)"modem.html", (char *)"Modems", NULL);
fprintf(ip, "<A HREF=\"index.html\">Main</A>\n");
fprintf(ip, "<UL>\n");
fprintf(ip, "<P>\n");
fprintf(ip, "<TABLE width='400' border='0' cellspacing='0' cellpadding='2'>\n");
fprintf(ip, "<COL width='10%%'><COL width='70%%'><COL width='20%%'>\n");
fprintf(ip, "<TBODY>\n");
fprintf(ip, "<TR><TH align='left'>Nr</TH><TH align='left'>Comment</TH><TH align='left'>Available</TH></TR>\n");
while ((fread(&modem, modemhdr.recsize, 1, mdm)) == 1) {
if (j == 1) {
@ -710,7 +714,8 @@ int modem_doc(FILE *fp, FILE *toc, int page)
}
nr++;
fprintf(ip, " <LI><A HREF=\"modem_%d.html\">%s</A></LI>\n", nr, modem.modem);
fprintf(ip, " <TR><TD><A HREF=\"modem_%d.html\">%d</A></TD><TD>%s</TD><TD>%s</TD></TR>\n",
nr, nr, modem.modem, getboolean(modem.available));
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");
@ -792,7 +797,8 @@ int modem_doc(FILE *fp, FILE *toc, int page)
j++;
}
fprintf(ip, "</UL>\n");
fprintf(ip, "</TBODY>\n");
fprintf(ip, "</TABLE>\n");
close_webdoc(ip);
fclose(mdm);

View File

@ -590,7 +590,11 @@ int tty_doc(FILE *fp, FILE *toc, int page)
ip = open_webdoc((char *)"ttyinfo.html", (char *)"TTY Lines", NULL);
fprintf(ip, "<A HREF=\"index.html\">Main</A>\n");
fprintf(ip, "<UL>\n");
fprintf(ip, "<P>\n");
fprintf(ip, "<TABLE width='400' border='0' cellspacing='0' cellpadding='2'>\n");
fprintf(ip, "<COL width='10%%'><COL width='70%%'><COL width='20%%'>\n");
fprintf(ip, "<TBODY>\n");
fprintf(ip, "<TR><TH align='left'>TTY</TH><TH align='left'>Comment</TH><TH align='left'>Available</TH></TR>\n");
while ((fread(&ttyinfo, ttyinfohdr.recsize, 1, tty)) == 1) {
if (j == 3) {
@ -600,7 +604,8 @@ int tty_doc(FILE *fp, FILE *toc, int page)
}
sprintf(temp, "ttyinfo_%s.html", ttyinfo.tty);
fprintf(ip, "<LI><A HREF=\"%s\">%s</A></LI>\n", temp, ttyinfo.comment);
fprintf(ip, "<TR><TD><A HREF=\"%s\">%s</A></TD><TD>%s</TD><TD>%s</TD></TR>\n",
temp, ttyinfo.tty, ttyinfo.comment, getboolean(ttyinfo.available));
if ((wp = open_webdoc(temp, (char *)"TTY Line", ttyinfo.comment))) {
/*
* There are devices like pts/1, this will create a subdir for the
@ -649,7 +654,8 @@ int tty_doc(FILE *fp, FILE *toc, int page)
j++;
}
fprintf(ip, "</UL>\n");
fprintf(ip, "</TBODY>\n");
fprintf(ip, "</TABLE>\n");
close_webdoc(ip);
fclose(tty);

View File

@ -441,7 +441,11 @@ int virus_doc(FILE *fp, FILE *toc, int page)
ip = open_webdoc((char *)"virscan.html", (char *)"Virus Scanners", NULL);
fprintf(ip, "<A HREF=\"index.html\">Main</A>\n");
fprintf(ip, "<UL>\n");
fprintf(ip, "<P>\n");
fprintf(ip, "<TABLE width='400' border='0' cellspacing='0' cellpadding='2'>\n");
fprintf(ip, "<COL width='10%%'><COL width='70%%'><COL width='20%%'>\n");
fprintf(ip, "<TBODY>\n");
fprintf(ip, "<TR><TH align='left'>Nr</TH><TH align='left'>Comment</TH><TH align='left'>Available</TH></TR>\n");
while ((fread(&virscan, virscanhdr.recsize, 1, vir)) == 1) {
@ -453,7 +457,8 @@ int virus_doc(FILE *fp, FILE *toc, int page)
nr++;
sprintf(temp, "virscan_%d.html", nr);
fprintf(ip, "<LI><A HREF=\"%s\">%s</A></LI>\n", temp, virscan.comment);
fprintf(ip, "<TR><TD><A HREF=\"%s\">%d</A></TD><TD>%s</TD><TD>%s</TD></TR>\n",
temp, nr, virscan.comment, getboolean(virscan.available));
if ((wp = open_webdoc(temp, (char *)"Virus Scanner", virscan.comment))) {
fprintf(wp, "<A HREF=\"index.html\">Main</A>&nbsp;<A HREF=\"virscan.html\">Back</A>\n");
fprintf(wp, "<P>\n");
@ -479,7 +484,8 @@ int virus_doc(FILE *fp, FILE *toc, int page)
j++;
}
fprintf(ip, "</UL>\n");
fprintf(ip, "</TBODY>\n");
fprintf(ip, "</TABLE>\n");
close_webdoc(ip);
fclose(vir);