From fb6348bd3872bf0c6180f8af4294579c2ed3d364 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Mon, 29 Mar 2004 20:41:26 +0000 Subject: [PATCH] Updates for html sitedocs --- TODO | 1 - mbsetup/Makefile | 2 +- mbsetup/m_bbs.c | 4 ++++ mbsetup/m_ff.c | 33 +++++++++++++++++++++++++++++++-- mbsetup/m_mail.c | 11 ++++++----- mbsetup/m_node.c | 2 +- mbsetup/m_ol.c | 33 +++++++++++++++++++++++++++++++++ mbsetup/m_ol.h | 1 + mbsetup/mbsetup.c | 14 +++----------- mbsetup/mutil.c | 10 ++++++++++ mbsetup/mutil.h | 1 + 11 files changed, 91 insertions(+), 21 deletions(-) diff --git a/TODO b/TODO index 68eef9af..14ea372d 100644 --- a/TODO +++ b/TODO @@ -170,7 +170,6 @@ mbsetup: N: When a message area is deleted, delete the rulesfile too. X: Generate crossreference document: - Filefind flags <=> TIC Areas Fileechos <=> Groups Fileechos <=> Magic processing Fileechos <=> Hatch diff --git a/mbsetup/Makefile b/mbsetup/Makefile index dd8c8f6d..ff734c6c 100644 --- a/mbsetup/Makefile +++ b/mbsetup/Makefile @@ -103,7 +103,7 @@ m_ff.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h stlist.h m_global. m_hatch.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h stlist.h m_global.h m_fgroup.h m_ticarea.h m_hatch.h m_mail.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h m_global.h m_marea.h m_mgroup.h m_mail.h m_modem.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h stlist.h m_global.h m_modem.h -m_ol.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h m_global.h m_ol.h +m_ol.o: ../config.h ../lib/mbselib.h ../lib/diesel.h screen.h mutil.h ledit.h m_global.h m_ol.h m_tic.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h m_fgroup.h m_ticarea.h m_magic.h m_hatch.h m_tic.h m_virus.o: ../config.h ../lib/mbselib.h ../paths.h screen.h mutil.h ledit.h stlist.h m_global.h m_virus.h stlist.o: ../config.h ../lib/mbselib.h stlist.h diff --git a/mbsetup/m_bbs.c b/mbsetup/m_bbs.c index 1094b0e4..0c4e9013 100644 --- a/mbsetup/m_bbs.c +++ b/mbsetup/m_bbs.c @@ -96,9 +96,13 @@ int bbs_doc(FILE *fp, FILE *toc, int page) addtoc(fp, toc, 8, 0, page, (char *)"BBS setup"); page = bbs_limits_doc(fp, toc, page); + dotter(); page = bbs_lang_doc(fp, toc, page); + dotter(); page = bbs_menu_doc(fp, toc, page); + dotter(); page = bbs_file_doc(fp, toc, page); + dotter(); page = bbs_prot_doc(fp, toc, page); return page; diff --git a/mbsetup/m_ff.c b/mbsetup/m_ff.c index c0b5f018..fab33cd4 100644 --- a/mbsetup/m_ff.c +++ b/mbsetup/m_ff.c @@ -433,8 +433,8 @@ void InitFilefind(void) int ff_doc(FILE *fp, FILE *toc, int page) { char temp[PATH_MAX]; - FILE *wp, *ip, *no; - int i = 0, j; + FILE *ti, *wp, *ip, *no; + int refs, nr, i = 0, j; sprintf(temp, "%s/etc/scanmgr.data", getenv("MBSE_ROOT")); if ((no = fopen(temp, "r")) == NULL) @@ -482,6 +482,35 @@ int ff_doc(FILE *fp, FILE *toc, int page) add_webdigit(wp, (char *)"Keyword length", scanmgr.keywordlen); fprintf(wp, "\n"); fprintf(wp, "\n"); + + fprintf(wp, "
\n"); + fprintf(wp, "

BBS File Areas Reference

\n"); + nr = refs = 0; + sprintf(temp, "%s/etc/fareas.data", getenv("MBSE_ROOT")); + if ((ti = fopen(temp, "r"))) { + fread(&areahdr, sizeof(areahdr), 1, ti); + while ((fread(&area, areahdr.recsize, 1, ti)) == 1) { + nr++; + if (area.Available) { + if (refs == 0) { + fprintf(wp, "\n"); + fprintf(wp, "\n"); + fprintf(wp, "\n"); + fprintf(wp, "\n"); + } + fprintf(wp, "\n", + nr, nr, getboolean(area.FileFind), area.Name); + refs++; + } + } + fclose(ti); + } + if (refs == 0) + fprintf(wp, "No BBS File Areas References\n"); + else { + fprintf(wp, "\n"); + fprintf(wp, "
AreaSearchDescription
Area %d%s%s
\n"); + } close_webdoc(wp); } diff --git a/mbsetup/m_mail.c b/mbsetup/m_mail.c index 71893076..36c92baa 100644 --- a/mbsetup/m_mail.c +++ b/mbsetup/m_mail.c @@ -76,13 +76,14 @@ void mail_menu(void) int mail_doc(FILE *fp, FILE *toc, int page) { - page = newpage(fp, page); - addtoc(fp, toc, 9, 0, page, (char *)"Mail setup"); + page = newpage(fp, page); + addtoc(fp, toc, 9, 0, page, (char *)"Mail setup"); - page = mail_group_doc(fp, toc, page); - page = mail_area_doc(fp, toc, page); + page = mail_group_doc(fp, toc, page); + dotter(); + page = mail_area_doc(fp, toc, page); - return page; + return page; } diff --git a/mbsetup/m_node.c b/mbsetup/m_node.c index c9a34715..c3b20b99 100644 --- a/mbsetup/m_node.c +++ b/mbsetup/m_node.c @@ -1422,7 +1422,7 @@ int node_doc(FILE *fp, FILE *toc, int page) sprintf(temp, "node_%d_%d_%d_%d_%s.html", nodes.Aka[0].zone, nodes.Aka[0].net, nodes.Aka[0].node, nodes.Aka[0].point, nodes.Aka[0].domain); - fprintf(ip, "
  • Node %s %s
  • \n", temp, aka2str(nodes.Aka[0]), nodes.Sysop); + fprintf(ip, "
  • %s %s
  • \n", temp, aka2str(nodes.Aka[0]), nodes.Sysop); if ((wp = open_webdoc(temp, (char *)"Fidonet node", aka2str(nodes.Aka[0])))) { fprintf(wp, "Main Back\n"); fprintf(wp, "

    \n"); diff --git a/mbsetup/m_ol.c b/mbsetup/m_ol.c index 1d220f78..7a0b7fa4 100644 --- a/mbsetup/m_ol.c +++ b/mbsetup/m_ol.c @@ -30,6 +30,7 @@ #include "../config.h" #include "../lib/mbselib.h" +#include "../lib/diesel.h" #include "screen.h" #include "mutil.h" #include "ledit.h" @@ -577,3 +578,35 @@ void ol_menu(void) } + +void ol_doc(void) +{ + FILE *fp, *wp; + char *temp, out[1024]; + int nr = 0; + + temp = calloc(PATH_MAX, sizeof(char)); + sprintf(temp, "%s/etc/oneline.data", getenv("MBSE_ROOT")); + if ((fp = fopen(temp, "r"))) { + if ((wp = open_webdoc((char *)"oneliners.html", (char *)"Oneliners", NULL))) { + fprintf(wp, "Main\n"); + fprintf(wp, "

    \n"); + fprintf(wp, "\n"); + fprintf(wp, "\n"); + fread(&olhdr, sizeof(olhdr), 1, fp); + while (fread(&ol, olhdr.recsize, 1, fp) == 1) { + nr++; + html_massage(ol.Oneline, out); + fprintf(wp, "\n", + nr, out, ol.UserName, ol.DateOfEntry, getboolean(ol.Available)); + } + fprintf(wp, "\n"); + fprintf(wp, "
    %d%s%s%s%s
    \n"); + close_webdoc(wp); + } + fclose(fp); + } + free(temp); +} + + diff --git a/mbsetup/m_ol.h b/mbsetup/m_ol.h index 2d3ee287..223e0ac5 100644 --- a/mbsetup/m_ol.h +++ b/mbsetup/m_ol.h @@ -8,6 +8,7 @@ int CountOneline(void); void EditOneline(void); void InitOneline(void); void ol_menu(void); +void ol_doc(void); #endif diff --git a/mbsetup/mbsetup.c b/mbsetup/mbsetup.c index 94239379..d86f21df 100644 --- a/mbsetup/mbsetup.c +++ b/mbsetup/mbsetup.c @@ -69,6 +69,7 @@ mode_t oldmask; /* Old umask value */ extern int do_quiet; /* Suppress log to screen */ extern int bbs_free; /* Free/Busy status */ +extern int horiz; /* Dot position in docs */ int exp_golded = FALSE; /* Export GoldED config */ int init = FALSE; /* Run init only */ @@ -184,17 +185,6 @@ void soft_info(void) } -int horiz; - -void dotter(void); -void dotter(void) -{ - Nopper(); - mvprintw(8, horiz++, (char *)"."); - fflush(stdout); -} - - void site_docs(void); void site_docs(void) @@ -301,6 +291,8 @@ void site_docs(void) page = task_doc(fp, toc, page); dotter(); page = route_doc(fp, toc, page); + dotter(); + ol_doc(); clrtoeol(); mvprintw( 8,11, (char *)"Created site documents in %s/doc", getenv("MBSE_ROOT")); fflush(stdout); diff --git a/mbsetup/mutil.c b/mbsetup/mutil.c index d6088551..1c3ff716 100644 --- a/mbsetup/mutil.c +++ b/mbsetup/mutil.c @@ -261,3 +261,13 @@ void add_statcnt(FILE *fp, char * hstr, statcnt st) } + +int horiz; + +void dotter(void) +{ + Nopper(); + mvprintw(8, horiz++, (char *)"."); + fflush(stdout); +} + diff --git a/mbsetup/mutil.h b/mbsetup/mutil.h index 56aebb82..2a0aa90c 100644 --- a/mbsetup/mutil.h +++ b/mbsetup/mutil.h @@ -14,5 +14,6 @@ void add_webtable(FILE *, char *, char *); void add_webdigit(FILE *, char *, int); void add_colors(FILE *, char *, int, int); void add_statcnt(FILE *, char *, statcnt); +void dotter(void); #endif