summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog30
-rw-r--r--Makefile.in6
-rw-r--r--aclocal.m419
-rwxr-xr-xconfigure59
-rw-r--r--configure.ac1
-rw-r--r--src/devices/grops/ps.cc5
-rw-r--r--tmac/Makefile.sub12
-rw-r--r--tmac/www.tmac355
8 files changed, 433 insertions, 54 deletions
diff --git a/ChangeLog b/ChangeLog
index 8279b011..473a333c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2003-02-25 Gaius Mulley <gaius@glam.ac.uk>
+
+ * aclocal.m4 (GROFF_HTML_PROGRAMS): Add test for pnmtops.
+ (GROFF_PNMTOPS_NOSETPAGE): New macro.
+ * configure.ac: Use it.
+ * configure: Regenerated.
+ * Makefile.in: Updated.
+
+ * tmac/Makefile.sub (NORMALFILES): Remove www.tmac.
+ (CLEANADD): Add www.tmac-sed.
+ (pnmtops_nosetpage): Define default.
+ (install_data): Handle www.tmac-sed and substitute
+ @PNMTOPS_NOSETPAGE@.
+ (stamp-sed): Add www.tmac.
+ * tmac/www.tmac: Rewritten, based on a patch by Bernd Warken.
+ It now breaks URLs at suitable places.
+ (www:substring_ok): New register set by...
+ (www:@test_substring): New macro.
+ (www:error): New alias to www-error.
+ (www:lenstr, www:splitstr, www:url_breaks, www:url_breaks_splitted):
+ New macros.
+ (URL): Use www:url_breaks.
+ (PIMG, MPIMG): Use @PNMTOPS_NOSETPAGE@.
+ (CDS, CDE): New macros.
+
+2003-02-25 Werner LEMBERG <wl@gnu.org>
+
+ * src/devices/grops/ps.cc (ps_printer::define_encoding): Avoid
+ buffer overflow.
+
2003-02-24 Werner LEMBERG <wl@gnu.org>
Contrary to the PCL5 Developer's Guide, the ascenders in TFM files
diff --git a/Makefile.in b/Makefile.in
index 0ac16a3a..31b9b271 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -142,6 +142,11 @@ tmacpath=$(systemtmacdir)$(SEP)$(localtmacdir)$(SEP)$(tmacdir)
# `sys_tmac_prefix' is prefix (if any) for system macro packages.
sys_tmac_prefix=@sys_tmac_prefix@
+# `pnmtops_nosetpag' is the command to be run to generate an eps
+# file. Some versions of pnmtops provide the -nosetpage option.
+# We detect this and use it if present.
+pnmtops_nosetpage=@pnmtops_nosetpage@
+
# `tmac_wrap' is list of system macro packages that should be made
# available to groff by creating a corresponding macro package
# in the groff macro directory that references the system macro
@@ -391,6 +396,7 @@ MDEFINES= \
"prefix=$(prefix)" \
"revision=$(revision)" \
"sys_tmac_prefix=$(sys_tmac_prefix)" \
+ "pnmtops_nosetpage=$(pnmtops_nosetpage)" \
"systemtmacdir=$(systemtmacdir)" \
"tmac_an_prefix=$(tmac_an_prefix)" \
"tmac_m_prefix=$(tmac_m_prefix)" \
diff --git a/aclocal.m4 b/aclocal.m4
index c3e6b643..a832a969 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -68,13 +68,14 @@ AC_CHECK_PROG(pnmcrop, pnmcrop, found, missing)
AC_CHECK_PROG(pnmtopng, pnmtopng, found, missing)
AC_CHECK_PROG(gs, gs gsos2, found, missing)
AC_CHECK_PROG(psselect, psselect, found, missing)
-case "x$pnmcut$pnmcrop$pnmtopng$gs$psselect" in
+AC_CHECK_PROG(pnmtops, pnmtops, found, missing)
+case "x$pnmcut$pnmcrop$pnmtopng$gs$psselect$pnmtops$pstopnm" in
*missing*)
make_html=
make_install_html=
AC_MSG_WARN([
- Since one or more of the above five programs can't be found in the path,
+ Since one or more of the above six programs can't be found in the path,
the HTML backend of groff (grohtml) won't work properly. Consequently,
no documentation in HTML format is built and installed.
]) ;;
@@ -82,6 +83,20 @@ esac
AC_SUBST(make_html)
AC_SUBST(make_install_html)])dnl
dnl
+dnl check to see whether pnmtops can handle the -nosetpage option
+dnl
+AC_DEFUN(GROFF_PNMTOPS_NOSETPAGE,
+[AC_MSG_CHECKING([whether pnmtops can handle the -nosetpage option])
+if echo P1 2 2 0 1 1 0 | pnmtops -nosetpage > /dev/null 2>&1 ; then
+ AC_MSG_RESULT(yes)
+ pnmtops_nosetpage="pnmtops -nosetpage"
+else
+ AC_MSG_RESULT(no)
+ pnmtops_nosetpage="pnmtops"
+fi
+AC_SUBST(pnmtops_nosetpage)
+])dnl
+dnl
dnl
dnl GROFF_CSH_HACK(if hack present, if not present)
dnl
diff --git a/configure b/configure
index d2f1a912..b90dec19 100755
--- a/configure
+++ b/configure
@@ -305,7 +305,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS groff_top_builddir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX TTYDEVDIRS OTHERDEVDIRS LPR LP LPQ PSPRINT DVIPRINT PERLPATH YACC RANLIB ac_ct_RANLIB INSTALL_INFO INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SH_SCRIPT_SED_CMD CPP EGREP LIBM LIBOBJS BROKEN_SPOOLER_FLAGS PAGE g sys_tmac_prefix tmac_wrap pnmcut pnmcrop pnmtopng gs psselect make_html make_install_html LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS groff_top_builddir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX TTYDEVDIRS OTHERDEVDIRS LPR LP LPQ PSPRINT DVIPRINT PERLPATH YACC RANLIB ac_ct_RANLIB INSTALL_INFO INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SH_SCRIPT_SED_CMD CPP EGREP LIBM LIBOBJS BROKEN_SPOOLER_FLAGS PAGE g sys_tmac_prefix tmac_wrap pnmcut pnmcrop pnmtopng gs psselect pnmtops make_html make_install_html pnmtops_nosetpage LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -6001,25 +6001,74 @@ else
echo "${ECHO_T}no" >&6
fi
-case "x$pnmcut$pnmcrop$pnmtopng$gs$psselect" in
+# Extract the first word of "pnmtops", so it can be a program name with args.
+set dummy pnmtops; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_pnmtops+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$pnmtops"; then
+ ac_cv_prog_pnmtops="$pnmtops" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_pnmtops="found"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_pnmtops" && ac_cv_prog_pnmtops="missing"
+fi
+fi
+pnmtops=$ac_cv_prog_pnmtops
+if test -n "$pnmtops"; then
+ echo "$as_me:$LINENO: result: $pnmtops" >&5
+echo "${ECHO_T}$pnmtops" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+case "x$pnmcut$pnmcrop$pnmtopng$gs$psselect$pnmtops$pstopnm" in
*missing*)
make_html=
make_install_html=
{ echo "$as_me:$LINENO: WARNING:
- Since one or more of the above five programs can't be found in the path,
+ Since one or more of the above six programs can't be found in the path,
the HTML backend of groff (grohtml) won't work properly. Consequently,
no documentation in HTML format is built and installed.
" >&5
echo "$as_me: WARNING:
- Since one or more of the above five programs can't be found in the path,
+ Since one or more of the above six programs can't be found in the path,
the HTML backend of groff (grohtml) won't work properly. Consequently,
no documentation in HTML format is built and installed.
" >&2;} ;;
esac
+echo "$as_me:$LINENO: checking whether pnmtops can handle the -nosetpage option" >&5
+echo $ECHO_N "checking whether pnmtops can handle the -nosetpage option... $ECHO_C" >&6
+if echo P1 2 2 0 1 1 0 | pnmtops -nosetpage > /dev/null 2>&1 ; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ pnmtops_nosetpage="pnmtops -nosetpage"
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ pnmtops_nosetpage="pnmtops"
+fi
+
+
ac_config_files="$ac_config_files stamp-h"
ac_config_files="$ac_config_files Makefile doc/Makefile src/xditview/Imakefile"
@@ -6656,8 +6705,10 @@ s,@pnmcrop@,$pnmcrop,;t t
s,@pnmtopng@,$pnmtopng,;t t
s,@gs@,$gs,;t t
s,@psselect@,$psselect,;t t
+s,@pnmtops@,$pnmtops,;t t
s,@make_html@,$make_html,;t t
s,@make_install_html@,$make_install_html,;t t
+s,@pnmtops_nosetpage@,$pnmtops_nosetpage,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
CEOF
diff --git a/configure.ac b/configure.ac
index 233651c7..27409f68 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,6 +71,7 @@ GROFF_PAGE
GROFF_G
GROFF_TMAC
GROFF_HTML_PROGRAMS
+GROFF_PNMTOPS_NOSETPAGE
AC_CONFIG_FILES(stamp-h, [echo timestamp > stamp-h])
AC_CONFIG_FILES([Makefile doc/Makefile src/xditview/Imakefile])
AC_OUTPUT
diff --git a/src/devices/grops/ps.cc b/src/devices/grops/ps.cc
index 8a2c82b0..1fdb140c 100644
--- a/src/devices/grops/ps.cc
+++ b/src/devices/grops/ps.cc
@@ -696,8 +696,9 @@ void ps_printer::define_encoding(const char *encoding, int encoding_index)
if (fp == 0)
fatal("can't open encoding file `%1'", encoding);
int lineno = 1;
- char buf[256];
- while (fgets(buf, 512, fp) != 0) {
+ const int BUFFER_SIZE = 512;
+ char buf[BUFFER_SIZE];
+ while (fgets(buf, BUFFER_SIZE, fp) != 0) {
char *p = buf;
while (csspace(*p))
p++;
diff --git a/tmac/Makefile.sub b/tmac/Makefile.sub
index 88544031..9f9b6f09 100644
--- a/tmac/Makefile.sub
+++ b/tmac/Makefile.sub
@@ -22,7 +22,7 @@ NORMALFILES=\
X.tmac Xps.tmac \
lj4.tmac \
lbp.tmac \
- html.tmac www.tmac \
+ html.tmac \
europs.tmac \
eqnrc \
troffrc troffrc-end \
@@ -32,13 +32,14 @@ STRIPFILES=e.tmac doc.tmac doc-old.tmac
MDOCFILES=doc-common doc-ditroff doc-nroff doc-syms
mdocdir=$(tmacdir)/mdoc
CLEANADD=\
- stamp-wrap stamp-sed *-wrap man.tmac-sed ms.tmac-sed \
+ stamp-wrap stamp-sed *-wrap man.tmac-sed ms.tmac-sed www.tmac-sed \
stamp-strip e.tmac-s doc.tmac-s doc-old.tmac-s \
doc-common-s doc-ditroff-s doc-nroff-s doc-syms-s mdoc.local-s
tmac_s_prefix=
tmac_an_prefix=
tmac_wrap=
sys_tmac_prefix=
+pnmtops_nosetpage="pnmtops"
all: stamp-strip stamp-wrap stamp-sed
@@ -64,6 +65,8 @@ install_data: $(NORMALFILES) $(SPECIALFILES) man.local \
$(INSTALL_DATA) $(srcdir)/an.tmac $(tmacdir)/$(tmac_an_prefix)an.tmac
-rm -f $(tmacdir)/man.tmac
$(INSTALL_DATA) man.tmac-sed $(tmacdir)/man.tmac
+ -rm -f $(tmacdir)/www.tmac
+ $(INSTALL_DATA) www.tmac-sed $(tmacdir)/www.tmac
for f in $(STRIPFILES); do \
rm -f $(tmacdir)/$$f; \
$(INSTALL_DATA) $$f-s $(tmacdir)/$$f; \
@@ -98,11 +101,12 @@ stamp-wrap:
fi
touch $@
-stamp-sed: man.tmac ms.tmac
- for f in man.tmac ms.tmac; do \
+stamp-sed: man.tmac ms.tmac www.tmac
+ for f in man.tmac ms.tmac www.tmac; do \
rm -f $$f-sed; \
sed -e "s;@TMAC_AN_PREFIX@;$(tmac_an_prefix);g" \
-e "s;@TMAC_S_PREFIX@;$(tmac_s_prefix);g" \
+ -e "s;@PNMTOPS_NOSETPAGE@;$(pnmtops_nosetpage);g" \
$(srcdir)/$$f > $$f-sed; \
done
touch $@
diff --git a/tmac/www.tmac b/tmac/www.tmac
index 01de668f..c7ef46ed 100644
--- a/tmac/www.tmac
+++ b/tmac/www.tmac
@@ -1,8 +1,47 @@
-.\" www.tmac
-.\"
-.\" A simple set of macros to provide HTML documents with basic
-.\" www functionality. It should work with any macro set.
-.\"
+.ig
+www.tmac - macro package for adding HTML elements to roff documents.
+
+File position: <groff_source_top>/tmac/www.tmac
+Installed position: groff's main macro directory.
+
+------------------------------------------------------------------------
+ Legalize
+------------------------------------------------------------------------
+
+This file is part of groff, the GNU roff type-setting system.
+
+Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+written by Gaius Mulley <gaius@glam.ac.uk>, with additions by
+Werner Lemberg <wl@gnu.org> and Bernd Warken <bwarken@mayn.de>.
+
+groff is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+groff is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with groff; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.
+
+
+------------------------------------------------------------------------
+ Description
+------------------------------------------------------------------------
+
+A simple set of macros to provide HTML documents with basic
+www functionality. It should work with any macro set.
+..
+.
+.\" --------------------------------------------------------------------
+.\" Setup
+.\" --------------------------------------------------------------------
+.
.nr _C \n(.C
.cp 0
.
@@ -27,9 +66,187 @@
. .
.\}
.
+.
+.\" --------------------------------------------------------------------
+.\" Test for `.substring'; result in register `www.substring_ok'.
+.\" The automated break points in .URL addresses are only added if
+.\" this register is non-zero.
+.\"
+.nr www:substring_ok 0
+.de www:@test_substring
+. if !d substring \
+. return
+. ds \\$0:s abcdefg\"
+. substring \\$0:s 1 1
+. if !'\\*[\\$0:s]'b' \{\
+. rm \\$0:s
+. return
+. \}
+. ds \\$0:s abcdefg\"
+. substring \\$0:s 0 0
+. if !'\\*[\\$0:s]'a' \{\
+. rm \\$0:s
+. return
+. \}
+. ds \\$0:s abcdefg\"
+. substring \\$0:s 1 -1
+. if !'\\*[\\$0:s]'bcdefg' \{\
+. rm \\$0:s
+. return
+. \}
+. nr www:substring_ok 1
+. rm \\$0:s
+..
+.www:@test_substring
+.rm www:@test_substring
+.
+.
+.\" --------------------------------------------------------------------
+.\" Local Macros
+.\" --------------------------------------------------------------------
+.
+.\" --------------------------------------------------------------------
+.\" www:error (<test>...)
+.\"
+.\" Print error message
+.\"
.de www-error
. tm \\n[.F]:\\n[.c]: macro error: \\$*
..
+.als www:error www-error
+.
+.\" --------------------------------------------------------------------
+.\" www:lenstr (<register_name> <string_name>)
+.\"
+.\" Store length of string named <string_name> into register named
+.\" <register_name>.
+.\"
+.de www:lenstr
+. if !(\\n[.$] == 2) \{\
+. tm .\\$0 expects 2 arguments.
+. ab
+. \}
+. length \\$0:n x\\*[\\$2]
+. nr \\$1 (\\n[\\$0:n]-1)
+. rr \\$0:n
+..
+.\" --------------------------------------------------------------------
+.\" www:splitstr (<name>)
+.\"
+.\" Add a space character between any two adjacent characters in string
+.\" <name> and restore result into the string variable <name>; space
+.\" characters are first replaced by the word `space'.
+.\"
+.de www:splitstr
+. if !(\\n[.$] == 1) \
+. www:error .\\$0 expects 1 argument.
+. if '\\*[\\$1]'' \
+. return
+. ds \\$0:r "\\*[\\$1]\""
+. ds \\$0:s\"
+. while 1 \{\
+. ds \\$0:c "\\*[\\$0:r]\""
+. substring \\$0:c 0 0\"
+. ie '\\*[\\$0:c]' ' \
+. as \\$0:s " space\""
+. el \
+. as \\$0:s " \\*[\\$0:c]\""
+. www:lenstr \\$0:n \\$0:r
+. if (\\n[\\$0:n] <= 1) \{\
+. break
+. \}
+. substring \\$0:r 1 -1\"
+. \}
+. if !'\\*[\\$0:s]'' \
+. substring \\$0:s 1 -1
+. ds \\$1 \\*[\\$0:s]
+. rm \\$0:c
+. rr \\$0:n
+. rm \\$0:r
+. rm \\$0:s
+..
+.\" --------------------------------------------------------------------
+.\" www:url_breaks (<string_name>)
+.\"
+.\" Add `\:' (possible break point) within URL strings after `/'.
+.\"
+.\" Smart about multiple `/', existing `\:', and space characters;
+.\" does not set a break point if less than 5 characters would go to
+.\" the next line.
+.\"
+.de www:url_breaks
+. if !(\\n[.$] == 1) \
+. www:error .\\$0 expects 1 argument.
+. if !\n[www:substring_ok] \
+. return
+. ds \\$0:s "\\*[\\$1]\""
+. www:splitstr \\$0:s
+. www:url_breaks_splitted \\$0:s \\*[\\$0:s]
+. ds \\$1 "\\*[\\$0:s]\""
+. rm \\$0:s
+..
+.\" --------------------------------------------------------------------
+.\" www:url_breaks_splitted (<result> <char> [<char>...])
+.\"
+.\" Add `\:' within URL strings, but arguments are a splitted string.
+.\"
+.\" Arguments: >=2: <result> <char> [<char>...]
+.\"
+.de www:url_breaks_splitted
+. nr \\$0:min 5 \" minimal number of characters for next line
+. if (\\n[.$] < 2) \
+. www:error .\\$0 expects at least 2 arguments.
+. ds \\$0:res \\$1\"
+. shift
+. ds \\$0:s\"
+. nr \\$0:done 0
+. while !\\n[\\$0:done] \{\
+. if (\\n[.$] <= 0) \{\
+. nr \\$0:done 1
+. break
+. \}
+. if '\\$1'space' \{\
+. as \\$0:s " \""
+. shift
+. continue
+. \}
+. if (\\n[.$] < \\n[\\$0:min]) \{\
+. as \\$0:s "\\$1\""
+. shift
+. continue
+. \}
+. if !'\\$1'/' \{\
+. as \\$0:s "\\$1\""
+. shift
+. continue
+. \}
+. \" we are at a `/' character
+. while '\\$1'/' \{\
+. as \\$0:s /\"
+. if (\\n[.$] == 0) \{\
+. nr \\$0:done 1
+. break
+. \}
+. shift
+. \}
+. if \\n[\\$0:done] \
+. break
+. if (\\n[.$] < \\n[\\$0:min]) \
+. continue
+. if '\\$1'\:' \
+. shift
+. as \\$0:s \:\"
+. \}
+. ds \\*[\\$0:res] \\*[\\$0:s]\"
+. rm \\$0:res
+. rm \\$0:s
+..
+.\" --------------------------------------------------------------------
+.\" User Interface
+.\" --------------------------------------------------------------------
+.
+.\" --------------------------------------------------------------------
+.\" HTML (<address> <description> [<punctuation>])
.\"
.\" the main auxiliary macro for the HTML interface
.\"
@@ -47,47 +264,61 @@
. if \\n[www-html] \
. nop \X^html:\\$*^\c
..
-.\"
+.\" --------------------------------------------------------------------
.\" HX n
.\"
.\" Automatic heading level cut off.
.\"
.\" N is the depth limit of automatically linked headings. So a depth
-.\" of 2 would cause grohtml to generate a list of links for `.NH 1' and
-.\" `.NH 2' but not for `.NH 3'.
+.\" of 2 would cause grohtml to generate a list of links for `.NH 1'
+.\" and `.NH 2' but not for `.NH 3'.
.\"
.de HX
. if \\n[www-html] \
. nop \X^index:\\$*^
..
-.\"
+.\" --------------------------------------------------------------------
.\" BCL foreground background active not-visited visited
.\"
.de BCL
. HTML <body text=\\$1 bgcolor=\\$2 link=\\$3 alink=\\$4 vlink=\\$5>
..
-.\"
+.\" --------------------------------------------------------------------
.\" BGIMG imagefile
.\"
.de BGIMG
. HTML <body background=\\$1>
..
-.\"
-.\" URL url description [after]
+.\" --------------------------------------------------------------------
+.\" URL url [description] [after]
+.\" if description is absent then the url becomes the anchor text
.\"
.de URL
-. ie \\n[www-html] \
-. HTML <a href="\\$1">\\$2</a>\\$3
-. el \
-. nop \m[blue]\\$2\m[] \%\[la]\f[C]\\$1\f[]\[ra]\\$3
+. ds \\$0:adr \\$1\"
+. www:url_breaks \\$0:adr
+. ie \\n[www-html] \{\
+. ie '\\$2'' \
+. HTML <a href="\\$1">\\$1</a>\\$3
+. el \
+. HTML <a href="\\$1">\\$2</a>\\$3
+. \}
+. el \{\
+. if !r ps4html .ad l
+. ie '\\$2'' \
+. nop \%\[la]\m[blue]\f[C]\\*[\\$0:adr]\f[]\m[]\[ra]\\$3
+. el \
+. nop \m[blue]\\$2\m[] \%\[la]\f[C]\\*[\\$0:adr]\f[]\[ra]\\$3
+. if !r ps4html .ad
+. \}
+. rm \\$0:adr
..
-.\"
+.\" --------------------------------------------------------------------
.\" FTP url description [after]
.\"
-.\" Same as UTL.
+.\" Same as URL.
.\"
.als FTP URL
-.\"
+.\" --------------------------------------------------------------------
.\" MTO address description [after]
.\"
.\" ADDRESS is the email address (without the `mailto:' prefix).
@@ -117,7 +348,7 @@
. nop \m[blue]\\$2\m[] \%\[la]\f[C]\\$1\f[]\[ra]\\$3
. \}
..
-.\"
+.\" --------------------------------------------------------------------
.\" TAG name
.\"
.\" Generate an html name NAME.
@@ -125,7 +356,7 @@
.de TAG
. HTML <a name="\\$1"></a>
..
-.\"
+.\" --------------------------------------------------------------------
.\" IMG [-R|-L|-C] filename [width] [height]
.\"
.\" Include an image of any type (will only work for -Thtml).
@@ -155,7 +386,7 @@
. el \
. nop \[la]\f[C]\\$1\f[]\[ra]
..
-.\"
+.\" --------------------------------------------------------------------
.\" HTML-TAG
.\"
.\" Emit a tag for grohtml. This is an internal macro.
@@ -167,7 +398,7 @@
. nop \X^html-tag:\\$*^
. \}
..
-.\"
+.\" --------------------------------------------------------------------
.\" HTML-TAG-NS
.\"
.\" Emit a tag for grohtml (without a space). This is an internal macro.
@@ -176,7 +407,7 @@
. if \\n[www-html] \
. nop \X^html-tag:\\$*^\c
..
-.\"
+.\" --------------------------------------------------------------------
.\" PIMG [-R|-L|-C] filename [width] [height]
.\"
.\" Include a png image. It will work for -Tps and -Thtml.
@@ -219,7 +450,7 @@
. el \{\
. if !r ps4html \{\
. www-make-unique-name
-. sy pngtopnm \\$2 | pnmcrop -white | pnmtops -noturn > \\*[www-unique-name].eps
+. sy pngtopnm \\$2 | pnmcrop -white | @PNMTOPS_NOSETPAGE@ -noturn > \\*[www-unique-name].eps
. ie '\\$1'-C' \
. PSPIC \\*[www-unique-name].eps \\$3 \\$4
. el \
@@ -228,6 +459,9 @@
. \}
..
.
+.\" --------------------------------------------------------------------
+.\" auxiliary definitions for MPIMG
+.\"
.nr www-left-ll-trap 0
.nr www-left-po-trap 0
.nr www-right-ll-trap 0
@@ -274,7 +508,7 @@
. wh \\n[www-left-ll-trap]u
. nr www-left-ll-trap 0
..
-.\"
+.\" --------------------------------------------------------------------
.\" MPIMG [-R|-L] filename [width] [height]
.\"
.\" Include a png image and wrap text around it. It will work for
@@ -303,7 +537,7 @@
. el \{\
. if !r ps4html \{\
. www-make-unique-name
-. sy pngtopnm \\$2 | pnmcrop -white | pnmtops -noturn > \\*[www-unique-name].eps
+. sy pngtopnm \\$2 | pnmcrop -white | @PNMTOPS_NOSETPAGE@ -noturn > \\*[www-unique-name].eps
. ie '\\$1'-R' \{\
. \" we must now disable a possible left image trap
. sp -1
@@ -343,7 +577,7 @@
. \}
. \}
..
-.\"
+.\" --------------------------------------------------------------------
.\" HnS n
.\"
.\" Begin heading. Heading level is N.
@@ -371,7 +605,7 @@
. www-error "HnE found without a corresponding HnS"
. br
..
-.\"
+.\" --------------------------------------------------------------------
.\" LK
.\"
.\" Emit the automatically collected links derived from
@@ -380,7 +614,7 @@
.de LK
. HTML-TAG ".links"
..
-.\"
+.\" --------------------------------------------------------------------
.\" HR
.\"
.\" Produce a horizontal line
@@ -393,7 +627,7 @@
. el \
. sp
..
-.\"
+.\" --------------------------------------------------------------------
.\" NHR
.\"
.\" Suppresses the generation of the top and bottom rules which grohtml
@@ -408,7 +642,7 @@
.de www-end-nowhere
. di
..
-.\"
+.\" --------------------------------------------------------------------
.\" HTL
.\"
.\" Generate an HTML title only. This differs from the -ms .TL macro
@@ -427,6 +661,9 @@
. \}
..
.
+.\" --------------------------------------------------------------------
+.\" auxiliary definitions for ULS / ULE
+.\"
.ds www-level1 \[bu]\ \ \"
.ds www-level2 \[sq]\ \ \"
.ds www-level3 \[ci]\ \ \"
@@ -449,7 +686,7 @@
. www-error "trying to terminate a list which does not exist"
. nr www-level -1
..
-.\"
+.\" --------------------------------------------------------------------
.\" ULS
.\"
.\" Start an unordered list.
@@ -464,7 +701,7 @@
. nr www-depth +\w'\\*[www-level\\n[www-level]]'u
. \}
..
-.\"
+.\" --------------------------------------------------------------------
.\" ULE
.\"
.\" End an unordered list.
@@ -478,7 +715,7 @@
. \}
. www-pop-level
..
-.\"
+.\" --------------------------------------------------------------------
.\" LI
.\"
.\" Insert a list item.
@@ -492,7 +729,7 @@
. nop \\*[www-level\\n[www-level]]\c
. \}
..
-.\"
+.\" --------------------------------------------------------------------
.\" DC l text [color]
.\"
.\" L is the letter to be dropped and enlarged.
@@ -537,6 +774,8 @@
. \}
. nop \\$2
..
+.\" --------------------------------------------------------------------
+.\" Setup around HTML-IMAGE and friends
.\"
.\" now set up TS, TE, EQ, EN default macros
.\"
@@ -547,9 +786,10 @@
.\"
.\" supplementary macros used by other macro sets
.\"
-.\" here are some tags specially for -Tps or -Thtml when invoked by pre-html
-.\" to generate png images from postscript.
-.\"
+.\" here are some tags specially for -Tps or -Thtml when invoked by
+.\" pre-html to generate png images from postscript.
+.
+.\" --------------------------------------------------------------------
.\" HTML-DO-IMAGE - tells troff to issue an image marker which can be
.\" read back by pre-html
.\"
@@ -559,7 +799,7 @@
. if \\n[www-html] \
. nop \O[5\\$2\\$1.png]\O[0]\O[3]
..
-.\"
+.\" --------------------------------------------------------------------
.\" HTML-IMAGE-END - terminates an image for html
.\"
.de HTML-IMAGE-END
@@ -571,7 +811,7 @@
.
.nr www-png-no 0
.
-.\"
+.\" --------------------------------------------------------------------
.\" www-make-unique-name - generates another unique name in string
.\" `www-unique-name'
.\"
@@ -579,7 +819,7 @@
. nr www-png-no +1
. ds www-unique-name \\*[www-image-template]\\n[www-png-no]
..
-.\"
+.\" --------------------------------------------------------------------
.\" HTML-IMAGE and friends tell grohtml that this region of text needs
.\" to be rendered as an image.
.\"
@@ -604,11 +844,42 @@
. HTML-DO-IMAGE \\*[www-unique-name] i
..
.
+.\" --------------------------------------------------------------------
+.\" Final Setup
+.\" --------------------------------------------------------------------
+.
.if \n[www-html] \{\
. nh
. nr HY 0
.\}
+.
+.\"
+.\" start of some code
+.\"
+.
+.de CDS
+.ft C
+.nf
+..
+.\"
+.\" end of some code
+.\"
+.
+.de CDE
+.fi
+.ft P
+..
+.
.if r ps4html .nop \O[0]
.cp \n(_C
.
+.\" now set
+.
+.\" --------------------------------------------------------------------
+.\" Emacs settings
+.\" --------------------------------------------------------------------
+.
+.\" Local Variables:
+.\" mode: nroff
+.\" End:
.\" EOF