man2html(by navichok26):

- Fixed Makefile.kos;
- Added auto-opening to webview.

git-svn-id: svn://kolibrios.org@9280 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
turbocat 2021-11-16 19:23:49 +00:00
parent 4003f26194
commit d3db09558e
3 changed files with 2364 additions and 2339 deletions

View File

@ -1,15 +1,19 @@
TCC = /kolibrios/develop/tcc/tcc KTCC_DIR = ../../develop/ktcc/trunk
NAME = man2html NAME = man2html
KTCC = kos32-tcc
KPACK = kpack
SRC = man2html.c cgibase.c abbrev.c strdefs.c SRC = man2html.c cgibase.c abbrev.c strdefs.c
CFLAGS = -D_KOLIBRI -DNOCGI CFLAGS = -D_KOLIBRI -DNOCGI -I$(KTCC_DIR)/libc.obj/include -I inc
LFLAGS = -nostdlib -L$(KTCC_DIR)/bin/lib $(KTCC_DIR)/bin/lib/crt0.o
LIBS = -ltcc -lc.obj LIBS = -ltcc -lc.obj
all: all:
$(KTCC) $(CFLAGS) $(SRC) $(LIBS) -o $(NAME) $(KTCC) $(CFLAGS) $(SRC) $(LFLAGS) $(LIBS) -o $(NAME)
$(KPACK) $(NAME)
clean: clean:
rm $(NAME) rm $(NAME)

View File

@ -13,13 +13,13 @@
* The default is to use cgibase. With relative html style * The default is to use cgibase. With relative html style
* we generate URLs of the form "../manX/page.html". * we generate URLs of the form "../manX/page.html".
*/ */
static int relat_html_style = 0; //static int relat_html_style = 0;
/* /*
* The default is to use cgibase. With current html style * The default is to use cgibase. With current html style
* we generate URLs of the form "./page.html". * we generate URLs of the form "./page.html".
*/ */
static int current_html_style = 0; static int current_html_style = 1;
/* /*
* Either the user is non-local (or local, but using httpd), * Either the user is non-local (or local, but using httpd),
@ -27,11 +27,15 @@ static int current_html_style = 0;
* and uses lynx, and we use lynxcgi:/home/httpd/cgi-bin. * and uses lynx, and we use lynxcgi:/home/httpd/cgi-bin.
*/ */
#if 0
static char *man2htmlpath = "/cgi-bin/man/man2html"; /* default */ static char *man2htmlpath = "/cgi-bin/man/man2html"; /* default */
static char *cgibase_format = "http://%s"; /* host.domain:port */ static char *cgibase_format = "http://%s"; /* host.domain:port */
static char *cgibase_ll_format = "lynxcgi:%s"; /* directory */ static char *cgibase_ll_format = "lynxcgi:%s"; /* directory */
static char *cgibase = "http://localhost"; /* default */ static char *cgibase = "http://localhost"; /* default */
#endif
/* /*
* Separator between URL and argument string. * Separator between URL and argument string.
* *
@ -82,6 +86,7 @@ man_page_html(char *sec, char *h) {
else else
fprintf(out, "<A HREF=\"./%s.html\">%s</A>", fprintf(out, "<A HREF=\"./%s.html\">%s</A>",
h, h); h, h);
#if 0
} else if (relat_html_style) { } else if (relat_html_style) {
if (!h) if (!h)
fprintf(out, "<A HREF=\"../index.html\">" fprintf(out, "<A HREF=\"../index.html\">"
@ -99,9 +104,11 @@ man_page_html(char *sec, char *h) {
else else
fprintf(out, "<A HREF=\"%s%s%c%s+%s\">%s</A>", fprintf(out, "<A HREF=\"%s%s%c%s+%s\">%s</A>",
cgibase, man2htmlpath, sep, sec, h, h); cgibase, man2htmlpath, sep, sec, h, h);
#endif
} }
} }
void void
ftp_html(char *f) { ftp_html(char *f) {
fprintf(out, "<A HREF=\"ftp://%s\">%s</A>", f, f); fprintf(out, "<A HREF=\"ftp://%s\">%s</A>", f, f);

File diff suppressed because it is too large Load Diff