summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Clark <jjc@jclark.com>1994-02-19 08:07:38 -0500
committerJames Clark <jjc@jclark.com>1994-02-19 08:07:38 -0500
commit7ba7a1343596d58ba91446b89c68bdfd10330436 (patch)
tree08cce86bc8d99c473fb2ea5e167eaabe2ea92f59
parent5bba1c1b0992c9b30fc6901c6f750c831e6d7712 (diff)
groff before CVS: release 1.091.09
-rw-r--r--BUG-REPORT2
-rw-r--r--ChangeLog393
-rw-r--r--INSTALL13
-rw-r--r--Makefile373
-rw-r--r--Makefile.comm10
-rw-r--r--Makefile.in28
-rw-r--r--NEWS27
-rw-r--r--PROBLEMS144
-rw-r--r--PROJECTS2
-rw-r--r--TODO2
-rw-r--r--VERSION2
-rw-r--r--acgroff.m459
-rw-r--r--addftinfo/addftinfo.cc20
-rw-r--r--afmtodit/afmtodit.man2
-rw-r--r--afmtodit/afmtodit.pl4
-rw-r--r--bug.PS66
-rwxr-xr-xconfig.status88
-rwxr-xr-xconfigure656
-rw-r--r--configure.in9
-rw-r--r--devX100-12/S2
-rw-r--r--devX100/S2
-rw-r--r--devX75-12/S2
-rw-r--r--devX75/S2
-rw-r--r--devdvi/generate/cork.map206
-rw-r--r--devps/S2
-rw-r--r--devps/generate/textmap2
-rw-r--r--eqn/TODO2
-rw-r--r--eqn/box.cc78
-rw-r--r--eqn/delim.cc4
-rw-r--r--eqn/eqn.man2
-rw-r--r--eqn/lex.cc376
-rw-r--r--eqn/main.cc2
-rw-r--r--eqn/sqrt.cc4
-rw-r--r--grodvi/dvi.cc2
-rw-r--r--grodvi/grodvi.man2
-rw-r--r--groff/groff.cc4
-rw-r--r--groff/pipeline.c7
-rw-r--r--grog/grog.man2
-rw-r--r--grops/TODO4
-rw-r--r--grops/grops.man30
-rw-r--r--grops/ps.cc63
-rw-r--r--grops/psfig.diff2
-rw-r--r--grops/psrm.cc32
-rw-r--r--grotty/grotty.man4
-rw-r--r--grotty/tty.cc34
-rw-r--r--include/assert.h4
-rw-r--r--include/lib.h22
-rw-r--r--include/posix.h6
-rw-r--r--include/stringclass.h29
-rw-r--r--indxbib/indxbib.cc5
-rw-r--r--libbib/index.cc8
-rw-r--r--libbib/linear.cc6
-rw-r--r--libdriver/input.cc11
-rw-r--r--libgroff/assert.cc3
-rw-r--r--libgroff/cmap.cc5
-rw-r--r--libgroff/cset.cc5
-rw-r--r--libgroff/font.cc24
-rw-r--r--libgroff/new.cc24
-rw-r--r--libgroff/strtol.c17
-rw-r--r--lkbib/lkbib.cc4
-rw-r--r--lookbib/lookbib.cc2
-rw-r--r--man/groff_font.man4
-rw-r--r--man/groff_out.man4
-rw-r--r--mm/ChangeLog38
-rw-r--r--mm/Makefile.sub5
-rw-r--r--mm/groff_mm.man49
-rw-r--r--mm/mm/0.MT2
-rw-r--r--mm/mm/ms.cov1
-rw-r--r--mm/tmac.m159
-rw-r--r--mm/tmac.mse2
-rw-r--r--nroff/nroff.man23
-rwxr-xr-xnroff/nroff.sh4
-rw-r--r--pfbtops/pfbtops.c4
-rw-r--r--pic/common.cc2
-rw-r--r--pic/lex.cc166
-rw-r--r--pic/main.cc2
-rwxr-xr-xpic/make-dos-dist11
-rw-r--r--pic/object.h2
-rw-r--r--pic/pic.cc44
-rw-r--r--pic/pic.man2
-rw-r--r--pic/pic.y44
-rw-r--r--pic/troff.cc1
-rw-r--r--refer/TODO124
-rw-r--r--refer/command.cc92
-rw-r--r--refer/label.cc84
-rw-r--r--refer/label.y12
-rw-r--r--refer/refer.cc8
-rw-r--r--refer/refer.man12
-rw-r--r--refer/token.cc12
-rw-r--r--soelim/TODO1
-rw-r--r--soelim/soelim.cc2
-rw-r--r--tbl/main.cc4
-rw-r--r--tbl/table.cc10
-rw-r--r--tbl/table.h3
-rw-r--r--tfmtodit/tfmtodit.cc28
-rw-r--r--tfmtodit/tfmtodit.man2
-rw-r--r--tmac/doc-ditroff18
-rw-r--r--tmac/groff_ms.man10
-rw-r--r--tmac/tmac.X3
-rw-r--r--tmac/tmac.dvi12
-rw-r--r--tmac/tmac.e8
-rw-r--r--tmac/tmac.ps3
-rw-r--r--tmac/tmac.pspic18
-rw-r--r--tmac/tmac.s67
-rw-r--r--troff/TODO8
-rw-r--r--troff/charinfo.h2
-rw-r--r--troff/dictionary.cc2
-rw-r--r--troff/div.cc11
-rw-r--r--troff/div.h1
-rw-r--r--troff/input.cc223
-rw-r--r--troff/node.cc18
-rw-r--r--troff/node.h6
-rw-r--r--troff/symbol.cc4
-rw-r--r--troff/token.h3
-rw-r--r--troff/troff.h13
-rw-r--r--troff/troff.man31
-rw-r--r--xditview/ChangeLog15
-rw-r--r--xditview/Dvi.c2
-rw-r--r--xditview/DviChar.c2
-rw-r--r--xditview/DviChar.h2
-rw-r--r--xditview/Makefile15
-rw-r--r--xditview/TODO2
-rw-r--r--xditview/device.c6
-rw-r--r--xditview/gxditview.man31
-rw-r--r--xditview/xditview.c5
125 files changed, 2836 insertions, 1615 deletions
diff --git a/BUG-REPORT b/BUG-REPORT
index c87c66fe5..d3c9b0299 100644
--- a/BUG-REPORT
+++ b/BUG-REPORT
@@ -40,7 +40,7 @@ definite example.]
COMMAND LINE:
[The command line that I should run in order to observe the bug. For
-example, `gtroff -Tps bug.tr'. If the commmand line uses -ms or -mm,
+example, `gtroff -Tps bug.tr'. If the command line uses -ms or -mm,
say whether these refer to the groff versions or the Unix versions of
the macros.]
diff --git a/ChangeLog b/ChangeLog
index 5c338d674..9db9bd716 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,396 @@
+Sat Feb 19 13:07:16 1994 James Clark (jjc@jclark.com)
+
+ * Version 1.09 released.
+
+Wed Feb 16 16:53:49 1994 James Clark (jjc@jclark.com)
+
+ * tmac/doc-ditroff (hK): Don't reset page number if \nC is > 0.
+
+Mon Feb 14 08:26:40 1994 James Clark (jjc@jclark.com)
+
+ * libgroff/font.cc (font::load_desc): Fix typo in error message.
+
+Sun Feb 13 09:37:38 1994 James Clark (jjc@jclark.com)
+
+ * libgroff/new.cc (operator new): Rewrite so as to avoid warning
+ about returning without a value.
+
+ * troff/charinfo.h (charinfo::get_special_translation): Cast
+ TRANSLATE_NONE to int.
+
+ * refer/token.cc (lookup_token, store_token): Remove bogus loop
+ test. Fix test so that it works with n unsigned.
+
+ * pic/pic.y (defaults_table): Fully bracket initializer.
+ * pic/lex.cc (lookup_keyword): Likewise.
+ * eqn/lex.cc (token_table, def_table): Likewise.
+ * eqn/box.cc (param_table): Likewise.
+ * troff/input.cc (warning_table): Likewise.
+ * libgroff/font.cc (table): Likewise.
+ * grops/ps.cc (ps_printer::special): Likewise.
+ * grops/psrm.cc (resource_manager::process_file): Likewise.
+ * tfmtodit/tfmtodit.cc (lig_chars, lig_table): Likewise.
+ * refer/command.cc (command_table): Likewise.
+ * addftinfo/addftinfo.cc (param_table): Likewise.
+
+ * troff/symbol.cc (symbol::symbol): Prevent compiler warnings
+ about temp's being unused.
+ (unused): New function.
+
+ * groff/pipeline.cc: Declare c_fatal.
+
+ * libbib/linear.cc (bmpattern::search): Cast patterrn[--j] to
+ uchar.
+
+ * libbib/index.cc (index_search_item::load): Prevent compiler
+ warnings about fd_closer's being unused.
+ (unused): New function.
+
+Sat Feb 12 10:31:59 1994 James Clark (jjc@jclark.com)
+
+ * troff/input.cc (copy_mode_error): Make `prefix' static.
+ Fix typo.
+
+ * include/posix.h: Include <osfcn.h> is HAVE_CC_OSFCN_H is
+ defined.
+ * acgroff.m4, configure.in, Makefile: Rename HAVE_CC_UNISTD_H to
+ HAVE_CC_OSFCN_H and modify accordingly.
+
+ * troff/input.cc (init_charset_table): radicalex overlaps
+ horizontally.
+
+ * groff/acgroff.m4 (GROFF_ISC_SYSV3): New macro (from
+ udodo!hans@relay.NL.net).
+ * groff/configure.in: Call it.
+
+ * groff/acgroff.m4 (GROFF_PCLOSE): New macro.
+ * groff/configure.in: Call it.
+ * include/lib.h: Conditionalize declaration of pclose.
+
+ * troff/div.cc (last_page_number): New global variable.
+ (top_level_diversion::begin_page): Exit if we just printed the
+ last page.
+ * troff/div.h (last_page_number): Declare it.
+ * troff/input.cc (parse_output_page_list): Set last_page_number.
+
+ * eqn/sqrt.cc: Rename \(rn to \[radicalex].
+ * devps/S, devps/textmap, tmac/tmac.ps, tmac/tmac.dvi,
+ tmac/tmac.X: Likewise.
+ * tmac/tmac.ps, tmac/tmac.X, tmac.dvi: Add definitions of \(rn.
+ * tmac.dvi: Make \(ru and \(ul extend beyond their width by .04m.
+
+Fri Feb 11 11:45:40 1994 James Clark (jjc@jclark.com)
+
+ * tmac/doc-ditroff (hK): Remove groff specific code which
+ prevented page-breaks between separate manual entries. If this is
+ the first page, don't set the page number to 1.
+
+ * acgroff.m4 (GROFF_POSIX): New macro.
+ * configure.in: Use it.
+
+ * troff/node.cc (class real_output_file,
+ real_output_file::real_output_file,
+ real_output_file::~real_output_file): Conditionalize use of
+ popen/pclose on POPEN_MISSING.
+ * troff/node.h: Conditionalize pipe_command on POPEN_MISSING.
+ * troff/input.cc (pipe_command): Give an error if POPEN_MISSING.
+ (pipe_source): Similarily.
+
+ * acgroff.m4 (GROFF_PROG_CCC): Update message about libg++.
+
+ * acgroff.m4 (GROFF_GETOPT, GROFF_PUTENV, GROFF_POPEN): Detect
+ presence of declarations by trying to compile example with
+ conflicting declarations. (gcc only gives a warning for missing
+ declarations.)
+
+Wed Feb 9 09:12:23 1994 James Clark (jjc@jclark.com)
+
+ * tmac/tmac.pspic (PSPIC): Allow options to specify alignment
+ (from Ulrich Lauther).
+
+Tue Feb 8 03:56:40 1994 James Clark (jjc@jclark.com)
+
+ * libbib/linear.cc (file_buffer::load): Use S_ISREG macro.
+
+Thu Feb 3 09:34:35 1994 James Clark (jjc@jclark.com)
+
+ * indxbib/indxbib.cc (write_hash_table): Add code for case where
+ pointers and ints have different sizes.
+
+Sun Jan 9 16:17:51 1994 James Clark (jjc@jclark.com)
+
+ * tmac/tmac.s (par*env-init): Call par@reset.
+
+Fri Jan 7 10:24:27 1994 James Clark (jjc@jclark.com)
+
+ * tmac/tmac.s (@IP): Switch to a new environment when diverting
+ tag.
+ (par*push-tag-env, par*pop-tag-env): New macros.
+
+Wed Jan 5 21:18:34 1994 James Clark (jjc@jclark.com)
+
+ * grops/ps.cc (ps_printer::ps_printer): Use MAX_LINE_LENGTH for
+ initializing `out'. Reduce MAX_LINE_LENGTH from 79 to 72.
+
+ * grops/ps.cc (ps_printer::~ps_printer): Output %%CreationDate
+ comment. Include <time.h>.
+
+Wed Dec 15 14:14:00 1993 James Clark (jjc@jclark.com)
+
+ * grops/ps.cc (is_small_h, is_small_v): Deleted.
+ (ps_printer::flush_sbuf): Use absolute motion only at beginning of
+ lines.
+
+Tue Dec 14 10:06:34 1993 James Clark (jjc@jclark.com)
+
+ * troff/input.cc (read_request): Only print a prompt if reading
+ from the terminal. Also clearerr on EOF if reading from the
+ terminal. Declare isatty.
+
+Mon Nov 29 08:38:15 1993 James Clark (jjc@jclark.com)
+
+ * refer/label.y: Rename map_t to map_func and extractor_t to
+ extractor_func.
+
+Sat Oct 30 06:38:12 1993 James Clark (jjc@jclark.com)
+
+ * include/assert.h: Don't use volatile.
+ * libgroff/assert.cc: Likewise.
+
+Fri Oct 29 15:00:23 1993 James Clark (jjc@jclark.com)
+
+ * troff/input.cc (abort_request): Look at character in tok before
+ calling get_copy().
+
+Thu Oct 28 14:09:48 1993 James Clark (jjc@jclark.com)
+
+ * troff/troff.h (NO_RETURN): Deleted.
+ * troff/div.cc (cleanup_and_exit): Don't declare aas NO_RETURN.
+ * troff/input.cc (exit_troff): Likewise
+
+ * Makefile.in: Remove `Making ...' messages since GNU make now
+ gives these.
+
+ * configure.in: Use AC_HAVE_HEADERS(unistd.h) instead of AC_UNISTD_H.
+
+Wed Oct 27 11:12:51 1993 James Clark (jjc@jclark.com)
+
+ * tmac/tmac.s (@init): Initialize PO to \n(.o here, rather than
+ to constant 1 inch.
+
+Sat Oct 23 10:03:52 1993 James Clark (jjc@jclark.com)
+
+ * tmac/tmac.e (hl): Use \n[.in] rather than \n(.i.
+
+Thu Oct 14 12:09:45 1993 James Clark (jjc@jclark.com)
+
+ * eqn/delim.cc (delim_box::compute_metrics): Don't increase
+ MARK_REG if there was no left delimiter.
+
+Sat Oct 2 19:54:47 1993 James Clark (jjc@jclark.com)
+
+ * pic/troff.cc (troff_output::text): Set line thickness to
+ relative before outputting text.
+
+ * tmac/tmac.e (@k): Don't zero ?T.
+ ((z): Likewise.
+
+Sat Sep 25 11:08:43 1993 James Clark (jjc@jclark.com)
+
+ * tmac/tmac.e ($p): Handle possibility that $3 is empty.
+
+Wed Aug 18 08:51:41 1993 James Clark (jjc@jclark.com)
+
+ * troff/input.cc (decode_args): Warn about unquoted tabs (from
+ Paul Eggert).
+
+Tue Aug 10 08:38:32 1993 James Clark (jjc@jclark.com)
+
+ * troff/input.cc (ignoring): New variable.
+ (ignore): Set ignoring during call to do_define_macro.
+ (do_define_macro): Clear ignoring before interpolating terminating
+ macro.
+ (copy_mode_error): New function.
+ (get_char_for_escape_name, read_long_escape_name,
+ interpolate_arg): Use copy_mode_error.
+ (warning_table): Add WARN_IG.
+ * troff/troff.h (WARN_IG): Declare.
+ (WARN_TOTAL): Change accordingly.
+
+ * groff/pipeline.c (strsignal): Rename to xstrsignal.
+ * groff/groff.cc (strsignal): Delete declaration.
+
+Fri Jul 16 01:43:12 1993 James Clark (jjc@jclark.com)
+
+ * troff/div.cc (page_offset): Use 'm' as default scaling.
+
+Sat Jul 3 09:11:38 1993 James Clark (jjc@jclark.com)
+
+ * nroff/nroff.sh: Ignore -u.
+
+Wed Jun 9 12:17:27 1993 James Clark (jjc@jclark.com)
+
+ * Makefile.in (MDEFINES): Pass down MAKEOVERRIDES.
+
+Fri Jun 4 17:35:47 1993 James Clark (jjc@jclark.com)
+
+ * tmac/tmac.s (par*box-draw): Set adjustment mode to l while
+ drawing box.
+ (B2): With -Tascii, leave additional vertical space before
+ and after. Ensure that the left and right indent is restored to
+ what it was even if the point size changes. Don't call
+ par@finish. Change the indent, line length and title length
+ directly. With -Tascii, make the width of the box 1n less.
+ (B1): Remember 1n at the current point size. Don't call
+ par@reset. Change the indent, line length and title length
+ directly. Ensure that the temporary indent is preserved.
+ (par*box-mark-top): Turn off no spacing mode.
+
+Thu Jun 3 17:47:14 1993 James Clark (jjc@jclark.com)
+
+ * Makefile.in (dist): Use .gz suffix.
+
+Thu May 27 20:04:59 1993 James Clark (jjc@jclark.com)
+
+ * troff/input.cc (main): Add return 0.
+ * pic/main.cc (main): Use return instead of exit.
+ * tbl/main.cc (main): Likewise.
+ * eqn/main.cc (main): Likewise.
+ * grops/ps.cc (main): Likewise.
+ * grotty/tty.cc (main): Likewise.
+ * groff/groff.cc (main): Likewise.
+ * grodvi/dvi.cc (main): Likewise.
+ * refer/refer.cc (main): Likewise.
+ * indxbib/indxbib.cc (main): Likewise.
+ * lkbib/lkbib.cc (main): Likewise.
+ * soelim/soelim.cc (main): Likewise.
+ * addftinfo/addftinfo.cc (main): Likewise.
+ * acgroff.m4 (GROFF_PROG_CCC, GROFF_CC_COMPILE_CHECK,
+ GROFF_COOKIE_BUG, GROFF_CC_ANSI_BUG): Likewise.
+
+ * troff/token.h (process_input_stack): Don't declare as static.
+ * troff/input.cc: Likewise.
+
+ * troff/node.c (invalidate_fontno): Make it a static member of
+ class font_family. Change callers.
+ * troff/node.c: Change declaration.
+
+ * tbl/main.cc (struct input_entry_format): Add explicit public
+ specifier.
+ * tbl/table.cc (struct text_stuff, struct single_hline_stuff,
+ struct double_hline_stuff): Likewise.
+ * tbl/table.h (struct entry_format): Likewise.
+ * pic/object.h (struct saved_state): Likewise.
+
+ * include/stringclass.h: Add forward declarations of friend
+ functions that are later declared as inline. Don't include inline
+ specifier in friend declaration.
+
+ * libgroff/lib.h: Declare popen and pclose.
+ * acgroff.m4 (GROFF_POPEN): New macro.
+ * configure.in: Call it.
+
+ * include/lib.h (PI): New constant. Undef first if necessary.
+ * tfmtodit/tfmtodit.cc (main): Use PI rather than M_PI.
+ * grops/ps.cc (degrees, radians): Likewise.
+ * libgroff/font.cc (font::get_skew): Likewise.
+
+ * grops/ps.cc (is_ascii): New function.
+ (ps_output::put_string): Use is_ascii. Use csprint rather than
+ isprint.
+ (ps_printer::define_encoding): Use csspace.
+ * libgroff/strtol.c (ISASCII): New macro.
+ (strtol): Cast arguments to is*() and tolower() to unsigned char.
+ Use ISASCII rather than isascii.
+ * libgroff/cmap.cc: Use isascii() only if <ctype.h> defines it.
+ * libgroff/cset.cc: Likewise.
+ * libdriver/input.cc: Include cset.h.
+ (do_file, get_integer, possibly_get_integer): Use csdigit() rather
+ than isdigit().
+
+ * refer/refer.cc (main): Use %ld rather than %d for longs.
+
+ * libbib/index.cc (index_search_item_iterator::get_tag): Use
+ S_ISREG macro.
+
+ * addftinfo/addftinfo.cc (param_t): Add explicit `int'.
+
+Mon May 24 08:51:37 1993 James Clark (jjc@jclark.com)
+
+ * troff/input.cc (hyphenation_code): Skip white space between
+ char/code pairs.
+
+Sun May 16 08:15:52 1993 James Clark (jjc at jclark.com)
+
+ * tbl/table.h (table::entry_list_tailp): New member.
+ (table::table): Initialize it.
+ (table::add_entry): Use entry_list_tailp to avoid O(n^2)
+ behaviour.
+
+Sat May 15 17:26:00 1993 James Clark (jjc at jclark.com)
+
+ * grotty/tty.cc (tty_printer::add_char): Don't discard characters
+ with negative horizontal positions. Remove casts of glyph::hpos to
+ int.
+ (USHRT_MAX): Delete definition.
+ (SHRT_MAX, SHRT_MIN): New definitions.
+ (glyph::hpos): Change type to short.
+ (tty_printer::end_page): Output multiple backspaces if necessary.
+ Remove casts of glyph::hpos to int.
+
+Fri May 7 12:14:37 1993 James Clark (jjc at jclark.com)
+
+ * tmac/tmac.s (@RT): New definition.
+
+Thu May 6 21:36:54 1993 James Clark (jjc at jclark.com)
+
+ * refer/refer.cc (do_file): Make sure current_filename is set when
+ filename is "-".
+
+ * pic/common.cc (common_output::dot_line): Handle zero length
+ lines.
+
+Sun May 2 19:54:16 1993 James Clark (jjc at jclark.com)
+
+ * tmac/tmac.s (par@reset): Get value for .hy for \n[HY].
+ (par@init): Initialize \n[HY].
+
+Mon Apr 26 11:43:16 1993 James Clark (jjc at jclark.com)
+
+ * troff/dictionary.cc (dictionary::remove): Continue when
+ r < j < i.
+
+Sun Apr 25 11:03:00 1993 James Clark (jjc at jclark.com)
+
+ * Makefile.com (.y.cc): Avoid ending up with two versions of
+ $(YTABH).
+
+Thu Apr 22 21:03:45 1993 James Clark (jjc at jclark.com)
+
+ * tmac/tmac.dvi (\(,c): Define only if it does not exist.
+ (\(,C): Likewise. Also fix typo.
+
+Wed Apr 21 08:47:32 1993 James Clark (jjc at jclark.com)
+
+ * lib.h: Delete extraneous semi-colon.
+
+ * Add pso request: `so' from a pipe.
+ * troff/input.c (file_iterator::file_iterator): Add 3rd argument.
+ (file_iterator::close): New function.
+ (file_iterator::~file_iterator, file_iterator::next_file): Use
+ file_iterator::close.
+ (file_iterator::backtrace): Say `process' rather than `file' when
+ the stream is popened.
+ (pipe_source): New function.
+ (init_input_requests): Bind ".pso" to pipe_source.
+
+Tue Apr 20 00:02:26 1993 James Clark (jjc at jclark.com)
+
+ * afmtodit/afmtodit.pl: Avoid single quotes in comments.
+
+ * pfbtops/pfbtops.c: Output 64 characters per line. Output hex
+ digits in lower case.
+
Mon Apr 19 09:55:57 1993 James Clark (jjc at jclark)
* Version 1.08 released.
diff --git a/INSTALL b/INSTALL
index e6e990fd6..3e10726b2 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,10 +1,9 @@
1. Get a C++ compiler. The C++ source files use a suffix of `.cc', so
your C++ compiler must be able to handle this. If you don't already
-have a C++ compiler, I suggest gcc 2.3.1 or later (gcc version 2
-includes GNU C++ as well as GNU C). If you are using gcc or g++ as
-your C++ compiler, you will also need to install the corresponding
-version of libg++, unless your system header files provide C++
-support.
+have a C++ compiler, I suggest gcc 2.5.8 or later (gcc version 2
+includes GNU C++ as well as GNU C). From gcc 2.5, it is no longer
+necessary to install libg++: the C++ header files needed by groff are
+created by the gcc installation process.
2. In the directory that this file is in, type `./configure'. If
you're using `csh' on an old version of System V, you might need to
@@ -88,6 +87,10 @@ DEFS Configuration options, in the form `-Dfoo -Dbar ...'
LIBS Libraries to link with, in the form `-lfoo -lbar ...'
CCLIBS Libraries to link C++ programs with, in the same form.
+If you have a library that provides a faster malloc than your system's
+usual malloc, it is good idea to include it in LIBS. For example,
+using the malloc that comes with GNU Emacs version 18 can give a
+worthwhile (and sometimes spectacular) performance improvement.
If you need to do unusual things to compile the package, we encourage
you to figure out how `configure' could check whether to do them, and
diff --git a/Makefile b/Makefile
index 006fd5a9b..8d93c936b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,4 @@
-# Generated automatically from Makefile.in by configure.
-# Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+# Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
# Written by James Clark (jjc@jclark.com)
#
# This file is part of groff.
@@ -18,371 +17,9 @@
# with groff; see the file COPYING. If not, write to the Free Software
# Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-# Define `page' to be letter if your PostScript printer uses 8.5x11
-# paper (USA) and define it to be A4, if it uses A4 paper (rest of the
-# world).
-PAGE=letter
-
-# Normally the Postscript driver, grops, produces output that conforms
-# to version 3.0 of the Adobe Document Structuring Conventions.
-# Unfortunately some spoolers and previewers can't handle such output.
-# The BROKEN_SPOOLER_FLAGS variable tells grops what it should do to
-# make its output acceptable to such programs. This variable controls
-# only the default behaviour of grops; the behaviour can be changed at
-# runtime by the grops -b option (and so by groff -P-b).
-# Use a value of 0 if your spoolers and previewers are able to handle
-# conforming PostScript correctly.
-# Add 1 if no %%{Begin,End}DocumentSetup comments should be generated;
-# this is needed for early versions of TranScript that get confused by
-# anything between the %%EndProlog line and the first %%Page: comment.
-# Add 2 if lines in included files beginning with %! should be
-# stripped out; this is needed for the OpenWindows 2.0 pageview previewer.
-# Add 4 if %%Page, %%Trailer and %%EndProlog comments should be
-# stripped out of included files; this is needed for spoolers that
-# don't understand the %%{Begin,End}Document comments. I suspect this
-# includes early versions of TranScript.
-# Add 8 if the first line of the PostScript output should be %!PS-Adobe-2.0
-# rather than %!PS-Adobe-3.0; this is needed when using Sun's Newsprint
-# with a printer that requires page reversal.
-BROKEN_SPOOLER_FLAGS=7
-
-# DEVICE is the default device.
-DEVICE=ps
-
-# PSPRINT is the command to use for printing a PostScript file,
-# for example `lpr'.
-PSPRINT=lpr
-
-# DVIPRINT is the command to use for printing a TeX dvi file,
-# for example `lpr -d'.
-DVIPRINT=lpr -d
-
-# Prefix for names of programs that have Unix counterparts.
-# For example, if `g' is `g' then troff will be installed as
-# gtroff. This doesn't affect programs like grops or groff that have
-# no Unix counterparts. Note that the groff versions of eqn and tbl
-# will not work with Unix troff. This is also use in the definitions
-# of tmac_s and tmac_m.
-g=g
-
-# The groff ms macros will be available as -m$(tmac_s).
-# If you use `tmac_s=s', you can use the Unix ms macros by using
-# groff -ms -M/usr/lib/tmac.
-tmac_s=$(g)s
-
-# Similarily, the groff mm macros will be available as -m$(tmac_m).
-tmac_m=$(g)m
-
-# Common prefix for installation directories.
-# Used in definitions of exec_prefix, datasubdir, fontpath, manroot.
-# This must already exist when you do make install.
-prefix=/usr/local
-
-exec_prefix=${prefix}
-
-# bindir says where to install executables.
-bindir=$(exec_prefix)/bin
-
-# datasubdir says where to install data files
-datadir=$(prefix)/lib
-datasubdir=$(datadir)/groff
-
-# fontdir says where to install dev*/*.
-fontdir=$(datasubdir)/font
-
-# fontpath says where to look for dev*/*.
-fontpath=.:$(fontdir):$(prefix)/lib/font:/usr/lib/font
-
-# tmacdir says where to install macros.
-tmacdir=$(datasubdir)/tmac
-
-# tmacpath says where to look for macro files.
-tmacpath=.:$(tmacdir):/usr/lib/tmac
-
-# Extension to be used for refer index files. Index files are not
-# shareable between different architectures, so you might want to use
-# different suffixes for different architectures. Choose an extension
-# that doesn't conflict with refer or any other indexing program.
-indexext=.i
-
-# Directory containing the default index for refer.
-indexdir=/usr/dict/papers
-
-# The filename (without suffix) of the default index for refer.
-indexname=Ind
-
-# common_words_file is a file containing a list of common words.
-# If your system provides /usr/lib/eign it will be copied onto this,
-# otherwise the supplied eign file will be used.
-common_words_file=$(datasubdir)/eign
-
-# manroot is the root of the man page directory tree.
-manroot=$(prefix)/man
-
-# man1ext is the man section for user commands.
-man1ext=1
-man1dir=$(manroot)/man$(man1ext)
-
-# man5ext is the man section for file formats.
-man5ext=5
-man5dir=$(manroot)/man$(man5ext)
-
-# man7ext is the man section for macros.
-man7ext=7
-man7dir=$(manroot)/man$(man7ext)
-
-# DEFINES should include the following:
-# -DHAVE_MMAP if you have mmap() and <sys/mman.h>
-# -DCFRONT_ANSI_BUG if you're using cfront 2.0 (or later?) with
-# an ANSI C compiler
-# -DCOOKIE_BUG if you're using gcc/g++ 2.[012] (you should
-# upgrade to 2.3).
-# -DARRAY_DELETE_NEEDS_SIZE if your C++ doesn't understand `delete []'
-# -DHAVE_SYS_SIGLIST if you have sys_siglist[]
-# -DWCOREFLAG=0200 if the 0200 bit of the status returned by
-# wait() indicates whether a core image was
-# produced for a process that was terminated
-# by a signal
-# -DHAVE_UNISTD_H if you have <unistd.h>
-# -DHAVE_CC_UNISTD_H if you have a C++ <unistd.h>
-# -DHAVE_DIRENT_H if you have <dirent.h>
-# -DHAVE_LIMITS_H if you have <limits.h>
-# -DHAVE_CC_LIMITS_H if you have a C++ <limits.h>
-# -DHAVE_SYS_DIR_H if you have <sys/dir.h>
-# -DHAVE_STDLIB_H if you have <stdlib.h>
-# -DHAVE_VFORK_H if you have <vfork.h>
-# -Dvfork=fork if you don't have a working vfork()
-# -DHAVE_RENAME if you have rename()
-# -DHAVE_MKSTEMP if you have mkstemp()
-# -DSTDLIB_H_DECLARES_GETOPT if your C++ <stdlib.h> declares getopt()
-# -DUNISTD_H_DECLARES_GETOPT if your C++ <unistd.h> declares getopt()
-# -DSTDLIB_H_DECLARES_PUTENV if your C++ <stdlib.h> declares putenv()
-# -DTRADITIONAL_CPP if your C++ compiler uses a traditional
-# (Reiser) preprocessor.
-# -DLONG_FOR_TIME_T if localtime() takes a long * not a time_t *
-# -DHAVE_STRUCT_EXCEPTION if <math.h> defines struct exception
-# -DRETSIGTYPE=int if signal handlers return int not void
-DEFINES= -DHAVE_UNISTD_H=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_STDLIB_H=1 -DHAVE_CC_LIMITS_H=1 -DHAVE_CC_UNISTD_H=1 -DSTDLIB_H_DECLARES_GETOPT=1 -DUNISTD_H_DECLARES_GETOPT=1 -DSTDLIB_H_DECLARES_PUTENV=1 -DRETSIGTYPE=void -DHAVE_STRUCT_EXCEPTION=1 -DHAVE_MMAP=1 -DHAVE_RENAME=1 -DHAVE_MKSTEMP=1
-
-# Include fmod.o, strtol.o, getcwd.o, strerror.o, putenv.o in LIBOBJS if
-# your C library is missing the corresponding function.
-LIBOBJS=
-
-# CCC is the compiler for C++ (.cc) files.
-CCC=gcc
-CC=gcc
-# CCDEFINES are definitions for C++ compilations.
-CCDEFINES=$(DEFINES)
-# CDEFINES are definitions for C compilations.
-CDEFINES=$(DEFINES)
-
-DEBUG=
-OPTIMIZE=-O2
-CCFLAGS=$(DEBUG) $(OPTIMIZE)
-CFLAGS=$(DEBUG) $(OPTIMIZE)
-YACC=bison -y
-YACCFLAGS=-v
-
-LIBS=
-CCLIBS=
-RANLIB=@:
-INSTALL=/usr/ucb/install -c
-INSTALL_PROGRAM=$(INSTALL)
-INSTALL_DATA=$(INSTALL) -m 644
-LN_S=ln -s
-AR=ar
-ETAGS=etags
-ETAGSFLAGS=
-# Flag that tells etags to assume C++.
-ETAGSCCFLAG=-C
-# Full path to perl.
-PERLPATH=
-# Sed command with which to edit sh scripts.
-SH_SCRIPT_SED_CMD=
-srcdir = .
-VPATH = .
-
-PURIFY=purify
-GCCVERSION=2.3.3
-GCCPREFIX=/usr/local/lib/gcc-lib/sparc-sun-sunos4.1/$(GCCVERSION)/
-PURIFYCCFLAGS=-g++=yes -collector=$(GCCPREFIX)ld
-
-MDEFINES="PAGE=$(PAGE)" "BROKEN_SPOOLER_FLAGS=$(BROKEN_SPOOLER_FLAGS)" \
- "DEVICE=$(DEVICE)" "PSPRINT=$(PSPRINT)" "DVIPRINT=$(DVIPRINT)" \
- "prefix=$(prefix)" "exec_prefix=$(exec_prefix)" "bindir=$(bindir)" \
- "g=$(g)" "datadir=$(datadir)" "datasubdir=$(datasubdir)" \
- "fontdir=$(fontdir)" "fontpath=$(fontpath)" \
- "tmacdir=$(tmacdir)" "tmacpath=$(tmacpath)" \
- "indexext=$(indexext)" "indexdir=$(indexdir)" \
- "indexname=$(indexname)" "common_words_file=$(common_words_file)" \
- "manroot=$(manroot)" "man1ext=$(man1ext)" "man1dir=$(man1dir)" \
- "man5ext=$(man5ext)" "man5dir=$(man5dir)" \
- "man7ext=$(man7ext)" "man7dir=$(man7dir)" \
- "tmac_s=$(tmac_s)" "tmac_m=$(tmac_m)" \
- "CCC=$(CCC)" "CC=$(CC)" "CCDEFINES=$(CCDEFINES)" "CDEFINES=$(CDEFINES)" \
- "CCFLAGS=$(CCFLAGS)" "CFLAGS=$(CFLAGS)" \
- "YACC=$(YACC)" "YACCFLAGS=$(YACCFLAGS)" \
- "LIBS=$(LIBS)" "CCLIBS=$(CCLIBS)" "LIBOBJS=$(LIBOBJS)" \
- "RANLIB=$(RANLIB)" "AR=$(AR)" \
- "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" "INSTALL_DATA=$(INSTALL_DATA)" \
- "ETAGS=$(ETAGS)" "ETAGSFLAGS=$(ETAGSFLAGS)" "ETAGSCCFLAG=$(ETAGSCCFLAG)" \
- "PERLPATH=$(PERLPATH)" "SH_SCRIPT_SED_CMD=$(SH_SCRIPT_SED_CMD)" \
- "PURIFY=$(PURIFY)" "PURIFYCCFLAGS=$(PURIFYCCFLAGS)"
-
SHELL=/bin/sh
-INCDIRS=include
-LIBDIRS=libgroff libdriver libbib
-CCPROGDIRS=groff troff tbl pic eqn grops grotty grodvi tfmtodit \
- refer lookbib indxbib lkbib soelim addftinfo
-CPROGDIRS=pfbtops psbb
-PROGDIRS=$(CCPROGDIRS) $(CPROGDIRS)
-DEVDIRS=devps devdvi devascii devlatin1 devX75 devX75-12 devX100 devX100-12
-OTHERDIRS=man tmac afmtodit grog nroff mm
-ALLDIRS=$(INCDIRS) $(LIBDIRS) $(PROGDIRS) $(DEVDIRS) $(OTHERDIRS)
-EXTRADIRS=devps/generate devdvi/generate xditview doc
-DISTDIRS=$(ALLDIRS) $(EXTRADIRS)
-TARGETS=all install install_bin install_data clean distclean mostlyclean \
- realclean extraclean distfiles TAGS depend uninstall_sub
-
-do=all
-dodirs=$(ALLDIRS) dot
-# Default target for subdir_Makefile
-subdir=troff
-
-
-$(TARGETS):
- @$(MAKE) $(MDEFINES) do=$@ $(dodirs)
-
-dot: FORCE
- @$(MAKE) $(MDEFINES) srcdir=$(srcdir) VPATH=$(srcdir) \
- -f $(srcdir)/Makefile.comm -f $(srcdir)/Makefile.sub $(do)
-
-$(LIBDIRS): FORCE
- @if test $(srcdir) = .; \
- then srcdir=.; \
- else srcdir=`cd $(srcdir); pwd`/$@; \
- fi; \
- echo Making $(do) in $@; \
- test -d $@ || mkdir $@; \
- cd $@; \
- $(MAKE) $(MDEFINES) srcdir=$$srcdir VPATH=$$srcdir \
- -f $$srcdir/../Makefile.comm -f $$srcdir/Makefile.sub \
- -f $$srcdir/../Makefile.lib -f $$srcdir/Makefile.dep $(do)
-
-$(CPROGDIRS): FORCE
- @if test $(srcdir) = .; \
- then srcdir=.; \
- else srcdir=`cd $(srcdir); pwd`/$@; \
- fi; \
- echo Making $(do) in $@; \
- test -d $@ || mkdir $@; \
- cd $@; \
- $(MAKE) $(MDEFINES) srcdir=$$srcdir VPATH=$$srcdir \
- -f $$srcdir/../Makefile.comm -f $$srcdir/Makefile.sub \
- -f $$srcdir/../Makefile.cpg -f $$srcdir/Makefile.dep $(do)
-
-$(CCPROGDIRS): FORCE
- @if test $(srcdir) = .; \
- then srcdir=.; \
- else srcdir=`cd $(srcdir); pwd`/$@; \
- fi; \
- echo Making $(do) in $@; \
- test -d $@ || mkdir $@; \
- cd $@; \
- $(MAKE) $(MDEFINES) srcdir=$$srcdir VPATH=$$srcdir \
- -f $$srcdir/../Makefile.comm -f $$srcdir/Makefile.sub \
- -f $$srcdir/../Makefile.ccpg -f $$srcdir/Makefile.dep $(do)
-
-$(DEVDIRS): FORCE
- @if test $(srcdir) = .; \
- then srcdir=.; \
- else srcdir=`cd $(srcdir); pwd`/$@; \
- fi; \
- echo Making $(do) in $@; \
- test -d $@ || mkdir $@; \
- cd $@; \
- $(MAKE) $(MDEFINES) srcdir=$$srcdir VPATH=$$srcdir \
- -f $$srcdir/../Makefile.comm -f $$srcdir/Makefile.sub \
- -f $$srcdir/../Makefile.dev $(do)
-
-$(INCDIRS) $(OTHERDIRS): FORCE
- @if test $(srcdir) = .; \
- then srcdir=.; \
- else srcdir=`cd $(srcdir); pwd`/$@; \
- fi; \
- echo Making $(do) in $@; \
- test -d $@ || mkdir $@; \
- cd $@; \
- $(MAKE) $(MDEFINES) srcdir=$$srcdir VPATH=$$srcdir \
- -f $$srcdir/../Makefile.comm -f $$srcdir/Makefile.sub \
- -f $$srcdir/../Makefile.man $(do)
-
-version=`cat $(srcdir)/VERSION`
-
-.PHONY: dist
-dist:
- -rm -fr tmp
- mkdir tmp
- for d in $(DISTDIRS); do \
- mkdir tmp/$$d; \
- done
- srcdir=`cd $(srcdir); pwd`; \
- cd tmp; \
- $(LN_S) ../Makefile .; \
- $(LN_S) $$srcdir/* . 2>/dev/null || true; \
- for d in $(DISTDIRS); do \
- (cd $$d; $(LN_S) $$srcdir/$$d/* . 2>/dev/null || true); \
- done; \
- $(MAKE) srcdir=$$srcdir VPATH=$$srcdir extraclean; \
- for d in $(EXTRADIRS); do \
- (cd $$d; $(MAKE) extraclean); \
- done; \
- rm -f Makefile; \
- $(LN_S) $$srcdir/Makefile.init Makefile
- mv tmp groff-$(version)
- tar cfh - groff-$(version) | gzip -c >groff-$(version).tar.z
- rm -fr groff-$(version)
-
-# $(PROGDIRS): libgroff
-# grops grotty grodvi: libdriver
-# refer lookbib indxbib lkbib: libbib
-# $(LIBDIRS) $(PROGDIRS): include
-
-.PHONY: $(ALLDIRS) dot $(TARGETS) FORCE
-
-subdir_Makefile: Makefile.cfg
- $(MAKE) do=Makefile $(subdir)
-
-Makefile.cfg: Makefile
- >Makefile.cfg
- for var in $(MDEFINES); do \
- echo "$$var" >>Makefile.cfg; \
- done
-
-depend: srcdir_must_be_dot
-
-.PHONY: srcdir_must_be_dot
-srcdir_must_be_dot:
- @test "X$(srcdir)" = "X." \
- || (echo This target can only be made in the source directory; \
- exit 1)
-
-Makefile: Makefile.in
- $(SHELL) config.status
-
-.PHONY: uninstall
-uninstall: uninstall_sub uninstall_dirs
-
-.PHONY: uninstall_dirs
-uninstall_dirs:
-# Use rmdir here so that the directories are only removed if they're empty
- -rmdir $(man1dir) $(man5dir) $(man7dir) $(manroot) \
- $(tmacdir) $(fontdir) $(bindir) $(datasubdir) $(datadir)
-
-
-.PHONY: check
-check:
-
-FORCE:
-.NOEXPORT:
+.PHONY: all
+all:
+ $(SHELL) configure
+ $(MAKE) all
diff --git a/Makefile.comm b/Makefile.comm
index cacc894f5..63c80ab5f 100644
--- a/Makefile.comm
+++ b/Makefile.comm
@@ -94,7 +94,15 @@ extraclean:
$(YACC) $(YACCFLAGS) $<; \
fi
mv y.tab.c $@
- test -z "$(YTABH)" || mv y.tab.h $(YTABH)
+# Avoid ending up with two versions of $(YTABH).
+ if test -n "$(YTABH)"; then \
+ if test -f $(srcdir)/$(YTABH); then \
+ rm -f $(YTABH); \
+ mv y.tab.h $(srcdir)/$(YTABH); \
+ else \
+ mv y.tab.h $(YTABH); \
+ fi; \
+ fi
.man.n:
@echo Making $@ from $<
diff --git a/Makefile.in b/Makefile.in
index d5ccb9abb..59dc52482 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -69,7 +69,7 @@ g=g
# groff -ms -M/usr/lib/tmac.
tmac_s=$(g)s
-# Similarily, the groff mm macros will be available as -m$(tmac_m).
+# Similarly, the groff mm macros will be available as -m$(tmac_m).
tmac_m=$(g)m
# Common prefix for installation directories.
@@ -99,7 +99,7 @@ tmacdir=$(datasubdir)/tmac
tmacpath=.:$(tmacdir):/usr/lib/tmac
# Extension to be used for refer index files. Index files are not
-# shareable between different architectures, so you might want to use
+# sharable between different architectures, so you might want to use
# different suffixes for different architectures. Choose an extension
# that doesn't conflict with refer or any other indexing program.
indexext=.i
@@ -143,7 +143,7 @@ man7dir=$(manroot)/man$(man7ext)
# produced for a process that was terminated
# by a signal
# -DHAVE_UNISTD_H if you have <unistd.h>
-# -DHAVE_CC_UNISTD_H if you have a C++ <unistd.h>
+# -DHAVE_CC_OSFCN_H if you have a C++ <osfcn.h>
# -DHAVE_DIRENT_H if you have <dirent.h>
# -DHAVE_LIMITS_H if you have <limits.h>
# -DHAVE_CC_LIMITS_H if you have a C++ <limits.h>
@@ -156,6 +156,7 @@ man7dir=$(manroot)/man$(man7ext)
# -DSTDLIB_H_DECLARES_GETOPT if your C++ <stdlib.h> declares getopt()
# -DUNISTD_H_DECLARES_GETOPT if your C++ <unistd.h> declares getopt()
# -DSTDLIB_H_DECLARES_PUTENV if your C++ <stdlib.h> declares putenv()
+# -DSTDIO_H_DECLARES_POPEN if your C++ <stdio.h> declares popen()
# -DTRADITIONAL_CPP if your C++ compiler uses a traditional
# (Reiser) preprocessor.
# -DLONG_FOR_TIME_T if localtime() takes a long * not a time_t *
@@ -202,11 +203,15 @@ srcdir = @srcdir@
VPATH = @srcdir@
PURIFY=purify
-GCCVERSION=2.3.3
-GCCPREFIX=/usr/local/lib/gcc-lib/sparc-sun-sunos4.1/$(GCCVERSION)/
-PURIFYCCFLAGS=-g++=yes -collector=$(GCCPREFIX)ld
-
-MDEFINES="PAGE=$(PAGE)" "BROKEN_SPOOLER_FLAGS=$(BROKEN_SPOOLER_FLAGS)" \
+PURIFYCCFLAGS=
+#PURIFYCCFLAGS=-g++=yes \
+# -collector=`dirname \`$(CCC) -print-libgcc-file-name\``/ld
+
+# Passing down MAKEOVERRIDES prevents $(MAKE) from containing a second
+# copy of $(MDEFINES) when making individual directories; this could
+# cause the argument list to become too long on some systems.
+MDEFINES="MAKEOVERRIDES=$(MAKEOVERRIDES)" \
+ "PAGE=$(PAGE)" "BROKEN_SPOOLER_FLAGS=$(BROKEN_SPOOLER_FLAGS)" \
"DEVICE=$(DEVICE)" "PSPRINT=$(PSPRINT)" "DVIPRINT=$(DVIPRINT)" \
"prefix=$(prefix)" "exec_prefix=$(exec_prefix)" "bindir=$(bindir)" \
"g=$(g)" "datadir=$(datadir)" "datasubdir=$(datasubdir)" \
@@ -261,7 +266,6 @@ $(LIBDIRS): FORCE
then srcdir=.; \
else srcdir=`cd $(srcdir); pwd`/$@; \
fi; \
- echo Making $(do) in $@; \
test -d $@ || mkdir $@; \
cd $@; \
$(MAKE) $(MDEFINES) srcdir=$$srcdir VPATH=$$srcdir \
@@ -273,7 +277,6 @@ $(CPROGDIRS): FORCE
then srcdir=.; \
else srcdir=`cd $(srcdir); pwd`/$@; \
fi; \
- echo Making $(do) in $@; \
test -d $@ || mkdir $@; \
cd $@; \
$(MAKE) $(MDEFINES) srcdir=$$srcdir VPATH=$$srcdir \
@@ -285,7 +288,6 @@ $(CCPROGDIRS): FORCE
then srcdir=.; \
else srcdir=`cd $(srcdir); pwd`/$@; \
fi; \
- echo Making $(do) in $@; \
test -d $@ || mkdir $@; \
cd $@; \
$(MAKE) $(MDEFINES) srcdir=$$srcdir VPATH=$$srcdir \
@@ -297,7 +299,6 @@ $(DEVDIRS): FORCE
then srcdir=.; \
else srcdir=`cd $(srcdir); pwd`/$@; \
fi; \
- echo Making $(do) in $@; \
test -d $@ || mkdir $@; \
cd $@; \
$(MAKE) $(MDEFINES) srcdir=$$srcdir VPATH=$$srcdir \
@@ -309,7 +310,6 @@ $(INCDIRS) $(OTHERDIRS): FORCE
then srcdir=.; \
else srcdir=`cd $(srcdir); pwd`/$@; \
fi; \
- echo Making $(do) in $@; \
test -d $@ || mkdir $@; \
cd $@; \
$(MAKE) $(MDEFINES) srcdir=$$srcdir VPATH=$$srcdir \
@@ -339,7 +339,7 @@ dist:
rm -f Makefile; \
$(LN_S) $$srcdir/Makefile.init Makefile
mv tmp groff-$(version)
- tar cfh - groff-$(version) | gzip -c >groff-$(version).tar.z
+ tar cfh - groff-$(version) | gzip -c >groff-$(version).tar.gz
rm -fr groff-$(version)
# $(PROGDIRS): libgroff
diff --git a/NEWS b/NEWS
index bbe0c0b51..f92f47580 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,27 @@
This file describes recent user-visible changes in groff. Bug fixes
are not described. There are more details in the man pages.
+VERSION 1.09
+============
+
+\(rn will now produce a character that has the traditional metrics,
+and will form corners with \(ul and \(br. This means that it will not
+align properly with \(sr. Instead there's a new character
+\[radicalex] which aligns with \(sr; this is used by eqn for doing
+square roots.
+
+Troff
+-----
+
+The `pso' request allows you to read from the standard output of a
+command.
+
+Grops
+-----
+
+The PSPIC macro has options to allow the horizontal alignment of the
+graphic to be specified.
+
VERSION 1.08
============
@@ -84,7 +105,7 @@ default device is ps.)
The postprocessor to be used for a particular device is now specified
by a `postpro' command in the DESC file rather than being compiled
-into groff. Similarily the command to be used for printing (with the
+into groff. Similarly the command to be used for printing (with the
-l option) is now specified by a `print' command in the DESC file.
The groff command no longer specifies eqnchar as an input file for
@@ -201,7 +222,7 @@ be derived from the $r or $R register.
The groff -me macros work with -C and (I think) with Unix troff.
For backward compatibility with BSD -me, the \*{ and \*} strings are
-also available as \*[ and \*]. Of course, \*[ will only be useable
+also available as \*[ and \*]. Of course, \*[ will only be usable
with -C.
The \*T string has been deleted. Use \*(Tm instead.
@@ -587,7 +608,7 @@ There is a `\C'xxx'' escape sequence equivalent to `\[xxx]'.
Characters ", ', ), ], *, \(dg are now initially transparent for the purposes
of end of sentence recognition.
-There is an anti-recusion feature in the `char' request, so you can
+There is an anti-recursion feature in the `char' request, so you can
say `.char \(bu \s+2\(bu\s-2'.
The limit on the number of font positions has been removed.
diff --git a/PROBLEMS b/PROBLEMS
index 16e168c86..feb2f88be 100644
--- a/PROBLEMS
+++ b/PROBLEMS
@@ -2,35 +2,6 @@ This file describes various problems that have been encountered in
compiling, installing and running groff. Suggestions for additions or
other improvements to this file are welcome.
-* gcc 2.3.3 fails to compile pic/object.cc.
-
-Apply the following patch:
-
-Thu Apr 1 12:06:03 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * cp-init.c (expand_default_init): Don't clear DECL_REGISTER.
-
-*** cp-init.c.~2~ Mon Mar 29 21:48:36 1993
---- cp-init.c Thu Apr 1 12:00:33 1993
-*************** expand_default_init (binfo, true_exp, ex
-*** 1141,1149 ****
- }
-
-- /* ARM $7.1.1: "[register] may be ignored and in most implementations
-- it will be ignored if the address of the variable is taken."
-- Since we're likely to do just that in the ctor call, clear this. */
-- DECL_REGISTER (exp) = 0;
--
- rval = build_method_call (exp, constructor_name (type),
- parms, binfo, flags|xxref_init_possible);
---- 1141,1144 ----
-
-
-* On a DECstation or other machine using a MIPS cpu, gcc/g++ 2.2.2
-gets a fatal signal while compiling tbl/main.c and tbl/table.c.
-
-Upgrade to gcc 2.3 or compile those files without -O.
-
* I get lots of `numeric overflow' error messages whenever I run
groff; I compiled groff with AT&T C++ 2.0 with an ANSI C compiler.
@@ -456,3 +427,118 @@ and recompile groff:
exprstmt = build_x_delete (ptr_type_node, current_class_decl, 0);
else
exprstmt = 0;
+
+* Where can I get grap?
+
+Grap is not freely available, but there is a nawk script implementing
+an extended subset of grap available for ftp as
+ftp.informatik.uni-rostock.de:/pub/local/software/prag-1.0.shar.gz.
+
+* How can I use groff with a Laserjet printer?
+
+You have at least 3 options:
+
+- use groff -Tps with GNU Ghostscript;
+
+- use groff -Tdvi with a TeX .dvi to Laserjet driver;
+
+- use groff with the Laserjet driver in Chris Lewis' psroff package
+(available for ftp from:
+ftp.uunet.ca:/distrib/chris_lewis/psroff3.0pl17).
+
+* Groff seems to generate level 3 Postscript, but my printer is only a
+level 1 or 2 PostScript printer.
+
+In fact groff generates only level 1 PostScript. The `%!PS-Adobe-3.0'
+comment at the beginning of PostScript output generated by groff
+indicates that the file conforms to version 3.0 of the Adobe Document
+Structuring Conventions. The output generated by groff should be
+printable on any PostScript printer. Problems with groff output's not
+printing are most often caused by the spooling system.
+
+* The \n(st and \n(sb registers don't seem to work. I thought \w set
+them to the height and depth of its argument, but the registers always
+seem to be 0.
+
+\n(st and \n(sb aren't supposed to give the height and depth of the
+string rather they give the minimum and maximum vertical displacement
+of the baseline. For example for \v'2u'\v'-3u', \n(st will be 1 and
+\n(sb will be -2. The height and depth of the string is available in
+the \n[rst] and \n[rsb] registers: these are groff extensions.
+
+* On an SGI system, how can I make the man command use groff?
+
+From David Hinds <dhinds@allegro.stanford.edu> (some of these steps
+are unnecessary if you install with the `g' Makefile variable defined
+as empty):
+
+Create a script called 'eqn':
+
+ > #!/bin/sh
+ > if [ ${1:-""} = /usr/pub/eqnchar ] ; then shift ; fi
+ > geqn $*
+
+and a script called 'neqn':
+
+ > #!/bin/sh
+ > if [ ${1:-""} = /usr/pub/eqnchar ] ; then shift ; fi
+ > geqn -Tascii $*
+
+and do:
+
+ > ln -s gnroff nroff
+
+and edit the end of the gnroff script to be:
+
+ > rest=`echo ${1+"$@"} | sed -e 's+/usr/lib/tmac+/usr/local/lib/groff/tmac+'`
+ > exec groff -Wall -mtty-char $T $opts $rest
+
+To get PostScript output from 'man -t', you also need to create a
+'psroff' script similar to 'nroff'. Here are the context diffs:
+
+*** /usr/local/bin/nroff Sat Feb 13 15:51:09 1993
+--- /usr/local/bin/psroff Sat Feb 13 17:45:46 1993
+***************
+*** 1,8 ****
+ #!/bin/sh
+! # Emulate nroff with groff.
+
+ prog="$0"
+! T=-Tascii
+ opts=
+
+ for i
+--- 1,8 ----
+ #!/bin/sh
+! # Emulate psroff with groff.
+
+ prog="$0"
+! T=-Tps
+ opts=
+
+ for i
+***************
+*** 25,30 ****
+--- 25,33 ----
+ -Tascii|-Tlatin1)
+ T=$1
+ ;;
++ -t)
++ # ignore -- default is send to stdout
++ ;;
+ -T*)
+ # ignore other devices
+ ;;
+***************
+*** 49,53 ****
+ rest=`echo ${1+"$@"} | sed -e 's+/usr/lib/tmac+/usr/local/lib/groff/tmac+'`
+
+ # This shell script is intended for use with man, so warnings are
+ # probably not wanted. Also load nroff-style character definitions.
+! exec groff -Wall -mtty-char $T $opts $rest
+--- 52,56 ----
+ rest=`echo ${1+"$@"} | sed -e 's+/usr/lib/tmac+/usr/local/lib/groff/tmac+'`
+
+ # This shell script is intended for use with man, so warnings are
+! # probably not wanted.
+! exec groff -Wall $T $opts $rest
diff --git a/PROJECTS b/PROJECTS
index 2b6e6684a..6ba76e2f3 100644
--- a/PROJECTS
+++ b/PROJECTS
@@ -11,7 +11,7 @@ Here are some things that would be useful additions to groff:
a page-makeup postprocessor and associated macro package
(like pm and -mpm)
- a complete, self-contained manual
+ a complete, self-contained manual (trent@cs.pdx.edu is working on this)
If you want to work on one of these, I suggest you contact me first.
diff --git a/TODO b/TODO
index 0adedbc98..7a7d37957 100644
--- a/TODO
+++ b/TODO
@@ -22,3 +22,5 @@ Catch the following error in -me:
.(z
.(l C
.)z
+
+Arrows for next/previous page from R5 xditview.
diff --git a/VERSION b/VERSION
index 986607cab..799001daa 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.08
+1.09
diff --git a/acgroff.m4 b/acgroff.m4
index 057b5a3a2..f1a7cd1d5 100644
--- a/acgroff.m4
+++ b/acgroff.m4
@@ -48,8 +48,7 @@ GROFF_EXIT
fi
echo checking that C++ compiler can compile very simple C++ program
GROFF_CC_TEST_PROGRAM([
-extern "C" { void exit(int); }
-int main() { exit(0); }
+int main() { return 0; }
],,
cat <<EOM
$CCC was unable successfully to compile a very simple C++ program
@@ -60,7 +59,6 @@ GROFF_EXIT
echo checking that C++ static constructors and destructors are called
GROFF_CC_TEST_PROGRAM([
extern "C" {
- void exit(int);
void _exit(int);
}
int i;
@@ -70,7 +68,7 @@ struct A {
~A() { if (i == 1) _exit(0); }
};
A a;
-main() { exit(1); }
+int main() { return 1; }
],,
cat <<EOM
$CCC is not installed correctly: static constructors and destructors do not work
@@ -83,15 +81,15 @@ GROFF_CC_COMPILE_CHECK([C++ header files],[#include <stdio.h>],
Your header files do not appear to support C++.
I was unable to compile and link a simple C++ program that used a function
declared in <stdio.h>.
-If you're using gcc/g++, you should install libg++.
+If you're using a version of gcc/g++ earlier than 2.5,
+you should install libg++.
EOF
GROFF_EXIT])])dnl
define(GROFF_CC_COMPILE_CHECK,
[AC_PROVIDE([$0])AC_REQUIRE([GROFF_PROG_CCC])echo checking for $1
cat <<EOF >conftest.cc
[$2]
-extern "C" { void exit(int); }
-int main() { exit(0); } void t() { [$3] }
+int main() { return 0; } void t() { [$3] }
EOF
dnl Don't try to run the program, which would prevent cross-configuring.
if eval $cc_compile; then
@@ -223,7 +221,7 @@ int main()
int *p = new int;
delete p;
testit = 0;
- exit(1);
+ return 1;
}
static unsigned dummy[3];
@@ -264,7 +262,7 @@ GROFF_CC_TEST_PROGRAM([#include <stdlib.h>
int main()
{
int z = 0;
- exit(INT_MIN < z);
+ return INT_MIN < z;
}
],AC_DEFINE(CFRONT_ANSI_BUG),,)])dnl
dnl
@@ -314,19 +312,30 @@ fi
AC_SUBST(DVIPRINT)])dnl
define(GROFF_GETOPT,
[GROFF_CC_COMPILE_CHECK([declaration of getopt in stdlib.h],
-[#include <stdlib.h>],
-[int opt = getopt(0, 0, 0); optarg = "foo"; optind = 1;],
+[#include <stdlib.h>
+extern "C" { void getopt(int); }],,,
AC_DEFINE(STDLIB_H_DECLARES_GETOPT))
GROFF_CC_COMPILE_CHECK([declaration of getopt in unistd.h],
[#include <sys/types.h>
-#include <unistd.h>],
-[int opt = getopt(0, 0, 0);],
+#include <unistd.h>
+extern "C" { void getopt(int); }],,,
AC_DEFINE(UNISTD_H_DECLARES_GETOPT))
])dnl
define(GROFF_PUTENV,
-[GROFF_CC_COMPILE_CHECK([declaration of putenv],[#include <stdlib.h>],
-[putenv((char *)0);],
+[GROFF_CC_COMPILE_CHECK([declaration of putenv],
+[#include <stdlib.h>
+extern "C" { void putenv(int); }],,,
AC_DEFINE(STDLIB_H_DECLARES_PUTENV))])dnl
+define(GROFF_POPEN,
+[GROFF_CC_COMPILE_CHECK([declaration of popen],
+[#include <stdio.h>
+extern "C" { void popen(int); }],,,
+AC_DEFINE(STDIO_H_DECLARES_POPEN))])dnl
+define(GROFF_PCLOSE,
+[GROFF_CC_COMPILE_CHECK([declaration of pclose],
+[#include <stdio.h>
+extern "C" { void pclose(int); }],,,
+AC_DEFINE(STDIO_H_DECLARES_PCLOSE))])dnl
define(GROFF_ETAGSCCFLAG,
[echo checking for etags C++ option
for flag in p C
@@ -351,11 +360,11 @@ define(GROFF_TIME_T,
[GROFF_CC_COMPILE_CHECK([time_t],[#include <time.h>],
[time_t t = time(0); struct tm *p = localtime(&t);],,
AC_DEFINE(LONG_FOR_TIME_T))])dnl
-define(GROFF_UNISTD_H,
-[GROFF_CC_COMPILE_CHECK(['C++ <unistd.h>'],[#include <unistd.h>],
+define(GROFF_OSFCN_H,
+[GROFF_CC_COMPILE_CHECK(['C++ <osfcn.h>'],[#include <osfcn.h>],
+[read(0, 0, 0); open(0, 0);],AC_DEFINE(HAVE_CC_OSFCN_H))])dnl
dnl Bison generated parsers have problems with C++ compilers other than g++.
dnl So byacc is preferred over bison.
-[read(0, 0, 0);],AC_DEFINE(HAVE_CC_UNISTD_H))])dnl
define(GROFF_PROG_YACC,
[AC_PROGRAM_CHECK(YACC, byacc, byacc, )
AC_PROGRAM_CHECK(YACC, bison, bison -y, yacc)
@@ -378,3 +387,17 @@ else
fi
rm -f conftest.sh
])dnl
+define(GROFF_POSIX,
+[GROFF_CC_COMPILE_CHECK(whether -D_POSIX_SOURCE is necessary,
+[#include <stdio.h>],
+[(void)fileno(stdin);],,
+AC_DEFINE(_POSIX_SOURCE))])dnl
+dnl From udodo!hans@relay.NL.net (Hans Zuidam)
+define(GROFF_ISC_SYSV3,
+[echo 'checking for ISC 3.x or 4.x'
+changequote(,)dnl
+if grep '[34]\.' /usr/options/cb.name >/dev/null 2>&1
+changequote([,])dnl
+then
+ AC_DEFINE(_SYSV3)
+fi])dnl
diff --git a/addftinfo/addftinfo.cc b/addftinfo/addftinfo.cc
index e6d96695c..253a08acf 100644
--- a/addftinfo/addftinfo.cc
+++ b/addftinfo/addftinfo.cc
@@ -34,20 +34,20 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
static void usage();
static void convert_font(const font_params &, FILE *, FILE *);
-typedef font_params::*param_t;
+typedef int font_params::*param_t;
static struct {
const char *name;
param_t par;
} param_table[] = {
- "x-height", &font_params::x_height,
- "fig-height", &font_params::fig_height,
- "asc-height", &font_params::asc_height,
- "body-height", &font_params::body_height,
- "cap-height", &font_params::cap_height,
- "comma-depth", &font_params::comma_depth,
- "desc-depth", &font_params::desc_depth,
- "body-depth", &font_params::body_depth,
+ { "x-height", &font_params::x_height },
+ { "fig-height", &font_params::fig_height },
+ { "asc-height", &font_params::asc_height },
+ { "body-height", &font_params::body_height },
+ { "cap-height", &font_params::cap_height },
+ { "comma-depth", &font_params::comma_depth },
+ { "desc-depth", &font_params::desc_depth },
+ { "body-depth", &font_params::body_depth },
};
// These are all in thousandths of an em.
@@ -113,7 +113,7 @@ int main(int argc, char **argv)
if (infp == 0)
fatal("can't open `%1': %2", font, strerror(errno));
convert_font(param, infp, stdout);
- exit(0);
+ return 0;
}
static void usage()
diff --git a/afmtodit/afmtodit.man b/afmtodit/afmtodit.man
index 760cc8b82..3730b7a23 100644
--- a/afmtodit/afmtodit.man
+++ b/afmtodit/afmtodit.man
@@ -183,7 +183,7 @@ for italic fonts.
.SH FILES
.Tp \w'\fB@FONTDIR@/devps/download'u+2n
.B @FONTDIR@/devps/DESC
-Device desciption file.
+Device description file.
.TP
.BI @FONTDIR@/devps/ F
Font description file for font
diff --git a/afmtodit/afmtodit.pl b/afmtodit/afmtodit.pl
index 1d1a24969..60bee93f0 100644
--- a/afmtodit/afmtodit.pl
+++ b/afmtodit/afmtodit.pl
@@ -163,8 +163,8 @@ while (<MAP>) {
warn "Both $mapped{$field[1]} and $field[0] map to $field[1]";
}
elsif ($field[1] eq "space") {
- # the PostScript character `space' is automatically mapped
- # to the groff character `space'; this is for grops
+ # the PostScript character "space" is automatically mapped
+ # to the groff character "space"; this is for grops
warn "you are not allowed to map to the groff character `space'";
}
elsif ($field[0] eq "space") {
diff --git a/bug.PS b/bug.PS
deleted file mode 100644
index 98fc39210..000000000
--- a/bug.PS
+++ /dev/null
@@ -1,66 +0,0 @@
-%!PS-Adobe-2.0
-%%DocumentFonts: Times-Roman Times-Italic Times-Bold Symbol
-%%Pages: (atend)
-%%EndComments
-% $Header: /home/jjc/catps/RCS/catps.pro,v 1.1 89/01/08 11:00:18 jjc Exp $
-
-/catps 13 dict def
-
-catps begin
-
-/F0 /Times-Roman findfont def
-/F1 /Times-Italic findfont def
-/F2 /Times-Bold findfont def
-/F3 /Symbol findfont def
-/F { scalefont setfont } bind def
-/S /show load def
-/M /moveto load def
-/BP { /level0 save def 1 6 div dup scale } bind def
-/EP { level0 restore showpage } bind def
-/T /end load def
-
-/fractiondict 5 dict def
-% num den FS -- print a fraction
-% it alters currentpoint but leaves currentfont unchanged
-
-/FS {
- fractiondict begin
- /den exch def
- /num exch def
- /regularfont currentfont def
- /fractionfont currentfont [.65 0 0 .6 0 0] makefont def
- gsave
- newpath 0 0 moveto (1) true charpath flattenpath pathbbox
- /height exch def pop pop pop
- grestore
- 0 .4 height mul rmoveto
- fractionfont setfont num show
- 0 .4 height mul neg rmoveto
- regularfont setfont (\244) show
- fractionfont setfont den show
- regularfont setfont
- end
-} def
-
-end
-
-
-%%EndProlog
-%%BeginSetup
-catps begin
-%%EndSetup
-
-%%Page: ? 1
-BP
-F0 60 F
-216 4382 M(a)S
-336 4289 M(b)S
-456 4196 M(c)S
-576 4103 M(d)S
-576 4010 M(e)S
-576 3917 M(f)S
-216 3821 M(g)S
-EP
-%%Trailer
-T
-
diff --git a/config.status b/config.status
deleted file mode 100755
index 7d58b2dd0..000000000
--- a/config.status
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/bin/sh
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host flipper:
-#
-# ./configure
-
-for arg
-do
- case "$arg" in
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- exec /bin/sh ./configure ;;
- *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
- esac
-done
-
-trap 'rm -f Makefile; exit 1' 1 3 15
-CC='gcc'
-CCLIBS=''
-CCC='gcc'
-LPR='lpr'
-LP='lp'
-LPQ='lpq'
-PSPRINT='lpr'
-DVIPRINT='lpr -d'
-PERLPATH=''
-YACC='bison -y'
-RANLIB='@:'
-INSTALL='/usr/ucb/install -c'
-INSTALL_PROGRAM='$(INSTALL)'
-INSTALL_DATA='$(INSTALL) -m 644'
-LN_S='ln -s'
-ETAGSCCFLAG='-C'
-SH_SCRIPT_SED_CMD=''
-CPP='${CC-cc} -E'
-LIBOBJS=''
-BROKEN_SPOOLER_FLAGS='7'
-PAGE='letter'
-LIBS=''
-srcdir='.'
-DEFS=' -DHAVE_UNISTD_H=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_STDLIB_H=1 -DHAVE_CC_LIMITS_H=1 -DHAVE_CC_UNISTD_H=1 -DSTDLIB_H_DECLARES_GETOPT=1 -DUNISTD_H_DECLARES_GETOPT=1 -DSTDLIB_H_DECLARES_PUTENV=1 -DRETSIGTYPE=void -DHAVE_STRUCT_EXCEPTION=1 -DHAVE_MMAP=1 -DHAVE_RENAME=1 -DHAVE_MKSTEMP=1'
-prefix='/opt/gnu'
-exec_prefix='${prefix}'
-prsub='s%^prefix\([ ]*\)=\([ ]*\).*$%prefix\1=\2/opt/gnu%
-s%^exec_prefix\([ ]*\)=\([ ]*\).*$%exec_prefix\1=\2${prefix}%'
-
-top_srcdir=$srcdir
-for file in .. Makefile; do if [ "x$file" != "x.." ]; then
- srcdir=$top_srcdir
- # Remove last slash and all that follows it. Not all systems have dirname.
- dir=`echo $file|sed 's%/[^/][^/]*$%%'`
- if test "$dir" != "$file"; then
- test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
- test ! -d $dir && mkdir $dir
- fi
- echo creating $file
- rm -f $file
- echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
- sed -e "
-$prsub
-s%@CC@%$CC%g
-s%@CCLIBS@%$CCLIBS%g
-s%@CCC@%$CCC%g
-s%@LPR@%$LPR%g
-s%@LP@%$LP%g
-s%@LPQ@%$LPQ%g
-s%@PSPRINT@%$PSPRINT%g
-s%@DVIPRINT@%$DVIPRINT%g
-s%@PERLPATH@%$PERLPATH%g
-s%@YACC@%$YACC%g
-s%@RANLIB@%$RANLIB%g
-s%@INSTALL@%$INSTALL%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@LN_S@%$LN_S%g
-s%@ETAGSCCFLAG@%$ETAGSCCFLAG%g
-s%@SH_SCRIPT_SED_CMD@%$SH_SCRIPT_SED_CMD%g
-s%@CPP@%$CPP%g
-s%@LIBOBJS@%$LIBOBJS%g
-s%@BROKEN_SPOOLER_FLAGS@%$BROKEN_SPOOLER_FLAGS%g
-s%@PAGE@%$PAGE%g
-s%@LIBS@%$LIBS%g
-s%@srcdir@%$srcdir%g
-s%@DEFS@%$DEFS%
-" $top_srcdir/${file}.in >> $file
-fi; done
-
diff --git a/configure b/configure
index 1eabd89ab..16f1bf18d 100755
--- a/configure
+++ b/configure
@@ -17,11 +17,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-# Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
-# [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
-# Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
-# --with-PACKAGE unless this script has special code to handle it.
-
+# Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp]
+# [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]]
+# Ignores all args except --srcdir, --prefix, --exec-prefix, and
+# --with-PACKAGE[=VALUE] unless this script has special code to handle it.
for arg
do
@@ -35,7 +34,7 @@ do
elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
else
case $arg in
- # For backward compatibility, also recognize exact --exec_prefix.
+ # For backward compatibility, recognize -exec-prefix and --exec_prefix.
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
@@ -49,9 +48,6 @@ do
-nfp | --nfp | --nf) ;;
- -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
- no_create=1 ;;
-
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
@@ -63,22 +59,39 @@ do
next_srcdir=yes ;;
-with-* | --with-*)
- package=`echo $arg|sed 's/-*with-//'`
- # Delete all the valid chars; see if any are left.
- if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
+ package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that aren't valid shell variable names.
+ if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
echo "configure: $package: invalid package name" >&2; exit 1
fi
- eval "with_`echo $package|sed s/-/_/g`=1" ;;
+ package=`echo $package| sed 's/-/_/g'`
+ case "$arg" in
+ *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
+ *) val=1 ;;
+ esac
+ eval "with_$package='$val'" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
+ verbose=yes ;;
*) ;;
esac
fi
done
-trap 'rm -f conftest* core; exit 1' 1 3 15
+trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
+trap 'rm -f confdefs*' 0
-rm -f conftest*
-compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
+# NLS nuisances.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
+if test "${LANG+set}" = 'set' ; then LANG=C; export LANG; fi
+
+rm -f conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'
# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
@@ -111,10 +124,14 @@ case $srcdir in
*) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
esac
+
+# Save the original args to write them into config.status later.
+configure_args="$*"
+
if test -z "$prefix"
then
echo checking for grops to derive installation directory prefix
- saveifs="$IFS"; IFS="$IFS:"
+ IFS="${IFS= }"; saveifs="$IFS"; IFS="$IFS:"
for dir in $PATH; do
test -z "$dir" && dir=.
if test $dir != . && test -f $dir/grops; then
@@ -124,11 +141,12 @@ then
fi
done
IFS="$saveifs"
+ echo " chose installation directory prefix ${prefix}"
fi
if test -z "$prefix"
then
echo checking for gcc to derive installation directory prefix
- saveifs="$IFS"; IFS="$IFS:"
+ IFS="${IFS= }"; saveifs="$IFS"; IFS="$IFS:"
for dir in $PATH; do
test -z "$dir" && dir=.
if test $dir != . && test -f $dir/gcc; then
@@ -138,14 +156,17 @@ then
fi
done
IFS="$saveifs"
+ echo " chose installation directory prefix ${prefix}"
fi
if test -z "$CC"; then
- echo checking for gcc
- saveifs="$IFS"; IFS="${IFS}:"
+ # Extract the first word of `gcc', so it can be a program name with args.
+ set dummy gcc; word=$2
+ echo checking for $word
+ IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
- if test -f $dir/gcc; then
+ if test -f $dir/$word; then
CC="gcc"
break
fi
@@ -153,6 +174,7 @@ if test -z "$CC"; then
IFS="$saveifs"
fi
test -z "$CC" && CC="cc"
+test -n "$CC" && test -n "$verbose" && echo " setting CC to $CC"
# Find out if we are using GNU C, under whatever name.
cat > conftest.c <<EOF
@@ -182,46 +204,55 @@ if egrep yes conftest.out >/dev/null 2>&1; then
fi
fi
if test -z "$CCC"; then
- echo checking for g++
- saveifs="$IFS"; IFS="${IFS}:"
+ # Extract the first word of `g++', so it can be a program name with args.
+ set dummy g++; word=$2
+ echo checking for $word
+ IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
- if test -f $dir/g++; then
+ if test -f $dir/$word; then
CCC="g++"
break
fi
done
IFS="$saveifs"
fi
-test -z "$CCC" && CCC=""
+
+test -n "$CCC" && test -n "$verbose" && echo " setting CCC to $CCC"
if test -z "$CCC"; then
- echo checking for CC
- saveifs="$IFS"; IFS="${IFS}:"
+ # Extract the first word of `CC', so it can be a program name with args.
+ set dummy CC; word=$2
+ echo checking for $word
+ IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
- if test -f $dir/CC; then
+ if test -f $dir/$word; then
CCC="CC"
break
fi
done
IFS="$saveifs"
fi
-test -z "$CCC" && CCC=""
+
+test -n "$CCC" && test -n "$verbose" && echo " setting CCC to $CCC"
if test -z "$CCC"; then
- echo checking for cc++
- saveifs="$IFS"; IFS="${IFS}:"
+ # Extract the first word of `cc++', so it can be a program name with args.
+ set dummy cc++; word=$2
+ echo checking for $word
+ IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
- if test -f $dir/cc++; then
+ if test -f $dir/$word; then
CCC="cc++"
break
fi
done
IFS="$saveifs"
fi
-test -z "$CCC" && CCC=""
+
+test -n "$CCC" && test -n "$verbose" && echo " setting CCC to $CCC"
if test -z "$CCC"; then
cat <<EOM
@@ -233,8 +264,7 @@ fi
echo checking that C++ compiler can compile very simple C++ program
cat <<EOF > conftest.cc
-extern "C" { void exit(int); }
-int main() { exit(0); }
+int main() { return 0; }
EOF
rm -f conftest
@@ -254,7 +284,6 @@ echo checking that C++ static constructors and destructors are called
cat <<EOF > conftest.cc
extern "C" {
- void exit(int);
void _exit(int);
}
int i;
@@ -264,7 +293,7 @@ struct A {
~A() { if (i == 1) _exit(0); }
};
A a;
-main() { exit(1); }
+int main() { return 1; }
EOF
rm -f conftest
@@ -282,8 +311,7 @@ rm -f conftest*
echo checking for C++ header files
cat <<EOF >conftest.cc
#include <stdio.h>
-extern "C" { void exit(int); }
-int main() { exit(0); } void t() { fopen(0, 0); }
+int main() { return 0; } void t() { fopen(0, 0); }
EOF
if eval $cc_compile; then
:
@@ -292,7 +320,8 @@ else
Your header files do not appear to support C++.
I was unable to compile and link a simple C++ program that used a function
declared in <stdio.h>.
-If you're using gcc/g++, you should install libg++.
+If you're using a version of gcc/g++ earlier than 2.5,
+you should install libg++.
EOF
rm -f conftest* core; exit 1
fi
@@ -302,18 +331,21 @@ then
for p in lpr
do
if test -z "$LPR"; then
- echo checking for $p
- saveifs="$IFS"; IFS="${IFS}:"
+ # Extract the first word of `$p', so it can be a program name with args.
+ set dummy $p; word=$2
+ echo checking for $word
+ IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
- if test -f $dir/$p; then
+ if test -f $dir/$word; then
LPR="$p"
break
fi
done
IFS="$saveifs"
fi
-test -z "$LPR" && LPR=""
+
+test -n "$LPR" && test -n "$verbose" && echo " setting LPR to $LPR"
test -n "$LPR" && break
done
@@ -321,18 +353,21 @@ done
for p in lp
do
if test -z "$LP"; then
- echo checking for $p
- saveifs="$IFS"; IFS="${IFS}:"
+ # Extract the first word of `$p', so it can be a program name with args.
+ set dummy $p; word=$2
+ echo checking for $word
+ IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
- if test -f $dir/$p; then
+ if test -f $dir/$word; then
LP="$p"
break
fi
done
IFS="$saveifs"
fi
-test -z "$LP" && LP=""
+
+test -n "$LP" && test -n "$verbose" && echo " setting LP to $LP"
test -n "$LP" && break
done
@@ -345,18 +380,21 @@ done
for p in lpq
do
if test -z "$LPQ"; then
- echo checking for $p
- saveifs="$IFS"; IFS="${IFS}:"
+ # Extract the first word of `$p', so it can be a program name with args.
+ set dummy $p; word=$2
+ echo checking for $word
+ IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
- if test -f $dir/$p; then
+ if test -f $dir/$word; then
LPQ="$p"
break
fi
done
IFS="$saveifs"
fi
-test -z "$LPQ" && LPQ=""
+
+test -n "$LPQ" && test -n "$verbose" && echo " setting LPQ to $LPQ"
test -n "$LPQ" && break
done
@@ -396,25 +434,30 @@ done
IFS="$saveifs"
if test -z "$YACC"; then
- echo checking for byacc
- saveifs="$IFS"; IFS="${IFS}:"
+ # Extract the first word of `byacc', so it can be a program name with args.
+ set dummy byacc; word=$2
+ echo checking for $word
+ IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
- if test -f $dir/byacc; then
+ if test -f $dir/$word; then
YACC="byacc"
break
fi
done
IFS="$saveifs"
fi
-test -z "$YACC" && YACC=""
+
+test -n "$YACC" && test -n "$verbose" && echo " setting YACC to $YACC"
if test -z "$YACC"; then
- echo checking for bison
- saveifs="$IFS"; IFS="${IFS}:"
+ # Extract the first word of `bison', so it can be a program name with args.
+ set dummy bison; word=$2
+ echo checking for $word
+ IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
- if test -f $dir/bison; then
+ if test -f $dir/$word; then
YACC="bison -y"
break
fi
@@ -422,34 +465,47 @@ if test -z "$YACC"; then
IFS="$saveifs"
fi
test -z "$YACC" && YACC="yacc"
+test -n "$YACC" && test -n "$verbose" && echo " setting YACC to $YACC"
if test -z "$RANLIB"; then
- echo checking for ranlib
- saveifs="$IFS"; IFS="${IFS}:"
+ # Extract the first word of `ranlib', so it can be a program name with args.
+ set dummy ranlib; word=$2
+ echo checking for $word
+ IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
- if test -f $dir/ranlib; then
+ if test -f $dir/$word; then
RANLIB="ranlib"
break
fi
done
IFS="$saveifs"
fi
-test -z "$RANLIB" && RANLIB="@:"
+test -z "$RANLIB" && RANLIB=":"
+test -n "$RANLIB" && test -n "$verbose" && echo " setting RANLIB to $RANLIB"
# Make sure to not get the incompatible SysV /etc/install and
# /usr/sbin/install, which might be in PATH before a BSD-like install,
# or the SunOS /usr/etc/install directory, or the AIX /bin/install,
-# or the AFS install, which mishandles nonexistent args. (Sigh.)
-if test -z "$INSTALL"; then
+# or the AFS install, which mishandles nonexistent args, or
+# /usr/ucb/install on SVR4, which tries to use the nonexistent group
+# `staff'. On most BSDish systems install is in /usr/bin, not /usr/ucb
+# anyway. Sigh.
+if test "z${INSTALL}" = "z" ; then
echo checking for install
- saveifs="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
case $dir in
- /etc|/usr/sbin|/usr/etc|/usr/afsws/bin) ;;
+ /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
*)
+ if test -f $dir/installbsd; then
+ INSTALL="$dir/installbsd -c" # OSF1
+ INSTALL_PROGRAM='$(INSTALL)'
+ INSTALL_DATA='$(INSTALL) -m 644'
+ break
+ fi
if test -f $dir/install; then
if grep dspmsg $dir/install >/dev/null 2>&1; then
: # AIX
@@ -466,8 +522,11 @@ if test -z "$INSTALL"; then
IFS="$saveifs"
fi
INSTALL=${INSTALL-cp}
+test -n "$verbose" && echo " setting INSTALL to $INSTALL"
INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
+test -n "$verbose" && echo " setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
+test -n "$verbose" && echo " setting INSTALL_DATA to $INSTALL_DATA"
echo checking for ln -s
rm -f conftestdata
@@ -507,186 +566,372 @@ fi
rm -f conftest.sh
-echo checking for unistd.h
+for hdr in unistd.h dirent.h limits.h sys/dir.h stdlib.h
+do
+trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
+echo checking for ${hdr}
echo checking how to run the C preprocessor
if test -z "$CPP"; then
- CPP='${CC-cc} -E'
+ # This must be in double quotes, not single quotes, because CPP may get
+ # substituted into the Makefile and ``${CC-cc}'' will simply confuse
+ # make. It must be expanded now.
+ CPP="${CC-cc} -E"
cat > conftest.c <<EOF
+#include "confdefs.h"
#include <stdio.h>
+Syntax Error
EOF
-err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
+err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
:
else
+ rm -rf conftest*
CPP=/lib/cpp
fi
rm -f conftest*
fi
+test ".${verbose}" != "." && echo " setting CPP to $CPP"
cat > conftest.c <<EOF
-#include <unistd.h>
+#include "confdefs.h"
+#include <${hdr}>
EOF
-err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
+err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
- DEFS="$DEFS -DHAVE_UNISTD_H=1"
+ rm -rf conftest*
+
+{
+test -n "$verbose" && \
+echo " defining ${trhdr}"
+echo "#define" ${trhdr} 1 >> confdefs.h
+DEFS="$DEFS -D${trhdr}=1"
+}
+
+
fi
rm -f conftest*
+done
-for hdr in dirent.h limits.h sys/dir.h stdlib.h
-do
-trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
-echo checking for ${hdr}
-cat > conftest.c <<EOF
-#include <${hdr}>
+echo 'checking for ISC 3.x or 4.x'
+if grep '[34]\.' /usr/options/cb.name >/dev/null 2>&1
+then
+
+{
+test -n "$verbose" && \
+echo " defining _SYSV3"
+echo "#define" _SYSV3 1 >> confdefs.h
+DEFS="$DEFS -D_SYSV3=1"
+}
+
+fi
+echo checking for whether -D_POSIX_SOURCE is necessary
+cat <<EOF >conftest.cc
+#include <stdio.h>
+int main() { return 0; } void t() { (void)fileno(stdin); }
EOF
-err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
-if test -z "$err"; then
- DEFS="$DEFS -D${trhdr}=1"
+if eval $cc_compile; then
+ :
+else
+
+{
+test -n "$verbose" && \
+echo " defining _POSIX_SOURCE"
+echo "#define" _POSIX_SOURCE 1 >> confdefs.h
+DEFS="$DEFS -D_POSIX_SOURCE=1"
+}
+
fi
rm -f conftest*
-done
-
echo checking for 'C++ <limits.h>'
cat <<EOF >conftest.cc
#include <limits.h>
-extern "C" { void exit(int); }
-int main() { exit(0); } void t() { int x = INT_MIN; int y = INT_MAX; int z = UCHAR_MAX; }
+int main() { return 0; } void t() { int x = INT_MIN; int y = INT_MAX; int z = UCHAR_MAX; }
EOF
if eval $cc_compile; then
- DEFS="$DEFS -DHAVE_CC_LIMITS_H=1"
+
+{
+test -n "$verbose" && \
+echo " defining HAVE_CC_LIMITS_H"
+echo "#define" HAVE_CC_LIMITS_H 1 >> confdefs.h
+DEFS="$DEFS -DHAVE_CC_LIMITS_H=1"
+}
+
fi
rm -f conftest*
-echo checking for 'C++ <unistd.h>'
+echo checking for 'C++ <osfcn.h>'
cat <<EOF >conftest.cc
-#include <unistd.h>
-extern "C" { void exit(int); }
-int main() { exit(0); } void t() { read(0, 0, 0); }
+#include <osfcn.h>
+int main() { return 0; } void t() { read(0, 0, 0); open(0, 0); }
EOF
if eval $cc_compile; then
- DEFS="$DEFS -DHAVE_CC_UNISTD_H=1"
+
+{
+test -n "$verbose" && \
+echo " defining HAVE_CC_OSFCN_H"
+echo "#define" HAVE_CC_OSFCN_H 1 >> confdefs.h
+DEFS="$DEFS -DHAVE_CC_OSFCN_H=1"
+}
+
fi
rm -f conftest*
echo checking for declaration of getopt in stdlib.h
cat <<EOF >conftest.cc
#include <stdlib.h>
-extern "C" { void exit(int); }
-int main() { exit(0); } void t() { int opt = getopt(0, 0, 0); optarg = "foo"; optind = 1; }
+extern "C" { void getopt(int); }
+int main() { return 0; } void t() { }
EOF
if eval $cc_compile; then
- DEFS="$DEFS -DSTDLIB_H_DECLARES_GETOPT=1"
+ :
+else
+
+{
+test -n "$verbose" && \
+echo " defining STDLIB_H_DECLARES_GETOPT"
+echo "#define" STDLIB_H_DECLARES_GETOPT 1 >> confdefs.h
+DEFS="$DEFS -DSTDLIB_H_DECLARES_GETOPT=1"
+}
+
fi
rm -f conftest*
echo checking for declaration of getopt in unistd.h
cat <<EOF >conftest.cc
#include <sys/types.h>
#include <unistd.h>
-extern "C" { void exit(int); }
-int main() { exit(0); } void t() { int opt = getopt(0, 0, 0); }
+extern "C" { void getopt(int); }
+int main() { return 0; } void t() { }
EOF
if eval $cc_compile; then
- DEFS="$DEFS -DUNISTD_H_DECLARES_GETOPT=1"
+ :
+else
+
+{
+test -n "$verbose" && \
+echo " defining UNISTD_H_DECLARES_GETOPT"
+echo "#define" UNISTD_H_DECLARES_GETOPT 1 >> confdefs.h
+DEFS="$DEFS -DUNISTD_H_DECLARES_GETOPT=1"
+}
+
fi
rm -f conftest*
echo checking for declaration of putenv
cat <<EOF >conftest.cc
#include <stdlib.h>
-extern "C" { void exit(int); }
-int main() { exit(0); } void t() { putenv((char *)0); }
+extern "C" { void putenv(int); }
+int main() { return 0; } void t() { }
EOF
if eval $cc_compile; then
- DEFS="$DEFS -DSTDLIB_H_DECLARES_PUTENV=1"
+ :
+else
+
+{
+test -n "$verbose" && \
+echo " defining STDLIB_H_DECLARES_PUTENV"
+echo "#define" STDLIB_H_DECLARES_PUTENV 1 >> confdefs.h
+DEFS="$DEFS -DSTDLIB_H_DECLARES_PUTENV=1"
+}
+
+fi
+rm -f conftest*
+echo checking for declaration of popen
+cat <<EOF >conftest.cc
+#include <stdio.h>
+extern "C" { void popen(int); }
+int main() { return 0; } void t() { }
+EOF
+if eval $cc_compile; then
+ :
+else
+
+{
+test -n "$verbose" && \
+echo " defining STDIO_H_DECLARES_POPEN"
+echo "#define" STDIO_H_DECLARES_POPEN 1 >> confdefs.h
+DEFS="$DEFS -DSTDIO_H_DECLARES_POPEN=1"
+}
+
+fi
+rm -f conftest*
+echo checking for declaration of pclose
+cat <<EOF >conftest.cc
+#include <stdio.h>
+extern "C" { void pclose(int); }
+int main() { return 0; } void t() { }
+EOF
+if eval $cc_compile; then
+ :
+else
+
+{
+test -n "$verbose" && \
+echo " defining STDIO_H_DECLARES_PCLOSE"
+echo "#define" STDIO_H_DECLARES_PCLOSE 1 >> confdefs.h
+DEFS="$DEFS -DSTDIO_H_DECLARES_PCLOSE=1"
+}
+
fi
rm -f conftest*
echo checking for time_t
cat <<EOF >conftest.cc
#include <time.h>
-extern "C" { void exit(int); }
-int main() { exit(0); } void t() { time_t t = time(0); struct tm *p = localtime(&t); }
+int main() { return 0; } void t() { time_t t = time(0); struct tm *p = localtime(&t); }
EOF
if eval $cc_compile; then
:
else
- DEFS="$DEFS -DLONG_FOR_TIME_T=1"
+
+{
+test -n "$verbose" && \
+echo " defining LONG_FOR_TIME_T"
+echo "#define" LONG_FOR_TIME_T 1 >> confdefs.h
+DEFS="$DEFS -DLONG_FOR_TIME_T=1"
+}
+
fi
rm -f conftest*
echo checking for return type of signal handlers
cat > conftest.c <<EOF
+#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
#ifdef signal
#undef signal
#endif
extern void (*signal ()) ();
-main() { exit(0); }
-t() { int i; }
+int main() { exit(0); }
+int t() { int i; }
EOF
if eval $compile; then
- DEFS="$DEFS -DRETSIGTYPE=void"
+ rm -rf conftest*
+
+{
+test -n "$verbose" && \
+echo " defining" RETSIGTYPE to be void
+echo "#define" RETSIGTYPE void >> confdefs.h
+DEFS="$DEFS -DRETSIGTYPE=void"
+}
+
+
else
- DEFS="$DEFS -DRETSIGTYPE=int"
+ rm -rf conftest*
+
+{
+test -n "$verbose" && \
+echo " defining" RETSIGTYPE to be int
+echo "#define" RETSIGTYPE int >> confdefs.h
+DEFS="$DEFS -DRETSIGTYPE=int"
+}
+
fi
rm -f conftest*
echo checking for struct exception
cat > conftest.c <<EOF
+#include "confdefs.h"
#include <math.h>
-main() { exit(0); }
-t() { struct exception e; }
+int main() { exit(0); }
+int t() { struct exception e; }
EOF
if eval $compile; then
- DEFS="$DEFS -DHAVE_STRUCT_EXCEPTION=1"
+ rm -rf conftest*
+
+{
+test -n "$verbose" && \
+echo " defining HAVE_STRUCT_EXCEPTION"
+echo "#define" HAVE_STRUCT_EXCEPTION 1 >> confdefs.h
+DEFS="$DEFS -DHAVE_STRUCT_EXCEPTION=1"
+}
+
+
fi
rm -f conftest*
echo checking for mmap
cat > conftest.c <<EOF
+#include "confdefs.h"
#include <sys/types.h>
#include <sys/mman.h>
-main() { exit(0); }
-t() { char *p = mmap(0, 0, PROT_READ, MAP_PRIVATE, 0, 0); munmap(p, 0); }
+int main() { exit(0); }
+int t() { char *p = mmap(0, 0, PROT_READ, MAP_PRIVATE, 0, 0); munmap(p, 0); }
EOF
if eval $compile; then
- DEFS="$DEFS -DHAVE_MMAP=1"
+ rm -rf conftest*
+
+{
+test -n "$verbose" && \
+echo " defining HAVE_MMAP"
+echo "#define" HAVE_MMAP 1 >> confdefs.h
+DEFS="$DEFS -DHAVE_MMAP=1"
+}
+
+
fi
rm -f conftest*
echo checking for pid_t in sys/types.h
-echo '#include <sys/types.h>' > conftest.c
-eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
+echo '#include "confdefs.h"
+#include <sys/types.h>' > conftest.c
+eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "pid_t" conftest.out >/dev/null 2>&1; then
:
-else
- DEFS="$DEFS -Dpid_t=int"
+else
+ rm -rf conftest*
+
+{
+test -n "$verbose" && \
+echo " defining" pid_t to be int
+echo "#define" pid_t int >> confdefs.h
+DEFS="$DEFS -Dpid_t=int"
+}
+
fi
rm -f conftest*
echo checking for vfork.h
cat > conftest.c <<EOF
+#include "confdefs.h"
#include <vfork.h>
EOF
-err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
+err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
- DEFS="$DEFS -DHAVE_VFORK_H=1"
+ rm -rf conftest*
+
+{
+test -n "$verbose" && \
+echo " defining HAVE_VFORK_H"
+echo "#define" HAVE_VFORK_H 1 >> confdefs.h
+DEFS="$DEFS -DHAVE_VFORK_H=1"
+}
+
+
fi
rm -f conftest*
echo checking for working vfork
+
cat > conftest.c <<EOF
+#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <signal.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_VFORK_H
#include <vfork.h>
#endif
+static int signalled;
+static RETSIGTYPE catch (s) int s; { signalled = 1; }
main() {
- pid_t parent = getpid();
- pid_t child = vfork();
+ pid_t parent = getpid ();
+ pid_t child;
+
+ signal (SIGINT, catch);
+
+ child = vfork ();
if (child == 0) {
/* On sparc systems, changes by the child to local and incoming
@@ -711,6 +956,12 @@ main() {
|| p != p5 || p != p6 || p != p7)
_exit(1);
+ /* On some systems (e.g. SunOS 5.2), if the parent is catching
+ a signal, the child ignores the signal before execing,
+ and the parent later receives that signal, the parent dumps core.
+ Test for this by ignoring SIGINT in the child. */
+ signal (SIGINT, SIG_IGN);
+
/* On some systems (e.g. IRIX 3.3),
vfork doesn't separate parent from child file descriptors.
If the child closes a descriptor before it execs or exits,
@@ -733,6 +984,10 @@ main() {
/* Did the vfork/compiler bug occur? */
|| parent != getpid()
+ /* Did the signal handling bug occur? */
+ || kill(parent, SIGINT) != 0
+ || signalled != 1
+
/* Did the file descriptor bug occur? */
|| fstat(fileno(stdout), &st) != 0
);
@@ -743,9 +998,16 @@ eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
:
else
- DEFS="$DEFS -Dvfork=fork"
+
+{
+test -n "$verbose" && \
+echo " defining" vfork to be fork
+echo "#define" vfork fork >> confdefs.h
+DEFS="$DEFS -Dvfork=fork"
+}
+
fi
-rm -f conftest*
+rm -fr conftest*
saved_libs="$LIBS"
LIBS="$LIBS -lm"
@@ -753,16 +1015,27 @@ for func in fmod strtol getcwd strerror putenv
do
echo checking for ${func}
cat > conftest.c <<EOF
-
-main() { exit(0); }
-t() {
+#include "confdefs.h"
+#include <ctype.h>
+int main() { exit(0); }
+int t() {
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_${func}) || defined (__stub___${func})
+choke me
+#else
/* Override any gcc2 internal prototype to avoid an error. */
-extern char ${func}(); ${func}(); }
+extern char ${func}(); ${func}();
+#endif
+ }
EOF
if eval $compile; then
:
else
+ rm -rf conftest*
LIBOBJS="$LIBOBJS ${func}.o"
+test -n "$verbose" && echo " using ${func}.o instead"
fi
rm -f conftest*
@@ -774,10 +1047,14 @@ do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
-#include <stdio.h>
-main() { exit(0); }
-t() {
-#ifdef __stub_${func}
+#include "confdefs.h"
+#include <ctype.h>
+int main() { exit(0); }
+int t() {
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_${func}) || defined (__stub___${func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error. */
@@ -786,20 +1063,37 @@ extern char ${func}(); ${func}();
}
EOF
if eval $compile; then
- DEFS="$DEFS -D${trfunc}=1"
+ rm -rf conftest*
+ {
+test -n "$verbose" && \
+echo " defining ${trfunc}"
+echo "#define" ${trfunc} 1 >> confdefs.h
+DEFS="$DEFS -D${trfunc}=1"
+}
+
+
fi
rm -f conftest*
-#endif
done
echo checking for sys_siglist
cat > conftest.c <<EOF
+#include "confdefs.h"
-main() { exit(0); }
-t() { extern char *sys_siglist[]; sys_siglist[0] = 0; }
+int main() { exit(0); }
+int t() { extern char *sys_siglist[]; sys_siglist[0] = 0; }
EOF
if eval $compile; then
- DEFS="$DEFS -DHAVE_SYS_SIGLIST=1"
+ rm -rf conftest*
+
+{
+test -n "$verbose" && \
+echo " defining HAVE_SYS_SIGLIST"
+echo "#define" HAVE_SYS_SIGLIST 1 >> confdefs.h
+DEFS="$DEFS -DHAVE_SYS_SIGLIST=1"
+}
+
+
fi
rm -f conftest*
@@ -817,7 +1111,7 @@ int main()
int *p = new int;
delete p;
testit = 0;
- exit(1);
+ return 1;
}
static unsigned dummy[3];
@@ -846,7 +1140,14 @@ EOF
rm -f conftest
eval $cc_compile
if test -s conftest && (./conftest) 2>/dev/null; then
- DEFS="$DEFS -DCOOKIE_BUG=1"
+
+{
+test -n "$verbose" && \
+echo " defining COOKIE_BUG"
+echo "#define" COOKIE_BUG 1 >> confdefs.h
+DEFS="$DEFS -DCOOKIE_BUG=1"
+}
+
fi
rm -f conftest*
echo checking for cfront ANSI C INT_MIN bug
@@ -864,40 +1165,60 @@ cat <<EOF > conftest.cc
int main()
{
int z = 0;
- exit(INT_MIN < z);
+ return INT_MIN < z;
}
EOF
rm -f conftest
eval $cc_compile
if test -s conftest && (./conftest) 2>/dev/null; then
- DEFS="$DEFS -DCFRONT_ANSI_BUG=1"
+
+{
+test -n "$verbose" && \
+echo " defining CFRONT_ANSI_BUG"
+echo "#define" CFRONT_ANSI_BUG 1 >> confdefs.h
+DEFS="$DEFS -DCFRONT_ANSI_BUG=1"
+}
+
fi
rm -f conftest*
echo checking for new array delete syntax
cat <<EOF >conftest.cc
-extern "C" { void exit(int); }
-int main() { exit(0); } void t() { char *p = new char[5]; delete [] p; }
+int main() { return 0; } void t() { char *p = new char[5]; delete [] p; }
EOF
if eval $cc_compile; then
:
else
- DEFS="$DEFS -DARRAY_DELETE_NEEDS_SIZE=1"
+
+{
+test -n "$verbose" && \
+echo " defining ARRAY_DELETE_NEEDS_SIZE"
+echo "#define" ARRAY_DELETE_NEEDS_SIZE 1 >> confdefs.h
+DEFS="$DEFS -DARRAY_DELETE_NEEDS_SIZE=1"
+}
+
fi
rm -f conftest*
echo checking for traditional preprocessor
cat <<EOF >conftest.cc
#define name2(a,b) a/**/b
-extern "C" { void exit(int); }
-int main() { exit(0); } void t() { int name2(foo,bar); }
+int main() { return 0; } void t() { int name2(foo,bar); }
EOF
if eval $cc_compile; then
- DEFS="$DEFS -DTRADITIONAL_CPP=1"
+
+{
+test -n "$verbose" && \
+echo " defining TRADITIONAL_CPP"
+echo "#define" TRADITIONAL_CPP 1 >> confdefs.h
+DEFS="$DEFS -DTRADITIONAL_CPP=1"
+}
+
fi
rm -f conftest*
echo checking for w_coredump
cat > conftest.c <<EOF
+#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -915,9 +1236,17 @@ main()
EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
- DEFS="$DEFS -DWCOREFLAG=0200"
+
+{
+test -n "$verbose" && \
+echo " defining" WCOREFLAG to be 0200
+echo "#define" WCOREFLAG 0200 >> confdefs.h
+DEFS="$DEFS -DWCOREFLAG=0200"
+}
+
+
fi
-rm -f conftest*
+rm -fr conftest*
test -n "${BROKEN_SPOOLER_FLAGS}" || BROKEN_SPOOLER_FLAGS=7
echo using default value of ${BROKEN_SPOOLER_FLAGS} for grops -b option
@@ -956,15 +1285,23 @@ fi
test -n "$PAGE" || PAGE=letter
echo guessing $PAGE size paper
+# Set default prefixes.
if test -n "$prefix"; then
test -z "$exec_prefix" && exec_prefix='${prefix}'
prsub="s%^prefix\\([ ]*\\)=\\([ ]*\\).*$%prefix\\1=\\2$prefix%"
fi
if test -n "$exec_prefix"; then
prsub="$prsub
-s%^exec_prefix\\([ ]*\\)=\\([ ]*\\).*$%\
-exec_prefix\\1=\\2$exec_prefix%"
+s%^exec_prefix\\([ ]*\\)=\\([ ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
fi
+# Quote sed substitution magic chars in DEFS.
+cat >conftest.def <<EOF
+$DEFS
+EOF
+escape_ampersand_and_backslash='s%[&\\]%\\&%g'
+DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
+rm -f conftest.def
+# Substitute for predefined variables.
trap 'rm -f config.status; exit 1' 1 3 15
echo creating config.status
@@ -974,15 +1311,16 @@ cat > config.status <<EOF
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null`:
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
#
-# $0 $*
+# $0 $configure_args
for arg
do
case "\$arg" in
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- exec /bin/sh $0 $* ;;
+ echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
+ exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
*) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
esac
done
@@ -1015,11 +1353,14 @@ DEFS='$DEFS'
prefix='$prefix'
exec_prefix='$exec_prefix'
prsub='$prsub'
+extrasub='$extrasub'
EOF
cat >> config.status <<\EOF
top_srcdir=$srcdir
-for file in .. Makefile; do if [ "x$file" != "x.." ]; then
+
+CONFIG_FILES=${CONFIG_FILES-"Makefile"}
+for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
srcdir=$top_srcdir
# Remove last slash and all that follows it. Not all systems have dirname.
dir=`echo $file|sed 's%/[^/][^/]*$%%'`
@@ -1032,6 +1373,7 @@ for file in .. Makefile; do if [ "x$file" != "x.." ]; then
echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
sed -e "
$prsub
+$extrasub
s%@CC@%$CC%g
s%@CCLIBS@%$CCLIBS%g
s%@CCC@%$CCC%g
@@ -1059,7 +1401,9 @@ s%@DEFS@%$DEFS%
" $top_srcdir/${file}.in >> $file
fi; done
+
+exit 0
EOF
chmod +x config.status
-test -n "$no_create" || ./config.status
+${CONFIG_SHELL-/bin/sh} config.status
diff --git a/configure.in b/configure.in
index bd20d8f21..fccb8c8a5 100644
--- a/configure.in
+++ b/configure.in
@@ -15,12 +15,15 @@ GROFF_ETAGSCCFLAG
GROFF_CSH_HACK(SH_SCRIPT_SED_CMD='1s/.*/:/', SH_SCRIPT_SED_CMD='')
AC_SUBST(SH_SCRIPT_SED_CMD)
dnl checks for headers
-AC_UNISTD_H
-AC_HAVE_HEADERS(dirent.h limits.h sys/dir.h stdlib.h)
+AC_HAVE_HEADERS(unistd.h dirent.h limits.h sys/dir.h stdlib.h)
+GROFF_ISC_SYSV3
+GROFF_POSIX
GROFF_LIMITS_H
-GROFF_UNISTD_H
+GROFF_OSFCN_H
GROFF_GETOPT
GROFF_PUTENV
+GROFF_POPEN
+GROFF_PCLOSE
dnl checks for typedefs
GROFF_TIME_T
AC_RETSIGTYPE
diff --git a/devX100-12/S b/devX100-12/S
index 1d235dab5..453c295e2 100644
--- a/devX100-12/S
+++ b/devX100-12/S
@@ -74,7 +74,7 @@ tf 14,8 0 0134
rB "
pp 11,11 0 0136
_ 8,0,4 0 0137
-rn 8,13 0 0140
+radicalex 8,13 0 0140
*a 11,9 0 0141
*b 9,13,4 0 0142
*x 9,9,3 0 0143
diff --git a/devX100/S b/devX100/S
index 5e9141246..59af889e1 100644
--- a/devX100/S
+++ b/devX100/S
@@ -74,7 +74,7 @@ tf 10,7 0 0134
rB "
pp 10,10 0 0136
_ 7,0,3 0 0137
-rn 7,12 0 0140
+radicalex 7,12 0 0140
*a 9,7 0 0141
*b 8,11,3 0 0142
*x 8,7,3 0 0143
diff --git a/devX75-12/S b/devX75-12/S
index e93a20573..2e66ad091 100644
--- a/devX75-12/S
+++ b/devX75-12/S
@@ -74,7 +74,7 @@ tf 9,6 0 0134
rB "
pp 8,9 0 0136
_ 6,0,3 0 0137
-rn 6,12 0 0140
+radicalex 6,12 0 0140
*a 8,6 0 0141
*b 7,10,3 0 0142
*x 7,6,3 0 0143
diff --git a/devX75/S b/devX75/S
index 77e2f5fb3..b1cfbbf11 100644
--- a/devX75/S
+++ b/devX75/S
@@ -74,7 +74,7 @@ tf 7,5 0 0134
rB "
pp 7,7 0 0136
_ 5,0,3 0 0137
-rn 5,10 0 0140
+radicalex 5,10 0 0140
*a 7,5 0 0141
*b 5,8,2 0 0142
*x 6,5,2 0 0143
diff --git a/devdvi/generate/cork.map b/devdvi/generate/cork.map
new file mode 100644
index 000000000..52cac9c8b
--- /dev/null
+++ b/devdvi/generate/cork.map
@@ -0,0 +1,206 @@
+# Map for DC/EC fonts with Cork encoding.
+# Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+0 ga
+1 aa char180
+2 a^
+3 a~
+4 ad char168
+5 a"
+6 ao
+7 ah
+8 ab
+9 a- char175
+10 a.
+11 ac char184
+12 ho
+13 bq
+14 fo
+15 fc
+16 lq
+17 rq
+18 Bq
+19 Fo char171
+20 Fc char187
+21 en
+22 em
+25 .i
+26 .j
+27 ff
+28 fi
+29 fl
+30 Fi
+31 Fl
+33 !
+34 "
+35 # sh
+36 $ Do
+37 %
+38 &
+39 ' aq
+40 (
+41 )
+42 *
+43 + pl
+44 ,
+45 -
+46 .
+47 / sl
+48 0
+49 1
+50 2
+51 3
+52 4
+53 5
+54 6
+55 7
+56 8
+57 9
+58 :
+59 ;
+60 <
+61 = eq
+62 >
+63 ?
+64 @ at
+65 A
+66 B
+67 C
+68 D
+69 E
+70 F
+71 G
+72 H
+73 I
+74 J
+75 K
+76 L
+77 M
+78 N
+79 O
+80 P
+81 Q
+82 R
+83 S
+84 T
+85 U
+86 V
+87 W
+88 X
+89 Y
+90 Z
+91 [ lB
+92 \ rs
+93 ] rB
+94 ^ ha
+95 _
+96 ` oq
+97 a
+98 b
+99 c
+100 d
+101 e
+102 f
+103 g
+104 h
+105 i
+106 j
+107 k
+108 l
+109 m
+110 n
+111 o
+112 p
+113 q
+114 r
+115 s
+116 t
+117 u
+118 v
+119 w
+120 x
+121 y
+122 z
+123 { lC
+124 | or bv ba
+125 } rC
+126 ~
+127 hy char173
+130 'C
+138 /L
+146 vS
+152 :Y
+154 vZ
+156 IJ
+159 sc char167
+162 'c
+170 (l
+178 vs
+184 :y char255
+186 vz
+188 ij
+189 r! char161
+190 r? char191
+191 Po char163
+192 `A char192
+193 'A char193
+194 ^A char194
+195 ~A char195
+196 :A char196
+197 oA char197
+198 AE char198
+199 ,C char199
+200 `E char200
+201 'E char201
+202 ^E char202
+203 :E char203
+204 `I char204
+205 'I char205
+206 ^I char206
+207 :I char207
+208 -D char208
+209 ~N char209
+210 `O char210
+211 'O char211
+212 ^O char212
+213 ~O char213
+214 :O char214
+215 OE
+216 /O char216
+217 `U char217
+218 'U char218
+219 ^U char219
+220 :U char220
+221 char221
+222 TP char222
+224 `a char224
+225 'a char225
+226 ^a char226
+227 ~a char227
+228 :a char228
+229 oa char229
+230 ae char230
+231 ,c char231
+232 `e char232
+233 'e char233
+234 ^e char234
+235 :e char235
+236 `i char236
+237 'i char237
+238 ^i char238
+239 :i char239
+240 Sd char240
+241 ~n char241
+242 `o char242
+243 'o char243
+244 ^o char244
+245 ~o char245
+246 :o char246
+247 oe
+248 /o char248
+249 `u char249
+250 'u char250
+251 ^u char251
+252 :u char252
+253 char253
+254 Tp char254
+255 ss char223
diff --git a/devps/S b/devps/S
index 4c58752ed..2a4c0e725 100644
--- a/devps/S
+++ b/devps/S
@@ -75,7 +75,7 @@ tf "
rB "
pp 658,674 3 0136 perpendicular
_ 500,0,252 3 0137 underscore
-rn 500,917 3 0140 radicalex
+radicalex 500,917 3 0140 radicalex
*a 631,500,18 3 0141 alpha
*b 549,741,223 3 0142 beta
*x 549,499,231 3 0143 chi
diff --git a/devps/generate/textmap b/devps/generate/textmap
index 9001d3657..a4b51a3ec 100644
--- a/devps/generate/textmap
+++ b/devps/generate/textmap
@@ -430,7 +430,7 @@ bracketrighttp bracketrighttp
bracketrightbt bracketrightbt
bracketrightex bracketrightex
radical sr
-radicalex rn
+radicalex radicalex
approxequal ~=
bracketlefttp lc
bracketleftbt lf
diff --git a/eqn/TODO b/eqn/TODO
index 89b158e8a..81793575b 100644
--- a/eqn/TODO
+++ b/eqn/TODO
@@ -13,7 +13,7 @@ adjustments.
Possibly generate .lf commands during compute_metrics phase.
-Consider whether there shuld be extra space at the side of piles.
+Consider whether there should be extra space at the side of piles.
Provide scriptstyle displaystyle etc.
diff --git a/eqn/box.cc b/eqn/box.cc
index 08dbe0797..3a17cdf45 100644
--- a/eqn/box.cc
+++ b/eqn/box.cc
@@ -84,45 +84,45 @@ struct {
const char *name;
int *ptr;
} param_table[] = {
-"fat_offset", &fat_offset,
-"over_hang", &over_hang,
-"accent_width", &accent_width,
-"delimiter_factor", &delimiter_factor,
-"delimiter_shortfall", &delimiter_shortfall,
-"null_delimiter_space", &null_delimiter_space,
-"script_space", &script_space,
-"thin_space", &thin_space,
-"medium_space", &medium_space,
-"thick_space", &thick_space,
-"num1", &num1,
-"num2", &num2,
-"denom1", &denom1,
-"denom2", &denom2,
-"axis_height", &axis_height,
-"sup1", &sup1,
-"sup2", &sup2,
-"sup3", &sup3,
-"default_rule_thickness", &default_rule_thickness,
-"sub1", &sub1,
-"sub2", &sub2,
-"sup_drop", &sup_drop,
-"sub_drop", &sub_drop,
-"x_height", &x_height,
-"big_op_spacing1", &big_op_spacing1,
-"big_op_spacing2", &big_op_spacing2,
-"big_op_spacing3", &big_op_spacing3,
-"big_op_spacing4", &big_op_spacing4,
-"big_op_spacing5", &big_op_spacing5,
-"minimum_size", &minimum_size,
-"baseline_sep", &baseline_sep,
-"shift_down", &shift_down,
-"column_sep", &column_sep,
-"matrix_side_sep", &matrix_side_sep,
-"draw_lines", &draw_flag,
-"body_height", &body_height,
-"body_depth", &body_depth,
-"nroff", &nroff,
-0, 0
+ { "fat_offset", &fat_offset },
+ { "over_hang", &over_hang },
+ { "accent_width", &accent_width },
+ { "delimiter_factor", &delimiter_factor },
+ { "delimiter_shortfall", &delimiter_shortfall },
+ { "null_delimiter_space", &null_delimiter_space },
+ { "script_space", &script_space },
+ { "thin_space", &thin_space },
+ { "medium_space", &medium_space },
+ { "thick_space", &thick_space },
+ { "num1", &num1 },
+ { "num2", &num2 },
+ { "denom1", &denom1 },
+ { "denom2", &denom2 },
+ { "axis_height", &axis_height },
+ { "sup1", &sup1 },
+ { "sup2", &sup2 },
+ { "sup3", &sup3 },
+ { "default_rule_thickness", &default_rule_thickness },
+ { "sub1", &sub1 },
+ { "sub2", &sub2 },
+ { "sup_drop", &sup_drop },
+ { "sub_drop", &sub_drop },
+ { "x_height", &x_height },
+ { "big_op_spacing1", &big_op_spacing1 },
+ { "big_op_spacing2", &big_op_spacing2 },
+ { "big_op_spacing3", &big_op_spacing3 },
+ { "big_op_spacing4", &big_op_spacing4 },
+ { "big_op_spacing5", &big_op_spacing5 },
+ { "minimum_size", &minimum_size },
+ { "baseline_sep", &baseline_sep },
+ { "shift_down", &shift_down },
+ { "column_sep", &column_sep },
+ { "matrix_side_sep", &matrix_side_sep },
+ { "draw_lines", &draw_flag },
+ { "body_height", &body_height },
+ { "body_depth", &body_depth },
+ { "nroff", &nroff },
+ { 0, 0 }
};
void set_param(const char *name, int value)
diff --git a/eqn/delim.cc b/eqn/delim.cc
index ecf9c557e..4fc4d5050 100644
--- a/eqn/delim.cc
+++ b/eqn/delim.cc
@@ -344,9 +344,9 @@ int delim_box::compute_metrics(int style)
define_extensible_string(left, uid, LEFT_DELIM);
printf(".rn " DELIM_STRING " " LEFT_DELIM_STRING_FORMAT "\n",
uid);
+ if (r)
+ printf(".nr " MARK_REG " +\\n[" DELIM_WIDTH_REG "]\n");
}
- if (r)
- printf(".nr " MARK_REG " +\\n[" DELIM_WIDTH_REG "]\n");
if (right) {
define_extensible_string(right, uid, RIGHT_DELIM);
printf(".rn " DELIM_STRING " " RIGHT_DELIM_STRING_FORMAT "\n",
diff --git a/eqn/eqn.man b/eqn/eqn.man
index 0228b7215..81b684259 100644
--- a/eqn/eqn.man
+++ b/eqn/eqn.man
@@ -186,7 +186,7 @@ closing
a closing bracket such as );
.TP
punctuation
-a punctutation character such as ,;
+a punctuation character such as ,;
.TP
inner
a subformula contained within brackets;
diff --git a/eqn/lex.cc b/eqn/lex.cc
index 910db77f5..5537f9130 100644
--- a/eqn/lex.cc
+++ b/eqn/lex.cc
@@ -54,199 +54,199 @@ static struct {
const char *name;
int token;
} token_table[] = {
- "over", OVER,
- "smallover", SMALLOVER,
- "sqrt", SQRT,
- "sub", SUB,
- "sup", SUP,
- "lpile", LPILE,
- "rpile", RPILE,
- "cpile", CPILE,
- "pile", PILE,
- "left", LEFT,
- "right", RIGHT,
- "to", TO,
- "from", FROM,
- "size", SIZE,
- "font", FONT,
- "roman", ROMAN,
- "bold", BOLD,
- "italic", ITALIC,
- "fat", FAT,
- "bar", BAR,
- "under", UNDER,
- "accent", ACCENT,
- "uaccent", UACCENT,
- "above", ABOVE,
- "fwd", FWD,
- "back", BACK,
- "down", DOWN,
- "up", UP,
- "matrix", MATRIX,
- "col", COL,
- "lcol", LCOL,
- "rcol", RCOL,
- "ccol", CCOL,
- "mark", MARK,
- "lineup", LINEUP,
- "space", SPACE,
- "gfont", GFONT,
- "gsize", GSIZE,
- "define", DEFINE,
- "sdefine", SDEFINE,
- "ndefine", NDEFINE,
- "tdefine", TDEFINE,
- "undef", UNDEF,
- "ifdef", IFDEF,
- "include", INCLUDE,
- "copy", INCLUDE,
- "delim", DELIM,
- "chartype", CHARTYPE,
- "type", TYPE,
- "vcenter", VCENTER,
- "set", SET,
- "opprime", PRIME,
- "grfont", GRFONT,
- "gbfont", GBFONT,
- "split", SPLIT,
- "nosplit", NOSPLIT,
- "special", SPECIAL,
+ { "over", OVER },
+ { "smallover", SMALLOVER },
+ { "sqrt", SQRT },
+ { "sub", SUB },
+ { "sup", SUP },
+ { "lpile", LPILE },
+ { "rpile", RPILE },
+ { "cpile", CPILE },
+ { "pile", PILE },
+ { "left", LEFT },
+ { "right", RIGHT },
+ { "to", TO },
+ { "from", FROM },
+ { "size", SIZE },
+ { "font", FONT },
+ { "roman", ROMAN },
+ { "bold", BOLD },
+ { "italic", ITALIC },
+ { "fat", FAT },
+ { "bar", BAR },
+ { "under", UNDER },
+ { "accent", ACCENT },
+ { "uaccent", UACCENT },
+ { "above", ABOVE },
+ { "fwd", FWD },
+ { "back", BACK },
+ { "down", DOWN },
+ { "up", UP },
+ { "matrix", MATRIX },
+ { "col", COL },
+ { "lcol", LCOL },
+ { "rcol", RCOL },
+ { "ccol", CCOL },
+ { "mark", MARK },
+ { "lineup", LINEUP },
+ { "space", SPACE },
+ { "gfont", GFONT },
+ { "gsize", GSIZE },
+ { "define", DEFINE },
+ { "sdefine", SDEFINE },
+ { "ndefine", NDEFINE },
+ { "tdefine", TDEFINE },
+ { "undef", UNDEF },
+ { "ifdef", IFDEF },
+ { "include", INCLUDE },
+ { "copy", INCLUDE },
+ { "delim", DELIM },
+ { "chartype", CHARTYPE },
+ { "type", TYPE },
+ { "vcenter", VCENTER },
+ { "set", SET },
+ { "opprime", PRIME },
+ { "grfont", GRFONT },
+ { "gbfont", GBFONT },
+ { "split", SPLIT },
+ { "nosplit", NOSPLIT },
+ { "special", SPECIAL },
};
static struct {
const char *name;
const char *def;
} def_table[] = {
- "ALPHA", "\\(*A",
- "BETA", "\\(*B",
- "CHI", "\\(*X",
- "DELTA", "\\(*D",
- "EPSILON", "\\(*E",
- "ETA", "\\(*Y",
- "GAMMA", "\\(*G",
- "IOTA", "\\(*I",
- "KAPPA", "\\(*K",
- "LAMBDA", "\\(*L",
- "MU", "\\(*M",
- "NU", "\\(*N",
- "OMEGA", "\\(*W",
- "OMICRON", "\\(*O",
- "PHI", "\\(*F",
- "PI", "\\(*P",
- "PSI", "\\(*Q",
- "RHO", "\\(*R",
- "SIGMA", "\\(*S",
- "TAU", "\\(*T",
- "THETA", "\\(*H",
- "UPSILON", "\\(*U",
- "XI", "\\(*C",
- "ZETA", "\\(*Z",
- "Alpha", "\\(*A",
- "Beta", "\\(*B",
- "Chi", "\\(*X",
- "Delta", "\\(*D",
- "Epsilon", "\\(*E",
- "Eta", "\\(*Y",
- "Gamma", "\\(*G",
- "Iota", "\\(*I",
- "Kappa", "\\(*K",
- "Lambda", "\\(*L",
- "Mu", "\\(*M",
- "Nu", "\\(*N",
- "Omega", "\\(*W",
- "Omicron", "\\(*O",
- "Phi", "\\(*F",
- "Pi", "\\(*P",
- "Psi", "\\(*Q",
- "Rho", "\\(*R",
- "Sigma", "\\(*S",
- "Tau", "\\(*T",
- "Theta", "\\(*H",
- "Upsilon", "\\(*U",
- "Xi", "\\(*C",
- "Zeta", "\\(*Z",
- "alpha", "\\(*a",
- "beta", "\\(*b",
- "chi", "\\(*x",
- "delta", "\\(*d",
- "epsilon", "\\(*e",
- "eta", "\\(*y",
- "gamma", "\\(*g",
- "iota", "\\(*i",
- "kappa", "\\(*k",
- "lambda", "\\(*l",
- "mu", "\\(*m",
- "nu", "\\(*n",
- "omega", "\\(*w",
- "omicron", "\\(*o",
- "phi", "\\(*f",
- "pi", "\\(*p",
- "psi", "\\(*q",
- "rho", "\\(*r",
- "sigma", "\\(*s",
- "tau", "\\(*t",
- "theta", "\\(*h",
- "upsilon", "\\(*u",
- "xi", "\\(*c",
- "zeta", "\\(*z",
- "max", "{type \"operator\" roman \"max\"}",
- "min", "{type \"operator\" roman \"min\"}",
- "lim", "{type \"operator\" roman \"lim\"}",
- "sin", "{type \"operator\" roman \"sin\"}",
- "cos", "{type \"operator\" roman \"cos\"}",
- "tan", "{type \"operator\" roman \"tan\"}",
- "sinh", "{type \"operator\" roman \"sinh\"}",
- "cosh", "{type \"operator\" roman \"cosh\"}",
- "tanh", "{type \"operator\" roman \"tanh\"}",
- "arc", "{type \"operator\" roman \"arc\"}",
- "log", "{type \"operator\" roman \"log\"}",
- "ln", "{type \"operator\" roman \"ln\"}",
- "exp", "{type \"operator\" roman \"exp\"}",
- "Re", "{type \"operator\" roman \"Re\"}",
- "Im", "{type \"operator\" roman \"Im\"}",
- "det", "{type \"operator\" roman \"det\"}",
- "and", "{roman \"and\"}",
- "if", "{roman \"if\"}",
- "for", "{roman \"for\"}",
- "sum", "{type \"operator\" vcenter size +5 \\(*S}",
- "prod", "{type \"operator\" vcenter size +5 \\(*P}",
- "int", "{type \"operator\" vcenter size +8 \\(is}",
- "union", "{type \"operator\" vcenter size +5 \\(cu}",
- "inter", "{type \"operator\" vcenter size +5 \\(ca}",
- "times", "type \"binary\" \\(mu",
- "ldots", "type \"inner\" { . . . }",
- "inf", "\\(if",
- "partial", "\\(pd",
- "nothing", "\"\"",
- "half", "{1 smallover 2}",
- "hat_def", "roman \"^\"",
- "hat", "accent { hat_def }",
- "dot_def", "back 15 \"\\v'-52M'.\\v'52M'\"",
- "dot", "accent { dot_def }",
- "dotdot_def", "back 25 \"\\v'-52M'..\\v'52M'\"",
- "dotdot", "accent { dotdot_def }",
- "tilde_def", "\"~\"",
- "tilde", "accent { tilde_def }",
- "utilde_def", "\"\\v'75M'~\\v'-75M'\"",
- "utilde", "uaccent { utilde_def }",
- "vec_def", "up 52 size -5 \\(->",
- "vec", "accent { vec_def }",
- "dyad_def", "up 52 size -5 {\\(<- back 60 \\(->}",
- "dyad", "accent { dyad_def }",
- "==", "type \"relation\" \\(==",
- "!=", "type \"relation\" \\(!=",
- "+-", "type \"binary\" \\(+-",
- "->", "type \"relation\" \\(->",
- "<-", "type \"relation\" \\(<-",
- "<<", "{ < back 20 < }",
- ">>", "{ > back 20 > }",
- "...", "type \"inner\" vcenter { . . . }",
- "prime", "'",
- "approx", "type \"relation\" \"\\(~=\"",
- "grad", "\\(gr",
- "del", "\\(gr",
- "cdot", "type \"binary\" vcenter .",
- "dollar", "$",
+ { "ALPHA", "\\(*A" },
+ { "BETA", "\\(*B" },
+ { "CHI", "\\(*X" },
+ { "DELTA", "\\(*D" },
+ { "EPSILON", "\\(*E" },
+ { "ETA", "\\(*Y" },
+ { "GAMMA", "\\(*G" },
+ { "IOTA", "\\(*I" },
+ { "KAPPA", "\\(*K" },
+ { "LAMBDA", "\\(*L" },
+ { "MU", "\\(*M" },
+ { "NU", "\\(*N" },
+ { "OMEGA", "\\(*W" },
+ { "OMICRON", "\\(*O" },
+ { "PHI", "\\(*F" },
+ { "PI", "\\(*P" },
+ { "PSI", "\\(*Q" },
+ { "RHO", "\\(*R" },
+ { "SIGMA", "\\(*S" },
+ { "TAU", "\\(*T" },
+ { "THETA", "\\(*H" },
+ { "UPSILON", "\\(*U" },
+ { "XI", "\\(*C" },
+ { "ZETA", "\\(*Z" },
+ { "Alpha", "\\(*A" },
+ { "Beta", "\\(*B" },
+ { "Chi", "\\(*X" },
+ { "Delta", "\\(*D" },
+ { "Epsilon", "\\(*E" },
+ { "Eta", "\\(*Y" },
+ { "Gamma", "\\(*G" },
+ { "Iota", "\\(*I" },
+ { "Kappa", "\\(*K" },
+ { "Lambda", "\\(*L" },
+ { "Mu", "\\(*M" },
+ { "Nu", "\\(*N" },
+ { "Omega", "\\(*W" },
+ { "Omicron", "\\(*O" },
+ { "Phi", "\\(*F" },
+ { "Pi", "\\(*P" },
+ { "Psi", "\\(*Q" },
+ { "Rho", "\\(*R" },
+ { "Sigma", "\\(*S" },
+ { "Tau", "\\(*T" },
+ { "Theta", "\\(*H" },
+ { "Upsilon", "\\(*U" },
+ { "Xi", "\\(*C" },
+ { "Zeta", "\\(*Z" },
+ { "alpha", "\\(*a" },
+ { "beta", "\\(*b" },
+ { "chi", "\\(*x" },
+ { "delta", "\\(*d" },
+ { "epsilon", "\\(*e" },
+ { "eta", "\\(*y" },
+ { "gamma", "\\(*g" },
+ { "iota", "\\(*i" },
+ { "kappa", "\\(*k" },
+ { "lambda", "\\(*l" },
+ { "mu", "\\(*m" },
+ { "nu", "\\(*n" },
+ { "omega", "\\(*w" },
+ { "omicron", "\\(*o" },
+ { "phi", "\\(*f" },
+ { "pi", "\\(*p" },
+ { "psi", "\\(*q" },
+ { "rho", "\\(*r" },
+ { "sigma", "\\(*s" },
+ { "tau", "\\(*t" },
+ { "theta", "\\(*h" },
+ { "upsilon", "\\(*u" },
+ { "xi", "\\(*c" },
+ { "zeta", "\\(*z" },
+ { "max", "{type \"operator\" roman \"max\"}" },
+ { "min", "{type \"operator\" roman \"min\"}" },
+ { "lim", "{type \"operator\" roman \"lim\"}" },
+ { "sin", "{type \"operator\" roman \"sin\"}" },
+ { "cos", "{type \"operator\" roman \"cos\"}" },
+ { "tan", "{type \"operator\" roman \"tan\"}" },
+ { "sinh", "{type \"operator\" roman \"sinh\"}" },
+ { "cosh", "{type \"operator\" roman \"cosh\"}" },
+ { "tanh", "{type \"operator\" roman \"tanh\"}" },
+ { "arc", "{type \"operator\" roman \"arc\"}" },
+ { "log", "{type \"operator\" roman \"log\"}" },
+ { "ln", "{type \"operator\" roman \"ln\"}" },
+ { "exp", "{type \"operator\" roman \"exp\"}" },
+ { "Re", "{type \"operator\" roman \"Re\"}" },
+ { "Im", "{type \"operator\" roman \"Im\"}" },
+ { "det", "{type \"operator\" roman \"det\"}" },
+ { "and", "{roman \"and\"}" },
+ { "if", "{roman \"if\"}" },
+ { "for", "{roman \"for\"}" },
+ { "sum", "{type \"operator\" vcenter size +5 \\(*S}" },
+ { "prod", "{type \"operator\" vcenter size +5 \\(*P}" },
+ { "int", "{type \"operator\" vcenter size +8 \\(is}" },
+ { "union", "{type \"operator\" vcenter size +5 \\(cu}" },
+ { "inter", "{type \"operator\" vcenter size +5 \\(ca}" },
+ { "times", "type \"binary\" \\(mu" },
+ { "ldots", "type \"inner\" { . . . }" },
+ { "inf", "\\(if" },
+ { "partial", "\\(pd" },
+ { "nothing", "\"\"" },
+ { "half", "{1 smallover 2}" },
+ { "hat_def", "roman \"^\"" },
+ { "hat", "accent { hat_def }" },
+ { "dot_def", "back 15 \"\\v'-52M'.\\v'52M'\"" },
+ { "dot", "accent { dot_def }" },
+ { "dotdot_def", "back 25 \"\\v'-52M'..\\v'52M'\"" },
+ { "dotdot", "accent { dotdot_def }" },
+ { "tilde_def", "\"~\"" },
+ { "tilde", "accent { tilde_def }" },
+ { "utilde_def", "\"\\v'75M'~\\v'-75M'\"" },
+ { "utilde", "uaccent { utilde_def }" },
+ { "vec_def", "up 52 size -5 \\(->" },
+ { "vec", "accent { vec_def }" },
+ { "dyad_def", "up 52 size -5 {\\(<- back 60 \\(->}" },
+ { "dyad", "accent { dyad_def }" },
+ { "==", "type \"relation\" \\(==" },
+ { "!=", "type \"relation\" \\(!=" },
+ { "+-", "type \"binary\" \\(+-" },
+ { "->", "type \"relation\" \\(->" },
+ { "<-", "type \"relation\" \\(<-" },
+ { "<<", "{ < back 20 < }" },
+ { ">>", "{ > back 20 > }" },
+ { "...", "type \"inner\" vcenter { . . . }" },
+ { "prime", "'" },
+ { "approx", "type \"relation\" \"\\(~=\"" },
+ { "grad", "\\(gr" },
+ { "del", "\\(gr" },
+ { "cdot", "type \"binary\" vcenter ." },
+ { "dollar", "$" },
};
void init_table(const char *device)
@@ -465,7 +465,7 @@ int top_input::get_location(char **fnp, int *lnp)
return 1;
}
-// Character respresenting $1. Must be illegal input character.
+// Character representing $1. Must be illegal input character.
#define ARG1 14
argument_macro_input::argument_macro_input(const char *body, int ac,
diff --git a/eqn/main.cc b/eqn/main.cc
index cfc25f236..534b7f86d 100644
--- a/eqn/main.cc
+++ b/eqn/main.cc
@@ -348,5 +348,5 @@ int main(int argc, char **argv)
}
if (ferror(stdout) || fflush(stdout) < 0)
fatal("output error");
- exit(0);
+ return 0;
}
diff --git a/eqn/sqrt.cc b/eqn/sqrt.cc
index 5ec05a098..3488d0311 100644
--- a/eqn/sqrt.cc
+++ b/eqn/sqrt.cc
@@ -41,10 +41,10 @@ sqrt_box::sqrt_box(box *pp) : pointer_box(pp)
}
#define SQRT_CHAR "\\(sr"
-#define RADICAL_EXTENSION_CHAR "\\(rn"
+#define RADICAL_EXTENSION_CHAR "\\[radicalex]"
#define SQRT_CHAIN "\\[sr\\\\n[" INDEX_REG "]]"
-#define BAR_CHAIN "\\[rn\\\\n[" INDEX_REG "]]"
+#define BAR_CHAIN "\\[radicalex\\\\n[" INDEX_REG "]]"
int sqrt_box::compute_metrics(int style)
{
diff --git a/grodvi/dvi.cc b/grodvi/dvi.cc
index c3ae76ee6..6064143de 100644
--- a/grodvi/dvi.cc
+++ b/grodvi/dvi.cc
@@ -884,7 +884,7 @@ int main(int argc, char **argv)
do_file(argv[i]);
}
delete pr;
- exit(0);
+ return 0;
}
static void usage()
diff --git a/grodvi/grodvi.man b/grodvi/grodvi.man
index fe1fced70..f51f3e7a8 100644
--- a/grodvi/grodvi.man
+++ b/grodvi/grodvi.man
@@ -120,7 +120,7 @@ for font and device description files.
.SH FILES
.TP
.B @FONTDIR@/devdvi/DESC
-Device desciption file.
+Device description file.
.TP
.B @FONTDIR@/devdvi/ F
Font description file for font
diff --git a/groff/groff.cc b/groff/groff.cc
index 078091315..8ef9262ba 100644
--- a/groff/groff.cc
+++ b/groff/groff.cc
@@ -50,8 +50,6 @@ extern "C" {
}
#endif /* not STDLIB_H_DECLARES_PUTENV */
-const char *strsignal(int);
-
const int SOELIM_INDEX = 0;
const int REFER_INDEX = SOELIM_INDEX + 1;
const int PIC_INDEX = REFER_INDEX + 1;
@@ -309,7 +307,7 @@ int main(int argc, char **argv)
print_commands();
exit(0);
}
- exit(run_commands());
+ return run_commands();
}
const char *basename(const char *s)
diff --git a/groff/pipeline.c b/groff/pipeline.c
index 0172a1745..1203638b3 100644
--- a/groff/pipeline.c
+++ b/groff/pipeline.c
@@ -94,9 +94,10 @@ extern char *strerror();
#define error c_error
extern void error P((char *, char *, char *, char *));
+extern void c_fatal P((char *, char *, char *, char *));
static void sys_fatal P((char *));
-static char *strsignal P((int));
+static char *xstrsignal P((int));
static char *itoa P((int));
int run_pipeline(ncommands, commands)
@@ -191,7 +192,7 @@ int run_pipeline(ncommands, commands)
{
error("%1: %2%3",
commands[i][0],
- strsignal(sig),
+ xstrsignal(sig),
WCOREDUMP(status) ? " (core dumped)" : "");
ret |= 2;
}
@@ -226,7 +227,7 @@ static char *itoa(n)
return buf;
}
-static char *strsignal(n)
+static char *xstrsignal(n)
int n;
{
static char buf[sizeof("Signal ") + 1 + sizeof(int)*3];
diff --git a/grog/grog.man b/grog/grog.man
index bf2718325..82641654e 100644
--- a/grog/grog.man
+++ b/grog/grog.man
@@ -39,7 +39,7 @@ For example,
.IP
.B `grog \-Tdvi paper.ms`
.LP
-will guess the approriate command to print
+will guess the appropriate command to print
.B paper.ms
and then run it after adding the
.B \-Tdvi
diff --git a/grops/TODO b/grops/TODO
index 4d1e5fd61..da67973a2 100644
--- a/grops/TODO
+++ b/grops/TODO
@@ -2,6 +2,10 @@ Read PFB files directly.
Generate %%DocumentMedia comment.
+Generate %%For comment.
+
+Generate %%Title comment.
+
For efficiency it might be better to have the printer interface have
support for the t and u commands.
diff --git a/grops/grops.man b/grops/grops.man
index 5da1e6f3f..7a2d0bd90 100644
--- a/grops/grops.man
+++ b/grops/grops.man
@@ -335,7 +335,7 @@ There are also some special fonts called
.B SS
and
.BR S .
-Zapf Dingbats is avilable as
+Zapf Dingbats is available as
.BR ZD
and a reversed version of ZapfDingbats (with symbols pointing in the opposite
direction) is available as
@@ -381,7 +381,15 @@ will draw a horizontal line one inch long.
may make changes to the graphics state,
but any changes will persist only to the
end of the page.
-Any definitions will also persist only until the end of the page.
+A dictionary containing the definitions specified by the
+.B def
+and
+.B mdef
+will be on top of the dictionary stack.
+If your code adds definitions to this dictionary,
+you should allocate space for them using
+.BI \eX'ps\ mdef \ n '\fR.
+Any definitions will persist only until the end of the page.
If you use the
.B \eY
escape sequence with an argument that names a macro,
@@ -446,7 +454,7 @@ definitions.
needs to know how many definitions
.I code
contains
-so that it can create an apppropriately sized PostScript dictionary
+so that it can create an appropriately sized PostScript dictionary
to contain them.
.TP
.BI \eX'ps:\ import\ file\ llx\ lly\ urx\ ury\ width\ \fR[\fP\ height\ \fR]\fP '
@@ -511,7 +519,8 @@ is run by the groff command) include a
macro which allows a picture to be easily imported.
This has the format
.IP
-.BI .PSPIC\ file\ \fR[ width\ \fR[ height \fR]]
+\&\fB.PSPIC\fP \fI\|file\fP [ \fB\-L\fP | \fB-R\fP | \fB\-I\fP \fIn\fP ]\
+[ \fIwidth\fP [ \fIheight\fP ]]
.LP
.I file
is the name of the file containing the illustration;
@@ -533,6 +542,17 @@ wide
and
.I height
high.
+By default, the graphic will be horizontally centered.
+The
+.BI \-L
+and
+.BI \-R
+cause the graphic to be left-aligned and right-aligned
+respectively.
+The
+.B \-I
+option causes the graphic to be indented by
+.IR n .
.RE
.TP
.B \eX'ps:\ invis'
@@ -751,7 +771,7 @@ should be used.
.SH FILES
.Tp \w'\fB@FONTDIR@/devps/download'u+2n
.B @FONTDIR@/devps/DESC
-Device desciption file.
+Device description file.
.TP
.BI @FONTDIR@/devps/ F
Font description file for font
diff --git a/grops/ps.cc b/grops/ps.cc
index 1dd5d8c77..2a78981d5 100644
--- a/grops/ps.cc
+++ b/grops/ps.cc
@@ -23,6 +23,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "cset.h"
#include "ps.h"
+#include <time.h>
static int landscape_flag = 0;
static int ncopies = 1;
@@ -36,6 +37,7 @@ static int bflag = 0;
unsigned broken_flags = 0;
#define DEFAULT_LINEWIDTH 40 /* in ems/1000 */
+#define MAX_LINE_LENGTH 72
#define FILL_MAX 1000
const char *const dict_name = "grops";
@@ -44,12 +46,12 @@ const int DEFS_DICT_SPARE = 50;
double degrees(double r)
{
- return r*180.0/M_PI;
+ return r*180.0/PI;
}
double radians(double d)
{
- return d*M_PI/180.0;
+ return d*PI/180.0;
}
inline double transform_fill(int fill)
@@ -57,6 +59,15 @@ inline double transform_fill(int fill)
return 1 - fill/double(FILL_MAX);
}
+// This is used for testing whether a character should be output in the
+// PostScript file using \nnn, so we really want the character to be
+// less than 0200.
+
+inline int is_ascii(char c)
+{
+ return (unsigned char)c < 0200;
+}
+
ps_output::ps_output(FILE *f, int n)
: fp(f), max_line_length(n), col(0), need_space(0), fixed_point(0)
{
@@ -174,7 +185,7 @@ ps_output &ps_output::put_string(const char *s, int n)
int len = 0;
for (int i = 0; i < n; i++) {
char c = s[i];
- if (isascii(c) && isprint(c)) {
+ if (is_ascii(c) && csprint(c)) {
if (c == '(' || c == ')' || c == '\\')
len += 2;
else
@@ -218,7 +229,7 @@ ps_output &ps_output::put_string(const char *s, int n)
col++;
for (i = 0; i < n; i++) {
char c = s[i];
- if (isascii(c) && isprint(c)) {
+ if (is_ascii(c) && csprint(c)) {
if (c == '(' || c == ')' || c == '\\')
len = 2;
else
@@ -503,7 +514,7 @@ ps_printer::ps_printer()
sbuf_len(0),
output_hpos(-1),
output_vpos(-1),
- out(0, 79),
+ out(0, MAX_LINE_LENGTH),
ndefined_styles(0),
next_encoding_index(0),
line_thickness(-1),
@@ -624,16 +635,6 @@ void ps_printer::set_char(int i, font *f, const environment *env, int w)
sbuf_kern = 0;
}
-int is_small_h(int n)
-{
- return n < (font::res*2)/72 && n > -(font::res*10)/72;
-}
-
-int is_small_v(int n)
-{
- return n < (font::res*4)/72 && n > -(font::res*4)/72;
-}
-
static char *make_encoding_name(int encoding_index)
{
static char buf[3 + INT_DIGITS + 1];
@@ -656,7 +657,7 @@ void ps_printer::define_encoding(const char *encoding, int encoding_index)
char buf[256];
while (fgets(buf, 512, fp) != 0) {
char *p = buf;
- while (isascii(*p) && isspace(*p))
+ while (csspace(*p))
p++;
if (*p != '#' && *p != '\0' && (p = strtok(buf, WS)) != 0) {
char *q = strtok(0, WS);
@@ -783,9 +784,7 @@ void ps_printer::flush_sbuf()
output_style = sbuf_style;
}
int extra_space = 0;
- if (output_hpos < 0 || output_vpos < 0
- || !is_small_h(output_hpos - sbuf_start_hpos)
- || !is_small_v(output_vpos - sbuf_vpos))
+ if (output_hpos < 0 || output_vpos < 0)
motion = ABSOLUTE;
else {
if (output_hpos != sbuf_start_hpos)
@@ -1111,6 +1110,16 @@ ps_printer::~ps_printer()
.comment_arg(version_string)
.end_comment();
}
+ {
+ fputs("%%CreationDate: ", out.get_file());
+#ifdef LONG_FOR_TIME_T
+ long
+#else
+ time_t
+#endif
+ t = time(0);
+ fputs(ctime(&t), out.get_file());
+ }
for (font_pointer_list *f = font_list; f; f = f->next) {
ps_font *psf = (ps_font *)(f->p);
rm.need_font(psf->get_internal_name());
@@ -1185,13 +1194,13 @@ void ps_printer::special(char *arg, const environment *env)
const char *name;
SPECIAL_PROCP proc;
} proc_table[] = {
- "exec", &ps_printer::do_exec,
- "def", &ps_printer::do_def,
- "mdef", &ps_printer::do_mdef,
- "import", &ps_printer::do_import,
- "file", &ps_printer::do_file,
- "invis", &ps_printer::do_invis,
- "endinvis", &ps_printer::do_endinvis,
+ { "exec", &ps_printer::do_exec },
+ { "def", &ps_printer::do_def },
+ { "mdef", &ps_printer::do_mdef },
+ { "import", &ps_printer::do_import },
+ { "file", &ps_printer::do_file },
+ { "invis", &ps_printer::do_invis },
+ { "endinvis", &ps_printer::do_endinvis },
};
for (char *p = arg; *p == ' ' || *p == '\n'; p++)
;
@@ -1496,7 +1505,7 @@ int main(int argc, char **argv)
do_file(argv[i]);
}
delete pr;
- exit(0);
+ return 0;
}
static void usage()
diff --git a/grops/psfig.diff b/grops/psfig.diff
index 77217742d..5be080ddd 100644
--- a/grops/psfig.diff
+++ b/grops/psfig.diff
@@ -3,7 +3,7 @@ version of psfig in comp.sources.unix/Volume11. After applying them,
psfig should be recompiled with -DGROFF. The resulting psfig will
work only with groff, so you might want to install it under a
different name. The output of this psfig must be processed using the
-macros in the file ../macros/tmac.psfig. These will automatically add
+macros in the file ../tmac/tmac.psfig. These will automatically add
the necessary PostScript code to the prologue output by grops. Use of
the `global' feature in psfig will result in non-conformant PostScript
which will fail if processed by a page reversal program. Note that
diff --git a/grops/psrm.cc b/grops/psrm.cc
index e26acf4b1..95492c7a1 100644
--- a/grops/psrm.cc
+++ b/grops/psrm.cc
@@ -879,22 +879,22 @@ void resource_manager::process_file(int rank, FILE *fp, const char *filename,
};
static comment_info comment_table[] = {
- "BeginResource:", &resource_manager::do_begin_resource,
- "IncludeResource:", &resource_manager::do_include_resource,
- "BeginDocument:", &resource_manager::do_begin_document,
- "IncludeDocument:", &resource_manager::do_include_document,
- "BeginProcSet:", &resource_manager::do_begin_procset,
- "IncludeProcSet:", &resource_manager::do_include_procset,
- "BeginFont:", &resource_manager::do_begin_font,
- "IncludeFont:", &resource_manager::do_include_font,
- "BeginFile:", &resource_manager::do_begin_file,
- "IncludeFile:", &resource_manager::do_include_file,
- "EndProcSet", &resource_manager::change_to_end_resource,
- "EndFont", &resource_manager::change_to_end_resource,
- "EndFile", &resource_manager::change_to_end_resource,
- "BeginPreview:", &resource_manager::do_begin_preview,
- "BeginData:", &resource_manager::do_begin_data,
- "BeginBinary:", &resource_manager::do_begin_binary,
+ { "BeginResource:", &resource_manager::do_begin_resource },
+ { "IncludeResource:", &resource_manager::do_include_resource },
+ { "BeginDocument:", &resource_manager::do_begin_document },
+ { "IncludeDocument:", &resource_manager::do_include_document },
+ { "BeginProcSet:", &resource_manager::do_begin_procset },
+ { "IncludeProcSet:", &resource_manager::do_include_procset },
+ { "BeginFont:", &resource_manager::do_begin_font },
+ { "IncludeFont:", &resource_manager::do_include_font },
+ { "BeginFile:", &resource_manager::do_begin_file },
+ { "IncludeFile:", &resource_manager::do_include_file },
+ { "EndProcSet", &resource_manager::change_to_end_resource },
+ { "EndFont", &resource_manager::change_to_end_resource },
+ { "EndFile", &resource_manager::change_to_end_resource },
+ { "BeginPreview:", &resource_manager::do_begin_preview },
+ { "BeginData:", &resource_manager::do_begin_data },
+ { "BeginBinary:", &resource_manager::do_begin_binary },
};
const int NCOMMENTS = sizeof(comment_table)/sizeof(comment_table[0]);
diff --git a/grotty/grotty.man b/grotty/grotty.man
index c3ba2d5cd..6b7e7471d 100644
--- a/grotty/grotty.man
+++ b/grotty/grotty.man
@@ -151,7 +151,7 @@ Print the version number.
.SH FILES
.TP
.B @FONTDIR@/devascii/DESC
-Device desciption file for
+Device description file for
.B ascii
device.
.TP
@@ -162,7 +162,7 @@ of
.B ascii device.
.TP
.B @FONTDIR@/devlatin1/DESC
-Device desciption file for
+Device description file for
.B latin1
device.
.TP
diff --git a/grotty/tty.cc b/grotty/tty.cc
index b44759934..087c19c1b 100644
--- a/grotty/tty.cc
+++ b/grotty/tty.cc
@@ -20,8 +20,12 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "driver.h"
-#ifndef USHRT_MAX
-#define USHRT_MAX 65535
+#ifndef SHRT_MIN
+#define SHRT_MIN (-32768)
+#endif
+
+#ifndef SHRT_MAX
+#define SHRT_MAX 32767
#endif
#define TAB_WIDTH 8
@@ -98,7 +102,7 @@ class glyph {
static glyph *free_list;
public:
glyph *next;
- unsigned short hpos;
+ short hpos;
unsigned char code;
unsigned char mode;
void *operator new(size_t);
@@ -175,12 +179,8 @@ void tty_printer::add_char(unsigned char c, int h, int v, unsigned char mode)
fatal("horizontal position not a multiple of horizontal resolution");
#endif
int hpos = h / font::hor;
- if (hpos < 0) {
- error("character to the left of first column discarded");
- return;
- }
- if (hpos > USHRT_MAX) {
- error("character with ridiculously large horizontal position discarded");
+ if (hpos < SHRT_MIN || hpos > SHRT_MAX) {
+ error("character with ridiculous horizontal position discarded");
return;
}
int vpos;
@@ -219,7 +219,7 @@ void tty_printer::add_char(unsigned char c, int h, int v, unsigned char mode)
// in order of occurrence.
for (glyph **pp = lines + (vpos - 1); *pp; pp = &(*pp)->next)
- if (int((*pp)->hpos) < hpos
+ if ((*pp)->hpos < hpos
|| ((*pp)->hpos == hpos && (*pp)->draw_mode() >= g->draw_mode()))
break;
@@ -313,21 +313,23 @@ void tty_printer::end_page(int page_length)
if (!overstrike_flag)
continue;
}
- if (hpos > int(p->hpos)) {
- putchar('\b');
- hpos--;
+ if (hpos > p->hpos) {
+ do {
+ putchar('\b');
+ hpos--;
+ } while (hpos > p->hpos);
}
else {
if (horizontal_tab_flag) {
for (;;) {
int next_tab_pos = ((hpos + TAB_WIDTH) / TAB_WIDTH) * TAB_WIDTH;
- if (next_tab_pos > int(p->hpos))
+ if (next_tab_pos > p->hpos)
break;
putchar('\t');
hpos = next_tab_pos;
}
}
- for (; hpos < int(p->hpos); hpos++)
+ for (; hpos < p->hpos; hpos++)
putchar(' ');
}
assert(hpos == p->hpos);
@@ -428,7 +430,7 @@ int main(int argc, char **argv)
do_file(argv[i]);
}
delete pr;
- exit(0);
+ return 0;
}
static void usage()
diff --git a/include/assert.h b/include/assert.h
index 3963b4fb4..fe988ee3e 100644
--- a/include/assert.h
+++ b/include/assert.h
@@ -20,9 +20,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef ASSERT_H
#define ASSERT_H
-#ifdef __GNUG__
-volatile
-#endif
+
void assertion_failed(int, const char *);
inline void do_assert(int expr, int line, const char *file)
diff --git a/include/lib.h b/include/lib.h
index 2cee56719..3ca1557bd 100644
--- a/include/lib.h
+++ b/include/lib.h
@@ -19,12 +19,14 @@ with groff; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
extern "C" {
+#ifndef strerror
char *strerror(int);
+#endif
#ifndef __BORLANDC__
const char *itoa(int);
const char *iftoa(int, int);
#endif /* __BORLANDC__ */
-};
+}
#ifdef STDLIB_H_DECLARES_GETOPT
#include <stdlib.h>
@@ -53,6 +55,18 @@ int is_prime(unsigned);
FILE *xtmpfile();
+#ifndef STDIO_H_DECLARES_POPEN
+
+extern "C" { FILE *popen(const char *, const char *); }
+
+#endif /* not STDIO_H_DECLARES_POPEN */
+
+#ifndef STDIO_H_DECLARES_PCLOSE
+
+extern "C" { int pclose (FILE *); }
+
+#endif /* not STDIO_H_DECLARES_PCLOSE */
+
int interpret_lf_args(const char *p);
extern char illegal_char_table[];
@@ -91,6 +105,12 @@ inline int illegal_input_char(int c)
#define INT_DIGITS 10
+#ifdef PI
+#undef PI
+#endif
+
+const double PI = 3.14159265358979323846;
+
/* ad_delete deletes an array of objects with destructors;
a_delete deletes an array of objects without destructors */
diff --git a/include/posix.h b/include/posix.h
index fc76d90bf..d3ff8f552 100644
--- a/include/posix.h
+++ b/include/posix.h
@@ -22,10 +22,10 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <sys/stat.h>
#include <fcntl.h>
-#ifdef HAVE_CC_UNISTD_H
-#include <unistd.h>
-#else
+#ifdef HAVE_CC_OSFCN_H
#include <osfcn.h>
+#else
+#include <unistd.h>
#endif
#ifndef S_IRUSR
diff --git a/include/stringclass.h b/include/stringclass.h
index 570f47ac7..cf4da4bac 100644
--- a/include/stringclass.h
+++ b/include/stringclass.h
@@ -22,6 +22,19 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdio.h>
#include <assert.h>
+// Ensure that the first declaration of functions that are later
+// declared as inline declares them as inline.
+
+class string;
+
+inline string operator+(const string &, const string &);
+inline string operator+(const string &, const char *);
+inline string operator+(const char *, const string &);
+inline string operator+(const string &, char);
+inline string operator+(char, const string &);
+inline int operator==(const string &, const string &);
+inline int operator!=(const string &, const string &);
+
class string {
public:
string();
@@ -57,14 +70,14 @@ public:
void clear();
void move(string &);
- friend inline string operator+(const string &, const string &);
- friend inline string operator+(const string &, const char *);
- friend inline string operator+(const char *, const string &);
- friend inline string operator+(const string &, char);
- friend inline string operator+(char, const string &);
-
- friend inline int operator==(const string &, const string &);
- friend inline int operator!=(const string &, const string &);
+ friend string operator+(const string &, const string &);
+ friend string operator+(const string &, const char *);
+ friend string operator+(const char *, const string &);
+ friend string operator+(const string &, char);
+ friend string operator+(char, const string &);
+
+ friend int operator==(const string &, const string &);
+ friend int operator!=(const string &, const string &);
friend int operator<=(const string &, const string &);
friend int operator<(const string &, const string &);
friend int operator>=(const string &, const string &);
diff --git a/indxbib/indxbib.cc b/indxbib/indxbib.cc
index b2d1a263a..c69142cfc 100644
--- a/indxbib/indxbib.cc
+++ b/indxbib/indxbib.cc
@@ -286,7 +286,7 @@ int main(int argc, char **argv)
fatal("can't unlink temporary index file: %1", strerror(errno));
#endif /* not HAVE_RENAME */
temp_index_file = 0;
- exit(failed);
+ return failed;
}
static void usage()
@@ -700,8 +700,9 @@ static void write_hash_table()
if (sizeof(table_entry) == sizeof(int))
fwrite_or_die(hash_table, sizeof(int), hash_table_size, indxfp);
else {
- assert(0);
// write it out word by word
+ for (int i = 0; i < hash_table_size; i++)
+ fwrite_or_die(&hash_table[i].count, sizeof(int), 1, indxfp);
}
fwrite_or_die(filenames.contents(), 1, filenames.length(), indxfp);
if (fseek(indxfp, 0, 0) < 0)
diff --git a/libbib/index.cc b/libbib/index.cc
index 8fe5acdae..1766849d5 100644
--- a/libbib/index.cc
+++ b/libbib/index.cc
@@ -136,10 +136,14 @@ public:
file_closer(int &fd) : fdp(&fd) { }
~file_closer() { close(*fdp); }
};
-
+
+// Tell the compiler that a variable is intentionally unused.
+inline void unused(void *) { }
+
int index_search_item::load(int fd)
{
file_closer fd_closer(fd); // close fd on return
+ unused(&fd_closer);
struct stat sb;
if (fstat(fd, &sb) < 0) {
error("can't fstat `%1': %2", name, strerror(errno));
@@ -385,7 +389,7 @@ int index_search_item_iterator::get_tag(int tagno,
error("can't stat `%1': %2", filename, strerror(errno));
err = 1;
}
- else if ((sb.st_mode & S_IFMT) != S_IFREG) {
+ else if (!S_ISREG(sb.st_mode)) {
error("`%1' is not a regular file", filename);
err = 1;
}
diff --git a/libbib/linear.cc b/libbib/linear.cc
index 079800821..2aa0584b7 100644
--- a/libbib/linear.cc
+++ b/libbib/linear.cc
@@ -132,7 +132,7 @@ const char *bmpattern::search(const char *buf, const char *end) const
for (;;) {
if (j == 0)
return s;
- if (map[uchar(*--s)] != pattern[--j])
+ if (map[uchar(*--s)] != uchar(pattern[--j]))
break;
}
k++;
@@ -301,13 +301,13 @@ int file_buffer::load(int fd, const char *filename)
struct stat sb;
if (fstat(fd, &sb) < 0)
error("can't fstat `%1': %2", filename, strerror(errno));
- else if ((sb.st_mode & S_IFMT) != S_IFREG)
+ else if (!S_ISREG(sb.st_mode))
error("`%1' is not a regular file", filename);
else {
// We need one character extra at the beginning for an additional newline
// used as a sentinel. We get 4 instead so that the read buffer will be
// word-aligned. This seems to make the read slightly faster. We also
- // need one character at the end also for an addional newline used as a
+ // need one character at the end also for an additional newline used as a
// sentinel.
int size = int(sb.st_size);
buffer = new char[size + 4 + 1];
diff --git a/libdriver/input.cc b/libdriver/input.cc
index d046e864e..c44fdbee6 100644
--- a/libdriver/input.cc
+++ b/libdriver/input.cc
@@ -20,6 +20,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "driver.h"
#include "device.h"
+#include "cset.h"
const char *current_filename;
int current_lineno;
@@ -168,7 +169,7 @@ void do_file(const char *filename)
case '9':
{
int c = get_char();
- if (!isascii(c) || !isdigit(c))
+ if (!csdigit(c))
fatal("digit expected");
env.hpos += (command - '0')*10 + (c - '0');
}
@@ -370,7 +371,7 @@ int get_integer()
neg = 1;
c = get_char();
}
- if (!isascii(c) || !isdigit(c))
+ if (!csdigit(c))
fatal("integer expected");
int total = 0;
do {
@@ -380,7 +381,7 @@ int get_integer()
else
total += c - '0';
c = get_char();
- } while (isascii(c) && isdigit(c));
+ } while (csdigit(c));
if (c != EOF)
ungetc(c, current_file);
return total;
@@ -396,7 +397,7 @@ int possibly_get_integer(int *res)
neg = 1;
c = get_char();
}
- if (!isascii(c) || !isdigit(c)) {
+ if (!csdigit(c)) {
if (c != EOF)
ungetc(c, current_file);
return 0;
@@ -409,7 +410,7 @@ int possibly_get_integer(int *res)
else
total += c - '0';
c = get_char();
- } while (isascii(c) && isdigit(c));
+ } while (csdigit(c));
if (c != EOF)
ungetc(c, current_file);
*res = total;
diff --git a/libgroff/assert.cc b/libgroff/assert.cc
index 39ec2c91d..ed39dbad7 100644
--- a/libgroff/assert.cc
+++ b/libgroff/assert.cc
@@ -23,9 +23,6 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
extern const char *program_name;
-#ifdef __GNUG__
-volatile
-#endif
void assertion_failed(int lineno, const char *filename)
{
if (program_name != 0)
diff --git a/libgroff/cmap.cc b/libgroff/cmap.cc
index 4b1a43e22..ce834cca0 100644
--- a/libgroff/cmap.cc
+++ b/libgroff/cmap.cc
@@ -24,9 +24,10 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
cmap cmlower(CMAP_BUILTIN);
cmap cmupper(CMAP_BUILTIN);
+#ifdef isascii
#define ISASCII(c) isascii(c)
-#if 0
-#define ISASCII(c) 1 /* use this is you have an ANSI ctype.h */
+#else
+#define ISASCII(c) (1)
#endif
cmap::cmap()
diff --git a/libgroff/cset.cc b/libgroff/cset.cc
index 9fe44d9b7..fcba1642e 100644
--- a/libgroff/cset.cc
+++ b/libgroff/cset.cc
@@ -33,9 +33,10 @@ cset csprint(CSET_BUILTIN);
cset csgraph(CSET_BUILTIN);
cset cscntrl(CSET_BUILTIN);
+#ifdef isascii
#define ISASCII(c) isascii(c)
-#if 0
-#define ISASCII(c) 1 /* use this is you have an ANSI ctype.h */
+#else
+#define ISASCII(c) (1)
#endif
void cset::clear()
diff --git a/libgroff/font.cc b/libgroff/font.cc
index f360d4bc6..55c772d2c 100644
--- a/libgroff/font.cc
+++ b/libgroff/font.cc
@@ -207,7 +207,7 @@ inline int font::scale(int w, int sz)
int font::get_skew(int c, int point_size, int sl)
{
int h = get_height(c, point_size);
- return int(h*tan((slant+sl)*M_PI/180.0) + .5);
+ return int(h*tan((slant+sl)*PI/180.0) + .5);
}
int font::contains(int c)
@@ -700,16 +700,16 @@ static struct {
const char *command;
int *ptr;
} table[] = {
- "res", &font::res,
- "hor", &font::hor,
- "vert", &font::vert,
- "unitwidth", &font::unitwidth,
- "paperwidth", &font::paperwidth,
- "paperlength", &font::paperlength,
- "spare1", &font::biggestfont,
- "biggestfont", &font::biggestfont,
- "spare2", &font::spare2,
- "sizescale", &font::sizescale
+ { "res", &font::res },
+ { "hor", &font::hor },
+ { "vert", &font::vert },
+ { "unitwidth", &font::unitwidth },
+ { "paperwidth", &font::paperwidth },
+ { "paperlength", &font::paperlength },
+ { "spare1", &font::biggestfont },
+ { "biggestfont", &font::biggestfont },
+ { "spare2", &font::spare2 },
+ { "sizescale", &font::sizescale }
};
@@ -870,7 +870,7 @@ int font::load_desc()
return 0;
}
if (font_name_table == 0) {
- t.error("missing `fonts' commmand");
+ t.error("missing `fonts' command");
return 0;
}
if (sizes == 0) {
diff --git a/libgroff/new.cc b/libgroff/new.cc
index f85767b45..21b533e49 100644
--- a/libgroff/new.cc
+++ b/libgroff/new.cc
@@ -37,21 +37,23 @@ void *operator new(size_t size)
size++;
#ifdef COOKIE_BUG
char *p = (char *)malloc(unsigned(size + 8));
- if (p != 0) {
- ((unsigned *)p)[1] = 0;
- return p + 8;
- }
#else /* not COOKIE_BUG */
char *p = (char *)malloc(unsigned(size));
- if (p != 0)
- return p;
#endif /* not COOKIE_BUG */
- if (program_name) {
- ewrite(program_name);
- ewrite(": ");
+ if (p == 0) {
+ if (program_name) {
+ ewrite(program_name);
+ ewrite(": ");
+ }
+ ewrite("out of memory\n");
+ _exit(-1);
}
- ewrite("out of memory\n");
- _exit(-1);
+#ifdef COOKIE_BUG
+ ((unsigned *)p)[1] = 0;
+ return p + 8;
+#else /* not COOKIE_BUG */
+ return p;
+#endif /* not COOKIE_BUG */
}
#ifdef COOKIE_BUG
diff --git a/libgroff/strtol.c b/libgroff/strtol.c
index 4a1830f68..ffe354ed8 100644
--- a/libgroff/strtol.c
+++ b/libgroff/strtol.c
@@ -36,6 +36,12 @@ extern int errno;
#define LONG_MIN (-LONG_MAX-1)
#endif
+#ifdef isascii
+#define ISASCII(c) isascii(c)
+#else
+#define ISASCII(c) (1)
+#endif
+
long strtol(str, ptr, base)
char *str, **ptr;
int base;
@@ -46,7 +52,7 @@ long strtol(str, ptr, base)
char *p;
static char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
- while (isascii(*str) && isspace(*str))
+ while (ISASCII((unsigned char)*str) && isspace((unsigned char)*str))
str++;
if (*str == '-') {
@@ -70,7 +76,10 @@ long strtol(str, ptr, base)
else if (base == 16 && *str == '0' && (str[1] == 'x' || str[1] == 'X'))
str += 2;
- p = strchr(digits, isascii(*str) && isupper(*str) ? tolower(*str) : *str);
+ p = strchr(digits, (ISASCII((unsigned char)*str)
+ && isupper((unsigned char)*str)
+ ? tolower((unsigned char)*str)
+ : *str));
if (p == 0 || (val = (p - digits)) >= base) {
if (base == 16 && str > start && (str[-1] == 'x' || str[-1] == 'X')) {
if (ptr)
@@ -89,7 +98,9 @@ long strtol(str, ptr, base)
while (*++str != '\0') {
int n;
- p = strchr(digits, isascii(*str) && isupper(*str) ? tolower(*str) : *str);
+ p = strchr(digits, (ISASCII((unsigned char)*str)
+ && isupper((unsigned char)*str)
+ ? tolower((unsigned char)*str) : *str));
if (p == 0)
break;
n = p - digits;
diff --git a/lkbib/lkbib.cc b/lkbib/lkbib.cc
index a6d3e8fee..74459b730 100644
--- a/lkbib/lkbib.cc
+++ b/lkbib/lkbib.cc
@@ -39,7 +39,7 @@ static void usage()
exit(1);
}
-main(int argc, char **argv)
+int main(int argc, char **argv)
{
program_name = argv[0];
static char stderr_buf[BUFSIZ];
@@ -118,5 +118,5 @@ main(int argc, char **argv)
putchar('\n');
putchar('\n');
}
- exit(!count);
+ return !count;
}
diff --git a/lookbib/lookbib.cc b/lookbib/lookbib.cc
index fcb327735..e721e9454 100644
--- a/lookbib/lookbib.cc
+++ b/lookbib/lookbib.cc
@@ -43,7 +43,7 @@ static void usage()
exit(1);
}
-main(int argc, char **argv)
+int main(int argc, char **argv)
{
program_name = argv[0];
static char stderr_buf[BUFSIZ];
diff --git a/man/groff_font.man b/man/groff_font.man
index d62be03d0..a0b0cf481 100644
--- a/man/groff_font.man
+++ b/man/groff_font.man
@@ -151,7 +151,7 @@ are ligatures; possible ligatures are
.BR fl
and
.BR ffl .
-For backwards compatibiliy, the list of ligatures may be terminated
+For backwards compatibility, the list of ligatures may be terminated
with a
.BR 0.
The list of ligatures may not extend over more than one line.
@@ -260,7 +260,7 @@ if it starts with
.B 0x
or
.B 0X
-it will be intepreted as hexdecimal.
+it will be intepreted as hexadecimal.
.LP
Anything on the line after the code field will be ignored.
.LP
diff --git a/man/groff_out.man b/man/groff_out.man
index 9ad5389ba..209ee3d80 100644
--- a/man/groff_out.man
+++ b/man/groff_out.man
@@ -71,8 +71,8 @@ for drivers to search special fonts to find a character.
The
.B D
drawing command has been extended.
-These extensions will only be used by GNU pic if the
-.B \-x
+These extensions will not be used by GNU pic if the
+.B \-n
option is given.
.TP
\fBDf \fIn\fR\*(ic\en
diff --git a/mm/ChangeLog b/mm/ChangeLog
index 389777fa8..1eb5be4fd 100644
--- a/mm/ChangeLog
+++ b/mm/ChangeLog
@@ -1,7 +1,43 @@
+Tue Sep 7 08:37:00 1993 Jörgen Hägg (jh at efd.lth.se)
+
+ * version 1.19
+ * .lt is called in the header for .TP also.
+ * Variable Pgps added to control the header and footer point-size.
+ * Error-text printed with .APP removed.
+ * Error with .FG, .TB, .EC and .EX indentation fixed.
+ * header and footer line-length is not changed by MC or 2C.
+ * Default for page-length and page-offset is now taken from
+ \n[.p] and \n[.o].
+ * Argument to .ab (abort) is supplied.
+ * Argument to .1C added.
+ * Argument to .PGFORM added.
+ * RP/RS/RF totally rewritten. Should work with 2C now.
+
+Fri Apr 23 10:37:25 1993 Joergen Haegg (jh at efd.lth.se)
+
+ * version 1.18
+ * Height of display is now more exactly calculated.
+ * tabs and blankspaces where wrong in .VERBON.
+ * error in manual for escape-character in VERBON.
+ * Makefile.sub: installed tmac.m as tmac.m and tmac.mse
+ * Installation of tmac.mse now supports TMAC_M.
+ * bug with N fixed.
+
+Mon Apr 5 09:36:01 1993 Joergen Haegg (jh at efd.lth.se)
+
+ * version 1.17
+ * MULB preserves size.
+ * bug in VERBON fixed, causing strange errors.
+ * section-page footer fixed.
+ * added support for numberregister S
+ * fixed bug with floating displays wich made floats to
+ generate space on a page, but broke page anyway.
+ * end-of-page trap reinstalled.
+
Mon Mar 29 10:53:13 1993 Joergen Haegg (jh at efd.lth.se)
* version 1.16
- * MUL* now use the previus font and family.
+ * MUL* now use the previous font and family.
* extra blank page at end-of-text eliminated.
Mon Mar 8 10:27:47 1993 Joergen Haegg (jh at efd.lth.se)
diff --git a/mm/Makefile.sub b/mm/Makefile.sub
index a81fc0c43..25b5ba05a 100644
--- a/mm/Makefile.sub
+++ b/mm/Makefile.sub
@@ -20,7 +20,10 @@ install_m:
-test -d $(tmacdir) || mkdir $(tmacdir)
-rm -f $(tmacdir)/tmac.$(tmac_m)
$(INSTALL_DATA) $(srcdir)/tmac.m $(tmacdir)/tmac.$(tmac_m)
- $(INSTALL_DATA) $(srcdir)/tmac.m $(tmacdir)/tmac.$(tmac_m)se
+ @sed -e "s;^.mso tmac.m;.mso $(tmac_m);g" $(srcdir)/tmac.mse \
+ > $(tmacdir)/tmac.$(tmac_m)se
+
+
uninstall_sub:
-for f in $(FILES); do rm -f $(tmacdir)/mm/$$f; done
diff --git a/mm/groff_mm.man b/mm/groff_mm.man
index 291066734..0ef488bdb 100644
--- a/mm/groff_mm.man
+++ b/mm/groff_mm.man
@@ -32,6 +32,9 @@ english text to the preferred language. Use \fBm@TMAC_M@se\fP as an example.
.LP
Groff mm has several extensions:
.TP
+.B "1C [1]"
+Begin one column processing. An \fB1\fP as argmunet disabled the page-break.
+.TP
.B "APP name text"
Begin an appendix with name \fIname\fP. Automatic naming occurs if
\fIname\fP is "". The appendixes starts with \fBA\fP if auto is used.
@@ -116,14 +119,14 @@ Initialize the refencemacros. References will be written to
\fIfilename.tmp\fP and \fIfilename.qrf\fP. Requires two passes with groff.
The first looks for references and the second includes them.
\fBINITR\fP can be used several times, but it is only the first
-occurence of \fBINITR\fP that is active.
+occurrence of \fBINITR\fP that is active.
See also \fBSETR\fP, \fBGETPN\fP and \fBGETHN\fP.
.TP
.B "MC column-size [column-separation] "
Begin multiple columns. Return to normal with 1C.
.TP
.B "MT [arg [addressee]]"
-Memorandom type.
+Memorandum type.
The \fIarg\fP is part of a filename in \fI@TMAC_MDIR@/*.MT\fP.
Memorandum type 0 thru 5 are supported, including \fI"string"\fP.
\fIAddresse\fP just sets a variable, used in the AT&T macros.
@@ -149,12 +152,15 @@ Begin the next column. This is the only way to switch column.
.B "MULE"
End the multi-column mode and print the columns.
.TP
-.B "PGFORM [linelength [pagelength [pageoffset]]]"
+.B "PGFORM [linelength [pagelength [pageoffset [1]]]]"
Sets linelength, pagelength and/or pageoffset.
This macro can be used for special formatting, like letterheads
and other.
\fBPGFORM\fP can be used without arguments
to reset everything after a \fBMOVE\fP.
+A line-break is done unless the fourth argument is given.
+This can be used to avoid the pagenumber on the first page while setting
+new width and length.
.TP
.B PGNH
No header is printed on the next page. Used to get rid off
@@ -188,7 +194,7 @@ Description
.ti -.5i
1
.sp -1
-Enable the escape-character (\e). This is normally turned off during
+Disable the escape-character (\e). This is normally turned on during
verbose output.
.ti -.5i
2
@@ -268,6 +274,26 @@ Strings containing \fIJanuary\fI to \fIDecember\fP.
.B Qrf
String containing "See chapter \e\e*[Qrfh], page \e\en[Qrfp].".
.TP
+.B Pgps
+Controls whether header and footer pointsize should follow the current
+setting or just change when the header and footer is defined.
+.in +.5i
+.ti -.5i
+Value
+.sp -1
+Description
+.ti -.5i
+0
+.sp -1
+Pointsize will only change to the current setting when \fB.PH\fP, \fB.PF\fP,
+\&\fB.OH\fP, \fP.EH\fP, \fB.OF\fP or \fB.OE\fP is executed.
+.ti -.5i
+1
+.sp -1
+Pointsize will change after every \fB.S\fP. This is the default.
+.ti -.5i
+.in
+.TP
.B Sectf
Flag controlling "section-figures". A non-zero value enables this.
Se also register N.
@@ -287,9 +313,6 @@ possible to localize the macros with companyname and so on.
.LP
The following standard macros are implemented:
.TP
-.B 1C
-Begin one column processing
-.TP
.B 2C
Begin two column processing
.TP
@@ -389,8 +412,8 @@ Footnotes in displays is now possible.
.B "H level [heading-text [heading-suffix]]"
Numbered heading.
.TP
-.B "HC [hypenation-character]"
-Set hypenation character.
+.B "HC [hyphenation-character]"
+Set hyphenation character.
.TP
.B "HM [arg1 [arg2 [... [arg7]]]]"
Heading mark style.
@@ -435,7 +458,7 @@ List item
Marked list start
.TP
.B "MT [arg [addressee]]"
-Memorandom type. See above note about MT.
+Memorandum type. See above note about MT.
.TP
.B "ND new-date"
New date.
@@ -529,7 +552,7 @@ Table end.
Table header.
.TP
.B TL
-Begin title of memorandom.
+Begin title of memorandum.
.TP
.B TM [num1 [num2 [...]]]
Technical memorandumnumbers used in \fB.MT\fP. Unlimited number
@@ -537,6 +560,8 @@ of arguments may be given.
.TP
.B TP
Top of page user-defined macro.
+Note that header and footer is printed in a separate environment.
+Linelength is preserved though.
.TP
.B "TS [H]"
Table start
@@ -614,7 +639,7 @@ space before and after display if == 1 [0:1]
Eject page
.TP
.B Eq=0
-Eqation lable adjust 0=left, 1=right
+Equation lable adjust 0=left, 1=right
.TP
.B Fs=1
Footnote spacing
diff --git a/mm/mm/0.MT b/mm/mm/0.MT
index 1ac485984..02a423e1b 100644
--- a/mm/mm/0.MT
+++ b/mm/mm/0.MT
@@ -76,6 +76,7 @@ TM
.de cov@print-date
.MOVE 4.8c 13.3c
.S 8
+.nf
\\$1:
.br
.S
@@ -83,6 +84,7 @@ TM
.in 0.8c
.B "\\*[cov*new-date]"
.br
+.fi
.PGFORM
..
.\"------------
diff --git a/mm/mm/ms.cov b/mm/mm/ms.cov
index ee7511392..1c6621571 100644
--- a/mm/mm/ms.cov
+++ b/mm/mm/ms.cov
@@ -65,6 +65,7 @@
..
.\"-----------------
.de COVEND
+.br
.if d cov*default-firm .if !d cov*firm .ds cov*firm \\*[cov*default-firm]
.sp |4.2c
.cov@print-title
diff --git a/mm/tmac.m b/mm/tmac.m
index d37bdac0a..8c86a6074 100644
--- a/mm/tmac.m
+++ b/mm/tmac.m
@@ -1,5 +1,5 @@
.\" Version:
-.ds RE 1.16
+.ds RE 1.19
.ig
Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
@@ -47,7 +47,7 @@ Index array!index
.nr Ds 1
.\" Eject page
.nr Ej 0
-.\" Eqation lable adjust 0=left, 1=right
+.\" Equation lable adjust 0=left, 1=right
.nr Eq 0
.\" Em dash string
.ds EM \-
@@ -135,17 +135,24 @@ Index array!index
.\" .ds @language
.\"
.\" Current pointsize and vertical space, always in points.
-.nr @ps 10
-.nr @vs 12
+.ie r S \{\
+. nr @ps \n[S]
+. nr @vs \n[S]+2
+.\}
+.el \{\
+. nr @ps 10
+. nr @vs 12
+.\}
+.\"
.\" Page length
.ie r L .nr @pl \n[L]
-.el .nr @pl 11i
+.el .nr @pl \n[.p]
.\" page width
.ie r W .nr @ll \n[W]
.el .nr @ll 6i
.\" page offset
.ie r O .nr @po \n[O]
-.el .nr @po 1i
+.el .nr @po \n(.o
.\"
.\" cheating...
.pl \n[@pl]u
@@ -204,8 +211,10 @@ Index array!index
.ds MO12 December
.\" for GETR
.ds Qrf See chapter \\*[Qrfh], page \\*[Qrfp].
-.\" test for mgm macro. This can be used if the text must test
-.\" what macros is used.
+.\"
+.\" header- and footer-size will only change to the current
+.\" if Pgps is > 0.
+.nr Pgps 1
.\"
.\" section-page if Sectp > 0
.nr Sectp 0
@@ -222,6 +231,8 @@ Index array!index
.\" indent for VERBON
.nr Verbin 5n
.\"
+.\" test for mgm macro. This can be used if the text must test
+.\" what macros is used.
.nr .mgm 1
.\"
.\"---------------------------------------------
@@ -247,7 +258,7 @@ Index array!index
.tm ERROR:(\\n[.F]) input line \\n[.c]:\\$*
.if \\n[D] .backtrace
.tm ******************
-.ab
+.ab "Input aborted, syntax error"
..
.\" ####### module debug #################################
.de debug
@@ -383,11 +394,12 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.ta T 5n
..
.\"-------------
-.\" .PGFORM linelength [ pagelength [ pageoffset ] ]
+.\" .PGFORM linelength [ pagelength [ pageoffset [1]]]
.de PGFORM
.\" Break here to avoid problems with new linesetting of the previous line.
.\" Hope this doesn't break anything else :-)
-.br
+.\" Don't break if arg_4 is a '1'.
+.if ''\\$4' .br
.if !''\\$1' .nr @ll \\$1
.if !''\\$2' .nr @pl \\$2
.if !''\\$3' .nr @po \\$3
@@ -396,7 +408,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.po \\n[@po]u
.pl \\n[@pl]u
.nr @cur-ll \\n[@ll]
-.in 0
+'in 0
.pg@move-trap
..
.\"-------------
@@ -507,31 +519,33 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\" 0 escape on
.\" 1 add an empty line before verbose text
.\" 2 add an empty line after verbose text
-.\" 4 numbered lines (controlled by the string Verbnm)
-.\" 8 indent text by the numbervariable Verbin.
+.\" 3 numbered lines (controlled by the string Verbnm)
+.\" 4 indent text by the numbervariable Verbin.
.de VERBON
+.br
.nr misc*verb 0\\$1
.if (0\\n[misc*verb]%4)/2 .SP \\n[Lsp]u
-.br
.misc@ev-keep misc*verb-ev
.nf
.if (0\\n[misc*verb]%16)/8 .nm \\*[Verbnm]
.ie !'\\$3'' .ft \\$3
.el .ft CR
-.ss 12
-.ta T 8u*\w@n@u
-.if 0\\$2 \{\
+.ie 0\\$2 \{\
+. ss \\$2
. ps \\$2
. vs \\$2
.\}
+.el .ss 12
+.ta T 8u*\w@n@u
.if (0\\n[misc*verb]%32)/16 .in +\\n[Verbin]u
-.if !(0\\n[misc*verb]%2) \{\
+.if 0\\n[misc*verb]%2 \{\
. eo
. nr @verbose-flag 1 \" tell pageheader to set ec/eo
.\}
..
.de VERBOFF
.ec
+.br
.if (0\\n[misc*verb]%8)/4 .SP \\n[Lsp]u
.if (0\\n[misc*verb]%16)/8 .nm
.if (0\\n[misc*verb]%32)/16 .in
@@ -608,8 +622,8 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\" increment current counter
.nr H\\n[hd*level] +1
.\"
-.\" if level==1 -> prepare for new section.
-.if \\n[hd*level]=1 .rr hd*h1-page
+.\" update pagenumber if section-page is used
+.if \\n[hd*level]=1 .hd@set-page \\n[%]
.\"
.\"
.\" hd*mark is the text written to the left of the header.
@@ -745,26 +759,31 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\" set page-nr, called from header
.\"
.de hd@set-page
-.if !r hd*h1-page .nr hd*h1-page \\n[%]
+.if \\n[.$]>0 .nr hd*h1-page \\$1
.\"
.ie \\n[Sectp] .nr P \\n[%]-\\n[hd*h1-page]+1
.el .nr P \\n[%]
.\"
.\" Set section-page-string
.ds hd*sect-pg \\n[H1]-\\n[P]
+.if \\n[Sectp]>1 .if '\\n[H1]'0' .ds hd*sect-pg "
..
.\"########### module pg ####################
.\" set end of text trap
.wh 0 pg@header
.em pg@end-of-text
.\"
-.ie \n[N]=4 .ds pg*header ''''
-.el .ds pg*header ''- % -''
+.ds pg*header ''- % -''
+.ds pg*footer
+.if \n[N]=4 .ds pg*header ''''
+.if \n[N]=5 \{\
+. ds pg*header ''''
+. ds pg*footer ''\\*[hd*sect-pg]''
+.\}
.ds pg*even-footer
.ds pg*odd-footer
.ds pg*even-header
.ds pg*odd-header
-.ds pg*footer
.\"
.nr pg*top-margin 0
.nr pg*foot-margin 0
@@ -849,8 +868,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
. pg@set-env
. ie !d TP \{\
' sp 3
-. lt \\n[@ll]u
-. ie ((\\n[%]=1)&(\\n[N]=1):(\\n[N]=2)) .sp
+. ie ((\\n[%]=1)&((\\n[N]=1):(\\n[N]=2))) .sp
. el .tl \\*[pg*header]
. ie o .tl \\*[pg*odd-header]
. el .tl \\*[pg*even-header]
@@ -868,7 +886,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
. ft@check-old
. \"
. \" back to normal text processing
-. \" .pg@enable-trap
+. pg@enable-trap
. \" mark for multicolumn
. nr pg*head-mark \\n[nl]u
. \" set multicolumn
@@ -915,7 +933,6 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\" print the footer and eject new page
.ev pg*tl-ev
.pg@set-env
-.lt \\n[@ll]u
.ie o .tl \\*[pg*odd-footer]
.el .tl \\*[pg*even-footer]
.ie (\\n[%]=1)&(\\n[N]=1) .tl \\*[pg*header]
@@ -936,8 +953,15 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
'nh
'in 0
'ti 0
-'ps \\n[pg*ps]
-'vs \\n[pg*vs]
+.ie \\n[Pgps] \{\
+. ps \\n[@ps]
+. vs \\n[@vs]
+.\}
+.el \{\
+. ps \\n[pg*ps]
+. vs \\n[pg*vs]
+.\}
+.lt \\n[@ll]u
..
.\"-------------------------
.de PH
@@ -1058,6 +1082,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
. \}
.\}
..
+.\" An argument disables the page-break.
.de 1C
.br
.if \\n[pg*cols-per-page]<=1 .@error "1C: multicolumn mode not active"
@@ -1067,8 +1092,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.nr pg*cur-column 0 1
.nr pg*cur-po \\n[@po]u
.PGFORM
-.\".pg@next-page
-.SK
+.if !'\\$1'1' .SK
..
.de 2C
.br
@@ -1080,7 +1104,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.nr pg*cur-column 0 1
.nr pg*cur-po \\n[@po]u
.ll \\n[pg*column-size]u
-.lt \\n[pg*column-size]u
+.\" .lt \\n[pg*column-size]u
..
.\" MC column-size [ column-separation ]
.de MC
@@ -1096,7 +1120,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.nr pg*cur-column 0 1
.nr pg*cur-po \\n[@po]u
.ll \\n[pg*column-size]u
-.lt \\n[pg*column-size]u
+.\" .lt \\n[pg*column-size]u
..
.\" begin a new column
.de NCOL
@@ -1131,6 +1155,8 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.ds pg*mul-fam \\n[.fam]
.nr pg*mul-font \\n[.f]
.ev pg*mul-ev
+.ps \\n[@ps]
+.vs \\n[@vs]
.fam \\*[pg*mul-fam]
.ft \\n[pg*mul-font]
.fi
@@ -1438,8 +1464,13 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.br
.if \\n[ds*ffloat] .SP \\n[Lsp]u
.di
+.\" find out the real size of the diversion
+.di ds*test
+.ds*div!\\n[ds*snr]
+.di
.nr ds*width \\n[dl]
.nr ds*height \\n[dn]
+.rm ds*test
.misc@pop-nr ds-ll ds*old-ll
.misc@pop-nr ds-form ds*format
.misc@pop-nr ds-ffloat ds*ffloat
@@ -1488,7 +1519,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
. nr ds*fsize!\\n[ds*fnr] \\n[dn]
. \" print float if queue is empty and the display fits into
. \" the current page
-. if (\\n[ds*fnr]>\\n[ds*o-fnr])&(\\n[ds*height]<\\n[.t]) \{\
+. if ((\\n[ds*fnr]>\\n[ds*o-fnr])&(\\n[ds*height]<\\n[.t])) \{\
. ds@print-float 1
. \}
.\}
@@ -1521,7 +1552,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
. nr ds*float-busy 1
.\" at .DE
. if (\\$1=1)&((\\n[Df]%2)=1) \{\
-. if \\n[.t]>\\n[ds*fsize!\\n[ds*fnr]] \{\
+. if \\n[.t]>\\n[ds*fsize!\\n[ds*o-fnr]] \{\
. \" Df = 1,3 or 5
. ds@print-one-float
. \}
@@ -1645,6 +1676,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\"
.\" determine where the text begins
.nr li*text-begin \\n[li*tind]>?\w@\\*[li*c-mark]\ @
+.nr x \w@\\*[li*c-mark]\ @
.\"
.\" determine where the mark begin
.ie !\\n[li*pad] .nr li*in \\n[li*mind]
@@ -2085,7 +2117,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
\!.init@reset
\!.br
\!.ie (\w@\\$1\\$2@)>(\\n[.l]-\\n[.i]) \{\
-\!. in +\w@\\$1@u
+. in +\w@\\$1@u
\!. ti 0
\!.\}
\!.el .ce 1
@@ -2186,6 +2218,8 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\" jump to new environment.
.ev box*ev
.di box*div
+.ps \\n[@ps]
+.vs \\n[@vs]
.in 1n
.ll (u;\\n[box*wid]-1n)
.hy \\n[.hy]
@@ -2223,28 +2257,45 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.ds Rf \v'-.4m'\s-3[\\n+[ref*nr]]\s0\v'.4m'
.\"
.\" start reference
+.\"------------
.de RS
.if !''\\$1' .ds \\$1 \\n[ref*nr]
.nr ref*flag 1
-.ev ref*ev
-.da ref*div
-.init@reset
-.ll \\n[@ll]u
+.am ref*mac
+.ref@start-print \\n[ref*nr]
+\\..
+.eo
+.am ref*mac RF
+..
+.\"------------
+.de RF
+.ec
+.am ref*mac
+.ref@stop-print
+\\..
+..
+.\"------------
+.de ref@start-print
+.di ref*div
.in \\n[ref*nr-width]u
-.ti -(\w@\\n[ref*nr].@u+1n)
-\\n[ref*nr].
+.ti -(\w@\\$1.@u+1n)
+\\$1.
.sp -1
..
-.de RF
+.de ref@stop-print
.br
-.if \\n[Ls] .SP \\n[Lsp]u
.di
+.ne \\n[dn]u
+.ev ref*ev2
+.nf
+.ref*div
.ev
+.rm ref*div
+.if \\n[Ls] .SP \\n[Lsp]u
..
.\"-----------
.de RP
-.if !d ref*div .@error "RP: No references!"
-.nr ref*flag 0
+.if !d ref*mac .@error "RP: No references!"
.nr ref*i 0\\$2
.if \\n[ref*i]<2 .SK
.SP 2
@@ -2255,7 +2306,8 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\"-----------
.\" called by end-of-text!
.de ref@eot-print
-.if \\n[ref*flag] \{\
+.\".if \\n[ref*flag] \{
+.if d ref*mac \{\
. if \\n[D]>2 .tm Print references, called by eot
. nr ref*flag 0
. br
@@ -2271,15 +2323,16 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\" prints the references
.de ref@print-refs
.toc@save 1 "" "\\*[Rp]" \\n[%]
-.ev ref*ev
.ce
\fI\\*[Rp]\fP
.sp
+.nr ref*ll \\n[.l]
+.misc@ev-keep ref*ev
+.ll \\n[ref*ll]u
.in 0
-.nf
-.ref*div
+.ref*mac
.in
-.rm ref*div
+.rm ref*mac
.ev
..
.\"########################### module app ############################
diff --git a/mm/tmac.mse b/mm/tmac.mse
index 315d684d2..e84babfd9 100644
--- a/mm/tmac.mse
+++ b/mm/tmac.mse
@@ -1,5 +1,5 @@
.\" swedish version of mm
-.\" for mgm version 1.04
+.\" See tmac.m for version-information.
.mso tmac.m
.ds @language se
.\"
diff --git a/nroff/nroff.man b/nroff/nroff.man
index c64f8ea24..6f937d974 100644
--- a/nroff/nroff.man
+++ b/nroff/nroff.man
@@ -4,7 +4,10 @@
.SH SYNOPSIS
.B @g@nroff
[
-.B \-hi
+.B \-h
+]
+[
+.B \-i
]
[
.BI \-m name
@@ -44,14 +47,22 @@ is equivalent to the
.B grotty
.B \-h
option.
-Other options are as described in
+The
+.BR \-i ,
+.BR \-n ,
+.BR \-m ,
+.B \-o
+and
+.B \-r
+options have the effect described in
.BR @g@troff (@MAN1EXT@).
-In addition the
+In addition
+.B @g@nroff
+silently ignores options of
.BR \-e ,
.B \-q
-and
-.B \-s
-options are silently ignored.
+or
+.BR \-s .
.SH "SEE ALSO"
.BR groff (@MAN1EXT@),
.BR @g@troff (@MAN1EXT@),
diff --git a/nroff/nroff.sh b/nroff/nroff.sh
index 1be695995..7cc992feb 100755
--- a/nroff/nroff.sh
+++ b/nroff/nroff.sh
@@ -29,6 +29,10 @@ do
-T*)
# ignore other devices
;;
+ -u*)
+ # Solaris 2.2 `man' uses -u0; ignore it,
+ # since `less' and `more' can use the emboldening info.
+ ;;
--)
shift
break
diff --git a/pfbtops/pfbtops.c b/pfbtops/pfbtops.c
index bc79bce59..fb370ab79 100644
--- a/pfbtops/pfbtops.c
+++ b/pfbtops/pfbtops.c
@@ -3,8 +3,8 @@
#include <stdio.h>
/* Binary bytes per output line. */
-#define BYTES_PER_LINE (79/2)
-#define HEX_DIGITS "0123456789ABCDEF"
+#define BYTES_PER_LINE (64/2)
+#define HEX_DIGITS "0123456789abcdef"
static char *program_name;
diff --git a/pic/common.cc b/pic/common.cc
index 0f61c750e..817f1a988 100644
--- a/pic/common.cc
+++ b/pic/common.cc
@@ -419,6 +419,8 @@ void common_output::dot_line(const position &start, const position &end,
{
distance dist = end - start;
double length = hypot(dist);
+ if (length == 0.0)
+ return;
double pos = 0.0;
for (;;) {
if (*offsetp == 0.0)
diff --git a/pic/lex.cc b/pic/lex.cc
index a066533b5..33e243e14 100644
--- a/pic/lex.cc
+++ b/pic/lex.cc
@@ -154,7 +154,7 @@ int macro_input::peek()
return (unsigned char)*p;
}
-// Character respresenting $1. Must be illegal input character.
+// Character representing $1. Must be illegal input character.
#define ARG1 14
char *process_body(const char *body)
@@ -429,88 +429,88 @@ int lookup_keyword(const char *str, int len)
const char *name;
int token;
} table[] = {
- "Here", HERE,
- "above", ABOVE,
- "aligned", ALIGNED,
- "and", AND,
- "arc", ARC,
- "arrow", ARROW,
- "at", AT,
- "atan2", ATAN2,
- "below", BELOW,
- "between", BETWEEN,
- "bottom", BOTTOM,
- "box", BOX,
- "by", BY,
- "ccw", CCW,
- "center", CENTER,
- "chop", CHOP,
- "circle", CIRCLE,
- "command", COMMAND,
- "copy", COPY,
- "cos", COS,
- "cw", CW,
- "dashed", DASHED,
- "define", DEFINE,
- "diam", DIAMETER,
- "diameter", DIAMETER,
- "do", DO,
- "dotted", DOTTED,
- "down", DOWN,
- "ellipse", ELLIPSE,
- "else", ELSE,
- "end", END,
- "exp", EXP,
- "fill", FILL,
- "filled", FILL,
- "for", FOR,
- "from", FROM,
- "height", HEIGHT,
- "ht", HEIGHT,
- "if", IF,
- "int", INT,
- "invis", INVISIBLE,
- "invisible", INVISIBLE,
- "last", LAST,
- "left", LEFT,
- "line", LINE,
- "ljust", LJUST,
- "log", LOG,
- "lower", LOWER,
- "max", K_MAX,
- "min", K_MIN,
- "move", MOVE,
- "of", OF,
- "plot", PLOT,
- "print", PRINT,
- "rad", RADIUS,
- "radius", RADIUS,
- "rand", RAND,
- "reset", RESET,
- "right", RIGHT,
- "rjust", RJUST,
- "same", SAME,
- "sh", SH,
- "sin", SIN,
- "spline", SPLINE,
- "sprintf", SPRINTF,
- "sqrt", SQRT,
- "start", START,
- "the", THE,
- "then", THEN,
- "thick", THICKNESS,
- "thickness", THICKNESS,
- "thru", THRU,
- "to", TO,
- "top", TOP,
- "undef", UNDEF,
- "until", UNTIL,
- "up", UP,
- "upper", UPPER,
- "way", WAY,
- "wid", WIDTH,
- "width", WIDTH,
- "with", WITH,
+ { "Here", HERE },
+ { "above", ABOVE },
+ { "aligned", ALIGNED },
+ { "and", AND },
+ { "arc", ARC },
+ { "arrow", ARROW },
+ { "at", AT },
+ { "atan2", ATAN2 },
+ { "below", BELOW },
+ { "between", BETWEEN },
+ { "bottom", BOTTOM },
+ { "box", BOX },
+ { "by", BY },
+ { "ccw", CCW },
+ { "center", CENTER },
+ { "chop", CHOP },
+ { "circle", CIRCLE },
+ { "command", COMMAND },
+ { "copy", COPY },
+ { "cos", COS },
+ { "cw", CW },
+ { "dashed", DASHED },
+ { "define", DEFINE },
+ { "diam", DIAMETER },
+ { "diameter", DIAMETER },
+ { "do", DO },
+ { "dotted", DOTTED },
+ { "down", DOWN },
+ { "ellipse", ELLIPSE },
+ { "else", ELSE },
+ { "end", END },
+ { "exp", EXP },
+ { "fill", FILL },
+ { "filled", FILL },
+ { "for", FOR },
+ { "from", FROM },
+ { "height", HEIGHT },
+ { "ht", HEIGHT },
+ { "if", IF },
+ { "int", INT },
+ { "invis", INVISIBLE },
+ { "invisible", INVISIBLE },
+ { "last", LAST },
+ { "left", LEFT },
+ { "line", LINE },
+ { "ljust", LJUST },
+ { "log", LOG },
+ { "lower", LOWER },
+ { "max", K_MAX },
+ { "min", K_MIN },
+ { "move", MOVE },
+ { "of", OF },
+ { "plot", PLOT },
+ { "print", PRINT },
+ { "rad", RADIUS },
+ { "radius", RADIUS },
+ { "rand", RAND },
+ { "reset", RESET },
+ { "right", RIGHT },
+ { "rjust", RJUST },
+ { "same", SAME },
+ { "sh", SH },
+ { "sin", SIN },
+ { "spline", SPLINE },
+ { "sprintf", SPRINTF },
+ { "sqrt", SQRT },
+ { "start", START },
+ { "the", THE },
+ { "then", THEN },
+ { "thick", THICKNESS },
+ { "thickness", THICKNESS },
+ { "thru", THRU },
+ { "to", TO },
+ { "top", TOP },
+ { "undef", UNDEF },
+ { "until", UNTIL },
+ { "up", UP },
+ { "upper", UPPER },
+ { "way", WAY },
+ { "wid", WIDTH },
+ { "width", WIDTH },
+ { "with", WITH },
};
const keyword *start = table;
diff --git a/pic/main.cc b/pic/main.cc
index fe608ebd9..7b82ec7a5 100644
--- a/pic/main.cc
+++ b/pic/main.cc
@@ -606,6 +606,6 @@ int main(int argc, char **argv)
delete out;
if (ferror(stdout) || fflush(stdout) < 0)
fatal("output error");
- exit(0);
+ return 0;
}
diff --git a/pic/make-dos-dist b/pic/make-dos-dist
index e88365707..9f546a091 100755
--- a/pic/make-dos-dist
+++ b/pic/make-dos-dist
@@ -133,6 +133,7 @@ cat >getopt.c <<'EOF'
#include <stdio.h>
#include <string.h>
+#include <ctype.h>
#ifdef SWITCHAR
#include <dos.h>
@@ -147,6 +148,12 @@ char *optarg;
#define OPTION_CHAR '-'
#endif
+#ifdef isascii
+#define ISASCII(c) isascii(c)
+#else
+#define ISASCII(c) (1)
+#endif
+
int getopt(argc, argv, opts)
int argc;
char **argv;
@@ -226,9 +233,9 @@ char *opts;
return(EOF);
}
}
- optopt = c = argv[optind][sp];
+ optopt = c = (unsigned char)argv[optind][sp];
#ifdef CASE_INSENSITIVE_OPTIONS
- if (isascii(c) && isupper(c))
+ if (ISASCII(c) && isupper(c))
optopt = c = tolower(c);
#endif
if (c == ':' || (cp = strchr(opts, c)) == NULL) {
diff --git a/pic/object.h b/pic/object.h
index 39240b634..fe3dd7657 100644
--- a/pic/object.h
+++ b/pic/object.h
@@ -110,7 +110,7 @@ struct graphics_state {
direction dir;
};
-struct saved_state : graphics_state {
+struct saved_state : public graphics_state {
saved_state *prev;
PTABLE(place) *tbl;
};
diff --git a/pic/pic.cc b/pic/pic.cc
index 92016512e..a85ff8ba1 100644
--- a/pic/pic.cc
+++ b/pic/pic.cc
@@ -3129,28 +3129,28 @@ static struct {
double val;
int scaled; // non-zero if val should be multiplied by scale
} defaults_table[] = {
- "arcrad", .25, 1,
- "arrowht", .1, 1,
- "arrowwid", .05, 1,
- "circlerad", .25, 1,
- "boxht", .5, 1,
- "boxwid", .75, 1,
- "boxrad", 0.0, 1,
- "dashwid", .05, 1,
- "ellipseht", .5, 1,
- "ellipsewid", .75, 1,
- "moveht", .5, 1,
- "movewid", .5, 1,
- "lineht", .5, 1,
- "linewid", .5, 1,
- "textht", 0.0, 1,
- "textwid", 0.0, 1,
- "scale", 1.0, 0,
- "linethick", -1.0, 0, // in points
- "fillval", .5, 0,
- "arrowhead", 1.0, 0,
- "maxpswid", 8.5, 0,
- "maxpsht", 11.0, 0,
+ { "arcrad", .25, 1 },
+ { "arrowht", .1, 1 },
+ { "arrowwid", .05, 1 },
+ { "circlerad", .25, 1 },
+ { "boxht", .5, 1 },
+ { "boxwid", .75, 1 },
+ { "boxrad", 0.0, 1 },
+ { "dashwid", .05, 1 },
+ { "ellipseht", .5, 1 },
+ { "ellipsewid", .75, 1 },
+ { "moveht", .5, 1 },
+ { "movewid", .5, 1 },
+ { "lineht", .5, 1 },
+ { "linewid", .5, 1 },
+ { "textht", 0.0, 1 },
+ { "textwid", 0.0, 1 },
+ { "scale", 1.0, 0 },
+ { "linethick", -1.0, 0 }, // in points
+ { "fillval", .5, 0 },
+ { "arrowhead", 1.0, 0 },
+ { "maxpswid", 8.5, 0 },
+ { "maxpsht", 11.0, 0 },
};
place *lookup_label(const char *label)
diff --git a/pic/pic.man b/pic/pic.man
index b049eab91..1ace45929 100644
--- a/pic/pic.man
+++ b/pic/pic.man
@@ -36,7 +36,7 @@
]
.SH DESCRIPTION
.LP
-This manual page descibes the GNU version of
+This manual page describes the GNU version of
.BR pic ,
which is part of the groff document formatting system.
.B pic
diff --git a/pic/pic.y b/pic/pic.y
index 8c0405ffe..a572dcedc 100644
--- a/pic/pic.y
+++ b/pic/pic.y
@@ -1524,28 +1524,28 @@ static struct {
double val;
int scaled; // non-zero if val should be multiplied by scale
} defaults_table[] = {
- "arcrad", .25, 1,
- "arrowht", .1, 1,
- "arrowwid", .05, 1,
- "circlerad", .25, 1,
- "boxht", .5, 1,
- "boxwid", .75, 1,
- "boxrad", 0.0, 1,
- "dashwid", .05, 1,
- "ellipseht", .5, 1,
- "ellipsewid", .75, 1,
- "moveht", .5, 1,
- "movewid", .5, 1,
- "lineht", .5, 1,
- "linewid", .5, 1,
- "textht", 0.0, 1,
- "textwid", 0.0, 1,
- "scale", 1.0, 0,
- "linethick", -1.0, 0, // in points
- "fillval", .5, 0,
- "arrowhead", 1.0, 0,
- "maxpswid", 8.5, 0,
- "maxpsht", 11.0, 0,
+ { "arcrad", .25, 1 },
+ { "arrowht", .1, 1 },
+ { "arrowwid", .05, 1 },
+ { "circlerad", .25, 1 },
+ { "boxht", .5, 1 },
+ { "boxwid", .75, 1 },
+ { "boxrad", 0.0, 1 },
+ { "dashwid", .05, 1 },
+ { "ellipseht", .5, 1 },
+ { "ellipsewid", .75, 1 },
+ { "moveht", .5, 1 },
+ { "movewid", .5, 1 },
+ { "lineht", .5, 1 },
+ { "linewid", .5, 1 },
+ { "textht", 0.0, 1 },
+ { "textwid", 0.0, 1 },
+ { "scale", 1.0, 0 },
+ { "linethick", -1.0, 0 }, // in points
+ { "fillval", .5, 0 },
+ { "arrowhead", 1.0, 0 },
+ { "maxpswid", 8.5, 0 },
+ { "maxpsht", 11.0, 0 },
};
place *lookup_label(const char *label)
diff --git a/pic/troff.cc b/pic/troff.cc
index 2b6d0d7b8..6fd561c10 100644
--- a/pic/troff.cc
+++ b/pic/troff.cc
@@ -408,6 +408,7 @@ static const char *choose_delimiter(const char *text)
void troff_output::text(const position &center, text_piece *v, int n,
double ang)
{
+ line_thickness(BAD_THICKNESS); // the text might use lines (eg in equations)
int rotate_flag = 0;
if (driver_extension_flag && ang != 0.0) {
rotate_flag = 1;
diff --git a/refer/TODO b/refer/TODO
new file mode 100644
index 000000000..5bbd9bff1
--- /dev/null
+++ b/refer/TODO
@@ -0,0 +1,124 @@
+inline references
+
+Some sort of macro/subroutine that can cover several references.
+
+move-punctuation should ignore multiple punctuation characters.
+
+Make the index files machine independent.
+
+Allow search keys to be negated (with !) to indicate that the
+reference should not contain the key. Ignore negated keys during
+indexed searching.
+
+Provide an option with lkbib and lookbib that prints the location
+(filename, position) of each reference. Need to map filename_id's
+back to filenames.
+
+Rename join-authors to join-fields. Have a separate label-join-fields
+command used by @ and #.
+
+Have some sort of quantifier: eg $.n#A means execute `$.n' for each
+instance of an A field, setting $ to that field, and then join the
+results using the join-authors command.
+
+no-text-in-bracket command which says not to allow post_text and
+pre_text when the [] flags has been given. Useful for superscripted
+footnotes.
+
+Make it possible to translate - to \(en in page ranges.
+
+Trim eign a bit.
+
+In indexed searching discard all numeric keys except dates.
+
+Allow `\ ' to separate article from first word.
+
+%also
+
+Option automatically to supply [] flags in every reference.
+
+See if we can avoid requiring a comma before jr. and so on
+in find_last_name().
+
+Cache sortified authors in authors string during tentative evaluation of
+label specification.
+
+Possibly don't allow * and % expressions in the first part of ?:, | or
+& expressions.
+
+Handle better the case where <> occurs inside functions and in the
+first operand of ~. Or perhaps implement <> using some magic character
+in the string.
+
+Should special treatment be given to lines beginning with . in
+references? (Unix refer seems to treat them like `%').
+
+Add global flag to control whether all files should be stat-ed after
+loading, and whether they should be stat-ed before each search.
+Perhaps make this dependent on the number of files there are.
+
+Option to truncate keys to truncate_len in linear searching.
+
+Allow multiple -f options in indxbib.
+
+In indxbib, possibly store common words rather than common words
+filename. In this case store only words that are actually present in
+the file.
+
+Perhaps we should put out an obnoxious copyright message when lookbib
+starts up.
+
+Provide an option that writes a file containing just the references
+actually used. Useful if you want to distribute a document.
+
+Have a magic token such that
+%A <sort stuff><magic token><print stuff>
+will print as though it were
+%A <print stuff>
+but sort as though it were
+%A <sort stuff>
+Do we need this if we can specify author alternatives for sorting?
+No, provided we have separate alternatives for @.
+
+In consider_authors when last names are ambiguous we might be able to
+use just the first name and not Jr. bit. Or we might be able to
+abbreviate the author.
+
+It ought to be possible to specify an alternative field to sort on
+instead of date. (ie if there's a field giving the type of document --
+these references should sort after any years)
+
+Provide a way to execute a command using a command-line option.
+
+Option to set the label-spec as a command-line option (-L).
+
+Command to to specify which fields can occur multiple times:
+multiple AE
+
+Command to specify how various fields sort:
+aort-as-name A
+sort-as-date D
+sort-as-title T
+sort-as-other O
+
+Command to specify which fields are author fields:
+# if we don't have A use field Q
+author-fields AQ
+
+Commands to set properties of tokens.
+sortify-token \(ae ae
+uppercase-token \[ae] \[AE]
+
+Command to set the names of months:
+months january february march april may ...
+
+Perhaps provide some sort of macro capability:
+# perhaps a macro capability
+defmacro foo
+annotation-field $1
+endef
+
+Command to control strings used in capitalization
+capitalize-start \s+2
+capitalize-end \s-2
+(perhaps make these arguments to the capitalize command.)
diff --git a/refer/command.cc b/refer/command.cc
index 93b6cfe95..ee6062799 100644
--- a/refer/command.cc
+++ b/refer/command.cc
@@ -636,52 +636,52 @@ struct {
command_t func;
const char *arg_types;
} command_table[] = {
- "include", include_command, "s",
- "echo", echo_command, "s*",
- "capitalize", capitalize_command, "f?",
- "accumulate", accumulate_command, "",
- "no-accumulate", no_accumulate_command, "",
- "move-punctuation", move_punctuation_command, "",
- "no-move-punctuation", no_move_punctuation_command, "",
- "sort", sort_command, "s?",
- "no-sort", no_sort_command, "",
- "articles", articles_command, "s*",
- "database", database_command, "ss*",
- "default-database", default_database_command, "",
- "no-default-database", no_default_database_command, "",
- "bibliography", bibliography_command, "ss*",
- "annotate", annotate_command, "F?s?",
- "no-annotate", no_annotate_command, "",
- "reverse", reverse_command, "s",
- "no-reverse", no_reverse_command, "",
- "abbreviate", abbreviate_command, "ss?s?s?s?",
- "no-abbreviate", no_abbreviate_command, "",
- "search-ignore", search_ignore_command, "f?",
- "no-search-ignore", no_search_ignore_command, "",
- "search-truncate", search_truncate_command, "i?",
- "no-search-truncate", no_search_truncate_command, "",
- "discard", discard_command, "f?",
- "no-discard", no_discard_command, "",
- "label", label_command, "s",
- "abbreviate-label-ranges", abbreviate_label_ranges_command, "s?",
- "no-abbreviate-label-ranges", no_abbreviate_label_ranges_command, "",
- "label-in-reference", label_in_reference_command, "",
- "no-label-in-reference", no_label_in_reference_command, "",
- "label-in-text", label_in_text_command, "",
- "no-label-in-text", no_label_in_text_command, "",
- "sort-adjacent-labels", sort_adjacent_labels_command, "",
- "no-sort-adjacent-labels", no_sort_adjacent_labels_command, "",
- "date-as-label", date_as_label_command, "s?",
- "no-date-as-label", no_date_as_label_command, "",
- "short-label", short_label_command, "s",
- "no-short-label", no_short_label_command, "",
- "compatible", compatible_command, "",
- "no-compatible", no_compatible_command, "",
- "join-authors", join_authors_command, "sss?",
- "bracket-label", bracket_label_command, "sss",
- "separate-label-second-parts", separate_label_second_parts_command, "s",
- "et-al", et_al_command, "sii?",
- "no-et-al", no_et_al_command, "",
+ { "include", include_command, "s" },
+ { "echo", echo_command, "s*" },
+ { "capitalize", capitalize_command, "f?" },
+ { "accumulate", accumulate_command, "" },
+ { "no-accumulate", no_accumulate_command, "" },
+ { "move-punctuation", move_punctuation_command, "" },
+ { "no-move-punctuation", no_move_punctuation_command, "" },
+ { "sort", sort_command, "s?" },
+ { "no-sort", no_sort_command, "" },
+ { "articles", articles_command, "s*" },
+ { "database", database_command, "ss*" },
+ { "default-database", default_database_command, "" },
+ { "no-default-database", no_default_database_command, "" },
+ { "bibliography", bibliography_command, "ss*" },
+ { "annotate", annotate_command, "F?s?" },
+ { "no-annotate", no_annotate_command, "" },
+ { "reverse", reverse_command, "s" },
+ { "no-reverse", no_reverse_command, "" },
+ { "abbreviate", abbreviate_command, "ss?s?s?s?" },
+ { "no-abbreviate", no_abbreviate_command, "" },
+ { "search-ignore", search_ignore_command, "f?" },
+ { "no-search-ignore", no_search_ignore_command, "" },
+ { "search-truncate", search_truncate_command, "i?" },
+ { "no-search-truncate", no_search_truncate_command, "" },
+ { "discard", discard_command, "f?" },
+ { "no-discard", no_discard_command, "" },
+ { "label", label_command, "s" },
+ { "abbreviate-label-ranges", abbreviate_label_ranges_command, "s?" },
+ { "no-abbreviate-label-ranges", no_abbreviate_label_ranges_command, "" },
+ { "label-in-reference", label_in_reference_command, "" },
+ { "no-label-in-reference", no_label_in_reference_command, "" },
+ { "label-in-text", label_in_text_command, "" },
+ { "no-label-in-text", no_label_in_text_command, "" },
+ { "sort-adjacent-labels", sort_adjacent_labels_command, "" },
+ { "no-sort-adjacent-labels", no_sort_adjacent_labels_command, "" },
+ { "date-as-label", date_as_label_command, "s?" },
+ { "no-date-as-label", no_date_as_label_command, "" },
+ { "short-label", short_label_command, "s" },
+ { "no-short-label", no_short_label_command, "" },
+ { "compatible", compatible_command, "" },
+ { "no-compatible", no_compatible_command, "" },
+ { "join-authors", join_authors_command, "sss?" },
+ { "bracket-label", bracket_label_command, "sss" },
+ { "separate-label-second-parts", separate_label_second_parts_command, "s" },
+ { "et-al", et_al_command, "sii?" },
+ { "no-et-al", no_et_al_command, "" },
};
static int check_args(const char *types, const char *name,
diff --git a/refer/label.cc b/refer/label.cc
index 35ddd1b75..44254650d 100644
--- a/refer/label.cc
+++ b/refer/label.cc
@@ -2,7 +2,7 @@
static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/90";
#endif
#define YYBYACC 1
-#line 22 "label.y"
+#line 22 "/u/jjc/groff/refer/label.y"
#include "refer.h"
#include "refid.h"
@@ -103,23 +103,23 @@ public:
}
};
-typedef void map_t(const char *, const char *, string &);
+typedef void map_func(const char *, const char *, string &);
class map_expr : public unary_expr {
- map_t *func;
+ map_func *func;
public:
- map_expr(expression *e, map_t *f) : unary_expr(e), func(f) { }
+ map_expr(expression *e, map_func *f) : unary_expr(e), func(f) { }
void evaluate(int, const reference &, string &, substring_position &);
};
-typedef const char *extractor_t(const char *, const char *, const char **);
+typedef const char *extractor_func(const char *, const char *, const char **);
class extractor_expr : public unary_expr {
int part;
- extractor_t *func;
+ extractor_func *func;
public:
enum { BEFORE = +1, MATCH = 0, AFTER = -1 };
- extractor_expr(expression *e, extractor_t *f, int pt)
+ extractor_expr(expression *e, extractor_func *f, int pt)
: unary_expr(e), func(f), part(pt) { }
void evaluate(int, const reference &, string &, substring_position &);
};
@@ -200,7 +200,7 @@ static expression *parse_result;
string literals;
-#line 221 "label.y"
+#line 221 "/u/jjc/groff/refer/label.y"
typedef union {
int num;
expression *expr;
@@ -438,7 +438,7 @@ YYSTYPE yylval;
short yyss[YYSTACKSIZE];
YYSTYPE yyvs[YYSTACKSIZE];
#define yystacksize YYSTACKSIZE
-#line 397 "label.y"
+#line 397 "/u/jjc/groff/refer/label.y"
/* bison defines const to be empty unless __STDC__ is defined, which it
isn't under cfront */
@@ -1357,74 +1357,74 @@ yyreduce:
switch (yyn)
{
case 1:
-#line 250 "label.y"
+#line 250 "/u/jjc/groff/refer/label.y"
{ parse_result = (yyvsp[0].expr ? new analyzed_expr(yyvsp[0].expr) : 0); }
break;
case 2:
-#line 255 "label.y"
+#line 255 "/u/jjc/groff/refer/label.y"
{ yyval.expr = yyvsp[0].expr; }
break;
case 3:
-#line 257 "label.y"
+#line 257 "/u/jjc/groff/refer/label.y"
{ yyval.expr = new conditional_expr(yyvsp[-4].expr, yyvsp[-2].expr, yyvsp[0].expr); }
break;
case 4:
-#line 262 "label.y"
+#line 262 "/u/jjc/groff/refer/label.y"
{ yyval.expr = 0; }
break;
case 5:
-#line 264 "label.y"
+#line 264 "/u/jjc/groff/refer/label.y"
{ yyval.expr = yyvsp[0].expr; }
break;
case 6:
-#line 269 "label.y"
+#line 269 "/u/jjc/groff/refer/label.y"
{ yyval.expr = yyvsp[0].expr; }
break;
case 7:
-#line 271 "label.y"
+#line 271 "/u/jjc/groff/refer/label.y"
{ yyval.expr = new alternative_expr(yyvsp[-2].expr, yyvsp[0].expr); }
break;
case 8:
-#line 273 "label.y"
+#line 273 "/u/jjc/groff/refer/label.y"
{ yyval.expr = new conditional_expr(yyvsp[-2].expr, yyvsp[0].expr, 0); }
break;
case 9:
-#line 278 "label.y"
+#line 278 "/u/jjc/groff/refer/label.y"
{ yyval.expr = yyvsp[0].expr; }
break;
case 10:
-#line 280 "label.y"
+#line 280 "/u/jjc/groff/refer/label.y"
{ yyval.expr = new list_expr(yyvsp[-1].expr, yyvsp[0].expr); }
break;
case 11:
-#line 285 "label.y"
+#line 285 "/u/jjc/groff/refer/label.y"
{ yyval.expr = yyvsp[0].expr; }
break;
case 12:
-#line 287 "label.y"
+#line 287 "/u/jjc/groff/refer/label.y"
{ yyval.expr = new substitute_expr(yyvsp[-2].expr, yyvsp[0].expr); }
break;
case 13:
-#line 292 "label.y"
+#line 292 "/u/jjc/groff/refer/label.y"
{ yyval.expr = new at_expr; }
break;
case 14:
-#line 294 "label.y"
+#line 294 "/u/jjc/groff/refer/label.y"
{
yyval.expr = new literal_expr(literals.contents() + yyvsp[0].str.start,
yyvsp[0].str.len);
}
break;
case 15:
-#line 299 "label.y"
+#line 299 "/u/jjc/groff/refer/label.y"
{ yyval.expr = new field_expr(yyvsp[0].num, 0); }
break;
case 16:
-#line 301 "label.y"
+#line 301 "/u/jjc/groff/refer/label.y"
{ yyval.expr = new field_expr(yyvsp[-1].num, yyvsp[0].num - 1); }
break;
case 17:
-#line 303 "label.y"
+#line 303 "/u/jjc/groff/refer/label.y"
{
switch (yyvsp[0].num) {
case 'I':
@@ -1441,13 +1441,13 @@ case 17:
}
break;
case 18:
-#line 319 "label.y"
+#line 319 "/u/jjc/groff/refer/label.y"
{
yyval.expr = new format_expr('0', yyvsp[0].dig.ndigits, yyvsp[0].dig.val);
}
break;
case 19:
-#line 323 "label.y"
+#line 323 "/u/jjc/groff/refer/label.y"
{
switch (yyvsp[-1].num) {
case 'l':
@@ -1479,59 +1479,59 @@ case 19:
}
break;
case 20:
-#line 354 "label.y"
+#line 354 "/u/jjc/groff/refer/label.y"
{ yyval.expr = new truncate_expr(yyvsp[-2].expr, yyvsp[0].num); }
break;
case 21:
-#line 356 "label.y"
+#line 356 "/u/jjc/groff/refer/label.y"
{ yyval.expr = new truncate_expr(yyvsp[-2].expr, -yyvsp[0].num); }
break;
case 22:
-#line 358 "label.y"
+#line 358 "/u/jjc/groff/refer/label.y"
{ yyval.expr = new star_expr(yyvsp[-1].expr); }
break;
case 23:
-#line 360 "label.y"
+#line 360 "/u/jjc/groff/refer/label.y"
{ yyval.expr = yyvsp[-1].expr; }
break;
case 24:
-#line 362 "label.y"
+#line 362 "/u/jjc/groff/refer/label.y"
{ yyval.expr = new separator_expr(yyvsp[-1].expr); }
break;
case 25:
-#line 367 "label.y"
+#line 367 "/u/jjc/groff/refer/label.y"
{ yyval.num = -1; }
break;
case 26:
-#line 369 "label.y"
+#line 369 "/u/jjc/groff/refer/label.y"
{ yyval.num = yyvsp[0].num; }
break;
case 27:
-#line 374 "label.y"
+#line 374 "/u/jjc/groff/refer/label.y"
{ yyval.num = yyvsp[0].num; }
break;
case 28:
-#line 376 "label.y"
+#line 376 "/u/jjc/groff/refer/label.y"
{ yyval.num = yyvsp[-1].num*10 + yyvsp[0].num; }
break;
case 29:
-#line 381 "label.y"
+#line 381 "/u/jjc/groff/refer/label.y"
{ yyval.dig.ndigits = 1; yyval.dig.val = yyvsp[0].num; }
break;
case 30:
-#line 383 "label.y"
+#line 383 "/u/jjc/groff/refer/label.y"
{ yyval.dig.ndigits = yyvsp[-1].dig.ndigits + 1; yyval.dig.val = yyvsp[-1].dig.val*10 + yyvsp[0].num; }
break;
case 31:
-#line 389 "label.y"
+#line 389 "/u/jjc/groff/refer/label.y"
{ yyval.num = 0; }
break;
case 32:
-#line 391 "label.y"
+#line 391 "/u/jjc/groff/refer/label.y"
{ yyval.num = 1; }
break;
case 33:
-#line 393 "label.y"
+#line 393 "/u/jjc/groff/refer/label.y"
{ yyval.num = -1; }
break;
#line 1538 "y.tab.c"
diff --git a/refer/label.y b/refer/label.y
index d18eb89a9..d4b7fd362 100644
--- a/refer/label.y
+++ b/refer/label.y
@@ -119,23 +119,23 @@ public:
}
};
-typedef void map_t(const char *, const char *, string &);
+typedef void map_func(const char *, const char *, string &);
class map_expr : public unary_expr {
- map_t *func;
+ map_func *func;
public:
- map_expr(expression *e, map_t *f) : unary_expr(e), func(f) { }
+ map_expr(expression *e, map_func *f) : unary_expr(e), func(f) { }
void evaluate(int, const reference &, string &, substring_position &);
};
-typedef const char *extractor_t(const char *, const char *, const char **);
+typedef const char *extractor_func(const char *, const char *, const char **);
class extractor_expr : public unary_expr {
int part;
- extractor_t *func;
+ extractor_func *func;
public:
enum { BEFORE = +1, MATCH = 0, AFTER = -1 };
- extractor_expr(expression *e, extractor_t *f, int pt)
+ extractor_expr(expression *e, extractor_func *f, int pt)
: unary_expr(e), func(f), part(pt) { }
void evaluate(int, const reference &, string &, substring_position &);
};
diff --git a/refer/refer.cc b/refer/refer.cc
index cb6e218e3..0f6641027 100644
--- a/refer/refer.cc
+++ b/refer/refer.cc
@@ -258,7 +258,7 @@ int main(int argc, char **argv)
if (n < 0)
n = 0;
opt = ptr;
- sprintf(strchr(buf, '\0'), "+%d", n);
+ sprintf(strchr(buf, '\0'), "+%ld", n);
}
strcat(buf, "D.y");
if (*opt == ',')
@@ -273,7 +273,7 @@ int main(int argc, char **argv)
}
if (n < 0)
n = 0;
- sprintf(strchr(buf, '\0'), "-%d", n);
+ sprintf(strchr(buf, '\0'), "-%ld", n);
opt = ptr;
if (*opt != '\0')
error("argument to `l' option not of form `m,n'");
@@ -374,7 +374,7 @@ int main(int argc, char **argv)
output_references();
if (fflush(stdout) < 0)
fatal("output error");
- exit(0);
+ return 0;
}
static void usage()
@@ -422,8 +422,8 @@ static void do_file(const char *filename)
error("can't open `%1': %2", filename, strerror(errno));
return;
}
- current_filename = filename;
}
+ current_filename = filename;
fprintf(outfp, ".lf 1 %s\n", filename);
string line;
current_lineno = 0;
diff --git a/refer/refer.man b/refer/refer.man
index 9f7a3c019..ed2f2bdbe 100644
--- a/refer/refer.man
+++ b/refer/refer.man
@@ -155,7 +155,7 @@ no-label-in-text; no-label-in-reference
.B compatible
.TP
.B \-P
-.B move-puntuation
+.B move-punctuation
.TP
.B \-S
.B
@@ -259,10 +259,10 @@ If the name contains a title such as
.B Jr.
at the end,
it should be separated from the last name by a comma.
-There can be multiple occurences of the
+There can be multiple occurrences of the
.B A
field.
-The order is siginificant.
+The order is significant.
It is a good idea always to supply an
.B A
field or a
@@ -357,10 +357,10 @@ For all fields except
.B A
and
.BR E ,
-if there is more than one occurence of a particular field in a record,
+if there is more than one occurernce of a particular field in a record,
only the last such field will be used.
.LP
-If accent strings are used, they should follow the charater to be accented.
+If accent strings are used, they should follow the character to be accented.
This means that the
.B AM
macro must be used with the
@@ -727,7 +727,7 @@ and
even when followed by a character other than space or newline.
.TP
.BI database\ filename \fR\|.\|.\|.
-Search the bibligraphic databases
+Search the bibliographic databases
.IR filename \|.\|.\|.
For each
.I filename
diff --git a/refer/token.cc b/refer/token.cc
index 8847081bd..1ec7acd16 100644
--- a/refer/token.cc
+++ b/refer/token.cc
@@ -155,7 +155,7 @@ static void store_token(const char *tok, token_type typ,
const char *sk = 0, const char *oc = 0)
{
unsigned n = hash_string(tok, strlen(tok)) % TOKEN_TABLE_SIZE;
- while (n >= 0) {
+ for (;;) {
if (token_table[n].tok == 0) {
if (++ntokens == TOKEN_TABLE_SIZE)
assert(0);
@@ -164,8 +164,10 @@ static void store_token(const char *tok, token_type typ,
}
if (strcmp(tok, token_table[n].tok) == 0)
break;
- if (--n < 0)
+ if (n == 0)
n = TOKEN_TABLE_SIZE - 1;
+ else
+ --n;
}
token_table[n].ti.set(typ, sk, oc);
}
@@ -176,14 +178,16 @@ token_info default_token_info;
const token_info *lookup_token(const char *start, const char *end)
{
unsigned n = hash_string(start, end - start) % TOKEN_TABLE_SIZE;
- while (n >= 0) {
+ for (;;) {
if (token_table[n].tok == 0)
break;
if (strlen(token_table[n].tok) == end - start
&& memcmp(token_table[n].tok, start, end - start) == 0)
return &(token_table[n].ti);
- if (--n < 0)
+ if (n == 0)
n = TOKEN_TABLE_SIZE - 1;
+ else
+ --n;
}
return &default_token_info;
}
diff --git a/soelim/TODO b/soelim/TODO
new file mode 100644
index 000000000..f2a3924ef
--- /dev/null
+++ b/soelim/TODO
@@ -0,0 +1 @@
+Understand .pso.
diff --git a/soelim/soelim.cc b/soelim/soelim.cc
index f69baeee8..405f18408 100644
--- a/soelim/soelim.cc
+++ b/soelim/soelim.cc
@@ -71,7 +71,7 @@ int main(int argc, char **argv)
nbad += !do_file(argv[i]);
if (ferror(stdout) || fflush(stdout) < 0)
fatal("output error");
- exit(nbad != 0);
+ return nbad != 0;
}
void set_location()
diff --git a/tbl/main.cc b/tbl/main.cc
index c99af2b85..0003b8360 100644
--- a/tbl/main.cc
+++ b/tbl/main.cc
@@ -652,7 +652,7 @@ format::~format()
a_delete entry;
}
-struct input_entry_format : entry_format {
+struct input_entry_format : public entry_format {
input_entry_format *next;
string width;
int separation;
@@ -1492,6 +1492,6 @@ int main(int argc, char **argv)
}
if (ferror(stdout) || fflush(stdout) < 0)
fatal("output error");
- exit(0);
+ return 0;
}
diff --git a/tbl/table.cc b/tbl/table.cc
index 76c7cd74a..1daa49795 100644
--- a/tbl/table.cc
+++ b/tbl/table.cc
@@ -1016,7 +1016,7 @@ stuff::~stuff()
{
}
-struct text_stuff : stuff {
+struct text_stuff : public stuff {
string contents;
const char *filename;
int lineno;
@@ -1046,7 +1046,7 @@ void text_stuff::print(table *)
location_force_filename = 1; // it might have been a .lf command
}
-struct single_hline_stuff : stuff {
+struct single_hline_stuff : public stuff {
single_hline_stuff(int r);
void print(table *);
int is_single_line();
@@ -1200,6 +1200,7 @@ void vertical_rule::print()
table::table(int nc, unsigned f, int ls, char dpc)
: ncolumns(nc), flags(f), linesize(ls), decimal_point_char(dpc),
nrows(0), allocated_rows(0), entry(0), entry_list(0),
+ entry_list_tailp(&entry_list),
left_separation(0), right_separation(0), stuff_list(0), vline(0),
vrule_list(0), row_is_all_lines(0), span_list(0)
{
@@ -1590,9 +1591,8 @@ void table::add_entry(int r, int c, const string &str, const entry_format *f,
e->input_filename = fn;
e->start_row = e->end_row = r;
e->start_col = e->end_col = c;
- for (table_entry **p = &entry_list; *p; p = &(*p)->next)
- ;
- *p = e;
+ *entry_list_tailp = e;
+ entry_list_tailp = &e->next;
entry[r][c] = e;
}
}
diff --git a/tbl/table.h b/tbl/table.h
index ae27545e2..f97ab7beb 100644
--- a/tbl/table.h
+++ b/tbl/table.h
@@ -60,7 +60,7 @@ enum format_type {
FORMAT_DOUBLE_HLINE
};
-struct entry_format : entry_modifier {
+struct entry_format : public entry_modifier {
format_type type;
entry_format(format_type);
@@ -84,6 +84,7 @@ class table {
stuff *stuff_list;
horizontal_span *span_list;
table_entry *entry_list;
+ table_entry **entry_list_tailp;
table_entry ***entry;
char **vline;
char *row_is_all_lines;
diff --git a/tfmtodit/tfmtodit.cc b/tfmtodit/tfmtodit.cc
index 851735d16..407c1994d 100644
--- a/tfmtodit/tfmtodit.cc
+++ b/tfmtodit/tfmtodit.cc
@@ -652,14 +652,14 @@ struct {
const char *ch;
int i;
} lig_chars[] = {
- "f", -1,
- "i", -1,
- "l", -1,
- "ff", -1,
- "fi", -1,
- "fl", -1,
- "Fi", -1,
- "Fl", -1,
+ { "f", -1 },
+ { "i", -1 },
+ { "l", -1 },
+ { "ff", -1 },
+ { "fi", -1 },
+ { "fl", -1 },
+ { "Fi", -1 },
+ { "Fl", -1 },
};
// Indices into lig_chars[].
@@ -672,11 +672,11 @@ struct {
unsigned char c1, c2, res;
const char *ch;
} lig_table[] = {
- CH_f, CH_f, CH_ff, "ff",
- CH_f, CH_i, CH_fi, "fi",
- CH_f, CH_l, CH_fl, "fl",
- CH_ff, CH_i, CH_ffi, "ffi",
- CH_ff, CH_l, CH_ffl, "ffl",
+ { CH_f, CH_f, CH_ff, "ff" },
+ { CH_f, CH_i, CH_fi, "fi" },
+ { CH_f, CH_l, CH_fl, "fl" },
+ { CH_ff, CH_i, CH_ffi, "ffi" },
+ { CH_ff, CH_l, CH_ffl, "ffl" },
};
static void usage();
@@ -758,7 +758,7 @@ int main(int argc, char **argv)
printf("spacewidth %d\n", n*MULTIPLIER);
}
if (t.get_param(1, &n) && n != 0)
- printf("slant %f\n", atan2(n/double(1<<20), 1.0)*180.0/M_PI);
+ printf("slant %f\n", atan2(n/double(1<<20), 1.0)*180.0/PI);
int xheight;
if (!t.get_param(5, &xheight))
xheight = 0;
diff --git a/tfmtodit/tfmtodit.man b/tfmtodit/tfmtodit.man
index a7787a92f..1b0766823 100644
--- a/tfmtodit/tfmtodit.man
+++ b/tfmtodit/tfmtodit.man
@@ -139,7 +139,7 @@ commands giving additional font metric information.
.SH FILES
.Tp \w'\fB@FONTDIR@/devdvi/DESC'u+2n
.B @FONTDIR@/devdvi/DESC
-Device desciption file.
+Device description file.
.TP
.BI @FONTDIR@/devdvi/ F
Font description file for font
diff --git a/tmac/doc-ditroff b/tmac/doc-ditroff
index a6a5832e5..039db7dd0 100644
--- a/tmac/doc-ditroff
+++ b/tmac/doc-ditroff
@@ -34,6 +34,8 @@
.\" tmac.mdoc-ditroff
.\" %beginstrip%
.\"
+.\" -rC1 numbers pages continuously; initialize to avoid warnings
+.if \n(.g .if !rC .nr C 0
.ds aD \fI\s10
.ds aR \f(CO\s10
.ds cM \f(CB\s10
@@ -133,17 +135,21 @@
.\}
.wh 0 hM
.wh -1.25i fM
-.\" .tm Here is gX == \\n(gX
+.nr nL \\n(nl
.ie \\n(gX==1 \{\
. rm n1
-. if \\n(.g .br
-. if !\\n(.g .bp
+. bp
.\}
.el \{\
-. if \\n(.g .br
-. if !\\n(.g 'bp
+' bp
+.\}
+.\" Don't set the page number if this is the first page,
+.\" in case the user has used -n.
+.if \\n(nL>0 \{\
+. if !\\nC \{\
+. nr % 1
+. \}
.\}
-.nr % 1
.nr gX 0
.em lM
..
diff --git a/tmac/groff_ms.man b/tmac/groff_ms.man
index 9a5d40e8a..d54e5b0e1 100644
--- a/tmac/groff_ms.man
+++ b/tmac/groff_ms.man
@@ -14,7 +14,8 @@ groff_ms \- groff ms macros
.SH DESCRIPTION
This manual page describes the GNU version of the ms macros,
which is part of the groff document formatting system.
-The groff ms macros are intended to be compatible with the 4.3
+The groff ms macros are intended to be compatible with the
+documented behaviour of the 4.3
.SM BSD
Unix ms macros subject to the following limitations:
.IP \(bu
@@ -161,6 +162,13 @@ and
.B \en(PD/2
respectively; however, if any of these registers has been defined
before initialization, it will not be set.
+The hyphenation flags (as set by the
+.B .hy
+request) are set from the
+.B HY
+register;
+if this has not been defined at initialization,
+it will be set to 14.
.LP
Right-aligned displays are available with
.B ".DS R"
diff --git a/tmac/tmac.X b/tmac/tmac.X
index 044113fe9..53dd59638 100644
--- a/tmac/tmac.X
+++ b/tmac/tmac.X
@@ -11,6 +11,7 @@
.char \(ru \D'l .5m 0'
.char \(ul \v'.25m'\D'l .5m 0'\v'-.25m'
.char \(br \v'.25m'\D'l 0 -1m'\v'.75m'
+.char \(rn \v'-.75m'\D'l .5m 0'\v'.75m'
.char ~ \v'-.55m'\\s[\\n(.s/2u]\v'.2m'\(ti\v'-.2m'\s0\v'.55m'
.char ^ \v'-.55m'\\s[\\n(.s/2u]\v'.3m'\(ha\v'-.3m'\s0\v'.55m'
.if !c\(va .char \(va \o'\(ua\(da'
@@ -40,6 +41,6 @@
.if !c\(rh .tr \(rh\(rA
.if !c\(bq .tr \(bq,
.if !c\(aq .tr \(aq'
-.if '\*(.T'X100' .char \(rn \h'-\w'\(sr'u'\(rn\h'\w'\(sr'u'
+.if '\*(.T'X100' .char \[radicalex] \h'-\w'\(sr'u'\[radicalex]\h'\w'\(sr'u'
.if !\n(_C .mso tmac.pspic
.cp \n(_C
diff --git a/tmac/tmac.dvi b/tmac/tmac.dvi
index c64fc73ce..73412ac05 100644
--- a/tmac/tmac.dvi
+++ b/tmac/tmac.dvi
@@ -8,12 +8,14 @@
.char _ \R'dvi-char_ \\n(.f=\f(CW\\n(.f\fP'\\*[dvi-char_\\n[dvi-char_]]
.char \[ul] \R'dvi-char_ \w'M'=\w'i''\\*[dvi-char_\\n[dvi-char_]]
.\" Normally use a rule.
-.ds dvi-char_0 \v'.23m'\D'R .5m .04m'\v'-.04m'\v'-.23m'
+.\" This is designed so that \(ul, \(rn and \(br form corners.
+.ds dvi-char_0 \Z'\v'.23m'\D'R .54m .04m''\h'.5m'
.\" In font CW use a real _ character.
.ds dvi-char_1 _
-.if !c\[rn] .char \[rn] \D'R .5m -.04m'\v'.04m'
+.if !c\[radicalex] .char \[radicalex] \D'R .5m -.04m'\v'.04m'
.if !c\[br] .char \[br] \Z'\v'.25m'\D'R .04m -1m''
-.if !c\[ru] .char \[ru] \v'-.02m'\D'R .5m .04m'\v'-.04m'\v'.02m'
+.if !c\[ru] .char \[ru] \Z'\v'-.02m'\D'R .54m .04m''\h'.5m'
+.if !c\[rn] .char \[rn] \Z'\v'-.77m'\D'R .54m .04m''\h'.5m'
.if !c\[co] .char \[co] \z\(ci\h'\w'\(ci'u-\w'c'u/2u'c\h'\w'\(ci'u-\w'c'u/2u'
.if !c\[rg] .char \[rg] \z\(ci\h'\w'\(ci'u-\w'r'u/2u'r\h'\w'\(ci'u-\w'r'u/2u'
.if !c\[fm] .char \[fm] \v'-.35m'\s[\\n(.s*7u/10u]\[prime]\s0\v'.35m'
@@ -124,9 +126,9 @@
.dvi-achar \(:u \(ad u u
.dvi-achar \('y \' y y
.dvi-achar \(:y \(ad y y
-.char \(,C \o'\(acc'
+.if !c\(,C .char \(,C \o'\(acC'
.hcode \(,Cc
-.char \(,c \o'\(acc'
+.if !c\(,c .char \(,c \o'\(acc'
.hcode \(,cc
.cp \n(_C
.do mso tmac.latin1
diff --git a/tmac/tmac.e b/tmac/tmac.e
index f5295cb2f..92fb26484 100644
--- a/tmac/tmac.e
+++ b/tmac/tmac.e
@@ -476,7 +476,9 @@
..
.de hl \" *** draw horizontal line
.br
-\l'\\n(.lu-\\n(.iu'
+.ie \n(.g .do nr _I \\n[.in]
+.el .nr _I \\n(.i
+\l'\\n(.lu-\\n(_Iu'
.sp
..
.\" *** PARAGRAPHING ***
@@ -653,7 +655,7 @@
. ti +\\n(sou
. @F \\n(sf
. sz \\n(sp
-. if \\$3>0 \
+. if 0\\$3 \
. $\\$3
. if \w"\\$2">0 \\$2.
. if \w"\\$1">0 \\$1\f1\ \ \&
@@ -695,7 +697,6 @@
.if \n@>4 .tm >> (z, .z=\n(.z
.@D 4 \\$1 \\$2
.@(
-.nr ?T 0
..
.de )z \" *** end floating keep
.if \n@>4 .tm >> )z, .z=\n(.z
@@ -755,7 +756,6 @@
.br
.rm \\$1
.ev
-.nr ?T 0
..
.de (t \" XXX temp ref to (z
.(z \\$1 \\$2
diff --git a/tmac/tmac.ps b/tmac/tmac.ps
index d7d655dba..4d954f4ae 100644
--- a/tmac/tmac.ps
+++ b/tmac/tmac.ps
@@ -21,7 +21,7 @@
.ftr ZI ZCMI
.ftr C CR
.cflags 8 \(an
-.char \(rn \h'-\w'\(sr'u'\(rn\h'\w'\(sr'u'
+.char \[radicalex] \h'-\w'\(sr'u'\[radicalex]\h'\w'\(sr'u'
.char \(mo \h'.08m'\(mo\h'-.08m'
.char \(nm \h'.08m'\(nm\h'-.08m'
.char \[parenlefttp] \[parenlefttp]\h'.016m'
@@ -38,6 +38,7 @@
.if !c\[ru] .char \[ru] \D'l .5m 0'
.if !c\[ul] .char \[ul] \v'.25m'\D'l .5m 0'\v'-.25m'
.if !c\[br] .char \[br] \Z'\v'.25m'\D'l 0 -1m''
+.if !c\[rn] .char \[rn] \v'-.75m'\D'l .5m 0'\v'.75m'
.if !c\[or] .char \[or] \h'.1m'\Z'\D'l 0 -.675m''\h'.1m'
.if !c\[Fi] .char \[Fi] ffi
.if !c\[Fl] .char \[Fl] ffl
diff --git a/tmac/tmac.pspic b/tmac/tmac.pspic
index 9923907ff..a9f53b6c8 100644
--- a/tmac/tmac.pspic
+++ b/tmac/tmac.pspic
@@ -11,6 +11,20 @@
.\}
..
.de PSPIC
+.nr ps-offset-mode 0
+.if '\\$1'-L' \{\
+. nr ps-offset-mode 1
+. shift
+.\}
+.if '\\$1'-R' \{\
+. nr ps-offset-mode 2
+. shift
+.\}
+.if '\\$1'-I' \{\
+. nr ps-offset-mode 3
+. nr ps-offset (m;\\$2)
+. shift 2
+.\}
.br
.sy echo .ps-bb `psbb \\$1` >/tmp/psbb\\n[$$]
.so /tmp/psbb\\n[$$]
@@ -25,7 +39,9 @@
. el .nr ps-desht \\n[ps-deswid]*1000+(\\n[ps-wid]/2)/\\n[ps-wid]\
*\\n[ps-ht]+500/1000
. ne \\n[ps-desht]u+1v
-. nr ps-offset \\n[.l]-\\n[.i]-\\n[ps-deswid]/2
+. if \\n[ps-offset-mode]=0 .nr ps-offset \\n[.l]-\\n[.i]-\\n[ps-deswid]/2
+. if \\n[ps-offset-mode]=1 .nr ps-offset 0
+. if \\n[ps-offset-mode]=2 .nr ps-offset \\n[.l]-\\n[.i]-\\n[ps-deswid]
. ie \\n[.$]>=3 .ds ps-desht \\n[ps-desht]
. el .ds ps-desht \" empty
\h'\\n[ps-offset]u'\
diff --git a/tmac/tmac.s b/tmac/tmac.s
index 9afb7e6f0..8807a23ca 100644
--- a/tmac/tmac.s
+++ b/tmac/tmac.s
@@ -1,3 +1,4 @@
+.\" -*- nroff -*-
.ig
Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -44,6 +45,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
.de @nop
..
.de @init
+.nr PO \\n(.o
.\" a non-empty environment
.ev ne
\c
@@ -394,7 +396,6 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
.nr pg@fn-colw 0
.nr HM 1i
.nr FM 1i
-.nr PO 1i
.ds LF
.ds CF
.ds RF
@@ -984,6 +985,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
.aln \\n[.ev]:PD PD
.ad \\n[par*adj]
.par@reset-env
+.par@reset
..
.\" happens when the first page begins
.de par@init
@@ -997,6 +999,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
.par*vs \\n[VS]
.if !rPD .nr PD .3v>?\n(.V
.if !rDD .nr DD .5v>?\n(.V
+.if !rHY .nr HY 14
.if !dFAM .ds FAM \\n[.fam]
.nr par*adj \\n[.j]
.par*env-init
@@ -1057,9 +1060,13 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
.par*vs \\n[\\n[.ev]:VS]
.ls 1
.TA
-.hy 14
+.hy \\n[HY]
+..
+.de @RT
+.nr \\n[.ev]:pli 0
+.nr \\n[.ev]:pri 0
+.par@reset
..
-.als @RT par@reset
.\" This can be redefined by the user.
.de TA
.ta T 5n
@@ -1101,12 +1108,10 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
.if !'\\$1'' \{\
. \" Divert the label so as to freeze any spaces.
. di par*label
-. in 0
-. nf
+. par*push-tag-env
\&\\$1
+. par*pop-tag-env
. di
-. in
-. fi
. chop par*label
. ti -\\n[\\n[.ev]:ai]u
. ie \\n[dl]+1n<=\\n[\\n[.ev]:ai] \\*[par*label]\h'|\\n[\\n[.ev]:ai]u'\c
@@ -1117,6 +1122,26 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
. rm par*label
.\}
..
+.\" We don't want margin characters to be attached when we divert
+.\" the tag. Since there's no way to save and restore the current
+.\" margin character, we have to switch to a new environment, taking
+.\" what we need of the old environment with us.
+.de par*push-tag-env
+.nr par*saved-font \\n[.f]
+.nr par*saved-size \\n[.s]z
+.nr par*saved-ss \\n[.ss]
+.ds par*saved-fam \\n[.fam]
+.ev par
+.nf
+.TA
+.ft \\n[par*saved-font]
+.ps \\n[par*saved-size]u
+.ss \\n[par*saved-ss]
+.fam \\*[par*saved-fam]
+..
+.de par*pop-tag-env
+.ev
+..
.de @RS
.br
.nr \\n[.ev]:li!\\n[\\n[.ev]:il] \\n[\\n[.ev]:li]
@@ -1162,7 +1187,13 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
.di par*box-div
.nr \\n[.ev]:li +1n
.nr \\n[.ev]:ri +1n
-.par@reset
+.nr par*box-in \\n[.in]
+.\" remember what 1n is, just in case the point size changes
+.nr par*box-n 1n
+.in +1n
+.ll -1n
+.lt -1n
+.ti \\n[par*box-in]u+1n
..
.de @div-end!par*box-div
.B2
@@ -1173,21 +1204,28 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
.de B2
.ie '\\n(.z'par*box-div' \{\
. br
+. if \n[.V]>.25m .sp
. di
+. if \n[.V]>.25m .sp
. ds@need \\n[dn]
. par*box-mark-top
. ev nf
. par*box-div
. ev
-. nr \\n[.ev]:ri -1n
-. nr \\n[.ev]:li -1n
-. par@finish
-. par*box-draw \\n[.i]u \\n[.l]u
+. nr \\n[.ev]:ri -\\n[par*box-n]
+. nr \\n[.ev]:li -\\n[par*box-n]
+. in -\\n[par*box-n]u
+. ll +\\n[par*box-n]u
+. lt +\\n[par*box-n]u
+. par*box-draw \\n[.i]u \\n[.l]u-(\\n[.H]u==1n*1n)
.\}
.el .@error B2 without B1
..
.de par*box-mark-top
-.ie '\\n[.z]'' .mk par*box-top
+.ie '\\n[.z]'' \{\
+. rs
+. mk par*box-top
+.\}
.el \!.par*box-mark-top
..
.de par*box-draw
@@ -1195,6 +1233,8 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
. nr par*box-in \\n[.i]
. nr par*box-ll \\n[.l]
. nr par*box-vpt \\n[.vpt]
+. nr par*box-ad \\n[.j]
+. ad l
. vpt 0
. in \\$1
. ll \\$2
@@ -1208,6 +1248,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
. in \\n[par*box-in]u
. ll \\n[par*box-ll]u
. vpt \\n[par*box-vpt]
+. ad \\n[par*box-ad]
.\}
.el \!.par*box-draw \\$1 \\$2
..
diff --git a/troff/TODO b/troff/TODO
index f67707490..c8ee6bceb 100644
--- a/troff/TODO
+++ b/troff/TODO
@@ -70,7 +70,7 @@ Request to set character slant.
Provide some way to upcase or downcase strings.
-Support non-uniformly scaleable fonts. Perhaps associate a suffix with
+Support non-uniformly scalable fonts. Perhaps associate a suffix with
a particular range of sizes. eg
sizesuffix .display 14-512
Then is you ask for R at pointsize 16, groff will first look for
@@ -110,7 +110,7 @@ Better string-processing support (substring, length, search).
Generalized ligatures.
Provide some way for a macro to tell whether it was called with `'' or
-`.'. This would be useful for implementing a tracing macro packge.
+`.'. This would be useful for implementing a tracing macro package.
Request to remove an environment. (Maintain a count of the references
to the environment from the environment table, environment dictionary
@@ -130,3 +130,7 @@ copy mode. Should we do the same?
Number register giving name of end macro.
More thorough range checking.
+
+Provide syntax for octal and hexadecimal numeric constants. Perhaps
+o#100 and x#7f as per Scheme. Or perhaps PostScript 16#7f. Ambiguity
+between whether `c' is treated as digit or scaling indicator.
diff --git a/troff/charinfo.h b/troff/charinfo.h
index 29a5b853d..38e9e8f2d 100644
--- a/troff/charinfo.h
+++ b/troff/charinfo.h
@@ -145,7 +145,7 @@ inline int charinfo::get_index()
inline int charinfo::get_special_translation(int transparent_throughput)
{
return (transparent_throughput && !transparent_translate
- ? TRANSLATE_NONE
+ ? int(TRANSLATE_NONE)
: special_translation);
}
diff --git a/troff/dictionary.cc b/troff/dictionary.cc
index 5437a1a1e..2e6e32dc0 100644
--- a/troff/dictionary.cc
+++ b/troff/dictionary.cc
@@ -112,7 +112,7 @@ void *dictionary::remove(symbol s)
if (table[i].v == 0)
break;
r = int(table[i].s.hash() % size);
- } while ((i <= r && r < j) || (j < i && i <= r));
+ } while ((i <= r && r < j) || (r < j && j < i) || (j < i && i <= r));
table[j] = table[i];
}
if (p != 0)
diff --git a/troff/div.cc b/troff/div.cc
index c30001f2a..f82d838a5 100644
--- a/troff/div.cc
+++ b/troff/div.cc
@@ -35,6 +35,8 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
int exit_started = 0; // the exit process has started
int done_end_macro = 0; // the end macro (if any) has finished
int seen_last_page_ejector = 0; // seen the LAST_PAGE_EJECTOR cookie
+int last_page_number = 0; // if > 0, the number of the last page
+ // specified with -o
static int began_page_in_end_macro = 0; // a new page was begun during the end macro
static int last_post_line_extra_space = 0; // needed for \n(.a
@@ -512,7 +514,7 @@ void end_diversions()
}
}
-NO_RETURN void cleanup_and_exit(int exit_code)
+void cleanup_and_exit(int exit_code)
{
if (the_output) {
the_output->trailer(topdiv->get_page_length());
@@ -533,6 +535,8 @@ int top_level_diversion::begin_page()
if (!done_end_macro)
began_page_in_end_macro = 1;
}
+ if (last_page_number > 0 && page_number == last_page_number)
+ cleanup_and_exit(0);
if (!the_output)
init_output();
++page_count;
@@ -603,7 +607,10 @@ diversion::~diversion()
void page_offset()
{
hunits n;
- if (!has_arg() || !get_hunits(&n, 'v', topdiv->page_offset))
+ // The troff manual says that the default scaling indicator is v,
+ // but it is in fact m: v wouldn't make sense for a horizontally
+ // oriented request.
+ if (!has_arg() || !get_hunits(&n, 'm', topdiv->page_offset))
n = topdiv->prev_page_offset;
topdiv->prev_page_offset = topdiv->page_offset;
topdiv->page_offset = n;
diff --git a/troff/div.h b/troff/div.h
index dd2754013..ca5924f83 100644
--- a/troff/div.h
+++ b/troff/div.h
@@ -131,6 +131,7 @@ extern diversion *curdiv;
extern int exit_started;
extern int done_end_macro;
+extern int last_page_number;
extern int seen_last_page_ejector;
void spring_trap(symbol); // implemented by input.c
diff --git a/troff/input.cc b/troff/input.cc
index 609ee78ed..632a8fbd1 100644
--- a/troff/input.cc
+++ b/troff/input.cc
@@ -37,6 +37,17 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
// Needed for getpid().
#include "posix.h"
+#ifdef ISATTY_MISSING
+#undef isatty
+#define isatty(n) (1)
+#else /* not ISATTY_MISSING */
+#ifndef isatty
+extern "C" {
+ int isatty(int);
+}
+#endif /* not isatty */
+#endif /* not ISATTY_MISSING */
+
#define USAGE_EXIT_CODE 1
#define MACRO_PREFIX "tmac."
#define STARTUP_FILE "troffrc"
@@ -69,11 +80,14 @@ const char *program_name = 0;
token tok;
int break_flag = 0;
static int backtrace_flag = 0;
+#ifndef POPEN_MISSING
char *pipe_command = 0;
+#endif
charinfo *charset_table[256];
static int warning_mask = DEFAULT_WARNING_MASK;
static int inhibit_errors = 0;
+static int ignoring = 0;
static void enable_warning(const char *);
static void disable_warning(const char *);
@@ -81,13 +95,17 @@ static void disable_warning(const char *);
static int escape_char = '\\';
static symbol end_macro_name;
static int compatible_flag = 0;
-static void process_input_stack();
int ascii_output_flag = 0;
int suppress_output_flag = 0;
int tcommand_flag = 0;
static int get_copy(node**, int = 0);
+static void copy_mode_error(const char *,
+ const errarg & = empty_errarg,
+ const errarg & = empty_errarg,
+ const errarg & = empty_errarg);
+
static symbol read_escape_name();
static void interpolate_string(symbol);
static void interpolate_macro(symbol);
@@ -225,11 +243,13 @@ class file_iterator : public input_iterator {
FILE *fp;
int lineno;
const char *filename;
+ int popened;
int newline_flag;
enum { BUF_SIZE = 512 };
unsigned char buf[BUF_SIZE];
+ void close();
public:
- file_iterator(FILE *, const char *);
+ file_iterator(FILE *, const char *, int = 0);
~file_iterator();
int fill(node **);
int peek();
@@ -240,17 +260,26 @@ public:
int is_file();
};
-file_iterator::file_iterator(FILE *f, const char *fn)
-: fp(f), filename(fn), lineno(1), newline_flag(0)
+file_iterator::file_iterator(FILE *f, const char *fn, int po)
+: fp(f), filename(fn), lineno(1), newline_flag(0), popened(po)
{
}
file_iterator::~file_iterator()
{
- if (fp != stdin)
- fclose(fp);
- else
+ close();
+}
+
+void file_iterator::close()
+{
+ if (fp == stdin)
clearerr(stdin);
+#ifndef POPEN_MISSING
+ else if (popened)
+ pclose(fp);
+#endif /* not POPEN_MISSING */
+ else
+ fclose(fp);
}
int file_iterator::is_file()
@@ -260,14 +289,12 @@ int file_iterator::is_file()
int file_iterator::next_file(FILE *f, const char *s)
{
- if (fp != stdin)
- fclose(fp);
- else
- clearerr(stdin);
+ close();
filename = s;
fp = f;
lineno = 1;
newline_flag = 0;
+ popened = 0;
ptr = 0;
eptr = 0;
return 1;
@@ -330,7 +357,8 @@ int file_iterator::get_location(int /*allow_macro*/,
void file_iterator::backtrace()
{
- errprint("%1:%2: backtrace: file `%1'\n", filename, lineno);
+ errprint("%1:%2: backtrace: %3 `%1'\n", filename, lineno,
+ popened ? "process" : "file");
}
int file_iterator::set_location(const char *f, int ln)
@@ -589,7 +617,7 @@ static int get_char_for_escape_name()
int c = get_copy(NULL);
switch (c) {
case EOF:
- error("end of input in escape name");
+ copy_mode_error("end of input in escape name");
return '\0';
default:
if (!illegal_input_char(c))
@@ -600,7 +628,8 @@ static int get_char_for_escape_name()
case '\t':
case '\001':
case '\b':
- error("%1 is not allowed in an escape name", input_char_description(c));
+ copy_mode_error("%1 is not allowed in an escape name",
+ input_char_description(c));
return '\0';
}
return c;
@@ -655,7 +684,7 @@ static symbol read_long_escape_name()
buf[i] = 0;
if (buf == abuf) {
if (i == 0) {
- error("empty escape name");
+ copy_mode_error("empty escape name");
return NULL_SYMBOL;
}
return symbol(abuf);
@@ -1822,7 +1851,7 @@ symbol get_long_name(int required)
}
}
-NO_RETURN void exit_troff()
+void exit_troff()
{
exit_started = 1;
topdiv->set_last_page();
@@ -1994,7 +2023,7 @@ int diverted_copy_file_node::reread(int *bolp)
return 1;
}
-static void process_input_stack()
+void process_input_stack()
{
int_stack trap_bol_stack;
int bol = 1;
@@ -2829,6 +2858,7 @@ static void decode_args(macro_iterator *mi)
break;
macro arg;
int quote_input_level = 0;
+ int done_tab_warning = 0;
if (c == '\"') {
quote_input_level = input_stack::get_level();
c = get_copy(&n);
@@ -2848,8 +2878,13 @@ static void decode_args(macro_iterator *mi)
else {
if (c == 0)
arg.append(n);
- else
+ else {
+ if (c == '\t' && quote_input_level == 0 && !done_tab_warning) {
+ warning(WARN_TAB, "tab character in unquoted macro argument");
+ done_tab_warning = 1;
+ }
arg.append(c);
+ }
c = get_copy(&n);
}
}
@@ -2897,6 +2932,7 @@ macro_iterator::~macro_iterator()
void read_request()
{
macro_iterator *mi = new macro_iterator;
+ int reading_from_terminal = isatty(fileno(stdin));
int had_prompt = 0;
if (!tok.newline() && !tok.eof()) {
int c = get_copy(NULL);
@@ -2904,7 +2940,8 @@ void read_request()
c = get_copy(NULL);
while (c != EOF && c != '\n' && c != ' ') {
if (!illegal_input_char(c)) {
- fputc(c, stderr);
+ if (reading_from_terminal)
+ fputc(c, stderr);
had_prompt = 1;
}
c = get_copy(NULL);
@@ -2914,8 +2951,10 @@ void read_request()
decode_args(mi);
}
}
- fputc(had_prompt ? ':' : '\007', stderr);
- fflush(stderr);
+ if (reading_from_terminal) {
+ fputc(had_prompt ? ':' : '\007', stderr);
+ fflush(stderr);
+ }
input_stack::push(mi);
macro mac;
int nl = 0;
@@ -2935,11 +2974,12 @@ void read_request()
mac.append(c);
}
}
+ if (reading_from_terminal)
+ clearerr(stdin);
input_stack::push(new string_iterator(mac));
tok.next();
}
-
void do_define_string(int append)
{
symbol nm;
@@ -3089,7 +3129,7 @@ static void interpolate_arg(symbol nm)
{
const char *s = nm.contents();
if (!s || *s == '\0')
- error("missing argument name");
+ copy_mode_error("missing argument name");
else if (s[1] == 0 && csdigit(s[0]))
input_stack::push(input_stack::get_arg(s[0] - '0'));
else if (s[0] == '*' && s[1] == '\0') {
@@ -3110,7 +3150,7 @@ static void interpolate_arg(symbol nm)
for (const char *p = s; *p && csdigit(*p); p++)
;
if (*p)
- error("bad argument name `%1'", s);
+ copy_mode_error("bad argument name `%1'", s);
else
input_stack::push(input_stack::get_arg(atoi(s)));
}
@@ -3265,8 +3305,10 @@ void do_define_macro(define_mode mode)
}
*mm = mac;
}
- if (term != dot_symbol)
+ if (term != dot_symbol) {
+ ignoring = 0;
interpolate_macro(term);
+ }
else
skip_line();
return;
@@ -3320,7 +3362,9 @@ void append_macro()
void ignore()
{
+ ignoring = 1;
do_define_macro(DEFINE_IGNORE);
+ ignoring = 0;
}
void remove_macro()
@@ -4171,6 +4215,50 @@ void source()
}
}
+// like .so but use popen()
+
+void pipe_source()
+{
+#ifdef POPEN_MISSING
+ error("pipes not available on this system");
+ skip_line();
+#else /* not POPEN_MISSING */
+ if (tok.newline() || tok.eof())
+ error("missing command");
+ else {
+ int c;
+ while ((c = get_copy(NULL)) == ' ' || c == '\t')
+ ;
+ int buf_size = 24;
+ char *buf = new char[buf_size];
+ int buf_used = 0;
+ for (; c != '\n' && c != EOF; c = get_copy(NULL)) {
+ const char *s = asciify(c);
+ int slen = strlen(s);
+ if (buf_used + slen + 1> buf_size) {
+ char *old_buf = buf;
+ int old_buf_size = buf_size;
+ buf_size *= 2;
+ buf = new char[buf_size];
+ memcpy(buf, old_buf, old_buf_size);
+ a_delete old_buf;
+ }
+ strcpy(buf + buf_used, s);
+ buf_used += slen;
+ }
+ buf[buf_used] = '\0';
+ errno = 0;
+ FILE *fp = popen(buf, "r");
+ if (fp)
+ input_stack::push(new file_iterator(fp, symbol(buf).contents(), 1));
+ else
+ error("can't open pipe to process `%1': %2", buf, strerror(errno));
+ a_delete buf;
+ }
+ tok.next();
+#endif /* not POPEN_MISSING */
+}
+
const char *asciify(int c)
{
static char buf[3];
@@ -4389,6 +4477,7 @@ static void init_charset_table()
get_charinfo(symbol("em"))->set_flags(charinfo::BREAK_AFTER);
get_charinfo(symbol("ul"))->set_flags(charinfo::OVERLAPS_HORIZONTALLY);
get_charinfo(symbol("rn"))->set_flags(charinfo::OVERLAPS_HORIZONTALLY);
+ get_charinfo(symbol("radicalex"))->set_flags(charinfo::OVERLAPS_HORIZONTALLY);
get_charinfo(symbol("ru"))->set_flags(charinfo::OVERLAPS_HORIZONTALLY);
get_charinfo(symbol("br"))->set_flags(charinfo::OVERLAPS_VERTICALLY);
page_character = charset_table['%'];
@@ -4487,6 +4576,7 @@ void hyphenation_code()
}
ci->set_hyphenation_code(c);
tok.next();
+ tok.skip();
}
skip_line();
}
@@ -4758,8 +4848,14 @@ const char *constant_int_reg::get_string()
void abort_request()
{
int c;
- while ((c = get_copy(0)) == ' ')
- ;
+ if (tok.eof())
+ c = EOF;
+ else if (tok.newline())
+ c = '\n';
+ else {
+ while ((c = get_copy(0)) == ' ')
+ ;
+ }
if (c == EOF || c == '\n')
fputs("User Abort.", stderr);
else {
@@ -4802,6 +4898,10 @@ char *read_string()
void pipe_output()
{
+#ifdef POPEN_MISSING
+ error("pipes not available on this system");
+ skip_line();
+#else /* not POPEN_MISSING */
if (the_output) {
error("can't pipe: output already started");
skip_line();
@@ -4810,6 +4910,7 @@ void pipe_output()
if ((pipe_command = read_string()) == 0)
error("can't pipe to empty command");
}
+#endif /* not POPEN_MISSING */
}
static int system_status;
@@ -4951,6 +5052,10 @@ static void parse_output_page_list(char *p)
}
else
j = i;
+ if (j == 0)
+ last_page_number = -1;
+ else if (last_page_number >= 0 && j > last_page_number)
+ last_page_number = j;
output_page_list = new page_range(i, j, output_page_list);
if (*p != ',')
break;
@@ -5284,6 +5389,7 @@ int main(int argc, char **argv)
if (optind >= argc || iflag)
process_input_file("-");
exit_troff();
+ return 0; // not reached
}
void warn_request()
@@ -5380,6 +5486,9 @@ void init_input_requests()
#endif /* COLUMN */
init_request("mso", macro_source);
init_request("do", do_request);
+#ifndef POPEN_MISSING
+ init_request("pso", pipe_source);
+#endif /* not POPEN_MISSING */
number_reg_dictionary.define("systat", new variable_reg(&system_status));
number_reg_dictionary.define("slimit",
new variable_reg(&input_stack::limit));
@@ -5563,27 +5672,28 @@ static struct {
const char *name;
int mask;
} warning_table[] = {
- "char", WARN_CHAR,
- "range", WARN_RANGE,
- "break", WARN_BREAK,
- "delim", WARN_DELIM,
- "el", WARN_EL,
- "scale", WARN_SCALE,
- "number", WARN_NUMBER,
- "syntax", WARN_SYNTAX,
- "tab", WARN_TAB,
- "right-brace", WARN_RIGHT_BRACE,
- "missing", WARN_MISSING,
- "input", WARN_INPUT,
- "escape", WARN_ESCAPE,
- "space", WARN_SPACE,
- "font", WARN_FONT,
- "di", WARN_DI,
- "mac", WARN_MAC,
- "reg", WARN_REG,
- "all", WARN_TOTAL & ~(WARN_DI | WARN_MAC | WARN_REG),
- "w", WARN_TOTAL,
- "default", DEFAULT_WARNING_MASK,
+ { "char", WARN_CHAR },
+ { "range", WARN_RANGE },
+ { "break", WARN_BREAK },
+ { "delim", WARN_DELIM },
+ { "el", WARN_EL },
+ { "scale", WARN_SCALE },
+ { "number", WARN_NUMBER },
+ { "syntax", WARN_SYNTAX },
+ { "tab", WARN_TAB },
+ { "right-brace", WARN_RIGHT_BRACE },
+ { "missing", WARN_MISSING },
+ { "input", WARN_INPUT },
+ { "escape", WARN_ESCAPE },
+ { "space", WARN_SPACE },
+ { "font", WARN_FONT },
+ { "di", WARN_DI },
+ { "mac", WARN_MAC },
+ { "reg", WARN_REG },
+ { "ig", WARN_IG },
+ { "all", WARN_TOTAL & ~(WARN_DI | WARN_MAC | WARN_REG) },
+ { "w", WARN_TOTAL },
+ { "default", DEFAULT_WARNING_MASK },
};
static int lookup_warning(const char *name)
@@ -5614,6 +5724,23 @@ static void disable_warning(const char *name)
error("unknown warning `%1'", name);
}
+static void copy_mode_error(const char *format,
+ const errarg &arg1,
+ const errarg &arg2,
+ const errarg &arg3)
+{
+ if (ignoring) {
+ static const char prefix[] = "(in ignored input) ";
+ char *s = new char[sizeof(prefix) + strlen(format)];
+ strcpy(s, prefix);
+ strcat(s, format);
+ warning(WARN_IG, s, arg1, arg2, arg3);
+ a_delete s;
+ }
+ else
+ error(format, arg1, arg2, arg3);
+}
+
enum error_type { WARNING, ERROR, FATAL };
static void do_error(error_type type,
diff --git a/troff/node.cc b/troff/node.cc
index 6d36519d7..6fad470c6 100644
--- a/troff/node.cc
+++ b/troff/node.cc
@@ -134,6 +134,7 @@ protected:
int slant;
public:
tfont_spec(symbol nm, int pos, font *, font_size, int, int);
+ tfont_spec(const tfont_spec &spec) { *this = spec; }
tfont_spec plain();
int operator==(const tfont_spec &);
friend tfont *font_info::get_tfont(font_size fs, int, int, int);
@@ -173,8 +174,6 @@ inline int env_definite_font(environment *env)
return env->get_family()->make_definite(env->get_font());
}
-static void invalidate_fontno(int n);
-
/* font_info functions */
static font_info **font_table = 0;
@@ -622,7 +621,9 @@ tfont::tfont(tfont_spec &spec) : tfont_spec(spec)
/* output_file */
class real_output_file : public output_file {
+#ifndef POPEN_MISSING
int piped;
+#endif
int printing;
virtual void really_transparent_char(unsigned char) = 0;
virtual void really_print_line(hunits x, vunits y, node *n,
@@ -1176,6 +1177,7 @@ void output_file::trailer(vunits)
real_output_file::real_output_file()
: printing(0)
{
+#ifndef POPEN_MISSING
if (pipe_command) {
if ((fp = popen(pipe_command, "w")) != 0) {
piped = 1;
@@ -1184,6 +1186,7 @@ real_output_file::real_output_file()
error("pipe open failed: %1", strerror(errno));
}
piped = 0;
+#endif /* not POPEN_MISSING */
fp = stdout;
}
@@ -1196,6 +1199,7 @@ real_output_file::~real_output_file()
fp = 0;
fatal("error writing output file");
}
+#ifndef POPEN_MISSING
if (piped) {
int result = pclose(fp);
fp = 0;
@@ -1211,7 +1215,9 @@ real_output_file::~real_output_file()
pipe_command, exit_status);
}
}
- else if (fclose(fp) < 0) {
+ else
+#endif /* not POPEN MISSING */
+ if (fclose(fp) < 0) {
fp = 0;
fatal("error closing output file");
}
@@ -4306,7 +4312,7 @@ static int mount_font_no_translate(int n, symbol name, symbol external_name)
else if (font_table[n] != 0)
delete font_table[n];
font_table[n] = new font_info(name, n, external_name, fm);
- invalidate_fontno(n);
+ font_family::invalidate_fontno(n);
return 1;
}
@@ -4334,7 +4340,7 @@ void mount_style(int n, symbol name)
else if (font_table[n] != 0)
delete font_table[n];
font_table[n] = new font_info(get_font_translation(name), n, NULL_SYMBOL, 0);
- invalidate_fontno(n);
+ font_family::invalidate_fontno(n);
}
/* global functions */
@@ -4442,7 +4448,7 @@ font_family *lookup_family(symbol nm)
return f;
}
-static void invalidate_fontno(int n)
+void font_family::invalidate_fontno(int n)
{
assert(n >= 0 && n < font_table_size);
dictionary_iterator iter(family_dictionary);
diff --git a/troff/node.h b/troff/node.h
index 02526e7c9..0ab9c9fd6 100644
--- a/troff/node.h
+++ b/troff/node.h
@@ -470,14 +470,14 @@ public:
#endif /* COLUMN */
};
+#ifndef POPEN_MISSING
extern char *pipe_command;
+#endif
extern output_file *the_output;
extern void init_output();
int in_output_page_list(int n);
-static void invalidate_fontno(int);
-
class font_family {
int *map;
int map_size;
@@ -487,7 +487,7 @@ public:
font_family(symbol);
~font_family();
make_definite(int);
- friend void invalidate_fontno(int);
+ static void invalidate_fontno(int);
};
font_family *lookup_family(symbol);
diff --git a/troff/symbol.cc b/troff/symbol.cc
index eb816990d..933e5d9ba 100644
--- a/troff/symbol.cc
+++ b/troff/symbol.cc
@@ -68,6 +68,9 @@ static unsigned int hash_string(const char *p)
return hc;
}
+// Tell compiler that a variable is intentionally unused.
+inline void unused(void *) { }
+
symbol::symbol(const char *p, int how)
{
if (p == 0 || *p == 0) {
@@ -108,6 +111,7 @@ symbol::symbol(const char *p, int how)
pp >= old_table;
--pp) {
symbol temp(*pp, 1); /* insert it into the new table */
+ unused(&temp);
}
a_delete old_table;
for (pp = table + hc % table_size;
diff --git a/troff/token.h b/troff/token.h
index 486c6eafd..f8a319afe 100644
--- a/troff/token.h
+++ b/troff/token.h
@@ -23,9 +23,6 @@ struct charinfo;
struct node;
struct vunits;
-// See ARM p251.
-static void process_input_stack();
-
class token {
symbol nm;
node *nd;
diff --git a/troff/troff.h b/troff/troff.h
index bfe89a0fa..03bd38320 100644
--- a/troff/troff.h
+++ b/troff/troff.h
@@ -31,13 +31,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "assert.h"
#include "device.h"
-#ifdef __GNUG__
-#define NO_RETURN volatile
-#else
-#define NO_RETURN
-#endif
-
-NO_RETURN void cleanup_and_exit(int n);
+void cleanup_and_exit(int n);
typedef int units;
@@ -76,11 +70,12 @@ enum warning_type {
WARN_INPUT = 040000,
WARN_ESCAPE = 0100000,
WARN_SPACE = 0200000,
- WARN_FONT = 0400000
+ WARN_FONT = 0400000,
+ WARN_IG = 01000000
// change WARN_TOTAL if you add more warning types
};
-const int WARN_TOTAL = 0777777;
+const int WARN_TOTAL = 01777777;
int warning(warning_type, const char *,
const errarg & = empty_errarg,
diff --git a/troff/troff.man b/troff/troff.man
index a98a1f3d0..b9ff67984 100644
--- a/troff/troff.man
+++ b/troff/troff.man
@@ -150,6 +150,8 @@ means print every page up to
.IB n \-
means print every page from
.IR n .
+.B Troff
+will exit after printing the last page in the list.
.TP
.BI \-r cn
.TQ
@@ -274,7 +276,7 @@ nor
and so
.B troff
disallows this.
-Similarily it would make no sense to use a scaling indicator
+Similarly it would make no sense to use a scaling indicator
other than
.B z
or
@@ -702,12 +704,18 @@ have this property);
2
lines can be broken before the character
(initially no characters have this property);
+a line will not be broken at a character with this property
+unless the characters on each side both have non-zero
+hyphenation codes.
.TP
4
lines can be broken after the character
(initially characters
.B \-\e(hy\e(em
have this property);
+a line will not be broken at a character with this property
+unless the characters on each side both have non-zero
+hyphenation codes.
.TP
8
the character overlaps horizontally
@@ -853,7 +861,7 @@ will be special, that is, they will searched for characters not in
the current font.
Any fonts specified in the
.B special
-request will be searched before fonts specified in the
+request will be searched after fonts specified in the
.B fspecial
request.
.TP
@@ -1050,6 +1058,12 @@ exists, append to it instead of truncating it.
Print the names and contents of all currently defined number registers
on stderr.
.TP
+.BI .pso \ command
+This is behaves like the
+.B so
+request except that input comes from the standard output of
+.IR command .
+.TP
.B .ptr
Print the names and positions of all traps (not including input line
traps and diversion traps) on stderr. Empty slots in the page trap
@@ -1071,7 +1085,7 @@ Right justify the next
.I n
input lines.
Without an argument right justify the next input line.
-The number of lines to be right justifed is available in the
+The number of lines to be right justified is available in the
.B \en[.rj]
register.
This implicitly does
@@ -1790,7 +1804,9 @@ So, in most cases, at most one warning will be given for
use of a particular name.
.TP
.BR tab \t2048
-Use of a tab character where a number was expected.
+Inappropriate use of a tab character.
+Either use of a tab character where a number was expected,
+or use of tab character in an unquoted macro argument.
.TP
.BR right-brace \t4096
Use of
@@ -1821,6 +1837,13 @@ This warning will never occur in compatibility mode.
.BR font \t131072
Non-existent fonts.
This is enabled by default.
+.TP
+.BR ig \t262144
+Illegal escapes in text ignored with the
+.B ig
+request.
+These are conditions that are errors when they do not occur
+in ignored text.
.LP
There are also names that can be used to refer to groups of warnings:
.TP
diff --git a/xditview/ChangeLog b/xditview/ChangeLog
index 880201cc4..df19a85db 100644
--- a/xditview/ChangeLog
+++ b/xditview/ChangeLog
@@ -1,3 +1,18 @@
+Sat Feb 12 10:38:47 1994 James Clark (jjc@jclark.com)
+
+ * DviChar.c (Adobe_Symbol_map): Rename radicalex to rn.
+
+Thu May 27 20:30:12 1993 James Clark (jjc@jclark.com)
+
+ * device.c (isascii): Define if necessary.
+ (canonicalize_name): Cast argument to isdigit() to unsigned char.
+
+Thu Apr 29 18:36:57 1993 James Clark (jjc at jclark.com)
+
+ * xditview.c: Include <X11/Xos.h>.
+ (NewFile): Don't declare rindex(). Use strrchr() rather than
+ rindex().
+
Tue Mar 30 15:12:09 1993 James Clark (jjc at jclark)
* draw.c (charExists): Check that fi->per_char is not NULL.
diff --git a/xditview/Dvi.c b/xditview/Dvi.c
index 8402119a3..1748509d4 100644
--- a/xditview/Dvi.c
+++ b/xditview/Dvi.c
@@ -470,7 +470,7 @@ FindPage (dw)
while (dw->dvi.current_page != dw->dvi.requested_page) {
dw->dvi.current_page = ParseInput (dw);
/*
- * at EOF, seek back to the begining of this page.
+ * at EOF, seek back to the beginning of this page.
*/
if (!dw->dvi.readingTmp && feof (dw->dvi.file)) {
file_position = SearchPagePosition (dw,
diff --git a/xditview/DviChar.c b/xditview/DviChar.c
index dc511bf49..cd84d3530 100644
--- a/xditview/DviChar.c
+++ b/xditview/DviChar.c
@@ -492,7 +492,7 @@ static DviCharNameMap Adobe_Symbol_map = {
{ "]", "rB", /* 93 */},
{ "pp", /* 94 */},
{ "_", /* 95 */},
-{ "rn", /* 96 */},
+{ "radicalex", /* 96 */},
{ "*a", /* 97 */},
{ "*b", /* 98 */},
{ "*x", /* 99 */},
diff --git a/xditview/DviChar.h b/xditview/DviChar.h
index 4a8f6bbe6..b075240d3 100644
--- a/xditview/DviChar.h
+++ b/xditview/DviChar.h
@@ -6,7 +6,7 @@
* 256 elements (actually only 256-32 are usable).
*
* The encoding names are taken from X -
- * case insensitive, a dash seperating the
+ * case insensitive, a dash separating the
* CharSetRegistry from the CharSetEncoding
*/
diff --git a/xditview/Makefile b/xditview/Makefile
index 3a7430474..6dea45fc8 100644
--- a/xditview/Makefile
+++ b/xditview/Makefile
@@ -416,13 +416,16 @@ xditview.o: /local/include/X11/Xatom.h /local/include/X11/Xlib.h
xditview.o: /usr/include/sys/types.h /usr/include/sys/stdtypes.h
xditview.o: /usr/include/sys/sysmacros.h /local/include/X11/X.h
xditview.o: /local/include/X11/Xfuncproto.h /local/include/X11/Xosdefs.h
-xditview.o: /usr/include/stddef.h /local/include/X11/Intrinsic.h
+xditview.o: /usr/include/stddef.h /local/include/X11/Xos.h
+xditview.o: /usr/include/string.h /usr/include/fcntl.h
+xditview.o: /usr/include/sys/fcntlcom.h /usr/include/sys/stat.h
+xditview.o: /usr/include/unistd.h /usr/include/sys/time.h
+xditview.o: /usr/include/sys/time.h /local/include/X11/Intrinsic.h
xditview.o: /local/include/X11/Xutil.h /local/include/X11/Xresource.h
-xditview.o: /usr/include/string.h /local/include/X11/Core.h
-xditview.o: /local/include/X11/Composite.h /local/include/X11/Constraint.h
-xditview.o: /local/include/X11/Object.h /local/include/X11/RectObj.h
-xditview.o: /local/include/X11/StringDefs.h /local/include/X11/Shell.h
-xditview.o: /local/include/X11/Xaw/Paned.h
+xditview.o: /local/include/X11/Core.h /local/include/X11/Composite.h
+xditview.o: /local/include/X11/Constraint.h /local/include/X11/Object.h
+xditview.o: /local/include/X11/RectObj.h /local/include/X11/StringDefs.h
+xditview.o: /local/include/X11/Shell.h /local/include/X11/Xaw/Paned.h
xditview.o: /local/include/X11/Xmu/Converters.h
xditview.o: /local/include/X11/Xaw/Viewport.h /local/include/X11/Xaw/Form.h
xditview.o: /local/include/X11/Xaw/Reports.h /local/include/X11/Xaw/Box.h
diff --git a/xditview/TODO b/xditview/TODO
index 88a0dae2e..83a3ca163 100644
--- a/xditview/TODO
+++ b/xditview/TODO
@@ -8,7 +8,7 @@ font path.
Have character substitutions (currently done in draw.c:FakeCharacter)
specified in a resource (similar format to FontMap).
-The initial width of the dialog box should expand to accomodate the
+The initial width of the dialog box should expand to accommodate the
default value.
Option in Print dialog to specify that only the current page should be
diff --git a/xditview/device.c b/xditview/device.c
index 45cce4c6c..26c0f2a39 100644
--- a/xditview/device.c
+++ b/xditview/device.c
@@ -12,6 +12,10 @@
#define FONTPATH "/usr/local/lib/groff/font:/usr/local/lib/font:/usr/lib/font"
#endif
+#ifndef isascii
+#define isascii(c) (1)
+#endif
+
extern void exit();
extern char *strtok(), *strchr();
extern char *getenv();
@@ -307,7 +311,7 @@ char *canonicalize_name(s)
int n;
for (p = s + 4; *p; p++)
- if (!isascii(*p) || !isdigit(*p))
+ if (!isascii(*p) || !isdigit((unsigned char)*p))
return s;
n = atoi(s + 4);
if (n >= 0 && n <= 0xff) {
diff --git a/xditview/gxditview.man b/xditview/gxditview.man
index e4718aa7a..04cd446df 100644
--- a/xditview/gxditview.man
+++ b/xditview/gxditview.man
@@ -188,6 +188,35 @@ Specifies the default foreground color.
.TP
.BR font\ (class\ Font )
Specifies the font to be used for error messages.
+.TP
+.BR fontMap\ (class\ FontMap )
+Specifies the mapping from groff font names to X font names. This
+must be a string containing a sequence of lines. Each line contains
+two whitespace separated fields: first the groff font name, and
+secondly the X font name. The default is
+.nf
+"\e
+TR -adobe-times-medium-r-normal--*-100-*-*-*-*-iso8859-1\en\e
+TI -adobe-times-medium-i-normal--*-100-*-*-*-*-iso8859-1\en\e
+TB -adobe-times-bold-r-normal--*-100-*-*-*-*-iso8859-1\en\e
+TBI -adobe-times-bold-i-normal--*-100-*-*-*-*-iso8859-1\en\e
+CR -adobe-courier-medium-r-normal--*-100-*-*-*-*-iso8859-1\en\e
+CI -adobe-courier-medium-o-normal--*-100-*-*-*-*-iso8859-1\en\e
+CB -adobe-courier-bold-r-normal--*-100-*-*-*-*-iso8859-1\en\e
+CBI -adobe-courier-bold-o-normal--*-100-*-*-*-*-iso8859-1\en\e
+HR -adobe-helvetica-medium-r-normal--*-100-*-*-*-*-iso8859-1\en\e
+HI -adobe-helvetica-medium-o-normal--*-100-*-*-*-*-iso8859-1\en\e
+HB -adobe-helvetica-bold-r-normal--*-100-*-*-*-*-iso8859-1\en\e
+HBI -adobe-helvetica-bold-o-normal--*-100-*-*-*-*-iso8859-1\en\e
+NR -adobe-new century schoolbook-medium-r-normal--*-100-*-*-*-*-iso8859-1\en\e
+NI -adobe-new century schoolbook-medium-i-normal--*-100-*-*-*-*-iso8859-1\en\e
+NB -adobe-new century schoolbook-bold-r-normal--*-100-*-*-*-*-iso8859-1\en\e
+NBI -adobe-new century schoolbook-bold-i-normal--*-100-*-*-*-*-iso8859-1\en\e
+S -adobe-symbol-medium-r-normal--*-100-*-*-*-*-adobe-fontspecific\en\e
+SS -adobe-symbol-medium-r-normal--*-100-*-*-*-*-adobe-fontspecific\en\e
+"
+.fi
+
.SH "SEE ALSO"
.IR X (1),
.IR xrdb (1),
@@ -210,7 +239,7 @@ Richard L. Hyde (Purdue)
.br
David Slattengren (Berkeley)
.br
-Malcom Slaney (Schlumberger Palo Alto Research)
+Malcolm Slaney (Schlumberger Palo Alto Research)
.br
Mark Moraes (University of Toronto)
.br
diff --git a/xditview/xditview.c b/xditview/xditview.c
index 7179045ba..6894ceea6 100644
--- a/xditview/xditview.c
+++ b/xditview/xditview.c
@@ -33,6 +33,7 @@ static char rcsid[] = "$XConsortium: xditview.c,v 1.17 89/12/10 17:05:08 rws Exp
#include <X11/Xatom.h>
#include <X11/Xlib.h>
+#include <X11/Xos.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>
@@ -265,7 +266,7 @@ NewFile (name)
char *name;
{
Arg arg[2];
- char *n, *rindex ();
+ char *n;
FILE *new_file;
Boolean seek = 0;
@@ -294,7 +295,7 @@ char *name;
XtSetValues (dvi, arg, 2);
if (hadFile || name[0] != '-' || name[1] != '\0') {
XtSetArg (arg[0], XtNtitle, name);
- if (name[0] != '/' && (n = rindex (name, '/')))
+ if (name[0] != '/' && (n = strrchr (name, '/')))
n = n + 1;
else
n = name;