wok-6.x view man2html/stuff/man2html-slitaz.diff @ rev 21448

updated mk-livestatus (1.2.2 -> 1.2.8p25)
author Hans-G?nter Theisgen
date Mon Apr 29 16:37:24 2019 +0100 (2019-04-29)
parents
children
line source
1 --- /dev/null
2 +++ b/Makefile
3 @@ -0,0 +1,89 @@
4 +CFLAGS += -Wall -Wstrict-prototypes -Wmissing-prototypes -DGUNZIP='"gunzip"' `pkg-config --cflags --libs glib-2.0`
5 +# -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lglib-2.0
6 +OBJECTS = man2html.o cgibase.o abbrev.o strdefs.o
7 +bindir = $(DESTDIR)$(PREFIX)/usr/bin
8 +mandir = $(DESTDIR)$(PREFIX)/usr/share/man
9 +vardir = $(DESTDIR)$(PREFIX)/var
10 +httpdir = $(DESTDIR)$(PREFIX)/home/httpd
11 +cgidir = $(DESTDIR)$(PREFIX)/var/www
12 +sharedir = $(DESTDIR)$(PREFIX)/usr/share/man2html
13 +cgiowner = www
14 +cgigroup = www
15 +CC ?= gcc
16 +
17 +all: man2html hman
18 +
19 +man2html: $(OBJECTS)
20 + $(CC) -o man2html $(OBJECTS) $(CFLAGS)
21 +
22 +pot:
23 + mkdir -p po
24 + xgettext -o po/man2html.pot -k_ -kN_ \
25 + --package-name="man2html" \
26 + --from-code="UTF-8" \
27 + cgibase.c man2html.c hman.sh man.sh
28 +
29 +msgmerge:
30 + @for l in $(LINGUAS); do \
31 + echo -n "Updating $$l po file."; \
32 + msgmerge -U po/$$l.po po/man2html.pot; \
33 + done;
34 +
35 +msgfmt:
36 + @for l in $(LINGUAS); do \
37 + echo "Compiling $$l mo file..."; \
38 + mkdir -p po/mo/$$l/LC_MESSAGES; \
39 + msgfmt -o po/mo/$$l/LC_MESSAGES/man2html.mo po/$$l.po; \
40 + done;
41 +
42 +
43 +# man2html: ../src/version.h
44 +
45 +# This installs the man2html utility
46 +install: man2html
47 + mkdir -p $(bindir)
48 + install -m 755 man2html $(bindir)
49 + mkdir -p $(mandir)/man1
50 + install -m 644 man2html.1 $(mandir)/man1/man2html.1
51 +
52 +install-scripts: install-man-scripts install-glimpse-stuff install-hman
53 +
54 +# These are the scripts that allow pointing a browser at
55 +# http://localhost/cgi-bin/man/man2html
56 +# to work.
57 +install-man-scripts:
58 + mkdir -p $(cgidir)
59 + mkdir -p $(sharedir)
60 + install -m 755 scripts/cgi-bin/man/* $(cgidir)
61 + install -m 644 scripts/cgi-aux/man/* $(sharedir)
62 + install -d -o $(cgiowner) -g $(cgigroup) -m 775 $(vardir)/man2html
63 +# (aux was renamed to cgi-aux since aux causes problems under DOS)
64 +
65 +# If you have installed glimpse, and have compressed man pages,
66 +# then perhaps you also want these filters.
67 +install-glimpse-stuff:
68 + install -m 644 glimpse_filters $(vardir)/man2html/.glimpse_filters
69 +
70 +# In order not to have to type a long command like
71 +# netscape http://localhost/cgi-bin/man/man2html?section+topic
72 +# or
73 +# lynx lynxcgi:/home/httpd/cgi-bin/man/man2html?section+topic
74 +# it is convenient to have some shell script as a wrapper.
75 +# The script hman can be aliased to man. It uses an environment
76 +# variable MANHTMLPAGER to find out which browser you use, and
77 +# you can set MANHTMLHOST if the pages are not on localhost.
78 +hman: hman.sh
79 + rm -f hman
80 + sed -e 's,%version%,1.6g-7,' hman.sh > hman
81 +
82 +install-hman: hman
83 + install -m 555 hman $(bindir)/hman
84 + install -m 644 hman.1 $(mandir)/man1/hman.1
85 +
86 +clean:
87 + rm -f core hman man2html $(OBJECTS) *~
88 +
89 +spotless: clean
90 + rm -f Makefile
91 +
92 +$(OBJECTS): defs.h
93 --- a/abbrev.c
94 +++ b/abbrev.c
95 @@ -27,7 +27,7 @@
96 "SSO", "System Services Overview",
97 "TEXT", "Editing Text Files",
98 "DOCS", "Formatting Documents",
99 - "TROFF", "Using <B>nroff</B> and <B>troff</B>",
100 + "TROFF", "Using <b>nroff</b> and <b>troff</b>",
101 "INDEX", "Global Index",
102 "CPG", "C Programmer's Guide",
103 "CREF", "C Reference Manual",
104 @@ -46,7 +46,7 @@
105 "CGI", "SunCGI Reference Manual",
106 "CORE", "SunCore Reference Manual",
107 "4ASSY", "Sun-4 Assembly Language Reference",
108 - "SARCH", "<FONT SIZE=\"-1\">SPARC</FONT> Architecture Manual",
109 + "SARCH", "SPARC Architecture Manual",
110 "KR", "The C Programming Language",
111 0, 0 };
113 --- a/cgibase.c
114 +++ b/cgibase.c
115 @@ -8,6 +8,8 @@
116 #include <ctype.h> /* tolower() */
117 #include <string.h> /* strlen() */
118 #include "defs.h"
119 +#include <glib.h>
120 +#include <glib/gi18n.h>
122 /*
123 * The default is to use cgibase. With relative html style
124 @@ -21,8 +23,8 @@
125 * and uses lynx, and we use lynxcgi:/usr/lib/cgi-bin.
126 */
128 -static char *man2htmlpath = "/cgi-bin/man/man2html"; /* default */
129 -static char *cgibase_format = "http://%s"; /* host.domain:port */
130 +static char *man2htmlpath = ""; /* default */
131 +static char *cgibase_format = "%s"; /* host.domain:port */
132 static char *cgibase_ll_format = "lynxcgi:%s"; /* directory */
133 static char *cgibase = ""; /* default */
135 @@ -68,76 +70,46 @@
136 relat_html_style = 1;
137 }
139 -/* What shall we say in case of relat_html_style? */
140 -static char *signature = "<HR>\n"
141 -"This document was created by\n"
142 -"<A HREF=\"%s%s\">man2html</A>,\n"
143 -"using the manual pages.<BR>\n"
144 -"%s\n";
145 -
146 -#define TIMEFORMAT "%T GMT, %B %d, %Y"
147 -#define TIMEBUFSZ 500
148 -
149 void print_sig()
150 {
151 - char timebuf[TIMEBUFSZ];
152 - struct tm *timetm;
153 - time_t now;
154 -
155 - timebuf[0] = 0;
156 -#ifdef TIMEFORMAT
157 - sprintf(timebuf, "Time: ");
158 - now=time(NULL);
159 - timetm=gmtime(&now);
160 - strftime(timebuf+6, TIMEBUFSZ-6, TIMEFORMAT, timetm);
161 - timebuf[TIMEBUFSZ-1] = 0;
162 -#endif
163 - printf(signature, cgibase, man2htmlpath, timebuf);
164 + printf("</section>\n<footer>\n<p>%s</p>\n</footer>\n",
165 + _("This document was created by <b>man2html</b> using the manual pages."));
166 }
168 void
169 include_file_html(char *g) {
170 - printf("<A HREF=\"file:///usr/include/%s\">%s</A>&gt;", g,g);
171 + printf("<a href=\"file:///usr/include/%s\">%s</a>&gt;", g,g);
172 }
174 void
175 man_page_html(char *sec, char *h) {
176 - if (relat_html_style) {
177 - if (!h)
178 - printf("<A HREF=\"../index.html\">"
179 - "Return to Main Contents</A>");
180 - else
181 - printf("<A HREF=\"../man%s/%s.%s.html\">%s</A>",
182 - sec, h, sec, h);
183 - } else {
184 - if (!h)
185 - printf("<A HREF=\"%s%s\">Return to Main Contents</A>",
186 - cgibase, man2htmlpath);
187 - else if (!sec)
188 - printf("<A HREF=\"%s%s%c%s\">%s</A>",
189 - cgibase, man2htmlpath, sep, h, h);
190 - else
191 - printf("<A HREF=\"%s%s%c%s+%s\">%s</A>",
192 - cgibase, man2htmlpath, sep, sec, h, h);
193 - }
194 + if (!h)
195 + printf("<a href=\"?\">%s</a>",
196 + _("Return to Main Contents"));
197 + else if (!sec)
198 + printf("<a href=\"?%s\">%s</a>",
199 + h, h);
200 + else
201 + printf("<a href=\"?%s+%s\">%s</a>",
202 + sec, h, h);
203 }
205 void
206 ftp_html(char *f) {
207 - printf("<A HREF=\"ftp://%s\">%s</A>", f, f);
208 + printf("<a href=\"ftp://%s\">%s</a>", f, f);
209 }
211 void
212 www_html(char *f) {
213 - printf("<A HREF=\"http://%s\">%s</A>", f, f);
214 + printf("<a href=\"http://%s\">%s</a>", f, f);
215 }
217 void
218 mailto_html(char *g) {
219 - printf("<A HREF=\"mailto:%s\">%s</A>", g, g);
220 + printf("<a href=\"mailto:%s\">%s</a>", g, g);
221 }
223 void
224 url_html(char *g) {
225 - printf("<A HREF=\"%s\">%s</A>", g, g);
226 + printf("<a href=\"%s\">%s</a>", g, g);
227 }
228 --- a/hman.sh
229 +++ b/hman.sh
230 @@ -8,99 +8,83 @@
231 # Usage examples:
232 # hman - get start page
233 # hman man2html - get man page for man2html
234 -# hman 7 locale - get section 7 man page for locale
235 +# hman 7 locale - get section 7 man page for locale
236 # hman 1 - section 1 index of names only
237 # hman 3 index - section 3 index names+descriptions
238 # hman -k editor - search all man pages for some string
239 -# hman -P arena ./twm.man - specify browser; specify man page
240 +# hman -P arena ./twm.man - specify browser; specify man page
241 #
242 -# hman from %version%
243 +# hman from 1.6g-7
244 #
246 -if [ x"$1" = x"-v" ] || [ x"$1" = x"-V" ]; then
247 - echo "`basename $0` from %version%"
248 +. /usr/lib/slitaz/httphelper.sh
249 +. /lib/libtaz.sh
250 +
251 +# Internationalization
252 +export TEXTDOMAIN='man2html'
253 +_() { local T="$1"; shift; printf "$(gettext "$T")" "$@"; echo; }
254 +
255 +
256 +if [ "$1" == '-v' ] || [ "$1" == '-V' ]; then
257 + echo "$(basename $0) v. 1.6g-slitaz"
258 exit 0
259 fi
261 # The user has to set MANHTMLPAGER (or he will get httpd-free lynx).
262 # Pick your favorite browser: lynx, xmosaic, netscape, arena, amaya, grail, ...
263 -if [ x"$MANHTMLPAGER" = x ] && ! which lynx > /dev/null ; then
264 - HMAN_BROWSER=sensible-browser
265 -else
266 - HMAN_BROWSER=${MANHTMLPAGER-lynxcgi}
267 -fi
268 +HMAN_BROWSER="${MANHTMLPAGER:-tazweb}"
270 -#
271 # If the man pages are on a remote host, specify it in MANHTMLHOST.
272 -HOST=${MANHTMLHOST-localhost}
273 +HOST=${MANHTMLHOST:-localhost}
275 # Perhaps the browser was specified on the command line?
276 -if [ "$#" -gt 1 ] && [ x"$1" = x"-P" ]; then
277 - HMAN_BROWSER="$2"
278 - shift; shift
279 +if [ "$#" -gt 1 ] && [ "$1" == '-P' ]; then
280 + HMAN_BROWSER="$2"
281 + shift; shift
282 fi
284 # Perhaps the host was specified on the command line?
285 -if [ "$#" -gt 1 ] && [ x"$1" = x"-H" ]; then
286 - HOST="$2"
287 - shift; shift
288 +if [ "$#" -gt 1 ] && [ "$1" == '-H' ]; then
289 + HOST="$2"
290 + shift; shift
291 fi
293 -# Interface to a live (already running) netscape browser.
294 -nsfunc () {
295 - if ( /bin/ps xc | grep -q 'netscape$' ) ; then
296 - if [ -x netscape-remote ] ; then
297 - exec netscape-remote -remote "openURL($1,new_window)"
298 - else
299 - exec netscape -remote "openURL($1,new_window)"
300 - fi
301 - else
302 - netscape $1 &
303 - fi
304 -}
305 +CGI="http://$HOST/man.cgi"
307 -urlencode() {
308 - echo "$@" | perl -pe 'chomp(); s/([^A-Za-z0-9\ \_\-\.\/])/"%" . unpack("H*", $1)/eg; tr/ /+/;'
309 +enc() {
310 + echo "$@" | sed -e 's|+|%2B|g; s| |+|g';
311 }
313 -
314 -case "$HMAN_BROWSER" in
315 - lynxcgi)
316 - HMAN_BROWSER=lynx
317 - CG="lynxcgi:/usr/lib/cgi-bin/man"
318 - ;;
319 - netscape)
320 - HMAN_BROWSER=nsfunc
321 - CG="http://$HOST/cgi-bin/man"
322 - ;;
323 - *)
324 - CG="http://$HOST/cgi-bin/man"
325 - ;;
326 +case "$#" in
327 + 0)
328 + $HMAN_BROWSER "$CGI";;
329 + 1)
330 + case "$1" in
331 + 1|2|3|4|5|6|7|8|l|n)
332 + $HMAN_BROWSER "$CGI?$1";;
333 + /*)
334 + $HMAN_BROWSER "$CGI?$(enc "$1")";;
335 + */*)
336 + $HMAN_BROWSER "$CGI?$(enc "$(realpath "$PWD/$1")")";;
337 + *)
338 + $HMAN_BROWSER "$CGI?$(enc "$1")";;
339 + esac
340 + ;;
341 + 2)
342 +# case "$1" in
343 +# -k)
344 +# $HMAN_BROWSER "$CGI?search=$(enc "$2")";;
345 +# *)
346 +# if [ "$2" == 'index' ]; then
347 +# $HMAN_BROWSER "$CGI?whatis=$(enc "$1")"
348 +# else
349 + $HMAN_BROWSER "$CGI?$(enc "$1 $2")"
350 +# fi
351 +# ;;
352 +# esac
353 + ;;
354 + *)
355 + _ 'bad number of args';;
356 esac
357 -
358 - case "$#" in
359 - 0) $HMAN_BROWSER "$CG/man2html" ;;
360 - 1) case "$1" in
361 - 1|2|3|4|5|6|7|8|l|n)
362 - $HMAN_BROWSER "$CG/mansec?query=$1" ;;
363 - /*)
364 - $HMAN_BROWSER "$CG/man2html?query=`urlencode "$1"`" ;;
365 - */*)
366 - $HMAN_BROWSER "$CG/man2html?query=`urlencode "$PWD/$1"`" ;;
367 - *)
368 - $HMAN_BROWSER "$CG/man2html?query=`urlencode "$1"`" ;;
369 - esac ;;
370 - 2) case "$1" in
371 - -k)
372 - $HMAN_BROWSER "$CG/mansearch?query=`urlencode "$2"`" ;;
373 - *)
374 - if [ "$2" = index ]; then
375 - $HMAN_BROWSER "$CG/manwhatis?query=`urlencode "$1"`"
376 - else
377 - $HMAN_BROWSER "$CG/man2html?query=`urlencode "$1 $2"`"
378 - fi ;;
379 - esac ;;
380 - *) echo "bad number of args" ;;
381 - esac
383 exit 0
384 --- /dev/null
385 +++ b/man.sh
386 @@ -0,0 +1,292 @@
387 +#!/bin/sh
388 +# man2html cgi script - uses /usr/bin/man2html to format man pages
389 +# aeb@cwi.nl - 980109
390 +# Aleksej Bobylev <al.bobylev@gmail.com>, 2015-2016
391 +
392 +. /usr/lib/slitaz/httphelper.sh
393 +. /lib/libtaz.sh
394 +
395 +# Internationalization.
396 +[ -e /etc/locale.conf ] && . /etc/locale.conf
397 +export TEXTDOMAIN='man2html'
398 +export LANG LC_ALL
399 +_() { local T="$1"; shift; printf "$(gettext "$T")" "$@"; echo; }
400 +
401 +
402 +SECTIONS="$(_ 'User Commands'):$(_ 'System Calls'):$(_ 'C Library Functions'):\
403 +$(_ 'Devices and Network Interfaces'):$(_ 'File Formats'):\
404 +$(_ 'Games and Demos'):$(_ 'Environments, Tables, and Troff Macros'):\
405 +$(_ 'Maintenance Commands'):$(_ 'All available manual pages')"
406 +
407 +query="$(GET query)"
408 +if [ -z "$query" ]; then
409 + set -- $(echo $(GET) | tr '+' ' ')
410 +else
411 + set -- $(echo $(GET query) | tr '+' ' ')
412 +fi
413 +
414 +
415 +if [ $1 == 'css' ]; then
416 + # post css file on query
417 + header 'Content-Type: text/css'
418 + cat /usr/share/doc/slitaz-doc.css
419 +fi
420 +
421 +if [ $# -eq 1 ]; then
422 + case $1 in
423 + 1|2|3|4|5|6|7|8|all)
424 + if [ "$1" == 'all' ]; then
425 + sec_n='9'; sec_folder='man?'
426 + else
427 + sec_n="$1"; sec_folder="man$1"
428 + fi
429 + sec_desc=$(echo "$SECTIONS" | cut -d':' -f $sec_n)
430 + header
431 + cat <<EOT
432 +<!DOCTYPE html>
433 +<html>
434 +<head>
435 + <title>$1. $sec_desc</title>
436 + <link rel="stylesheet" href="?css">
437 +</head>
438 +<body><header><h1>$(_ 'Section %s: %s' $1 "$sec_desc")</h1></header>
439 + <section><header>$(_ 'Manual Pages')</header>
440 + <p>
441 +EOT
442 +
443 + case $1 in
444 + 1) _ "Section 1 of the manual describes user commands and tools, for example, file \
445 +manipulation tools, shells, compilers, web browsers, file and image viewers and editors, and so \
446 +on.";;
447 + 2) _ "Section 2 of the manual describes the Linux system calls. A system call is \
448 +an entry point into the Linux kernel.";;
449 + 3) _ "Section 3 of the manual describes all library functions excluding the \
450 +library functions (system call wrappers) described in Section 2, which implement system calls.";;
451 + 4) _ "Section 4 of the manual describes special files (devices).";;
452 + 5) _ "Section 5 of the manual describes various file formats, as well as the \
453 +corresponding C structures, if any.";;
454 + 6) _ "Section 6 of the manual describes all the games and funny little programs \
455 +available on the system.";;
456 + 7) _ "Section 7 of the manual provides overviews on various topics, and describes \
457 +conventions and protocols, character set standards, the standard filesystem layout, and \
458 +miscellaneous other things.";;
459 + 8) _ "Section 8 of the manual describes commands which either can be or are used \
460 +only by the superuser, like system-administration commands, daemons, and hardware-related \
461 +commands.";;
462 + esac
463 +
464 + [ "$1" != 'all' ] && echo "<b><a href=\"?intro.$1\">intro</a></b>($1)"
465 + echo '</p>'
466 +
467 + temp="$(mktemp)"; temp2="$(mktemp)"
468 + for dir in $(find /usr/share/man -type d -name "$sec_folder"); do
469 + ls $dir | sed 's|\.\([0-9]\)\.*[bgx]*z*2*$|:\1|'
470 + # fix sorting 'feature': leading '_' always ignored by `sort`
471 + done | sed 's|_|zzzzzzzz|g' | sort -fu | sed 's|zzzzzzzz|_|g' | \
472 + awk -F' ' -vtemp="$temp" -vtemp2="$temp2" '
473 + {
474 + split($1, man, ":");
475 +
476 + letter = tolower(substr(man[1], 1, 1));
477 + if (letter != last_letter) {
478 + last_letter = letter;
479 + letter_index[++num_letters] = letter;
480 + print "<h3 id=\"l" letter "\">" toupper(letter) "</h3>" > temp;
481 + }
482 + lnk = man[1]; gsub("+", "%2b", lnk);
483 + printf "<b><a href=\"?%s.%s\">%s</a></b>(%s) ", lnk, man[2], man[1], man[2] > temp;
484 + }
485 + END {
486 + # Print out alphabetic quick index and other links
487 + for (i = 1; i <= num_letters; i++) {
488 + print "<a href=\"#l" letter_index[i] section "\">" toupper(letter_index[i]) "</a>" > temp2;
489 + }
490 + }
491 + '
492 + if [ -s "$temp" ]; then
493 + echo '<hr>'; cat "$temp2"; echo '<hr>'
494 + cat "$temp"
495 + echo '<hr>'; cat "$temp2"; echo '<hr>'
496 + fi
497 +
498 + rm -f "$temp" "$temp2"
499 +
500 + cat <<EOT
501 + </section>
502 + <section><header>$(_ 'Sections')</header>
503 + <ol>
504 +EOT
505 + for i in $(seq 8); do
506 + sec_desc=$(echo "$SECTIONS" | cut -d':' -f $i)
507 + echo "<li><a href=\"?$i\">$sec_desc</a></li>"
508 + done
509 + cat <<EOT
510 + </ol>
511 + <p><a href="?all">$(_ 'All Sections')</a></p>
512 +</section>
513 +
514 +</body>
515 +</html>
516 +EOT
517 + exit 0
518 + ;;
519 + esac
520 +fi
521 +
522 +# Find the required page - expect to be called with "man2html [sec] page".
523 +# There may a prefixed "-M manpath" option.
524 +
525 +if [ $# -ge 2 -a "$1" == '-M' ]; then
526 + MANPATH="$2"
527 + export MANPATH
528 + shift; shift
529 + MP=' using the given MANPATH'
530 +else
531 + MP=''
532 +fi
533 +
534 +
535 +# If no arguments given, show a start page.
536 +
537 +if [ $# -eq 0 ]; then
538 + header
539 + cat <<EOT
540 +<!DOCTYPE html>
541 +<html>
542 +<head>
543 + <meta charset="UTF-8">
544 + <title>$(_ 'Manual Pages - Main Contents')</title>
545 + <link rel="stylesheet" href="?css">
546 +</head>
547 +<body>
548 +<header><h1>$(_ 'Manual Pages - Main Contents')</h1></header>
549 +<section><header>$(_ 'Name and Section lookup')</header>
550 + <form method="GET">
551 + <input name="query" size="40">
552 + <button type="submit">$(_ 'Search')</button>
553 + </form>
554 + <p>$(_ "You can enter a program name, possibly preceded by the section, the directories to search \
555 +(with -M) or a full name. For example:")</p>
556 +
557 + <ul>
558 + <li><tt>find</tt></li>
559 + <li><tt>1 find</tt></li>
560 + <li><tt>-M /usr/share/man:/opt/man:/usr/local/share/man find</tt></li>
561 + <li><tt>/usr/share/man/man1/gperf.1</tt></li>
562 + </ul>
563 +</section>
564 +
565 +<section><header>$(_ 'Index of pages')</header>
566 +
567 + <ol>
568 +EOT
569 + for i in $(seq 8); do
570 + sec_desc=$(echo "$SECTIONS" | cut -d':' -f $i)
571 + echo "<li><a href=\"?$i\">$sec_desc</a></li>"
572 + done
573 + cat <<EOT
574 + </ol>
575 + <p><a href="?all">$(_ 'All Sections')</a></p>
576 +</section>
577 +
578 +<footer>
579 + <p>$(_ 'The original man2html program and scripts are due to %s and %s.' \
580 + '<a href="http://wsinwp01.win.tue.nl:1234/index.html">Richard Verhoeven</a>' \
581 + '<a href="mailto:michael@actrix.gen.nz">Michael Hamilton</a>')
582 + $(_ 'This version is from %s maintained by %s.' 'man-1.6g' \
583 + '<a href="mailto:flucifredi@acm.org">Federico Lucifredi</a>')</p>
584 +</footer>
585 +</body>
586 +</html>
587 +EOT
588 + exit 0
589 +fi
590 +
591 +if [ $# -gt 2 ]; then
592 + man2html -E "man2html: bad invocation: too many arguments"
593 + exit 0
594 +fi
595 +
596 +# A single argument may be an explicitly give path name
597 +# Otherwise, find it
598 +
599 +if [ $# -eq 1 ]; then
600 + arg=${1//%2b/+}
601 + case "$arg" in
602 + /*) PAGE="$arg";;
603 + *.*) PAGE=$(find /usr/share/man \( -type f -o -type l \) \( -name "$arg" -o -name "$arg.gz" -o -name "$arg.bz2" -o -name "$arg.xz" \));;
604 + *) PAGE=$(find /usr/share/man \( -type f -o -type l \) \( -name "$arg.*" -o -name "$arg.*.gz" -o -name "$arg.*.bz2" -o -name "$arg.*.xz" \));;
605 + esac
606 +else
607 + arg=${2//%2b/+}
608 + PAGE="$(
609 + for dir in $(find /usr/share/man -type d -name man$1); do
610 + find $dir \( -type f -o -type l \) -name "$arg.$1*"
611 + done)"
612 +fi
613 +
614 +if [ -z "$PAGE" ]; then
615 + complaint="$(_ 'Cannot find a page')"
616 + if [ $# -eq 1 ]; then
617 + complaint="$(_ 'Cannot find a page for <b>%s</b> %s' $1 $MP)"
618 + else
619 + complaint="$(_ 'Cannot find a page for <b>%s</b> in section <b>%s</b> %s') $2 $1 $MP"
620 + fi
621 + man2html -E "<p>$complaint</p>"
622 + exit 0
623 +fi
624 +
625 +if [ "$(echo "$PAGE" | wc -l)" -gt 1 ]; then
626 + header
627 + cat <<EOT
628 +<!DOCTYPE html>
629 +<html><head><title>$(_ 'Multiple pages')</title>
630 +<link rel="stylesheet" href="?css"></link></head>
631 +<body><header><h1>$(_ 'Multiple pages found')</h1></header>
632 + <section>
633 + <ul>
634 +EOT
635 + echo "$PAGE" | awk -F'/' '{
636 + if ($5 ~ "man") {
637 + split($6, man, ".");
638 + printf "<li><a href=\"?%s\">%s</a> (%s)</li>\n", $0, man[1], man[2];
639 + } else {
640 + split($7, man, ".");
641 + printf "<li><a href=\"?%s\">%s</a> (%s) — %s</li>\n", $0, man[1], man[2], $5;
642 + }
643 + }'
644 + sed 's|^.*$|<li><a href="?&">&</a></li>|'
645 + echo '</ul></section></body></html>'
646 + exit 0
647 +fi
648 +
649 +if [ -r "$PAGE" ]; then
650 + tmpman="$(mktemp)"
651 + # Unpack man page
652 + case "$PAGE" in
653 + *.gz) zcat "$PAGE" > "$tmpman";;
654 + *.bz2) bzcat "$PAGE" > "$tmpman";;
655 + *.xz) xzcat "$PAGE" > "$tmpman";;
656 + *) cp "$PAGE" "$tmpman";;
657 + esac
658 +
659 + # Check for link
660 + line="$(fgrep -v '.\"' "$tmpman" | head -n1)"
661 + case "$line" in
662 + .so*)
663 + link="$(echo "$line" | cut -d'/' -f2)"
664 + header "HTTP/1.1 301 Moved Permanently" \
665 + "Location: ?$link"
666 + ;;
667 + *)
668 + # Convert page to HTML
669 + man2html "$tmpman"
670 + ;;
671 + esac
672 +
673 + # Clean
674 + rm "$tmpman"
675 +else
676 + man2html -E "Strange... Cannot find (or read) $PAGE."
677 +fi
678 +exit 0
679 --- a/man2html.c
680 +++ b/man2html.c
681 @@ -21,14 +21,17 @@
682 #include <ctype.h>
683 #include <sys/stat.h>
684 #include "defs.h"
685 -#include "../src/version.h"
686 +#include "version.h"
687 +#include <glib.h>
688 +#include <glib/gi18n.h>
689 +#define GETTEXT_PACKAGE "man2html"
691 /* BSD mandoc Bd/Ed example(?) blocks */
692 #define BD_LITERAL 1
693 #define BD_INDENT 2
695 #define SIZE(a) (sizeof(a)/sizeof(*a))
696 -#define DOCTYPE "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"
697 +#define DOCTYPE "<!DOCTYPE html>\n"
698 #define CONTENTTYPE "Content-type: text/html; charset=UTF-8\n\n"
700 static char NEWLINE[2]="\n";
701 @@ -58,28 +61,13 @@
703 static char charb[3];
705 -#ifdef GUNZIP
706 -/* from src/utils.c */
707 -static int
708 -is_shell_safe(const char *ss, int quoted) {
709 - char *bad = " ;'\\\"<>|";
710 - char *p;
712 - if (quoted)
713 - bad++; /* allow a space inside quotes */
714 - for (p = bad; *p; p++)
715 - if (strchr(ss, *p))
716 - return 0;
717 - return 1;
718 -}
719 -#endif
720 -
721 /* reads the entire manpage into buffer *buf and returns number of chars read */
722 static int
723 read_manpage_into_buffer(char *path, char **buf) {
724 int compressed = 0;
725 FILE * f = NULL;
726 - char * ext;
727 + /* char * ext; */
728 int l = 0;
729 struct stat stbuf;
731 @@ -94,26 +82,6 @@
732 char * tmp = NULL;
733 char * command = NULL;
734 char * openpath = path;
735 -#ifdef GUNZIP
736 -
737 - if (is_shell_safe(openpath, 1)) {
738 - ext = strrchr(openpath, '.');
739 - compressed = (ext && !strcmp(ext, ".gz"));
740 -
741 - if (!compressed && stat(openpath, &stbuf)) {
742 - tmp = (char*) xmalloc(strlen(path) + 4);
743 - sprintf(tmp, "%s.gz", path);
744 - if ((compressed = !stat(tmp, &stbuf)))
745 - openpath = tmp;
746 - }
747 - }
748 -
749 - if (compressed) {
750 - command = (char*) xmalloc(strlen(openpath) + sizeof(GUNZIP) + 4);
751 - sprintf(command, GUNZIP " '%s'", openpath);
752 - f = popen(command, "r");
753 - } else
754 -#endif
755 f = fopen(openpath, "r");
757 if (tmp) free(tmp);
758 @@ -170,7 +138,7 @@
760 h = chardef;
761 if (h->nr != V('*','*')) {
762 - printf("chardef corrupted\n");
763 + printf("%s\n", _("chardef corrupted"));
764 exit(1);
765 }
767 @@ -216,7 +184,7 @@
768 ** Add the links to the output.
769 ** At the moment the following are recognized:
770 **
771 - ** name(*) -> ../man?/name.*
772 + ** name(*) -> ?name.*
773 ** method://string -> method://string
774 ** www.host.name -> http://www.host.name
775 ** ftp.host.name -> ftp://ftp.host.name
776 @@ -453,8 +421,8 @@
777 #define DL 1
778 #define UL 2
779 #define OL 3
780 -static char *dl_open[4] = { "", "<DL COMPACT>\n", "<UL>", "<OL>" };
781 -static char *dl_close[4] = { "", "</DL>\n", "</UL>", "</OL>" };
782 +static char *dl_open[4] = { "", "<dl compact>\n", "<ul>", "<ol>" };
783 +static char *dl_close[4] = { "", "</dl>\n", "</ul>", "</ol>" };
785 static inline void
786 dl_begin(void) {
787 @@ -462,7 +430,7 @@
788 out_html(dl_open[DL]);
789 dl_set[itemdepth]=DL;
790 }
791 - out_html("<DT>");
792 + out_html("<dt>");
793 }
795 static inline void
796 @@ -481,14 +449,14 @@
797 itemdepth++;
798 if (itemdepth < SIZE(dl_set))
799 dl_set[itemdepth]=noDL;
800 - out_html("<DL COMPACT><DT><DD>");
801 + out_html("<dl compact><dt><dd>");
802 }
804 static inline void
805 dl_endlevel(void) {
806 if (itemdepth) {
807 dl_end();
808 - out_html("</DL>\n");
809 + out_html("</dl>\n");
810 itemdepth--;
811 }
812 }
813 @@ -538,12 +506,12 @@
815 #define FO0 ""
816 #define FC0 ""
817 -#define FO1 "<I>"
818 -#define FC1 "</I>"
819 -#define FO2 "<B>"
820 -#define FC2 "</B>"
821 -#define FO3 "<TT>"
822 -#define FC3 "</TT>"
823 +#define FO1 "<i>"
824 +#define FC1 "</i>"
825 +#define FO2 "<b>"
826 +#define FC2 "</b>"
827 +#define FO3 "<tt>"
828 +#define FC3 "</tt>"
830 char *switchfont[16] = { "" , FC0 FO1, FC0 FO2, FC0 FO3,
831 FC1 FO0, "" , FC1 FO2, FC1 FO3,
832 @@ -588,14 +556,16 @@
833 i=current_font;
834 sizebuf[0]=0;
835 strcat(sizebuf, change_to_font(0));
836 - if (current_size) strcat(sizebuf, "</FONT>");
837 + if (current_size) strcat(sizebuf, "</span>");
838 current_size=nr;
839 if (nr) {
840 int l;
841 - strcat(sizebuf, "<FONT SIZE=\"");
842 + strcat(sizebuf, "<span style=\"font-size: ");
843 l=strlen(sizebuf);
844 if (nr>0) sizebuf[l++]='+'; else sizebuf[l++]='-',nr=-nr;
845 sizebuf[l++]=nr+'0';
846 + sizebuf[l++]='p';
847 + sizebuf[l++]='t';
848 sizebuf[l++]='"';
849 sizebuf[l++]='>';
850 sizebuf[l]=0;
851 @@ -775,7 +745,7 @@
852 skip_escape=exskipescape;
853 intresult=j;
854 break;
855 - case 'l': h="<HR>"; curpos=0;
856 + case 'l': h="<hr>"; curpos=0;
857 case 'b':
858 case 'v':
859 case 'x':
860 @@ -812,7 +782,7 @@
861 case 'c': no_newline_output=1; break;
862 case '{': newline_for_fun++; h="";break;
863 case '}': if (newline_for_fun) newline_for_fun--; h="";break;
864 - case 'p': h="<BR>\n";curpos=0; break;
865 + case 'p': h="<br>\n";curpos=0; break;
866 case 't': h="\t";curpos=(curpos+8)&0xfff8; break;
867 case '<': h="&lt;";curpos++; break;
868 case '>': h="&gt;";curpos++; break;
869 @@ -1021,7 +991,7 @@
870 out_html(change_to_size(0));
871 if (!fillout) {
872 fillout=1;
873 - out_html("</PRE>");
874 + out_html("</pre>");
875 }
876 while (*h && *h!='\n') h++;
877 if (h[-1]==';') {
878 @@ -1197,45 +1167,45 @@
879 currow=currow->prev;
880 }
881 /* produce html output */
882 - if (center) out_html("<CENTER>");
883 - if (box==2) out_html("<TABLE BORDER><TR><TD>");
884 - out_html("<TABLE");
885 + if (center) out_html("<div style=\"margin: 0 auto\">");
886 + if (box==2) out_html("<table border><tr><td>");
887 + out_html("<table");
888 if (box || border) {
889 - out_html(" BORDER");
890 - if (!border) out_html("><TR><TD><TABLE");
891 - if (expand) out_html(" WIDTH=100%");
892 + out_html(" border");
893 + if (!border) out_html("><tr><td><table");
894 + if (expand) out_html(" width=100%");
895 }
896 out_html(">\n");
897 currow=layout;
898 while (currow) {
899 j=0;
900 - out_html("<TR VALIGN=top>");
901 + out_html("<tr style=\"vertical-align: top\">");
902 curfield=currow->first;
903 while (curfield) {
904 if (curfield->align!='S' && curfield->align!='^') {
905 - out_html("<TD");
906 + out_html("<td");
907 switch (curfield->align) {
908 case 'N':
909 curfield->space+=4;
910 case 'R':
911 - out_html(" ALIGN=right");
912 + out_html(" style=\"text-align: right\"");
913 break;
914 case 'C':
915 - out_html(" ALIGN=center");
916 + out_html(" style=\"text-align: center\"");
917 default:
918 break;
919 }
920 if (!curfield->valign && curfield->rowspan>1)
921 - out_html(" VALIGN=center");
922 + out_html(" style=\"vertical-align: center\"");
923 if (curfield->colspan>1) {
924 char buf[5];
925 - out_html(" COLSPAN=");
926 + out_html(" colspan=");
927 sprintf(buf, "%i", curfield->colspan);
928 out_html(buf);
929 }
930 if (curfield->rowspan>1) {
931 char buf[5];
932 - out_html(" ROWSPAN=");
933 + out_html(" rowspan=");
934 sprintf(buf, "%i", curfield->rowspan);
935 out_html(buf);
936 }
937 @@ -1244,8 +1214,8 @@
938 if (curfield->size) out_html(change_to_size(curfield->size));
939 if (curfield->font) out_html(change_to_font(curfield->font));
940 switch (curfield->align) {
941 - case '=': out_html("<HR><HR>"); break;
942 - case '_': out_html("<HR>"); break;
943 + case '=': out_html("<hr><hr>"); break;
944 + case '_': out_html("<hr>"); break;
945 default:
946 if (curfield->contents) out_html(curfield->contents);
947 break;
948 @@ -1255,20 +1225,20 @@
949 if (curfield->font) out_html(change_to_font(0));
950 if (curfield->size) out_html(change_to_size(0));
951 if (j>=maxcol && curfield->align>'@' && curfield->align!='_')
952 - out_html("<BR>");
953 - out_html("</TD>");
954 + out_html("<br>");
955 + out_html("</td>");
956 }
957 curfield=curfield->next;
958 }
959 - out_html("</TR>\n");
960 + out_html("</tr>\n");
961 currow=currow->next;
962 }
963 - if (box && !border) out_html("</TABLE>");
964 - out_html("</TABLE>");
965 - if (box==2) out_html("</TABLE>");
966 - if (center) out_html("</CENTER>\n");
967 + if (box && !border) out_html("</table>");
968 + out_html("</table>");
969 + if (box==2) out_html("</table>");
970 + if (center) out_html("</div>\n");
971 else out_html("\n");
972 - if (!oldfillout) out_html("<PRE>");
973 + if (!oldfillout) out_html("<pre>");
974 fillout=oldfillout;
975 out_html(change_to_size(oldsize));
976 out_html(change_to_font(oldfont));
977 @@ -1401,7 +1371,7 @@
978 case '&': value = (value && value2); break;
979 case ':': value = (value || value2); break;
980 default: fprintf(stderr,
981 - "man2html: Unknown operator %c.\n", oper);
982 + _("man2html: Unknown operator %c.\n"), oper);
983 }
984 oper=0;
985 }
986 @@ -1489,42 +1459,42 @@
989 char *section_list[] = {
990 - "1", "User Commands ",
991 - "1C", "User Commands",
992 - "1G", "User Commands",
993 - "1S", "User Commands",
994 - "1V", "User Commands ",
995 - "2", "System Calls",
996 - "2V", "System Calls",
997 - "3", "C Library Functions",
998 - "3C", "Compatibility Functions",
999 - "3F", "Fortran Library Routines",
1000 - "3K", "Kernel VM Library Functions",
1001 - "3L", "Lightweight Processes Library",
1002 - "3M", "Mathematical Library",
1003 - "3N", "Network Functions",
1004 - "3R", "RPC Services Library",
1005 - "3S", "Standard I/O Functions",
1006 - "3V", "C Library Functions",
1007 - "3X", "Miscellaneous Library Functions",
1008 - "4", "Devices and Network Interfaces",
1009 - "4F", "Protocol Families",
1010 - "4I", "Devices and Network Interfaces",
1011 - "4M", "Devices and Network Interfaces",
1012 - "4N", "Devices and Network Interfaces",
1013 - "4P", "Protocols",
1014 - "4S", "Devices and Network Interfaces",
1015 - "4V", "Devices and Network Interfaces",
1016 - "5", "File Formats",
1017 - "5V", "File Formats",
1018 - "6", "Games and Demos",
1019 - "7", "Environments, Tables, and Troff Macros",
1020 - "7V", "Environments, Tables, and Troff Macros",
1021 - "8", "Maintenance Commands",
1022 - "8C", "Maintenance Commands",
1023 - "8S", "Maintenance Commands",
1024 - "8V", "Maintenance Commands",
1025 - "L", "Local Commands",
1026 + "1", N_("User Commands"),
1027 + "1C", N_("User Commands"),
1028 + "1G", N_("User Commands"),
1029 + "1S", N_("User Commands"),
1030 + "1V", N_("User Commands"),
1031 + "2", N_("System Calls"),
1032 + "2V", N_("System Calls"),
1033 + "3", N_("C Library Functions"),
1034 + "3C", N_("Compatibility Functions"),
1035 + "3F", N_("Fortran Library Routines"),
1036 + "3K", N_("Kernel VM Library Functions"),
1037 + "3L", N_("Lightweight Processes Library"),
1038 + "3M", N_("Mathematical Library"),
1039 + "3N", N_("Network Functions"),
1040 + "3R", N_("RPC Services Library"),
1041 + "3S", N_("Standard I/O Functions"),
1042 + "3V", N_("C Library Functions"),
1043 + "3X", N_("Miscellaneous Library Functions"),
1044 + "4", N_("Devices and Network Interfaces"),
1045 + "4F", N_("Protocol Families"),
1046 + "4I", N_("Devices and Network Interfaces"),
1047 + "4M", N_("Devices and Network Interfaces"),
1048 + "4N", N_("Devices and Network Interfaces"),
1049 + "4P", N_("Protocols"),
1050 + "4S", N_("Devices and Network Interfaces"),
1051 + "4V", N_("Devices and Network Interfaces"),
1052 + "5", N_("File Formats"),
1053 + "5V", N_("File Formats"),
1054 + "6", N_("Games and Demos"),
1055 + "7", N_("Environments, Tables, and Troff Macros"),
1056 + "7V", N_("Environments, Tables, and Troff Macros"),
1057 + "8", N_("Maintenance Commands"),
1058 + "8C", N_("Maintenance Commands"),
1059 + "8S", N_("Maintenance Commands"),
1060 + "8V", N_("Maintenance Commands"),
1061 + "L", N_("Local Commands"),
1062 /* for Solaris:
1063 "1", "User Commands",
1064 "1B", "SunOS/BSD Compatibility Package Commands",
1065 @@ -1593,7 +1563,7 @@
1066 "9s", "DDI and DKI Data Structures",
1067 "L", "Local Commands",
1068 */
1069 - NULL, "Misc. Reference Manual Pages",
1070 + NULL, N_("Misc. Reference Manual Pages"),
1071 NULL, NULL
1072 };
1074 @@ -1604,7 +1574,7 @@
1076 if (!c) return "";
1077 while (section_list[i] && strcmp(c,section_list[i])) i=i+2;
1078 - if (section_list[i+1]) return section_list[i+1];
1079 + if (section_list[i+1]) return _(section_list[i+1]);
1080 else return c;
1083 @@ -1636,10 +1606,10 @@
1084 if (level != subs) {
1085 manidx_need(6);
1086 if (subs) {
1087 - strcpy(manidx+mip, "</DL>\n");
1088 + strcpy(manidx+mip, "</dl>\n");
1089 mip += 6;
1090 } else {
1091 - strcpy(manidx+mip, "<DL>\n");
1092 + strcpy(manidx+mip, "<dl>\n");
1093 mip += 5;
1096 @@ -1647,7 +1617,7 @@
1098 scan_troff(item, 1, &c);
1099 manidx_need(100 + strlen(c));
1100 - sprintf(manidx+mip, "<DT><A HREF=\"#%s\">%s</A><DD>\n", label, c);
1101 + sprintf(manidx+mip, "<dt><a href=\"#%s\">%s</a></dt><dd>\n", label, c);
1102 if (c) free(c);
1103 while (manidx[mip]) mip++;
1105 @@ -1834,8 +1804,8 @@
1107 break;
1108 case V('b','r'):
1109 - if (still_dd) out_html("<DD>");
1110 - else out_html("<BR>\n");
1111 + if (still_dd) out_html("<dd>");
1112 + else out_html("<br>\n");
1113 curpos=0;
1114 c=c+j;
1115 if (c[0] == escapesym) { c=scan_escape(c+1); }
1116 @@ -1865,17 +1835,17 @@
1117 c=skip_till_newline(c);
1118 /* center next i lines */
1119 if (i>0) {
1120 - out_html("<CENTER>\n");
1121 + out_html("<div style=\"margin: 0 auto\">\n");
1122 while (i && *c) {
1123 char *line=NULL;
1124 c=scan_troff(c,1, &line);
1125 - if (line && strncmp(line, "<BR>", 4)) {
1126 + if (line && strncmp(line, "<br>", 4)) {
1127 out_html(line);
1128 - out_html("<BR>\n");
1129 + out_html("<br>\n");
1130 i--;
1133 - out_html("</CENTER>\n");
1134 + out_html("</div>\n");
1135 curpos=0;
1137 break;
1138 @@ -1906,7 +1876,7 @@
1139 if (!fillout) {
1140 out_html(change_to_font(0));
1141 out_html(change_to_size('0'));
1142 - out_html("</PRE>\n");
1143 + out_html("</pre>\n");
1145 curpos=0;
1146 fillout=1;
1147 @@ -1981,7 +1951,7 @@
1148 if (fillout) {
1149 out_html(change_to_font(0));
1150 out_html(change_to_size('0'));
1151 - out_html("<PRE>\n");
1152 + out_html("<pre>\n");
1154 curpos=0;
1155 fillout=0;
1156 @@ -2002,7 +1972,7 @@
1157 break;
1158 case V('s','p'):
1159 c=c+j;
1160 - if (fillout) out_html("<P>"); else {
1161 + if (fillout) out_html("<p>"); else {
1162 out_html(NEWLINE);
1163 NEWLINE[0]='\n';
1165 @@ -2033,30 +2003,15 @@
1166 *c = 0;
1167 scan_troff(h,1, &name);
1168 if (name[3] == '/') h=name+3; else h=name;
1169 -#if NOCGI
1170 - if (!out_length) {
1171 - char *t,*s;
1172 - t=strrchr(fname, '/');
1173 - if (!t) t=fname;
1174 - fprintf(stderr, "ln -s %s.html %s.html\n", h, t);
1175 - s=strrchr(t, '.');if (!s) s=t;
1176 - printf(CONTENTTYPE DOCTYPE);
1177 - printf("<HTML><HEAD><TITLE> Man page of %s</TITLE>\n"
1178 - "</HEAD><BODY>\n"
1179 - "See the man page for <A HREF=\"%s.html\">%s</A>.\n"
1180 - "</BODY></HTML>\n",
1181 - s, h, h);
1182 - } else
1183 -#endif
1185 /* this works alright, except for section 3 */
1186 if ((l = read_manpage_into_buffer(h, &buf)) < 0) {
1187 fprintf(stderr,
1188 - "man2html: unable to open or read file %s\n", h);
1189 - out_html("<BLOCKQUOTE>"
1190 - "man2html: unable to open or read file\n");
1191 + _("man2html: unable to open or read file %s\n"), h);
1192 + out_html("<blockquote>");
1193 + out_html(_("man2html: unable to open or read file\n"));
1194 out_html(h);
1195 - out_html("</BLOCKQUOTE>\n");
1196 + out_html("</blockquote>\n");
1197 } else {
1198 buf[0]=buf[l]='\n';
1199 buf[l+1]=buf[l+2]=0;
1200 @@ -2085,7 +2040,7 @@
1201 #if 0
1202 dl_down();
1203 #endif
1204 - out_html("<BR>\n");
1205 + out_html("<br>\n");
1206 c=c+j;
1207 c=scan_expression(c, &j);
1208 for (i=0; i<j; i++) out_html("&nbsp;");
1209 @@ -2163,7 +2118,7 @@
1210 if (words) {
1211 scan_troff(wordlist[0], 1,NULL);
1213 - out_html("<DD>");
1214 + out_html("<dd>");
1215 curpos = 0;
1216 break;
1217 case V('T','P'):
1218 @@ -2172,7 +2127,7 @@
1219 /* somewhere a definition ends with '.TP' */
1220 if (!*c) still_dd=1; else {
1221 c=scan_troff(c,1,NULL);
1222 - out_html("<DD>");
1223 + out_html("<dd>");
1225 curpos=0;
1226 break;
1227 @@ -2195,20 +2150,20 @@
1228 fprintf(idxfile,"\n");
1230 #endif
1231 - out_html("<A NAME=\"");
1232 + out_html("<span id=\"");
1233 out_html(idxlabel);
1234 /* this will not work in mosaic (due to a bug).
1235 ** Adding '&nbsp;' between '>' and '<' solves it, but creates
1236 ** some space. A normal space does not work.
1237 */
1238 - out_html("\"></A>");
1239 + out_html("\"></span>");
1240 break;
1241 case V('P',' '):
1242 case V('P','\n'):
1243 case V('L','P'):
1244 case V('P','P'):
1245 dl_end();
1246 - if (fillout) out_html("<P>\n"); else {
1247 + if (fillout) out_html("<p>\n"); else {
1248 out_html(NEWLINE);
1249 NEWLINE[0]='\n';
1251 @@ -2272,19 +2227,29 @@
1252 out_html(change_to_size(0));
1253 if (!fillout) {
1254 fillout=1;
1255 - out_html("</PRE>");
1256 + out_html("</pre>");
1258 trans_char(c,'"', '\a');
1259 add_to_index(mode, c);
1260 - out_html("<A NAME=\"");
1261 - out_html(label);
1262 - /* &nbsp; for mosaic users */
1263 - if (mode) out_html("\">&nbsp;</A>\n<H3>");
1264 - else out_html("\">&nbsp;</A>\n<H2>");
1266 + if (mode) {
1267 + out_html("<h3 id=\"");
1268 + out_html(label);
1269 + out_html("\">");
1270 + } else {
1271 + out_html("</section>\n\n<section id=\"");
1272 + out_html(label);
1273 + out_html("\">\n<h2>");
1274 + }
1276 mandoc_synopsis = (strncmp(c, "SYNOPSIS", 8) == 0);
1277 c = (mandoc_command ? scan_troff_mandoc : scan_troff)(c,1,NULL);
1278 - if (mode) out_html("</H3>\n");
1279 - else out_html("</H2>\n");
1281 + if (mode)
1282 + out_html("</h3>\n");
1283 + else
1284 + out_html("</h2>\n");
1286 curpos=0;
1287 break;
1288 case V('T','S'):
1289 @@ -2315,7 +2280,7 @@
1290 int skip=0;
1291 output_possible=1;
1292 printf(CONTENTTYPE DOCTYPE);
1293 - out_html("<HTML><HEAD><TITLE>Man page of ");
1294 + out_html("<html><head>\n<meta charset=\"UTF-8\">\n<title>");
1295 scan_troff(wordlist[0], 0, &t);
1296 /* we need to remove all html tags */
1297 for (s=q=t; *s; s++) {
1298 @@ -2324,11 +2289,14 @@
1299 else if (!skip) *q++ = *s;
1301 *q = '\0';
1302 - out_html(t);
1303 + char buff[256];
1304 + sprintf(buff, _("Man page of %s"), t);
1305 + out_html(buff);
1306 free(t);
1307 - out_html("</TITLE>\n</HEAD><BODY>\n<H1>");
1308 + out_html("</title>\n<link rel=\"stylesheet\" href=\"?css\">\n</head><body>\n<header><h1>");
1309 scan_troff(wordlist[0], 0, NULL);
1310 - out_html("</H1>\nSection: ");
1311 + out_html("</h1></header>\n<section>\n");
1312 + out_html(_("Section: "));
1313 if (words>4)
1314 scan_troff(wordlist[4], 0, NULL);
1315 else
1316 @@ -2336,14 +2304,17 @@
1317 out_html(" (");
1318 scan_troff(wordlist[1], 0, NULL);
1319 if (words>2) {
1320 - out_html(")<BR>Updated: ");
1321 + out_html(")<br>");
1322 + out_html(_("Updated: "));
1323 scan_troff(wordlist[2], 1, NULL);
1324 } else out_html(")");
1325 - out_html("<BR><A HREF=\"#index\">Index</A>\n");
1326 + out_html("<br><a href=\"#index\">");
1327 + out_html(_("Index"));
1328 + out_html("</a>\n");
1329 man_page_html(0,0); /* Return to Main Contents */
1330 *sl='\n';
1331 - out_html("<HR>\n");
1332 - if (mandoc_command) out_html("<BR>BSD mandoc<BR>");
1333 + out_html("<hr>\n");
1334 + if (mandoc_command) out_html("<br>\nBSD mandoc<br>");
1336 c = sl+1;
1337 } else
1338 @@ -2507,7 +2478,7 @@
1339 dl_newlevel_type(DL);
1340 if (nl)
1341 *nl = t;
1342 - if (fillout) out_html("<P>\n"); else {
1343 + if (fillout) out_html("<p>\n"); else {
1344 out_html(NEWLINE);
1345 NEWLINE[0]='\n';
1347 @@ -2518,7 +2489,7 @@
1348 case V('E','l'): /* BSD mandoc */
1349 c=c+j;
1350 dl_endlevel_type();
1351 - if (fillout) out_html("<P>\n"); else {
1352 + if (fillout) out_html("<p>\n"); else {
1353 out_html(NEWLINE);
1354 NEWLINE[0]='\n';
1356 @@ -2528,7 +2499,7 @@
1357 case V('I','t'): /* BSD mandoc */
1358 c=c+j;
1359 if (dl_type(DL)) {
1360 - out_html("<DT>");
1361 + out_html("<dt>");
1362 out_html(change_to_font('B'));
1363 if (*c == '\n') {
1364 /* Don't allow embedded comms after a newline */
1365 @@ -2543,9 +2514,9 @@
1366 if (inXo)
1367 still_dd = 1;
1368 else
1369 - out_html("<DD>");
1370 + out_html("<dd>");
1371 } else if (dl_type(UL) || dl_type(OL)) {
1372 - out_html("<LI>");
1373 + out_html("<li>");
1374 c=scan_troff_mandoc(c,1,NULL);
1375 out_html(NEWLINE);
1377 @@ -2559,7 +2530,7 @@
1378 c=c+j;
1379 if (inXo) {
1380 if (still_dd)
1381 - out_html("<DD>");
1382 + out_html("<dd>");
1383 inXo = 0;
1385 break;
1386 @@ -2594,12 +2565,12 @@
1387 case V('D','l'): /* BSD mandoc */
1388 c=c+j;
1389 out_html(NEWLINE);
1390 - out_html("<BLOCKQUOTE>");
1391 + out_html("<blockquote>");
1392 out_html(change_to_font('L'));
1393 if (*c == '\n') c++;
1394 c=scan_troff_mandoc(c, 1, NULL);
1395 out_html(change_to_font('R'));
1396 - out_html("</BLOCKQUOTE>");
1397 + out_html("</blockquote>");
1398 if (fillout) curpos++; else curpos=0;
1399 break;
1400 case V('B','d'): /* BSD mandoc */
1401 @@ -2615,14 +2586,14 @@
1402 mandoc_bd_options = 0; /* Remember options for terminating Bl */
1403 if (strstr(c, "-offset indent")) {
1404 mandoc_bd_options |= BD_INDENT;
1405 - out_html("<BLOCKQUOTE>\n");
1406 + out_html("<blockquote>\n");
1408 if (strstr(c, "-literal") || strstr(c, "-unfilled")) {
1409 if (fillout) {
1410 mandoc_bd_options |= BD_LITERAL;
1411 out_html(change_to_font(0));
1412 out_html(change_to_size('0'));
1413 - out_html("<PRE>\n");
1414 + out_html("<pre>\n");
1416 curpos=0;
1417 fillout=0;
1418 @@ -2637,18 +2608,18 @@
1419 if (!fillout) {
1420 out_html(change_to_font(0));
1421 out_html(change_to_size('0'));
1422 - out_html("</PRE>\n");
1423 + out_html("</pre>\n");
1426 if (mandoc_bd_options & BD_INDENT)
1427 - out_html("</BLOCKQUOTE>\n");
1428 + out_html("</blockquote>\n");
1429 curpos=0;
1430 fillout=1;
1431 c=skip_till_newline(c);
1432 break;
1433 case V('B','e'): /* BSD mandoc */
1434 c=c+j;
1435 - if (fillout) out_html("<P>"); else {
1436 + if (fillout) out_html("<p>"); else {
1437 out_html(NEWLINE);
1438 NEWLINE[0]='\n';
1440 @@ -2715,7 +2686,7 @@
1441 if (fillout) curpos++; else curpos=0;
1442 break;
1443 case V('P','p'): /* BSD mandoc */
1444 - if (fillout) out_html("<P>\n"); else {
1445 + if (fillout) out_html("<p>\n"); else {
1446 out_html(NEWLINE);
1447 NEWLINE[0]='\n';
1449 @@ -2726,9 +2697,9 @@
1450 trans_char(c,'"','\a');
1451 c=c+j;
1452 if (*c == '\n') c++;
1453 - out_html("``");
1454 + out_html("“");
1455 c=scan_troff_mandoc(c, 1, NULL);
1456 - out_html("''");
1457 + out_html("”");
1458 out_html(NEWLINE);
1459 if (fillout) curpos++; else curpos=0;
1460 break;
1461 @@ -2800,12 +2771,22 @@
1462 trans_char(c,'"','\a');
1463 c=c+j;
1464 if (*c == '\n') c++;
1465 - out_html("`");
1466 + out_html("‘");
1467 c=scan_troff_mandoc(c, 1, NULL);
1468 - out_html("'");
1469 + out_html("’");
1470 out_html(NEWLINE);
1471 if (fillout) curpos++; else curpos=0;
1472 break;
1473 + case V('A','q'): /* BSD mandoc */
1474 + trans_char(c,'"','\a');
1475 + c=c+j;
1476 + if (*c == '\n') c++;
1477 + out_html("⟨");
1478 + c=scan_troff_mandoc(c, 1, NULL);
1479 + out_html("⟩");
1480 + out_html(NEWLINE);
1481 + if (fillout) curpos++; else curpos=0;
1482 + break;
1483 case V('A','r'): /* BSD mandoc */
1484 /* parse one line in italics */
1485 out_html(change_to_font('I'));
1486 @@ -2855,7 +2836,7 @@
1487 */
1488 static int count = 0; /* Don't break on the first Nm */
1489 if (count) {
1490 - out_html("<BR>");
1491 + out_html("<br>");
1492 } else {
1493 char *end, t=0 /* just for gcc */;
1494 end = strchr(c, '\n');
1495 @@ -3038,7 +3019,7 @@
1496 if (h[-1] == '\n' && still_dd && isalnum(*h)) {
1497 /* sometimes a .HP request is not followed by a .br request */
1498 FLUSHIBP;
1499 - out_html("<DD>");
1500 + out_html("<dd>");
1501 curpos=0;
1502 still_dd=0;
1504 @@ -3108,12 +3089,12 @@
1505 curpos++;
1507 } else {
1508 - out_html("<TT>");
1509 + out_html("<tt>");
1510 while (curpos < tabstops[curtab]) {
1511 out_html("&nbsp;");
1512 curpos++;
1514 - out_html("</TT>");
1515 + out_html("</tt>");
1519 @@ -3122,7 +3103,7 @@
1520 if (*h == ' ' && (h[-1] == '\n' || usenbsp)) {
1521 FLUSHIBP;
1522 if (!usenbsp && fillout) {
1523 - out_html("<BR>");
1524 + out_html("<br>");
1525 curpos=0;
1527 usenbsp=fillout;
1528 @@ -3196,13 +3177,13 @@
1530 switch(status) {
1531 case 403:
1532 - printf("Status: 403 Forbidden\n");
1533 + printf("HTTP/1.1 403 Forbidden\n");
1534 break;
1535 case 404:
1536 - printf("Status: 404 Not Found\n");
1537 + printf("HTTP/1.1 404 Not Found\n");
1538 break;
1539 case 500:
1540 - printf("Status: 500 Internal Server Error\n");
1541 + printf("HTTP/1.1 500 Internal Server Error\n");
1542 break;
1543 case 0:
1544 default:
1545 @@ -3210,12 +3191,13 @@
1548 printf(CONTENTTYPE DOCTYPE);
1549 - printf("<HTML><HEAD><TITLE>%s</TITLE></HEAD>\n"
1550 - "<BODY>\n<H1>%s</H1>\n", s, s);
1551 + printf("<html>\n<head>\n<meta charset=\"UTF-8\">\n<title>%s</title>\n"
1552 + "<link rel=\"stylesheet\" href=\"?css\">\n</head>\n"
1553 + "<body>\n<header><h1>%s</h1></header>\n<section>\n", s, s);
1554 va_start(p, t);
1555 vfprintf(stdout, t, p);
1556 va_end(p);
1557 - printf("</BODY></HTML>\n");
1558 + printf("</section>\n</body></html>\n");
1559 exit(0);
1562 @@ -3223,8 +3205,8 @@
1563 xstrdup(const char *s) {
1564 char *p = strdup(s);
1565 if (p == NULL)
1566 - error_page(500, "Out of memory",
1567 - "Sorry, out of memory, aborting...\n");
1568 + error_page(500, _("Out of memory"),
1569 + _("Sorry, out of memory, aborting...\n"));
1570 return p;
1573 @@ -3232,8 +3214,8 @@
1574 xmalloc(size_t size) {
1575 void *p = malloc(size);
1576 if (p == NULL)
1577 - error_page(500, "Out of memory",
1578 - "Sorry, out of memory, aborting...\n");
1579 + error_page(500, _("Out of memory"),
1580 + _("Sorry, out of memory, aborting...\n"));
1581 return p;
1584 @@ -3241,16 +3223,16 @@
1585 xrealloc(void *ptr, size_t size) {
1586 void *p = realloc(ptr,size);
1587 if (p == NULL)
1588 - error_page(500, "Out of memory",
1589 - "Sorry, out of memory, aborting...\n");
1590 + error_page(500, _("Out of memory"),
1591 + _("Sorry, out of memory, aborting...\n"));
1592 return p;
1595 static void
1596 usage(void) {
1597 - error_page(500, "man2html: bad invocation",
1598 - "Call: man2html [-l|-h host.domain:port] [-p|-q] [filename]\n"
1599 - "or: man2html -r [filename]\n");
1600 + error_page(500, _("man2html: bad invocation"),
1601 + _("Call: man2html [-l|-h host.domain:port] [-p|-q] [filename]\n"
1602 + "or: man2html -r [filename]\n"));
1605 static void
1606 @@ -3273,7 +3255,7 @@
1608 #if 0
1609 else /* complain or not - this need not be fatal */
1610 - error_page("Error", "man2html: could not chdir to %s", s);
1611 + error_page(_("Error"), _("man2html: could not chdir to %s"), s);
1612 #endif
1615 @@ -3291,6 +3273,11 @@
1616 */
1617 int
1618 main(int argc, char **argv) {
1619 + setlocale (LC_ALL, "");
1620 + bindtextdomain (GETTEXT_PACKAGE, "/usr/share/locale");
1621 + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
1622 + textdomain (GETTEXT_PACKAGE);
1624 int l, c;
1625 char *buf, *filename, *fnam = NULL;
1627 @@ -3309,7 +3296,7 @@
1628 case 'D':
1629 goto_dir(optarg, 0, 0); break;
1630 case 'E':
1631 - error_page(0, "Error", "%s", optarg); break;
1632 + error_page(0, _("Error"), "%s", optarg); break;
1633 case 'h':
1634 set_cgibase("localhost"); break;
1635 case 'H':
1636 @@ -3362,7 +3349,7 @@
1638 l = read_manpage_into_buffer(fnam, &buf);
1639 if (l < 0)
1640 - error_page(404, "File not found", "Could not open %s\n", fname);
1641 + error_page(404, _("File not found"), _("Could not open %s\n"), fname);
1643 buf[0] = '\n';
1644 buf[l+1] = '\n';
1645 @@ -3379,34 +3366,34 @@
1646 out_html(change_to_size(0));
1647 if (!fillout) {
1648 fillout=1;
1649 - out_html("</PRE>");
1650 + out_html("</pre>");
1652 out_html(NEWLINE);
1653 if (output_possible) {
1654 /* &nbsp; for mosaic users */
1655 if (manidx) {
1656 - printf("<HR>\n<A NAME=\"index\">&nbsp;</A><H2>Index</H2>\n<DL>\n");
1657 + printf("</section>\n\n<section id=\"index\">\n<h2>%s</h2>\n\n<dl>\n", _("Index"));
1658 manidx[mip]=0;
1659 printf("%s", manidx);
1660 - if (subs) printf("</DL>\n");
1661 - printf("</DL>\n");
1662 + if (subs) printf("</dl>\n");
1663 + printf("</dl>\n");
1665 print_sig();
1666 - printf("</BODY>\n</HTML>\n");
1667 + printf("</body>\n</html>\n");
1668 } else {
1669 if (!filename)
1670 filename = fname;
1671 if (*filename == '/')
1672 - error_page(403, "Invalid Man Page",
1673 - "The requested file %s is not a valid (unformatted) "
1674 + error_page(403, _("Invalid Man Page"),
1675 + _("The requested file %s is not a valid (unformatted) "
1676 "man page.\nIf the file is a formatted man page, "
1677 "you could try to load the\n"
1678 - "<A HREF=\"file://%s\">plain file</A>.\n",
1679 + "<a href=\"file://%s\">plain file</a>.\n"),
1680 filename, filename);
1681 else
1682 - error_page(403, "Invalid Man Page",
1683 - "The requested file %s is not a valid (unformatted) "
1684 - "man page.", filename);
1685 + error_page(403, _("Invalid Man Page"),
1686 + _("The requested file %s is not a valid (unformatted) "
1687 + "man page."), filename);
1689 if (idxfile)
1690 fclose(idxfile);
1691 --- a/scripts/cgi-bin/man/man2html
1692 +++ b/scripts/cgi-bin/man/man2html
1693 @@ -8,11 +8,11 @@
1695 # Do we need lynxcgi URLs? For the moment our criterion is
1696 # 1) HTTP_USER_AGENT=Lynx* and 2) HTTP_HOST is unset.
1697 -AGENT="${HTTP_USER_AGENT-unknown}"
1698 +AGENT="${HTTP_USER_AGENT:-unknown}"
1700 case "$AGENT" in
1701 Lynx*|lynx*)
1702 - HH="${HTTP_HOST-nohh}"
1703 + HH="${HTTP_HOST:-nohh}"
1704 SED="s/%lynx //"
1705 ;;
1706 *)
1707 @@ -21,7 +21,7 @@
1708 ;;
1709 esac
1711 -SERVER="${SERVER_NAME-localhost}"
1712 +SERVER="${SERVER_NAME:-localhost}"
1713 case "$HH" in
1714 nohh)
1715 LL="-l"
1716 --- a/scripts/cgi-bin/man/mansearch
1717 +++ b/scripts/cgi-bin/man/mansearch
1718 @@ -7,11 +7,11 @@
1720 # Do we need lynxcgi URLs? For the moment our criterion is
1721 # 1) HTTP_USER_AGENT=Lynx* and 2) HTTP_HOST is unset.
1722 -AGENT="${HTTP_USER_AGENT-unknown}"
1723 +AGENT="${HTTP_USER_AGENT:-unknown}"
1725 case "$AGENT" in
1726 Lynx*|lynx*)
1727 - HH="${HTTP_HOST-nohh}"
1728 + HH="${HTTP_HOST:-nohh}"
1729 SED="s/%lynx //"
1730 ;;
1731 *)
1732 @@ -20,7 +20,7 @@
1733 ;;
1734 esac
1736 -SERVER="${SERVER_NAME-localhost}"
1737 +SERVER="${SERVER_NAME:-localhost}"
1738 case "$HH" in
1739 nohh)
1740 CG="lynxcgi:/usr/lib/cgi-bin/man"
1741 --- a/scripts/cgi-bin/man/mansearchhelp
1742 +++ b/scripts/cgi-bin/man/mansearchhelp
1743 @@ -4,17 +4,17 @@
1745 # Do we need lynxcgi URLs? For the moment our criterion is
1746 # 1) HTTP_USER_AGENT=Lynx* and 2) HTTP_HOST is unset.
1747 -AGENT="${HTTP_USER_AGENT-unknown}"
1748 +AGENT="${HTTP_USER_AGENT:-unknown}"
1749 case "$AGENT" in
1750 Lynx*|lynx*)
1751 - HH="${HTTP_HOST-nohh}"
1752 + HH="${HTTP_HOST:-nohh}"
1753 ;;
1754 *)
1755 HH=nolynx
1756 ;;
1757 esac
1759 -SERVER="${SERVER_NAME-localhost}"
1760 +SERVER="${SERVER_NAME:-localhost}"
1761 case "$HH" in
1762 nohh)
1763 CG="lynxcgi:/usr/lib/cgi-bin/man"
1764 --- a/strdefs.c
1765 +++ b/strdefs.c
1766 @@ -27,266 +27,333 @@
1767 { V('.','V'), 1, 0, NULL }, /* the me package tests for this */
1768 { 0, 0, 0, NULL } };
1771 +/* Characters written according to http://mdocml.bsd.lv/man/mandoc_char.7.html */
1773 static STRDEF standardstring[] = {
1774 - { V('<','='), 2, "&lt;=", NULL }, /* less equal */
1775 - { V('>','='), 2, "&gt=;", NULL }, /* greather equal */
1776 - { V('A','m'), 1, "&amp;", NULL }, /* infinity */
1777 - { V('B','a'), 1, "|", NULL }, /* vartical bar */
1778 - { V('G','e'), 2, "&gt=;", NULL }, /* greather equal */
1779 - { V('G','t'), 1, "&gt;", NULL }, /* greather than */
1780 - { V('I','f'), 1, "&infin;", NULL }, /* infinity */
1781 - { V('L','e'), 2, "&lt;=", NULL }, /* less equal */
1782 - { V('L','q'), 1, "&ldquo;", NULL }, /* left double quote */
1783 - { V('L','t'), 1, "&lt;", NULL }, /* less than */
1784 - { V('N','a'), 3, "NaN", NULL }, /* not a number */
1785 - { V('N','e'), 2, "!=", NULL }, /* not equal */
1786 - { V('P','i'), 2, "Pi", NULL }, /* pi */
1787 - { V('P','m'), 1, "&plusmn;", NULL }, /* plus minus */
1788 - { V('R',' '), 1, "&#174;", NULL },
1789 - { V('R','q'), 1, "&rdquo;", NULL }, /* right double quote */
1790 - { V('a','a'), 1, "'", NULL }, /* accute accent */
1791 - { V('g','a'), 1, "`", NULL }, /* grave accent */
1792 - { V('l','q'), 2, "``", NULL },
1793 - { V('q',' '), 1, "&quot;", NULL }, /* straight double quote */
1794 - { V('r','q'), 2, "''", NULL },
1795 - { V('u','a'), 1, "^", NULL }, /* upwards arrow */
1796 + { V('<','='), 1, "≤", NULL }, /* less-than-equal */
1797 + { V('>','='), 1, "≥", NULL }, /* greater-than-equal */
1798 + { V('A','i'), 4, "ANSI", NULL }, /* ANSI standard name */
1799 + { V('A','m'), 1, "&amp;", NULL }, /* ampersand */
1800 + { V('B','a'), 1, "|", NULL }, /* vertical bar */
1801 + { V('G','e'), 1, "≥", NULL }, /* greater-than-equal */
1802 + { V('G','t'), 1, "&gt;", NULL }, /* greater-than */
1803 + { V('I','f'), 8, "infinity", NULL }, /* infinity */
1804 + { V('L','e'), 1, "≤", NULL }, /* less-than-equal */
1805 + { V('L','q'), 1, "“", NULL }, /* left-double-quote */
1806 + { V('L','t'), 1, "&lt;", NULL }, /* less-than */
1807 + { V('N','a'), 3, "NaN", NULL }, /* NaN */
1808 + { V('N','e'), 1, "≠", NULL }, /* not equal */
1809 + { V('P','i'), 2, "pi", NULL }, /* pi */
1810 + { V('P','m'), 1, "±", NULL }, /* plus-minus */
1811 + { V('P','x'), 5, "POSIX", NULL }, /* POSIX standard name */
1812 + { V('R',' '), 1, "®", NULL }, /* restricted mark */
1813 + { V('R','q'), 1, "”", NULL }, /* right-double-quote */
1814 + { V('T','m'), 4, "(Tm)", NULL }, /* trade mark */
1815 + { V('a','a'), 1, "´", NULL }, /* acute */
1816 + { V('g','a'), 1, "`", NULL }, /* grave */
1817 + { V('l','p'), 1, "(", NULL }, /* left-parenthesis */
1818 + { V('l','q'), 1, "“", NULL }, /* left double-quote */
1819 + { V('q',' '), 1, "&quot;", NULL }, /* double-quote */
1820 + { V('r','p'), 1, ")", NULL }, /* right-parenthesis */
1821 + { V('r','q'), 1, "”", NULL }, /* right double-quote */
1822 + { V('u','a'), 1, "↑", NULL }, /* up-arrow */
1823 + { V('v','a'), 1, "↕", NULL }, /* up-down arrow */
1824 { 0, 0, NULL, NULL}
1825 };
1827 static STRDEF standardchar[] = {
1828 - { V('*','*'), 1, "*", NULL }, /* math star */
1829 - { V('*','A'), 1, "&Alpha;", NULL },
1830 - { V('*','B'), 1, "&Beta;", NULL },
1831 - { V('*','C'), 1, "&Xi;", NULL },
1832 - { V('*','D'), 1, "&Delta;", NULL },
1833 - { V('*','E'), 1, "&Epsilon;", NULL },
1834 - { V('*','F'), 1, "&Phi;", NULL },
1835 - { V('*','G'), 1, "&Gamma;", NULL },
1836 - { V('*','H'), 1, "&Theta;", NULL },
1837 - { V('*','I'), 1, "&Iota;", NULL },
1838 - { V('*','K'), 1, "&Kappa;", NULL },
1839 - { V('*','L'), 1, "&Lambda;", NULL },
1840 - { V('*','M'), 1, "&Mu;", NULL },
1841 - { V('*','N'), 1, "&Nu;", NULL },
1842 - { V('*','O'), 1, "&Omicron;", NULL },
1843 - { V('*','P'), 1, "&Pi;", NULL },
1844 - { V('*','Q'), 1, "&Psi;", NULL },
1845 - { V('*','R'), 1, "&Rho;", NULL },
1846 - { V('*','S'), 1, "&Sigma;", NULL },
1847 - { V('*','T'), 1, "&Tau;", NULL },
1848 - { V('*','U'), 1, "&Upsilon;", NULL },
1849 - { V('*','W'), 1, "&Omega;", NULL },
1850 - { V('*','X'), 1, "&Chi;", NULL },
1851 - { V('*','Y'), 1, "&Eta;", NULL },
1852 - { V('*','Z'), 1, "&Zeta;", NULL },
1853 - { V('*','a'), 1, "&alpha;", NULL },
1854 - { V('*','b'), 1, "&beta;", NULL },
1855 - { V('*','c'), 1, "&xi;", NULL },
1856 - { V('*','d'), 1, "&delta;", NULL },
1857 - { V('*','e'), 1, "&epsilon;", NULL },
1858 - { V('*','f'), 1, "&phi;", NULL },
1859 - { V('*','g'), 1, "&gamma;", NULL },
1860 - { V('*','h'), 1, "&theta;", NULL },
1861 - { V('*','i'), 1, "&iota;", NULL },
1862 - { V('*','k'), 1, "&kappa;", NULL },
1863 - { V('*','l'), 1, "&lambda;", NULL },
1864 - { V('*','m'), 1, "&mu;", NULL },
1865 - { V('*','n'), 1, "&nu;", NULL },
1866 - { V('*','o'), 1, "&omicron;", NULL },
1867 - { V('*','p'), 1, "&pi;", NULL },
1868 - { V('*','q'), 1, "&psi;", NULL },
1869 - { V('*','r'), 1, "&rho;", NULL },
1870 - { V('*','s'), 1, "&sigma;", NULL },
1871 - { V('*','t'), 1, "&tau;", NULL },
1872 - { V('*','u'), 1, "&upsilon;", NULL },
1873 - { V('*','w'), 1, "&omega;", NULL },
1874 - { V('*','x'), 1, "&chi;", NULL },
1875 - { V('*','y'), 1, "&eta;", NULL },
1876 - { V('*','z'), 1, "&zeta;", NULL },
1877 - { V('\'','A'), 1, "&Aacute;", NULL },
1878 - { V('\'','E'), 1, "&Eacute;", NULL },
1879 - { V('\'','I'), 1, "&Iacute;", NULL },
1880 - { V('\'','O'), 1, "&Oacute;", NULL },
1881 - { V('\'','U'), 1, "&Uacute;", NULL },
1882 - { V('\'','Y'), 1, "&Yacute;", NULL },
1883 - { V('\'','a'), 1, "&aacute;", NULL },
1884 - { V('\'','e'), 1, "&eacute;", NULL },
1885 - { V('\'','i'), 1, "&iacute;", NULL },
1886 - { V('\'','o'), 1, "&oacute;", NULL },
1887 - { V('\'','u'), 1, "&uacute;", NULL },
1888 - { V('\'','y'), 1, "&yacute;", NULL },
1889 - { V('!','='), 1, "&ne;", NULL },
1890 - { V('%','0'), 1, "&permil;", NULL },
1891 - { V('+','-'), 1, "&plusmn;", NULL },
1892 - { V(',','C'), 1, "&Ccedil;", NULL },
1893 - { V(',','c'), 1, "&ccedil;", NULL },
1894 - { V('-','>'), 1, "&rarr;", NULL },
1895 - { V('-','D'), 1, "&ETH;", NULL },
1896 - { V('.','i'), 1, "&#x131;", NULL },
1897 - { V('/','L'), 1, "&#x141;", NULL },
1898 - { V('/','O'), 1, "&Oslash;", NULL },
1899 - { V('/','l'), 1, "&#x142;", NULL },
1900 - { V('/','o'), 1, "&oslash;", NULL },
1901 - { V('1','2'), 1, "&#189;", NULL },
1902 - { V('1','4'), 1, "&#188;", NULL },
1903 - { V('3','4'), 1, "&#190;", NULL },
1904 - { V(':','A'), 1, "&Auml;", NULL },
1905 - { V(':','E'), 1, "&Euml;", NULL },
1906 - { V(':','I'), 1, "&Iuml;", NULL },
1907 - { V(':','O'), 1, "&Ouml;", NULL },
1908 - { V(':','U'), 1, "&Uuml;", NULL },
1909 - { V(':','a'), 1, "&auml;", NULL },
1910 - { V(':','e'), 1, "&euml;", NULL },
1911 - { V(':','i'), 1, "&iuml;", NULL },
1912 - { V(':','o'), 1, "&ouml;", NULL },
1913 - { V(':','u'), 1, "&uuml;", NULL },
1914 - { V(':','y'), 1, "&yuml;", NULL },
1915 - { V('<','-'), 1, "&larr;", NULL },
1916 - { V('<','='), 1, "&le;", NULL },
1917 - { V('<','>'), 1, "&harr;", NULL },
1918 - { V('=','='), 1, "&equiv;", NULL },
1919 - { V('=','~'), 1, "&cong;", NULL },
1920 - { V('>','='), 1, "&ge;", NULL },
1921 - { V('A','E'), 1, "&AElig;", NULL },
1922 - { V('A','h'), 1, "&alepfsym;", NULL },
1923 - { V('C','R'), 1, "&#x240d;", NULL },
1924 - { V('C','s'), 1, "&curren;", NULL },
1925 - { V('D','o'), 1, "$", NULL },
1926 - { V('E','u'), 1, "&euro;", NULL },
1927 - { V('F','c'), 1, "&raquo;", NULL },
1928 - { V('F','i'), 3, "ffi", NULL },
1929 - { V('F','l'), 3, "ffl", NULL },
1930 - { V('F','o'), 1, "&laquo;", NULL },
1931 - { V('O','E'), 1, "&OElig;", NULL },
1932 - { V('P','o'), 1, "&pound;", NULL },
1933 - { V('S','1'), 1, "&sup1;", NULL },
1934 - { V('S','2'), 1, "&sup2;", NULL },
1935 - { V('S','3'), 1, "&sup3;", NULL },
1936 - { V('S','d'), 1, "&eth;", NULL },
1937 - { V('T','P'), 1, "&THORN;", NULL },
1938 - { V('T','p'), 1, "&thorn;", NULL },
1939 - { V('Y','e'), 1, "&yen;", NULL },
1940 - { V('^','A'), 1, "&Acirc;", NULL },
1941 - { V('^','E'), 1, "&Ecirc;", NULL },
1942 - { V('^','I'), 1, "&Icirc;", NULL },
1943 - { V('^','O'), 1, "&Ocirc;", NULL },
1944 - { V('^','U'), 1, "&Ucirc;", NULL },
1945 - { V('^','a'), 1, "&acirc;", NULL },
1946 - { V('^','e'), 1, "&ecirc;", NULL },
1947 - { V('^','i'), 1, "&icirc;", NULL },
1948 - { V('^','o'), 1, "&ocirc;", NULL },
1949 - { V('^','u'), 1, "&ucirc;", NULL },
1950 - { V('`','A'), 1, "&Agrave;", NULL },
1951 - { V('`','E'), 1, "&Egrave;", NULL },
1952 - { V('`','I'), 1, "&Igrave;", NULL },
1953 - { V('`','O'), 1, "&Ograve;", NULL },
1954 - { V('`','U'), 1, "&Ugrave;", NULL },
1955 - { V('`','a'), 1, "&agrave;", NULL },
1956 - { V('`','e'), 1, "&egrave;", NULL },
1957 - { V('`','i'), 1, "&igrave;", NULL },
1958 - { V('`','o'), 1, "&ograve;", NULL },
1959 - { V('`','u'), 1, "&ugrave;", NULL },
1960 - { V('a','a'), 1, "&acute;", NULL },
1961 - { V('a','e'), 1, "&aelig;", NULL },
1962 - { V('a','p'), 1, "&asymp;", NULL },
1963 - { V('a','q'), 1, "'", NULL },
1964 - { V('a','t'), 1, "@", NULL },
1965 - { V('a','~'), 1, "~", NULL },
1966 - { V('b','a'), 1, "|", NULL },
1967 - { V('b','b'), 1, "|", NULL },
1968 - { V('b','r'), 1, "|", NULL },
1969 - { V('b','r'), 1, "|", NULL },
1970 - { V('b','u'), 1, "&bull;", NULL },
1971 - { V('b','v'), 1, "|", NULL },
1972 - { V('c','*'), 1, "&otimes;", NULL },
1973 - { V('c','+'), 1, "&oplus;", NULL },
1974 - { V('c','i'), 1, "&#x25cb;", NULL },
1975 - { V('c','o'), 1, "&#169;", NULL },
1976 - { V('c','q'), 1, "'", NULL },
1977 - { V('c','t'), 1, "&#162;", NULL },
1978 - { V('d','A'), 1, "&dArr;", NULL },
1979 - { V('d','a'), 1, "&darr;", NULL },
1980 - { V('d','d'), 1, "=", NULL },
1981 - { V('d','e'), 1, "&#176;", NULL },
1982 - { V('d','g'), 1, "-", NULL },
1983 - { V('d','i'), 1, "&#247;", NULL },
1984 - { V('d','q'), 1, "&quot;", NULL },
1985 - { V('e','m'), 3, "---", NULL }, /* em dash */
1986 - { V('e','n'), 1, "-", NULL }, /* en dash */
1987 - { V('e','q'), 1, "=", NULL },
1988 - { V('e','s'), 1, "&#216;", NULL },
1989 - { V('e','u'), 1, "&euro;", NULL },
1990 - { V('f','/'), 1, "&frasl;", NULL },
1991 - { V('f','c'), 1, "&rsaquo;", NULL },
1992 - { V('f','f'), 2, "ff", NULL },
1993 - { V('f','i'), 2, "fi", NULL },
1994 - { V('f','l'), 2, "fl", NULL },
1995 - { V('f','m'), 1, "&#180;", NULL },
1996 - { V('f','o'), 1, "&lsaquo;", NULL },
1997 - { V('g','a'), 1, "`", NULL },
1998 - { V('h','A'), 1, "&hArr;", NULL },
1999 - { V('h','y'), 1, "-", NULL },
2000 - { V('i','f'), 1, "&infin;", NULL },
2001 - { V('i','s'), 8, "Integral", NULL }, /* integral sign */
2002 - { V('l','A'), 1, "&lArr;", NULL },
2003 - { V('l','B'), 1, "[", NULL },
2004 - { V('l','C'), 1, "{", NULL },
2005 - { V('l','a'), 1, "&lt;", NULL },
2006 - { V('l','b'), 1, "[", NULL },
2007 - { V('l','c'), 2, "|&#175;", NULL },
2008 - { V('l','f'), 2, "|_", NULL },
2009 - { V('l','h'), 1, "&#x261a;", NULL },
2010 - { V('l','k'), 1, "<FONT SIZE=\"+2\">{</FONT>", NULL },
2011 - { V('l','q'), 1, "\"", NULL },
2012 - { V('l','z'), 1, "&loz;", NULL },
2013 - { V('m','c'), 1, "&micro;", NULL },
2014 - { V('m','i'), 1, "-", NULL },
2015 - { V('m','u'), 1, "&#215;", NULL },
2016 - { V('n','o'), 1, "&#172;", NULL },
2017 - { V('o','A'), 1, "&Aring;", NULL },
2018 - { V('o','a'), 1, "&aring;", NULL },
2019 - { V('o','e'), 1, "&oelig;", NULL },
2020 - { V('o','q'), 1, "'", NULL },
2021 - { V('o','r'), 1, "|", NULL },
2022 - { V('p','d'), 1, "d", NULL }, /* partial derivative */
2023 - { V('p','l'), 1, "+", NULL },
2024 - { V('p','s'), 1, "&para;", NULL },
2025 - { V('r','!'), 1, "&iexcl;", NULL },
2026 - { V('r','?'), 1, "&iquest;", NULL },
2027 - { V('r','A'), 1, "&rArr;", NULL },
2028 - { V('r','B'), 1, "]", NULL },
2029 - { V('r','C'), 1, "}", NULL },
2030 - { V('r','a'), 1, "&gt;", NULL },
2031 - { V('r','c'), 2, "&#175;|", NULL },
2032 - { V('r','f'), 2, "_|", NULL },
2033 - { V('r','g'), 1, "&#174;", NULL },
2034 - { V('r','h'), 1, "&#x261b;", NULL },
2035 - { V('r','k'), 1, "<FONT SIZE=\"+2\">}</FONT>", NULL },
2036 - { V('r','n'), 1, "&#175;", NULL },
2037 - { V('r','q'), 1, "\"", NULL },
2038 - { V('r','s'), 1, "\\", NULL },
2039 - { V('r','u'), 1, "_", NULL },
2040 - { V('s','c'), 1, "&#167;", NULL },
2041 - { V('s','h'), 1, "#", NULL },
2042 - { V('s','l'), 1, "/", NULL },
2043 - { V('s','q'), 1, "&#x25a1;", NULL },
2044 - { V('s','s'), 1, "&szlig;", NULL },
2045 - { V('t','f'), 1, "&there4;", NULL },
2046 - { V('t','i'), 1, "~", NULL },
2047 - { V('t','m'), 1, "&trade;", NULL },
2048 - { V('t','s'), 1, "s", NULL }, /* should be terminal sigma */
2049 - { V('u','A'), 1, "&uArr;", NULL },
2050 - { V('u','a'), 1, "&uarr;", NULL },
2051 - { V('u','l'), 1, "_", NULL },
2052 - { V('~','A'), 1, "&Atilde;", NULL },
2053 - { V('~','N'), 1, "&Ntilde;", NULL },
2054 - { V('~','O'), 1, "&Otilde;", NULL },
2055 - { V('~','a'), 1, "&atilde;", NULL },
2056 - { V('~','n'), 1, "&ntilde;", NULL },
2057 - { V('~','o'), 1, "&otilde;", NULL },
2058 + { V('*','*'), 1, "∗", NULL }, /* asterisk */
2059 + { V('*','A'), 1, "Α", NULL }, /* Alpha */
2060 + { V('*','B'), 1, "Β", NULL }, /* Beta */
2061 + { V('*','C'), 1, "Ξ", NULL }, /* Xi */
2062 + { V('*','D'), 1, "Δ", NULL }, /* Delta */
2063 + { V('*','E'), 1, "Ε", NULL }, /* Epsilon */
2064 + { V('*','F'), 1, "Φ", NULL }, /* Phi */
2065 + { V('*','G'), 1, "Γ", NULL }, /* Gamma */
2066 + { V('*','H'), 1, "Θ", NULL }, /* Theta */
2067 + { V('*','I'), 1, "Ι", NULL }, /* Iota */
2068 + { V('*','K'), 1, "Κ", NULL }, /* Kappa */
2069 + { V('*','L'), 1, "Λ", NULL }, /* Lambda */
2070 + { V('*','M'), 1, "Μ", NULL }, /* Mu */
2071 + { V('*','N'), 1, "Ν", NULL }, /* Nu */
2072 + { V('*','O'), 1, "Ο", NULL }, /* Omicron */
2073 + { V('*','P'), 1, "Π", NULL }, /* Pi */
2074 + { V('*','Q'), 1, "Ψ", NULL }, /* Psi */
2075 + { V('*','R'), 1, "Ρ", NULL }, /* Rho */
2076 + { V('*','S'), 1, "Σ", NULL }, /* Sigma */
2077 + { V('*','T'), 1, "Τ", NULL }, /* Tau */
2078 + { V('*','U'), 1, "Υ", NULL }, /* Upsilon */
2079 + { V('*','W'), 1, "Ω", NULL }, /* Omega */
2080 + { V('*','X'), 1, "Χ", NULL }, /* Chi */
2081 + { V('*','Y'), 1, "Η", NULL }, /* Eta */
2082 + { V('*','Z'), 1, "Ζ", NULL }, /* Zeta */
2083 + { V('*','a'), 1, "α", NULL }, /* alpha */
2084 + { V('*','b'), 1, "β", NULL }, /* beta */
2085 + { V('*','c'), 1, "ξ", NULL }, /* xi */
2086 + { V('*','d'), 1, "δ", NULL }, /* delta */
2087 + { V('*','e'), 1, "ε", NULL }, /* epsilon */
2088 + { V('*','f'), 1, "φ", NULL }, /* phi */
2089 + { V('*','g'), 1, "γ", NULL }, /* gamma */
2090 + { V('*','h'), 1, "θ", NULL }, /* theta */
2091 + { V('*','i'), 1, "ι", NULL }, /* iota */
2092 + { V('*','k'), 1, "κ", NULL }, /* kappa */
2093 + { V('*','l'), 1, "λ", NULL }, /* lambda */
2094 + { V('*','m'), 1, "μ", NULL }, /* mu */
2095 + { V('*','n'), 1, "ν", NULL }, /* nu */
2096 + { V('*','o'), 1, "ο", NULL }, /* omicron */
2097 + { V('*','p'), 1, "π", NULL }, /* pi */
2098 + { V('*','q'), 1, "ψ", NULL }, /* psi */
2099 + { V('*','r'), 1, "ρ", NULL }, /* rho */
2100 + { V('*','s'), 1, "σ", NULL }, /* sigma */
2101 + { V('*','t'), 1, "τ", NULL }, /* tau */
2102 + { V('*','u'), 1, "υ", NULL }, /* upsilon */
2103 + { V('*','w'), 1, "ω", NULL }, /* omega */
2104 + { V('*','x'), 1, "χ", NULL }, /* chi */
2105 + { V('*','y'), 1, "η", NULL }, /* eta */
2106 + { V('*','z'), 1, "ζ", NULL }, /* zeta */
2107 + { V('\'','A'), 1, "Á", NULL }, /* acute A */
2108 + { V('\'','E'), 1, "É", NULL }, /* acute E */
2109 + { V('\'','I'), 1, "Í", NULL }, /* acute I */
2110 + { V('\'','O'), 1, "Ó", NULL }, /* acute O */
2111 + { V('\'','U'), 1, "Ú", NULL }, /* acute U */
2112 + { V('\'','Y'), 1, "Ý", NULL }, /* Yacute (*) */
2113 + { V('\'','a'), 1, "á", NULL }, /* acute a */
2114 + { V('\'','e'), 1, "é", NULL }, /* acute e */
2115 + { V('\'','i'), 1, "í", NULL }, /* acute i */
2116 + { V('\'','o'), 1, "ó", NULL }, /* acute o */
2117 + { V('\'','u'), 1, "ú", NULL }, /* acute u */
2118 + { V('\'','y'), 1, "ý", NULL }, /* yacute (*) */
2119 + { V('!','='), 1, "≠", NULL }, /* not equal */
2120 + { V('%','0'), 1, "‰", NULL }, /* per-thousand */
2121 + { V('+','-'), 1, "±", NULL }, /* plus-minus */
2122 + { V('+','e'), 1, "ϵ", NULL }, /* epsilon variant */
2123 + { V('+','f'), 1, "φ", NULL }, /* phi variant */
2124 + { V('+','h'), 1, "ϑ", NULL }, /* theta variant */
2125 + { V('+','p'), 1, "ϖ", NULL }, /* pi variant */
2126 + { V(',','C'), 1, "Ç", NULL }, /* cedilla C */
2127 + { V(',','c'), 1, "ç", NULL }, /* cedilla c */
2128 + { V('-','+'), 1, "∓", NULL }, /* minus-plus */
2129 + { V('-','>'), 1, "→", NULL }, /* right arrow */
2130 + { V('-','D'), 1, "Ð", NULL }, /* Eth */
2131 + { V('-','h'), 1, "ℏ", NULL }, /* Planck constant over 2π */
2132 + { V('.','i'), 1, "ı", NULL }, /* dotless i */
2133 + { V('.','j'), 1, "ȷ", NULL }, /* dotless j */
2134 + { V('/','L'), 1, "Ł", NULL }, /* stroke L */
2135 + { V('/','O'), 1, "Ø", NULL }, /* stroke O */
2136 + { V('/','_'), 1, "∠", NULL }, /* angle */
2137 + { V('/','l'), 1, "ł", NULL }, /* stroke l */
2138 + { V('/','o'), 1, "ø", NULL }, /* stroke o */
2139 + { V('1','2'), 1, "½", NULL }, /* 1/2 (*) */
2140 + { V('1','4'), 1, "¼", NULL }, /* 1/4 (*) */
2141 + { V('3','4'), 1, "¾", NULL }, /* 3/4 (*) */
2142 + { V('3','d'), 1, "∴", NULL }, /* therefore */
2143 + { V(':','A'), 1, "Ä", NULL }, /* dieresis A */
2144 + { V(':','E'), 1, "Ë", NULL }, /* dieresis E */
2145 + { V(':','I'), 1, "Ï", NULL }, /* dieresis I */
2146 + { V(':','O'), 1, "Ö", NULL }, /* dieresis O */
2147 + { V(':','U'), 1, "Ü", NULL }, /* dieresis U */
2148 + { V(':','a'), 1, "ä", NULL }, /* dieresis a */
2149 + { V(':','e'), 1, "ë", NULL }, /* dieresis e */
2150 + { V(':','i'), 1, "ï", NULL }, /* dieresis i */
2151 + { V(':','o'), 1, "ö", NULL }, /* dieresis o */
2152 + { V(':','u'), 1, "ü", NULL }, /* dieresis u */
2153 + { V(':','y'), 1, "ÿ", NULL }, /* dieresis y */
2154 + { V('<','-'), 1, "←", NULL }, /* left arrow */
2155 + { V('<','<'), 1, "≪", NULL }, /* much less */
2156 + { V('<','='), 1, "≤", NULL }, /* less-than-equal */
2157 + { V('<','>'), 1, "↔", NULL }, /* left-right arrow */
2158 + { V('=','='), 1, "≡", NULL }, /* equivalent */
2159 + { V('=','~'), 1, "≅", NULL }, /* approximately equal */
2160 + { V('>','='), 1, "≥", NULL }, /* greater-than-equal */
2161 + { V('>','>'), 1, "≫", NULL }, /* much greater */
2162 + { V('A','E'), 1, "Æ", NULL }, /* AE ligature */
2163 + { V('A','N'), 1, "∧", NULL }, /* logical and */
2164 + { V('A','h'), 1, "ℵ", NULL }, /* aleph */
2165 + { V('B','q'), 1, "„", NULL }, /* right low double-quote */
2166 + { V('C','R'), 1, "↵", NULL }, /* carriage return */
2167 + { V('C','s'), 1, "¤", NULL }, /* Scandinavian */
2168 + { V('D','o'), 1, "$", NULL }, /* dollar */
2169 + { V('E','u'), 1, "€", NULL }, /* Euro symbol */
2170 + { V('F','c'), 1, "»", NULL }, /* right guillemet */
2171 + { V('F','i'), 1, "ffi", NULL }, /* ffi ligature */
2172 + { V('F','l'), 1, "ffl", NULL }, /* ffl ligature */
2173 + { V('F','n'), 1, "ƒ", NULL }, /* florin */
2174 + { V('F','o'), 1, "«", NULL }, /* left guillemet */
2175 + { V('I','J'), 1, "IJ", NULL }, /* IJ ligature */
2176 + { V('I','m'), 1, "ℑ", NULL }, /* imaginary */
2177 + { V('O','E'), 1, "Œ", NULL }, /* OE ligature */
2178 + { V('O','K'), 1, "✓", NULL }, /* check mark */
2179 + { V('O','R'), 1, "∨", NULL }, /* logical or */
2180 + { V('P','o'), 1, "£", NULL }, /* pound */
2181 + { V('R','e'), 1, "ℜ", NULL }, /* real */
2182 + { V('S','1'), 1, "¹", NULL }, /* sup1 (*) */
2183 + { V('S','2'), 1, "²", NULL }, /* sup2 (*) */
2184 + { V('S','3'), 1, "³", NULL }, /* sup3 (*) */
2185 + { V('S','d'), 1, "ð", NULL }, /* eth */
2186 + { V('T','P'), 1, "Þ", NULL }, /* Thorn */
2187 + { V('T','p'), 1, "þ", NULL }, /* thorn */
2188 + { V('Y','e'), 1, "¥", NULL }, /* yen */
2189 + { V('^','A'), 1, "Â", NULL }, /* circumflex A */
2190 + { V('^','E'), 1, "Ê", NULL }, /* circumflex E */
2191 + { V('^','I'), 1, "Î", NULL }, /* circumflex I */
2192 + { V('^','O'), 1, "Ô", NULL }, /* circumflex O */
2193 + { V('^','U'), 1, "Û", NULL }, /* circumflex U */
2194 + { V('^','a'), 1, "â", NULL }, /* circumflex a */
2195 + { V('^','e'), 1, "ê", NULL }, /* circumflex e */
2196 + { V('^','i'), 1, "î", NULL }, /* circumflex i */
2197 + { V('^','o'), 1, "ô", NULL }, /* circumflex o */
2198 + { V('^','u'), 1, "û", NULL }, /* circumflex u */
2199 + { V('`','A'), 1, "À", NULL }, /* grave A */
2200 + { V('`','E'), 1, "È", NULL }, /* grave E */
2201 + { V('`','I'), 1, "Ì", NULL }, /* grave I */
2202 + { V('`','O'), 1, "Ò", NULL }, /* grave O */
2203 + { V('`','U'), 1, "Ù", NULL }, /* grave U */
2204 + { V('`','a'), 1, "à", NULL }, /* grave a */
2205 + { V('`','e'), 1, "è", NULL }, /* grave e */
2206 + { V('`','i'), 1, "ì", NULL }, /* grave i */
2207 + { V('`','o'), 1, "ò", NULL }, /* grave o */
2208 + { V('`','u'), 1, "ù", NULL }, /* grave u */
2209 + { V('a','"'), 1, "˝", NULL }, /* Hungarian umlaut */
2210 + { V('a','-'), 1, "¯", NULL }, /* macron */
2211 + { V('a','.'), 1, "˙", NULL }, /* dotted */
2212 + { V('a','^'), 1, "^", NULL }, /* circumflex */
2213 + { V('a','a'), 1, "´", NULL }, /* acute */
2214 + { V('a','b'), 1, "˘", NULL }, /* breve */
2215 + { V('a','c'), 1, "¸", NULL }, /* cedilla */
2216 + { V('a','d'), 1, "¨", NULL }, /* dieresis */
2217 + { V('a','e'), 1, "æ", NULL }, /* ae ligature */
2218 + { V('a','h'), 1, "ˇ", NULL }, /* caron */
2219 + { V('a','o'), 1, "˚", NULL }, /* ring */
2220 + { V('a','p'), 1, "∼", NULL }, /* tilde operator */
2221 + { V('a','q'), 1, "'", NULL }, /* apostrophe quote (text) */
2222 + { V('a','t'), 1, "@", NULL }, /* at */
2223 + { V('a','~'), 1, "~", NULL }, /* tilde */
2224 + { V('b','a'), 1, "|", NULL }, /* bar */
2225 + { V('b','b'), 1, "¦", NULL }, /* broken bar */
2226 + { V('b','r'), 1, "│", NULL }, /* box rule */
2227 + { V('b','q'), 1, "‚", NULL }, /* right low single-quote */
2228 + { V('b','u'), 1, "•", NULL }, /* bullet */
2229 + { V('b','v'), 1, "⎪", NULL }, /* brace extension */
2230 + { V('c','*'), 1, "⊗", NULL }, /* circle-multiply */
2231 + { V('c','+'), 1, "⊕", NULL }, /* circle-plus */
2232 + { V('c','a'), 1, "∩", NULL }, /* intersection */
2233 + { V('c','i'), 1, "○", NULL }, /* circle */
2234 + { V('c','o'), 1, "©", NULL }, /* copyright */
2235 + { V('c','q'), 1, "’", NULL }, /* right single-quote */
2236 + { V('c','t'), 1, "¢", NULL }, /* cent */
2237 + { V('c','u'), 1, "∪", NULL }, /* union */
2238 + { V('d','A'), 1, "⇓", NULL }, /* down double-arrow */
2239 + { V('d','a'), 1, "↓", NULL }, /* down arrow */
2240 + { V('d','d'), 1, "‡", NULL }, /* double dagger */
2241 + { V('d','e'), 1, "°", NULL }, /* degree */
2242 + { V('d','g'), 1, "†", NULL }, /* dagger */
2243 + { V('d','i'), 1, "÷", NULL }, /* divide */
2244 + { V('d','q'), 1, "\"", NULL }, /* double quote (text) */
2245 + { V('e','m'), 1, "—", NULL }, /* em-dash */
2246 + { V('e','n'), 1, "–", NULL }, /* en-dash */
2247 + { V('e','q'), 1, "=", NULL }, /* equal */
2248 + { V('e','s'), 1, "∅", NULL }, /* empty set */
2249 + { V('e','u'), 1, "€", NULL }, /* Euro symbol */
2250 + { V('f','/'), 1, "⁄", NULL }, /* fraction */
2251 + { V('f','a'), 1, "∀", NULL }, /* universal quantifier */
2252 + { V('f','c'), 1, "›", NULL }, /* right single guillemet */
2253 + { V('f','f'), 1, "ff", NULL }, /* ff ligature */
2254 + { V('f','i'), 1, "fi", NULL }, /* fi ligature */
2255 + { V('f','l'), 1, "fl", NULL }, /* fl ligature */
2256 + { V('f','m'), 1, "′", NULL }, /* minute */
2257 + { V('f','o'), 1, "‹", NULL }, /* left single guillemet */
2258 + { V('g','a'), 1, "`", NULL }, /* grave */
2259 + { V('g','r'), 1, "∇", NULL }, /* gradient */
2260 + { V('h','A'), 1, "⇔", NULL }, /* left-right double-arrow */
2261 + { V('h','a'), 1, "^", NULL }, /* hat (text) */
2262 + { V('h','o'), 1, "˛", NULL }, /* ogonek */
2263 + { V('h','y'), 1, "‐", NULL }, /* hyphen */
2264 + { V('i','b'), 1, "⊆", NULL }, /* reflexive subset */
2265 + { V('i','f'), 1, "∞", NULL }, /* infinity */
2266 + { V('i','j'), 1, "ij", NULL }, /* ij ligature */
2267 + { V('i','p'), 1, "⊇", NULL }, /* reflexive superset */
2268 + { V('i','s'), 1, "∫", NULL }, /* integral */
2269 + { V('l','A'), 1, "⇐", NULL }, /* left double-arrow */
2270 + { V('l','B'), 1, "[", NULL }, /* left bracket */
2271 + { V('l','C'), 1, "{", NULL }, /* left brace */
2272 + { V('l','a'), 1, "⟨", NULL }, /* left angle */
2273 + { V('l','b'), 1, "⎩", NULL }, /* bottom-left hooked brace */
2274 + { V('l','c'), 1, "⌈", NULL }, /* left-ceiling */
2275 + { V('l','f'), 1, "⌊", NULL }, /* left-floor */
2276 + { V('l','h'), 1, "☜", NULL }, /* left hand */
2277 + { V('l','k'), 1, "⎨", NULL }, /* mid-left hooked brace */
2278 + { V('l','q'), 1, "“", NULL }, /* left double-quote */
2279 + { V('l','t'), 1, "⎧", NULL }, /* top-left hooked brace */
2280 + { V('l','z'), 1, "◊", NULL }, /* lozenge */
2281 + { V('m','c'), 1, "µ", NULL }, /* micro */
2282 + { V('m','i'), 1, "−", NULL }, /* minus */
2283 + { V('m','o'), 1, "∈", NULL }, /* element */
2284 + { V('m','u'), 1, "×", NULL }, /* multiply */
2285 + { V('n','b'), 1, "⊄", NULL }, /* not subset */
2286 + { V('n','c'), 1, "⊅", NULL }, /* not superset */
2287 + { V('n','e'), 1, "≢", NULL }, /* not equivalent */
2288 + { V('n','m'), 1, "∉", NULL }, /* not element */
2289 + { V('n','o'), 1, "¬", NULL }, /* logical not */
2290 + { V('o','A'), 1, "Å", NULL }, /* ring A */
2291 + { V('o','a'), 1, "å", NULL }, /* ring a */
2292 + { V('o','e'), 1, "œ", NULL }, /* oe ligature */
2293 + { V('o','q'), 1, "‘", NULL }, /* left single-quote */
2294 + { V('o','r'), 1, "|", NULL }, /* bitwise or */
2295 + { V('p','c'), 1, "·", NULL }, /* center-dot */
2296 + { V('p','d'), 1, "∂", NULL }, /* partial differential */
2297 + { V('p','l'), 1, "+", NULL }, /* plus */
2298 + { V('p','p'), 1, "⊥", NULL }, /* perpendicular */
2299 + { V('p','s'), 1, "¶", NULL }, /* paragraph */
2300 + { V('p','t'), 1, "∝", NULL }, /* proportionate */
2301 + { V('r','!'), 1, "¡", NULL }, /* upside-down exclamation */
2302 + { V('r','?'), 1, "¿", NULL }, /* upside-down question */
2303 + { V('r','A'), 1, "⇒", NULL }, /* right double-arrow */
2304 + { V('r','B'), 1, "]", NULL }, /* right bracket */
2305 + { V('r','C'), 1, "}", NULL }, /* right brace */
2306 + { V('r','a'), 1, "⟩", NULL }, /* right angle */
2307 + { V('r','b'), 1, "⎭", NULL }, /* bottom-right hooked brace */
2308 + { V('r','c'), 1, "⌉", NULL }, /* right-ceiling */
2309 + { V('r','f'), 1, "⌋", NULL }, /* right-floor */
2310 + { V('r','g'), 1, "®", NULL }, /* registered */
2311 + { V('r','h'), 1, "☞", NULL }, /* right hand */
2312 + { V('r','k'), 1, "⎬", NULL }, /* mid-right hooked brace */
2313 + { V('r','l'), 1, "‾", NULL }, /* overline */
2314 + { V('r','n'), 1, "‾", NULL }, /* overline */
2315 + { V('r','q'), 1, "”", NULL }, /* right double-quote */
2316 + { V('r','s'), 1, "\\", NULL }, /* backward slash */
2317 + { V('r','t'), 1, "⎫", NULL }, /* top-left hooked brace */
2318 + { V('r','u'), 1, "_", NULL }, /* (*) */
2319 + { V('s','b'), 1, "⊂", NULL }, /* proper subset */
2320 + { V('s','c'), 1, "§", NULL }, /* section */
2321 + { V('s','d'), 1, "″", NULL }, /* second */
2322 + { V('s','h'), 1, "#", NULL }, /* hash (pound) */
2323 + { V('s','l'), 1, "/", NULL }, /* forward slash */
2324 + { V('s','p'), 1, "⊃", NULL }, /* proper superset */
2325 + { V('s','q'), 1, "□", NULL }, /* white square */
2326 + { V('s','r'), 1, "√", NULL }, /* square root */
2327 + { V('s','s'), 1, "ß", NULL }, /* German eszett */
2328 + { V('s','t'), 1, "∋", NULL }, /* such that */
2329 + { V('t','e'), 1, "∃", NULL }, /* existential quantifier */
2330 + { V('t','f'), 1, "∴", NULL }, /* therefore */
2331 + { V('t','i'), 1, "~", NULL }, /* tilde (text) */
2332 + { V('t','m'), 1, "™", NULL }, /* trademarked */
2333 + { V('t','s'), 1, "ς", NULL }, /* sigma terminal */
2334 + { V('u','A'), 1, "⇑", NULL }, /* up double-arrow */
2335 + { V('u','a'), 1, "↑", NULL }, /* up arrow */
2336 + { V('u','l'), 1, "_", NULL }, /* underscore */
2337 + { V('v','A'), 1, "⇕", NULL }, /* up-down double-arrow */
2338 + { V('v','a'), 1, "↕", NULL }, /* up-down arrow */
2339 + { V('|','='), 1, "≃", NULL }, /* asymptotically equal */
2340 + { V('~','='), 1, "≈", NULL }, /* almost equal */
2341 + { V('~','A'), 1, "Ã", NULL }, /* tilde A */
2342 + { V('~','N'), 1, "Ñ", NULL }, /* tilde N */
2343 + { V('~','O'), 1, "Õ", NULL }, /* tilde O */
2344 + { V('~','a'), 1, "ã", NULL }, /* tilde a */
2345 + { V('~','n'), 1, "ñ", NULL }, /* tilde n */
2346 + { V('~','o'), 1, "õ", NULL }, /* tilde o */
2347 + { V('~','~'), 1, "≈", NULL }, /* almost equal */
2348 { 0, 0, NULL, NULL }
2351 };
2353 void stdinit(void) {
2354 --- /dev/null
2355 +++ b/version.h
2356 @@ -0,0 +1 @@
2357 +#define version "1.6g-7-slitaz"