summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Clark <jjc@jclark.com>1991-11-17 07:11:17 -0500
committerJames Clark <jjc@jclark.com>1991-11-17 07:11:17 -0500
commitbd5385e4ea12522ba7e852fa3a628f3be854f674 (patch)
tree845f23ce5d37f4079e9ae8def6ab4013731838bb
parent351da0dcdf702cf243d26ffa998961bce2aa8653 (diff)
downloadgroff-git-bd5385e4ea12522ba7e852fa3a628f3be854f674.tar.gz
groff before CVS: release 1.041.04
-rw-r--r--BUG-REPORT7
-rw-r--r--CHANGES33
-rw-r--r--ChangeLog379
-rw-r--r--INSTALL121
-rw-r--r--Makefile137
-rw-r--r--PROBLEMS39
-rw-r--r--README25
-rw-r--r--VERSION2
-rw-r--r--doc/meintro.me1
-rw-r--r--driver/input.c1
-rw-r--r--dvi/devdvi/FontMakefile8
-rw-r--r--dvi/devdvi/Makefile2
-rw-r--r--dvi/devdvi/SA142
-rw-r--r--dvi/devdvi/SB132
-rw-r--r--dvi/devdvi/msam.map127
-rw-r--r--dvi/devdvi/msbm.map121
-rw-r--r--dvi/tfmtodit.c5
-rw-r--r--eqn/Makefile8
-rw-r--r--eqn/box.c26
-rw-r--r--eqn/box.h2
-rw-r--r--eqn/delim.c13
-rw-r--r--eqn/eqn.h1
-rw-r--r--eqn/lex.c16
-rw-r--r--eqn/main.c177
-rw-r--r--eqn/pbox.h3
-rw-r--r--etc/addftinfo.c2
-rw-r--r--etc/grog.pl2
-rw-r--r--etc/grog.sh2
-rw-r--r--etc/soelim.c1
-rw-r--r--gendef24
-rw-r--r--groff.c107
-rw-r--r--groff.sh2
-rw-r--r--lib/Makefile14
-rw-r--r--lib/font.c1
-rw-r--r--lib/fontfile.c1
-rw-r--r--lib/getcwd.c35
-rw-r--r--lib/lib.h6
-rw-r--r--lib/ptable.c16
-rw-r--r--lib/ptable.h34
-rw-r--r--lib/tmpfile.c98
-rw-r--r--macros/Makefile20
-rw-r--r--macros/tmac.an4
-rw-r--r--man/Makefile34
-rw-r--r--man/geqn.man3
-rw-r--r--man/gpic.man12
-rw-r--r--man/grefer.man4
-rw-r--r--man/groff.man29
-rw-r--r--man/grops.man49
-rwxr-xr-xman/mdate.sh8
-rw-r--r--mm/ChangeLog68
-rw-r--r--mm/Makefile83
-rw-r--r--mm/README16
-rw-r--r--mm/groff_mm.man604
-rw-r--r--mm/groff_mmse.man33
-rw-r--r--mm/mm/0.MT91
-rw-r--r--mm/mm/ms.MT47
-rw-r--r--mm/mm/ms.cov67
-rw-r--r--mm/mm/se_ms.cov3
-rw-r--r--mm/tmac.m2153
-rw-r--r--mm/tmac.mse39
-rw-r--r--pic/lex.c37
-rw-r--r--pic/main.c30
-rwxr-xr-xpic/make-dos-dist289
-rw-r--r--pic/object.c4
-rw-r--r--pic/object.h47
-rw-r--r--pic/output.c4
-rw-r--r--pic/pic.tab.c1923
-rw-r--r--pic/pic.y12
-rw-r--r--pic/troff.c10
-rw-r--r--ps/Makefile16
-rw-r--r--ps/devps/prologue1
-rw-r--r--ps/pfbtops.c26
-rw-r--r--ps/ps.c46
-rw-r--r--ps/ps.h6
-rw-r--r--ps/psbb.c2
-rw-r--r--ps/psrm.c11
-rw-r--r--ps/tmac.ps10
-rw-r--r--ps/tmac.psatk2
-rw-r--r--refer/Makefile34
-rw-r--r--refer/TODO10
-rw-r--r--refer/command.c1
-rw-r--r--refer/dirnamemax.c47
-rw-r--r--refer/genlimits.c44
-rw-r--r--refer/index.c7
-rw-r--r--refer/indxbib.c64
-rw-r--r--refer/label.tab.c2
-rw-r--r--refer/label.y2
-rw-r--r--refer/linear.c13
-rw-r--r--refer/lkbib.c3
-rw-r--r--refer/lookbib.c11
-rw-r--r--refer/refer.c17
-rw-r--r--refer/refer.h1
-rw-r--r--refer/search.c1
-rw-r--r--refer/search.h1
-rw-r--r--tbl/main.c153
-rw-r--r--tbl/table.c68
-rw-r--r--troff/Makefile11
-rw-r--r--troff/env.c37
-rw-r--r--troff/env.h1
-rw-r--r--troff/input.c78
-rw-r--r--troff/node.c17
-rw-r--r--troff/number.c14
-rw-r--r--troff/reg.c10
-rw-r--r--troff/token.h6
-rw-r--r--tty/tmac.tty2
-rw-r--r--xditview/ChangeLog67
-rw-r--r--xditview/Dvi.c55
-rw-r--r--xditview/DviChar.c12
-rw-r--r--xditview/DviP.h2
-rw-r--r--xditview/FontMap17
-rw-r--r--xditview/FontMap.X10017
-rw-r--r--xditview/FontMap.X7517
-rw-r--r--xditview/Imakefile56
-rw-r--r--xditview/Makefile476
-rw-r--r--xditview/README9
-rw-r--r--xditview/draw.c24
-rw-r--r--xditview/font.c114
-rw-r--r--xditview/gxditview.man8
-rw-r--r--xditview/page.c10
-rw-r--r--xditview/parse.c5
-rw-r--r--xditview/tmac.Xps5
-rw-r--r--xditview/xditview.c29
-rw-r--r--xditview/xtotroff.c144
123 files changed, 7438 insertions, 2000 deletions
diff --git a/BUG-REPORT b/BUG-REPORT
index 8448d8a95..49b019412 100644
--- a/BUG-REPORT
+++ b/BUG-REPORT
@@ -4,12 +4,13 @@ Please read the PROBLEMS file before sending in a bug report.
Please fill in all fields, even if you think they are not relevant.
+Please delete the text in brackets before sending it in.
+
Please report separate bugs separately.
Send the completed form either to bug-groff@prep.ai.mit.edu or
-directly to me: jjc@jclark.uucp or jjc%jclark@mcsun.eu.net (if neither
-of those works for you, jjc@ai.mit.edu should forward.) Messages sent
-to bug-groff can sometimes take several days to reach me.
+directly to me (jjc@jclark.com). Messages sent to bug-groff can
+sometimes take several days to reach me.
GROFF VERSION:
[The version of groff you are using. For example, `1.00']
diff --git a/CHANGES b/CHANGES
index a415584ce..071dc2bc4 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,37 @@
This file describes recent user-visible changes in groff. Bug fixes
are not described. There are more details in the man pages.
+VERSION 1.04
+============
+
+An implementation of the -mm macros is included.
+
+The directory in which temporary files are created can be controlled
+by setting the GROFF_TMPDIR or TMPDIR environment variables.
+
+Pic
+---
+
+Some MS-DOS support (see pic/make-dos-dist).
+
+Grops
+-----
+
+There are two new \X commands (\X'ps: invis' and \X'ps: endinvis')
+which make it possible to have substitute characters that are
+displayed when previewing with -TXps but ignored when printing with
+grops.
+
+Xditview
+--------
+
+Support for scalable fonts.
+
+VERSION 1.03
+============
+
+No changes other than bug fixes.
+
VERSION 1.02
============
@@ -42,7 +73,7 @@ The `mso' request is like the `so' request except that it searches for
the file in the same directories in which tmac.X is searched for when
the -mX option is given.
-The escape sequemce `\R' is similar to the `nr' request.
+The escape sequence `\R' is similar to the `nr' request.
Eqn
---
diff --git a/ChangeLog b/ChangeLog
index 8f186c169..0473cf043 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,384 @@
+Sun Nov 17 12:04:08 1991 James Clark (jjc at jclark)
+
+ * Version 1.04 released.
+
+Wed Nov 13 05:27:21 1991 James Clark (jjc at jclark)
+
+ * macros/tmac.an (TH): Define a macro an-init to define variables
+ based on command line arguments.
+ (an-header): Call it.
+
+Sun Nov 3 12:07:34 1991 James Clark (jjc at jclark)
+
+ * Makefile (install.mm): Rename to install.dwbmm.
+
+ * Makefile: Integrate mm.
+ * mm: New directory.
+
+Wed Oct 30 10:11:34 1991 James Clark (jjc at jclark)
+
+ * refer/dirnamemax.c: If PATHCONF_MISSING is defined, include
+ <sys/types.h>.
+
+ * pic/troff.c (troff_output::simple_spline,
+ troff_output::simple_polygon): Rename variable `v' to `d' to avoid
+ shadowing parameter.
+
+ * lib/tmpfile.c (xtmpfile): Declare dir as const char *.
+
+ * lib/ptable.h: Add explicit casts when converting from unsigned
+ long to unsigned.
+
+ * dvi/devdvi/{SA,SB,msam.map,msbm.map}: New files.
+ * dvi/devdvi/Makefile: Install SA, SB.
+
+ * refer/indxbib.c: Add declaration of mktemp.
+
+ * refer/lookbib.c: Add declaration of isatty.
+
+Fri Oct 25 09:00:17 1991 James Clark (jjc at jclark)
+
+ * pic/lex.c (interpolate_macro_with_args): While collecting
+ arguments, keep track of whether we're in a string.
+
+Wed Oct 23 08:42:48 1991 James Clark (jjc at jclark)
+
+ * ps/tmac.ps (PSPIC): Do the .sp after the \X, and move the \X
+ down with \v, so as to avoid problems with top of page trap
+ setting no space mode.
+
+Tue Oct 22 17:38:49 1991 James Clark (jjc at jclark)
+
+ * eqn/lex.c (get_delimited_text): Allow tab before macro body.
+
+Tue Oct 15 17:24:53 1991 James Clark (jjc at jclark)
+
+ * ps/psrm.c (ps_get_line): Fix bug when lines longer than 255.
+ Improve error message.
+
+Fri Oct 11 11:09:38 1991 James Clark (jjc at jclark)
+
+ * ps/psrm.c (print_ps_string): Don't pass negative numbers to
+ printf("%03o");
+
+Wed Oct 9 17:50:14 1991 James Clark (jjc at jclark)
+
+ * groff.c (possible_command::execp): Always use _exit() after a
+ failed exec.
+
+ * Makefile: Add HAVE_UNION_WAIT, HAVE_PID_T, WAIT_COREDUMP_0200,
+ NO_SYS_WAIT_H configuration options.
+ * groff.c: Use these options. Use POSIX-style macros to extract
+ fields from the status returned by wait().
+
+Fri Oct 4 12:12:27 1991 James Clark (jjc at jclark)
+
+ * tbl/table.c (table::compute_separation_factor): Allow the
+ separation factor to drop to 0.
+
+Tue Oct 1 18:12:38 1991 James Clark (jjc at jclark)
+
+ * refer/search.c: Include <errno.h>.
+
+Sun Sep 29 08:40:57 1991 James Clark (jjc at jclark)
+
+ * pic/pic.y (YYDEBUG): Don't define for Borland C++.
+
+ * lib/lib.h: #ifdef out declarations of itoa and iftoa for Borland
+ C++.
+
+ * pic/lex.c (input_stack::bol): Move definition out of class body.
+
+ * pic/main.c: On MSDOS munge argv[0].
+
+ * lib/ptable.h: Define name2 as _Paste2 for Borland C++.
+
+ * lib/ptable.c (hash_string): Use unsigned long rather than
+ unsigned.
+ (next_ptable_size): Use unsigned rather than int. Give an error
+ message if we've hit the largest table size.
+ * lib/ptable.c: Corresponding changes. Also use unsigneds for the
+ table size.
+
+ * pic/object.h (object_spec): Make flags unsigned long. Declare
+ flags as const unisgned long rather than as enums.
+
+ * pic/output.c: Deleted.
+
+ * pic/troff.c (troff_output::simple_ellipse): Remove spurious %.
+
+ * tbl/table.c (simple_entry::note_double_vrule_on_{left,right}):
+ Add additional argument.
+ (line_entry::note_double_vrule_on_{left,right}): Set value of
+ douvle_vrule_on_{right,left} flag according to argument.
+ (simple_line_entry::simple_print,
+ simple_line_entry::double_line_print): If adjacent to double vrule
+ on a corner extend rather than shorten the rule by half the double
+ vrule sep.
+
+ * troff/number.c (parse_term): In checking for overflow, handle the
+ case where the current horizontal position is negative.
+
+Thu Sep 12 08:26:09 1991 James Clark (jjc at jclark)
+
+ * pic/object.c (draw_arrow): Check for object having zero length.
+
+Wed Sep 11 10:32:38 1991 James Clark (jjc at jclark)
+
+ * eqn/main.c (do_file): Split off inline equation handling into...
+ (inline_equation): New function. Search for starting delimiter
+ using...
+ (delim_search): New function. Don't recognize a delimiter that
+ occurs in the name of an escape sequence, number register, string
+ etc.
+
+Tue Sep 10 04:01:11 1991 James Clark (jjc at jclark)
+
+ * eqn/delim.c (delim_box::compute_metrics): Don't call
+ define_extensible_string if left is 0.
+ (delim_box::output): Don't print the left delimiter if left is 0.
+ (delim_box::debug_print): Check for left == 0 before calling printf.
+
+Fri Aug 23 13:02:30 1991 James Clark (jjc at jclark)
+
+ * troff/Makefile (majorminor.c): Include only digits in
+ minor_version.
+
+Thu Aug 22 09:35:37 1991 James Clark (jjc at jclark)
+
+ * refer/dirnamemax.c: new file.
+ * refer/genlimits.c: Deleted.
+ * refer/indxbib.c (main): Use dir_name_max() instead of NAME_MAX.
+ Don't check path length.
+ * refer/Makefile: Add dir_name_max.o; delete genlimits.
+ * Makefile: Add PATHCONF_MISSING option.
+
+ * refer/indxbib.c (get_cwd): New function.
+ (main): Use get_cwd().
+ * lib/getcwd.c: New file.
+ * Makefile: Delete -DHAVE_GETWD. Include GETCWD variable. Pass
+ GETCWD in SUBFLAGS.
+ * lib/Makefile: Compile getcwd.o.
+
+ * ps/tmac.psatk (psatk-defs): Define showpage after pushing
+ userdict.
+
+ * refer/indxbib.c (main): Check success of mktemp.
+
+ * lib/tmpfile.c: New file.
+ * lib/Makefile: Add tmpfile.c.
+ * lib/lib.h: Declare xtmpfile(); include <stdio.h>.
+ * ps/ps.h: Delete declaration of mktemp().
+ * ps/ps.c (ps_printer::ps_printer): Use xtmpfile().
+ * refer/refer.c (divert_to_temporary_file): Use xtmpfile().
+ * driver/driver.h: No need now to include errno.h.
+
+ * everywhere: Set errno to 0 before calling fopen().
+
+ * eqn/eqn.h, etc/soelim.c, driver/driver.h, etc/addftinfo.c,
+ dvi/tfmtodit.c, groff.c, refer/index.c, refer/linear.c,
+ refer/lookbib.c, refer/refer.h, ps/psbb.c: Include <errno.h>.
+
+Mon Aug 19 10:52:18 1991 James Clark (jjc at jclark)
+
+ * troff/env.h (translate_space_to_dummy): Declare it.
+ * troff/env.c (environment::space_newline, environment::space):
+ If translate_space_to_dummy is set then make the width of spaces 0.
+ * troff/input.c (translate): If the second character of a
+ translation is a space, translate to unbreakable space. If the
+ first character is a space, set or clear translate_space_to_dummy
+ according to whether the second character is \&. Weird!
+
+Tue Jul 30 10:03:56 1991 James Clark (jjc at jclark)
+
+ * groff.c (run_commands): Don't use non-zero exit code because a
+ command gets SIGPIPE.
+
+ * groff.c, groff.sh: Use -mXps with -TXps.
+
+ * ps/ps.c (ps_printer::special): Move call to flush_sbuf() into...
+ (ps_printer::do_exec, ps_printer::do_file, ps_printer::do_def,
+ ps_printer::do_mdef, ps_printer::do_import): Call flush_sbuf().
+ (ps_printer::special): New specials invis and endinvis.
+ (ps_printer::do_invis, ps_printer::do_endinvis): New functions.
+ (ps_printer::set_char, ps_printer::draw): Return if invis_count>0.
+ (ps_printer::end_page): Check that invis_count == 0.
+ (ps_printer::invis_count): New member.
+ (ps_printer::ps_printer): Initialize invis_count to 0.
+
+ * troff/env.c (environment::hyphenate_line): Hyphenation
+ indicator at beginning of word inhibits splitting after -, \(em
+ etc.
+
+ * pic/pic.y (element): Allow another element to follow } without
+ any intervening separator.
+
+Mon Jul 22 12:27:37 1991 James Clark (jjc at jclark)
+
+ * pic/lex.c (get_delimited): Allow tabs before delimiter.
+
+Wed Jul 17 10:59:08 1991 James Clark (jjc at jclark)
+
+ * groff.c: Get rid of HAVE_UNION_WAIT stuff. Instead suppress
+ declaration of wait() in header files.
+ * Makefile: Get rid of -DHAVE_UNION_WAIT.
+
+ * tbl/table.c (alphabetic_text_entry::add_tab): New function.
+
+ * lib/lib.h: Declare return type of strerror as char *.
+
+ * man/Makefile: Add g flag to sed substitutions.
+ * Makefile (shgroff, bindist): Likewise.
+
+Sun Jul 14 11:57:02 1991 James Clark (jjc at jclark)
+
+ * ps/ps.c (ps_printer::do_import): Move push of userdict into...
+ * ps/devps/prologue (PBEGIN): Define showpage after pushing
+ userdict.
+
+Sat Jul 13 20:53:04 1991 James Clark (jjc at jclark)
+
+ * ps/devps/prologue (PBEGIN): Zap any definition of showpage in
+ userdict.
+
+Fri Jul 12 07:10:09 1991 James Clark (jjc at jclark)
+
+ * man/mdate.sh: Handle the fact that BSD ls -l does not print the
+ group.
+
+Sun Jul 7 08:00:23 1991 James Clark (jjc at jclark)
+
+ * troff/input.c (define_number_reg): If currently undefined,
+ don't define it if the argument is an invalid expression.
+
+ * Makefile: Ignore return value of `if' commands without `else'
+ parts.
+
+ * Makefile: Split up CPPDEFINES into a series of separate
+ configuration options.
+
+ * troff/input.c (init_registers): Use time_t instead of long
+ unless LONG_FOR_TIME_T is defined. Use returned result rather
+ than passing pointer.
+ * Makefile: Document LONG_FOR_TIME_T as a CPPDEFINE.
+
+ * lib/Makefile (fontpath.h): Use gendef.
+
+Thu Jul 4 09:48:05 1991 James Clark (jjc at jclark)
+
+ * troff/input.c (input_iterator::shift): Delete argument name.
+ * troff/node.c (suppress_output_file::really_begin_page,
+ suppress_output_file::really_transparent_char, node::ascii_print,
+ node::tprint): Delete names of unused arguments.
+
+Wed Jul 3 17:34:57 1991 James Clark (jjc at jclark)
+
+ * refer/label.y (string): Pass $4 to command_error.
+
+Tue Jul 2 15:06:01 1991 James Clark (jjc at jclark)
+
+ * Version 1.03 released.
+
+Sat Jun 29 08:14:01 1991 James Clark (jjc at jclark)
+
+ * Makefile: Pass definition of SHELL in SUBFLAGS.
+
+ * gendef: New file.
+ * Makefile, eqn/Makefile, refer/Makefile, troff/Makefile,
+ ps/Makefile: Use gendef to construct header files that are
+ constructed from the Makefile.
+
+ * macros/Makefile: make all should build stripped version of tmac.e.
+
+ * refer/Makefile (clean): Remove y.output.
+
+Fri Jun 28 09:44:36 1991 James Clark (jjc at jclark)
+
+ * ps/pfbtops.c (main): Add -v option which prints out a version
+ number.
+ * ps/Makefile (pfbtops): Link with libgroff.a.
+
+Fri Jun 21 07:43:23 1991 James Clark (jjc at jclark)
+
+ * refer/search.h (linear_searcher::get_nkeys): Delete declaration.
+ * refer/linear.c (linear_searcher::get_nkeys): Delete definition.
+
+ * refer/lkbib.c (main): Always terminate reference with blank
+ line.
+ * refer/lookbib.c (main): Likewise.
+
+ * refer/linear.c (file_buffer::load): Check that the file is not a
+ binary file.
+
+ * refer/Makefile (genlimits): Possibly add -DHAVE_SYS_DIR_H.
+ (genlimits.c): Include <sys/dir.h> if HAVE_SYS_DIR_H is defined.
+ Delete second inclusion of <sys/param.h>.
+
+Tue Jun 18 01:32:26 1991 James Clark (jjc at jclark)
+
+ * troff/token.h (token::special): Deleted.
+
+ * tbl/main.c (process_format): Rework so that opt->tab_char is
+ recognized only when appropriate.
+
+ * ps/Makefile (clean): Remove pfbtops.
+
+Sun Jun 16 09:37:19 1991 James Clark (jjc at jclark)
+
+ * lib/font.c (text_file::next): Don't return if we have got a
+ blank line.
+
+Fri Jun 14 09:52:26 1991 James Clark (jjc at jclark)
+
+ * refer/refer.c (store_reference): Get hash code from old_table[i]
+ when rehashing the table.
+
+Thu Jun 13 01:26:43 1991 James Clark (jjc at jclark)
+
+ * eqn/box.c (box::top_level): Save size and prev size using \R and
+ restore it afterwards. Set the size to the size at the beginning
+ of the line.
+ * eqn/pbox.h: Declare SAVED_INLINE_PREV_SIZE_REG,
+ SAVED_INLINE_SIZE_REG, and SAVED_SIZE_REG.
+
+ * refer/Makefile (limits.h): Use ./genlimits.
+
+Wed Jun 12 16:05:34 1991 James Clark (jjc at jclark)
+
+ * refer/index.c: Delete declarations of stat() and fstat().
+
+Tue Jun 11 14:52:49 1991 James Clark (jjc at jclark)
+
+ * tty/tmac.tty: Add character definitions for \(>= and \(<=.
+
+Mon Jun 10 22:49:48 1991 James Clark (jjc at jclark)
+
+ * etc/grog.sh, etc/grog.pl: Change regex for .PS.
+
+Fri Jun 7 09:13:06 1991 James Clark (jjc at jclark)
+
+ * troff/input.c (token::get_char): Handle \e.
+
+ * refer/linear.c: Delete declarations of fstat() and stat().
+
+Wed Jun 5 09:11:59 1991 James Clark (jjc at jclark)
+
+ * troff/node.c, troff/env.c, troff/input.c, Makefile: Remove
+ OP_DELETE_BROKEN stuff, since we now have a fix for g++.
+
+Mon Jun 3 13:41:32 1991 James Clark (jjc at jclark)
+
+ * troff/input.c (do_define_macro): Improve error handling for end
+ of file while defining macro.
+
Sun Jun 2 10:20:24 1991 James Clark (jjc at jclark)
+ * eqn/box.h: Fix declaration of set_gsize.
+ * eqn/box.c (set_gsize): Make argument const char *.
+ (gsize): Declare as char *.
+ * eqn/main.c (main): Don't convert gsize to int.
+ * eqn/lex.c (do_gsize): Pass char * to set_gsize.
+
* Version 1.02 released.
Sat Jun 1 12:19:46 1991 James Clark (jjc at jclark)
diff --git a/INSTALL b/INSTALL
index ce3ac520e..27bd271d8 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,110 +1,9 @@
-Groff has been compiled on a Sun 4 under SunOS 4.1.1 with g++ 1.39.1
-and with AT&T C++ 2.0, and on a 386 PC under 386/ix 2.0.1 with g++
-1.37.1 using Michael Bloom's GNU COFF patches. You may encounter
-problems on other machines that I cannot anticipate.
-
If you are using g++, you will need to install the header files from
libg++. The only other parts of libg++ used by groff are contained in
the files xyzzy.c and gnulib3.c; the libg++.a that I use contains only
xyzzy.o and gnulib3.o. You don't need xyzzy.o unless you're using GNU
ld.
-If you're using g++ 1.39 on a sparc you'll probably want to apply the
-following fix (from Casper H.S. Dik):
-
-*** config/out-sparc.c.org Wed Dec 12 03:13:57 1990
---- config/out-sparc.c Sat Feb 23 23:21:26 1991
-***************
-*** 908,925 ****
- else if (GET_CODE (XEXP (operands[1], 0)) == PLUS)
- {
- rtx inc_reg = XEXP (XEXP (operands[1], 0), 0);
- if (inc_reg == frame_pointer_rtx
- && GET_CODE (XEXP (XEXP (operands[1], 0), 1)) == REG
-! && XEXP (XEXP (operands[1], 0), 0) != frame_pointer_rtx)
- inc_reg = XEXP (XEXP (operands[1], 0), 1);
- if (inc_reg == frame_pointer_rtx)
- {
- output_asm_insn ("mov %%fp,%%g1", xoperands);
- inc_reg = gen_rtx (REG, SImode, 1);
- }
- xoperands[1] = inc_reg;
- output_asm_insn ("add 4,%1,%1", xoperands);
-! xoperands[1] = operands[1];
- output_asm_insn ("ld %1,%0", xoperands);
- xoperands[1] = inc_reg;
- output_asm_insn ("add -4,%1,%1", xoperands);
---- 908,931 ----
- else if (GET_CODE (XEXP (operands[1], 0)) == PLUS)
- {
- rtx inc_reg = XEXP (XEXP (operands[1], 0), 0);
-+ rtx from = operands[1];
- if (inc_reg == frame_pointer_rtx
- && GET_CODE (XEXP (XEXP (operands[1], 0), 1)) == REG
-! && XEXP (XEXP (operands[1], 0), 1) != frame_pointer_rtx)
- inc_reg = XEXP (XEXP (operands[1], 0), 1);
- if (inc_reg == frame_pointer_rtx)
- {
- output_asm_insn ("mov %%fp,%%g1", xoperands);
- inc_reg = gen_rtx (REG, SImode, 1);
-+ from = gen_rtx (GET_CODE (operands[1]),
-+ GET_MODE (operands[1]),
-+ gen_rtx (PLUS, GET_MODE (XEXP (operands[1], 0)),
-+ inc_reg,
-+ XEXP (XEXP (operands[1], 0), 1)));
- }
- xoperands[1] = inc_reg;
- output_asm_insn ("add 4,%1,%1", xoperands);
-! xoperands[1] = from;
- output_asm_insn ("ld %1,%0", xoperands);
- xoperands[1] = inc_reg;
- output_asm_insn ("add -4,%1,%1", xoperands);
-***************
-*** 989,1006 ****
- else if (GET_CODE (XEXP (operands[0], 0)) == PLUS)
- {
- rtx inc_reg = XEXP (XEXP (operands[0], 0), 0);
- if (inc_reg == frame_pointer_rtx
- && GET_CODE (XEXP (XEXP (operands[0], 0), 1)) == REG
-! && XEXP (XEXP (operands[0], 0), 0) != frame_pointer_rtx)
- inc_reg = XEXP (XEXP (operands[0], 0), 1);
- if (inc_reg == frame_pointer_rtx)
- {
- output_asm_insn ("mov %%fp,%%g1", xoperands);
- inc_reg = gen_rtx (REG, SImode, 1);
- }
- xoperands[0] = inc_reg;
- output_asm_insn ("add 4,%0,%0", xoperands);
-! xoperands[0] = operands[0];
- output_asm_insn ("st %r1,%0", xoperands);
- xoperands[0] = inc_reg;
- output_asm_insn ("add -4,%0,%0", xoperands);
---- 995,1018 ----
- else if (GET_CODE (XEXP (operands[0], 0)) == PLUS)
- {
- rtx inc_reg = XEXP (XEXP (operands[0], 0), 0);
-+ rtx to = operands[0];
- if (inc_reg == frame_pointer_rtx
- && GET_CODE (XEXP (XEXP (operands[0], 0), 1)) == REG
-! && XEXP (XEXP (operands[0], 0), 1) != frame_pointer_rtx)
- inc_reg = XEXP (XEXP (operands[0], 0), 1);
- if (inc_reg == frame_pointer_rtx)
- {
- output_asm_insn ("mov %%fp,%%g1", xoperands);
- inc_reg = gen_rtx (REG, SImode, 1);
-+ to = gen_rtx (GET_CODE (operands[0]),
-+ GET_MODE (operands[0]),
-+ gen_rtx (PLUS, GET_MODE (XEXP (operands[0], 0)),
-+ inc_reg,
-+ XEXP (XEXP (operands[0], 0), 1)));
- }
- xoperands[0] = inc_reg;
- output_asm_insn ("add 4,%0,%0", xoperands);
-! xoperands[0] = to;
- output_asm_insn ("st %r1,%0", xoperands);
- xoperands[0] = inc_reg;
- output_asm_insn ("add -4,%0,%0", xoperands);
-
On a Sun 3 and other 68k machines, using libg++ 1.37.0 you will need
to apply the following change to g++-include/math.h:
@@ -236,9 +135,8 @@ Makefile, and also do
so that the parsers will be regenerated using yacc (the supplied
*.tab.[ch] files were generated by bison.)
-If you want to install xditview, you'll need to do that separately:
-change directory to xditview, edit the Makefile, do a make and a make
-install. You'll need to be running X11R4.
+If you want to install xditview, you'll need to do that separately.
+Follow the instructions in xditview/INSTALL.
The dvi files produced by grodvi can use fonts at non-standard
magnifications. You may need to compile fonts with Metafont at these
@@ -252,12 +150,15 @@ macro or request and its arguments, it is good idea to produce a
version with spaces so that you can use it with groff (without having
to use the -C flag). The file macros/fixmacros.sed is a sed script
which will attempt to edit a file of macros so that it can be used
-with groff without the -C flag. If you have the DWB 2.0 mm macros
-installed on your machine, you might want to do a `make install.mm';
-this will copy the mm macros to groff's macro directory and fix a few
-problems that occur when using the mm macros with groff; this requires
-the `patch' program. If the patch in macros/mm.diff is rejected,
-carefully apply it by hand.
+with groff without the -C flag.
+
+If you have the DWB 2.0 mm macros installed on your machine, you might
+want to do a `make install.dwbmm'; this will copy the mm macros to
+groff's macro directory and fix a few problems that occur when using
+the DWB mm macros with groff; this requires the `patch' program. If
+the patch in macros/mm.diff is rejected, carefully apply it by hand.
+If you do this make sure that TMAC_M=gm in the Makefile, so that the
+groff mm macros are installed as -mgm.
You can share groff with a friend who has the same type of machine as
you, but does not have a C++ compiler. First do `make bindist'; this
diff --git a/Makefile b/Makefile
index 000de0282..d52059b17 100644
--- a/Makefile
+++ b/Makefile
@@ -93,6 +93,9 @@ MAN7DIR=$(MANROOT)/man$(MAN7EXT)
# groff -ms -M/usr/lib/tmac.
TMAC_S=gs
+# Similarily, the groff mm macros will be available as -m$(TMAC_M).
+TMAC_M=gm
+
# 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.
@@ -114,28 +117,62 @@ TMAC_S=gs
# A value of 7 is equivalent to -DBROKEN_SPOOLER of earlier releases.
BROKEN_SPOOLER_FLAGS=7
-# Include -DCFRONT_ANSI_BUG in CPPDEFINES if you are using AT&T C++
-# 2.0 with an ANSI C compiler backend.
-# Include -DOP_DELETE_BROKEN if you're using g++ 1.39.0 or 1.39.1.
-# Include -DHAVE_VFORK if you have vfork().
-# Include -DHAVE_SYS_SIGLIST if you have sys_siglist[].
-# Include -DHAVE_UNION_WAIT if wait() is declared by osfcn.h to take
-# an argument of type union wait * (Sun C++ does this). Don't include
-# it if you're using the libg++ header files.
-# Include -DHAVE_MMAP if you have the mmap() system call
-# (and you want to use it).
-# Include -DHAVE_RENAME if you have the rename() system call.
-# Include -DHAVE_GETWD if you have the getwd() library function.
-
-CPPDEFINES=#-DCFRONT_ANSI_BUG -DOP_DELETE_BROKEN -DHAVE_VFORK -DHAVE_SYS_SIGLIST -DHAVE_UNION_WAIT -DHAVE_MMAP -DHAVE_RENAME -DHAVE_GETWD
+# Uncomment the next line if you are using AT&T C++ 2.0 with an ANSI C
+# compiler backend.
+D1=#-DCFRONT_ANSI_BUG
+
+# Uncomment the next line if you have vfork().
+D2=#-DHAVE_VFORK
+
+# Uncomment the next line if you have sys_siglist[].
+D3=#-DHAVE_SYS_SIGLIST
+
+# Uncomment the next line if you have the mmap() system call (and you
+# want to use it).
+D4=#-DHAVE_MMAP
+
+# Uncomment the next line if you have the rename() system call.
+D5=#-DHAVE_RENAME
+
+# Uncomment the next line if the argument to localtime() is a long*
+# rather than a time_t*.
+D6=#-DLONG_FOR_TIME_T
+
+# Uncomment the next line if wait is declared by your C++ header files
+# to take an argument of type union wait *.
+D7=#-DHAVE_UNION_WAIT
+
+# Uncoment the next line if your C++ header files declare a type pid_t
+# which is used as the return type of fork() and wait().
+D8=#-DHAVE_PID_T
+
+# Uncomment the next line 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. This is true for traditional Unix
+# implementations, but not necessarily for all POSIX systems.
+D9=-DWAIT_COREDUMP_0200
+
+# Uncomment the next line if <sys/wait.h> should not be included
+# when using wait(). Use this with the libg++ header files.
+D10=-DNO_SYS_WAIT_H
+
+# Uncomment the next line if you do not have the POSIX pathconf()
+# function. You will need this on old UNIX systems that do not
+# support POSIX.
+PATHCONF_MISSING=#-DPATHCONF_MISSING
# Uncomment the next line if you don't have fmod in your math library.
-# I believe this is needed on Ultrix and BSD 4.3.
-# FMOD=fmod.o
+# I believe this is needed on old versions of Ultrix and BSD 4.3.
+FMOD=#fmod.o
# Uncomment the next line if you don't have strtol in your C library.
# I believe this is needed on BSD 4.3.
-# STRTOL=strtol.o
+STRTOL=#strtol.o
+
+# Uncomment the next line if you don't have getcwd in your library.
+# An emulation in terms of getwd() will be provided. I believe this
+# is needed on BSD 4.3.
+GETCWD=#getcwd.o
# Additional flags needed to compile the GNU Emacs malloc.
# Use this with BSD.
@@ -166,7 +203,7 @@ GROFF=groff
GROG=grog.sh
# The next line should be uncommented if you want to use the new perl
# version.
-# GROG=grog.pl
+# GROG=grog.pl
# CC is the C++ compiler
CC=g++
@@ -177,7 +214,7 @@ CC=g++
OLDCC=gcc
PROFILE_FLAG=
-DEBUG_FLAG=-g
+DEBUG_FLAG=
OPTIMIZE_FLAG=-O
WARNING_FLAGS=#-Wall -Wcast-qual -Wwrite-strings
@@ -186,7 +223,7 @@ XCFLAGS=
# CFLAGS are passed to sub makes
CFLAGS=$(PROFILE_FLAG) $(DEBUG_FLAG) $(OPTIMIZE_FLAG) $(WARNING_FLAGS) \
- $(CPPDEFINES) $(XCFLAGS)
+$(D1) $(D2) $(D3) $(D4) $(D5) $(D6) $(D7) $(D8) $(D9) $(D10) $(XCFLAGS)
XOLDCFLAGS=
# OLDCFLAGS are passed to sub makes
@@ -217,26 +254,27 @@ ETAGSFLAGS=-p
SHELL=/bin/sh
-SUBDIRS=lib troff pic tbl eqn refer etc driver ps tty dvi macros man
+SUBDIRS=lib troff pic tbl eqn refer etc driver ps tty dvi macros man mm
# SUBFLAGS says what flags to pass to sub makes
-SUBFLAGS="CC=$(CC)" "CFLAGS=$(CFLAGS)" "LDFLAGS=$(LDFLAGS)" \
+SUBFLAGS="SHELL=$(SHELL)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "LDFLAGS=$(LDFLAGS)" \
"OLDCC=$(OLDCC)" "OLDCFLAGS=$(OLDCFLAGS)" \
"YACC=$(YACC)" "YACCFLAGS=$(YACCFLAGS)" \
"DEVICE=$(DEVICE)" "FONTPATH=$(FONTPATH)" "MACROPATH=$(MACROPATH)" \
"MALLOCFLAGS=$(MALLOCFLAGS)" "MALLOC=$(MALLOC)" \
- "FMOD=$(FMOD)" "STRTOL=$(STRTOL)" "GROG=$(GROG)" \
+ "FMOD=$(FMOD)" "STRTOL=$(STRTOL)" "GETCWD=$(GETCWD)" "GROG=$(GROG)" \
"AR=$(AR)" "RANLIB=$(RANLIB)" "LIBS=$(LIBS)" "MLIBS=$(MLIBS)" \
"FONTDIR=$(FONTDIR)" "BINDIR=$(BINDIR)" "PAGE=$(PAGE)" \
"MACRODIR=$(MACRODIR)" "HYPHENFILE=$(HYPHENFILE)" \
- "TMAC_S=$(TMAC_S)" "MAN1EXT=$(MAN1EXT)" "MAN1DIR=$(MAN1DIR)" \
- "MAN5EXT=$(MAN5EXT)" "MAN5DIR=$(MAN5DIR)" \
+ "TMAC_S=$(TMAC_S)" "TMAC_M=$(TMAC_M)" "MAN1EXT=$(MAN1EXT)" \
+ "MAN1DIR=$(MAN1DIR)" "MAN5EXT=$(MAN5EXT)" "MAN5DIR=$(MAN5DIR)" \
"MAN7EXT=$(MAN7EXT)" "MAN7DIR=$(MAN7DIR)" \
"BROKEN_SPOOLER_FLAGS=$(BROKEN_SPOOLER_FLAGS)" \
"INDEX_SUFFIX=$(INDEX_SUFFIX)" \
"DEFAULT_INDEX_DIR=$(DEFAULT_INDEX_DIR)" \
"DEFAULT_INDEX_NAME=$(DEFAULT_INDEX_NAME)" \
- "COMMON_WORDS_FILE=$(COMMON_WORDS_FILE)"
+ "COMMON_WORDS_FILE=$(COMMON_WORDS_FILE)" \
+ "PATHCONF_MISSING=$(PATHCONF_MISSING)"
INCLUDES=-Ilib
@@ -261,7 +299,7 @@ TAGS: FORCE
topclean: FORCE
-rm -f shgroff
- -rm -f groff *.o core device.h device.h.n
+ -rm -f groff *.o core device.h
clean: topclean FORCE
@for dir in $(SUBDIRS) doc; do \
@@ -286,7 +324,7 @@ install.nobin: FORCE shgroff
@for dir in $(SUBDIRS); do \
echo Making install.nobin in $$dir; \
(cd $$dir; $(MAKE) $(SUBFLAGS) install.nobin); done
- if [ -z "$(GROFF)" ] ; \
+ -if [ -z "$(GROFF)" ] ; \
then rm -f $(BINDIR)/groff ; \
cp shgroff $(BINDIR)/groff ; fi
@@ -295,13 +333,13 @@ install.bin: FORCE $(GROFF)
@for dir in $(SUBDIRS); do \
echo Making install.bin in $$dir; \
(cd $$dir; $(MAKE) $(SUBFLAGS) install.bin); done
- if [ -n "$(GROFF)" ] ; \
+ -if [ -n "$(GROFF)" ] ; \
then rm -f $(BINDIR)/groff ; \
cp groff $(BINDIR)/groff ; fi
install: install.bin install.nobin
-install.mm: FORCE
+install.dwbmm: FORCE
-[ -d $(GROFFLIBDIR) ] || mkdir $(GROFFLIBDIR)
-[ -d $(MACRODIR) ] || mkdir $(MACRODIR)
-rm -f $(MACRODIR)/tmac.m
@@ -315,12 +353,12 @@ install.mm: FORCE
shgroff: groff.sh
@echo Making $@ from groff.sh
@-rm -f $@
- @sed -e "s;@BINDIR@;$(BINDIR);" \
- -e "s;@DEVICE@;$(DEVICE);" \
- -e "s;@PROG_PREFIX@;$(PROG_PREFIX);" \
- -e "s;@FONTDIR@;$(FONTDIR);" \
- -e "s;@PSPRINT@;$(PSPRINT);" \
- -e "s;@DVIPRINT@;$(DVIPRINT);" \
+ @sed -e "s;@BINDIR@;$(BINDIR);g" \
+ -e "s;@DEVICE@;$(DEVICE);g" \
+ -e "s;@PROG_PREFIX@;$(PROG_PREFIX);g" \
+ -e "s;@FONTDIR@;$(FONTDIR);g" \
+ -e "s;@PSPRINT@;$(PSPRINT);g" \
+ -e "s;@DVIPRINT@;$(DVIPRINT);g" \
groff.sh >$@ || rm -f $@
@chmod +x $@
@@ -330,11 +368,10 @@ groff: groff.o lib/libgroff.a
lib/libgroff.a: lib
device.h: FORCE
- @echo \#define DEVICE \"$(DEVICE)\" >device.h.n
- @echo \#define PSPRINT `$(SHELL) stringify $(PSPRINT)` >>device.h.n
- @echo \#define DVIPRINT `$(SHELL) stringify $(DVIPRINT)` >>device.h.n
- @cmp -s device.h device.h.n || cp device.h.n device.h
- @rm -f device.h.n
+ @$(SHELL) gendef $@ \
+ "DEVICE=\"$(DEVICE)\"" \
+ "PSPRINT=`$(SHELL) stringify $(PSPRINT)`" \
+ "DVIPRINT=`$(SHELL) stringify $(DVIPRINT)`"
groff.o: device.h lib/lib.h lib/errarg.h lib/error.h lib/stringclass.h \
lib/font.h
@@ -346,16 +383,16 @@ bindist: all VERSION Makefile.bd README.bd FORCE
(cd $$dir; $(MAKE) $(SUBFLAGS) "BINDIR=$$topdir/bindist" install.bin); done
cp README.bd bindist/README
cp VERSION bindist
- if [ -n "$(GROFF)" ] ; then cp groff bindist/groff ; fi
+ -if [ -n "$(GROFF)" ] ; then cp groff bindist/groff ; fi
@echo Making bindist/Makefile
- @sed -e "s;@GROFFLIBDIR@;$(GROFFLIBDIR);" \
- -e "s;@FONTDIR@;$(FONTDIR);" \
- -e "s;@FONTPATH@;$(FONTPATH);" \
- -e "s;@MACRODIR@;$(MACRODIR);" \
- -e "s;@MACROPATH@;$(MACROPATH);" \
- -e "s;@HYPHENFILE@;$(HYPHENFILE);" \
- -e "s;@DEVICE@;$(DEVICE);" \
- -e "s;@GROFF@;$(GROFF);" \
+ @sed -e "s;@GROFFLIBDIR@;$(GROFFLIBDIR);g" \
+ -e "s;@FONTDIR@;$(FONTDIR);g" \
+ -e "s;@FONTPATH@;$(FONTPATH);g" \
+ -e "s;@MACRODIR@;$(MACRODIR);g" \
+ -e "s;@MACROPATH@;$(MACROPATH);g" \
+ -e "s;@HYPHENFILE@;$(HYPHENFILE);g" \
+ -e "s;@DEVICE@;$(DEVICE);g" \
+ -e "s;@GROFF@;$(GROFF);g" \
Makefile.bd >bindist/Makefile
FORCE:
diff --git a/PROBLEMS b/PROBLEMS
index b6e86dc92..f2b612e47 100644
--- a/PROBLEMS
+++ b/PROBLEMS
@@ -20,7 +20,7 @@ Include -DCFRONT_ANSI_BUG in CPPDEFINES in the top-level Makefile. If
that doesn't solve the problem, define INT_MIN as -INT_MAX in
lib/lib.h.
-* Using SunOS 4.1, gtroff aborts in malloc.
+* Using SunOS 4.1 or 4.1.1, gtroff aborts in malloc.
Include -DSUNOS_LOCALTIME_BUG in MALLOCFLAGS in the top-level Makefile.
@@ -38,21 +38,30 @@ INSTALL file.
* I get errors when I try to compile groff with Sun C++.
-Groff requires ANSI C style header files. The Sun C++ header files
-need some changes to meet this requirement: <string.h> must declare
-the mem* functions, (just add `#include <memory.h>' to <string.h>);
-the first argument to fopen and freopen should be declared as `const
-char *'; the first argument to fread should be declared as `void *';
-malloc should be declared to return `void *'. You can either change
+Groff requires header files that are moderately compatible with AT&T
+C++ and ANSI C. With some versions of Sun C++, the supplied header
+files need some of the following changes to meet this requirement:
+<string.h> must declare the mem* functions, (just add `#include
+<memory.h>' to <string.h>); the first argument to fopen and freopen
+should be declared as `const char *'; the first argument to fread
+should be declared as `void *'; the first argument to fwrite should be
+declared as `const void *'; malloc should be declared to return `void
+*'; in <alloca.h>, the declaration `extern "C" { void
+*__builtin_alloca(int); }' should be added; declarations of getopt(),
+optarg, optind and opterr should be added to <stdlib.h>; in
+<sys/signal.h> the return type and the second argument type of
+signal() should be changed to be `void (*)(int)'.
+
+ You can either change
them in place, or copy them to some other directory and include that
directory with a -I option.
* I get the error `make[2]: execve: /bin/sh: Arg list too long.'.
-If you're using GNU make, try using /bin/make instead. Otherwise if
-you have the `env' command, try changing occurrences of $(MAKE) in the
-top-level Makefile to
- env - PATH=/bin:/usr/bin $(MAKE)
+If you're using GNU make, try using /bin/make instead. Alternatively,
+if you're using GNU make 3.59 or later, do something like:
+ echo .NOEXPORT: >make.noexport
+ MAKEFILES=`pwd`/make.noexport; export MAKEFILES
* pic output is not centered horizontally; pictures sometimes run off
the bottom of the page.
@@ -246,3 +255,11 @@ Use groff -TXps.
* In gpic expressions don't work at all. I'm using g++ 1.39 on a sparc.
This is a bug in gcc/g++ 1.39. Apply the fix given in the INSTALL file.
+
+* When I try to run gxditview, I get the error:
+Error: Widget viewport has zero width and/or height
+
+This error means you haven't correctly installed the application
+defaults file, GXditview.ad; ``make install'' does this for you
+automatically, so either you didn't do ``make install'', or you don't
+have imake configured correctly.
diff --git a/README b/README
index b4b2ac701..fe73ce3e9 100644
--- a/README
+++ b/README
@@ -1,14 +1,17 @@
-This is the beta-test version of the GNU groff document formatting
-system. The version number is given in the file VERSION.
+This is the GNU groff document formatting system. The version number
+is given in the file VERSION.
Included in this release are implementations of troff, pic, eqn, tbl,
refer, the -man macros and the -ms macros, and drivers for PostScript,
TeX dvi format, and typewriter-like devices. Also included is a
-modified version of the Berkeley -me macros, and an enhanced version
-of the X11R4 xditview.
+modified version of the Berkeley -me macros, an enhanced version of
+the X11 xditview previewer, and an implementation of the -mm macros
+contributed by Joergen Haegg (jh@efd.lth.se).
You will require a C++ compiler implementing version 2.0 of the C++
-language. I suggest GNU C++ 1.37.1 (rather than 1.39.1).
+language. I suggest GNU C++ version 1.40.3. (Do not use version
+1.39.) You will also require C++ header files that are fairly
+compliant with ANSI C.
See the file INSTALL for installation instructions.
@@ -23,6 +26,14 @@ For the moment, the documentation assumes that you are already
familiar with the Unix versions of troff, -man, -ms and the
preprocessors.
+People occasionally ask me where they can get binaries of groff for
+various systems. If you are prepared to make binaries available,
+please let me know and tell me how people can get them, the systems
+they will run on, and the version of groff they are for. (See the
+last paragraph of the INSTALL file for how to make a binary
+distribution.) I'll keep a list which I can send to people who are
+looking for binaries.
+
Please report bugs using the form in the file BUG-REPORT; the idea of
this is to make sure that I have all the information I need to fix the
bug. At the very least, read the BUG-REPORT form and make sure that
@@ -33,6 +44,4 @@ bug reports, I would be interested in suggestions for improvements to
groff (no matter how small).
James Clark
-jjc@jclark.uucp
-jjc%jclark@mcsun.eu.net
-jjc@gnu.ai.mit.edu
+jjc@jclark.com
diff --git a/VERSION b/VERSION
index 101047359..11a84add6 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.02
+1.04
diff --git a/doc/meintro.me b/doc/meintro.me
index c31d6f172..3d2640cf7 100644
--- a/doc/meintro.me
+++ b/doc/meintro.me
@@ -19,7 +19,6 @@
.\"UC 7
.ll 6.5i
.lt 6.5i
-.pn 0
.ds MO @VERSION@
.nr si 3n
.he 'USING GROFF AND \-ME''%'
diff --git a/driver/input.c b/driver/input.c
index 746fe4f16..84d0e4c15 100644
--- a/driver/input.c
+++ b/driver/input.c
@@ -50,6 +50,7 @@ void do_file(const char *filename)
current_file = stdin;
}
else {
+ errno = 0;
current_file = fopen(filename, "r");
if (current_file == 0) {
error("can't open `%1'", filename);
diff --git a/dvi/devdvi/FontMakefile b/dvi/devdvi/FontMakefile
index fb6f1b864..31237a691 100644
--- a/dvi/devdvi/FontMakefile
+++ b/dvi/devdvi/FontMakefile
@@ -20,7 +20,7 @@
TFMDIR=tfm
GFDIR=gf
TFMTODIT=../tfmtodit
-FONTS=R I B BI CW MI S EX H HI HB
+FONTS=R I B BI CW MI S EX H HI HB SA SB
SPECIALFLAG=-s
all: $(FONTS)
@@ -71,4 +71,10 @@ HI: texr.map
$(TFMTODIT) -g $(GFDIR)/cmssi10.300gf \
$(TFMDIR)/cmssi10.tfm texb.map $@
+SA: msam.map
+ $(TFMTODIT) $(SPECIALFLAG) $(TFMDIR)/msam10.tfm msam.map $@
+
+SB: msbm.map
+ $(TFMTODIT) $(SPECIALFLAG) $(TFMDIR)/msbm10.tfm msbm.map $@
+
$(FONTS): $(TFMTODIT)
diff --git a/dvi/devdvi/Makefile b/dvi/devdvi/Makefile
index bb318342b..0ac8544a6 100644
--- a/dvi/devdvi/Makefile
+++ b/dvi/devdvi/Makefile
@@ -17,7 +17,7 @@
#with groff; see the file LICENSE. If not, write to the Free Software
#Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-FONTS=R I B BI CW MI S EX H HI HB
+FONTS=R I B BI CW MI S EX H HI HB SA SB
FONTDIR=/usr/local/lib/groff/font
DEVICEDIR=$(FONTDIR)/devdvi
diff --git a/dvi/devdvi/SA b/dvi/devdvi/SA
new file mode 100644
index 000000000..e0768c0b6
--- /dev/null
+++ b/dvi/devdvi/SA
@@ -0,0 +1,142 @@
+name SA
+special
+internalname msam10
+checksum -1749815603
+designsize 10485760
+charset
+boxdot 815562,709446 2 0000
+boxplus 815562,709446 2 0001
+boxtimes 815562,709446 2 0002
+square 815562,709446 2 0003
+blacksquare 815562,709446 2 0004
+centerdot 291272,576570 2 0005
+lozenge 699053,728178,116509 3 0006
+blacklozenge 699053,728178,116509 3 0007
+circlearrowright 815562,610248,85960 3 0010
+circlearrowleft 815562,610248,85960 3 0011
+rightleftharpoons 1048579,547770,14197 3 0012
+leftrightharpoons 1048579,547770,14197 3 0013
+boxminus 815562,709446 2 0014
+Vdash 757307,728178 2 0015
+Vvdash 932070,728178 2 0016
+vDash 640798,728178 2 0017
+twoheadrightarrow 1048579,547770,14197 3 0020
+twoheadleftarrow 1048579,547770,14197 3 0021
+leftleftarrows 1048579,709446,189584 3 0022
+rightrightarrows 1048579,709446,189584 3 0023
+upuparrows 873816,728178,203888 3 0024
+downdownarrows 873816,728178,203888 3 0025
+upharpoonright 436909,728178,203888 3 0026
+downharpoonright 436909,728178,203888 3 0027
+upharpoonleft 436909,728178,203888 3 0030
+downharpoonleft 436909,728178,203888 3 0031
+rightarrowtail 1165088,547770,14197 3 0032
+leftarrowtail 1165088,547770,14197 3 0033
+leftrightarrows 1048579,709446,189584 3 0034
+rightleftarrows 1048579,709446,189584 3 0035
+Lsh 524290,728178 2 0036
+Rsh 524290,728178 2 0037
+rightsquigarrow 1048579,396238,-139592 0 0040
+leftrightsquigarrow 1456360,396238,-139592 0 0041
+looparrowleft 1048579,576570 2 0042
+looparrowright 1048579,576570 2 0043
+circeq 815562,765021,240733 3 0044
+succsim 815562,765021,240733 3 0045
+gtrsim 815562,765021,240733 3 0046
+gtrapprox 815562,792549,268261 3 0047
+multimap 1165088,576570 2 0050
+3d 699053,728178 2 0051
+tf "
+therefore "
+because 699053,728178 2 0052
+doteqdot 815562,610248,85960 3 0053
+triangleq 815562,961197,85960 3 0054
+precsim 815562,765021,240733 3 0055
+lesssim 815562,765021,240733 3 0056
+lessapprox 815562,792549,268261 3 0057
+eqslantless 815562,667592,143304 3 0060
+eqslantgtr 815562,667592,143304 3 0061
+curlyeqprec 815562,667592,143304 3 0062
+curlyeqsucc 815562,667592,143304 3 0063
+preccurlyeq 815562,667592,143304 3 0064
+leqq 815562,792549,268261 3 0065
+leqslant 815562,667592,143304 3 0066
+lessgtr 815562,709446,189584 3 0067
+backprime 288358,576570 2 0070
+--- 524290,486557,-37731 2 0071
+risingdotseq 815562,610248,85960 3 0072
+fallingdotseq 815562,610248,85960 3 0073
+succcurlyeq 815562,667592,143304 3 0074
+geqq 815562,792549,268261 3 0075
+geqslant 815562,667592,143304 3 0076
+gtrless 815562,709446,189584 3 0077
+sqsubset 815562,576570,36882 3 0100
+sqsupset 815562,576570,36882 3 0101
+vartriangleright 815562,576570,36882 3 0102
+vartriangleleft 815562,576570,36882 3 0103
+trianglerighteq 815562,667592,143304 3 0104
+trianglelefteq 815562,667592,143304 3 0105
+bigstar 990323,728178,203888 3 0106
+between 524290,792549,268261 3 0107
+blacktriangledown 757307,576570 2 0110
+blacktriangleright 815562,576570,36882 3 0111
+blacktriangleleft 815562,576570,36882 3 0112
+--- 524290,486557,-37731 2 0113
+--- 524290,486557,-37731 2 0114
+vartriangle 757307,576570 2 0115
+blacktriangle 757307,576570 2 0116
+triangledown 757307,576570 2 0117
+eqcirc 815562,728178 2 0120
+lesseqgtr 815562,928714,404426 3 0121
+gtreqless 815562,928714,404426 3 0122
+lesseqqgtr 815562,1030294,506006 3 0123
+gtreqqless 815562,1030294,506006 3 0124
+char165 786434,709446,0,26214 2 0125
+Ye "
+yen "
+Rrightarrow 1048579,667592,143304 3 0126
+Lleftarrow 1048579,667592,143304 3 0127
+OK 873816,728178 2 0130
+checkmark "
+veebar 640798,728178,203888 3 0131
+barwedge 640798,728178,203888 3 0132
+doublebarwedge 640798,792549,203888 3 0133
+/_ 757307,728178 2 0134
+angle "
+measuredangle 757307,728178 2 0135
+sphericalangle 757307,547770,36882 3 0136
+varpropto 815562,728178 2 0137
+smallsmile 815562,728178,203888 3 0140
+smallfrown 815562,728178,203888 3 0141
+Subset 815562,576570,36882 3 0142
+Supset 815562,576570,36882 3 0143
+Cup 699053,576570 2 0144
+Cap 699053,576570 2 0145
+curlywedge 797355,576570 2 0146
+curlyvee 797355,576570 2 0147
+leftthreetimes 815562,728178 2 0150
+rightthreetimes 815562,728178 2 0151
+subseteqq 815562,792549,268261 3 0152
+supseteqq 815562,792549,268261 3 0153
+bumpeq 815562,576570,63568 3 0154
+Bumpeq 815562,576570,63568 3 0155
+lll 1398106,576570,36882 3 0156
+ggg 1398106,576570,36882 3 0157
+ulcorner 524290,728178 2 0160
+urcorner 524290,728178 2 0161
+rg 992648,709446,159430 3 0162
+char174 "
+circledR "
+circledS 946045,709446,159430 3 0163
+pitchfork 699053,728178 2 0164
+dotplus 815562,728178,85960 3 0165
+backsim 815562,396238,-139592 0 0166
+backsimeq 815562,486557,-37731 2 0167
+llcorner 524290,396238 0 0170
+lrcorner 524290,396238 0 0171
+maltese 873816,728178 2 0172
+complement 524290,865080 2 0173
+intercal 582544,451470,203888 1 0174
+circledcirc 815562,610248,85960 3 0175
+circledast 815562,610248,85960 3 0176
+circleddash 815562,610248,85960 3 0177
diff --git a/dvi/devdvi/SB b/dvi/devdvi/SB
new file mode 100644
index 000000000..a4be59db2
--- /dev/null
+++ b/dvi/devdvi/SB
@@ -0,0 +1,132 @@
+name SB
+special
+internalname msbm10
+spacewidth 314576
+slant 87.709390
+checksum -2001332536
+designsize 10485760
+charset
+lvertneqq 815562,794042,263635 3 0000
+gvertneqq 815562,794042,263635 3 0001
+nleq 815562,832390,317448 3 0002
+ngeq 815562,832390,317448 3 0003
+nless 815562,740048,215760 3 0004
+ngtr 815562,740048,215760 3 0005
+nprec 815562,740048,215760 3 0006
+nsucc 815562,740048,215760 3 0007
+lneqq 815562,794042,263635 3 0010
+gneqq 815562,794042,263635 3 0011
+nleqslant 815562,832390,317448 3 0012
+ngeqslant 815562,832390,317448 3 0013
+lneq 815562,666864,142576 3 0014
+gneq 815562,666864,142576 3 0015
+npreceq 815562,832390,317448 3 0016
+nsucceq 815562,832390,317448 3 0017
+precnsim 815562,777110,243501 3 0020
+succnsim 815562,777110,243501 3 0021
+lnsim 815562,777110,243501 3 0022
+gnsim 815562,777110,243501 3 0023
+nleqq 815562,964179,439891 3 0024
+ngeqq 815562,964179,439891 3 0025
+precneqq 815562,794042,263635 3 0026
+succneqq 815562,794042,263635 3 0027
+precnapprox 815562,794042,274379 3 0030
+succnapprox 815562,794042,274379 3 0031
+lnapprox 815562,794042,274379 3 0032
+gnapprox 815562,794042,274379 3 0033
+nsim 815562,384696,-139592 0 0034
+ncong 815562,832390,317448 3 0035
+diagup 932070,722352,203888 3 0036
+diagdown 932070,777110,203888 3 0037
+varsubsetneq 815562,666864,142576 3 0040
+varsupsetneq 815562,666864,142576 3 0041
+nsubseteqq 815562,794042,263635 3 0042
+nsupseteqq 815562,794042,263635 3 0043
+subsetneqq 815562,832390,298650 3 0044
+supsetneqq 815562,832390,298650 3 0045
+varsubsetneqq 815562,794042,263635 3 0046
+varsupsetneqq 815562,794042,263635 3 0047
+subsetneq 815562,666864,142576 3 0050
+supsetneq 815562,666864,142576 3 0051
+nsubseteq 815562,832390,317448 3 0052
+nsupseteq 815562,832390,317448 3 0053
+nparallel 524290,777110,263635 3 0054
+nmid 291272,777110,263635 3 0055
+nshortmid 233018,609920,85632 3 0056
+nshortparallel 407781,609920,85632 3 0057
+nvdash 640798,722352 2 0060
+nVdash 757307,722352 2 0061
+nvDash 640798,722352 2 0062
+nVDash 757307,722352 2 0063
+ntrianglerighteq 815562,832390,317448 3 0064
+ntrianglelefteq 815562,832390,317448 3 0065
+ntriangleleft 815562,740048,215760 3 0066
+ntriangleright 815562,740048,215760 3 0067
+nleftarrow 1048579,384696,-139592 0 0070
+nrightarrow 1048579,384696,-139592 0 0071
+nLeftarrow 1048579,384696,-139592 0 0072
+nRightarrow 1048579,384696,-139592 0 0073
+nLeftrightarrow 1048579,384696,-139592 0 0074
+nleftrightarrow 1048579,384696,-139592 0 0075
+divideontimes 815562,609920,85632 3 0076
+varnothing 815562,609920,85632 3 0077
+nexists 582544,722352 2 0100
+BbbA 757307,722352 2 0101
+BbbB 699053,722352 2 0102
+BbbC 757307,722352 2 0103
+BbbD 757307,722352 2 0104
+BbbE 699053,722352 2 0105
+BbbF 640798,722352 2 0106
+BbbG 815562,722352 2 0107
+BbbH 815562,722352 2 0110
+BbbI 407781,722352 2 0111
+BbbJ 524290,722352,174763 3 0112
+BbbK 815562,722352 2 0113
+BbbL 699053,722352 2 0114
+BbbM 990325,722352 2 0115
+BbbN 757307,722352 2 0116
+BbbO 815562,722352,174763 3 0117
+BbbP 640798,722352 2 0120
+BbbQ 815562,722352,174763 3 0121
+BbbR 757307,722352 2 0122
+BbbS 582544,722352 2 0123
+BbbT 699053,722352 2 0124
+BbbU 757307,722352 2 0125
+BbbV 757307,722352 2 0126
+BbbW 1048579,722352 2 0127
+BbbX 757307,722352 2 0130
+BbbY 757307,722352 2 0131
+BbbZ 699053,722352 2 0132
+--- 1980650,865080 2 0133
+--- 2446685,865080 2 0134
+--- 1980650,865080 2 0135
+--- 2446685,943717 2 0136
+Finv 582544,722352 2 0140
+Game 669925,722352 2 0141
+mho 757307,722352 2 0146
+eth 582544,722352 2 0147
+eqsim 815562,486275,-38013 2 0150
+beth 699053,722352 2 0151
+gimel 466035,722352 2 0152
+daleth 699053,722352 2 0153
+lessdot 815562,565285,40997 3 0154
+gtrdot 815562,565285,40997 3 0155
+ltimes 815562,609920,85632 3 0156
+rtimes 815562,609920,85632 3 0157
+shortmid 233018,609920,85632 3 0160
+shortparallel 407781,609920,85632 3 0161
+smallsetminus 815562,609920,85632 3 0162
+thicksim 815562,384696,-139592 0 0163
+thickapprox 815562,506590,-17698 2 0164
+approxeq 815562,609920,85632 3 0165
+succapprox 815562,794042,274379 3 0166
+precapprox 815562,794042,274379 3 0167
+curvearrowleft 1048579,451470 0 0170
+curvearrowright 1048579,451470 0 0171
+digamma 815562,609920,85632 3 0172
+varkappa 699053,451470,0,42235 0 0173
+Bbbk 582544,722352 2 0174
+hslash 566525,722352 2 0175
+-h 566525,722352 2 0176
+hbar "
+backepsilon 450016,451470 0 0177
diff --git a/dvi/devdvi/msam.map b/dvi/devdvi/msam.map
new file mode 100644
index 000000000..9e5e5f90b
--- /dev/null
+++ b/dvi/devdvi/msam.map
@@ -0,0 +1,127 @@
+# Map for the AMSFonts 2.0 msam font using TeX names.
+# Contributed by Zdzislaw Meglicki (Zdzislaw.Meglicki@arp.anu.edu.au).
+0 boxdot
+1 boxplus
+2 boxtimes
+3 square
+4 blacksquare
+5 centerdot
+6 lozenge
+7 blacklozenge
+8 circlearrowright
+9 circlearrowleft
+10 rightleftharpoons
+11 leftrightharpoons
+12 boxminus
+13 Vdash
+14 Vvdash
+15 vDash
+16 twoheadrightarrow
+17 twoheadleftarrow
+18 leftleftarrows
+19 rightrightarrows
+20 upuparrows
+21 downdownarrows
+22 upharpoonright
+23 downharpoonright
+24 upharpoonleft
+25 downharpoonleft
+26 rightarrowtail
+27 leftarrowtail
+28 leftrightarrows
+29 rightleftarrows
+30 Lsh
+31 Rsh
+32 rightsquigarrow
+33 leftrightsquigarrow
+34 looparrowleft
+35 looparrowright
+36 circeq
+37 succsim
+38 gtrsim
+39 gtrapprox
+40 multimap
+41 therefore tf 3d
+42 because
+43 doteqdot
+44 triangleq
+45 precsim
+46 lesssim
+47 lessapprox
+48 eqslantless
+49 eqslantgtr
+50 curlyeqprec
+51 curlyeqsucc
+52 preccurlyeq
+53 leqq
+54 leqslant
+55 lessgtr
+56 backprime
+58 risingdotseq
+59 fallingdotseq
+60 succcurlyeq
+61 geqq
+62 geqslant
+63 gtrless
+64 sqsubset
+65 sqsupset
+66 vartriangleright
+67 vartriangleleft
+68 trianglerighteq
+69 trianglelefteq
+70 bigstar
+71 between
+72 blacktriangledown
+73 blacktriangleright
+74 blacktriangleleft
+77 vartriangle
+78 blacktriangle
+79 triangledown
+80 eqcirc
+81 lesseqgtr
+82 gtreqless
+83 lesseqqgtr
+84 gtreqqless
+85 yen Ye char165
+86 Rrightarrow
+87 Lleftarrow
+88 checkmark OK
+89 veebar
+90 barwedge
+91 doublebarwedge
+92 angle /_
+93 measuredangle
+94 sphericalangle
+95 varpropto
+96 smallsmile
+97 smallfrown
+98 Subset
+99 Supset
+100 Cup
+101 Cap
+102 curlywedge
+103 curlyvee
+104 leftthreetimes
+105 rightthreetimes
+106 subseteqq
+107 supseteqq
+108 bumpeq
+109 Bumpeq
+110 lll
+111 ggg
+112 ulcorner
+113 urcorner
+114 circledR char174 rg
+115 circledS
+116 pitchfork
+117 dotplus
+118 backsim
+119 backsimeq
+120 llcorner
+121 lrcorner
+122 maltese
+123 complement
+124 intercal
+125 circledcirc
+126 circledast
+127 circleddash
diff --git a/dvi/devdvi/msbm.map b/dvi/devdvi/msbm.map
new file mode 100644
index 000000000..07ee095d4
--- /dev/null
+++ b/dvi/devdvi/msbm.map
@@ -0,0 +1,121 @@
+# Map for the AMSFonts 2.0 msbm font using TeX names.
+# Contributed by Zdzislaw Meglicki (Zdzislaw.Meglicki@arp.anu.edu.au).
+0 lvertneqq
+1 gvertneqq
+2 nleq
+3 ngeq
+4 nless
+5 ngtr
+6 nprec
+7 nsucc
+8 lneqq
+9 gneqq
+10 nleqslant
+11 ngeqslant
+12 lneq
+13 gneq
+14 npreceq
+15 nsucceq
+16 precnsim
+17 succnsim
+18 lnsim
+19 gnsim
+20 nleqq
+21 ngeqq
+22 precneqq
+23 succneqq
+24 precnapprox
+25 succnapprox
+26 lnapprox
+27 gnapprox
+28 nsim
+29 ncong
+30 diagup
+31 diagdown
+32 varsubsetneq
+33 varsupsetneq
+34 nsubseteqq
+35 nsupseteqq
+36 subsetneqq
+37 supsetneqq
+38 varsubsetneqq
+39 varsupsetneqq
+40 subsetneq
+41 supsetneq
+42 nsubseteq
+43 nsupseteq
+44 nparallel
+45 nmid
+46 nshortmid
+47 nshortparallel
+48 nvdash
+49 nVdash
+50 nvDash
+51 nVDash
+52 ntrianglerighteq
+53 ntrianglelefteq
+54 ntriangleleft
+55 ntriangleright
+56 nleftarrow
+57 nrightarrow
+58 nLeftarrow
+59 nRightarrow
+60 nLeftrightarrow
+61 nleftrightarrow
+62 divideontimes
+63 varnothing
+64 nexists
+65 BbbA
+66 BbbB
+67 BbbC
+68 BbbD
+69 BbbE
+70 BbbF
+71 BbbG
+72 BbbH
+73 BbbI
+74 BbbJ
+75 BbbK
+76 BbbL
+77 BbbM
+78 BbbN
+79 BbbO
+80 BbbP
+81 BbbQ
+82 BbbR
+83 BbbS
+84 BbbT
+85 BbbU
+86 BbbV
+87 BbbW
+88 BbbX
+89 BbbY
+90 BbbZ
+96 Finv
+97 Game
+102 mho
+103 eth
+104 eqsim
+105 beth
+106 gimel
+107 daleth
+108 lessdot
+109 gtrdot
+110 ltimes
+111 rtimes
+112 shortmid
+113 shortparallel
+114 smallsetminus
+115 thicksim
+116 thickapprox
+117 approxeq
+118 succapprox
+119 precapprox
+120 curvearrowleft
+121 curvearrowright
+122 digamma
+123 varkappa
+124 Bbbk
+125 hslash
+126 hbar -h
+127 backepsilon
diff --git a/dvi/tfmtodit.c b/dvi/tfmtodit.c
index b2f4b56c4..a563ba425 100644
--- a/dvi/tfmtodit.c
+++ b/dvi/tfmtodit.c
@@ -51,6 +51,7 @@ both be zero. */
#include <stdlib.h>
#include <math.h>
#include <string.h>
+#include <errno.h>
#include "lib.h"
#include "errarg.h"
#include "error.h"
@@ -271,6 +272,7 @@ int read4(unsigned char *&s)
int tfm::load(const char *file)
{
+ errno = 0;
FILE *fp = fopen(file, "r");
if (!fp) {
error("can't open `%1': %2", file, strerror(errno));
@@ -410,6 +412,7 @@ int gf::load(const char *file)
int pending_adjustment = 0;
int left_adj, right_adj;
const int gf_id_byte = 131;
+ errno = 0;
FILE *fp = fopen(file, "r");
if (!fp) {
error("can't open `%1': %2", file, strerror(errno));
@@ -595,6 +598,7 @@ char_list::char_list(const char *s, char_list *p) : ch(strsave(s)), next(p)
int read_map(const char *file, char_list **table)
{
+ errno = 0;
FILE *fp = fopen(file, "r");
if (!fp) {
error("can't open `%1': %2", file, strerror(errno));
@@ -734,6 +738,7 @@ int main(int argc, char **argv)
char_list *table[256];
if (!read_map(map_file, table))
return 1;
+ errno = 0;
if (!freopen(font_file, "w", stdout)) {
error("can't open `%1' for writing: %2", font_file, strerror(errno));
return 1;
diff --git a/eqn/Makefile b/eqn/Makefile
index a81c60798..09380867e 100644
--- a/eqn/Makefile
+++ b/eqn/Makefile
@@ -49,7 +49,7 @@ eqn.tab.c: eqn.y
eqn.tab.o: eqn.h box.h
box.o: eqn.h box.h pbox.h
limit.o: eqn.h box.h pbox.h
-text.o: eqn.h box.h pbox.h
+text.o: eqn.h box.h pbox.h ../lib/ptable.h
over.o: eqn.h box.h pbox.h
list.o: eqn.h box.h pbox.h
script.o: eqn.h box.h pbox.h
@@ -60,12 +60,10 @@ sqrt.o: eqn.h box.h pbox.h
pile.o: eqn.h box.h pbox.h
special.o: eqn.h box.h pbox.h
main.o: device.h eqn.h box.h ../lib/stringclass.h
-lex.o: eqn.h eqn.tab.c box.h ../lib/stringclass.h
+lex.o: eqn.h eqn.tab.c box.h ../lib/stringclass.h ../lib/ptable.h
device.h: FORCE
- @echo \#define DEVICE \"$(DEVICE)\" >device.h.n
- @cmp -s device.h device.h.n || cp device.h.n device.h
- @rm -f device.h.n
+ @$(SHELL) ../gendef $@ "DEVICE=\"$(DEVICE)\""
install.bin: eqn
-[ -d $(BINDIR) ] || mkdir $(BINDIR)
diff --git a/eqn/box.c b/eqn/box.c
index 6178cf3f3..634dd0705 100644
--- a/eqn/box.c
+++ b/eqn/box.c
@@ -26,8 +26,8 @@ const char *current_roman_font;
char *gfont = 0;
char *grfont = 0;
char *gbfont = 0;
+char *gsize = 0;
-int gsize = 0;
int script_size_reduction = -1; // negative means reduce by a percentage
int positive_space = -1;
@@ -148,9 +148,10 @@ void set_space(int n)
positive_space = n;
}
-void set_gsize(int n)
+void set_gsize(const char *s)
{
- gsize = n;
+ delete gsize;
+ gsize = strsave(s);
}
void set_script_reduction(int n)
@@ -252,8 +253,9 @@ void box::top_level()
printf(".ft\n");
printf(".nr " SAVED_PREV_FONT_REG " \\n[.f]\n");
printf(".ft %s\n", get_gfont());
- if (gsize > 0)
- b = new size_box(strsave(itoa(gsize)), b);
+ printf(".nr " SAVED_SIZE_REG " \\n[.s]z\n");
+ if (gsize)
+ b = new size_box(strsave(gsize), b);
current_roman_font = get_grfont();
// This catches tabs used within \Z (which aren't allowed).
b->check_tabs(0);
@@ -274,15 +276,23 @@ void box::top_level()
// so we cannot use \E there; so we hide it in a string instead.
printf(".ds " RESTORE_FONT_STRING " "
"\\f[\\\\n[" SAVED_INLINE_PREV_FONT_REG "]]"
- "\\f[\\\\n[" SAVED_INLINE_FONT_REG "]]\n");
+ "\\f[\\\\n[" SAVED_INLINE_FONT_REG "]]"
+ "\n");
printf(".as " LINE_STRING " "
"\\R'" SAVED_INLINE_FONT_REG " \\En[.f]'"
"\\fP"
- "\\R'" SAVED_INLINE_PREV_FONT_REG " \\En[.f]'");
+ "\\R'" SAVED_INLINE_PREV_FONT_REG " \\En[.f]'"
+ "\\R'" SAVED_INLINE_SIZE_REG " \\En[.s]z'"
+ "\\s0"
+ "\\R'" SAVED_INLINE_PREV_SIZE_REG " \\En[.s]z'");
printf("\\f[%s]", get_gfont());
+ printf("\\s'\\En[" SAVED_SIZE_REG "]u'");
current_roman_font = get_grfont();
b->output();
- printf("\\E*[" RESTORE_FONT_STRING "]\n");
+ printf("\\E*[" RESTORE_FONT_STRING "]"
+ "\\s'\\En[" SAVED_INLINE_PREV_SIZE_REG "]u'"
+ "\\s'\\En[" SAVED_INLINE_SIZE_REG "]u'"
+ "\n");
if (r == FOUND_LINEUP)
printf(".if r" SAVED_MARK_REG " .as " LINE_STRING " \\h'\\n["
MARK_WIDTH_REG "]u-\\n[" SAVED_MARK_REG "]u-(\\n["
diff --git a/eqn/box.h b/eqn/box.h
index aeaf5e46b..4e2985722 100644
--- a/eqn/box.h
+++ b/eqn/box.h
@@ -254,7 +254,7 @@ box *make_underline_box(box *);
box *make_special_box(char *, box *);
void set_space(int);
-void set_gsize(int);
+void set_gsize(const char *);
void set_gfont(const char *);
void set_grfont(const char *);
void set_gbfont(const char *);
diff --git a/eqn/delim.c b/eqn/delim.c
index 634e95633..4e638914e 100644
--- a/eqn/delim.c
+++ b/eqn/delim.c
@@ -319,9 +319,11 @@ int delim_box::compute_metrics(int style)
printf(".nr " DELTA_REG " 0\\n[" DELTA_REG "]*%d/500"
">?(\\n[" DELTA_REG "]*2-%dM)\n",
delimiter_factor, delimiter_shortfall);
- define_extensible_string(left, uid, LEFT_DELIM);
- printf(".rn " DELIM_STRING " " LEFT_DELIM_STRING_FORMAT "\n",
- uid);
+ if (left) {
+ 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 (right) {
@@ -334,7 +336,8 @@ int delim_box::compute_metrics(int style)
void delim_box::output()
{
- printf("\\*[" LEFT_DELIM_STRING_FORMAT "]", uid);
+ if (left)
+ printf("\\*[" LEFT_DELIM_STRING_FORMAT "]", uid);
p->output();
if (right)
printf("\\*[" RIGHT_DELIM_STRING_FORMAT "]", uid);
@@ -347,7 +350,7 @@ void delim_box::check_tabs(int level)
void delim_box::debug_print()
{
- fprintf(stderr, "left \"%s\" { ", left);
+ fprintf(stderr, "left \"%s\" { ", left ? left : "");
p->debug_print();
fprintf(stderr, " }");
if (right)
diff --git a/eqn/eqn.h b/eqn/eqn.h
index ceff89d5f..1394e9d64 100644
--- a/eqn/eqn.h
+++ b/eqn/eqn.h
@@ -22,6 +22,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <string.h>
#include <assert.h>
#include <stdlib.h>
+#include <errno.h>
#include "cset.h"
#include "errarg.h"
#include "error.h"
diff --git a/eqn/lex.c b/eqn/lex.c
index 2efa20ade..1b165932a 100644
--- a/eqn/lex.c
+++ b/eqn/lex.c
@@ -652,7 +652,7 @@ void get_delimited_text()
int lineno;
int got_location = get_location(&filename, &lineno);
int start = get_char();
- while (start == ' ' || start == '\n')
+ while (start == ' ' || start == '\t' || start == '\n')
start = get_char();
token_buffer.clear();
if (start == EOF) {
@@ -872,6 +872,7 @@ void do_include()
}
token_buffer += '\0';
const char *filename = token_buffer.contents();
+ errno = 0;
FILE *fp = fopen(filename, "r");
if (fp == 0) {
lex_error("can't open included file `%1'", filename);
@@ -933,12 +934,15 @@ void do_gsize()
return;
}
token_buffer += '\0';
- char *ptr;
- long n = strtol(token_buffer.contents(), &ptr, 10);
- if (n == 0 && ptr == token_buffer.contents())
- lex_error("bad argument `%1' to gsize command", ptr);
+ const char *ptr = token_buffer.contents();
+ if (*ptr == '+' || *ptr == '-')
+ ptr++;
+ while (csdigit(*ptr))
+ ptr++;
+ if (*ptr != '\0')
+ lex_error("bad argument `%1' to gsize command", token_buffer.contents());
else
- set_gsize(int(n));
+ set_gsize(token_buffer.contents());
}
void do_gfont()
diff --git a/eqn/main.c b/eqn/main.c
index dd3c25c12..2c10edc33 100644
--- a/eqn/main.c
+++ b/eqn/main.c
@@ -24,6 +24,9 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
extern int yyparse();
+static char *delim_search(char *, int);
+static int inline_equation(FILE *, string &, string &);
+
char start_delim = '\0';
char end_delim = '\0';
int non_empty_flag;
@@ -65,7 +68,6 @@ void do_file(const char *filename)
current_filename = filename;
current_lineno = 0;
while (read_line(fp, &linebuf)) {
- int i;
if (linebuf.length() >= 4
&& linebuf[0] == '.' && linebuf[1] == 'l' && linebuf[2] == 'f'
&& (linebuf[3] == ' ' || linebuf[3] == '\n' || compatible_flag)) {
@@ -111,65 +113,124 @@ void do_file(const char *filename)
printf(".lf %d\n", current_lineno);
put_string(linebuf, stdout);
}
- else if (start_delim != '\0' && (i = linebuf.search(start_delim)) >= 0
- && (i == 0 || linebuf[i - 1] != '\\')) {
- start_string();
+ else if (start_delim != '\0' && linebuf.search(start_delim) >= 0
+ && inline_equation(fp, linebuf, str))
+ ;
+ else
+ put_string(linebuf, stdout);
+ }
+ if (fp != stdin)
+ fclose(fp);
+ current_filename = 0;
+ current_lineno = 0;
+}
+
+/* Handle an inline equation. Return 1 if it was an inline equation,
+0 otherwise. */
+
+static int inline_equation(FILE *fp, string &linebuf, string &str)
+{
+ linebuf += '\0';
+ char *ptr = &linebuf[0];
+ char *start = delim_search(ptr, start_delim);
+ if (!start) {
+ // It wasn't a delimiter after all.
+ linebuf.set_length(linebuf.length() - 1); // strip the '\0'
+ return 0;
+ }
+ start_string();
+ inline_flag = 1;
+ for (;;) {
+ if (no_newline_in_delim_flag && strchr(start + 1, end_delim) == 0) {
+ error("missing `%1'", end_delim);
+ char *nl = strchr(start + 1, '\n');
+ if (nl != 0)
+ *nl = '\0';
+ do_text(ptr);
+ break;
+ }
+ int start_lineno = current_lineno;
+ *start = '\0';
+ do_text(ptr);
+ ptr = start + 1;
+ str.clear();
+ for (;;) {
+ char *end = strchr(ptr, end_delim);
+ if (end != 0) {
+ *end = '\0';
+ str += ptr;
+ ptr = end + 1;
+ break;
+ }
+ str += ptr;
+ if (!read_line(fp, &linebuf))
+ fatal("end of file before `%1'", end_delim);
linebuf += '\0';
- char *ptr = &linebuf[0];
- inline_flag = 1;
- for (;;) {
- char *start = strchr(ptr, start_delim);
- if (start == 0) {
- char *nl = strchr(ptr, '\n');
- if (nl != 0)
- *nl = '\0';
- do_text(ptr);
+ ptr = &linebuf[0];
+ }
+ str += '\0';
+ init_lex(str.contents(), current_filename, start_lineno);
+ yyparse();
+ start = delim_search(ptr, start_delim);
+ if (start == 0) {
+ char *nl = strchr(ptr, '\n');
+ if (nl != 0)
+ *nl = '\0';
+ do_text(ptr);
+ break;
+ }
+ }
+ printf(".lf %d\n", current_lineno);
+ output_string();
+ restore_compatibility();
+ printf(".lf %d\n", current_lineno + 1);
+ return 1;
+}
+
+/* Search for delim. Skip over number register and string names etc. */
+
+static char *delim_search(char *ptr, int delim)
+{
+ while (*ptr) {
+ if (*ptr == delim)
+ return ptr;
+ if (*ptr++ == '\\') {
+ switch (*ptr) {
+ case 'n':
+ case '*':
+ case 'f':
+ case 'g':
+ case 'k':
+ switch (*++ptr) {
+ case '\0':
+ case '\\':
break;
- }
- if (no_newline_in_delim_flag && strchr(start + 1, end_delim) == 0) {
- error("missing `%1'", end_delim);
- char *nl = strchr(start + 1, '\n');
- if (nl != 0)
- *nl = '\0';
- do_text(ptr);
+ case '(':
+ if (*++ptr != '\\' && *ptr != '\0' && *++ptr != '\\' && *ptr != '\0')
+ ptr++;
+ break;
+ case '[':
+ while (*++ptr != '\0')
+ if (*ptr == ']') {
+ ptr++;
+ break;
+ }
+ break;
+ default:
+ ptr++;
break;
}
- int start_lineno = current_lineno;
- *start = '\0';
- do_text(ptr);
- ptr = start + 1;
- str.clear();
- for (;;) {
- char *end = strchr(ptr, end_delim);
- if (end != 0) {
- *end = '\0';
- str += ptr;
- ptr = end + 1;
- break;
- }
- str += ptr;
- if (!read_line(fp, &linebuf))
- fatal("end of file before `%1'", end_delim);
- linebuf += '\0';
- ptr = &linebuf[0];
- }
- str += '\0';
- init_lex(str.contents(), current_filename, start_lineno);
- yyparse();
+ break;
+ case '\\':
+ case '\0':
+ break;
+ default:
+ ptr++;
+ break;
}
- printf(".lf %d\n", current_lineno);
- output_string();
- restore_compatibility();
- printf(".lf %d\n", current_lineno + 1);
- }
- else {
- put_string(linebuf, stdout);
}
}
- if (fp != stdin)
- fclose(fp);
- current_filename = 0;
- current_lineno = 0;
+ return 0;
}
void usage()
@@ -221,9 +282,13 @@ int main(int argc, char **argv)
break;
case 's':
{
- int n;
- if (sscanf(optarg, "%d", &n) == 1)
- set_gsize(n);
+ const char *ptr = optarg;
+ if (*ptr == '+' || *ptr == '-')
+ ptr++;
+ while (csdigit(*ptr))
+ ptr++;
+ if (*ptr == '\0')
+ set_gsize(optarg);
else
error("bad size `%1'", optarg);
}
diff --git a/eqn/pbox.h b/eqn/pbox.h
index d14d2854f..45bc79439 100644
--- a/eqn/pbox.h
+++ b/eqn/pbox.h
@@ -106,6 +106,9 @@ extern int matrix_side_sep;
#define SAVED_PREV_FONT_REG PREFIX "spfont"
#define SAVED_INLINE_FONT_REG PREFIX "sifont"
#define SAVED_INLINE_PREV_FONT_REG PREFIX "sipfont"
+#define SAVED_SIZE_REG PREFIX "ssize"
+#define SAVED_INLINE_SIZE_REG PREFIX "sisize"
+#define SAVED_INLINE_PREV_SIZE_REG PREFIX "sipsize"
#define RESTORE_FONT_STRING PREFIX "rfont"
#define INDEX_REG PREFIX "i"
#define TEMP_MACRO PREFIX "tempmac"
diff --git a/etc/addftinfo.c b/etc/addftinfo.c
index b0211baa1..19c7b2907 100644
--- a/etc/addftinfo.c
+++ b/etc/addftinfo.c
@@ -23,6 +23,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <string.h>
#include <assert.h>
#include <stdlib.h>
+#include <errno.h>
#include "lib.h"
#include "errarg.h"
#include "error.h"
@@ -107,6 +108,7 @@ int main(int argc, char **argv)
}
if (argc - i != 3)
usage();
+ errno = 0;
FILE *infp = fopen(font, "r");
if (infp == 0)
fatal("can't open `%1': %2", font, strerror(errno));
diff --git a/etc/grog.pl b/etc/grog.pl
index b896b0b16..0a5d236bd 100644
--- a/etc/grog.pl
+++ b/etc/grog.pl
@@ -47,7 +47,7 @@ sub process {
$soelim++ if $level;
}
}
- elsif (/^\.PS/) {
+ elsif (/^\.PS([ 0-9.<].*)?$/) {
$_ = <FILE>;
if (!/^\./ || /^\.ps/) {
$pic++;
diff --git a/etc/grog.sh b/etc/grog.sh
index 3b32f1990..0d3b3bd88 100644
--- a/etc/grog.sh
+++ b/etc/grog.sh
@@ -30,7 +30,7 @@ egrep -h '^\.(P|[LI]P|[pnil]p|Dd|TS|EQ|TH|SH|so|\[|R1)' $* \
/^\.SO_START$/ { so = 1 }
/^\.SO_END$/ { so = 0 }
/^\.TS/ { tbl++; if (so > 0) soelim++ }
-/^\.PS/ { pic++; if (so > 0) soelim++ }
+/^\.PS([ 0-9.<].*)?$/ { pic++; if (so > 0) soelim++ }
/^\.EQ/ { eqn++; if (so > 0) soelim++ }
/^\.(R1|\[)/ { refer++; if (so > 0) soelim++ }
/^\.TH/ { TH++ }
diff --git a/etc/soelim.c b/etc/soelim.c
index 3e7dfd1cf..adb5e39e3 100644
--- a/etc/soelim.c
+++ b/etc/soelim.c
@@ -23,6 +23,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <string.h>
#include <assert.h>
#include <stdlib.h>
+#include <errno.h>
#include "lib.h"
#include "errarg.h"
#include "error.h"
diff --git a/gendef b/gendef
new file mode 100644
index 000000000..e2b2575ff
--- /dev/null
+++ b/gendef
@@ -0,0 +1,24 @@
+# gendef filename var=val var=val
+
+file=$1
+shift
+
+defs="#define $1"
+shift
+for def
+do
+ defs="$defs
+#define $def"
+done
+
+t=/tmp/groff.$$
+
+sed -e 's/=/ /' >$t <<EOF
+$defs
+EOF
+
+test -r $file && cmp -s $t $file || cp $t $file
+
+rm -f $t
+
+exit 0
diff --git a/groff.c b/groff.c
index ee82f910c..8c32a232f 100644
--- a/groff.c
+++ b/groff.c
@@ -25,6 +25,11 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <osfcn.h>
#include <stdlib.h>
#include <signal.h>
+#include <errno.h>
+#include <sys/types.h>
+#ifndef NO_SYS_WAIT_H
+#include <sys/wait.h>
+#endif /* not NO_SYS_WAIT_H */
#include "lib.h"
#include "assert.h"
@@ -35,17 +40,52 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "device.h"
-const char *strsignal(int);
+#ifdef HAVE_PID_T
+typedef pid_t PID_T;
+#else
+typedef int PID_T;
+#endif
-// HAVE_UNION_WAIT exists only because Sun's osfcn.h includes sys/wait.h.
+#ifdef HAVE_UNION_WAIT
+typedef union wait WAIT_STATUS_T;
+#else
+typedef int WAIT_STATUS_T;
+#endif
+#ifdef NO_SYS_WAIT_H
extern "C" {
-#ifdef HAVE_UNION_WAIT
- int wait(union wait *);
-#else /* !HAVE_UNION_WAIT */
- int wait(int *);
-#endif /* !HAVE_UNION_WAIT */
+ PID_T wait(WAIT_STATUS_T *);
}
+#endif /* NO_SYS_WAIT_H */
+
+
+#ifdef HAVE_UNION_WAIT
+/* Convert the argument which must be an lvalue of type union wait *
+to an int. */
+#define WTOI(s) (*(int *)&(s))
+#else
+#define WTOI(s) (s)
+#endif
+
+#ifndef WIFEXITED
+#define WIFEXITED(s) ((WTOI(s) & 0377) == 0)
+#define WIFSTOPPED(s) ((WTOI(s) & 0377) == 0177)
+#define WIFSIGNALED(s) ((WTOI(s) & 0377) != 0 && ((WTOI(s) & 0377) != 0177))
+#endif /* WIFEXITED */
+
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(s) ((WTOI(s) >> 8) & 0377)
+#define WTERMSIG(s) (WTOI(s) & 0177)
+#define WSTOPSIG(s) ((WTOI(s) >> 8) & 0377)
+#endif /* not WEXITSTATUS */
+
+#ifdef WAIT_COREDUMP_0200
+#define WCOREDUMPED(s) (WTOI(s) & 0200)
+#else
+#define WCOREDUMPED(s) 0
+#endif
+
+const char *strsignal(int);
const char *ps_print[] = { PSPRINT 0 };
@@ -149,7 +189,7 @@ struct {
"X11 previewer with PostScript metrics",
gxditview,
EQN_D_OPTION|PIC_X_OPTION|PIC_P_OPTION|XT_OPTION|PRINT_OPTION,
- "ps",
+ "Xps",
0
},
};
@@ -173,7 +213,7 @@ class possible_command {
string args;
char **argv;
public:
- int pid;
+ PID_T pid;
possible_command();
~possible_command();
@@ -452,11 +492,11 @@ int run_commands()
sys_fatal("pipe");
}
#ifdef HAVE_VFORK
- int pid = vfork();
+ PID_T pid = vfork();
if (pid < 0)
sys_fatal("vfork");
#else /* !HAVE_VFORK */
- int pid = fork();
+ PID_T pid = fork();
if (pid < 0)
sys_fatal("fork");
#endif /* !HAVE_VFORK */
@@ -496,35 +536,32 @@ int run_commands()
}
int ret = 0;
while (proc_count > 0) {
- int status;
-#ifdef HAVE_UNION_WAIT
- // union wait is just syntactic sugar: it's really just an int.
- int pid = wait((union wait *)&status);
-#else /* !HAVE_UNION_WAIT */
- int pid = wait(&status);
-#endif /* !HAVE_UNION_WAIT */
+ WAIT_STATUS_T status;
+ PID_T pid = wait(&status);
if (pid < 0)
sys_fatal("wait");
for (i = 0; i < NCOMMANDS; i++)
if (commands[i].pid == pid) {
--proc_count;
- if ((status & 0xffff) != 0) {
- if ((status & 0xff) != 0) {
- if ((status & 0x7f) != SIGPIPE)
- error("%1: %2%3",
- commands[i].get_name(),
- strsignal(status & 0x7f),
- (status & 0x80) ? " (core dumped)" : "");
+ if (WIFSIGNALED(status)) {
+ int sig = WTERMSIG(status);
+ if (sig != SIGPIPE) {
+ error("%1: %2%3",
+ commands[i].get_name(),
+ strsignal(sig),
+ WCOREDUMPED(status) ? " (core dumped)" : "");
ret |= 2;
}
- else {
- int exit_status = (status >> 8) & 0xff;
- if (exit_status == EXEC_FAILED_EXIT_STATUS)
- ret |= 4;
- else if (exit_status != 0)
- ret |= 1;
- }
}
+ else if (WIFEXITED(status)) {
+ int exit_status = WEXITSTATUS(status);
+ if (exit_status == EXEC_FAILED_EXIT_STATUS)
+ ret |= 4;
+ else if (exit_status != 0)
+ ret |= 1;
+ }
+ else
+ error("unexpected status %1", WTOI(status));
break;
}
}
@@ -670,12 +707,8 @@ void possible_command::execp()
build_argv();
execvp(name, argv);
error("couldn't exec %1: %2", name, strerror(errno));
-#ifdef HAVE_VFORK
- // vfork(2) says not to call exit when execve fails after vforking.
+ fflush(stderr); // just in case
_exit(EXEC_FAILED_EXIT_STATUS);
-#else
- exit(EXEC_FAILED_EXIT_STATUS);
-#endif
}
void synopsis()
diff --git a/groff.sh b/groff.sh
index 4776322af..5c7add2fb 100644
--- a/groff.sh
+++ b/groff.sh
@@ -272,7 +272,7 @@ X100|X75|X100-12|X75-12)
;;
Xps)
- trflags="-mps $trflags"
+ trflags="-mXps $trflags"
eqnchar=@FONTDIR@/devps/eqnchar
postpro="| gxditview $optP -printCommand 'grops | @PSPRINT@' -"
picflag="-x -p"
diff --git a/lib/Makefile b/lib/Makefile
index 721b44857..13a5d6c71 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -28,12 +28,14 @@ MALLOC=malloc.o
MALLOCFLAGS=
FMOD=#fmod.o
STRTOL=#strtol.o
+GETCWD=#getcwd.o
OBJECTS=$(MALLOC) new.o itoa.o strerror.o error.o errarg.o fatal.o prime.o \
strsave.o matherr.o assert.o iftoa.o string.o cset.o cmap.o \
ptable.o font.o fontfile.o nametoindex.o filename.o lineno.o \
- progname.o lf.o change_lf.o version.o $(FMOD) $(STRTOL)
+ progname.o lf.o change_lf.o version.o tmpfile.o \
+ $(FMOD) $(STRTOL) $(GETCWD)
SOURCES=new.c itoa.c strerror.c error.c errarg.c fatal.c prime.c \
- strsave.c matherr.c fmod.c assert.c iftoa.c \
+ strsave.c matherr.c fmod.c assert.c iftoa.c tmpfile.c getcwd.c \
string.c cset.c cmap.c ptable.c font.c fontfile.c nametoindex.c \
filename.c lineno.c progname.c lf.c change_lf.c version.c \
assert.h cset.h cmap.h errarg.h error.h font.h getpagesize.h \
@@ -73,14 +75,16 @@ fmod.o: fmod.c
strtol.o: strtol.c
$(OLDCC) $(OLDCFLAGS) -c strtol.c
+getcwd.o: getcwd.c
+ $(OLDCC) $(OLDCFLAGS) -c getcwd.c
+
string.o: stringclass.h
lf.o: stringclass.h
fontfile.o: fontpath.h
+tmpfile.o: lib.h errarg.h error.h
fontpath.h: FORCE
- @echo \#define FONTPATH \"$(FONTPATH)\" >fontpath.h.n
- @cmp -s fontpath.h fontpath.h.n || cp fontpath.h.n fontpath.h
- @rm -f fontpath.h.n
+ @$(SHELL) ../gendef $@ "FONTPATH=\"$(FONTPATH)\""
TAGS : $(SOURCES)
etags $(ETAGSFLAGS) $(SOURCES)
diff --git a/lib/font.c b/lib/font.c
index 98f7c68a6..b6ec8a7f4 100644
--- a/lib/font.c
+++ b/lib/font.c
@@ -122,7 +122,6 @@ int text_file::next()
ptr++;
if (*ptr != 0 && (!skip_comments || *ptr != '#'))
return 1;
- return 1;
}
return 0;
}
diff --git a/lib/fontfile.c b/lib/fontfile.c
index 1d11fde79..780368065 100644
--- a/lib/fontfile.c
+++ b/lib/fontfile.c
@@ -101,6 +101,7 @@ FILE *font::open_file(const char *name, char **pathp)
strcat(path, dev_name);
strcat(path, "/");
strcat(path, name);
+ errno = 0;
FILE *fp = fopen(path, "r");
if (fp != 0) {
*pathp = path;
diff --git a/lib/getcwd.c b/lib/getcwd.c
new file mode 100644
index 000000000..ed1642fe0
--- /dev/null
+++ b/lib/getcwd.c
@@ -0,0 +1,35 @@
+/* Partial emulation of getcwd in terms of getwd. */
+
+#include <sys/param.h>
+#include <string.h>
+#include <errno.h>
+
+char *getwd();
+
+char *getcwd(buf, size)
+ char *buf;
+ int size; /* POSIX says this should be size_t */
+{
+ if (size <= 0) {
+ errno = EINVAL;
+ return 0;
+ }
+ else {
+ char mybuf[MAXPATHLEN];
+ int saved_errno = errno;
+
+ errno = 0;
+ if (!getwd(mybuf)) {
+ if (errno == 0)
+ ; /* what to do? */
+ return 0;
+ }
+ errno = saved_errno;
+ if (strlen(mybuf) + 1 > size) {
+ errno = ERANGE;
+ return 0;
+ }
+ strcpy(buf, mybuf);
+ return buf;
+ }
+}
diff --git a/lib/lib.h b/lib/lib.h
index 22fb1a3ff..14e0b6567 100644
--- a/lib/lib.h
+++ b/lib/lib.h
@@ -21,13 +21,17 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifdef __cplusplus
extern "C" {
- const char *strerror(int);
+ char *strerror(int);
+#ifndef __BORLANDC__
const char *itoa(int);
const char *iftoa(int, int);
+#endif /* __BORLANDC__ */
};
char *strsave(const char *s);
int is_prime(unsigned);
+#include <stdio.h>
+FILE *xtmpfile();
int interpret_lf_args(const char *p);
diff --git a/lib/ptable.c b/lib/ptable.c
index 5f2a1640c..d39616c14 100644
--- a/lib/ptable.c
+++ b/lib/ptable.c
@@ -18,11 +18,13 @@ with groff; see the file LICENSE. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "ptable.h"
+#include "errarg.h"
+#include "error.h"
-unsigned hash_string(const char *s)
+unsigned long hash_string(const char *s)
{
assert(s != 0);
- unsigned h = 0, g;
+ unsigned long h = 0, g;
while (*s != 0) {
h <<= 4;
h += *s++;
@@ -34,16 +36,16 @@ unsigned hash_string(const char *s)
return h;
}
-static const int table_sizes[] = {
+static const unsigned table_sizes[] = {
101, 503, 1009, 2003, 3001, 4001, 5003, 10007, 20011, 40009,
80021, 160001, 500009, 1000003, 2000003, 4000037, 8000009,
16000057, 32000011, 64000031, 128000003, 0
};
-int next_ptable_size(int n)
+unsigned next_ptable_size(unsigned n)
{
- for (const int *p = table_sizes; *p <= n && *p != 0; p++)
- ;
- assert(*p != 0);
+ for (const unsigned *p = table_sizes; *p <= n; p++)
+ if (*p == 0)
+ fatal("cannot expand table");
return *p;
}
diff --git a/lib/ptable.h b/lib/ptable.h
index 5825223ed..719fed74d 100644
--- a/lib/ptable.h
+++ b/lib/ptable.h
@@ -22,12 +22,18 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <generic.h>
#include <string.h>
+#ifdef __BORLANDC__
+#ifndef name2
+#define name2 _Paste2
+#endif
+#endif
+
#define PTABLE(T) name2(T,_ptable)
#define PASSOC(T) name2(T,_passoc)
#define PTABLE_ITERATOR(T) name2(T,_ptable_iterator)
-extern int next_ptable_size(int);
-extern unsigned hash_string(const char *);
+extern unsigned next_ptable_size(unsigned);
+extern unsigned long hash_string(const char *);
#define declare_ptable(T) \
\
@@ -41,7 +47,7 @@ struct PTABLE(T); \
\
class PTABLE_ITERATOR(T) { \
PTABLE(T) *p; \
- int i; \
+ unsigned i; \
public: \
PTABLE_ITERATOR(T)(PTABLE(T) *); \
int next(const char **, T **); \
@@ -49,8 +55,8 @@ public: \
\
class PTABLE(T) { \
PASSOC(T) *v; \
- int size; \
- int used; \
+ unsigned size; \
+ unsigned used; \
enum { FULL_NUM = 2, FULL_DEN = 3, INITIAL_SIZE = 17 }; \
public: \
PTABLE(T)(); \
@@ -76,7 +82,7 @@ PTABLE(T)::PTABLE(T)() \
\
PTABLE(T)::~PTABLE(T)() \
{ \
- for (int i = 0; i < size; i++) { \
+ for (unsigned i = 0; i < size; i++) { \
delete v[i].key; \
delete v[i].val; \
} \
@@ -85,8 +91,8 @@ PTABLE(T)::~PTABLE(T)() \
void PTABLE(T)::define(const char *key, T *val) \
{ \
assert(key != 0); \
- int h = hash_string(key); \
- for (int n = h % size; \
+ unsigned long h = hash_string(key); \
+ for (unsigned n = unsigned(h % size); \
v[n].key != 0; \
n = (n == 0 ? size - 1 : n - 1)) \
if (strcmp(v[n].key, key) == 0) { \
@@ -98,15 +104,15 @@ void PTABLE(T)::define(const char *key, T *val) \
return; \
if (used*FULL_DEN >= size*FULL_NUM) { \
PASSOC(T) *oldv = v; \
- int old_size = size; \
+ unsigned old_size = size; \
size = next_ptable_size(size); \
v = new PASSOC(T)[size]; \
- for (int i = 0; i < old_size; i++) \
+ for (unsigned i = 0; i < old_size; i++) \
if (oldv[i].key != 0) { \
if (oldv[i].val == 0) \
delete oldv[i].key; \
else { \
- for (int j = hash_string(oldv[i].key) % size; \
+ for (unsigned j = unsigned(hash_string(oldv[i].key) % size); \
v[j].key != 0; \
j = (j == 0 ? size - 1 : j - 1)) \
; \
@@ -114,7 +120,7 @@ void PTABLE(T)::define(const char *key, T *val) \
v[j].val = oldv[i].val; \
} \
} \
- for (n = h % size; \
+ for (n = unsigned(h % size); \
v[n].key != 0; \
n = (n == 0 ? size - 1 : n - 1)) \
; \
@@ -130,7 +136,7 @@ void PTABLE(T)::define(const char *key, T *val) \
T *PTABLE(T)::lookup(const char *key) \
{ \
assert(key != 0); \
- for (int n = hash_string(key) % size; \
+ for (unsigned n = unsigned(hash_string(key) % size); \
v[n].key != 0; \
n = (n == 0 ? size - 1 : n - 1)) \
if (strcmp(v[n].key, key) == 0) \
@@ -145,7 +151,7 @@ PTABLE_ITERATOR(T)::PTABLE_ITERATOR(T)(PTABLE(T) *t) \
\
int PTABLE_ITERATOR(T)::next(const char **keyp, T **valp) \
{ \
- int size = p->size; \
+ unsigned size = p->size; \
PASSOC(T) *v = p->v; \
for (; i < size; i++) \
if (v[i].key != 0) { \
diff --git a/lib/tmpfile.c b/lib/tmpfile.c
new file mode 100644
index 000000000..c048b1832
--- /dev/null
+++ b/lib/tmpfile.c
@@ -0,0 +1,98 @@
+// -*- C++ -*-
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+ Written by James Clark (jjc@jclark.uucp)
+
+This file is part of groff.
+
+groff is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 1, or (at your option) any later
+version.
+
+groff is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License along
+with groff; see the file LICENSE. If not, write to the Free Software
+Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
+#include <osfcn.h>
+
+#include "lib.h"
+#include "errarg.h"
+#include "error.h"
+
+extern "C" {
+ // Sun's stdlib.h fails to declare this.
+ char *mktemp(char *);
+}
+
+// If this is set, create temporary files there
+#define GROFF_TMPDIR_ENVVAR "GROFF_TMPDIR"
+// otherwise if this is set, create temporary files there
+#define TMPDIR_ENVVAR "TMPDIR"
+// otherwise create temporary files here.
+#define DEFAULT_TMPDIR "/tmp"
+// Use this as the prefix for temporary filenames.
+#define TMPFILE_PREFIX "groff"
+
+// Open a temporary file with fatal error on failure.
+
+FILE *xtmpfile()
+{
+ const char *dir = getenv(GROFF_TMPDIR_ENVVAR);
+ if (!dir) {
+ dir = getenv(TMPDIR_ENVVAR);
+ if (!dir)
+ dir = DEFAULT_TMPDIR;
+ }
+
+ const char *p = strrchr(dir, '/');
+ int needs_slash = (!p || p[1]);
+ char *templ = new char[strlen(dir) + needs_slash
+ + sizeof(TMPFILE_PREFIX) - 1 + 6 + 1];
+ strcpy(templ, dir);
+ if (needs_slash)
+ strcat(templ, "/");
+ strcat(templ, TMPFILE_PREFIX);
+ strcat(templ, "XXXXXX");
+
+#ifdef HAVE_MKSTEMP
+ errno = 0;
+ int fd = mkstemp(templ);
+ if (fd < 0)
+ fatal("cannot create temporary file: %1", strerror(errno));
+ errno = 0;
+ FILE *fp = fdopen(fd, "w+");
+ if (!fp)
+ fatal("fdopen: %1", strerror(errno));
+#else /* not HAVE_MKSTEMP */
+ if (!mktemp(templ) || !templ[0])
+ fatal("cannot create file name for temporary file");
+ errno = 0;
+ FILE *fp = fopen(templ, "w+");
+ if (!fp)
+ fatal("cannot open `%1': %2", templ, strerror(errno));
+#endif /* not HAVE_MKSTEMP */
+ if (unlink(templ) < 0)
+ error("cannot unlink `%1': %2", templ, strerror(errno));
+ delete templ;
+ return fp;
+}
+
+#if 0
+// If you're not running Unix, the following will do:
+FILE *xtmpfile()
+{
+ FILE *fp = tmpfile();
+ if (!fp)
+ fatal("couldn't create temporary file");
+ return fp;
+}
+#endif
diff --git a/macros/Makefile b/macros/Makefile
index edf6d2c42..58df33720 100644
--- a/macros/Makefile
+++ b/macros/Makefile
@@ -20,20 +20,26 @@
MACRODIR=/usr/local/lib/groff/tmac
TMAC_S=gs
-all:
+all: tmac.e.strip
+
+tmac.e.strip: tmac.e
+ -rm -f $@
+ sed -e '/%beginstrip%/,$$s/[ ]*\\".*//' -e '/^\.$$/d' tmac.e >$@
+
clean:
-distclean:
-realclean:
+ -rm -f tmac.e.strip
+
+distclean: clean
+realclean: distclean
+
TAGS:
-install.nobin:
+install.nobin: all
-[ -d $(MACRODIR) ] || mkdir $(MACRODIR)
-rm -f $(MACRODIR)/tmac.an
cp tmac.an $(MACRODIR)
-rm -f $(MACRODIR)/tmac.e
- @echo Installing tmac.e
- @sed -e '/%beginstrip%/,$$s/[ ]*\\".*//' -e '/^\.$$/d' \
- tmac.e > $(MACRODIR)/tmac.e
+ cp tmac.e.strip $(MACRODIR)/tmac.e
-rm -f $(MACRODIR)/tmac.$(TMAC_S)
cp tmac.s $(MACRODIR)/tmac.$(TMAC_S)
-rm -f $(MACRODIR)/tmac.pic
diff --git a/macros/tmac.an b/macros/tmac.an
index 96553d50b..aca79a621 100644
--- a/macros/tmac.an
+++ b/macros/tmac.an
@@ -32,6 +32,7 @@
.if rP .pn 0\nP
.\" .TH title section extra1 extra2 extra3
.de TH
+.de an-init \" We have to do it like this to get multiple man pages right.
.ds an-title "\\$1
.ds an-section "\\$2
.ds an-extra1 "\\$3
@@ -39,6 +40,8 @@
.el .ds an-extra2 \"Sun Release 4.0
.ie \\n[.$]>4 .ds an-extra3 "\\$5
.el .ds an-extra3 \"UNIX Programmer's Manual
+.ds an-init
+\\..
.DT
.nr IN 7.2n
.nr LL 6.5i
@@ -66,6 +69,7 @@
..
.wh 0 an-header
.de an-header
+.an-init
.ev 1
.sp .5i
.tl '\\*[an-title](\\*[an-section])'\\*[an-extra3]'\\*[an-title](\\*[an-section])'
diff --git a/man/Makefile b/man/Makefile
index 213ed43f0..296cbdef9 100644
--- a/man/Makefile
+++ b/man/Makefile
@@ -61,23 +61,23 @@ MANPAGES= $(MAN1PAGES) $(MAN5PAGES) $(MAN7PAGES)
.man.n:
@echo Making $@ from $<
@-rm -f $@
- @sed -e "s;@HYPHENFILE@;$(HYPHENFILE);" \
- -e "s;@FONTDIR@;$(FONTDIR);" \
- -e "s;@FONTPATH@;$(FONTPATH);" \
- -e "s;@MACRODIR@;$(MACRODIR);" \
- -e "s;@MACROPATH@;$(MACROPATH);" \
- -e "s;@DEVICE@;$(DEVICE);" \
- -e "s;@DEFAULT_INDEX@;$(DEFAULT_INDEX_DIR)/$(DEFAULT_INDEX_NAME);" \
- -e "s;@DEFAULT_INDEX_NAME@;$(DEFAULT_INDEX_NAME);" \
- -e "s;@INDEX_SUFFIX@;$(INDEX_SUFFIX);" \
- -e "s;@COMMON_WORDS_FILE@;$(COMMON_WORDS_FILE);" \
- -e "s;@MAN1EXT@;$(MAN1EXT);" \
- -e "s;@MAN5EXT@;$(MAN5EXT);" \
- -e "s;@MAN7EXT@;$(MAN7EXT);" \
- -e "s;@TMAC_S@;$(TMAC_S);" \
- -e "s;@BROKEN_SPOOLER_FLAGS@;$(BROKEN_SPOOLER_FLAGS);" \
- -e "s;@VERSION@;`cat ../VERSION`;" \
- -e "s;@MDATE@;`$(SHELL) mdate.sh $<`;" \
+ @sed -e "s;@HYPHENFILE@;$(HYPHENFILE);g" \
+ -e "s;@FONTDIR@;$(FONTDIR);g" \
+ -e "s;@FONTPATH@;$(FONTPATH);g" \
+ -e "s;@MACRODIR@;$(MACRODIR);g" \
+ -e "s;@MACROPATH@;$(MACROPATH);g" \
+ -e "s;@DEVICE@;$(DEVICE);g" \
+ -e "s;@DEFAULT_INDEX@;$(DEFAULT_INDEX_DIR)/$(DEFAULT_INDEX_NAME);g" \
+ -e "s;@DEFAULT_INDEX_NAME@;$(DEFAULT_INDEX_NAME);g" \
+ -e "s;@INDEX_SUFFIX@;$(INDEX_SUFFIX);g" \
+ -e "s;@COMMON_WORDS_FILE@;$(COMMON_WORDS_FILE);g" \
+ -e "s;@MAN1EXT@;$(MAN1EXT);g" \
+ -e "s;@MAN5EXT@;$(MAN5EXT);g" \
+ -e "s;@MAN7EXT@;$(MAN7EXT);g" \
+ -e "s;@TMAC_S@;$(TMAC_S);g" \
+ -e "s;@BROKEN_SPOOLER_FLAGS@;$(BROKEN_SPOOLER_FLAGS);g" \
+ -e "s;@VERSION@;`cat ../VERSION`;g" \
+ -e "s;@MDATE@;`$(SHELL) mdate.sh $<`;g" \
$< >$@
@chmod 444 $@
diff --git a/man/geqn.man b/man/geqn.man
index 5df3017ef..c13b82cd3 100644
--- a/man/geqn.man
+++ b/man/geqn.man
@@ -767,6 +767,9 @@ will cause a character to be set in italic type.
A type of
.B digit
will cause a character to be set in roman type.
+.SH BUGS
+Inline equations will be set at the point size that is current at the
+beginning of the input line.
.SH "SEE ALSO"
.BR groff (@MAN1EXT@),
.BR gtroff (@MAN1EXT@),
diff --git a/man/gpic.man b/man/gpic.man
index 21f664ab7..6f7c9ad11 100644
--- a/man/gpic.man
+++ b/man/gpic.man
@@ -665,10 +665,14 @@ macros.
.SH "SEE ALSO"
.BR gtroff (@MAN1EXT@),
.BR groff_out (@MAN5EXT@),
-.BR tex (1),
-.I
-Tpic: Pic for
-.IR \*(tx .
+.BR tex (1)
+.br
+Tpic: Pic for \*(tx
+.br
+AT&T Bell Laboratories, Computing Science Technical Report No.\ 116,
+PIC \(em A Graphics Language for Typesetting.
+(This can be obtained by sending a mail message to netlib@research.att.com
+with a body of `send\ 116\ from\ research/cstr'.)
.SH BUGS
.LP
Input characters that are illegal for
diff --git a/man/grefer.man b/man/grefer.man
index f5bc52d84..b856de4e6 100644
--- a/man/grefer.man
+++ b/man/grefer.man
@@ -734,8 +734,8 @@ is a label expression that specifies a string with which to replace the
.B D
field after constructing the label.
See the
-.B
-Label expressions subsection for a description of label expressions.
+.B "Label expressions"
+subsection for a description of label expressions.
This command is useful if you do not want explicit labels in the
reference list, but instead want to handle any necessary
disambiguation by qualifying the date in some way.
diff --git a/man/groff.man b/man/groff.man
index ddcf7c015..5e8ae5cb1 100644
--- a/man/groff.man
+++ b/man/groff.man
@@ -158,6 +158,13 @@ to the postprocessor.
Each argument should be passed with a separate
.B \-P
option.
+Note that
+.B groff
+does not prepend
+.B \-
+to
+.I arg
+before passing it to the postprocessor.
.TP
.B \-l
Spool the output.
@@ -169,6 +176,13 @@ to the spooler.
Each argument should be passed with a separate
.B \-L
option.
+Note that
+.B groff
+does not prepend
+.B \-
+to
+.I arg
+before passing it to the postprocessor.
.TP
.BI \-T dev
Prepare output for device
@@ -241,6 +255,21 @@ File containing hyphenation patterns.
.B PATH
The search path for commands executed by
.BR groff .
+.TP
+.SM
+.B GROFF_TMPDIR
+The directory in which temporary files will be created.
+If this is not set and
+.B
+.SM TMPDIR
+is set, temporary files will be created in that directory.
+Otherwise temporary files will be created in
+.BR /tmp .
+The
+.BR grops (@MAN1EXT@)
+and
+.BR grefer (@MAN1EXT@)
+commands can create temporary files.
.SH FILES
.TP \w'\fB@FONTDIR@/dev\fIname\fB/eqnchar'u+3n
.B @HYPHENFILE@
diff --git a/man/grops.man b/man/grops.man
index e7b066356..53b102a8f 100644
--- a/man/grops.man
+++ b/man/grops.man
@@ -507,6 +507,55 @@ and
.I height
high.
.RE
+.TP
+.B \eX'ps:\ invis'
+.br
+.ns
+.TP
+.B \eX'ps:\ endinvis'
+No output will be generated for text and drawing commands
+that are bracketed with these
+.B \eX
+commands.
+These commands are intended for use when output from
+.B gtroff
+will be previewed before being processed with
+.BR grops ;
+if the previewer is unable to display certain characters
+or other constructs, then other substitute characters or constructs
+can be used for previewing by bracketing them with these
+.B \eX
+commands.
+.RS
+.LP
+For example,
+.B gxditview
+is not able to display a proper
+.B \e(em
+character because the standard X11 fonts do not provide it;
+this problem can be overcome by executing the following
+request
+.IP
+.ft B
+.nf
+\&.char \e(em \eX'ps: invis'\e
+\eZ'\ev'-.25m'\eh'.05m'\eD'l .9m 0'\eh'.05m''\e
+\eX'ps: endinvis'\e(em
+.ft
+.fi
+.LP
+In this case,
+.B gxditview
+will be unable to display the
+.B \e(em
+character and will draw the line,
+whereas
+.B grops
+will print the
+.B \e(em
+character
+and ignore the line.
+.RE
.LP
The input to
.B grops
diff --git a/man/mdate.sh b/man/mdate.sh
index 5ccc3f67a..4edd6e68c 100755
--- a/man/mdate.sh
+++ b/man/mdate.sh
@@ -24,11 +24,11 @@ NR == 1 {
}
NR == 2 {
- if ($8 ~ /:/) {
- if (number[$6] > number[month])
+ if ($(NF-1) ~ /:/) {
+ if (number[$(NF-3)] > number[month])
year--;
}
else
- year = $8;
- print $7, full[$6], year
+ year = $(NF-1);
+ print $(NF-2), full[$(NF-3)], year
}'
diff --git a/mm/ChangeLog b/mm/ChangeLog
new file mode 100644
index 000000000..0ddbcd390
--- /dev/null
+++ b/mm/ChangeLog
@@ -0,0 +1,68 @@
+Wed Nov 6 15:18:40 1991 Joergen Haegg (jh at efd.lth.se)
+
+ * version 0.13
+ * ds*format nod defined if PS/PE is used without DS/DE.
+ * GETST added, fourth argument to EX, FG, TB and EC added.
+
+Mon Nov 4 13:38:01 1991 Joergen Haegg (jh at efd.lth.se)
+
+ * version 0.12
+ * Fixed C,D,P,+-size in .S
+
+Sun Jan 1 00:00:00 1991 Joergen Haegg (jh at efd.lth.se)
+ * Next version will have ChangeLog entries...
+ * Bug in INITR fixed.
+ * VERBON/VERBOFF added to include programlistings
+ * Bug in .DE fixed, addition overflow
+Sun Jan 1 00:00:00 1991 Joergen Haegg (jh at efd.lth.se)
+ * spelling error in month-names.
+ * WC should work now (no warranty :-)
+ * FD almost finished, some details missing.
+ * incorrect calculation of foot-notes fixed.
+ * DS/DE did not break page when the size was smaller than the paper
+ * Forward/backward referencesystem added. Se .INITR in README.
+ * mgmsw changed name to mgmse.
+Sun Jan 1 00:00:00 1991 Joergen Haegg (jh at efd.lth.se)
+ * embarrassing bug in .P fixed
+ * .H did always eject page, now fixed.
+ * lost floating displays now found.
+ * accents added (from mgs)
+ * empty line in .EQ/.EN removed
+ * indentation in .TC corrected.
+ * indentation of DS/DE in lists fixed.
+ * .TB and friends now work inside DS/DE and outside.
+ * .WC partially implemented (WF and WD). Still working on it.
+ * .mso used if version>=1.02
+Sun Jan 1 00:00:00 1991 Joergen Haegg (jh at efd.lth.se)
+ * register P was not working.
+ * support for register Fg, Tb, Ec and Ex.
+ * list items was left on the previous page at a page break.
+ * tlevel in .TC now defaults to 2.
+ * string DT, EM and Tm supported.
+ * new macro: PGNH, see comments.
+ * bug in MOVE fixed.
+ * pagenumber in .TC fixed.
+ * a blank page was ejected if Ej==1, now fixed
+ * bug in floating display fixed (did break and SP wrong)
+ * bug in .SP fixed, no lines is now printed at top of page
+ * There are still problems with footnotes and displays in two column mode.
+Sun Jan 1 00:00:00 1991 Joergen Haegg (jh at efd.lth.se)
+ * register P added (same as %)
+ * bug in floating displays fixed
+ * MOVE added
+ * MT added, see comment below
+ * COVER/COVEND added
+ * fixed bug in figure titles
+ * extended S, se comment below
+ * MT 0 added
+ * ms-cover added (COVER ms)
+Sun Jan 1 00:00:00 1991 Joergen Haegg (jh at efd.lth.se)
+ * bugs in RD and comb. fonts fixed
+Sun Jan 1 00:00:00 1991 Joergen Haegg (jh at efd.lth.se)
+ * HC added
+ * Combined fonts (IB,BI...)
+ * HM added
+ * RD added
+ * OP added
+ * TP&PX supported
+ * warnings for unimplemented macros
diff --git a/mm/Makefile b/mm/Makefile
new file mode 100644
index 000000000..0f495d913
--- /dev/null
+++ b/mm/Makefile
@@ -0,0 +1,83 @@
+#Copyright (C) 1991 Free Software Foundation, Inc.
+# Written by Joergen Haegg (jh@efd.lth.se)
+#
+#This file is part of groff.
+#
+#groff is free software; you can redistribute it and/or modify it under
+#the terms of the GNU General Public License as published by the Free
+#Software Foundation; either version 1, or (at your option) any later
+#version.
+#
+#groff is distributed in the hope that it will be useful, but WITHOUT ANY
+#WARRANTY; without even the implied warranty of MERCHANTABILITY or
+#FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+#for more details.
+#
+#You should have received a copy of the GNU General Public License along
+#with groff; see the file LICENSE. If not, write to the Free Software
+#Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+MACRODIR=/usr/local/lib/groff/tmac
+MMDIR=$(MACRODIR)/mm
+#TMAC_M=gm
+TMAC_M=m
+# MAN7EXT is the man section for macros
+MAN7EXT=7
+MAN7DIR=/usr/local/man/man$(MAN7EXT)
+# MAN1EXT is the man section for user commands
+MAN1EXT=1
+SHELL=/bin/sh
+
+FILES=0.MT ms.MT ms.cov se_ms.cov
+
+.SUFFIXES: .man .n
+
+.man.n:
+ @echo Making $@ from $<
+ @-rm -f $@
+ @sed -e "s;@MACRODIR@;$(MACRODIR);g" \
+ -e "s;@MAN1EXT@;$(MAN1EXT);g" \
+ -e "s;@MAN7EXT@;$(MAN7EXT);g" \
+ -e "s;@TMAC_MDIR@;$(MMDIR);g" \
+ -e "s;@TMAC_M@;$(TMAC_M);g" \
+ -e "s;@VERSION@;`cat ../VERSION`;g" \
+ -e "s;@MDATE@;`$(SHELL) ../man/mdate.sh $<`;g" \
+ $< >$@
+ @chmod 444 $@
+
+all: groff_mm.n groff_mmse.n
+
+groff_mm.n: ../VERSION
+
+tar:
+ tar cvf mm.tar tmac* mm *.man Makefile ChangeLog README
+clean:
+ -rm -f groff_mm.n groff_mmse.n
+
+distclean: clean
+realclean: distclean
+
+TAGS:
+
+install.nobin: install.m all
+ -[ -d $(MACRODIR)/mm ] || mkdir $(MACRODIR)/mm
+ for f in $(FILES); do \
+ rm -f $(MACRODIR)/mm/$$f; \
+ cp mm/$$f $(MACRODIR)/mm; \
+ done
+ -[ -d $(MAN7DIR) ] || mkdir $(MAN7DIR)
+ -rm -f $(MAN7DIR)/groff_mm.$(MAN7EXT)
+ cp groff_mm.n $(MAN7DIR)/groff_mm.$(MAN7EXT)
+ -rm -f $(MAN7DIR)/groff_mmse.$(MAN7EXT)
+ cp groff_mmse.n $(MAN7DIR)/groff_mmse.$(MAN7EXT)
+
+install.m:
+ -[ -d $(MACRODIR) ] || mkdir $(MACRODIR)
+ -rm -f $(MACRODIR)/tmac.$(TMAC_M)
+ cp tmac.m $(MACRODIR)/tmac.$(TMAC_M)
+ -rm -f $(MACRODIR)/tmac.$(TMAC_M)se
+ sed 's/@TMAC_M@/$(TMAC_M)/' tmac.mse >$(MACRODIR)/tmac.$(TMAC_M)se
+
+install.bin:
+
+install: install.bin install.nobin
diff --git a/mm/README b/mm/README
new file mode 100644
index 000000000..05145713e
--- /dev/null
+++ b/mm/README
@@ -0,0 +1,16 @@
+This is mgm, a macro package for groff.
+
+It is supposed to be compatible with the DWB mm macros,
+and has several extensions.
+
+Send bug reports to jh@efd.lth.se with a description of the problem
+and a sample of text which reproduces the error.
+
+Don't forget to mention the version of mgm (look in the beginning
+of tmac.m) and the version of groff.
+
+Any new ideas or improvements are welcome.
+
+This README should be bigger :-)
+
+Jörgen.
diff --git a/mm/groff_mm.man b/mm/groff_mm.man
new file mode 100644
index 000000000..008390557
--- /dev/null
+++ b/mm/groff_mm.man
@@ -0,0 +1,604 @@
+.TH GROFF_MM @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
+.SH NAME
+groff_mm \- groff mm macros
+.SH SYNOPSIS
+.B groff
+.B \-m@TMAC_M@
+[
+.IR options .\|.\|.
+]
+[
+.IR files .\|.\|.
+]
+.SH DESCRIPTION
+The groff mm macros are intended to be compatible with the DWB mm macros
+with the following limitations:
+.TP
+.B \(bu
+no letter macros implemented (yet).
+.TP
+.B \(bu
+no Bell Labs localisms implemented.
+.TP
+.B \(bu
+the macros OK, PM and TM is not implemented.
+.TP
+.B \(bu
+groff mm does not support cut marks
+.LP
+\fBm@TMAC_M@\fP is intended to be international. Therefore it is
+possible to write short national macrofiles which change all
+english text to the preferred language. Use \fBm@TMAC_M@se\fP as an example.
+.LP
+Groff mm has several extensions:
+.TP
+.B B1
+Begin box (as the ms macro)
+Draws a box around the text.
+.TP
+.B B2
+End box. Finish the box.
+.TP
+.B BVL
+Start of
+broken variable-item list.
+As VL but text begins always at the next line
+.TP
+.B "COVER [arg]"
+Works just like MT, but reads from @TMAC_MDIR@/*.cov instead.
+\fIarg\fP is used together with \fI.cov\fP to find a macrofile
+with the selected headermacros, like \fIms.cov\fP.
+\fIms.cov\fP is supposed to look like the \fBms\fP coversheet.
+It is also possible to control size and fonts of title and abstract,
+since \fBCOVER\fP is before .TL, .AS and the rest.
+Only a few coverfiles exists at the moment.
+.TP
+.B COVEND
+This finish the cover description and prints the cover-page.
+It is defined in the cover file.
+.TP
+.B "GETHN refname [varname]"
+Includes the headernumber where the corresponding \fBSETR\fP \fIrefname\fP
+was placed. Will be X.X.X. in pass 1. See \fBINITR\fP.
+If varname is used, \fBGETHN\fP sets the variable \fIvarname\fP to the
+headernumber.
+.TP
+.B "GETPN refname [varname]"
+Includes the pagenumber where the corresponding \fBSETR\fP \fIrefname\fP
+was placed. Will be 9999 in pass 1. See \fBINITR\fP.
+If varname is used, \fBGETPN\fP sets the variable \fIvarname\fP
+to the pagenumber.
+.TP
+.B "GETR refname"
+Combines \fBGETHN\fP and \fBGETPN\fP with the text 'chapter' and ', page'.
+The string \fIQrf\fP contains the text for reference:
+.ti +.5i
+\&.ds Qrf See chapter \e\e*[Qrfh], page \e\e*[Qrfp].
+.br
+\fIQrf\fP may be changed to support other languages.
+Strings \fIQrfh\fP and \fIQrfp\fP are set by \fBGETR\fP
+and contains the page and headernumber.
+.TP
+.B "GETST refname [varname]"
+Includes the string saved with the second argument to \fB.SETR\fP.
+Will be dummystring in pass 1.
+If varname is used, \fBGETST\fP sets the variable \fIvarname\fP to the
+saved string. See \fBINITR\fP.
+.TP
+.B "INITR filename"
+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.
+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.
+Well, not new, but different.
+The \fIarg\fP is part of a filename in \fI@TMAC_MDIR@/*.MT\fP.
+So, it is possible to write even the AT&T covers now.
+\fIAddresse\fP just sets a variable, used in the AT&T macros.
+An example of a macro file can be found in \fI0.MT\fP.
+.TP
+.B "MOVE y-pos [x-pos [line-length]]"
+Move to a position, pageoffset set to \fIx-pos\fP.
+If \fIline-length\fP is not given, the difference between
+current and new pageoffset is used.
+Use \fBPGFORM\fP without arguments to return to normal.
+.TP
+.B "PGFORM [linelength [pagelength [pageoffset]]]"
+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.
+.TP
+.B PGNH
+No header is printed on the next page. Used to get rid off
+the header in letters or other special texts
+This macro must be used before any text to inhibit the pageheader
+on the first page.
+.TP
+.B "SETR refname [string]"
+Remember the current header and page-number as refname.
+Saves \fIstring\fP if \fIstring\fP is defined. \fIstring\fP is retrieved
+with \fB.GETST\fP.
+See \fBINITR\fP.
+.TP
+.B TAB
+reset tabs to every 5n. Normally used to reset any previous tabpositions.
+.TP
+.B VERBON
+Begin verbatim output using courier font.
+Usually for printing programs.
+All character has equal width.
+.TP
+.B VERBOFF
+End verbatim output.
+.sp
+.LP
+New variables in m@TMAC_M@:
+.TP
+.B Lifg
+String containing \fIFigure\fP.
+.TP
+.B Litb
+String containing \fITABLE\fP.
+.TP
+.B Liex
+String containing \fIExhibit\fP.
+.TP
+.B Liec
+String containing \fIEquation\fP.
+.TP
+.B Licon
+String containing \fICONTENTS\fP.
+.TP
+.B "MO1 - MO12"
+Strings containing \fIJanuary\fI to \fIDecember\fP.
+.TP
+.B Qrf
+String containing "See chapter \e\e*[Qrfh], page \e\en[Qrfp].".
+.TP
+.B .mgm
+Always 1.
+.sp 3
+.LP
+The following standard macros are implemented:
+.TP
+.B 1C
+Begin one column processing
+.TP
+.B 2C
+Begin two column processing
+.TP
+.B AE
+Abstract end
+.TP
+.B "AF [name of firm]"
+Authors firm
+.TP
+.B "AL [type [text-indent [1]]]]"
+Start autoincrement list
+.TP
+.B "AS [arg [indent]]"
+Abstract start
+.TP
+.B "AT title1 [title2 ...]"
+Authors title
+.TP
+.B "AU name [initials [loc [dept [ext [room [arg [arg [arg]]]]]]]]"
+Author information
+.TP
+.B "B [bold-text [prev-font-tex [...]]]"
+Begin boldface
+No limit on the number of arguments.
+.TP
+.B BE
+End bottom block
+.TP
+.B "BI [bold-text [italic-text [bold-text [...]]]"
+Bold-italic.
+No limit on the number of arguments.
+.TP
+.B "BL [text-indent [1]]"
+Start bullet list
+.TP
+.B "BR [bold-text [roman-text [bold-text [...]]]"
+Bold-roman.
+No limit on the number of arguments.
+.TP
+.B BS
+Bottom block start
+.TP
+.B DE
+Display end
+.TP
+.B "DF [format [fill [rindent]]]"
+Begin floating display (no nesting allowed)
+.TP
+.B "DL [text-indent [1]]"
+Dash list start
+.TP
+.B "DS [format [fill [rindent]]]"
+Static display start.
+Can now have unlimited nesting. Also
+right adjusted text and block may be used (R or RB as \fIformat\fP).
+.TP
+.B "EC [title [override [flag [refname]]]]"
+Equation title.
+If \fIrefname\fP is used, then the equationnumber is saved with
+\fB.SETR\fP, and can be retrieved with \fB.GETST\fP \fIrefname\fP.
+See BUGS for limits.
+.TP
+.B "EF [arg]"
+Even-page footer.
+.TP
+.B "EH [arg]"
+Even-page header.
+.TP
+.B EN
+Equation end.
+.TP
+.B "EQ [label]"
+Equation start.
+.TP
+.B "EX [title [override [flag [refname]]]]"
+Exhibit title.
+If \fIrefname\fP is used, then the exhibitnumber is saved with
+\fB.SETR\fP, and can be retrieved with \fB.GETST\fP \fIrefname\fP.
+See BUGS for limits.
+.TP
+.B "FD [arg [1]]"
+Footnote default format.
+.TP
+.B FE
+Footnote end.
+.TP
+.B "FG [title [override [flag [refname]]]]"
+Figure title.
+If \fIrefname\fP is used, then the figurenumber is saved with
+\fB.SETR\fP, and can be retrieved with \fB.GETST\fP \fIrefname\fP.
+See BUGS for limits.
+.TP
+.B FS
+Footnote start.
+Footnotes in displays is now possible.
+.TP
+.B "H level [heading-text [heading-suffix]]"
+Numbered heading.
+.TP
+.B "HC [hypenation-character]"
+Set hypenation character.
+.TP
+.B "HM [arg1 [arg2 [... [arg7]]]]"
+Heading mark style.
+.TP
+.B "HU heading-text"
+Unnumbered header.
+.TP
+.B "HX dlevel rlevel heading-text"
+Userdefined heading exit.
+Called just before printing the header.
+.TP
+.B "HY dlevel rlevel heading-text"
+Userdefined heading exit.
+Called just before printing the header.
+.TP
+.B "HZ dlevel rlevel heading-text"
+Userdefined heading exit.
+Called just after printing the header.
+.TP
+.B "I [italic-text [prev-font-text [italic-text [...]]]"
+Italic.
+.TP
+.B "IB [italic-text [bold-text [italic-text [...]]]"
+Italic-bold
+.TP
+.B "IR [italic-text [roman-text [italic-text [...]]]"
+Italic-roman
+.TP
+.B "LB text-indent mark-indent pad type [mark [LI-space [LB-space]]]"
+List begin macro.
+.TP
+.B "LC [list level]"
+List-status clear
+.TP
+.B LE
+List end.
+.TP
+.B "LI [mark [1]]"
+List item
+.TP
+.B "ML mark [text-indent]"
+Marked list start
+.TP
+.B "MT [arg [addressee]]"
+Memorandom type. See above note about MT.
+.TP
+.B "ND new-date"
+New date.
+.TP
+.B "OF [arg]"
+Odd-page footer
+.TP
+.B "OH [arg]"
+Odd-page header
+.TP
+.B OP
+Skip to odd page.
+.TP
+.B "P [type]"
+Begin new paragraph.
+.TP
+.B PE
+Picture end.
+.TP
+.B "PF [arg]"
+Page footer
+.TP
+.B "PH [arg]"
+Page header
+.TP
+.B PS
+Picture start (from pic)
+.TP
+.B PX
+Page-header user-defined exit.
+.TP
+.B R
+Roman.
+.TP
+.B "RB [roman-text [bold-text [roman-text [...]]]"
+Roman-bold.
+.TP
+.B "RD [prompt [diversion [string]]]"
+Read to diversion and/or string.
+.TP
+.B RF
+Reference end
+.TP
+.B "RI [roman-text [italic-text [roman-text [...]]]"
+Roman-italic.
+.TP
+.B "RL [text-indent [1]]"
+Reference list start
+.TP
+.B "RP [arg [arg]]"
+Produce reference page.
+.TP
+.B "RS [string-name]"
+Reference start.
+.TP
+.B "S [size [spacing]]"
+Set point size and vertical spacing. If any argument is equal 'P', then
+the previous value is used. A 'C' means current value, and 'D' default value.
+If '+' or '-' is used before the value, then increment or decrement of
+the current value will be done.
+.TP
+.B "SA [arg]"
+Set adjustment.
+.TP
+.B "SK [pages]"
+Skip pages.
+.TP
+.B "SM string1 [string2 [string3]]"
+Make a string smaller.
+.TP
+.B "SP [lines]"
+Space vertically. \fIlines\fP can have any scalingfactor, like \fI3i\fP or
+\fI8v\fP.
+.TP
+.B "TB [title [override [flag [refname]]]]"
+Table title.
+If \fIrefname\fP is used, then the tablenumber is saved with
+\fB.SETR\fP, and can be retrieved with \fB.GETST\fP \fIrefname\fP.
+See BUGS for limits.
+.TP
+.B "TC [slevel [spacing [tlevel [tab [h1 [h2 [h3 [h4 [h5]]]]]]]]]"
+Table of contents.
+All texts can be redefined, new stringvariables
+\fILifg\fP, \fILitb\fP, \fILiex\fP, \fILiec\fP and \fILicon\fP contains
+"Figure", "TABLE", "Exhibit", "Equation" and "CONTENTS".
+These can be redefined to other languages.
+.TP
+.B TE
+Table end.
+.TP
+.B "TH [N]"
+Table header.
+.TP
+.B TL
+Begin title of memorandom.
+.TP
+.B TP
+Top of page user-defined macro.
+.TP
+.B "TS [H]"
+Table start
+.TP
+.B TX
+Userdefined table of contents exit.
+.TP
+.B TY
+Userdefined tbale of contents exit (no "CONTENTS").
+.TP
+.B "VL [text-indent [mark-indent [1]]]"
+Variable-item list start
+.TP
+.B "VM [top [bottom]]"
+Vertical margin.
+.TP
+.B "WC [format]"
+Footnote and display width control.
+.sp 3
+.LP
+Strings used in m@TMAC_M@:
+.TP
+.B "EM"
+Em dash string
+.TP
+.B HF
+Fontlist for headings, normally "2 2 2 2 2 2 2".
+Nonnumeric fontnames may also be used.
+.TP
+.B HP
+Pointsize list for headings. Normally "0 0 0 0 0 0 0" which is the same as
+"10 10 10 10 10 10 10".
+.TP
+.B Lf
+Contains "LIST OF FIGURES".
+.TP
+.B Lt
+Contains "LIST OF TABLES".
+.TP
+.B Lx
+Contains "LIST OF EXHIBITS".
+.TP
+.B Le
+Contains "LIST OF EQUATIONS".
+.TP
+.B Rp
+Contains "REFERENCES".
+.TP
+.B Tm
+Contains \e(tm, trade mark.
+.\"-----------------------------------
+.LP
+Number variables used in m@TMAC_M@:
+.TP
+.B Cl=2
+Contents level [0:7], contents saved if heading level <= Cl
+.TP
+.B Cp=0
+Eject page between LIST OF XXXX if Cp == 0
+.TP
+.B D=0
+Debugflag, values >0 produces varying degree of debug. A value of 1
+gives information about the progress of formatting.
+.TP
+.B De=0
+Eject after floating display is output [0:1]
+.TP
+.B Df=5
+Floating keep output [0:5]
+.TP
+.B Ds=1
+space before and after display if == 1 [0:1]
+.TP
+.B Ej=0
+Eject page
+.TP
+.B Eq=0
+Eqation lable adjust 0=left, 1=right
+.TP
+.B Fs=1
+Footnote spacing
+.TP
+.B "H1-H7"
+Heading counters
+.TP
+.B Hb=2
+Heading break level [0:7]
+.TP
+.B Hc=0
+Heading centering level, [0:7]
+.TP
+.B Hi=1
+Heading temporary indent [0:2]
+0 -> 0 indent, left margin
+.br
+1 -> indent to right , like .P 1
+.br
+2 -> indent to line up with text part of preceding heading
+.TP
+.B Hs=2
+Heading space level [0:7]
+.TP
+.B Ht=0
+Heading numbering type
+0 -> multiple (1.1.1 ...)
+.br
+1 -> single
+.TP
+.B Hu=2
+Unnumbered heading level
+.TP
+.B Hy=1
+Hyphenation in body
+0 -> no hyphenation
+.br
+1 -> hyphenation 14 on
+.TP
+.B "Lf=1, Lt=1, Lx=1, Le=0"
+Enables (1) or disables (0) the printing of List of figures,
+List of tables, List of exhibits and List of equations.
+.TP
+.B Li=6
+List indent, used by .AL
+.TP
+.B Ls=99
+List space, if current listlevel > Ls then no spacing will occur around lists.
+.TP
+.B N=0
+Numbering style [0:5]
+.TP
+.B Np=0
+Numbered paragraphs.
+.br
+0 == not numbered
+.br
+1 == numbered in first level headings.
+.TP
+.B Of=0
+Format of figure,table,exhibit,equation titles.
+.br
+0= ". "
+.br
+1= " - "
+.TP
+.B Pi=5
+paragraph indent
+.TP
+.B Ps=1
+paragraph spacing
+.TP
+.B Pt=0
+Paragraph type.
+.br
+0 == left-justified
+.br
+1 == indented .P
+.br
+2 == indented .P except after .H, .DE or .LE.
+.TP
+.B Si=5
+Display indent.
+.LP
+.SH BUGS
+It is only possible to have one title in each \fB.DS\fP/\fB.DE\fP
+for figures, equations, exhibits and tables. This title is always printed
+under the contents in the display. It is, however, possible to use
+these macros outside displays also.
+.SH AUTHOR
+Jörgen Hägg, Lund Institute of Technology, Sweden <jh@efd.lth.se>
+.SH FILES
+.TP
+.B @MACRODIR@/tmac.@TMAC_M@
+.TP
+.B @TMAC_MDIR@*.cov
+.TP
+.B @TMAC_MDIR@*.MT
+.SH "SEE ALSO"
+.BR groff (@MAN1EXT@),
+.BR gtroff (@MAN1EXT@),
+.BR gtbl (@MAN1EXT@),
+.BR gpic (@MAN1EXT@),
+.BR geqn (@MAN1EXT@)
+.br
+.BR mm (@MAN7EXT@)
+.BR m@TMAC_M@se (@MAN7EXT@)
diff --git a/mm/groff_mmse.man b/mm/groff_mmse.man
new file mode 100644
index 000000000..0ee51c7c0
--- /dev/null
+++ b/mm/groff_mmse.man
@@ -0,0 +1,33 @@
+.TH GROFF_MMSE @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
+.SH NAMN
+groff_mmse \- svenska mm makro för groff
+.SH SYNTAX
+.B groff
+.B \-m@TMAC_M@se
+[
+.IR flaggor .\|.\|.
+]
+[
+.IR filer .\|.\|.
+]
+.SH BESKRIVNING
+\fBm@TMAC_M@se\fP är en svensk variant av \fBm@TMAC_M@\fP. Alla texter
+är översatta. En A4 sida får text som är 13 cm bred, 3.5 cm indragning
+samt är 28.5 cm hög.
+.LP
+\fBCOVER\fP kan använda \fIse_ms\fP som argument. Detta ger ett
+svenskt försättsblad.
+Se \fBgroff_mm(@MAN7EXT@)\fP för övriga detaljer.
+.SH "SKRIVET AV"
+Jörgen Hägg, Lunds Tekniska Högskola <jh@efd.lth.se>
+.SH FILER
+.B @MACRODIR@/tmac.@TMAC_M@se
+.B @TMAC_MDIR@/se_*.cov
+.SH "SE OCKSÅ"
+.BR groff (@MAN1EXT@),
+.BR gtroff (@MAN1EXT@),
+.BR gtbl (@MAN1EXT@),
+.BR gpic (@MAN1EXT@),
+.BR geqn (@MAN1EXT@)
+.br
+.BR m@TMAC_M@ (@MAN7EXT@)
diff --git a/mm/mm/0.MT b/mm/mm/0.MT
new file mode 100644
index 000000000..cbc73c7f8
--- /dev/null
+++ b/mm/mm/0.MT
@@ -0,0 +1,91 @@
+.\"------------
+.\" Cover sheet. Memorandum type 0
+.\" version 0.10
+.\" MT covers will be maintained at low priority.
+.\"------------
+.PH "''''"
+.OH "''''"
+.EH "''''"
+.de cov@print-title
+.MOVE 5.6c 1.5c
+.S 8
+subject:
+.br
+.sp -1.4
+.S
+.in 1.2c
+.\" .MOVE \\n[misc*cur-bline]u 2.7c
+.nf
+.B
+.cov*title
+.R
+.fi
+.PGFORM
+..
+.\"------------
+.de cov@print-authors
+.MOVE 6.5c 13.5c
+.S 8
+\\$1:
+.br
+.S
+.sp -1
+.in 0.8c
+.B
+.nr cov*i 0 1
+.while \\n+[cov*i]<=\\n[cov*au] \{\
+\\*[cov*au!\\n[cov*i]!1]
+.br
+.\}
+.R
+.PGFORM
+..
+.\"------------
+.de cov@print-date
+.MOVE 5.6c 13.5c
+.S 8
+\\$1:
+.br
+.S
+.sp -1
+.in 0.8c
+.B "\\*[cov*new-date]"
+.br
+.PGFORM
+..
+.\"------------
+.de cov@print-firm
+.MOVE 4c 0 17.7c
+.S 18
+.rj \\n[cov*title-size]
+\fB\\*[cov*firm]\fP
+.S
+.PGFORM
+..
+.\"------------
+.de cov@print-abstract
+.MOVE 8.1c
+.ce
+\fI\\$1\fP
+.SP 1c
+.ev cov*ev
+.init@reset
+.nf
+.ll \\n[@ll]u
+.if d cov*abstract .cov*abstract
+.ev
+..
+.\"-----------------
+.if !d cov*mt-printed \{\
+. cov@print-firm
+. cov@print-title subject
+. cov@print-date date
+. cov@print-authors from
+. cov@print-abstract ABSTRACT
+. SP 1.7c
+. ce
+\fIMEMORANDUM FOR FILE\fP
+. pg@enable-top-trap
+. pg@enable-trap
+. ds cov*mt-printed
+.\}
diff --git a/mm/mm/ms.MT b/mm/mm/ms.MT
new file mode 100644
index 000000000..6bffba5a1
--- /dev/null
+++ b/mm/mm/ms.MT
@@ -0,0 +1,47 @@
+.\"------------
+.\" Cover sheet. Mostly like ms cover.
+.\" version 0.8
+.\"------------
+.de cov@print-title
+.nf
+.in 0
+.ce \\n[cov*title-size]
+.cov*title
+.fi
+..
+.\"------------
+.de cov@print-authors
+.nr cov*i 0 1
+.while \\n+[cov*i]<=\\n[cov*au] \{\
+. ce
+\fI\\*[cov*au!\\n[cov*i]!1]\fP
+.\}
+..
+.\"------------
+.de cov@print-abstract
+.DS CB
+.cov*abstract
+.DE
+..
+.\"------------
+.de cov@print-date
+.S 8
+.ce
+\\*[cov*new-date]
+..
+.\"-----------------
+.sp 8
+.cov@print-title
+.\"
+.sp 2
+.S 12
+.cov@print-authors
+.\"
+.sp 2
+.cov@print-date
+.sp 4
+.S 10
+.cov@print-abstract
+.pg@enable-top-trap
+.bp 1
+.pg@enable-trap
diff --git a/mm/mm/ms.cov b/mm/mm/ms.cov
new file mode 100644
index 000000000..673c2530c
--- /dev/null
+++ b/mm/mm/ms.cov
@@ -0,0 +1,67 @@
+.\"------------
+.\" Cover sheet. Mostly like ms cover.
+.\" version 0.8
+.\"------------
+.nr cov*title-size 14
+.\"------------
+.de cov@print-title
+.in 0
+.ce \\n[cov*title-size]
+.cov*title
+..
+.\"------------
+.de cov@print-authors
+.SP
+.nr cov*i 0 1
+.while \\n+[cov*i]<=\\n[cov*au] \{\
+. ce
+\fI\\*[cov*au!\\n[cov*i]!1]\fP
+. nr cov*j 0 1
+. while \\n+[cov*j]<=9 \{\
+. if d cov*at!\\n[cov*i]!\\n[cov*j] \{\
+. ce
+\s-1\\*[cov*at!\\n[cov*i]!\\n[cov*j]]\s0
+. \}
+. \}
+.\}
+..
+.\"------------
+.de cov@print-firm
+.SP .5
+.ce
+\\*[cov*firm]
+..
+.\"------------
+.nr cur*abstract-ll 12.6c
+.\"
+.de cov@print-abstract
+.SP 2
+.if \\n[.$] \{\
+. ce
+\\$1
+.\}
+.ev cov*ev
+.init@reset
+.nf
+.ll \\n[@ll]u
+.in (u;(\\n[@ll]-\\n[cov*abstract-width])/2)
+.cov*abstract
+.ev
+..
+.\"------------
+.de cov@print-date
+.SP 2
+\\*[cov*new-date]
+..
+.\"-----------------
+.de COVEND
+.sp |4.2c
+.cov@print-title
+.cov@print-authors
+.cov@print-firm
+.cov@print-abstract
+.cov@print-date
+.pg@enable-top-trap
+.bp 1
+.pg@enable-trap
+..
diff --git a/mm/mm/se_ms.cov b/mm/mm/se_ms.cov
new file mode 100644
index 000000000..92f90da7a
--- /dev/null
+++ b/mm/mm/se_ms.cov
@@ -0,0 +1,3 @@
+.\" version 0.8
+.mso mac.gm/ms.cov
+.nr cur*abstract-ll 11c
diff --git a/mm/tmac.m b/mm/tmac.m
new file mode 100644
index 000000000..c98b8b950
--- /dev/null
+++ b/mm/tmac.m
@@ -0,0 +1,2153 @@
+.\" Version:
+.ds RE 0.13
+.ig
+Copyright (C) 1991 Free Software Foundation, Inc.
+mgm is written by Jörgen Hägg (jh@efd.lth.se)
+
+mgm is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 1, or (at your option) any later
+version.
+
+mgm is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License along
+with groff; see the file LICENSE. If not, write to the Free Software
+Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+
+Almost complete. The letter format is not included.
+Maybe as a separate package.
+Should be better as time goes.
+
+Please send bugreports with examples to jh@efd.lth.se.
+
+Naming convention stolen from mgs.
+Local names module*name
+Extern names module@name
+Env.var environ:name
+Index array!index
+..
+.warn
+.\" ####### init ######
+.\" Contents level [0:7], contents saved if heading level <= Cl
+.nr Cl 2
+.\" Eject page between LIST OF XXXX if Cp == 0
+.nr Cp 0
+.\" Debugflag
+.if !r D .nr D 0
+.\" Eject after floating display is output [0:1]
+.nr De 0
+.\" Floating keep output [0;5]
+.nr Df 5
+.\" space before and after display if == 1 [0:1]
+.nr Ds 1
+.\" Eject page
+.nr Ej 0
+.\" Eqation lable adjust 0=left, 1=right
+.nr Eq 0
+.\" Em dash string
+.ds EM \-
+.\" Footnote spacing
+.nr Fs 1
+.\" H1-H7 heading counters
+.nr H1 0 1
+.nr H2 0 1
+.nr H3 0 1
+.nr H4 0 1
+.nr H5 0 1
+.nr H6 0 1
+.nr H7 0 1
+.\" Heading break level [0:7]
+.nr Hb 2
+.\" heading centering level, [0:7]
+.nr Hc 0
+.\" header format
+.ds HF 2 2 2 2 2 2 2
+.\" heading temp. indent [0:2]
+.\" 0 -> 0 indent, left margin
+.\" 1 -> indent to right , like .P 1
+.\" 2 -> indent to line up with text part of preceding heading
+.nr Hi 1
+.\" header pointsize
+.ds HP 0 0 0 0 0 0 0
+.\" heading space level [0:7]
+.nr Hs 2
+.\" heading numbering type
+.\" 0 -> multiple (1.1.1 ...)
+.\" 1 -> single
+.nr Ht 0
+.\" Unnumbered heading level
+.nr Hu 2
+.\" hyphenation in body
+.\" 0 -> no hyphenation
+.\" 1 -> hyphenation 14 on
+.nr Hy 1
+.\" text for toc, selfexplanatory. Look in the new variable section
+.ds Lf LIST OF FIGURES
+.nr Lf 1
+.ds Lt LIST OF TABLES
+.nr Lt 1
+.ds Lx LIST OF EXHIBITS
+.nr Lx 1
+.ds Le LIST OF EQUATIONS
+.nr Le 0
+.\" List indent, used by .AL
+.nr Li 6
+.\" List space, if listlevel > Ls then no spacing will occur around lists.
+.nr Ls 99
+.\" Numbering style [0:5]
+.nr N 0
+.\" numbered paragraphs
+.\" 0 == not numbered
+.\" 1 == numbered in first level headings.
+.nr Np 0
+.\" Format of figure,table,exhibit,equation titles.
+.\" 0= ". ", 1=" - "
+.nr Of 0
+.\" paragraph indent
+.nr Pi 5
+.\" paragraph spacing
+.nr Ps 1
+.\" paragraph type
+.\" 0 == left-justified
+.\" 1 == indented .P
+.\" 2 == indented .P except after .H, .DE or .LE.
+.nr Pt 0
+.\" Reference title
+.ds Rp REFERENCES
+.\" Display indent
+.nr Si 5
+.\"
+.ds Tm \(tm
+.\"
+.\"---------------------------------------------
+.\" Internal global variables
+.\"
+.\" These two are for cover macro .MT
+.\" Change @langage in the national file.
+.ds @cur-lib /usr/local/lib/groff/tmac
+.\" .ds @language
+.\" Current pointsize and vertical space, always in points.
+.nr @ps 10
+.nr @vs 12
+.\" Page length
+.ie r L .nr @pl \n[L]
+.el .nr @pl 11i
+.\" page width
+.ie r W .nr @ll \n[W]
+.el .nr @ll 6i
+.\" page offset
+.ie r O .nr @ll \n[O]
+.el .nr @po .75i
+.\"
+.\" cheating...
+.\".pl 100i
+.pl \n[@pl]u
+.ll \n[@ll]u
+.po \n[@po]u
+.nr @cur-ll \n[@ll]
+.\"---------------------------------------------
+.\" New variables
+.\"
+.\" Change these in the national configuration file
+.ds Lifg Figure
+.ds Litb TABLE
+.ds Liex Exhibit
+.ds Liec Equation
+.ds Licon CONTENTS
+.ds MO1 January
+.ds MO2 February
+.ds MO3 March
+.ds MO4 April
+.ds MO5 May
+.ds MO6 June
+.ds MO7 July
+.ds MO8 August
+.ds MO9 September
+.ds MO10 October
+.ds MO11 November
+.ds MO12 December
+.\" for GETR
+.ds Qrf See chapter \\*[Qrfh], page \\n[Qrfp].
+.\" test for mgm macro. This can be used if the text must test
+.\" what macros is used.
+.nr .mgm 1
+.\"---------------------------------------------
+.if \n[D] .tm Groff mm, version \*[RE].
+.\" ####### module init ######
+.\" reset all things
+.de init@reset
+.ie \\n[misc@adjust] 'ad
+.el 'na
+.ie \\n[Hy] 'hy 14
+.el 'nh
+'in 0
+'ti 0
+'ps \\n[@ps]
+'vs \\n[@vs]
+..
+.de @error
+.tm ******************
+.tm ERROR:(\\n[.F]) input line \\n[.c]:\\$*
+.if \\n[D] .backtrace
+.tm ******************
+.ab
+..
+.\" ####### module debug #################################
+.de debug
+.tm \\$1:\\n[.F]:\\n[c.] ll=\\n[.l] vs=\\n[.v] ps=\\n[.s],\\n[.ps] \
+in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
+..
+.de debug-all
+.nr debug*n 1n
+.nr debug*m 1m
+.tm \\$1:\\n[.F]:\\n[c.] ll=\\n[.l] vs=\\n[.v] ps=\\n[.s] in=\\n[.i]\
+ ad=\\n[.j] fi=\\n[.u] pl=\\n[.p] page=\\n[%] .o=\\n[.o]
+.tm _______ .d=\\n[.d] .f=\\n[.f] .h=\\n[.h] .k=\\n[.k] .n=\\n[.n]\
+ .p=\\n[.p] .t=\\n[.t] .z=\\n[.z] nl=\\n[nl] dn=\\n[dn] n=\\n[debug*n]
+..
+.\" ####### module par #################################
+.nr par@ind-flag 1 \" indent on following P if Pt=2
+.nr hd*last-pos -1
+.nr par*number 0 1
+.af par*number 01
+.nr par*num-count 0 1
+.af par*num-count 01
+.\" reset numbered paragraphs, arg1 = headerlevel
+.de par@reset-num
+.if \\$1<3 .nr par*num-count 0
+.if (\\$1=1)&(\\n[Np]=1) .nr par*number 0
+..
+.\"------------
+.\" paragraph
+.de P
+.\" skip P if previous heading
+.if !((\\n[nl]=\\n[hd*last-pos]):(\\n[nl]=(\\n[hd*last-pos]-.5v))) \{\
+. if \\n[D]>2 .tm Paragraph
+. par@doit \\$*
+.\}
+..
+.de par@doit
+.SP \\n[Ps]/2u
+.ie \\n[.$] \{\
+. if \\$1=1 .ti +\\n[Pi]n
+.\}
+.el \{\
+. if \\n[Pt]=1 .ti +\\n[Pi]n
+. if (\\n[Pt]=2)&\\n[par@ind-flag] .ti +\\n[Pi]n
+.\}
+.if \\n[Np] \{\
+\\n[H1].\\n+[par*number]\ \ \c
+.\" $$$ 'br
+.\}
+.nr par@ind-flag 1
+..
+.\" ####### module line #######################################
+.de SP
+.br
+.if !r line*lp\\n[.z] .nr line*lp\\n[.z] 0
+.if !r line*ac\\n[.z] .nr line*ac\\n[.z] 0
+.ie \\n[.$] .nr line*temp (v;\\$1)
+.el .nr line*temp 1v
+.\"
+.ie \\n[line*lp\\n[.z]]=\\n[.d] \{\
+. \" go here if no output since the last .SP
+. nr line*output \\n[line*temp]-\\n[line*ac\\n[.z]]
+. if \\n[line*output]<0 .nr line*output 0
+. nr line*ac\\n[.z] +\\n[line*output]
+.\}
+.el \{\
+. nr line*ac\\n[.z] \\n[line*temp]
+. nr line*output \\n[line*temp]
+. \" no extra space in the beginning of a page
+. if (\\n[.d]<0):(\\n[pg*head-mark]=\\n[.d]) .nr line*output 0
+.\}
+.if \\n[line*output] .sp \\n[line*output]u
+.nr line*lp\\n[.z] \\n[.d]
+..
+.\" ######## module misc ###############
+.nr misc@adjust 14
+.de SA
+.if \\n[.$] \{\
+. if \\$1-1 .@error "SA: bad arg: \\$1"
+. nr misc@adjust 0\\$1
+.\}
+.ie \\n[misc@adjust] 'ad
+.el 'na
+..
+.\"-------------
+.\" switch environment, keep all important settings.
+.de misc@ev-keep
+.nr misc*ll \\n[.l]
+.ev \\$1
+.ll \\n[misc*ll]u
+..
+.\"-------------
+.\" .misc@push stackname value
+.de misc@push
+.ie d misc*st-\\$1 .ds misc*st-\\$1 \\$2 \\*[misc*st-\\$1]
+.el .ds misc*st-\\$1 \\$2
+..
+.\"-------------
+.\" .misc@pop stackname
+.\" value returned in the string misc*pop
+.de misc@pop
+.misc@pop-set misc*st-\\$1 \\*[misc*st-\\$1]
+..
+.\"-------------
+.de misc@pop-set
+.ds misc*st-name \\$1
+.shift
+.if \\n[.$]<1 .@error "stack \\*[misc*st-name] empty"
+.ds misc*pop \\$1
+.shift
+.ds \\*[misc*st-name] \\$*
+..
+.\"-------------
+.\" .misc@pop-nr stackname varname
+.de misc@pop-nr
+.misc@pop \\$1
+.nr \\$2 \\*[misc*pop]
+..
+.\"-------------
+.\" .misc@pop-ds stackname varname
+.de misc@pop-ds
+.misc@pop \\$1
+.ds \\$2 \\*[misc*pop]
+..
+.\"-----------
+.\" reset tabs
+.de TAB
+.ta T 5n
+..
+.\"-------------
+.\" .PGFORM linelength [ pagelength [ pageoffset ] ]
+.de PGFORM
+.if !''\\$1' .nr @ll \\$1
+.if !''\\$2' .nr @pl \\$2
+.if !''\\$3' .nr @po \\$3
+.ll \\n[@ll]u
+.po \\n[@po]u
+.pl \\n[@pl]u
+.nr @cur-ll \\n[@ll]
+.pg@move-trap
+..
+.\"-------------
+.\" .MOVE y [[x] linelength]
+.\" move to line y, indent to x
+.de MOVE
+.if !\\n[.$] .@error "MOVE y [x]: no arguments"
+.if \\n[nl]<0 \c
+.sp |(v;\\$1)
+.ie \\n[.$]>2 .nr pg*i (v;\\$3)
+.el \{\
+. ie \\n[.$]>1 .nr pg*i (v;\\n[@ll]u-\\$2)
+. el .nr pg*i (v;\\n[@ll]u)
+.\}
+.if !''\\$2' \{\
+. po \\$2
+. ll \\n[pg*i]u+\\n[@po]u
+.\}
+..
+.\"-------------
+.de SM
+.if !\\n[.$] .@error "SM: no arguments"
+.if \\n[.$]=1 \s-1\\$1\s0
+.if \\n[.$]=2 \s-1\\$1\s0\\$2
+.if \\n[.$]=3 \\$1\s-1\\$2\s0\\$3
+..
+.\"-------------
+.nr misc*S-ps \n[@ps]
+.nr misc*S-vs \n[@vs]
+.nr misc*S-ps1 \n[@ps]
+.nr misc*S-vs1 \n[@vs]
+.ds misc*a
+.ds misc*b
+.de S
+.ie !\\n[.$] \{\
+. ds misc*a P
+. ds misc*b P
+.\}
+.el \{\
+. ie \\n[.$]=1 .ds misc*b D
+. el \{\
+. ie \w'\\$2'=0 .ds misc*b C
+. el .ds misc*b \\$2
+. \}
+. ie \w'\\$1'=0 .ds misc*a C
+. el .ds misc*a \\$1
+.\}
+.\" set point size
+.if !'\\*[misc*a]'C' \{\
+. ie '\\*[misc*a]'P' .nr @ps \\n[misc*S-ps]
+. el \{\
+. ie '\\*[misc*a]'D' .nr @ps 10
+. el .nr @ps \\*[misc*a]
+. \}
+.\}
+.\" set vertical spacing
+.if !'\\*[misc*b]'C' \{\
+. ie '\\*[misc*b]'P' .nr @vs \\n[misc*S-vs]
+. el \{\
+. ie '\\*[misc*b]'D' .nr @vs \\n[@ps]+2
+. el .nr @vs \\*[misc*b]
+. \}
+.\}
+.init@reset
+.if \\n[D]>1 .tm point-size \\n[@ps] (\\n[.s]), vertical spacing \\n[@vs] (\\n[.v])
+.nr misc*S-ps \\n[misc*S-ps1]
+.nr misc*S-vs \\n[misc*S-vs1]
+.nr misc*S-ps1 \\n[@ps]
+.nr misc*S-vs1 \\n[@vs]
+..
+.\"------------
+.de HC
+.ev 0
+.hc \\$1
+.ev
+.ev 1
+.hc \\$1
+.ev
+.ev 2
+.hc \\$1
+.ev
+..
+.\"------------
+.de RD
+.tm \\$@
+.di misc*rd
+'fl
+.rd \\$1
+.br
+.di
+.ie !''\\$3' \{\
+. di misc*rd2
+. ds \\$3 "\\*[misc*rd]
+. br
+. di
+.\}
+.if !''\\$2' .rn misc*rd \\$2
+.rm misc*rd misc*rd2
+..
+.\"------------
+.de VERBON
+.br
+.misc@ev-keep misc*verb-ev
+.nf
+.ft CR
+.ss 12
+.ta T 8u*\w'n'u
+..
+.de VERBOFF
+.ev
+..
+.\" ######## module acc #################
+.\"-----------
+.\" accents. These are copied from mgs, written by James Clark.
+.de acc@over-def
+.ds \\$1 \Z'\v'(u;\w'x'*0+\En[rst]-\En[.cht])'\
+\h'(u;-\En[skw]+(-\En[.w]-\w'\\$2'/2)+\En[.csk])'\\$2'
+..
+.de acc@under-def
+.ds \\$1 \Z'\v'\En[.cdp]u'\h'(u;-\En[.w]-\w'\\$2'/2)'\\$2'
+..
+.acc@over-def ` \`
+.acc@over-def ' \'
+.acc@over-def ^ ^
+.acc@over-def ~ ~
+.acc@over-def : \(ad
+.acc@over-def ; \(ad
+.acc@under-def , \(ac
+.\" ######## module uni #################
+.\" unimplemented macros
+.de OK
+.tm "OK: not implemented"
+..
+.de PM
+.tm "PM: not implemented"
+..
+.de TM
+.tm "TM: not implemented"
+..
+.\" ######## module hd #################
+.\" support for usermacro
+.nr hd*htype 0
+.ds hd*mark
+.ds hd*suf-space
+.nr hd*need 0
+.aln ;0 hd*htype
+.als }0 hd*mark
+.als }2 hd*suf-space
+.aln ;3 hd*need
+.\"-------------
+.\" .hd@split varable index val1 val2 ...
+.de hd@split
+.nr hd*sp-tmp \\$2+2
+.ds \\$1 \\$[\\n[hd*sp-tmp]]
+..
+.de HU
+.H 0 "\\$1"
+..
+.\"-------------
+.de H
+.nr hd*cur-bline \\n[nl]
+.br
+.ds@print-float 2\" $$$ could be wrong...
+.\" terminate all lists
+.LC 0
+.init@reset
+.nr hd*level 0\\$1
+.nr hd*arg1 0\\$1
+.if !\\n[hd*level] .nr hd*level \\n[Hu]
+.\" Check if it's time for new page. Only if text has
+.\" appeared before.
+.if \\n[Ej]&(\\n[Ej]>=\\n[hd*level])&(\\n[hd*cur-bline]>=0) .pg@next-page
+.\" clear lower counters
+.nr hd*i 1 1
+.while \\n+[hd*i]<8 .if \\n[hd*level]<\\n[hd*i] .nr H\\n[hd*i] 0 1
+.\"
+.\" increment current counter
+.if \\n[hd*arg1] .nr H\\n[hd*level] +1
+.ie \\n[hd*level]<=1 .SP 1\" pre-space
+.el .SP .5
+.\"
+.\" hd*mark is the text written to the left of the header.
+.ds hd*mark \\n[H1].
+.if \\n[hd*level]>1 .as hd*mark \\n[H2]
+.nr hd*i 2 1
+.while \\n+[hd*i]<8 .if \\n[hd*level]>(\\n[hd*i]-1) .as hd*mark .\\n[H\\n[hd*i]]
+.if \\n[Ht] .ds hd*mark \\n[H\\n[hd*level]].
+.\"
+.\" toc-mark is sent to the table of contents
+.ds hd*toc-mark \\*[hd*mark]
+.as hd*mark \ \ \" add spaces between mark and heading
+.if !\\n[hd*arg1] \{\
+. ds hd*mark\" no mark for unnumbered
+. ds hd*toc-mark
+.\}
+.\"
+.if \\n[D]>1 .tm At header \\*[hd*toc-mark]
+.nr hd*htype 0 \" hd*htype = check break and space
+. \" 0 = run-in, 1 = break only, 2 = space
+.if \\n[hd*level]<=\\n[Hb] .nr hd*htype 1
+.if \\n[hd*level]<=\\n[Hs] .nr hd*htype 2
+. \" two spaces if hd*htype == 0
+.ie (\\n[hd*htype]=0)&(\w@\\$2@) .ds hd*suf-space " \"
+.el .ds hd*suf-space
+.nr hd*need 2v \" hd*need = header need space
+.\"---------- user macro HX ------------
+.\" user exit macro to override numbering
+.if d HX .HX \\n[hd*level] \\n[hd*arg1] "\\$2\\$3"
+.par@reset-num \\n[hd*level]\" reset numbered paragraph
+.di hd*div
+\\*[hd*mark]\\$2\\$3\\*[hd*suf-space]
+.br
+.di
+.rm hd*div
+.if \\n[hd*htype]<2 .nr hd*need +.5v \" add some extra space
+.ne \\n[hd*need]u+\\n[dn]u+.5p \" this is the needed space for a header
+.\"---------- user macro HY -------------
+.\" user macro to reset indents
+.if d HY .HY \\n[hd*level] \\n[hd*arg1] "\\$2\\$3"
+.if \\n[hd*htype] .na \" no adjust if run-in
+.hd@split hd*font \\n[hd*level] \\*[HF]\" get font for this level
+.ft \\*[hd*font]\" set new font
+.nr hd*ps-save \\n[.ps]u
+.hd@split hd*new-ps \\n[hd*level] \\*[HP]\" get point size
+.ie (\\*[hd*new-ps]=0):(\w@\\*[hd*new-ps]@=0) \{\
+. if \\n[hd*htype] \{\
+. if '\\*[hd*font]'3' .ps -1z
+. if '\\*[hd*font]'B' .ps -1z
+. \}
+.\}
+.el .ps \\*[hd*new-ps]z
+.nr hd*mark-size \w'\\*[hd*mark]'
+.if (\\n[hd*level]<=\\n[Hc])&\\n[hd*htype] .ce\" center if level<=Hc
+.\"
+.\" finally, output the header
+\\*[hd*mark]\&\c
+.\" and the rest of the header
+.ie \\n[hd*htype] \{\
+\\$2\\$3
+. br
+.\}
+.el \\$2\\$3\\*[hd*suf-space]\&\c
+.ft 1
+.ps \\n[hd*ps-save]u
+.\"
+.\" table of contents
+.if (\\n[hd*level]<=\\n[Cl])&\w@\\$2@ \{\
+. toc@save \\n[hd*level] "\\*[hd*toc-mark]" "\\$2" \\n[%]
+.\}
+.\" set adjust to previous value
+.SA
+.\" do break or space
+.if \\n[hd*htype] .br
+.if \\n[hd*htype]>1 .SP .5
+.if \\n[hd*htype] \{\
+. \" indent if Hi=1 and Pt=1
+. if (\\n[Hi]=1)&(\\n[Pt]=1) .ti +\\n[Pi]n
+. \" indent size of mark if Hi=2
+. if \\n[hd*htype]&(\\n[Hi]>1) .ti +\\n[hd*mark-size]u
+.\}
+.nr par@ind-flag 0 \" no indent on .P if Pt=2
+.\"
+.\" check if it is time to reset footnotes
+.if (\\n[hd*level]=1)&\\n[ft*clear-at-header] .nr ft*nr 0 1
+.\"
+.\" check if it is time to reset indexes
+.if (\\n[hd*level]=1)&(\\n[N]=5) \{\
+. nr lix*fg-nr 0 1
+. nr lix*tb-nr 0 1
+. nr lix*ec-nr 0 1
+. nr lix*ex-nr 0 1
+.\}
+.\"---------- user macro HZ ----------
+.if d HZ .HZ \\n[hd*level] \\n[hd*arg1] "\\$2\\$3"
+.nr hd*last-pos \\n[nl]
+.nr par@ind-flag 0
+..
+.\"--------
+.de HM
+.nr hd*i 0 1
+.while \\n+[hd*i]<8 .af H\\n[hd*i] \\$[\\n[hd*i]] 1
+..
+.\"########### module pg ####################
+.\" set end of text trap
+.wh 0 pg@header
+.em pg@end-of-text
+.\"
+.ds pg*header ''- % -''
+.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
+.nr pg*block-size 0
+.nr pg*footer-size 4v\" 1v+footer+even/odd footer+1v
+.nr pg*header-size 7v\" 3v+header+even/odd header+2v
+.nr ft*note-size 0
+.nr pg*cur-column 0
+.nr pg*cols-per-page 1
+.nr pg*cur-po \n[@po]
+.nr pg*head-mark 0
+.\" compatibility reasons. Why not use %??
+.aln P %
+.\"-------------------------
+.\" footer traps: set, enable and disable
+.de pg@set-new-trap
+.nr pg*foot-trap \\n[@pl]u-(\\n[pg*block-size]u+\\n[ft*note-size]u+\\n[pg*foot-margin]u+\\n[pg*footer-size]u)
+.if \\n[D]>2 .tm pg*foot-trap \\n[@pl]u-(\\n[pg*block-size]u+\\n[ft*note-size]u+\\n[pg*foot-margin]u+\\n[pg*footer-size]u) = \\n[pg*foot-trap]
+..
+.de pg@enable-trap
+.wh \\n[pg*foot-trap]u pg@footer
+.if \\n[D]>2 .tm pg@enable-trap .t=\\n[.t]
+..
+.de pg@disable-trap
+.ch pg@footer
+..
+.\" move to new trap (if changed).
+.de pg@move-trap
+.pg@disable-trap
+.pg@set-new-trap
+.pg@enable-trap
+..
+.de pg@enable-top-trap
+.\" set trap for pageheader.
+.nr pg*top-enabled 1
+..
+.de pg@disable-top-trap
+.\" remove trap for pageheader.
+.nr pg*top-enabled 0
+..
+.\" no header on the next page
+.de PGNH
+.nr pg*top-enabled -1
+..
+.\" set first trap for pagefooter
+.pg@enable-top-trap
+.pg@set-new-trap
+.pg@enable-trap
+.\"-------------------------
+.\" stop output and begin on next page. Fix footnotes and all that.
+.de pg@next-page
+.\".debug next-page
+.ne 999i \" activate trap
+.\" .pg@footer
+..
+.\"-------------------------
+.\" support for PX and TP
+.als }t pg*header
+.als }e pg*even-header
+.als }o pg*odd-header
+.\"------------------------------------------------------------
+.\" HEADER
+.de pg@header
+.if \\n[D]>1 .tm \\n[.F]:\\n[c.]: header for page# \\n[%]
+.if \\n[pg*top-enabled] \{\
+. if \\n[pg*top-margin] .sp \\n[pg*top-margin]u
+. ev pg*tl-ev
+. init@reset
+. ie !d TP \{\
+' sp 3
+. lt \\n[@ll]u
+. tl \\*[pg*header]
+. ie \\n[%]%2 .tl \\*[pg*even-header]
+. el .tl \\*[pg*odd-header]
+' sp 2
+. \}
+. el .TP
+. ev
+. \" why no-space??
+. if d PX \{\
+. ns
+. PX
+. rs
+. \}
+. \" check for pending footnotes
+. ft@check-old
+. \"
+. \" back to normal text processing
+. \" .pg@enable-trap
+. \" mark for multicolumn
+. nr pg*head-mark \\n[nl]u
+. \" set multicolumn
+. \"
+. pg@set-po
+. \" print floating displays
+. ds@print-float 4
+. tbl@top-hook
+.\}
+.if \\n[pg*top-enabled]<0 .nr pg*top-enabled 1
+..
+.\"---------------------------------------------------------
+.\" FOOTER
+.de pg@footer
+.pg@disable-trap
+.\".debug footer
+.tbl@bottom-hook
+.\" increment pageoffset for MC
+.\" move to the exact start of footer.
+'sp |\\n[pg*foot-trap]u+1v
+.\"
+.if \\n[D]>3 .tm FOOTER after .sp
+.\" print footnotes
+.if d ft*div .ft@print
+.\"
+.pg@inc-po
+.if !\\n[pg*cur-column] .pg@print-footer
+.\" next column
+.pg@set-po
+.pg@enable-trap
+..
+.\"-------------------------
+.de pg@print-footer
+.\" check if there are any bottom block
+.if d pg*block-div .pg@block
+.\"
+.\" print the footer and eject new page
+.ev pg*tl-ev
+.init@reset
+.lt \\n[@ll]u
+.ie \\n[%]%2 .tl \\*[pg*even-footer]
+.el .tl \\*[pg*odd-footer]
+.tl \\*[pg*footer]
+.ev
+.ie (\\n[ds*fnr]>=\\n[ds*o-fnr]):\\n[ft*exist] \{\
+. ev ne
+' bp
+. ev
+.\}
+.el 'bp
+..
+.\"
+.\"-------------------------
+.de PH
+.ds pg*header "\\$1
+..
+.de PF
+.ds pg*footer "\\$1
+..
+.de OH
+.ds pg*odd-header "\\$1
+..
+.de EH
+.ds pg*even-header "\\$1
+..
+.de OF
+.ds pg*odd-footer "\\$1
+..
+.de EF
+.ds pg*even-footer "\\$1
+..
+.de pg@clear-hd
+.ds pg*even-header
+.ds pg*odd-header
+.ds pg*header
+..
+.de pg@clear-ft
+.ds pg*even-footer
+.ds pg*odd-footer
+.ds pg*footer
+..
+.\"-------------------------
+.\" end of page processing
+.de pg@footnotes
+.\".debug footnotes
+.\" output footnotes. set trap for block
+.\"
+..
+.\"-------------------------
+.\" print bottom block
+.de pg@block
+.ev pg*block-ev
+'nf
+'in 0
+.ll 100i
+.pg*block-div
+.br
+.ev
+..
+.\"-------------------------
+.\" define bottom block
+.de BS
+.misc@ev-keep pg*block-ev
+.init@reset
+.br
+.di pg*block-div
+..
+.\"-------------------------
+.de BE
+.br
+.di
+.nr pg*block-size \\n[dn]u
+.ev
+.pg@move-trap
+..
+.\"-------------------------
+.\" print out all pending text
+.de pg@end-of-text
+.\" non-empty environment
+.misc@ev-keep ne
+.init@reset
+\c
+.ds@print-float 3
+.ev
+..
+.\"-------------------------
+.\" set top and bottom margins $$$ (not implemented yet)
+.de VM
+..
+.\"---------------------
+.\" multicolumn output.
+.de pg@set-po
+.if \\n[pg*cols-per-page]>1 \{\
+. ll \\n[pg*column-size]u
+.\}
+..
+.de pg@inc-po
+.if \\n[pg*cols-per-page]>1 \{\
+. ie \\n+[pg*cur-column]>=\\n[pg*cols-per-page] \{\
+. nr pg*cur-column 0 1
+. nr pg*cur-po \\n[@po]u
+. po \\n[@po]u
+. ll \\n[@ll]u
+. \}
+. el \{\
+. nr pg*cur-po +(\\n[pg*column-size]u+\\n[pg*column-sep]u)
+. po \\n[pg*cur-po]u
+' sp |\\n[pg*head-mark]u
+. \}
+.\}
+..
+.de 1C
+.br
+.if \\n[pg*cols-per-page]<=1 .@error "1C: multicolumn mode not active"
+.nr pg*cols-per-page 1
+.nr pg*column-sep 0
+.nr pg*column-size \\n[@ll]
+.nr pg*cur-column 0 1
+.nr pg*cur-po \\n[@po]u
+.PGFORM
+.\".pg@next-page
+.SK
+..
+.de 2C
+.br
+.nr pg*head-mark \\n[nl]u
+.if \\n[pg*cols-per-page]>1 .@error "2C: multicolumn mode already active"
+.nr pg*cols-per-page 2
+.nr pg*column-sep \\n[@ll]/15
+.nr pg*column-size (\\n[@ll]u*7)/15
+.nr pg*cur-column 0 1
+.nr pg*cur-po \\n[@po]u
+.ll \\n[pg*column-size]u
+..
+.\" MC column-size [ column-separation ]
+.de MC
+.br
+.nr pg*head-mark \\n[nl]u
+.if \\n[pg*cols-per-page]>1 .@error "MC: multicolumn mode already active"
+.ie ''\\$1' .nr pg*column-size \\n[.l]
+.el .nr pg*column-size (n;\\$1)
+.ie ''\\$2' .nr pg*column-sep \\n[pg*column-size]/15
+.el .nr pg*column-sep (n;\\$2)
+.\"
+.nr pg*cols-per-page (u;\\n[.l]/(\\n[pg*column-size]+\\n[pg*column-sep]+1))
+.nr pg*cur-column 0 1
+.nr pg*cur-po \\n[@po]u
+.ll \\n[pg*column-size]u
+..
+.\" skip pages
+.de SK
+.br
+.bp
+.nr pg*i 0 1
+.while \\n+[pg*i]<=(0\\$1) .bp
+..
+.\"-----------
+.de OP
+.SK 1+(\\n[%]%2)
+..
+.\"########### module footnotes ###################
+.nr ft*note-size 0
+.nr ft*busy 0
+.nr ft*nr 0 1
+.nr ft*wide 0
+.nr ft*hyphen 0\" hyphenation value
+.nr ft*adjust 1\" >0 if adjust true
+.nr ft*indent 1\" >0 if text indent true (not imp. $$$)
+.nr ft*just 0\" 0=left justification, 1=right (not imp. $$$)
+.nr ft*exist 0\" not zero if there are any footnotes to be printed
+.nr ft*clear-at-header 0\" >0 if footnotes should be reset at first level head.
+.\"
+.ds F \v'-.4m'\s-3\\n+[ft*nr]\s0\v'.4m'
+.\"
+.\"-----------------
+.\" init footnote environment
+.de ft@init
+.\" indentcontrol not implemented $$$
+.\" label justification not implemented $$$
+'in 0
+'fi
+.ie \\n[ft*adjust] 'ad
+.el 'na
+.ie \\n[ft*hyphen] 'hy 14
+.el 'hy 0
+.ll \\n[@cur-ll]u
+.ps (\\n[@ps]-2)
+.vs (\\n[@vs]-1)
+..
+.\"-----------------
+.\" set footnote format
+.\" no support for two column processing (yet). $$$
+.de FD
+.if \\n[.$]=0 .@error "FD: bad arg \\$1"
+.ie \\$1>11 .nr ft*format 0
+.el .nr ft*format \\$1
+.\"
+.ie \\n[.$]=2 .nr ft*clear-at-header 1
+.el .nr ft*clear-at-header 0
+.\"
+.nr ft*hyphen (\\n[ft*format]%2)*14
+.nr ft*format \\n[ft*format]/2
+.\"
+.nr ft*adjust 1-(\\n[ft*format]%2)
+.nr ft*format \\n[ft*format]/2
+.\"
+.nr ft*indent 1-(\\n[ft*format]%2)
+.nr ft*format \\n[ft*format]/2
+.\"
+.nr ft*just \\n[ft*format]%2
+..
+.\"---------------
+.\" Footnote and display width control $$$
+.de WC
+.nr ft*i 0 1
+.while \\n+[ft*i]<=\\n[.$] \{\
+. ds ft*x \\$[\\n[ft*i]]
+. if '\\*[ft*x]'N' \{\
+. nr ft*wide 0
+. nr ft*first-fn 0
+. nr ds*wide 0
+. nr ds*float-break 1
+. \}
+. if '\\*[ft*x]'-WF' .nr ft*wide 0
+. if '\\*[ft*x]'WF' .nr ft*wide 1
+. if '\\*[ft*x]'-FF' .nr ft*first-fn 0
+. if '\\*[ft*x]'FF' .nr ft*first-fn 1
+. if '\\*[ft*x]'-WD' .nr ds*wide 0
+. if '\\*[ft*x]'WD' .nr ds*wide 1
+. if '\\*[ft*x]'-FB' .nr ds*float-break 0
+. if '\\*[ft*x]'FB' .nr ds*float-break 1
+.\}
+..
+.\"-----------------
+.\" begin footnote
+.de FS
+.if \\n[ft*busy] .@error "FS: missing FE"
+.nr ft*busy 1
+.ev ft*ev
+.ft@init
+.if !\\n[ft*wide] .pg@set-po
+.if !d ft*div .ft@init-footnote
+.di ft*tmp-div
+.nr ft*space \\n[Fs]v/2u
+.sp \\n[ft*space]u
+.\" print mark
+.ie \\n[.$] .ds ft*mark \\$1
+.el .ds ft*mark \\n[ft*nr].
+\\*[ft*mark]
+.in +.75c
+.sp -1
+.nr ft*exist 1
+..
+.\"-----------------
+.\" init footnote diversion
+.de ft@init-footnote
+.di ft*div
+\l'20n'
+.br
+.di
+.nr ft*note-size \\n[dn]
+..
+.\"-----------------
+.\" end footnote
+.de FE
+.nr ft*busy 0
+.br
+.di
+'in 0
+'nf
+.if \\n[@pl]u<\\n[dn]u .@error "FE: too big footnote"
+.ie (\\n[pg*foot-trap]u-\\n[.d]u)<\\n[dn]u \{\
+. da ft*next-div
+. ft*tmp-div
+. br
+. di
+.\}
+.el \{\
+. da ft*div
+. ft*tmp-div
+. di
+. nr ft*note-size +\\n[dn]
+.\}
+.rm ft*tmp-div
+.ev
+.pg@move-trap
+..
+.\"-----------------
+.\" print footnotes, see pg@footer
+.de ft@print
+.ev ft*print-ev
+'nf
+'in 0
+.ll 100i
+.ft*div
+.br
+.ev
+.rm ft*div
+.nr ft*note-size 0
+..
+.\"-----------------
+.\" check if any pending footnotes, see pg@header
+.de ft@check-old
+.if d ft*next-div \{\
+. ev ft*ev
+. ft@init
+. ft@init-footnote
+. nf
+. in 0
+. da ft*div
+. ft*next-div
+. di
+. nr ft*note-size +\\n[dn]
+. rm ft*next-div
+. ev
+. nr ft*exist 0
+. pg@move-trap
+.\}
+..
+.\"########### module display ###################
+.nr ds*wide 0\" >0 if wide displays wanted
+.nr ds*fnr 0 1\" floating display counter
+.nr ds*o-fnr 1\" floating display counter, already printed
+.nr ds*snr 0 1\" static display counter
+.nr ds*lvl 0 1\" display level
+.nr ds*float-busy 0\" >0 if printing float
+.nr ds*ffloat 0\" >0 if DF, 0 if DS
+.\" static display start
+.\" nested DS/DE is allowed. No limit on depth.
+.de DS
+.br
+.ds@start 0 DS \\$*
+..
+.\" floating display start
+.\" nested DF/DE is not allowed.
+.de DF
+.if \\n[ds*lvl] .@error "DF:nested floating is not allowed. Use DS."
+.ds@start 1 DF \\$*
+..
+.\"---------------
+.nr ds*format!0 0\" no indent
+.nr ds*format!L 0\" no indent
+.nr ds*format!I 1\" indent
+.nr ds*format!1 1\" indent
+.nr ds*format!C 2\" center each line
+.nr ds*format!2 2\" center each line
+.nr ds*format!CB 3\" center as block
+.nr ds*format!3 3\" center as block
+.nr ds*format!R 4\" right justify each line
+.nr ds*format!4 4\" right justify each line
+.nr ds*format!RB 5\" right justify as block
+.nr ds*format!5 5\" right justify as block
+.\"---------------
+.de ds@start
+.nr ds*ffloat \\$1
+.ds ds*type \\$2
+.shift 2
+.nr ds*lvl +1
+.\" get format of the display
+.ie \\n[.$] \{\
+. ie r ds*format!\\$1 .nr ds*format \\n[ds*format!\\$1]
+. el .@error "\\*[ds*type]:wrong format:\\$1"
+.\}
+.el .nr ds*format 0
+.\" fill or not to fill, that is the...
+.nr ds*fill -1
+.ie \\n[.$]>1 \{\
+. if '\\$2'N' .nr ds*fill 0
+. if '\\$2'0' .nr ds*fill 0
+. if '\\$2'F' .nr ds*fill 1
+. if '\\$2'1' .nr ds*fill 1
+. if \\n[ds*fill]<0 .@error "\\*[ds*type]:wrong fill:\\$2"
+.\}
+.el .nr ds*fill 0
+.nr ds*rindent 0
+.if \\n[.$]>2 .nr ds*rindent \\$3
+.\"
+.\"
+.nr ds*old-ll \\n[.l]
+.misc@push ds-ll \\n[.l]
+.misc@push ds-vs \\n[.v]
+.misc@push ds-form \\n[ds*format]
+.misc@push ds-ffloat \\n[ds*ffloat]
+.nr ds*i \\n[.i]
+.misc@ev-keep ds*ev!\\n+[ds*snr]
+.\"
+.init@reset
+'in \\n[ds*i]u
+.di ds*div!\\n[ds*snr]
+.\"
+.ll \\n[ds*old-ll]u
+.if \\n[ds*rindent] .ll -\\n[ds*rindent]n
+.if \\n[ds*wide] .ll \\n[@ll]u
+.\"
+.ie \\n[ds*fill] 'fi
+.el 'nf
+.\"
+.if \\n[ds*format]=1 \{\
+. ll -\\n[Si]n
+' in +\\n[Si]n
+.\}
+.if (\\n[ds*format]=3)&(\\n[ds*format]=5) 'in 0
+..
+.\"---------------
+.de DE
+.if \\n-[ds*lvl]<0 .@error "DE: no corresponding DS or DF"
+.br
+.lix@print-text
+.if \\n[ds*ffloat] .SP 0.5
+.di
+.nr ds*width \\n[dl]
+.nr ds*height \\n[dn]
+.misc@pop-nr ds-ll ds*old-ll
+.misc@pop-nr ds-vs ds*old-vs
+.misc@pop-nr ds-form ds*format
+.misc@pop-nr ds-ffloat ds*ffloat
+.if (\\n[ds*format]>=2)&(\\n[ds*width]>\\n[ds*old-ll]) \{\
+. @error "DE: display too wide for current line-length"
+.\}
+.\" prepare copy to floating display
+.if \\n[ds*ffloat] .di ds*fdiv!\\n+[ds*fnr]
+.\"
+'in 0
+'nf
+.if \\n[ds*format]=2 'ce \\n[ds*height]/\\n[ds*old-vs]
+.if \\n[ds*format]=3 'in (u;(\\n[ds*old-ll]-\\n[ds*width])/2)
+.if \\n[ds*format]=4 'rj \\n[ds*height]/\\n[ds*old-vs]
+.if \\n[ds*format]=5 'in (u;\\n[ds*old-ll]-\\n[ds*width])
+.\"
+.ie !\\n[ds*ffloat] \{\
+. \"
+. \" Print static display
+. \" Eject page if display will fit one page and
+. \" there are less than half of the page left.
+. nr ds*i \\n[pg*foot-trap]-\\n[pg*header-size]
+. if (\\n[ds*height]>\\n[ds*i])&(\\n[.t]<(\\n[ds*i]/2)) \{\
+. ne \\n[.t]u+1v
+. \}
+. if (\\n[ds*height]<\\n[ds*i])&(\\n[.t]<(\\n[ds*height])) \{\
+. ne \\n[.t]u+1v
+. \}
+. if \\n[Ds] .SP 0.5
+.\}
+.el .SP 0.5
+.ds*div!\\n[ds*snr]
+.ie !\\n[ds*ffloat] .if \\n[Ds] .SP 0.5
+.el \{\
+. SP 0.5
+. di
+.\}
+.rm ds*div!\\n[ds*snr]
+.nr ds*snr -1
+.nr par@ind-flag 0
+.\" move div to the floating display list
+.ev
+.if \\n[ds*ffloat] \{\
+. 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]) \{\
+. ds@print-float 1
+. \}
+.\}
+..
+.\"---------------
+.\" print according to Df and De.
+.\" .ds@print-float type
+.\" type called from
+.\" 1 .DE
+.\" 2 end of section
+.\" 3 end of document
+.\" 4 beginning of new page
+.\"
+.de ds@print-float
+.if \\n[Df]>5 .@error "Df=\\n[Df], max value is 5"
+.if !\\n[ds*float-busy] \{\
+. nr ds*float-busy 1
+.\" at .DE
+. if (\\$1=1)&((\\n[Df]%2)=1) \{\
+. if \\n[.t]>\\n[ds*fsize!\\n[ds*fnr]] \{\
+. \" Df = 1,3 or 5
+. ds@print-one-float
+. \}
+. \}
+.\" print all if Df<2 and end of section
+. if (\\$1=2)&(\\n[Df]<2) .ds@print-all-floats
+.\" print all if end of document. Where should they go instead?
+. if \\$1=3 .ds@print-all-floats
+.\" new page
+. if (\\$1=4)&(\\n[Df]>1) \{\
+. if \\n[Df]=2 .ds@print-one-float
+. if \\n[Df]=3 .ds@print-one-float
+. if \\n[Df]>3 \{\
+. ie \\n[De] .ds@print-all-floats
+. el .ds@print-this-page
+. \}
+. \}
+. nr ds*float-busy 0
+.\}
+..
+.\"---------------
+.\" print a floating diversion
+.de ds@output-div
+.ev ds*fev
+.in 0
+.nf
+.ds*fdiv!\\n[ds*o-fnr]
+.ev
+.rm ds*fdiv!\\n[ds*o-fnr]
+.rm ds*fsize!\\n[ds*o-fnr]
+.rm ds*fformat!\\n[ds*o-fnr]
+.nr ds*o-fnr +1
+..
+.\"---------------
+.\" print one floating display if there is one.
+.de ds@print-one-float
+.if \\n[ds*o-fnr]<=\\n[ds*fnr] \{\
+. if \\n[.t]<\\n[ds*fsize!\\n[ds*o-fnr]] .pg@next-page
+. ds@output-div
+. if \\n[De] .pg@next-page
+.\}
+..
+.\"---------------
+.\" print all queued floats.
+.\" if De>0 do a page eject between the floats.
+.de ds@print-all-floats
+.while \\n[ds*o-fnr]<=\\n[ds*fnr] \{\
+. if \\n[.t]<\\n[ds*fsize!\\n[ds*o-fnr]] .pg@next-page
+. ds@output-div
+. if \\n[De] .pg@next-page
+.\}
+..
+.\"---------------
+.\" print as many floats as will fit on the current page
+.de ds@print-this-page
+.while \\n[ds*o-fnr]<=\\n[ds*fnr] \{\
+. if \\n[.t]<\\n[ds*fsize!\\n[ds*o-fnr]] .break
+. ds@output-div
+.\}
+..
+.\"########### module list ###################
+.\" .LI text-indent mark-indent pad type [mark [LI-space [LB-space] ] ]
+.\"
+.nr li*tind 0
+.nr li*mind 0
+.nr li*pad 0
+.nr li*type 0
+.ds li*mark 0
+.nr li*li-spc 0
+.nr li*lvl 0 1
+.\"--------------------------
+.\" the major list-begin macro.
+.\" If type == -1 a 'break' will occur.
+.de LB
+.if \\n[.$]<4 .@error "LB: not enough arguments, min 4"
+.misc@push cind \\n[.i]
+.misc@push tind \\n[li*tind]
+.misc@push mind \\n[li*mind]
+.misc@push pad \\n[li*pad]
+.misc@push type \\n[li*type]
+.misc@push li-spc \\n[li*li-spc]
+.ds li*mark-list!\\n[li*lvl] \\*[li*mark]
+.nr li*lvl +1
+.\"
+.nr li*tind 0\\$1n\" text-indent
+.nr li*mind 0\\$2n\" mark-indent
+.nr li*pad 0\\$3n\" pad
+.nr li*type 0\\$4\" type
+.ds li*mark \\$5\" mark
+.ie !'\\$6'' .nr li*li-spc \\$6\" LI-space
+.el .nr li*li-spc 1
+.ie !'\\$7'' .nr li*lb-spc \\$6\" LB-space
+.el .nr li*lb-spc 0
+.\" init listcounter
+.nr li*cnt!\\n[li*lvl] 0 1
+.\" assign format
+.af li*cnt!\\n[li*lvl] 1
+.if \\n[li*type] .if !'\\*[li*mark]'' .af li*cnt!\\n[li*lvl] \\*[li*mark]
+.\"
+.if \\n[li*lb-spc] .SP \\n[li*lb-spc]v/2u
+.in +\\n[li*tind]u
+..
+.\"---------------
+.de LI
+.if \\n[li*lvl]<1 .@error "LI:no lists active"
+.if \\n[li*li-spc]&(\\n[Ls]>=\\n[li*lvl]) .SP \\n[li*li-spc]v/2u
+.ne 2v
+.\"
+.ds li*c-mark \\*[li*mark]
+.nr li*cnt!\\n[li*lvl] +1
+.if \\n[li*type]=1 .ds li*c-mark \\n[li*cnt!\\n[li*lvl]].
+.if \\n[li*type]=2 .ds li*c-mark \\n[li*cnt!\\n[li*lvl]])
+.if \\n[li*type]=3 .ds li*c-mark (\\n[li*cnt!\\n[li*lvl]])
+.if \\n[li*type]=4 .ds li*c-mark [\\n[li*cnt!\\n[li*lvl]]]
+.if \\n[li*type]=5 .ds li*c-mark <\\n[li*cnt!\\n[li*lvl]]>
+.if \\n[li*type]=6 .ds li*c-mark {\\n[li*cnt!\\n[li*lvl]]}
+.if \\n[.$]=1 .ds li*c-mark \\$1
+.if \\n[.$]=2 .ds li*c-mark \\$1\ \\*[li*c-mark]
+.if '\\*[li*c-mark]'\ ' .ds li*c-mark
+.\"
+.nr li*c-tind \\n[li*tind]
+.if \\n[li*type]:\w'\\*[li*mark]' \{\
+. ie \\n[li*pad] .nr li*c-tind \\n[li*pad]u+\w'\\*[li*c-mark]'u)
+. el .nr li*c-tind \\n[li*tind]-\\n[li*mind]
+.\}
+.\" Give hanging row if arg1==""
+.ie !((\\n[.$]=1)&(\w'\\$1'=0)) \{\
+.ti -\\n[li*c-tind]u
+\&\\*[li*c-mark]
+. ie \\n[li*type]=-1 .br
+. el .sp -1
+.\}
+.el \{\
+.ti -\\n[li*tind]u
+.\}
+..
+.\"-------------
+.de li@pop
+.nr li*lvl -1
+.misc@pop-nr cind li*tmp
+.in \\n[li*tmp]u
+.misc@pop-nr tind li*tind
+.misc@pop-nr mind li*mind
+.misc@pop-nr pad li*pad
+.misc@pop-nr type li*type
+.misc@pop-nr li-spc li*li-spc
+.ds li*mark \\*[li*mark-list!\\n[li*lvl]]
+..
+.de LE
+.if \\n[li*lvl]<1 .@error "LE:mismatched"
+.li@pop
+.if '\\$1'1' .SP .5
+..
+.\"-------------
+.\" list status clear.
+.de LC
+.if !\\n[.$]=1 .@error "LC: no argument"
+.if \\$1>\\n[li*lvl] .@error "LC: incorrect argument: \\$1 (too big)"
+.while \\n[li*lvl]>\\$1 .li@pop
+.nr par@ind-flag 0
+..
+.\"-------------
+.de AL
+.if \\n[.$]>3 .@error "AL: too many arguments"
+.ie \\n[.$]<=1 .LB \\n[Li] 0 2 1 "\\$1"
+.el \{\
+. ie \\n[.$]=2 .LB 0\\$2 0 2 1 "\\$1"
+. el \{\
+. ie !'\\$2'' .LB \\$2 0 2 1 "\\$1" 0 1
+. el .LB \\n[Li] 0 2 1 "\\$1" 0 1
+. \}
+.\}
+..
+.de ML
+.if \\n[.$]>3 .@error "BL: too many arguments"
+.nr li*ml-width \w'\\$1'u/1n+1u
+.if \\n[.$]<2 .LB \\n[li*ml-width] 0 1 0 "\\$1"
+.if \\n[.$]=2 .LB 0\\$2 0 1 0 "\\$1"
+.if \\n[.$]=3 \{\
+. ie !'\\$2'' .LB \\n[li*ml-width] 0 1 0 "\\$1" 0 1
+. el .LB \\n[Li] 0 1 0 "\\$1" 0 1
+.\}
+..
+.de VL
+.if \\n[.$]>3 .@error "VL: too many arguments"
+.if \\n[.$]<1 .@error "VL: missing text-indent"
+.ie \\n[.$]<3 .LB 0\\$1 0\\$2 0 0
+.el .LB 0\\$1 0\\$2 0 0 \& 0 1
+..
+.\" Bullet (for .BL)
+.de BL
+.ds BU \s-2\(bu\s0
+.if \\n[.$]>2 .@error "BL: too many arguments"
+.if \\n[.$]<1 .LB \\n[Pi] 0 1 0 \\*[BU]
+.if \\n[.$]=1 .LB 0\\$1 0 1 0 \\*[BU]
+.if \\n[.$]=2 \{\
+. ie !'\\$1'' .LB \\n[Pi] 0 1 0 \\*[BU] 0 1
+. el .LB 0\\$1 0 1 0 \\*[BU] 0 1
+.\}
+..
+.de DL
+.if \\n[.$]>2 .@error "DL: too many arguments"
+.if \\n[.$]<=1 .LB \\n[Pi] 0 1 0 \(em
+.if \\n[.$]=1 .LB 0\\$1 0 1 0 \(em
+.if \\n[.$]=2 \{\
+. ie !'\\$1'' .LB \\n[Pi] 0 1 0 \(em 0 1
+. el .LB 0\\$1 0 1 0 \(em 0 1
+.\}
+..
+.de RL
+.if \\n[.$]>2 .@error "RL: too many arguments"
+.if \\n[.$]<1 .LB 6 0 2 4
+.if \\n[.$]=1 .LB 0\\$1 0 2 4
+.if \\n[.$]=2 \{\
+. ie !'\\$1'' .LB 6 0 2 4 1 0 1
+. el .LB 0\\$1 0 2 4 1 0 1
+.\}
+..
+.\" Broken Variable List. As .VL but text begin on the next line
+.de BVL
+.if \\n[.$]>3 .@error "BVL: too many arguments"
+.if \\n[.$]<1 .@error "BVL: missing text-indent"
+.ie \\n[.$]<3 .LB 0\\$1 0\\$2 0 -1
+.el .LB 0\\$1 0\\$2 0 -1 \& 0 1
+..
+.\" ####### module tbl #######################################
+.\" This module is copied from groff_ms and modified for mgm.
+.\" Yes, it does not resemble the original anymore :-).
+.\" Don't know if I missed something important.
+.\" Groff_ms is written by James Clark.
+.nr tbl*have-header 0
+.nr tbl*header-written 0
+.de TS
+.br
+.if '\\$1'H' .di tbl*header-div
+..
+.de tbl@top-hook
+.if \\n[tbl*have-header] \{\
+. ie \\n[.t]-\\n[tbl*header-ht]-1v .tbl@print-header
+. el .sp \\n[.t]u
+.\}
+..
+.de tbl@bottom-hook
+.if \\n[tbl*have-header] \{\
+. nr T. 1
+.\" draw bottom and side lines of boxed tables.
+. T#
+.\}
+.nr tbl*header-written 0
+..
+.de tbl@print-header
+.ev tbl*ev
+'nf
+.tbl*header-div
+.ev
+.mk #T
+.nr tbl*header-written 1
+..
+.de TH
+.ie '\\n[.z]'tbl*header-div' \{\
+. nr T. 0
+. T#
+. br
+. di
+. nr tbl*header-ht \\n[dn]
+. ne \\n[dn]u+1v
+. nr tbl*have-header 1
+. ie '\\$1'N' .if !\\n[tbl*header-written] .tbl@print-header
+. el .tbl@print-header
+.\}
+.el .@error ".TH without .TS H"
+..
+.de TE
+.ie '\\n(.z'tbl*header-div' .@error ".TS H but no .TH before .TE"
+.el \{\
+. nr tbl*have-header 0
+.\}
+.\" reset tabs
+.TAB
+..
+.de T&
+..
+.\" ####### module pic #######################################
+.de PS
+.nr pic*in 0
+.br
+.SP .5
+.ie \\n[.$]<2 .@error "PS: bad arguments. Probably not processed with pic."
+.el \{\
+. if !\\n[ds*lvl] .ne (u;\\$1)+1v
+.\" should be contained between .DS/.DE
+.if r ds*format \{\
+. if \\n[ds*lvl]&((\\n[ds*format]=2):(\\n[ds*format]=3)) \{\
+. nr pic*in \\n[.i]
+.\" . in +(u;\\n[.l]-\\n[.i]-\\$2/2)
+. \}
+. \}
+.\}
+..
+.de PE
+.init@reset
+.SP .5
+..
+.\" ####### module eq #######################################
+.\"
+.nr eq*number 0 1
+.de EQ
+.ds eq*lable "\\$1
+.di eq*div
+.misc@ev-keep eq*ev
+.in 0
+.nf
+..
+.de EN
+.br
+.di
+.ta
+.\" equation with lable.
+.if \\n[dl] \{\
+. chop eq*div
+. ie (\\n[Eq]%2) \{\
+. \" lable to the left
+. if \\n[ds*format]<2 \{\
+. ta (u;(\\n[.l]/7)+\\n[.i]) \\n[.l]u\" L
+\\*[eq*lable]\t\\*[eq*div]\t\&
+. \}
+. if (\\n[ds*format]=2):(\\n[ds*format]=3) \{\
+. ta (u;(\\n[.l]-\\n[.i])/2+\\n[.i])C \\n[.l]u\" C
+\\*[eq*lable]\t\\*[eq*div]\t\&
+. \}
+. if \\n[ds*format]>3 \{\
+. ta \\n[.l]uR\" R
+\\*[eq*lable]\t\\*[eq*div]
+. \}
+. \}
+. el \{\
+. \" lable to the right
+. if \\n[ds*format]<2 \{\
+. ta \\n[.l]uR\" L
+\\*[eq*div]\t\\*[eq*lable]
+. \}
+. if (\\n[ds*format]=2):(\\n[ds*format]=3) \{\
+. ta (u;(\\n[.l]-\\n[.i])/2+\\n[.i])C \\n[.l]uR\" C
+\t\\*[eq*div]\t\\*[eq*lable]
+. \}
+. if \\n[ds*format]>3 \{\
+. ta (\\n[.l]u-\w'\\*[eq*lable]'u-1m)R \\n[.l]uR\" R
+\t\\*[eq*div]\t\\*[eq*lable]
+. \}
+. \}
+.\}
+.TAB
+.ev
+..
+.\"########### module toc ###################
+.\" table of contents
+.nr toc*slevel 1
+.nr toc*spacing 1v/2u
+.nr toc*tlevel 2
+.nr toc*tab 0
+.\"-----------
+.\" Table of contents with friends (module lix)
+.de TC
+.\" print any pending displays
+.pg@end-of-text
+.if \w'\\$1'>0 .nr toc*slevel \\$1
+.if \w'\\$2'>0 .nr toc*spacing \\$2v/2u
+.if \w'\\$3'>0 .nr toc*tlevel \\$3
+.if \w'\\$4'>0 .nr toc*tab \\$4
+.if \\n[pg*cols-per-page]>1 .1C
+.pg@clear-hd
+.pg@next-page
+.pg@clear-ft
+.\"-------------
+.if d Ci .toc@read-Ci \\*[Ci]
+.nf
+.in 0
+.nr toc*pn 0 1
+.af toc*pn i
+.PF "''\\\\\\\\n+[toc*pn]''"
+.nr toc*i 4 1
+.while \\n+[toc*i]<10 \{\
+. if !'\\$\\n[toc*i]'' \{\
+. ce
+\\$\\n[toc*i]
+. br
+. \}
+.\}
+.if \\n[.$]<=4 .if d TX .TX
+.ie d TY .if \\n[.$]<=4 .TY
+.el \{\
+. ce
+\\*[Licon]
+. br
+. SP 3
+.\}
+.toc*list
+.\" print LIST OF XXX
+.if d lix*dsfg .lix@print-ds fg "\\*[Lf]"
+.if d lix*dstb .lix@print-ds tb "\\*[Lt]"
+.if d lix*dsec .lix@print-ds ec "\\*[Le]"
+.if d lix*dsex .lix@print-ds ex "\\*[Lx]"
+..
+.\"-----------
+.\" .toc@read-Ci lev1 lev2 lev3 lev4 ... lev7
+.de toc@read-Ci
+.nr toc*i 0 1
+.while \\n+[toc*i]<8 \{\
+. nr toc*hl!\\n[toc*i] \\$\\n[toc*i]
+.\}
+..
+.\"-----------
+.de toc@save
+.\" collect maxsize of mark if string Ci don't exist.
+.if !d Ci \{\
+. if !r toc*hl!\\$1 .nr toc*hl!\\$1 0
+. if \\n[toc*hl!\\$1]<\w'\\$2' \{\
+. nr toc*hl!\\$1 \w'\\$2'u+1m
+. \}
+.\}
+.am toc*list
+.\" .toc@set level headernumber text pagenr
+.toc@set \\$1 "\\$2" "\\$3" \\$4
+\\..
+..
+.\"-----------
+.de toc@set
+.if \\$1<=\\n[toc*slevel] .SP \\n[toc*spacing]u
+.nr toc*ind 0
+.nr toc*i 0 1
+.ie d Ci \{\
+. nr toc*ind +\\n[toc*hl!\\$1]u
+.\}
+.el \{\
+. while \\n+[toc*i]<\\$1 \{\
+. nr toc*ind +\\n[toc*hl!\\n[toc*i]]u
+. \}
+.\}
+.if \\n[toc*ind] .ti +\\n[toc*ind]u
+.\"
+.\" length of headernum space
+.nr toc*i \\n[toc*hl!\\$1]-\w'\\$2'
+.\"
+.ie \\$1>\\n[toc*tlevel] \{\
+\\$2\h'\\n[toc*i]u'\\$3\ \ \ \\$4
+.\}
+.el \{\
+. ie '\\$2'' \{\
+. nr toc*sep (u;\\n[.l]-\w'\\$3\\$4'-\\n[toc*ind])-2m
+\\$3\h'1m'\l'\\n[toc*sep]u.'\h'1m'\\$4
+. \}
+. el \{\
+. nr toc*sep (u;\\n[.l]-\\n[toc*hl!\\$1]-\w'\\$3\\$4'-\\n[toc*ind])-3m
+\\$2\h'\\n[toc*i]u'\\$3\h'1m'\l'\\n[toc*sep]u.'\h'1m'\\$4
+. \}
+.\}
+..
+.\"########################### module lix ############################
+.\" LIST OF figures, tables, exhibits and equations
+.nr lix*fg-nr 0 1
+.nr lix*tb-nr 0 1
+.nr lix*ec-nr 0 1
+.nr lix*ex-nr 0 1
+.aln Fg lix*fg-nr
+.aln Tb lix*tb-nr
+.aln Ec lix*ec-nr
+.aln Ex lix*ex-nr
+.\"------------
+.de FG
+.lix@print-line fg Lf \\n+[lix*fg-nr] "\\$1" "\\$2" "\\$3" "\\$4"
+..
+.de TB
+.lix@print-line tb Lt \\n+[lix*tb-nr] "\\$1" "\\$2" "\\$3" "\\$4"
+..
+.de EC
+.lix@print-line ec Le \\n+[lix*ec-nr] "\\$1" "\\$2" "\\$3" "\\$4"
+..
+.de EX
+.lix@print-line ex Lx \\n+[lix*ex-nr] "\\$1" "\\$2" "\\$3" "\\$4"
+..
+.\"------------
+.\" print line with 'figure' in the text
+.\" type stringvar number text override flag refname
+.de lix@print-line
+.ds lix*text "\\$4
+.ie !\\n[Of] .ds lix*ds-form .\ \ \"
+.el .ds lix*ds-form "\ \(em\ \"
+.nr lix*in \\n[.i]
+.ds lix*lable \\*[Li\\$1]\ \\$3\\*[lix*ds-form]
+.if !'\\$5'' \{\
+. if !0\\$6 .ds lix*lable \\*[Li\\$1]\ \\$5\\$3\\*[lix*ds-form]
+. if 0\\$6=1 .ds lix*lable \\*[Li\\$1]\ \\$3\\$5\\*[lix*ds-form]
+. if 0\\$6=2 .ds lix*lable \\*[Li\\$1]\ \\$5\\*[lix*ds-form]
+.\}
+.nr lix*pgnr \\n[%]
+.\" print line if not between DS/DE
+.if \\n[ds*lvl]<1 .lix@print-text
+.\"
+.\" save line for LIST OF XXX
+.if !r lix*wth\\$1 .nr lix*wth\\$1 0
+.if \w'\\*[lix*lable]'>\\n[lix*wth\\$1] .nr lix*wth\\$1 \w'\\*[lix*lable]'
+.if \\n[\\$2] .lix@ds-save \\$1 \\n[lix*pgnr] "\\$4" "\\*[lix*lable]"
+.if !'\\$7'' .SETR \\$7 \\$3
+..
+.\"-----------
+.de lix@print-text
+.if d lix*text \{\
+. SP 0.5
+. misc@ev-keep lix
+. init@reset
+. br
+. ie (\w'\\*[lix*lable]\\*[lix*text]')>(\\n[.l]-\\n[.i]) \{\
+. in +\w'\\*[lix*lable]'u
+. ti 0
+. \}
+. el .ce 1
+\fB\\*[lix*lable]\fP\\*[lix*text]
+. br
+. ev
+. rm lix*text
+.\}
+..
+.\"------------
+.\" print complete list of XXXX
+.de lix@print-ds
+.\" arg: fg,tb,ec,ex text
+.if !\\n[Cp] .pg@next-page
+.\" print LIST OF XXXX
+.ce
+\\$2
+.SP 3
+.in \\n[lix*wth\\$1]u
+.fi
+.lix*ds\\$1
+..
+.\"------------
+.\" save line of list in macro
+.de lix@ds-save
+.\" type pagenumber text
+.am lix*ds\\$1
+.lix@dsln \\$1 \\$2 "\\$3" "\\$4" \\$5
+\\..
+..
+.\"------------
+.\" print appended macro
+.\" lix@dsln type pagenumber text headernr
+.de lix@dsln
+.nr lix*i \\n[lix*wth\\$1]-\w'\\$4'
+.ne 2v
+.ll -4m
+.ti 0
+\h'\\n[lix*i]u'\\$4\\$3
+.sp -1
+.ll
+.ti \\n[.l]u-\w'\\$2'u
+\\$2
+..
+.\"########################### module fnt ############################
+.\" some font macros.
+.de R
+.ft R
+.ul 0
+..
+.\"-----------
+.de fnt@switch
+.ul 0
+.ds fnt*tmp
+.nr fnt*prev \\n[.f]
+.nr fnt*i 2 1
+.while \\n+[fnt*i]<=\\n[.$] \{\
+. if \\n[fnt*i]>3 .as fnt*tmp \,
+. ie (\\n[fnt*i]%2)=1 .as fnt*tmp \\$1\\$[\\n[fnt*i]]
+. el .as fnt*tmp \\$2\\$[\\n[fnt*i]]
+. if \\n[fnt*i]<\\n[.$] .as fnt*tmp \/
+.\}
+\\*[fnt*tmp]\f[\\n[fnt*prev]]
+..
+.\"-----------
+.de B
+.ie \\n[.$] .fnt@switch \fB \f[\\n[.f]] \\$@
+.el .ft B
+..
+.de I
+.ie \\n[.$] .fnt@switch \fI \f[\\n[.f]] \\$@
+.el .ft I
+..
+.de IB
+.if \\n[.$] .fnt@switch \fI \fB \\$@
+..
+.de BI
+.if \\n[.$] .fnt@switch \fB \fI \\$@
+..
+.de IR
+.if \\n[.$] .fnt@switch \fI \fR \\$@
+..
+.de RI
+.if \\n[.$] .fnt@switch \fR \fI \\$@
+..
+.de RB
+.if \\n[.$] .fnt@switch \fR \fB \\$@
+..
+.de BR
+.if \\n[.$] .fnt@switch \fB \fR \\$@
+..
+.\"########################### module box ############################
+.\" draw a box around some text. Text will be kept on the same page.
+.\"
+.nr box*ll 0
+.\" .B1 and .B2 works like .DS
+.de B1
+.if \\n[box*ll] .@error "B1: missing B2"
+.nr box*ll \\n[.l]
+.nr box*ind \\n[.i]
+.nr box*hyp \\n[.hy]
+.in +1n
+.ll -1n
+.di box*div
+.hy \\n[.hy]
+..
+.de B2
+.if !\\n[box*ll] .@error "B2: missing B1"
+.br
+.di
+.nr box*height \\n[dn]
+.ne \\n[dn]u+1v
+.ev box*ev
+.ll \\n[box*ll]u
+.in 0
+.nr box*y-pos \\n[.d]u
+.nf
+.box*div
+.fi
+\v'-1v+.25m'\
+\D'l \\n[.l]u 0'\
+\D'l 0 -\\n[box*height]u'\
+\D'l -\\n[.l]u 0'\
+\D'l 0 \\n[box*height]u'
+.br
+.sp -1
+.ev
+.sp .20v
+.in \\n[box*ind]u
+.ll \\n[box*ll]u
+.rm box*div
+.nr box*ll 0
+..
+.\"########################### module ref ############################
+.nr ref*nr 0 1
+.nr ref*nr-width 5n
+.ds Rf \v'-.4m'\s-3[\\n+[ref*nr]]\s0\v'.4m'
+.\" start reference
+.de RS
+.if !''\\$1' .nr \\$1 \\n[ref*nr]
+.ev ref*ev
+.da ref*div
+.init@reset
+.ll \\n[@ll]u
+.in \\n[ref*nr-width]u
+.ti -(\w'\\n[ref*nr].'u+1n)
+\\n[ref*nr].
+.sp -1
+..
+.de RF
+.br
+.if \\n[Ls] .SP .5
+.di
+.ev
+..
+.de RP
+.if !d ref*div .@error "RP: No references!"
+.nr ref*i 0\\$2
+.if \\n[ref*i]<2 .SK
+.SP 2
+.ev ref*ev
+.ce
+\fI\\*[Rp]\fP
+.sp
+.in 0
+.nf
+.ref*div
+.in
+.if 0\\$1<1 .nr ref*nr 0 1
+.rm ref*div
+.ev
+.if (\\n[ref*i]=0:\\n[ref*i]=2) .SK
+..
+.\"########################### module cov ############################
+.\" title stored in diversion cov*title
+.\" abstract stored in diversion cov*abstract
+.\" arg to abstract stored in cov*abs-arg
+.\" indent stored in cov*abs-ind
+.\" number of authors stored in cov*au
+.\" author(s) stored in cov*au!x!y
+.\" author(s) title stored in cov*at!x!y
+.\" x is the author-index [1-cov*au], y is the argument-index [1-9].
+.\" author(s) firm stored in cov*firm
+.\" new date (if .ND exists) is stored in cov*new-date
+.\"
+.\"
+.nr cov*au 0
+.nr cov*title-size 12
+.ds cov*title-font B
+.nr cov*abstract-size 10
+.ds cov*abstract-font R
+.de TL
+.pg@disable-top-trap
+.misc@ev-keep cov*ev
+.init@reset
+.ft \\*[cov*title-font]
+.S \\n[cov*title-size]
+.di cov*title
+.nf
+.in 0
+..
+.de TLE
+.br
+.di
+.nr cov*title-size \\n[dn]/\\n[.v]
+.ev
+..
+.\" .AU name [initials [loc [dept [ext [room [arg [arg [arg]]]]]]]]
+.de AU
+.pg@disable-top-trap
+.if '\\n[.z]'cov*title' .TLE
+.if \\n[.$]<1 .@error "AU: no arguments"
+.nr cov*au +1
+.nr cov*i 0 1
+.while \\n[.$]>=\\n+[cov*i] \{\
+. ds cov*au!\\n[cov*au]!\\n[cov*i] "\\$[\\n[cov*i]]
+.\}
+..
+.\" .AT title1 [title2 [... [title9] ]]]]
+.\" Well, thats all that COVEND look for.
+.\" Must appear directly after .AU
+.de AT
+.if \\n[.$]<1 .@error "AT: no arguments"
+.nr cov*i 0 1
+.while \\n[.$]>=\\n+[cov*i] \{\
+. ds cov*at!\\n[cov*au]!\\n[cov*i] "\\$[\\n[cov*i]]
+.\}
+..
+.de AF
+.if \\n[.$]<1 .@error "AF: no arguments"
+.ds cov*firm \\$1
+..
+.de AS
+.pg@disable-top-trap
+.if d cov*abstract .@error "AS: only one abstract allowed"
+.if !''\\n[.z]' .@error "AS: no diversion allowed (previous .AS?)"
+.nr cov*abs-arg 0\\$1
+.nr cov*abs-ind 0\\$2
+.misc@ev-keep cov*ev
+.init@reset
+.if r cur*abstract-ll .ll \\n[cur*abstract-ll]u
+.in 0
+.fi
+.ft \\*[cov*abstract-font]
+.S \\n[cov*abstract-size]
+.di cov*abstract
+..
+.de AE
+.br
+.di
+.nr cov*abstract-lines \\n[dn]/\\n[.v]
+.nr cov*abstract-width \\n[dl]
+.ev
+..
+.\" I am planning to use mgm some time :-)
+.ie \\n[yr]<50 .ds cov*new-date \\*[MO\\n[mo]] \\n[dy], 20\\n[yr]
+.el .ds cov*new-date \\*[MO\\n[mo]] \\n[dy], 19\\n[yr]
+.als DT cov*new-date
+.de ND
+.pg@disable-top-trap
+.ds cov*new-date \\$1
+..
+.\"-----------------------
+.\" cover sheet
+.\" the file must have the following last lines (somewhere):
+.\" .pg@enable-top-trap
+.\" .bp 1
+.\" .pg@enable-trap
+.de MT
+.ie \\n[.$] .ds cov*mt-type \\$1
+.el .ds cov*mt-type 0
+.ds cov*mt-addresse "\\$2
+.ie d @language .ds cov*str mm/\\*[@language]_\\*[cov*mt-type].MT
+.el .ds cov*str mm/\\*[cov*mt-type].MT
+.\" $$$
+.ie (\n[.x]>=1)&(\n[.y]>=2) .mso \\*[cov*str]
+.el .so \\*[@cur-lib]/\\*[cov*str]
+..
+.de COVER
+.if !\\n[.$] .@error "COVER: no arguments"
+.pg@disable-top-trap
+.ie d @language .ds cov*str mm/\\*[@language]_\\$1.cov
+.el .ds cov*str mm/\\$1.cov
+.ie (\n[.x]>=1)&(\n[.y]>=2) .mso \\*[cov*str]
+.el .so \\*[@cur-lib]/\\*[cov*str]
+..
+.\"########################### module qrf ############################
+.\" forward and backward reference thru special files.
+.\"
+.\" init reference system
+.de INITR
+.if \\n[.$]<1 .@error "INITR:filename missing"
+.\" ignore if INITR has already been used
+.if !r qrf*pass \{\
+.\"
+. ds qrf*file \\$1
+. sy test -f \\*[qrf*file].tmp
+. ie \\n[systat] \{\
+. \" PASS 1
+. if \\n[D]=1 .tm PASS 1
+. if \\n[D]>1 .tm INITR: file \\*[qrf*file].tmp, PASS 1
+. nr qrf*pass 1
+. open qrf*stream \\*[qrf*file].tmp
+. write qrf*stream .\\\\" references for \\*[qrf*file]
+. close qrf*stream
+. \}
+. el \{\
+. nr qrf*pass 2
+. if \\n[D]=1 .tm PASS 2
+. if \\n[D]>1 .tm INITR: file \\*[qrf*file].tmp, PASS 2
+. sy mv \\*[qrf*file].tmp \\*[qrf*file].qrf
+' so \\*[qrf*file].qrf
+. \}
+.\}
+..
+.\"---------------
+.\" set a reference.
+.de SETR
+.if \\n[.$]<1 .@error "SETR:reference name missing"
+.ie !r qrf*pass .tm "SETR: No .INITR in this file"
+.el \{\
+. ds qrf*name qrf*ref-\\$1
+.\" probably pass two if already defined
+. if \\n[qrf*pass]<2 \{\
+. if \\n[D]>2 .tm SETR: ref \\*[qrf*name]=\\*[hd*toc-mark],\\n[%]
+. \" heading-number
+. ds \\*[qrf*name]-hn \\*[hd*toc-mark]
+. \" page-number
+. nr \\*[qrf*name]-pn \\n[%]
+. \"
+. \" append to file
+. opena qrf*stream \\*[qrf*file].tmp
+. write qrf*stream .ds \\*[qrf*name]-hn \\*[hd*toc-mark]
+. write qrf*stream .nr \\*[qrf*name]-pn \\n[%]
+. if !'\\$2'' write qrf*stream .ds \\*[qrf*name]-xx \\$2
+. close qrf*stream
+. \}
+.\}
+..
+.\"---------------
+.\" get misc-string, output <->42<-> in pass 1
+.\" If two arg -> set var. arg to misc-string.
+.de GETST
+.if \\n[.$]<1 .@error "GETST:reference name missing"
+.if !r qrf*pass .tm "GETST: No .INITR in this file"
+.ds qrf*name qrf*ref-\\$1
+.ie \\n[qrf*pass]=2 \{\
+. ie !d \\*[qrf*name]-xx .tm "GETHN:\\$1 not defined"
+. el \{\
+. ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-xx]
+. el \\*[\\*[qrf*name]-xx]
+. \}
+.\}
+.\" The answer...
+.el <->42<->
+..
+.\"---------------
+.\" get header-number, output X.X.X. in pass 1
+.\" If two arg -> set var. arg to header-number.
+.de GETHN
+.if \\n[.$]<1 .@error "GETHN:reference name missing"
+.if !r qrf*pass .tm "GETHN: No .INITR in this file"
+.ds qrf*name qrf*ref-\\$1
+.ie \\n[qrf*pass]=2 \{\
+. ie !d \\*[qrf*name]-hn .tm "GETHN:\\$1 not defined"
+. el \{\
+. ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-hn]
+. el \\*[\\*[qrf*name]-hn]
+. \}
+.\}
+.el X.X.X.
+..
+.\"---------------
+.\" get page-number, output 9999 in pass 1
+.\" If two arg -> set var. arg to page-number.
+.de GETPN
+.if \\n[.$]<1 .@error "GETPN:reference name missing"
+.if !r qrf*pass .tm "GETPN: No .INITR in this file"
+.ds qrf*name qrf*ref-\\$1
+.ie \\n[qrf*pass]=2 \{\
+. ie !r \\*[qrf*name]-pn .tm "GETPN:\\$1 not defined"
+. el \{\
+. ie \\n[.$]>1 .nr \\$2 \\n[\\*[qrf*name]-pn]
+. el \\n[\\*[qrf*name]-pn]
+. \}
+.\}
+.el 9999
+..
+.\"----------
+.de GETR
+.if \\n[.$]<1 .@error "GETR:reference name missing"
+.ie !r qrf*pass \{\
+. tm "GETR: No .INITR in this file"
+.\}
+.el \{\
+. if \\n[qrf*pass]=2 \{\
+. GETHN \\$1 Qrfh
+. GETPN \\$1 Qrfp
+\\*[Qrf]
+. \}
+.\}
+..
diff --git a/mm/tmac.mse b/mm/tmac.mse
new file mode 100644
index 000000000..32f63fe0b
--- /dev/null
+++ b/mm/tmac.mse
@@ -0,0 +1,39 @@
+.\" version 0.11
+.ie (\n[.x]>=1)&(\n[.y]>=2) .mso tmac.@TMAC_M@
+.el .so /usr/local/lib/groff/tmac/tmac.@TMAC_M@
+.ds @language se
+.\"
+.ds Lf Figurer
+.ds Lt Tabeller
+.ds Lx Uppställningar
+.ds Le Ekvationer
+.\" Page length
+.if !r L .nr @pl 28.5c
+.\" page width
+.if !r W .nr @ll 13c
+.\" page offset
+.if !r O .nr @po 3.5c
+.\" set the above parameters
+.PGFORM
+.ds Lifg Figur
+.ds Litb Tabell
+.ds Liex Uppställning
+.ds Liec Ekvation
+.ds Licon Innehållsförteckning
+.ds Qrf Se kapitel \\*[Qrfh], sidan \\n[Qrfp].
+.ds Rp Referenser
+.\"
+.ds MO1 januari
+.ds MO2 februari
+.ds MO3 mars
+.ds MO4 april
+.ds MO5 maj
+.ds MO6 juni
+.ds MO7 juli
+.ds MO8 augusti
+.ds MO9 september
+.ds MO10 oktober
+.ds MO11 november
+.ds MO12 december
+.ie \\n[yr]<50 .ds cov*new-date \\n[dy] \\*[MO\\n[mo]] 20\\n[yr]
+.el .ds cov*new-date \\n[dy] \\*[MO\\n[mo]] 19\\n[yr]
diff --git a/pic/lex.c b/pic/lex.c
index 9634ea48a..1984c6483 100644
--- a/pic/lex.c
+++ b/pic/lex.c
@@ -240,12 +240,17 @@ public:
static int peek_char();
static int get_location(const char **fnp, int *lnp);
static void push_back(unsigned char c, int was_bol = 0);
- static inline int bol() { return bol_flag; }
+ static int bol();
};
input *input_stack::current_input = 0;
int input_stack::bol_flag = 0;
+inline int input_stack::bol()
+{
+ return bol_flag;
+}
+
void input_stack::clear()
{
while (current_input != 0) {
@@ -359,6 +364,7 @@ void interpolate_macro_with_args(const char *body)
argv[i] = 0;
int level = 0;
int c;
+ enum { NORMAL, IN_STRING, IN_STRING_QUOTED } state = NORMAL;
do {
token_buffer.clear();
for (;;) {
@@ -367,7 +373,7 @@ void interpolate_macro_with_args(const char *body)
lex_error("end of input while scanning macro arguments");
break;
}
- if (level == 0 && (c == ',' || c == ')')) {
+ if (state == NORMAL && level == 0 && (c == ',' || c == ')')) {
if (token_buffer.length() > 0) {
token_buffer += '\0';
argv[argc] = strsave(token_buffer.contents());
@@ -378,10 +384,25 @@ void interpolate_macro_with_args(const char *body)
break;
}
token_buffer += char(c);
- if (c == '(')
- level++;
- else if (c == ')')
- level--;
+ switch (state) {
+ case NORMAL:
+ if (c == '"')
+ state = IN_STRING;
+ else if (c == '(')
+ level++;
+ else if (c == ')')
+ level--;
+ break;
+ case IN_STRING:
+ if (c == '"')
+ state = NORMAL;
+ else if (c == '\\')
+ state = IN_STRING_QUOTED;
+ break;
+ case IN_STRING_QUOTED:
+ state = IN_STRING;
+ break;
+ }
}
} while (c != ')' && c != EOF);
input_stack::push(new argument_macro_input(body, argc, argv));
@@ -1174,7 +1195,7 @@ int get_delimited()
{
token_buffer.clear();
int c = input_stack::get_char();
- while (c == ' ' || c == '\n')
+ while (c == ' ' || c == '\t' || c == '\n')
c = input_stack::get_char();
if (c == EOF) {
lex_error("missing delimiter");
@@ -1361,6 +1382,7 @@ void do_for(char *var, double from, double to, int by_is_multiplicative,
void do_copy(const char *filename)
{
+ errno = 0;
FILE *fp = fopen(filename, "r");
if (fp == 0) {
lex_error("can't open `%1': %2", filename, strerror(errno));
@@ -1604,6 +1626,7 @@ int simple_file_input::get_location(const char **fnp, int *lnp)
void copy_file_thru(const char *filename, const char *body, const char *until)
{
+ errno = 0;
FILE *fp = fopen(filename, "r");
if (fp == 0) {
lex_error("can't open `%1': %2", filename, strerror(errno));
diff --git a/pic/main.c b/pic/main.c
index 45cdd5c04..bb4ba3b54 100644
--- a/pic/main.c
+++ b/pic/main.c
@@ -292,6 +292,7 @@ void do_file(const char *filename)
if (strcmp(filename, "-") == 0)
fp = stdin;
else {
+ errno = 0;
fp = fopen(filename, "r");
if (fp == 0)
fatal("can't open `%1': %2", filename, strerror(errno));
@@ -443,6 +444,7 @@ void do_whole_file(const char *filename)
if (strcmp(filename, "-") == 0)
fp = stdin;
else {
+ errno = 0;
fp = fopen(filename, "r");
if (fp == 0)
fatal("can't open `%1': %2", filename, strerror(errno));
@@ -466,8 +468,36 @@ void usage()
exit(1);
}
+#ifdef __MSDOS__
+static char *fix_program_name(char *arg, char *dflt)
+{
+ if (!arg)
+ return dflt;
+ char *prog = strchr(arg, '\0');
+ for (;;) {
+ if (prog == arg)
+ break;
+ --prog;
+ if (strchr("\\/:", *prog)) {
+ prog++;
+ break;
+ }
+ }
+ char *ext = strchr(prog, '.');
+ if (ext)
+ *ext = '\0';
+ for (char *p = prog; *p; p++)
+ if ('A' <= *p && *p <= 'Z')
+ *p = 'a' + (*p - 'A');
+ return prog;
+}
+#endif /* __MSDOS__ */
+
int main(int argc, char **argv)
{
+#ifdef __MSDOS__
+ argv[0] = fix_program_name(argv[0], "pic");
+#endif /* __MSDOS__ */
program_name = argv[0];
static char stderr_buf[BUFSIZ];
setbuf(stderr, stderr_buf);
diff --git a/pic/make-dos-dist b/pic/make-dos-dist
new file mode 100755
index 000000000..3657b1ba2
--- /dev/null
+++ b/pic/make-dos-dist
@@ -0,0 +1,289 @@
+#! /bin/sh
+
+# This creates a compressed (14 bits) tar file that can be copied to a DOS
+# machine, unpacked and compiled with Borland C++ 2.0.
+
+# The grammar is yacced here, because I don't have a yacc on my DOS
+# machine. The resulting .tab.c file is split up; I found the
+# compiler ran out of memory otherwise. The sed command that does the
+# splitting assumes you're using the SunOS 4.1.1 yacc.
+# (Bison-generated parsers need alloca() which Borland C++ does not
+# have.) You'll need to tweak it for other yaccs: in particular you'll
+# need to change the `tabs' variable, so that it matches the names of
+# the external arrays of ints generated by your version yacc: it is
+# these that are split off into another file. You may also need to
+# change tabtype to `short' if the tables are arrays of shorts.
+
+picdir=`pwd`
+tarfile=pic_tar
+tabs="yyexca yyact yypact yypgo yyr1 yyr2 yychk yydef"
+tabtype=int
+file1=pic_tab1.c
+file2=pic_tab2.c
+
+rm -fr temp
+mkdir temp
+cd temp
+
+
+yacc -d $picdir/pic.y
+
+for tab in $tabs; do echo "/$tabtype $tab\\[]/i\\
+extern $tabtype $tab[];
+/$tabtype $tab\\[]/,/;/{
+w $file2
+d
+}"; done >split.sed
+
+sed -f split.sed y.tab.c >$file1
+
+rm -f split.sed y.tab.c
+
+mv y.tab.h pic_tab.h
+
+libfiles="change_lf.c cset.c cset.h errarg.c errarg.h error.c error.h \
+fatal.c filename.c version.c lf.c lib.h lineno.c new.c string.c \
+stringclass.h progname.c strerror.c strsave.c ptable.c ptable.h"
+
+picfiles="common.c common.h lex.c main.c object.c object.h output.h \
+pic.h position.h tex.c text.h troff.c"
+
+for file in $picfiles
+do
+ sed -e '/^#include/s/pic\.tab\.h/pic_tab.h/' $picdir/$file >$file
+done
+
+for file in $libfiles; do cp $picdir/../lib/$file $file; done
+
+mv stringclass.h stringcl.h
+mv change_lf.c changelf.c
+
+cat >makefile <<'EOF'
+# Makefile for pic with Borland C++ 2.0.
+CC=bcc -P -V
+OLDCC=bcc -V
+MODEL=l
+WARN=
+DEBUG=
+MAP=-M
+CFLAGS=-m$(MODEL) $(WARN) $(DEBUG) -I. -DSWITCHAR
+LDFLAGS=-m$(MODEL) $(DEBUG) $(MAP)
+
+OBJS=changelf.obj \
+common.obj \
+cset.obj \
+errarg.obj \
+error.obj \
+fatal.obj \
+filename.obj \
+lex.obj \
+lf.obj \
+lineno.obj \
+main.obj \
+new.obj \
+object.obj \
+pic_tab1.obj \
+pic_tab2.obj \
+progname.obj \
+ptable.obj \
+string.obj \
+strsave.obj \
+tex.obj \
+troff.obj \
+version.obj \
+getopt.obj \
+strerror.obj
+
+PROG=pic
+
+.c.obj:
+ $(CC) -c $(CFLAGS) {$< }
+
+$(PROG).exe: $(OBJS)
+ $(CC) $(LDFLAGS) -e$(PROG) @&&!
+$(OBJS)
+!
+
+strerror.obj: strerror.c
+ $(OLDCC) -c $(CFLAGS) strerror.c
+
+getopt.obj: getopt.c
+ $(OLDCC) -c $(CFLAGS) getopt.c
+
+# Enable auto-dependency checking.
+.autodepend
+EOF
+
+cat >osfcn.h <<'EOF'
+#include <io.h>
+
+extern "C" {
+ int getopt(int, char **, const char *);
+ extern int optind;
+ extern int opterr;
+}
+EOF
+
+cat >getopt.c <<'EOF'
+/* getopt() for those systems that don't have it. */
+/* Derived from comp.sources.unix/volume3/att_getopt. */
+
+#include <stdio.h>
+#include <string.h>
+
+#ifdef SWITCHAR
+#include <dos.h>
+#endif
+
+int opterr = 1;
+int optind = 1;
+int optopt;
+char *optarg;
+
+#ifndef OPTION_CHAR
+#define OPTION_CHAR '-'
+#endif
+
+int getopt(argc, argv, opts)
+int argc;
+char **argv;
+char *opts;
+{
+#ifdef SWITCHAR
+ union REGS regs;
+ static char switchar = '\0';
+#endif
+ static int sp = 1;
+ register int c;
+ register char *cp;
+ char *message;
+#ifdef SWITCHAR
+ if (switchar == '\0') {
+ regs.x.ax = 0x3700;
+ intdos(&regs, &regs);
+ if (!regs.x.cflag)
+ switchar = regs.h.dl;
+ else
+ switchar = '/';
+ }
+#endif
+ if (sp == 1) {
+ if (optind >= argc)
+ return EOF;
+ if ((
+#ifdef SWITCHAR
+ argv[optind][0] != switchar &&
+#endif
+ argv[optind][0] != OPTION_CHAR) || argv[optind][1] == '\0') {
+#ifdef REORDER_ARGS
+ int i;
+ for (i = optind; i < argc; i++)
+ if ((
+#ifdef SWITCHAR
+ argv[i][0] == switchar ||
+#endif
+ argv[i][0] == OPTION_CHAR) && argv[i][1] != '\0')
+ break;
+ if (i < argc) {
+ c = argv[i][1];
+#ifdef CASE_INSENSITIVE_OPTIONS
+ if (isupper(c))
+ c = tolower(c);
+#endif
+ if (c != ':' && c != OPTION_CHAR && (cp = strchr(opts, c)) != NULL
+ && cp[1] == ':' && argv[i][2] == 0 && i < argc - 1) {
+ int j;
+ char *temp1 = argv[i];
+ char *temp2 = argv[i+1];
+ for (j = i - 1; j >= optind; j--)
+ argv[j+2] = argv[j];
+ argv[optind] = temp1;
+ argv[optind+1] = temp2;
+ }
+ else {
+ int j;
+ char *temp = argv[i];
+ for (j = i - 1; j >= optind; j--)
+ argv[j+1] = argv[j];
+ argv[optind] = temp;
+ }
+ }
+ else
+#endif
+ return EOF;
+ }
+ if ((argv[optind][0] == OPTION_CHAR && argv[optind][1] == OPTION_CHAR
+ && argv[optind][2] == '\0')
+#ifdef SWITCHAR
+ || (argv[optind][0] == switchar && argv[optind][1] == switchar
+ && argv[optind][2] == '\0')
+#endif
+ ) {
+ optind++;
+ return(EOF);
+ }
+ }
+ optopt = c = argv[optind][sp];
+#ifdef CASE_INSENSITIVE_OPTIONS
+ if (isascii(c) && isupper(c))
+ optopt = c = tolower(c);
+#endif
+ if (c == ':' || (cp = strchr(opts, c)) == NULL) {
+ if (argv[optind][++sp] == '\0') {
+ optind++;
+ sp = 1;
+ }
+ message = ": illegal option -- ";
+ goto bad;
+ }
+ if (*++cp == ':') {
+ if (argv[optind][sp+1] != '\0')
+ optarg = &argv[optind++][sp+1];
+ else if (++optind >= argc) {
+ sp = 1;
+ message = ": option requires an argument -- ";
+ goto bad;
+ }
+ else
+ optarg = argv[optind++];
+ sp = 1;
+ }
+ else {
+ if (argv[optind][++sp] == '\0') {
+ sp = 1;
+ optind++;
+ }
+ optarg = NULL;
+ }
+ return c;
+bad:
+ if (opterr) {
+ fputs(argv[0], stderr);
+ fputs(message, stderr);
+ fputc(optopt, stderr);
+ fputc('\n', stderr);
+ }
+ return '?';
+}
+
+/*
+Local Variables:
+c-indent-level: 4
+c-continued-statement-offset: 4
+c-brace-offset: 4
+c-argdecl-indent: 4
+c-label-offset: -4
+tab-width: 4
+End:
+*/
+EOF
+
+for file in *; do sed -e 's/$/ /' $file >temp; mv temp $file; done
+
+tar cf ../$tarfile *
+cd ..
+compress -b14 $tarfile
+rm -fr temp
+
+echo Now move $tarfile.Z to a MSDOS machine with Borland C++ 2.0,
+echo unpack and compile with make -S.
diff --git a/pic/object.c b/pic/object.c
index 5b09ff9db..d417f6518 100644
--- a/pic/object.c
+++ b/pic/object.c
@@ -219,6 +219,10 @@ void draw_arrow(const position &pos, const distance &dir,
const arrow_head_type &aht, const line_type &lt)
{
double hyp = hypot(dir);
+ if (hyp == 0.0) {
+ error("cannot draw arrow on object with zero length");
+ return;
+ }
position base = -dir;
base *= aht.height/hyp;
position n(dir.y, -dir.x);
diff --git a/pic/object.h b/pic/object.h
index d1e17a87f..949d90d84 100644
--- a/pic/object.h
+++ b/pic/object.h
@@ -127,30 +127,27 @@ struct text_item {
~text_item();
};
-
-enum {
- IS_DOTTED = 01,
- IS_DASHED = 02,
- IS_CLOCKWISE = 04,
- IS_INVISIBLE = 020,
- HAS_LEFT_ARROW_HEAD = 040,
- HAS_RIGHT_ARROW_HEAD = 0100,
- HAS_SEGMENT = 0200,
- IS_SAME = 0400,
- HAS_FROM = 01000,
- HAS_AT = 02000,
- HAS_WITH = 04000,
- HAS_HEIGHT = 010000,
- HAS_WIDTH = 020000,
- HAS_RADIUS = 040000,
- HAS_TO = 0100000,
- IS_CHOPPED = 0200000,
- IS_DEFAULT_CHOPPED = 0400000,
- HAS_THICKNESS = 01000000,
- IS_FILLED = 02000000,
- IS_DEFAULT_FILLED = 04000000,
- IS_ALIGNED = 010000000,
-};
+const unsigned long IS_DOTTED = 01;
+const unsigned long IS_DASHED = 02;
+const unsigned long IS_CLOCKWISE = 04;
+const unsigned long IS_INVISIBLE = 020;
+const unsigned long HAS_LEFT_ARROW_HEAD = 040;
+const unsigned long HAS_RIGHT_ARROW_HEAD = 0100;
+const unsigned long HAS_SEGMENT = 0200;
+const unsigned long IS_SAME = 0400;
+const unsigned long HAS_FROM = 01000;
+const unsigned long HAS_AT = 02000;
+const unsigned long HAS_WITH = 04000;
+const unsigned long HAS_HEIGHT = 010000;
+const unsigned long HAS_WIDTH = 020000;
+const unsigned long HAS_RADIUS = 040000;
+const unsigned long HAS_TO = 0100000;
+const unsigned long IS_CHOPPED = 0200000;
+const unsigned long IS_DEFAULT_CHOPPED = 0400000;
+const unsigned long HAS_THICKNESS = 01000000;
+const unsigned long IS_FILLED = 02000000;
+const unsigned long IS_DEFAULT_FILLED = 04000000;
+const unsigned long IS_ALIGNED = 010000000;
struct segment {
int is_absolute;
@@ -164,7 +161,7 @@ struct graphic_object;
struct linear_object;
struct object_spec {
- unsigned flags;
+ unsigned long flags;
object_type type;
object_list oblist;
PTABLE(place) *tbl;
diff --git a/pic/output.c b/pic/output.c
deleted file mode 100644
index 6f9abc069..000000000
--- a/pic/output.c
+++ /dev/null
@@ -1,4 +0,0 @@
-// -*- C++ -*-
-
-#include "pic.h"
-
diff --git a/pic/pic.tab.c b/pic/pic.tab.c
index b346e45dd..bdbe2af9b 100644
--- a/pic/pic.tab.c
+++ b/pic/pic.tab.c
@@ -130,7 +130,9 @@ extern "C" {
int rand();
}
+#ifndef __BORLANDC__
#define YYDEBUG 1
+#endif /* __BORLANDC__ */
int yylex();
void yyerror(const char *);
@@ -159,7 +161,7 @@ char *format_number(const char *form, double n);
char *do_sprintf(const char *form, const double *v, int nv);
-#line 69 "pic.y"
+#line 71 "pic.y"
typedef union {
char *str;
int n;
@@ -203,11 +205,11 @@ typedef
-#define YYFINAL 373
+#define YYFINAL 376
#define YYFLAG -32768
#define YYNTBASE 131
-#define YYTRANSLATE(x) ((unsigned)(x) <= 365 ? yytranslate[x] : 170)
+#define YYTRANSLATE(x) ((unsigned)(x) <= 365 ? yytranslate[x] : 172)
static const short yytranslate[] = { 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -249,33 +251,133 @@ static const short yytranslate[] = { 0,
106, 107, 108, 109, 110
};
+static const short yyprhs[] = { 0,
+ 0, 2, 4, 8, 10, 14, 15, 17, 19, 22,
+ 26, 28, 30, 32, 34, 36, 39, 42, 45, 46,
+ 50, 53, 54, 55, 63, 64, 65, 72, 73, 84,
+ 86, 87, 92, 94, 96, 99, 102, 106, 107, 113,
+ 114, 117, 119, 123, 127, 128, 131, 135, 137, 142,
+ 147, 152, 153, 154, 161, 163, 164, 166, 168, 170,
+ 172, 174, 176, 178, 180, 182, 184, 187, 191, 192,
+ 197, 201, 205, 209, 213, 216, 219, 223, 226, 230,
+ 233, 237, 240, 244, 248, 252, 256, 260, 264, 267,
+ 270, 274, 277, 281, 284, 288, 291, 295, 298, 301,
+ 304, 307, 310, 313, 316, 319, 322, 325, 328, 331,
+ 335, 338, 340, 346, 347, 351, 353, 355, 357, 361,
+ 365, 371, 377, 384, 386, 391, 395, 399, 401, 404,
+ 407, 411, 413, 415, 417, 421, 423, 426, 429, 432,
+ 434, 436, 438, 440, 442, 444, 446, 449, 451, 454,
+ 458, 460, 462, 465, 467, 472, 476, 480, 483, 485,
+ 487, 489, 491, 493, 495, 497, 499, 501, 503, 505,
+ 507, 509, 511, 513, 516, 519, 522, 525, 527, 529,
+ 532, 535, 538, 541, 543, 545, 547, 549, 551, 554,
+ 557, 560, 563, 566, 570, 574, 578, 582, 586, 590,
+ 593, 597, 602, 607, 614, 619, 624, 629, 636, 643,
+ 648, 653, 657, 661, 665, 669, 673, 677, 681, 685,
+ 689
+};
+
+static const short yyrhs[] = { 134,
+ 0, 132, 0, 134, 133, 134, 0, 150, 0, 133,
+ 135, 150, 0, 0, 135, 0, 122, 0, 135, 122,
+ 0, 4, 123, 148, 0, 14, 0, 15, 0, 16,
+ 0, 17, 0, 7, 0, 84, 171, 0, 84, 156,
+ 0, 84, 158, 0, 0, 83, 137, 8, 0, 77,
+ 6, 0, 0, 0, 77, 6, 78, 138, 8, 139,
+ 147, 0, 0, 0, 77, 78, 140, 8, 141, 147,
+ 0, 0, 87, 4, 123, 171, 31, 171, 149, 88,
+ 142, 8, 0, 145, 0, 0, 145, 90, 143, 8,
+ 0, 144, 0, 102, 0, 102, 4, 0, 144, 4,
+ 0, 144, 112, 4, 0, 0, 89, 148, 35, 146,
+ 8, 0, 0, 103, 6, 0, 171, 0, 156, 94,
+ 156, 0, 156, 93, 156, 0, 0, 34, 171, 0,
+ 34, 117, 171, 0, 154, 0, 3, 124, 134, 150,
+ 0, 3, 124, 134, 159, 0, 3, 124, 134, 162,
+ 0, 0, 0, 125, 151, 132, 126, 152, 153, 0,
+ 136, 0, 0, 150, 0, 18, 0, 19, 0, 20,
+ 0, 21, 0, 22, 0, 23, 0, 24, 0, 25,
+ 0, 156, 0, 104, 171, 0, 104, 171, 156, 0,
+ 0, 127, 155, 132, 128, 0, 154, 26, 171, 0,
+ 154, 27, 171, 0, 154, 28, 171, 0, 154, 29,
+ 171, 0, 154, 171, 0, 154, 14, 0, 154, 14,
+ 171, 0, 154, 15, 0, 154, 15, 171, 0, 154,
+ 17, 0, 154, 17, 171, 0, 154, 16, 0, 154,
+ 16, 171, 0, 154, 30, 158, 0, 154, 31, 158,
+ 0, 154, 32, 158, 0, 154, 33, 169, 0, 154,
+ 34, 161, 0, 154, 35, 0, 154, 36, 0, 154,
+ 36, 171, 0, 154, 37, 0, 154, 37, 171, 0,
+ 154, 106, 0, 154, 106, 171, 0, 154, 38, 0,
+ 154, 38, 171, 0, 154, 39, 0, 154, 40, 0,
+ 154, 10, 0, 154, 11, 0, 154, 12, 0, 154,
+ 85, 0, 154, 86, 0, 154, 156, 0, 154, 41,
+ 0, 154, 42, 0, 154, 43, 0, 154, 44, 0,
+ 154, 105, 171, 0, 154, 107, 0, 6, 0, 108,
+ 111, 6, 157, 129, 0, 0, 157, 112, 171, 0,
+ 159, 0, 162, 0, 161, 0, 158, 115, 161, 0,
+ 158, 116, 161, 0, 111, 158, 112, 158, 129, 0,
+ 171, 160, 158, 49, 158, 0, 171, 113, 158, 112,
+ 158, 114, 0, 48, 0, 45, 46, 47, 48, 0,
+ 171, 112, 171, 0, 111, 161, 129, 0, 163, 0,
+ 163, 170, 0, 170, 163, 0, 170, 45, 163, 0,
+ 50, 0, 3, 0, 165, 0, 163, 130, 3, 0,
+ 13, 0, 9, 13, 0, 9, 166, 0, 164, 166,
+ 0, 18, 0, 19, 0, 20, 0, 21, 0, 22,
+ 0, 23, 0, 25, 0, 127, 128, 0, 6, 0,
+ 130, 3, 0, 167, 130, 3, 0, 170, 0, 167,
+ 0, 167, 170, 0, 168, 0, 9, 13, 166, 168,
+ 0, 13, 166, 168, 0, 9, 166, 168, 0, 3,
+ 168, 0, 51, 0, 52, 0, 53, 0, 54, 0,
+ 55, 0, 56, 0, 57, 0, 58, 0, 59, 0,
+ 60, 0, 61, 0, 79, 0, 80, 0, 16, 0,
+ 17, 0, 81, 16, 0, 82, 16, 0, 81, 17,
+ 0, 82, 17, 0, 97, 0, 98, 0, 81, 97,
+ 0, 82, 97, 0, 81, 98, 0, 82, 98, 0,
+ 99, 0, 101, 0, 100, 0, 4, 0, 5, 0,
+ 162, 62, 0, 162, 63, 0, 162, 64, 0, 162,
+ 65, 0, 162, 66, 0, 171, 115, 171, 0, 171,
+ 116, 171, 0, 171, 117, 171, 0, 171, 118, 171,
+ 0, 171, 119, 171, 0, 171, 121, 171, 0, 116,
+ 171, 0, 111, 171, 129, 0, 67, 111, 171, 129,
+ 0, 68, 111, 171, 129, 0, 69, 111, 171, 112,
+ 171, 129, 0, 70, 111, 171, 129, 0, 71, 111,
+ 171, 129, 0, 72, 111, 171, 129, 0, 73, 111,
+ 171, 112, 171, 129, 0, 74, 111, 171, 112, 171,
+ 129, 0, 75, 111, 171, 129, 0, 76, 111, 171,
+ 129, 0, 76, 111, 129, 0, 171, 113, 171, 0,
+ 171, 95, 171, 0, 171, 114, 171, 0, 171, 96,
+ 171, 0, 171, 94, 171, 0, 171, 93, 171, 0,
+ 171, 91, 171, 0, 171, 92, 171, 0, 120, 171,
+ 0
+};
+
#if YYDEBUG != 0
static const short yyrline[] = { 0,
- 263, 265, 273, 278, 281, 285, 287, 290, 292, 295,
- 301, 303, 305, 307, 309, 315, 320, 326, 331, 334,
- 339, 346, 349, 351, 359, 362, 364, 371, 374, 380,
- 388, 391, 402, 403, 407, 410, 412, 416, 420, 423,
- 426, 430, 433, 439, 446, 449, 451, 455, 470, 472,
- 480, 486, 492, 499, 507, 512, 516, 520, 525, 532,
- 539, 546, 553, 558, 563, 570, 585, 597, 603, 609,
- 615, 621, 640, 647, 654, 661, 668, 675, 682, 689,
- 696, 703, 718, 730, 736, 743, 755, 761, 767, 773,
- 779, 784, 790, 806, 823, 828, 833, 838, 843, 848,
- 853, 858, 865, 874, 883, 892, 901, 907, 914, 919,
- 929, 936, 957, 960, 968, 971, 976, 981, 986, 991,
- 998, 1000, 1003, 1006, 1010, 1013, 1019, 1025, 1031, 1039,
- 1050, 1054, 1062, 1065, 1069, 1084, 1100, 1103, 1105, 1107,
- 1109, 1111, 1113, 1115, 1117, 1121, 1126, 1133, 1141, 1145,
- 1152, 1158, 1164, 1170, 1176, 1184, 1187, 1189, 1191, 1193,
- 1195, 1197, 1199, 1201, 1203, 1205, 1207, 1209, 1211, 1213,
- 1215, 1217, 1219, 1221, 1223, 1225, 1227, 1229, 1231, 1233,
- 1235, 1237, 1239, 1243, 1252, 1254, 1261, 1268, 1275, 1282,
- 1289, 1291, 1293, 1295, 1303, 1311, 1324, 1326, 1328, 1337,
- 1346, 1359, 1368, 1377, 1386, 1388, 1390, 1392, 1394, 1400,
- 1402, 1404, 1406, 1408, 1410, 1412, 1414, 1416
+ 265, 267, 275, 280, 283, 287, 289, 292, 294, 297,
+ 303, 305, 307, 309, 311, 317, 322, 328, 333, 336,
+ 341, 348, 351, 353, 361, 364, 366, 373, 376, 382,
+ 390, 393, 404, 405, 409, 412, 414, 418, 422, 425,
+ 428, 432, 435, 441, 448, 451, 453, 457, 472, 474,
+ 482, 488, 494, 501, 504, 512, 515, 519, 524, 528,
+ 532, 537, 544, 551, 558, 565, 570, 575, 582, 597,
+ 609, 615, 621, 627, 633, 652, 659, 666, 673, 680,
+ 687, 694, 701, 708, 715, 730, 742, 748, 755, 767,
+ 773, 779, 785, 791, 796, 802, 818, 835, 840, 845,
+ 850, 855, 860, 865, 870, 877, 886, 895, 904, 913,
+ 919, 926, 931, 941, 948, 969, 972, 980, 983, 988,
+ 993, 998, 1003, 1010, 1012, 1015, 1018, 1022, 1025, 1031,
+ 1037, 1043, 1051, 1062, 1066, 1074, 1077, 1081, 1096, 1112,
+ 1115, 1117, 1119, 1121, 1123, 1125, 1127, 1129, 1133, 1138,
+ 1145, 1153, 1157, 1164, 1170, 1176, 1182, 1188, 1196, 1199,
+ 1201, 1203, 1205, 1207, 1209, 1211, 1213, 1215, 1217, 1219,
+ 1221, 1223, 1225, 1227, 1229, 1231, 1233, 1235, 1237, 1239,
+ 1241, 1243, 1245, 1247, 1249, 1251, 1255, 1264, 1266, 1273,
+ 1280, 1287, 1294, 1301, 1303, 1305, 1307, 1315, 1323, 1336,
+ 1338, 1340, 1349, 1358, 1371, 1380, 1389, 1398, 1400, 1402,
+ 1404, 1406, 1412, 1414, 1416, 1418, 1420, 1422, 1424, 1426,
+ 1428
};
-static const char * const yytname[] = { 0,
+static const char * const yytname[] = { "$",
"error","$illegal.","LABEL","VARIABLE","NUMBER","TEXT","COMMAND","DELIMITED","ORDINAL","LEFT_ARROW_HEAD",
"RIGHT_ARROW_HEAD","DOUBLE_ARROW_HEAD","LAST","UP","DOWN","LEFT","RIGHT","BOX","CIRCLE","ELLIPSE",
"ARC","LINE","ARROW","MOVE","SPLINE","HEIGHT","RADIUS","WIDTH","DIAMETER","FROM",
@@ -289,7 +391,11 @@ static const char * const yytname[] = { 0,
"START","RESET","UNTIL","PLOT","THICKNESS","FILL","ALIGNED","SPRINTF","DEFINE","UNDEF",
"'('","','","'<'","'>'","'+'","'-'","'*'","'/'","'%'","'!'",
"'^'","';'","'='","':'","'{'","'}'","'['","']'","')'","'.'",
-"top"
+"top","element_list","middle_element_list","optional_separator","separator","placeless_element","@1","@2","@3","@4",
+"@5","@6","@7","reset_variables","simple_if","@8","until","conditional_expr","optional_by","element",
+"@9","@10","optional_element","object_spec","@11","text","sprintf_args","position","position_not_place","between",
+"expr_pair","place","label","optional_ordinal_last","nth_primitive","object_type","label_path","relative_path","path","corner",
+"expr",""
};
#endif
@@ -299,23 +405,24 @@ static const short yyr1[] = { 0,
136, 138, 139, 136, 140, 141, 136, 142, 136, 136,
143, 136, 136, 136, 144, 144, 144, 146, 145, 147,
147, 148, 148, 148, 149, 149, 149, 150, 150, 150,
- 150, 151, 150, 150, 152, 152, 152, 152, 152, 152,
- 152, 152, 152, 152, 152, 153, 152, 152, 152, 152,
- 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
- 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
- 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
- 152, 152, 152, 152, 152, 152, 152, 152, 154, 154,
- 155, 155, 156, 156, 157, 157, 157, 157, 157, 157,
- 158, 158, 159, 159, 160, 160, 160, 160, 160, 161,
- 161, 161, 162, 162, 163, 163, 164, 164, 164, 164,
- 164, 164, 164, 164, 164, 165, 165, 166, 166, 166,
- 167, 167, 167, 167, 167, 168, 168, 168, 168, 168,
- 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
- 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
- 168, 168, 168, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169
+ 150, 151, 152, 150, 150, 153, 153, 154, 154, 154,
+ 154, 154, 154, 154, 154, 154, 154, 154, 155, 154,
+ 154, 154, 154, 154, 154, 154, 154, 154, 154, 154,
+ 154, 154, 154, 154, 154, 154, 154, 154, 154, 154,
+ 154, 154, 154, 154, 154, 154, 154, 154, 154, 154,
+ 154, 154, 154, 154, 154, 154, 154, 154, 154, 154,
+ 154, 156, 156, 157, 157, 158, 158, 159, 159, 159,
+ 159, 159, 159, 160, 160, 161, 161, 162, 162, 162,
+ 162, 162, 163, 163, 163, 164, 164, 165, 165, 166,
+ 166, 166, 166, 166, 166, 166, 166, 166, 167, 167,
+ 168, 168, 168, 169, 169, 169, 169, 169, 170, 170,
+ 170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
+ 170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
+ 170, 170, 170, 170, 170, 170, 171, 171, 171, 171,
+ 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
+ 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
+ 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
+ 171
};
static const short yyr2[] = { 0,
@@ -324,243 +431,258 @@ static const short yyr2[] = { 0,
2, 0, 0, 7, 0, 0, 6, 0, 10, 1,
0, 4, 1, 1, 2, 2, 3, 0, 5, 0,
2, 1, 3, 3, 0, 2, 3, 1, 4, 4,
- 4, 0, 4, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 2, 3, 0, 4, 3, 3, 3,
- 3, 2, 2, 3, 2, 3, 2, 3, 2, 3,
- 3, 3, 3, 3, 3, 2, 2, 3, 2, 3,
- 2, 3, 2, 3, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 3, 2, 1, 5,
- 0, 3, 1, 1, 1, 3, 3, 5, 5, 6,
- 1, 4, 3, 3, 1, 2, 2, 3, 1, 1,
- 1, 3, 1, 2, 2, 2, 1, 1, 1, 1,
- 1, 1, 1, 2, 1, 2, 3, 1, 1, 2,
- 1, 4, 3, 3, 2, 1, 1, 1, 1, 1,
+ 4, 0, 0, 6, 1, 0, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 2, 3, 0, 4,
+ 3, 3, 3, 3, 2, 2, 3, 2, 3, 2,
+ 3, 2, 3, 3, 3, 3, 3, 3, 2, 2,
+ 3, 2, 3, 2, 3, 2, 3, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 3,
+ 2, 1, 5, 0, 3, 1, 1, 1, 3, 3,
+ 5, 5, 6, 1, 4, 3, 3, 1, 2, 2,
+ 3, 1, 1, 1, 3, 1, 2, 2, 2, 1,
+ 1, 1, 1, 1, 1, 1, 2, 1, 2, 3,
+ 1, 1, 2, 1, 4, 3, 3, 2, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 1, 1, 2, 2, 2, 2,
- 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
- 3, 3, 3, 3, 3, 3, 2, 3, 4, 4,
- 6, 4, 4, 4, 6, 6, 4, 4, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 2
+ 1, 1, 1, 2, 2, 2, 2, 1, 1, 2,
+ 2, 2, 2, 1, 1, 1, 1, 1, 2, 2,
+ 2, 2, 2, 3, 3, 3, 3, 3, 3, 2,
+ 3, 4, 4, 6, 4, 4, 4, 6, 6, 4,
+ 4, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 2
};
static const short yydefact[] = { 6,
- 8, 2, 1, 7, 0, 0, 109, 15, 11, 12,
- 13, 14, 55, 56, 57, 58, 59, 60, 61, 62,
- 0, 19, 0, 0, 0, 34, 0, 0, 52, 66,
- 6, 54, 33, 30, 4, 48, 63, 9, 6, 0,
- 21, 25, 0, 130, 184, 185, 0, 133, 169, 170,
- 129, 156, 157, 158, 159, 160, 161, 162, 163, 164,
- 165, 166, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 167, 168, 0, 0, 175, 176, 181, 183,
- 182, 0, 0, 0, 17, 18, 113, 115, 114, 125,
- 0, 131, 0, 16, 0, 0, 0, 0, 0, 42,
- 35, 64, 0, 6, 6, 3, 7, 36, 0, 31,
- 97, 98, 99, 73, 75, 79, 77, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 86, 87, 89, 93,
- 95, 96, 103, 104, 105, 106, 100, 101, 0, 91,
- 108, 102, 72, 0, 10, 22, 0, 20, 145, 134,
- 137, 138, 139, 140, 141, 142, 143, 0, 135, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 171,
- 173, 177, 179, 172, 174, 178, 180, 0, 115, 0,
- 197, 218, 0, 0, 186, 187, 188, 189, 190, 0,
- 126, 136, 0, 127, 0, 121, 0, 0, 0, 0,
+ 8, 2, 1, 7, 0, 0, 112, 15, 11, 12,
+ 13, 14, 58, 59, 60, 61, 62, 63, 64, 65,
+ 0, 19, 0, 0, 0, 34, 0, 0, 52, 69,
+ 6, 55, 33, 30, 4, 48, 66, 9, 6, 0,
+ 21, 25, 0, 133, 187, 188, 0, 136, 172, 173,
+ 132, 159, 160, 161, 162, 163, 164, 165, 166, 167,
+ 168, 169, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 170, 171, 0, 0, 178, 179, 184, 186,
+ 185, 0, 0, 0, 17, 18, 116, 118, 117, 128,
+ 0, 134, 0, 16, 0, 0, 0, 0, 0, 42,
+ 35, 67, 0, 6, 6, 3, 7, 36, 0, 31,
+ 100, 101, 102, 76, 78, 82, 80, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 89, 90, 92, 96,
+ 98, 99, 106, 107, 108, 109, 103, 104, 0, 94,
+ 111, 105, 75, 0, 10, 22, 0, 20, 148, 137,
+ 140, 141, 142, 143, 144, 145, 146, 0, 138, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 174,
+ 176, 180, 182, 175, 177, 181, 183, 0, 118, 0,
+ 200, 221, 0, 0, 189, 190, 191, 192, 193, 0,
+ 129, 139, 0, 130, 0, 124, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 38, 0, 0, 0, 65, 111,
- 0, 0, 0, 5, 37, 0, 74, 76, 80, 78,
- 68, 69, 70, 71, 81, 0, 82, 83, 0, 0,
- 0, 0, 149, 151, 84, 148, 0, 85, 0, 88,
- 90, 94, 107, 92, 130, 184, 13, 14, 49, 0,
- 50, 51, 0, 26, 144, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 209, 0, 0, 124, 198, 116,
- 117, 132, 128, 0, 216, 217, 215, 214, 211, 213,
- 123, 0, 210, 212, 191, 192, 193, 194, 195, 196,
- 0, 0, 0, 44, 43, 210, 0, 53, 67, 32,
- 155, 0, 0, 0, 146, 0, 150, 0, 0, 23,
- 40, 199, 200, 0, 202, 203, 204, 0, 0, 207,
- 208, 0, 0, 0, 0, 0, 39, 0, 110, 0,
- 154, 153, 147, 40, 0, 27, 0, 0, 0, 118,
- 122, 0, 119, 45, 112, 152, 24, 41, 201, 205,
- 206, 120, 0, 0, 0, 46, 28, 47, 0, 29,
- 0, 0, 0
+ 0, 0, 0, 0, 38, 0, 0, 0, 68, 114,
+ 0, 0, 0, 5, 37, 0, 77, 79, 83, 81,
+ 71, 72, 73, 74, 84, 0, 85, 86, 0, 0,
+ 0, 0, 152, 154, 87, 151, 0, 88, 0, 91,
+ 93, 97, 110, 95, 133, 187, 13, 14, 49, 0,
+ 50, 51, 0, 26, 147, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 212, 0, 0, 127, 201, 119,
+ 120, 135, 131, 0, 219, 220, 218, 217, 214, 216,
+ 126, 0, 213, 215, 194, 195, 196, 197, 198, 199,
+ 0, 0, 0, 44, 43, 213, 0, 53, 70, 32,
+ 158, 0, 0, 0, 149, 0, 153, 0, 0, 23,
+ 40, 202, 203, 0, 205, 206, 207, 0, 0, 210,
+ 211, 0, 0, 0, 0, 0, 39, 0, 113, 56,
+ 0, 157, 156, 150, 40, 0, 27, 0, 0, 0,
+ 121, 125, 0, 122, 45, 115, 57, 54, 155, 24,
+ 41, 204, 208, 209, 123, 0, 0, 0, 46, 28,
+ 47, 0, 29, 0, 0, 0
};
-static const short yydefgoto[] = { 371,
- 2, 31, 222, 4, 32, 43, 263, 344, 147, 321,
- 369, 226, 33, 34, 303, 346, 97, 364, 35, 104,
- 36, 105, 37, 307, 86, 87, 212, 88, 99, 90,
- 91, 92, 159, 243, 244, 245, 93, 236
+static const short yydefgoto[] = { 374,
+ 2, 31, 222, 4, 32, 43, 263, 345, 147, 321,
+ 372, 226, 33, 34, 303, 347, 97, 367, 35, 104,
+ 340, 358, 36, 105, 37, 307, 86, 87, 212, 88,
+ 99, 90, 91, 92, 159, 243, 244, 245, 93, 236
};
-static const short yypact[] = { -101,
--32768,-32768, 535, -99, -96, -89,-32768,-32768,-32768,-32768,
+static const short yypact[] = { -107,
+-32768,-32768, 574, -104, -103, -97,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
- 23,-32768, 750, 37, 851, 38, 1057, -65,-32768,-32768,
- -101,-32768, 1, -42,-32768, 641,-32768,-32768, -101, 851,
- -4,-32768, 68,-32768,-32768,-32768, 62,-32768,-32768,-32768,
+ 10,-32768, 789, 26, 890, 33, 1096, -65,-32768,-32768,
+ -107,-32768, 1, -56,-32768, 680,-32768,-32768, -107, 890,
+ -20,-32768, 47,-32768,-32768,-32768, 29,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768, -32, -21, -9, -7, 25, 41, 42, 46,
- 48, 52,-32768,-32768, 2, 21,-32768,-32768,-32768,-32768,
--32768, 1158, 1057, 1057,-32768, -59,-32768,-32768, 232, 1673,
- 363,-32768, 13, 1646, 7, 1057, 97, 28, 232, 1973,
--32768, 984, 143, -101, -101,-32768, 509,-32768, 150,-32768,
--32768,-32768,-32768, 1499, 1499, 1339, 1419, 1057, 1057, 1057,
- 1057, 1158, 1158, 1158, 153, 1259,-32768, 1499, 1499, 1499,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1057, 1499,
--32768,-32768, 1973, 394,-32768,-32768, 157,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768, 39,-32768, 1057,
- 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 276,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768, -61, 44, 1594,
- 50, 50, 1259, 1259,-32768,-32768,-32768,-32768,-32768, 190,
--32768,-32768, 111, 64, 126,-32768, 1057, 1057, 1057, 1057,
- 1057, 1057, 1057, 1158, 1057, 1057, 1057, 1057, 1057, 1057,
- 1057, 1158, 1057, 1701,-32768, 0, 0, 1057,-32768,-32768,
- 70, 535, 69,-32768,-32768, 194, 1973, 1973, 1973, 1973,
- 1973, 1973, 1973, 1973, -59, 1646, -59, -59, 1569, 253,
- 363, 200, 1621,-32768,-32768,-32768, 1259,-32768, 677, 1973,
- 1973, 1973, 1973, 1973, -96, -89, 22, 27,-32768, -59,
- 19, 154, 207,-32768,-32768, 1732, 1741, 1540, 1772, 1781,
- 1812, 1932, 1942, 1821,-32768, 1852, 1158,-32768,-32768,-32768,
--32768,-32768, 64, 174, 720, 778, 767, 767, 125, 125,
- 1973, 11, 110, 125, 169, 169, 50, 50, 50, 50,
- -38, 486, 215,-32768,-32768, 125, -80,-32768,-32768,-32768,
--32768, 363, 1569, 1569,-32768, 227,-32768, 44, 1692,-32768,
- 133,-32768,-32768, 1057,-32768,-32768,-32768, 1057, 1057,-32768,
--32768, -63, 189, 1158, 1158, 1057,-32768, 1057,-32768, 1569,
--32768,-32768,-32768, 133, 239,-32768, 1861, 1892, 1901,-32768,
--32768, -52, -59, 452, 1973,-32768,-32768,-32768,-32768,-32768,
--32768,-32768, 952, 159, 1057, 1973,-32768, 1973, 240,-32768,
- 249, 257,-32768
+-32768,-32768, -48, -39, -37, -35, -32, -7, 8, 24,
+ 51, 54,-32768,-32768, 23, 50,-32768,-32768,-32768,-32768,
+-32768, 1197, 1096, 1096,-32768, -26,-32768,-32768, 87, 1671,
+ 198,-32768, 19, 491, 7, 1096, 99, 30, 87, 1993,
+-32768, 1023, 187, -107, -107,-32768, 548,-32768, 190,-32768,
+-32768,-32768,-32768, 1538, 1538, 1378, 1458, 1096, 1096, 1096,
+ 1096, 1197, 1197, 1197, 193, 1298,-32768, 1538, 1538, 1538,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1096, 1538,
+-32768,-32768, 1993, 433,-32768,-32768, 189,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768, 75,-32768, 1096,
+ 1096, 1096, 1096, 1096, 1096, 1096, 1096, 1096, 315,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768, -59, 76, 167,
+ 86, 86, 1298, 1298,-32768,-32768,-32768,-32768,-32768, 205,
+-32768,-32768, 20, 81, 168,-32768, 1096, 1096, 1096, 1096,
+ 1096, 1096, 1096, 1197, 1096, 1096, 1096, 1096, 1096, 1096,
+ 1096, 1197, 1096, 1721,-32768, 6, 6, 1096,-32768,-32768,
+ 96, 574, 85,-32768,-32768, 220, 1993, 1993, 1993, 1993,
+ 1993, 1993, 1993, 1993, -26, 491, -26, -26, 1608, 62,
+ 198, 228, 1660,-32768,-32768,-32768, 1298,-32768, 716, 1993,
+ 1993, 1993, 1993, 1993, -103, -97, 109, 123,-32768, -26,
+ 42, 284, 224,-32768,-32768, 1730, 1761, 1579, 1770, 1801,
+ 1810, 1952, 1962, 1841,-32768, 1850, 1197,-32768,-32768,-32768,
+-32768,-32768, 81, 186, 759, 817, 306, 306, 150, 150,
+ 1993, 55, 121, 150, 181, 181, 86, 86, 86, 86,
+ -38, 525, 233,-32768,-32768, 150, -93,-32768,-32768,-32768,
+-32768, 198, 1608, 1608,-32768, 240,-32768, 76, 1690,-32768,
+ 174,-32768,-32768, 1096,-32768,-32768,-32768, 1096, 1096,-32768,
+-32768, -14, 222, 1197, 1197, 1096,-32768, 1096,-32768, 574,
+ 1608,-32768,-32768,-32768, 174, 272,-32768, 1881, 1890, 1921,
+-32768,-32768, 111, -26, 242, 1993,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768, 991, 199, 1096, 1993,-32768,
+ 1993, 281,-32768, 295, 297,-32768
};
static const short yypgoto[] = {-32768,
- 43,-32768, 8, 229,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768, -86, 221,-32768, -74,-32768,
--32768,-32768, -16,-32768, -79, 118,-32768, -55, -13, -81,
--32768,-32768, -90,-32768, -225,-32768, -75, -23
+ 68,-32768, 31, 273,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768, -42, 267,-32768, -106,-32768,
+-32768,-32768,-32768,-32768, -16,-32768, -79, 164,-32768, -55,
+ -13, -85,-32768,-32768, -77,-32768, -214,-32768, -84, -23
};
-#define YYLAST 2094
+#define YYLAST 2114
static const short yytable[] = { 94,
- 192, 100, 178, 102, 108, 7, 85, 3, 98, 89,
- 335, 194, 143, 311, 191, 44, 100, 170, 171, 142,
- 1, 47, 38, 98, -169, 48, 179, 39, 41, -170,
- -169, 338, 224, 40, -169, -170, 174, 175, 106, -170,
- 95, 101, 235, 237, 238, 103, 144, 110, 339, 246,
- 277, 183, 184, 183, 184, 183, 184, 193, 180, 181,
- 182, 362, 183, 184, 260, 350, -169, 149, 89, 259,
- 248, -170, 214, 146, 150, 148, 183, 184, 160, 151,
- 152, 153, 154, 155, 156, 219, 157, 341, 342, 161,
- 227, 228, 229, 230, 231, 232, 233, 234, 172, 173,
- 42, 162, 249, 163, 250, 251, 252, 28, 89, 89,
- 89, 283, 109, 44, 356, 253, 254, 176, 177, 47,
- 216, 217, 334, 48, 292, 183, 184, 280, 281, 213,
- 262, 215, 301, -113, -113, 164, 266, 267, 268, 269,
- 270, 271, 272, 273, 274, 276, 221, 223, 220, 313,
- 314, 165, 166, 225, 195, 239, 167, 196, 168, 249,
- 249, 240, 169, 246, 264, 241, 265, 317, 49, 50,
- 211, 284, 278, 285, 286, 287, 288, 289, 290, 291,
+ 224, 100, 178, 102, 108, 191, 85, 194, 98, 89,
+ 335, 7, 143, 192, 1, 41, 100, 38, 338, 142,
+ 39, 44, 44, 98, 311, 40, 179, 47, 47, 95,
+ 3, 48, 48, 110, 149, 339, 101, 259, 170, 171,
+ 246, 150, 235, 237, 238, 103, 151, 152, 153, 154,
+ 155, 156, 277, 157, 148, 183, 184, 146, 180, 181,
+ 182, 106, 160, 193, 260, 174, 175, 149, 89, 144,
+ 248, 161, 214, 162, 312, 163, 183, 184, 164, 151,
+ 152, 153, 154, 155, 156, 219, 157, 42, 183, 184,
+ 227, 228, 229, 230, 231, 232, 233, 234, 342, 343,
+ 183, 184, 249, 165, 250, 251, 252, 283, 89, 89,
+ 89, -172, 109, 28, 351, 253, 254, -172, 166, 172,
+ 173, -172, 216, 217, 292, -173, 359, 280, 281, 213,
+ 262, -173, 301, 215, 167, -173, 266, 267, 268, 269,
+ 270, 271, 272, 273, 274, 276, 176, 177, 185, 186,
+ 187, 188, 189, -172, 246, 158, -116, -116, 317, 249,
+ 249, 168, 313, 314, 169, 195, 334, -173, 196, 183,
+ 184, 221, 223, 285, 286, 287, 288, 289, 290, 291,
293, 294, 295, 296, 297, 298, 299, 300, 158, 302,
- 89, 318, 282, 190, 306, 308, 309, 332, 89, 304,
- 305, 310, 315, 52, 53, 54, 55, 56, 57, 58,
- 59, 60, 61, 62, 320, 185, 186, 187, 188, 189,
- 333, 340, 337, 319, 206, 207, 208, 209, 210, 343,
- 211, 73, 74, 75, 76, 345, 351, 246, 246, 206,
- 207, 208, 209, 210, 358, 211, 367, 370, 372, 77,
- 78, 79, 80, 81, 352, 353, 373, 357, 149, 107,
- 145, 261, 0, 89, 246, 312, 0, 0, -114, -114,
- 151, 152, 153, 154, 155, 156, 0, 157, 44, 45,
- 46, 0, 242, 0, 47, 208, 209, 210, 48, 211,
- 0, 49, 50, 185, 186, 187, 188, 189, 0, 0,
- 347, 0, 0, 0, 348, 349, 0, 0, 0, 0,
- 0, 0, 354, 0, 355, 0, 0, 0, 0, 0,
- 89, 89, 0, 0, 0, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 0, 0, 366,
- 0, 368, 63, 64, 65, 66, 67, 68, 69, 70,
- 71, 72, 0, 0, 73, 74, 75, 76, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 149, 0,
- 0, 0, 77, 78, 79, 80, 81, 0, 0, 158,
- 151, 152, 153, 154, 155, 156, 96, 157, 0, 0,
- 0, 83, 0, 0, 0, 84, 255, 256, 46, 7,
- 8, 0, 47, 0, 275, 0, 48, 9, 10, 257,
- 258, 13, 14, 15, 16, 17, 18, 19, 20, 0,
+ 89, 318, 220, 225, 306, 239, 264, 332, 89, 304,
+ 305, 240, 265, 149, 278, 241, 211, 282, 49, 50,
+ 190, 195, 309, 284, 196, 151, 152, 153, 154, 155,
+ 156, 308, 157, 319, 365, 183, 184, 310, 246, 246,
+ 315, 320, 333, 357, 341, 206, 207, 208, 209, 210,
+ 337, 211, 344, 52, 53, 54, 55, 56, 57, 58,
+ 59, 60, 61, 62, 353, 354, 246, 197, 198, 199,
+ 200, 201, 202, 89, 206, 207, 208, 209, 210, 352,
+ 211, 73, 74, 75, 76, 366, 346, 361, 203, 204,
+ 205, 206, 207, 208, 209, 210, 370, 211, 373, 77,
+ 78, 79, 80, 81, 375, 279, 376, 208, 209, 210,
+ 348, 211, 360, 107, 349, 350, 145, 261, 0, 0,
+ 0, 0, 355, 0, 356, 0, 0, 44, 45, 46,
+ 89, 89, 242, 47, 158, 0, 0, 48, 0, 0,
+ 49, 50, 197, 198, 199, 200, 201, 202, 0, 0,
+ 0, 0, 369, 0, 371, 185, 186, 187, 188, 189,
+ 0, 0, 0, 0, 218, 205, 206, 207, 208, 209,
+ 210, 0, 211, 0, 51, 52, 53, 54, 55, 56,
+ 57, 58, 59, 60, 61, 62, 0, 0, 0, 0,
+ 0, 63, 64, 65, 66, 67, 68, 69, 70, 71,
+ 72, 0, 0, 73, 74, 75, 76, 0, -117, -117,
+ 201, 202, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 77, 78, 79, 80, 81, 0, 0, 218, 205,
+ 206, 207, 208, 209, 210, 96, 211, 0, 0, 0,
+ 83, 0, 0, 0, 84, 255, 256, 46, 7, 8,
+ 0, 47, 0, 275, 0, 48, 9, 10, 257, 258,
+ 13, 14, 15, 16, 17, 18, 19, 20, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 51, 52, 53, 54, 55, 56, 57,
- 58, 59, 60, 61, 62, 0, 0, 0, 0, 0,
- 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
- 21, 0, 73, 74, 75, 76, 22, 23, 0, 0,
- 24, 0, 25, 0, 0, 363, 0, 0, 0, 158,
- 77, 78, 79, 80, 81, 26, 0, 27, 0, 0,
- 0, 28, 0, 0, 82, 0, 0, 0, 0, 83,
- 0, 5, 6, 84, 7, 8, 336, 0, 29, 0,
- 30, 0, 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 0, 0, 0, 5, 6, 0,
- 7, 8, 197, 198, 199, 200, 201, 202, 9, 10,
- 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- 0, 0, 0, 0, 218, 205, 206, 207, 208, 209,
- 210, 0, 211, 0, 0, 0, 197, 198, 199, 200,
- 201, 202, 0, 0, 0, 21, 0, 0, 0, 0,
- 0, 22, 23, 0, 0, 24, 0, 25, 218, 205,
- 206, 207, 208, 209, 210, 0, 211, 0, 0, 0,
- 26, 21, 27, 0, 0, 0, 28, 22, 23, 0,
- 0, 24, 0, 25, 0, 0, 0, 0, 0, 0,
- 38, 0, 0, 29, 0, 30, 26, 0, 27, 0,
- 0, 0, 28, 44, 45, 46, 7, 0, 0, 47,
- 111, 112, 113, 48, 114, 115, 116, 117, 0, 29,
- 0, 30, 0, 0, 0, 0, 118, 119, 120, 121,
- 122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
- 132, 133, 134, 135, 136, 0, 0, 0, 0, 0,
- 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
- 61, 62, 0, 0, 0, 0, 0, 63, 64, 65,
- 66, 67, 68, 69, 70, 71, 72, 0, 0, 73,
- 74, 75, 76, 0, 0, 137, 138, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 77, 78, 79,
- 80, 81, 0, 0, 0, 139, 140, 141, 28, 0,
- 0, 96, 44, 45, 46, 7, 83, 0, 47, 0,
- 84, 0, 48, 0, 0, 49, 50, 197, 198, 199,
+ 0, 0, 51, 52, 53, 54, 55, 56, 57, 58,
+ 59, 60, 61, 62, 0, 0, 0, 0, 0, 63,
+ 64, 65, 66, 67, 68, 69, 70, 71, 72, 21,
+ 0, 73, 74, 75, 76, 22, 23, 0, 0, 24,
+ 0, 25, 0, 0, 0, 0, 0, 0, 0, 77,
+ 78, 79, 80, 81, 26, 195, 27, 0, 196, 0,
+ 28, 0, 0, 82, 0, 0, 0, 0, 83, 0,
+ 5, 6, 84, 7, 8, 336, 0, 29, 0, 30,
+ 0, 9, 10, 11, 12, 13, 14, 15, 16, 17,
+ 18, 19, 20, 0, 0, 0, 5, 6, 0, 7,
+ 8, 197, 198, 199, 200, 201, 202, 9, 10, 11,
+ 12, 13, 14, 15, 16, 17, 18, 19, 20, 0,
+ 0, 0, 203, 204, 205, 206, 207, 208, 209, 210,
+ 0, 211, 0, 0, 0, 197, 198, 199, 200, 201,
+ 202, 0, 0, 0, 21, 0, 0, 0, 0, 0,
+ 22, 23, 0, 0, 24, 0, 25, 218, 205, 206,
+ 207, 208, 209, 210, 0, 211, 0, 0, 0, 26,
+ 21, 27, 0, 0, 0, 28, 22, 23, 0, 0,
+ 24, 0, 25, 0, 0, 0, 0, 0, 0, 38,
+ 0, 0, 29, 0, 30, 26, 0, 27, 0, 0,
+ 0, 28, 44, 45, 46, 7, 0, 0, 47, 111,
+ 112, 113, 48, 114, 115, 116, 117, 0, 29, 0,
+ 30, 0, 0, 0, 0, 118, 119, 120, 121, 122,
+ 123, 124, 125, 126, 127, 128, 129, 130, 131, 132,
+ 133, 134, 135, 136, 0, 0, 0, 0, 0, 51,
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+ 62, 0, 0, 0, 0, 0, 63, 64, 65, 66,
+ 67, 68, 69, 70, 71, 72, 0, 0, 73, 74,
+ 75, 76, 0, 0, 137, 138, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 77, 78, 79, 80,
+ 81, 0, 0, 0, 139, 140, 141, 28, 0, 0,
+ 96, 44, 45, 46, 7, 83, 0, 47, 0, 84,
+ 0, 48, 0, 0, 49, 50, 197, 198, 199, 200,
+ 201, 202, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 203, 218, 205,
+ 206, 207, 208, 209, 210, 0, 211, 0, 51, 52,
+ 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
+ 0, 199, 200, 201, 202, 63, 64, 65, 66, 67,
+ 68, 69, 70, 71, 72, 0, 0, 73, 74, 75,
+ 76, 218, 205, 206, 207, 208, 209, 210, 0, 211,
+ 0, 0, 0, 0, 0, 77, 78, 79, 80, 81,
+ 0, 0, 44, 45, 46, 7, 28, 0, 47, 82,
+ 0, 0, 48, 0, 83, 49, 50, 197, 84, 199,
200, 201, 202, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 203, 218,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 218,
205, 206, 207, 208, 209, 210, 0, 211, 0, 51,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- 62, 0, 199, 200, 201, 202, 63, 64, 65, 66,
+ 62, 0, 0, 0, 0, 0, 63, 64, 65, 66,
67, 68, 69, 70, 71, 72, 0, 0, 73, 74,
- 75, 76, 218, 205, 206, 207, 208, 209, 210, 0,
- 211, 0, 0, 0, 0, 0, 77, 78, 79, 80,
- 81, 0, 0, 44, 45, 46, 7, 28, 0, 47,
- 82, 201, 202, 48, 0, 83, 49, 50, 197, 84,
- 199, 200, 201, 202, 0, 0, 0, 0, 0, 218,
- 205, 206, 207, 208, 209, 210, 0, 211, 0, 0,
- 218, 205, 206, 207, 208, 209, 210, 0, 211, 0,
+ 75, 76, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 77, 78, 79, 80,
+ 81, 0, 0, 44, 45, 46, 0, 28, 0, 47,
+ 96, 0, 0, 48, 0, 83, 49, 50, 0, 84,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
61, 62, 0, 0, 0, 0, 0, 63, 64, 65,
66, 67, 68, 69, 70, 71, 72, 0, 0, 73,
74, 75, 76, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 77, 78, 79,
- 80, 81, 0, 0, 44, 45, 46, 0, 28, 0,
- 47, 96, 0, 0, 48, 0, 83, 49, 50, 0,
- 84, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,
+ 80, 81, 0, 0, 0, 0, 0, 0, 44, 45,
+ 46, 96, 0, 0, 47, 0, 83, 368, 48, 0,
+ 84, 49, 50, 197, 198, 199, 200, 201, 202, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 28, 0, 0, 0, 0, 218, 205, 206, 207, 208,
+ 209, 210, 0, 211, 0, 51, 52, 53, 54, 55,
+ 56, 57, 58, 59, 60, 61, 62, 0, 0, 0,
+ 0, 0, 63, 64, 65, 66, 67, 68, 69, 70,
+ 71, 72, 0, 0, 73, 74, 75, 76, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 77, 78, 79, 80, 81, 0, 0, 44,
+ 45, 46, 0, 0, 0, 47, 96, 0, 0, 48,
+ 0, 83, 49, 50, 0, 84, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 51, 52, 53, 54, 55, 56, 57, 58, 59,
- 60, 61, 62, 0, 0, 0, 0, 0, 63, 64,
- 65, 66, 67, 68, 69, 70, 71, 72, 0, 0,
- 73, 74, 75, 76, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 77, 78,
- 79, 80, 81, 0, 0, 0, 0, 0, 0, 44,
- 45, 46, 96, 0, 0, 47, 0, 83, 365, 48,
- 0, 84, 49, 50, 197, 198, 199, 200, 201, 202,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 28, 0, 0, 0, 0, 218, 205, 206, 207,
- 208, 209, 210, 0, 211, 0, 51, 52, 53, 54,
+ 0, 0, 0, 0, 0, 0, 51, 52, 53, 54,
55, 56, 57, 58, 59, 60, 61, 62, 0, 0,
0, 0, 0, 63, 64, 65, 66, 67, 68, 69,
70, 71, 72, 0, 0, 73, 74, 75, 76, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 77, 78, 79, 80, 81, 0, 0,
- 44, 45, 46, 0, 0, 0, 47, 96, 0, 0,
+ 44, 45, 46, 0, 0, 0, 47, 82, 0, 0,
48, 0, 83, 49, 50, 0, 84, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -568,85 +690,73 @@ static const short yytable[] = { 94,
54, 55, 56, 57, 58, 59, 60, 61, 62, 0,
0, 0, 0, 0, 63, 64, 65, 66, 67, 68,
69, 70, 71, 72, 0, 0, 73, 74, 75, 76,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 44, 45, 46, 0, 0, 0, 47, 0, 0, 0,
+ 48, 0, 0, 0, 77, 78, 79, 80, 81, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 247, 0,
+ 0, 0, 0, 83, 0, 0, 0, 84, 0, 0,
+ 0, 0, -172, 0, 0, 0, 0, 51, 52, 53,
+ 54, 55, 56, 57, 58, 59, 60, 61, 62, 0,
+ 0, 0, 0, 0, 63, 64, 65, 66, 67, 68,
+ 69, 70, 71, 72, 0, 0, 73, 74, 75, 76,
+ 44, 45, 46, 0, 0, 0, 47, 0, 0, 0,
+ 48, 0, 0, 0, 77, 78, 79, 80, 81, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 96, 0,
+ 0, 0, 0, 83, 0, 0, 0, 84, 0, 0,
+ 0, 0, -173, 0, 0, 0, 0, 51, 52, 53,
+ 54, 55, 56, 57, 58, 59, 60, 61, 62, 0,
+ 0, 0, 0, 0, 63, 64, 65, 66, 67, 68,
+ 69, 70, 71, 72, 0, 0, 73, 74, 75, 76,
+ 44, 45, 46, 0, 0, 0, 47, 0, 0, 0,
+ 48, 0, 0, 0, 77, 78, 79, 80, 81, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 96, 0,
+ 0, 0, 0, 83, 0, 0, 0, 84, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 51, 52, 53,
+ 54, 55, 56, 57, 58, 59, 60, 61, 62, 0,
+ 0, 0, 0, 0, 63, 64, 65, 66, 67, 68,
+ 69, 70, 71, 72, 0, 0, 73, 74, 75, 76,
+ 0, 0, 0, 49, 50, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 77, 78, 79, 80, 81, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 96, 0,
+ 0, 0, 0, 83, 0, 0, 0, 84, 52, 53,
+ 54, 55, 56, 57, 58, 59, 60, 61, 62, 197,
+ 198, 199, 200, 201, 202, 49, 50, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 73, 74, 75, 76,
+ 324, 218, 205, 206, 207, 208, 209, 210, 0, 211,
0, 0, 0, 0, 77, 78, 79, 80, 81, 0,
- 0, 44, 45, 46, 0, 0, 0, 47, 82, 0,
- 0, 48, 0, 83, 49, 50, 0, 84, 0, 0,
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+ 62, 52, 53, 54, 55, 56, 57, 58, 59, 60,
+ 61, 62, 0, 0, 0, 0, 0, 242, 73, 74,
+ 75, 76, 0, 0, 0, 0, 0, 0, 0, 73,
+ 74, 75, 76, 0, 0, 0, 77, 78, 79, 80,
+ 81, 0, 0, 0, 0, 0, 0, 77, 78, 79,
+ 80, 81, 0, 0, 0, 0, 0, 0, 0, 0,
+ 197, 198, 199, 200, 201, 202, 0, 0, 0, 316,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 190, 203, 218, 205, 206, 207, 208, 209, 210, 0,
+ 211, 197, 198, 199, 200, 201, 202, 0, 279, 0,
+ 197, 198, 199, 200, 201, 202, 0, 0, 0, 0,
+ 0, 0, 0, 218, 205, 206, 207, 208, 209, 210,
+ 0, 211, 218, 205, 206, 207, 208, 209, 210, 279,
+ 211, 197, 198, 199, 200, 201, 202, 0, 322, 0,
+ 197, 198, 199, 200, 201, 202, 0, 0, 0, 0,
+ 0, 0, 0, 218, 205, 206, 207, 208, 209, 210,
+ 0, 211, 218, 205, 206, 207, 208, 209, 210, 323,
+ 211, 197, 198, 199, 200, 201, 202, 0, 325, 0,
+ 197, 198, 199, 200, 201, 202, 0, 0, 0, 0,
+ 0, 0, 0, 218, 205, 206, 207, 208, 209, 210,
+ 0, 211, 218, 205, 206, 207, 208, 209, 210, 326,
+ 211, 197, 198, 199, 200, 201, 202, 0, 327, 0,
+ 197, 198, 199, 200, 201, 202, 0, 0, 0, 0,
+ 0, 0, 0, 218, 205, 206, 207, 208, 209, 210,
+ 0, 211, 218, 205, 206, 207, 208, 209, 210, 330,
+ 211, 197, 198, 199, 200, 201, 202, 0, 331, 0,
+ 197, 198, 199, 200, 201, 202, 0, 0, 0, 0,
+ 0, 0, 0, 218, 205, 206, 207, 208, 209, 210,
+ 0, 211, 218, 205, 206, 207, 208, 209, 210, 362,
+ 211, 197, 198, 199, 200, 201, 202, 0, 363, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 51, 52,
- 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
- 0, 0, 0, 0, 0, 63, 64, 65, 66, 67,
- 68, 69, 70, 71, 72, 0, 0, 73, 74, 75,
- 76, 44, 45, 46, 0, 0, 0, 47, 0, 0,
- 0, 48, 0, 0, 0, 77, 78, 79, 80, 81,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 247,
- 0, 0, 0, 0, 83, 0, 0, 0, 84, 0,
- 0, 0, 0, -169, 0, 0, 0, 0, 51, 52,
- 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
- 0, 0, 0, 0, 0, 63, 64, 65, 66, 67,
- 68, 69, 70, 71, 72, 0, 0, 73, 74, 75,
- 76, 44, 45, 46, 0, 0, 0, 47, 0, 0,
- 0, 48, 0, 0, 0, 77, 78, 79, 80, 81,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,
- 0, 0, 0, 0, 83, 0, 0, 0, 84, 0,
- 0, 0, 0, -170, 0, 0, 0, 0, 51, 52,
- 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
- 0, 0, 0, 0, 0, 63, 64, 65, 66, 67,
- 68, 69, 70, 71, 72, 0, 0, 73, 74, 75,
- 76, 44, 45, 46, 0, 0, 0, 47, 0, 0,
- 0, 48, 0, 0, 0, 77, 78, 79, 80, 81,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,
- 0, 0, 0, 0, 83, 0, 0, 0, 84, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 51, 52,
- 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
- 0, 0, 0, 0, 0, 63, 64, 65, 66, 67,
- 68, 69, 70, 71, 72, 0, 0, 73, 74, 75,
- 76, 0, 0, 0, 49, 50, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 77, 78, 79, 80, 81,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,
- 0, 0, 0, 0, 83, 0, 0, 0, 84, 52,
- 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
- 197, 198, 199, 200, 201, 202, 49, 50, 195, 0,
- 0, 196, 0, 0, 0, 0, 0, 73, 74, 75,
- 76, 324, 218, 205, 206, 207, 208, 209, 210, 0,
- 211, 0, 0, 0, 0, 77, 78, 79, 80, 81,
- 0, 52, 53, 54, 55, 56, 57, 58, 59, 60,
- 61, 62, 0, 0, 197, 198, 199, 200, 201, 202,
- 195, 0, 0, 196, 0, 0, 0, 0, 242, 73,
- 74, 75, 76, 0, 0, 203, 204, 205, 206, 207,
- 208, 209, 210, 0, 211, 0, 0, 77, 78, 79,
- 80, 81, 279, 52, 53, 54, 55, 56, 57, 58,
- 59, 60, 61, 62, 0, 0, 197, 198, 199, 200,
- 201, 202, 0, 0, 0, 0, 0, 0, 0, 0,
- 316, 73, 74, 75, 76, 0, 0, 203, 204, 205,
- 206, 207, 208, 209, 210, 0, 211, 0, 0, 77,
- 78, 79, 80, 81, 0, 0, 0, 0, 0, 0,
- 0, 0, 197, 198, 199, 200, 201, 202, 0, 0,
- 0, 197, 198, 199, 200, 201, 202, 0, 0, 0,
- 0, 0, 190, 203, 218, 205, 206, 207, 208, 209,
- 210, 0, 211, 218, 205, 206, 207, 208, 209, 210,
- 279, 211, 197, 198, 199, 200, 201, 202, 0, 279,
- 0, 197, 198, 199, 200, 201, 202, 0, 0, 0,
- 0, 0, 0, 0, 218, 205, 206, 207, 208, 209,
- 210, 0, 211, 218, 205, 206, 207, 208, 209, 210,
- 322, 211, 197, 198, 199, 200, 201, 202, 0, 323,
- 0, 197, 198, 199, 200, 201, 202, 0, 0, 0,
- 0, 0, 0, 0, 218, 205, 206, 207, 208, 209,
- 210, 0, 211, 218, 205, 206, 207, 208, 209, 210,
- 325, 211, 197, 198, 199, 200, 201, 202, 0, 326,
- 0, 197, 198, 199, 200, 201, 202, 0, 0, 0,
- 0, 0, 0, 0, 218, 205, 206, 207, 208, 209,
- 210, 0, 211, 218, 205, 206, 207, 208, 209, 210,
- 327, 211, 197, 198, 199, 200, 201, 202, 0, 330,
- 0, 197, 198, 199, 200, 201, 202, 0, 0, 0,
- 0, 0, 0, 0, 218, 205, 206, 207, 208, 209,
- 210, 0, 211, 218, 205, 206, 207, 208, 209, 210,
- 331, 211, 197, 198, 199, 200, 201, 202, 0, 359,
- 0, 197, 198, 199, 200, 201, 202, 0, 0, 0,
- 0, 0, 0, 0, 218, 205, 206, 207, 208, 209,
- 210, 0, 211, 218, 205, 206, 207, 208, 209, 210,
- 360, 211, 197, 198, 199, 200, 201, 202, 0, 361,
+ 0, 0, 0, 218, 205, 206, 207, 208, 209, 210,
+ 0, 211, 197, 198, 199, 200, 201, 202, 0, 364,
0, 0, 197, 198, 199, 200, 201, 202, 0, 0,
0, 0, 0, 328, 218, 205, 206, 207, 208, 209,
210, 0, 211, 329, 218, 205, 206, 207, 208, 209,
@@ -657,117 +767,131 @@ static const short yytable[] = { 94,
};
static const short yycheck[] = { 23,
- 91, 25, 82, 27, 4, 6, 23, 0, 25, 23,
- 49, 93, 36, 239, 90, 3, 40, 16, 17, 36,
- 122, 9, 122, 40, 3, 13, 82, 124, 6, 3,
- 9, 112, 107, 123, 13, 9, 16, 17, 31, 13,
- 4, 4, 122, 123, 124, 111, 39, 90, 129, 125,
- 112, 115, 116, 115, 116, 115, 116, 45, 82, 83,
- 84, 114, 115, 116, 144, 129, 45, 6, 82, 144,
- 126, 45, 96, 78, 13, 8, 115, 116, 111, 18,
- 19, 20, 21, 22, 23, 102, 25, 313, 314, 111,
- 114, 115, 116, 117, 118, 119, 120, 121, 97, 98,
- 78, 111, 126, 111, 128, 129, 130, 108, 122, 123,
- 124, 193, 112, 3, 340, 139, 140, 97, 98, 9,
- 93, 94, 112, 13, 204, 115, 116, 183, 184, 123,
- 144, 35, 212, 115, 116, 111, 160, 161, 162, 163,
- 164, 165, 166, 167, 168, 169, 104, 105, 6, 240,
- 241, 111, 111, 4, 45, 3, 111, 48, 111, 183,
- 184, 9, 111, 239, 8, 13, 128, 243, 16, 17,
- 121, 46, 129, 197, 198, 199, 200, 201, 202, 203,
+ 107, 25, 82, 27, 4, 90, 23, 93, 25, 23,
+ 49, 6, 36, 91, 122, 6, 40, 122, 112, 36,
+ 124, 3, 3, 40, 239, 123, 82, 9, 9, 4,
+ 0, 13, 13, 90, 6, 129, 4, 144, 16, 17,
+ 125, 13, 122, 123, 124, 111, 18, 19, 20, 21,
+ 22, 23, 112, 25, 8, 115, 116, 78, 82, 83,
+ 84, 31, 111, 45, 144, 16, 17, 6, 82, 39,
+ 126, 111, 96, 111, 13, 111, 115, 116, 111, 18,
+ 19, 20, 21, 22, 23, 102, 25, 78, 115, 116,
+ 114, 115, 116, 117, 118, 119, 120, 121, 313, 314,
+ 115, 116, 126, 111, 128, 129, 130, 193, 122, 123,
+ 124, 3, 112, 108, 129, 139, 140, 9, 111, 97,
+ 98, 13, 93, 94, 204, 3, 341, 183, 184, 123,
+ 144, 9, 212, 35, 111, 13, 160, 161, 162, 163,
+ 164, 165, 166, 167, 168, 169, 97, 98, 62, 63,
+ 64, 65, 66, 45, 239, 127, 115, 116, 243, 183,
+ 184, 111, 240, 241, 111, 45, 112, 45, 48, 115,
+ 116, 104, 105, 197, 198, 199, 200, 201, 202, 203,
204, 205, 206, 207, 208, 209, 210, 211, 127, 213,
- 204, 247, 3, 130, 218, 126, 128, 277, 212, 216,
- 217, 8, 3, 51, 52, 53, 54, 55, 56, 57,
- 58, 59, 60, 61, 8, 62, 63, 64, 65, 66,
- 47, 312, 8, 247, 115, 116, 117, 118, 119, 3,
- 121, 79, 80, 81, 82, 103, 48, 313, 314, 115,
- 116, 117, 118, 119, 6, 121, 88, 8, 0, 97,
- 98, 99, 100, 101, 334, 335, 0, 344, 6, 31,
- 40, 144, -1, 277, 340, 13, -1, -1, 115, 116,
- 18, 19, 20, 21, 22, 23, -1, 25, 3, 4,
- 5, -1, 130, -1, 9, 117, 118, 119, 13, 121,
- -1, 16, 17, 62, 63, 64, 65, 66, -1, -1,
- 324, -1, -1, -1, 328, 329, -1, -1, -1, -1,
- -1, -1, 336, -1, 338, -1, -1, -1, -1, -1,
- 334, 335, -1, -1, -1, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, -1, -1, 363,
- -1, 365, 67, 68, 69, 70, 71, 72, 73, 74,
- 75, 76, -1, -1, 79, 80, 81, 82, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 6, -1,
- -1, -1, 97, 98, 99, 100, 101, -1, -1, 127,
- 18, 19, 20, 21, 22, 23, 111, 25, -1, -1,
- -1, 116, -1, -1, -1, 120, 3, 4, 5, 6,
- 7, -1, 9, -1, 129, -1, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24, 25, -1,
+ 204, 247, 6, 4, 218, 3, 8, 277, 212, 216,
+ 217, 9, 128, 6, 129, 13, 121, 3, 16, 17,
+ 130, 45, 128, 46, 48, 18, 19, 20, 21, 22,
+ 23, 126, 25, 247, 114, 115, 116, 8, 313, 314,
+ 3, 8, 47, 340, 312, 115, 116, 117, 118, 119,
+ 8, 121, 3, 51, 52, 53, 54, 55, 56, 57,
+ 58, 59, 60, 61, 334, 335, 341, 91, 92, 93,
+ 94, 95, 96, 277, 115, 116, 117, 118, 119, 48,
+ 121, 79, 80, 81, 82, 34, 103, 6, 112, 113,
+ 114, 115, 116, 117, 118, 119, 88, 121, 8, 97,
+ 98, 99, 100, 101, 0, 129, 0, 117, 118, 119,
+ 324, 121, 345, 31, 328, 329, 40, 144, -1, -1,
+ -1, -1, 336, -1, 338, -1, -1, 3, 4, 5,
+ 334, 335, 130, 9, 127, -1, -1, 13, -1, -1,
+ 16, 17, 91, 92, 93, 94, 95, 96, -1, -1,
+ -1, -1, 366, -1, 368, 62, 63, 64, 65, 66,
+ -1, -1, -1, -1, 113, 114, 115, 116, 117, 118,
+ 119, -1, 121, -1, 50, 51, 52, 53, 54, 55,
+ 56, 57, 58, 59, 60, 61, -1, -1, -1, -1,
+ -1, 67, 68, 69, 70, 71, 72, 73, 74, 75,
+ 76, -1, -1, 79, 80, 81, 82, -1, 115, 116,
+ 95, 96, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 97, 98, 99, 100, 101, -1, -1, 113, 114,
+ 115, 116, 117, 118, 119, 111, 121, -1, -1, -1,
+ 116, -1, -1, -1, 120, 3, 4, 5, 6, 7,
+ -1, 9, -1, 129, -1, 13, 14, 15, 16, 17,
+ 18, 19, 20, 21, 22, 23, 24, 25, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, -1, -1, -1, -1, -1,
- 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
- 77, -1, 79, 80, 81, 82, 83, 84, -1, -1,
- 87, -1, 89, -1, -1, 34, -1, -1, -1, 127,
- 97, 98, 99, 100, 101, 102, -1, 104, -1, -1,
- -1, 108, -1, -1, 111, -1, -1, -1, -1, 116,
- -1, 3, 4, 120, 6, 7, 31, -1, 125, -1,
- 127, -1, 14, 15, 16, 17, 18, 19, 20, 21,
- 22, 23, 24, 25, -1, -1, -1, 3, 4, -1,
- 6, 7, 91, 92, 93, 94, 95, 96, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
- -1, -1, -1, -1, 113, 114, 115, 116, 117, 118,
- 119, -1, 121, -1, -1, -1, 91, 92, 93, 94,
- 95, 96, -1, -1, -1, 77, -1, -1, -1, -1,
- -1, 83, 84, -1, -1, 87, -1, 89, 113, 114,
- 115, 116, 117, 118, 119, -1, 121, -1, -1, -1,
- 102, 77, 104, -1, -1, -1, 108, 83, 84, -1,
- -1, 87, -1, 89, -1, -1, -1, -1, -1, -1,
- 122, -1, -1, 125, -1, 127, 102, -1, 104, -1,
- -1, -1, 108, 3, 4, 5, 6, -1, -1, 9,
- 10, 11, 12, 13, 14, 15, 16, 17, -1, 125,
- -1, 127, -1, -1, -1, -1, 26, 27, 28, 29,
- 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, -1, -1, -1, -1, -1,
- 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
- 60, 61, -1, -1, -1, -1, -1, 67, 68, 69,
- 70, 71, 72, 73, 74, 75, 76, -1, -1, 79,
- 80, 81, 82, -1, -1, 85, 86, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 97, 98, 99,
- 100, 101, -1, -1, -1, 105, 106, 107, 108, -1,
- -1, 111, 3, 4, 5, 6, 116, -1, 9, -1,
- 120, -1, 13, -1, -1, 16, 17, 91, 92, 93,
+ -1, -1, 50, 51, 52, 53, 54, 55, 56, 57,
+ 58, 59, 60, 61, -1, -1, -1, -1, -1, 67,
+ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
+ -1, 79, 80, 81, 82, 83, 84, -1, -1, 87,
+ -1, 89, -1, -1, -1, -1, -1, -1, -1, 97,
+ 98, 99, 100, 101, 102, 45, 104, -1, 48, -1,
+ 108, -1, -1, 111, -1, -1, -1, -1, 116, -1,
+ 3, 4, 120, 6, 7, 31, -1, 125, -1, 127,
+ -1, 14, 15, 16, 17, 18, 19, 20, 21, 22,
+ 23, 24, 25, -1, -1, -1, 3, 4, -1, 6,
+ 7, 91, 92, 93, 94, 95, 96, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, -1,
+ -1, -1, 112, 113, 114, 115, 116, 117, 118, 119,
+ -1, 121, -1, -1, -1, 91, 92, 93, 94, 95,
+ 96, -1, -1, -1, 77, -1, -1, -1, -1, -1,
+ 83, 84, -1, -1, 87, -1, 89, 113, 114, 115,
+ 116, 117, 118, 119, -1, 121, -1, -1, -1, 102,
+ 77, 104, -1, -1, -1, 108, 83, 84, -1, -1,
+ 87, -1, 89, -1, -1, -1, -1, -1, -1, 122,
+ -1, -1, 125, -1, 127, 102, -1, 104, -1, -1,
+ -1, 108, 3, 4, 5, 6, -1, -1, 9, 10,
+ 11, 12, 13, 14, 15, 16, 17, -1, 125, -1,
+ 127, -1, -1, -1, -1, 26, 27, 28, 29, 30,
+ 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, -1, -1, -1, -1, -1, 50,
+ 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
+ 61, -1, -1, -1, -1, -1, 67, 68, 69, 70,
+ 71, 72, 73, 74, 75, 76, -1, -1, 79, 80,
+ 81, 82, -1, -1, 85, 86, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 97, 98, 99, 100,
+ 101, -1, -1, -1, 105, 106, 107, 108, -1, -1,
+ 111, 3, 4, 5, 6, 116, -1, 9, -1, 120,
+ -1, 13, -1, -1, 16, 17, 91, 92, 93, 94,
+ 95, 96, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 112, 113, 114,
+ 115, 116, 117, 118, 119, -1, 121, -1, 50, 51,
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+ -1, 93, 94, 95, 96, 67, 68, 69, 70, 71,
+ 72, 73, 74, 75, 76, -1, -1, 79, 80, 81,
+ 82, 113, 114, 115, 116, 117, 118, 119, -1, 121,
+ -1, -1, -1, -1, -1, 97, 98, 99, 100, 101,
+ -1, -1, 3, 4, 5, 6, 108, -1, 9, 111,
+ -1, -1, 13, -1, 116, 16, 17, 91, 120, 93,
94, 95, 96, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 112, 113,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 113,
114, 115, 116, 117, 118, 119, -1, 121, -1, 50,
51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
- 61, -1, 93, 94, 95, 96, 67, 68, 69, 70,
+ 61, -1, -1, -1, -1, -1, 67, 68, 69, 70,
71, 72, 73, 74, 75, 76, -1, -1, 79, 80,
- 81, 82, 113, 114, 115, 116, 117, 118, 119, -1,
- 121, -1, -1, -1, -1, -1, 97, 98, 99, 100,
- 101, -1, -1, 3, 4, 5, 6, 108, -1, 9,
- 111, 95, 96, 13, -1, 116, 16, 17, 91, 120,
- 93, 94, 95, 96, -1, -1, -1, -1, -1, 113,
- 114, 115, 116, 117, 118, 119, -1, 121, -1, -1,
- 113, 114, 115, 116, 117, 118, 119, -1, 121, -1,
+ 81, 82, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 97, 98, 99, 100,
+ 101, -1, -1, 3, 4, 5, -1, 108, -1, 9,
+ 111, -1, -1, 13, -1, 116, 16, 17, -1, 120,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 6, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
60, 61, -1, -1, -1, -1, -1, 67, 68, 69,
70, 71, 72, 73, 74, 75, 76, -1, -1, 79,
80, 81, 82, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 97, 98, 99,
- 100, 101, -1, -1, 3, 4, 5, -1, 108, -1,
- 9, 111, -1, -1, 13, -1, 116, 16, 17, -1,
- 120, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 6,
+ 100, 101, -1, -1, -1, -1, -1, -1, 3, 4,
+ 5, 111, -1, -1, 9, -1, 116, 117, 13, -1,
+ 120, 16, 17, 91, 92, 93, 94, 95, 96, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 50, 51, 52, 53, 54, 55, 56, 57, 58,
- 59, 60, 61, -1, -1, -1, -1, -1, 67, 68,
- 69, 70, 71, 72, 73, 74, 75, 76, -1, -1,
- 79, 80, 81, 82, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 97, 98,
- 99, 100, 101, -1, -1, -1, -1, -1, -1, 3,
- 4, 5, 111, -1, -1, 9, -1, 116, 117, 13,
- -1, 120, 16, 17, 91, 92, 93, 94, 95, 96,
+ 108, -1, -1, -1, -1, 113, 114, 115, 116, 117,
+ 118, 119, -1, 121, -1, 50, 51, 52, 53, 54,
+ 55, 56, 57, 58, 59, 60, 61, -1, -1, -1,
+ -1, -1, 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, -1, -1, 79, 80, 81, 82, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 97, 98, 99, 100, 101, -1, -1, 3,
+ 4, 5, -1, -1, -1, 9, 111, -1, -1, 13,
+ -1, 116, 16, 17, -1, 120, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 108, -1, -1, -1, -1, 113, 114, 115, 116,
- 117, 118, 119, -1, 121, -1, 50, 51, 52, 53,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 50, 51, 52, 53,
54, 55, 56, 57, 58, 59, 60, 61, -1, -1,
-1, -1, -1, 67, 68, 69, 70, 71, 72, 73,
74, 75, 76, -1, -1, 79, 80, 81, 82, -1,
@@ -781,85 +905,73 @@ static const short yycheck[] = { 23,
53, 54, 55, 56, 57, 58, 59, 60, 61, -1,
-1, -1, -1, -1, 67, 68, 69, 70, 71, 72,
73, 74, 75, 76, -1, -1, 79, 80, 81, 82,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 3, 4, 5, -1, -1, -1, 9, -1, -1, -1,
+ 13, -1, -1, -1, 97, 98, 99, 100, 101, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 111, -1,
+ -1, -1, -1, 116, -1, -1, -1, 120, -1, -1,
+ -1, -1, 45, -1, -1, -1, -1, 50, 51, 52,
+ 53, 54, 55, 56, 57, 58, 59, 60, 61, -1,
+ -1, -1, -1, -1, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, -1, -1, 79, 80, 81, 82,
+ 3, 4, 5, -1, -1, -1, 9, -1, -1, -1,
+ 13, -1, -1, -1, 97, 98, 99, 100, 101, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 111, -1,
+ -1, -1, -1, 116, -1, -1, -1, 120, -1, -1,
+ -1, -1, 45, -1, -1, -1, -1, 50, 51, 52,
+ 53, 54, 55, 56, 57, 58, 59, 60, 61, -1,
+ -1, -1, -1, -1, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, -1, -1, 79, 80, 81, 82,
+ 3, 4, 5, -1, -1, -1, 9, -1, -1, -1,
+ 13, -1, -1, -1, 97, 98, 99, 100, 101, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 111, -1,
+ -1, -1, -1, 116, -1, -1, -1, 120, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 50, 51, 52,
+ 53, 54, 55, 56, 57, 58, 59, 60, 61, -1,
+ -1, -1, -1, -1, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, -1, -1, 79, 80, 81, 82,
+ -1, -1, -1, 16, 17, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 97, 98, 99, 100, 101, -1,
- -1, 3, 4, 5, -1, -1, -1, 9, 111, -1,
- -1, 13, -1, 116, 16, 17, -1, 120, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 111, -1,
+ -1, -1, -1, 116, -1, -1, -1, 120, 51, 52,
+ 53, 54, 55, 56, 57, 58, 59, 60, 61, 91,
+ 92, 93, 94, 95, 96, 16, 17, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 79, 80, 81, 82,
+ 112, 113, 114, 115, 116, 117, 118, 119, -1, 121,
+ -1, -1, -1, -1, 97, 98, 99, 100, 101, -1,
+ 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
+ 61, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+ 60, 61, -1, -1, -1, -1, -1, 130, 79, 80,
+ 81, 82, -1, -1, -1, -1, -1, -1, -1, 79,
+ 80, 81, 82, -1, -1, -1, 97, 98, 99, 100,
+ 101, -1, -1, -1, -1, -1, -1, 97, 98, 99,
+ 100, 101, -1, -1, -1, -1, -1, -1, -1, -1,
+ 91, 92, 93, 94, 95, 96, -1, -1, -1, 130,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 130, 112, 113, 114, 115, 116, 117, 118, 119, -1,
+ 121, 91, 92, 93, 94, 95, 96, -1, 129, -1,
+ 91, 92, 93, 94, 95, 96, -1, -1, -1, -1,
+ -1, -1, -1, 113, 114, 115, 116, 117, 118, 119,
+ -1, 121, 113, 114, 115, 116, 117, 118, 119, 129,
+ 121, 91, 92, 93, 94, 95, 96, -1, 129, -1,
+ 91, 92, 93, 94, 95, 96, -1, -1, -1, -1,
+ -1, -1, -1, 113, 114, 115, 116, 117, 118, 119,
+ -1, 121, 113, 114, 115, 116, 117, 118, 119, 129,
+ 121, 91, 92, 93, 94, 95, 96, -1, 129, -1,
+ 91, 92, 93, 94, 95, 96, -1, -1, -1, -1,
+ -1, -1, -1, 113, 114, 115, 116, 117, 118, 119,
+ -1, 121, 113, 114, 115, 116, 117, 118, 119, 129,
+ 121, 91, 92, 93, 94, 95, 96, -1, 129, -1,
+ 91, 92, 93, 94, 95, 96, -1, -1, -1, -1,
+ -1, -1, -1, 113, 114, 115, 116, 117, 118, 119,
+ -1, 121, 113, 114, 115, 116, 117, 118, 119, 129,
+ 121, 91, 92, 93, 94, 95, 96, -1, 129, -1,
+ 91, 92, 93, 94, 95, 96, -1, -1, -1, -1,
+ -1, -1, -1, 113, 114, 115, 116, 117, 118, 119,
+ -1, 121, 113, 114, 115, 116, 117, 118, 119, 129,
+ 121, 91, 92, 93, 94, 95, 96, -1, 129, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 50, 51,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- -1, -1, -1, -1, -1, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, -1, -1, 79, 80, 81,
- 82, 3, 4, 5, -1, -1, -1, 9, -1, -1,
- -1, 13, -1, -1, -1, 97, 98, 99, 100, 101,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 111,
- -1, -1, -1, -1, 116, -1, -1, -1, 120, -1,
- -1, -1, -1, 45, -1, -1, -1, -1, 50, 51,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- -1, -1, -1, -1, -1, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, -1, -1, 79, 80, 81,
- 82, 3, 4, 5, -1, -1, -1, 9, -1, -1,
- -1, 13, -1, -1, -1, 97, 98, 99, 100, 101,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 111,
- -1, -1, -1, -1, 116, -1, -1, -1, 120, -1,
- -1, -1, -1, 45, -1, -1, -1, -1, 50, 51,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- -1, -1, -1, -1, -1, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, -1, -1, 79, 80, 81,
- 82, 3, 4, 5, -1, -1, -1, 9, -1, -1,
- -1, 13, -1, -1, -1, 97, 98, 99, 100, 101,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 111,
- -1, -1, -1, -1, 116, -1, -1, -1, 120, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 50, 51,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- -1, -1, -1, -1, -1, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, -1, -1, 79, 80, 81,
- 82, -1, -1, -1, 16, 17, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 97, 98, 99, 100, 101,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 111,
- -1, -1, -1, -1, 116, -1, -1, -1, 120, 51,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- 91, 92, 93, 94, 95, 96, 16, 17, 45, -1,
- -1, 48, -1, -1, -1, -1, -1, 79, 80, 81,
- 82, 112, 113, 114, 115, 116, 117, 118, 119, -1,
- 121, -1, -1, -1, -1, 97, 98, 99, 100, 101,
- -1, 51, 52, 53, 54, 55, 56, 57, 58, 59,
- 60, 61, -1, -1, 91, 92, 93, 94, 95, 96,
- 45, -1, -1, 48, -1, -1, -1, -1, 130, 79,
- 80, 81, 82, -1, -1, 112, 113, 114, 115, 116,
- 117, 118, 119, -1, 121, -1, -1, 97, 98, 99,
- 100, 101, 129, 51, 52, 53, 54, 55, 56, 57,
- 58, 59, 60, 61, -1, -1, 91, 92, 93, 94,
- 95, 96, -1, -1, -1, -1, -1, -1, -1, -1,
- 130, 79, 80, 81, 82, -1, -1, 112, 113, 114,
- 115, 116, 117, 118, 119, -1, 121, -1, -1, 97,
- 98, 99, 100, 101, -1, -1, -1, -1, -1, -1,
- -1, -1, 91, 92, 93, 94, 95, 96, -1, -1,
- -1, 91, 92, 93, 94, 95, 96, -1, -1, -1,
- -1, -1, 130, 112, 113, 114, 115, 116, 117, 118,
- 119, -1, 121, 113, 114, 115, 116, 117, 118, 119,
- 129, 121, 91, 92, 93, 94, 95, 96, -1, 129,
- -1, 91, 92, 93, 94, 95, 96, -1, -1, -1,
- -1, -1, -1, -1, 113, 114, 115, 116, 117, 118,
- 119, -1, 121, 113, 114, 115, 116, 117, 118, 119,
- 129, 121, 91, 92, 93, 94, 95, 96, -1, 129,
- -1, 91, 92, 93, 94, 95, 96, -1, -1, -1,
- -1, -1, -1, -1, 113, 114, 115, 116, 117, 118,
- 119, -1, 121, 113, 114, 115, 116, 117, 118, 119,
- 129, 121, 91, 92, 93, 94, 95, 96, -1, 129,
- -1, 91, 92, 93, 94, 95, 96, -1, -1, -1,
- -1, -1, -1, -1, 113, 114, 115, 116, 117, 118,
- 119, -1, 121, 113, 114, 115, 116, 117, 118, 119,
- 129, 121, 91, 92, 93, 94, 95, 96, -1, 129,
- -1, 91, 92, 93, 94, 95, 96, -1, -1, -1,
- -1, -1, -1, -1, 113, 114, 115, 116, 117, 118,
- 119, -1, 121, 113, 114, 115, 116, 117, 118, 119,
- 129, 121, 91, 92, 93, 94, 95, 96, -1, 129,
- -1, 91, 92, 93, 94, 95, 96, -1, -1, -1,
- -1, -1, -1, -1, 113, 114, 115, 116, 117, 118,
- 119, -1, 121, 113, 114, 115, 116, 117, 118, 119,
- 129, 121, 91, 92, 93, 94, 95, 96, -1, 129,
+ -1, -1, -1, 113, 114, 115, 116, 117, 118, 119,
+ -1, 121, 91, 92, 93, 94, 95, 96, -1, 129,
-1, -1, 91, 92, 93, 94, 95, 96, -1, -1,
-1, -1, -1, 112, 113, 114, 115, 116, 117, 118,
119, -1, 121, 112, 113, 114, 115, 116, 117, 118,
@@ -868,8 +980,6 @@ static const short yycheck[] = { 23,
-1, -1, -1, -1, -1, 113, 114, 115, 116, 117,
118, 119, -1, 121
};
-#define YYPURE 1
-
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/local/lib/bison.simple"
@@ -891,15 +1001,19 @@ static const short yycheck[] = { 23,
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#ifdef __GNUC__
#ifndef alloca
+#ifdef __GNUC__
#define alloca __builtin_alloca
-#endif /* Not alloca. */
#else /* Not GNU C. */
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__)
#include <alloca.h>
-#endif /* Sparc. */
+#else /* Not sparc */
+#ifdef MSDOS
+#include <malloc.h>
+#endif /* MSDOS */
+#endif /* Not sparc. */
#endif /* Not GNU C. */
+#endif /* alloca not defined. */
/* This is the parser code that is written into each bison parser
when the %semantic_parser declaration is not specified in the grammar.
@@ -938,17 +1052,21 @@ while (0)
#define YYTERROR 1
#define YYERRCODE 256
-#ifndef YYIMPURE
+#ifndef YYPURE
#define YYLEX yylex()
#endif
-#ifndef YYPURE
+#ifdef YYPURE
+#ifdef YYLSP_NEEDED
#define YYLEX yylex(&yylval, &yylloc)
+#else
+#define YYLEX yylex(&yylval)
+#endif
#endif
/* If nonreentrant, generate the variables here */
-#ifndef YYIMPURE
+#ifndef YYPURE
int yychar; /* the lookahead symbol */
YYSTYPE yylval; /* the semantic value of the */
@@ -960,7 +1078,7 @@ YYLTYPE yylloc; /* location data for the lookahead */
#endif
int yynerrs; /* number of parse errors so far */
-#endif /* YYIMPURE */
+#endif /* not YYPURE */
#if YYDEBUG != 0
int yydebug; /* nonzero means print parse trace */
@@ -984,18 +1102,16 @@ int yydebug; /* nonzero means print parse trace */
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 10000
#endif
+
+#ifndef __cplusplus
/* This is the most reliable way to avoid incompatibilities
in available built-in functions on various systems. */
static void
-#ifdef __cplusplus
-__yy_bcopy (char *from, char *to, int count)
-#else
__yy_bcopy (from, to, count)
char *from;
char *to;
int count;
-#endif
{
register char *f = from;
register char *t = to;
@@ -1005,7 +1121,24 @@ __yy_bcopy (from, to, count)
*t++ = *f++;
}
-#line 137 "/usr/local/lib/bison.simple"
+#else /* __cplusplus */
+
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+static void
+__yy_bcopy (char *from, char *to, int count)
+{
+ register char *f = from;
+ register char *t = to;
+ register int i = count;
+
+ while (i-- > 0)
+ *t++ = *f++;
+}
+
+#endif
+
+#line 160 "/usr/local/lib/bison.simple"
int
yyparse()
{
@@ -1034,7 +1167,7 @@ yyparse()
int yystacksize = YYINITDEPTH;
-#ifndef YYPURE
+#ifdef YYPURE
int yychar;
YYSTYPE yylval;
int yynerrs;
@@ -1255,12 +1388,15 @@ yyreduce:
#if YYDEBUG != 0
if (yydebug)
{
- if (yylen == 1)
- fprintf (stderr, "Reducing 1 value via rule %d (line %d), ",
- yyn, yyrline[yyn]);
- else
- fprintf (stderr, "Reducing %d values via rule %d (line %d), ",
- yylen, yyn, yyrline[yyn]);
+ int i;
+
+ fprintf (stderr, "Reducing via rule %d (line %d), ",
+ yyn, yyrline[yyn]);
+
+ /* Print the symboles being reduced, and their result. */
+ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
+ fprintf (stderr, "%s ", yytname[yyrhs[i]]);
+ fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
}
#endif
@@ -1268,49 +1404,49 @@ yyreduce:
switch (yyn) {
case 2:
-#line 266 "pic.y"
+#line 268 "pic.y"
{
if (olist.head)
print_picture(olist.head);
;
break;}
case 3:
-#line 275 "pic.y"
+#line 277 "pic.y"
{ yyval.pl = yyvsp[-1].pl; ;
break;}
case 4:
-#line 280 "pic.y"
+#line 282 "pic.y"
{ yyval.pl = yyvsp[0].pl; ;
break;}
case 5:
-#line 282 "pic.y"
+#line 284 "pic.y"
{ yyval.pl = yyvsp[-2].pl; ;
break;}
case 10:
-#line 297 "pic.y"
+#line 299 "pic.y"
{
define_variable(yyvsp[-2].str, yyvsp[0].x);
delete yyvsp[-2].str;
;
break;}
case 11:
-#line 302 "pic.y"
+#line 304 "pic.y"
{ current_direction = UP_DIRECTION; ;
break;}
case 12:
-#line 304 "pic.y"
+#line 306 "pic.y"
{ current_direction = DOWN_DIRECTION; ;
break;}
case 13:
-#line 306 "pic.y"
+#line 308 "pic.y"
{ current_direction = LEFT_DIRECTION; ;
break;}
case 14:
-#line 308 "pic.y"
+#line 310 "pic.y"
{ current_direction = RIGHT_DIRECTION; ;
break;}
case 15:
-#line 310 "pic.y"
+#line 312 "pic.y"
{
olist.append(make_command_object(yyvsp[0].lstr.str,
yyvsp[0].lstr.filename,
@@ -1318,14 +1454,14 @@ case 15:
;
break;}
case 16:
-#line 316 "pic.y"
+#line 318 "pic.y"
{
fprintf(stderr, "%g\n", yyvsp[0].x);
fflush(stderr);
;
break;}
case 17:
-#line 321 "pic.y"
+#line 323 "pic.y"
{
fprintf(stderr, "%s\n", yyvsp[0].lstr.str);
delete yyvsp[0].lstr.str;
@@ -1333,18 +1469,18 @@ case 17:
;
break;}
case 18:
-#line 327 "pic.y"
+#line 329 "pic.y"
{
fprintf(stderr, "%g, %g\n", yyvsp[0].pair.x, yyvsp[0].pair.y);
fflush(stderr);
;
break;}
case 19:
-#line 332 "pic.y"
+#line 334 "pic.y"
{ delim_flag = 1; ;
break;}
case 20:
-#line 334 "pic.y"
+#line 336 "pic.y"
{
delim_flag = 0;
system(yyvsp[0].str);
@@ -1352,7 +1488,7 @@ case 20:
;
break;}
case 21:
-#line 340 "pic.y"
+#line 342 "pic.y"
{
if (yychar < 0)
do_lookahead();
@@ -1361,15 +1497,15 @@ case 21:
;
break;}
case 22:
-#line 347 "pic.y"
+#line 349 "pic.y"
{ delim_flag = 2; ;
break;}
case 23:
-#line 349 "pic.y"
+#line 351 "pic.y"
{ delim_flag = 0; ;
break;}
case 24:
-#line 351 "pic.y"
+#line 353 "pic.y"
{
if (yychar < 0)
do_lookahead();
@@ -1380,15 +1516,15 @@ case 24:
;
break;}
case 25:
-#line 360 "pic.y"
+#line 362 "pic.y"
{ delim_flag = 2; ;
break;}
case 26:
-#line 362 "pic.y"
+#line 364 "pic.y"
{ delim_flag = 0; ;
break;}
case 27:
-#line 364 "pic.y"
+#line 366 "pic.y"
{
if (yychar < 0)
do_lookahead();
@@ -1398,11 +1534,11 @@ case 27:
;
break;}
case 28:
-#line 372 "pic.y"
+#line 374 "pic.y"
{ delim_flag = 1; ;
break;}
case 29:
-#line 374 "pic.y"
+#line 376 "pic.y"
{
delim_flag = 0;
if (yychar < 0)
@@ -1411,7 +1547,7 @@ case 29:
;
break;}
case 30:
-#line 381 "pic.y"
+#line 383 "pic.y"
{
if (yychar < 0)
do_lookahead();
@@ -1421,11 +1557,11 @@ case 30:
;
break;}
case 31:
-#line 389 "pic.y"
+#line 391 "pic.y"
{ delim_flag = 1; ;
break;}
case 32:
-#line 391 "pic.y"
+#line 393 "pic.y"
{
delim_flag = 0;
if (yychar < 0)
@@ -1439,43 +1575,43 @@ case 32:
;
break;}
case 34:
-#line 404 "pic.y"
+#line 406 "pic.y"
{ define_variable("scale", 1.0); ;
break;}
case 35:
-#line 409 "pic.y"
+#line 411 "pic.y"
{ reset(yyvsp[0].str); delete yyvsp[0].str; ;
break;}
case 36:
-#line 411 "pic.y"
+#line 413 "pic.y"
{ reset(yyvsp[0].str); delete yyvsp[0].str; ;
break;}
case 37:
-#line 413 "pic.y"
+#line 415 "pic.y"
{ reset(yyvsp[0].str); delete yyvsp[0].str; ;
break;}
case 38:
-#line 418 "pic.y"
+#line 420 "pic.y"
{ delim_flag = 1; ;
break;}
case 39:
-#line 420 "pic.y"
+#line 422 "pic.y"
{ delim_flag = 0; yyval.if_data.x = yyvsp[-3].x; yyval.if_data.body = yyvsp[0].str; ;
break;}
case 40:
-#line 425 "pic.y"
+#line 427 "pic.y"
{ yyval.str = 0; ;
break;}
case 41:
-#line 427 "pic.y"
+#line 429 "pic.y"
{ yyval.str = yyvsp[0].lstr.str; ;
break;}
case 42:
-#line 432 "pic.y"
+#line 434 "pic.y"
{ yyval.x = yyvsp[0].x; ;
break;}
case 43:
-#line 434 "pic.y"
+#line 436 "pic.y"
{
yyval.x = strcmp(yyvsp[-2].lstr.str, yyvsp[0].lstr.str) == 0;
delete yyvsp[-2].lstr.str;
@@ -1483,7 +1619,7 @@ case 43:
;
break;}
case 44:
-#line 440 "pic.y"
+#line 442 "pic.y"
{
yyval.x = strcmp(yyvsp[-2].lstr.str, yyvsp[0].lstr.str) != 0;
delete yyvsp[-2].lstr.str;
@@ -1491,19 +1627,19 @@ case 44:
;
break;}
case 45:
-#line 448 "pic.y"
+#line 450 "pic.y"
{ yyval.by.val = 1.0; yyval.by.is_multiplicative = 0; ;
break;}
case 46:
-#line 450 "pic.y"
+#line 452 "pic.y"
{ yyval.by.val = yyvsp[0].x; yyval.by.is_multiplicative = 0; ;
break;}
case 47:
-#line 452 "pic.y"
+#line 454 "pic.y"
{ yyval.by.val = yyvsp[0].x; yyval.by.is_multiplicative = 1; ;
break;}
case 48:
-#line 457 "pic.y"
+#line 459 "pic.y"
{
yyval.pl.obj = yyvsp[0].spec->make_object(&current_position,
&current_direction);
@@ -1519,11 +1655,11 @@ case 48:
;
break;}
case 49:
-#line 471 "pic.y"
+#line 473 "pic.y"
{ yyval.pl = yyvsp[0].pl; define_label(yyvsp[-3].str, & yyval.pl); delete yyvsp[-3].str; ;
break;}
case 50:
-#line 473 "pic.y"
+#line 475 "pic.y"
{
yyval.pl.obj = 0;
yyval.pl.x = yyvsp[0].pair.x;
@@ -1533,7 +1669,7 @@ case 50:
;
break;}
case 51:
-#line 481 "pic.y"
+#line 483 "pic.y"
{
yyval.pl = yyvsp[0].pl;
define_label(yyvsp[-3].str, & yyval.pl);
@@ -1541,7 +1677,7 @@ case 51:
;
break;}
case 52:
-#line 487 "pic.y"
+#line 489 "pic.y"
{
yyval.state.x = current_position.x;
yyval.state.y = current_position.y;
@@ -1549,49 +1685,62 @@ case 52:
;
break;}
case 53:
-#line 493 "pic.y"
+#line 495 "pic.y"
{
current_position.x = yyvsp[-2].state.x;
current_position.y = yyvsp[-2].state.y;
current_direction = yyvsp[-2].state.dir;
- yyval.pl = yyvsp[-1].pl;
;
break;}
case 54:
-#line 500 "pic.y"
+#line 501 "pic.y"
+{
+ yyval.pl = yyvsp[-3].pl;
+ ;
+ break;}
+case 55:
+#line 505 "pic.y"
{
yyval.pl.obj = 0;
yyval.pl.x = current_position.x;
yyval.pl.y = current_position.y;
;
break;}
-case 55:
-#line 509 "pic.y"
+case 56:
+#line 514 "pic.y"
+{;
+ break;}
+case 57:
+#line 516 "pic.y"
+{;
+ break;}
+case 58:
+#line 521 "pic.y"
{
yyval.spec = new object_spec(BOX_OBJECT);
;
break;}
-case 56:
-#line 513 "pic.y"
+case 59:
+#line 525 "pic.y"
{
yyval.spec = new object_spec(CIRCLE_OBJECT);
;
break;}
-case 57:
-#line 517 "pic.y"
+case 60:
+#line 529 "pic.y"
{
yyval.spec = new object_spec(ELLIPSE_OBJECT);
;
break;}
-case 58:
-#line 521 "pic.y"
+case 61:
+#line 533 "pic.y"
{
yyval.spec = new object_spec(ARC_OBJECT);
yyval.spec->dir = current_direction;
;
break;}
-case 59:
-#line 526 "pic.y"
+case 62:
+#line 538 "pic.y"
{
yyval.spec = new object_spec(LINE_OBJECT);
lookup_variable("lineht", & yyval.spec->segment_height);
@@ -1599,8 +1748,8 @@ case 59:
yyval.spec->dir = current_direction;
;
break;}
-case 60:
-#line 533 "pic.y"
+case 63:
+#line 545 "pic.y"
{
yyval.spec = new object_spec(ARROW_OBJECT);
lookup_variable("lineht", & yyval.spec->segment_height);
@@ -1608,8 +1757,8 @@ case 60:
yyval.spec->dir = current_direction;
;
break;}
-case 61:
-#line 540 "pic.y"
+case 64:
+#line 552 "pic.y"
{
yyval.spec = new object_spec(MOVE_OBJECT);
lookup_variable("moveht", & yyval.spec->segment_height);
@@ -1617,8 +1766,8 @@ case 61:
yyval.spec->dir = current_direction;
;
break;}
-case 62:
-#line 547 "pic.y"
+case 65:
+#line 559 "pic.y"
{
yyval.spec = new object_spec(SPLINE_OBJECT);
lookup_variable("lineht", & yyval.spec->segment_height);
@@ -1626,22 +1775,22 @@ case 62:
yyval.spec->dir = current_direction;
;
break;}
-case 63:
-#line 554 "pic.y"
+case 66:
+#line 566 "pic.y"
{
yyval.spec = new object_spec(TEXT_OBJECT);
yyval.spec->text = new text_item(yyvsp[0].lstr.str, yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno);
;
break;}
-case 64:
-#line 559 "pic.y"
+case 67:
+#line 571 "pic.y"
{
yyval.spec = new object_spec(TEXT_OBJECT);
yyval.spec->text = new text_item(format_number(0, yyvsp[0].x), 0, -1);
;
break;}
-case 65:
-#line 564 "pic.y"
+case 68:
+#line 576 "pic.y"
{
yyval.spec = new object_spec(TEXT_OBJECT);
yyval.spec->text = new text_item(format_number(yyvsp[0].lstr.str, yyvsp[-1].x),
@@ -1649,8 +1798,8 @@ case 65:
delete yyvsp[0].lstr.str;
;
break;}
-case 66:
-#line 571 "pic.y"
+case 69:
+#line 583 "pic.y"
{
saved_state *p = new saved_state;
yyval.pstate = p;
@@ -1666,8 +1815,8 @@ case 66:
olist.append(make_mark_object());
;
break;}
-case 67:
-#line 586 "pic.y"
+case 70:
+#line 598 "pic.y"
{
current_position.x = yyvsp[-2].pstate->x;
current_position.y = yyvsp[-2].pstate->y;
@@ -1680,40 +1829,40 @@ case 67:
delete yyvsp[-2].pstate;
;
break;}
-case 68:
-#line 598 "pic.y"
+case 71:
+#line 610 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->height = yyvsp[0].x;
yyval.spec->flags |= HAS_HEIGHT;
;
break;}
-case 69:
-#line 604 "pic.y"
+case 72:
+#line 616 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->radius = yyvsp[0].x;
yyval.spec->flags |= HAS_RADIUS;
;
break;}
-case 70:
-#line 610 "pic.y"
+case 73:
+#line 622 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->width = yyvsp[0].x;
yyval.spec->flags |= HAS_WIDTH;
;
break;}
-case 71:
-#line 616 "pic.y"
+case 74:
+#line 628 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->radius = yyvsp[0].x/2.0;
yyval.spec->flags |= HAS_RADIUS;
;
break;}
-case 72:
-#line 622 "pic.y"
+case 75:
+#line 634 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= HAS_SEGMENT;
@@ -1733,8 +1882,8 @@ case 72:
}
;
break;}
-case 73:
-#line 641 "pic.y"
+case 76:
+#line 653 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->dir = UP_DIRECTION;
@@ -1742,8 +1891,8 @@ case 73:
yyval.spec->segment_pos.y += yyval.spec->segment_height;
;
break;}
-case 74:
-#line 648 "pic.y"
+case 77:
+#line 660 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->dir = UP_DIRECTION;
@@ -1751,8 +1900,8 @@ case 74:
yyval.spec->segment_pos.y += yyvsp[0].x;
;
break;}
-case 75:
-#line 655 "pic.y"
+case 78:
+#line 667 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->dir = DOWN_DIRECTION;
@@ -1760,8 +1909,8 @@ case 75:
yyval.spec->segment_pos.y -= yyval.spec->segment_height;
;
break;}
-case 76:
-#line 662 "pic.y"
+case 79:
+#line 674 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->dir = DOWN_DIRECTION;
@@ -1769,8 +1918,8 @@ case 76:
yyval.spec->segment_pos.y -= yyvsp[0].x;
;
break;}
-case 77:
-#line 669 "pic.y"
+case 80:
+#line 681 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->dir = RIGHT_DIRECTION;
@@ -1778,8 +1927,8 @@ case 77:
yyval.spec->segment_pos.x += yyval.spec->segment_width;
;
break;}
-case 78:
-#line 676 "pic.y"
+case 81:
+#line 688 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->dir = RIGHT_DIRECTION;
@@ -1787,8 +1936,8 @@ case 78:
yyval.spec->segment_pos.x += yyvsp[0].x;
;
break;}
-case 79:
-#line 683 "pic.y"
+case 82:
+#line 695 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->dir = LEFT_DIRECTION;
@@ -1796,8 +1945,8 @@ case 79:
yyval.spec->segment_pos.x -= yyval.spec->segment_width;
;
break;}
-case 80:
-#line 690 "pic.y"
+case 83:
+#line 702 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->dir = LEFT_DIRECTION;
@@ -1805,8 +1954,8 @@ case 80:
yyval.spec->segment_pos.x -= yyvsp[0].x;
;
break;}
-case 81:
-#line 697 "pic.y"
+case 84:
+#line 709 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->flags |= HAS_FROM;
@@ -1814,8 +1963,8 @@ case 81:
yyval.spec->from.y = yyvsp[0].pair.y;
;
break;}
-case 82:
-#line 704 "pic.y"
+case 85:
+#line 716 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
if (yyval.spec->flags & HAS_SEGMENT)
@@ -1831,8 +1980,8 @@ case 82:
yyval.spec->to.y = yyvsp[0].pair.y;
;
break;}
-case 83:
-#line 719 "pic.y"
+case 86:
+#line 731 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->flags |= HAS_AT;
@@ -1845,16 +1994,16 @@ case 83:
}
;
break;}
-case 84:
-#line 731 "pic.y"
+case 87:
+#line 743 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->flags |= HAS_WITH;
yyval.spec->with = yyvsp[0].pth;
;
break;}
-case 85:
-#line 737 "pic.y"
+case 88:
+#line 749 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->flags |= HAS_SEGMENT;
@@ -1862,8 +2011,8 @@ case 85:
yyval.spec->segment_pos.y += yyvsp[0].pair.y;
;
break;}
-case 86:
-#line 744 "pic.y"
+case 89:
+#line 756 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
if (yyval.spec->flags & HAS_SEGMENT) {
@@ -1876,55 +2025,55 @@ case 86:
}
;
break;}
-case 87:
-#line 756 "pic.y"
+case 90:
+#line 768 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= IS_DOTTED;
lookup_variable("dashwid", & yyval.spec->dash_width);
;
break;}
-case 88:
-#line 762 "pic.y"
+case 91:
+#line 774 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->flags |= IS_DOTTED;
yyval.spec->dash_width = yyvsp[0].x;
;
break;}
-case 89:
-#line 768 "pic.y"
+case 92:
+#line 780 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= IS_DASHED;
lookup_variable("dashwid", & yyval.spec->dash_width);
;
break;}
-case 90:
-#line 774 "pic.y"
+case 93:
+#line 786 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->flags |= IS_DASHED;
yyval.spec->dash_width = yyvsp[0].x;
;
break;}
-case 91:
-#line 780 "pic.y"
+case 94:
+#line 792 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= IS_DEFAULT_FILLED;
;
break;}
-case 92:
-#line 785 "pic.y"
+case 95:
+#line 797 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->flags |= IS_FILLED;
yyval.spec->fill = yyvsp[0].x;
;
break;}
-case 93:
-#line 791 "pic.y"
+case 96:
+#line 803 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
// line chop chop means line chop 0 chop 0
@@ -1941,8 +2090,8 @@ case 93:
}
;
break;}
-case 94:
-#line 807 "pic.y"
+case 97:
+#line 819 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
if (yyval.spec->flags & IS_DEFAULT_CHOPPED) {
@@ -1960,57 +2109,57 @@ case 94:
}
;
break;}
-case 95:
-#line 824 "pic.y"
+case 98:
+#line 836 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= IS_SAME;
;
break;}
-case 96:
-#line 829 "pic.y"
+case 99:
+#line 841 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= IS_INVISIBLE;
;
break;}
-case 97:
-#line 834 "pic.y"
+case 100:
+#line 846 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= HAS_LEFT_ARROW_HEAD;
;
break;}
-case 98:
-#line 839 "pic.y"
+case 101:
+#line 851 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= HAS_RIGHT_ARROW_HEAD;
;
break;}
-case 99:
-#line 844 "pic.y"
+case 102:
+#line 856 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= (HAS_LEFT_ARROW_HEAD|HAS_RIGHT_ARROW_HEAD);
;
break;}
-case 100:
-#line 849 "pic.y"
+case 103:
+#line 861 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= IS_CLOCKWISE;
;
break;}
-case 101:
-#line 854 "pic.y"
+case 104:
+#line 866 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags &= ~IS_CLOCKWISE;
;
break;}
-case 102:
-#line 859 "pic.y"
+case 105:
+#line 871 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
for (text_item **p = & yyval.spec->text; *p; p = &(*p)->next)
@@ -2018,8 +2167,8 @@ case 102:
*p = new text_item(yyvsp[0].lstr.str, yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno);
;
break;}
-case 103:
-#line 866 "pic.y"
+case 106:
+#line 878 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
if (yyval.spec->text) {
@@ -2029,8 +2178,8 @@ case 103:
}
;
break;}
-case 104:
-#line 875 "pic.y"
+case 107:
+#line 887 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
if (yyval.spec->text) {
@@ -2040,8 +2189,8 @@ case 104:
}
;
break;}
-case 105:
-#line 884 "pic.y"
+case 108:
+#line 896 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
if (yyval.spec->text) {
@@ -2051,8 +2200,8 @@ case 105:
}
;
break;}
-case 106:
-#line 893 "pic.y"
+case 109:
+#line 905 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
if (yyval.spec->text) {
@@ -2062,29 +2211,29 @@ case 106:
}
;
break;}
-case 107:
-#line 902 "pic.y"
+case 110:
+#line 914 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->flags |= HAS_THICKNESS;
yyval.spec->thickness = yyvsp[0].x;
;
break;}
-case 108:
-#line 908 "pic.y"
+case 111:
+#line 920 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= IS_ALIGNED;
;
break;}
-case 109:
-#line 916 "pic.y"
+case 112:
+#line 928 "pic.y"
{
yyval.lstr = yyvsp[0].lstr;
;
break;}
-case 110:
-#line 920 "pic.y"
+case 113:
+#line 932 "pic.y"
{
yyval.lstr.filename = yyvsp[-2].lstr.filename;
yyval.lstr.lineno = yyvsp[-2].lstr.lineno;
@@ -2093,16 +2242,16 @@ case 110:
delete yyvsp[-2].lstr.str;
;
break;}
-case 111:
-#line 931 "pic.y"
+case 114:
+#line 943 "pic.y"
{
yyval.dv.v = 0;
yyval.dv.nv = 0;
yyval.dv.maxv = 0;
;
break;}
-case 112:
-#line 937 "pic.y"
+case 115:
+#line 949 "pic.y"
{
yyval.dv = yyvsp[-2].dv;
if (yyval.dv.nv >= yyval.dv.maxv) {
@@ -2122,103 +2271,103 @@ case 112:
yyval.dv.nv += 1;
;
break;}
-case 113:
-#line 959 "pic.y"
+case 116:
+#line 971 "pic.y"
{ yyval.pair = yyvsp[0].pair; ;
break;}
-case 114:
-#line 961 "pic.y"
+case 117:
+#line 973 "pic.y"
{
position pos = yyvsp[0].pl;
yyval.pair.x = pos.x;
yyval.pair.y = pos.y;
;
break;}
-case 115:
-#line 970 "pic.y"
+case 118:
+#line 982 "pic.y"
{ yyval.pair = yyvsp[0].pair; ;
break;}
-case 116:
-#line 972 "pic.y"
+case 119:
+#line 984 "pic.y"
{
yyval.pair.x = yyvsp[-2].pair.x + yyvsp[0].pair.x;
yyval.pair.y = yyvsp[-2].pair.y + yyvsp[0].pair.y;
;
break;}
-case 117:
-#line 977 "pic.y"
+case 120:
+#line 989 "pic.y"
{
yyval.pair.x = yyvsp[-2].pair.x - yyvsp[0].pair.x;
yyval.pair.y = yyvsp[-2].pair.y - yyvsp[0].pair.y;
;
break;}
-case 118:
-#line 982 "pic.y"
+case 121:
+#line 994 "pic.y"
{
yyval.pair.x = yyvsp[-3].pair.x;
yyval.pair.y = yyvsp[-1].pair.y;
;
break;}
-case 119:
-#line 987 "pic.y"
+case 122:
+#line 999 "pic.y"
{
yyval.pair.x = (1.0 - yyvsp[-4].x)*yyvsp[-2].pair.x + yyvsp[-4].x*yyvsp[0].pair.x;
yyval.pair.y = (1.0 - yyvsp[-4].x)*yyvsp[-2].pair.y + yyvsp[-4].x*yyvsp[0].pair.y;
;
break;}
-case 120:
-#line 992 "pic.y"
+case 123:
+#line 1004 "pic.y"
{
yyval.pair.x = (1.0 - yyvsp[-5].x)*yyvsp[-3].pair.x + yyvsp[-5].x*yyvsp[-1].pair.x;
yyval.pair.y = (1.0 - yyvsp[-5].x)*yyvsp[-3].pair.y + yyvsp[-5].x*yyvsp[-1].pair.y;
;
break;}
-case 123:
-#line 1005 "pic.y"
+case 126:
+#line 1017 "pic.y"
{ yyval.pair.x = yyvsp[-2].x; yyval.pair.y = yyvsp[0].x; ;
break;}
-case 124:
-#line 1007 "pic.y"
+case 127:
+#line 1019 "pic.y"
{ yyval.pair = yyvsp[-1].pair; ;
break;}
-case 125:
-#line 1012 "pic.y"
+case 128:
+#line 1024 "pic.y"
{ yyval.pl = yyvsp[0].pl; ;
break;}
-case 126:
-#line 1014 "pic.y"
+case 129:
+#line 1026 "pic.y"
{
path pth(yyvsp[0].crn);
if (!pth.follow(yyvsp[-1].pl, & yyval.pl))
YYABORT;
;
break;}
-case 127:
-#line 1020 "pic.y"
+case 130:
+#line 1032 "pic.y"
{
path pth(yyvsp[-1].crn);
if (!pth.follow(yyvsp[0].pl, & yyval.pl))
YYABORT;
;
break;}
-case 128:
-#line 1026 "pic.y"
+case 131:
+#line 1038 "pic.y"
{
path pth(yyvsp[-2].crn);
if (!pth.follow(yyvsp[0].pl, & yyval.pl))
YYABORT;
;
break;}
-case 129:
-#line 1032 "pic.y"
+case 132:
+#line 1044 "pic.y"
{
yyval.pl.x = current_position.x;
yyval.pl.y = current_position.y;
yyval.pl.obj = 0;
;
break;}
-case 130:
-#line 1041 "pic.y"
+case 133:
+#line 1053 "pic.y"
{
place *p = lookup_label(yyvsp[0].str);
if (!p) {
@@ -2229,30 +2378,30 @@ case 130:
delete yyvsp[0].str;
;
break;}
-case 131:
-#line 1051 "pic.y"
+case 134:
+#line 1063 "pic.y"
{
yyval.pl.obj = yyvsp[0].obj;
;
break;}
-case 132:
-#line 1055 "pic.y"
+case 135:
+#line 1067 "pic.y"
{
path pth(yyvsp[0].str);
if (!pth.follow(yyvsp[-2].pl, & yyval.pl))
YYABORT;
;
break;}
-case 133:
-#line 1064 "pic.y"
+case 136:
+#line 1076 "pic.y"
{ yyval.n = 1; ;
break;}
-case 134:
-#line 1066 "pic.y"
+case 137:
+#line 1078 "pic.y"
{ yyval.n = yyvsp[-1].n; ;
break;}
-case 135:
-#line 1071 "pic.y"
+case 138:
+#line 1083 "pic.y"
{
int count = 0;
for (object *p = olist.head; p != 0; p = p->next)
@@ -2267,8 +2416,8 @@ case 135:
}
;
break;}
-case 136:
-#line 1085 "pic.y"
+case 139:
+#line 1097 "pic.y"
{
int count = 0;
for (object *p = olist.tail; p != 0; p = p->prev)
@@ -2283,226 +2432,226 @@ case 136:
}
;
break;}
-case 137:
-#line 1102 "pic.y"
+case 140:
+#line 1114 "pic.y"
{ yyval.obtype = BOX_OBJECT; ;
break;}
-case 138:
-#line 1104 "pic.y"
+case 141:
+#line 1116 "pic.y"
{ yyval.obtype = CIRCLE_OBJECT; ;
break;}
-case 139:
-#line 1106 "pic.y"
+case 142:
+#line 1118 "pic.y"
{ yyval.obtype = ELLIPSE_OBJECT; ;
break;}
-case 140:
-#line 1108 "pic.y"
+case 143:
+#line 1120 "pic.y"
{ yyval.obtype = ARC_OBJECT; ;
break;}
-case 141:
-#line 1110 "pic.y"
+case 144:
+#line 1122 "pic.y"
{ yyval.obtype = LINE_OBJECT; ;
break;}
-case 142:
-#line 1112 "pic.y"
+case 145:
+#line 1124 "pic.y"
{ yyval.obtype = ARROW_OBJECT; ;
break;}
-case 143:
-#line 1114 "pic.y"
+case 146:
+#line 1126 "pic.y"
{ yyval.obtype = SPLINE_OBJECT; ;
break;}
-case 144:
-#line 1116 "pic.y"
+case 147:
+#line 1128 "pic.y"
{ yyval.obtype = BLOCK_OBJECT; ;
break;}
-case 145:
-#line 1118 "pic.y"
+case 148:
+#line 1130 "pic.y"
{ yyval.obtype = TEXT_OBJECT; ;
break;}
-case 146:
-#line 1123 "pic.y"
+case 149:
+#line 1135 "pic.y"
{
yyval.pth = new path(yyvsp[0].str);
;
break;}
-case 147:
-#line 1127 "pic.y"
+case 150:
+#line 1139 "pic.y"
{
yyval.pth = yyvsp[-2].pth;
yyval.pth->append(yyvsp[0].str);
;
break;}
-case 148:
-#line 1135 "pic.y"
+case 151:
+#line 1147 "pic.y"
{
yyval.pth = new path(yyvsp[0].crn);
;
break;}
-case 149:
-#line 1142 "pic.y"
+case 152:
+#line 1154 "pic.y"
{
yyval.pth = yyvsp[0].pth;
;
break;}
-case 150:
-#line 1146 "pic.y"
+case 153:
+#line 1158 "pic.y"
{
yyval.pth = yyvsp[-1].pth;
yyval.pth->append(yyvsp[0].crn);
;
break;}
-case 151:
-#line 1154 "pic.y"
+case 154:
+#line 1166 "pic.y"
{
yyval.pth = yyvsp[0].pth;
;
break;}
-case 152:
-#line 1159 "pic.y"
+case 155:
+#line 1171 "pic.y"
{
lex_warning("`%1%2 last %3' in `with' argument ignored",
yyvsp[-3].n, ordinal_postfix(yyvsp[-3].n), object_type_name(yyvsp[-1].obtype));
yyval.pth = yyvsp[0].pth;
;
break;}
-case 153:
-#line 1165 "pic.y"
+case 156:
+#line 1177 "pic.y"
{
lex_warning("`last %1' in `with' argument ignored",
object_type_name(yyvsp[-1].obtype));
yyval.pth = yyvsp[0].pth;
;
break;}
-case 154:
-#line 1171 "pic.y"
+case 157:
+#line 1183 "pic.y"
{
lex_warning("`%1%2 %3' in `with' argument ignored",
yyvsp[-2].n, ordinal_postfix(yyvsp[-2].n), object_type_name(yyvsp[-1].obtype));
yyval.pth = yyvsp[0].pth;
;
break;}
-case 155:
-#line 1177 "pic.y"
+case 158:
+#line 1189 "pic.y"
{
lex_warning("initial `%1' in `with' argument ignored", yyvsp[-1].str);
delete yyvsp[-1].str;
yyval.pth = yyvsp[0].pth;
;
break;}
-case 156:
-#line 1186 "pic.y"
+case 159:
+#line 1198 "pic.y"
{ yyval.crn = &object::north; ;
break;}
-case 157:
-#line 1188 "pic.y"
+case 160:
+#line 1200 "pic.y"
{ yyval.crn = &object::east; ;
break;}
-case 158:
-#line 1190 "pic.y"
+case 161:
+#line 1202 "pic.y"
{ yyval.crn = &object::west; ;
break;}
-case 159:
-#line 1192 "pic.y"
+case 162:
+#line 1204 "pic.y"
{ yyval.crn = &object::south; ;
break;}
-case 160:
-#line 1194 "pic.y"
+case 163:
+#line 1206 "pic.y"
{ yyval.crn = &object::north_east; ;
break;}
-case 161:
-#line 1196 "pic.y"
+case 164:
+#line 1208 "pic.y"
{ yyval.crn = &object:: south_east; ;
break;}
-case 162:
-#line 1198 "pic.y"
+case 165:
+#line 1210 "pic.y"
{ yyval.crn = &object::north_west; ;
break;}
-case 163:
-#line 1200 "pic.y"
+case 166:
+#line 1212 "pic.y"
{ yyval.crn = &object::south_west; ;
break;}
-case 164:
-#line 1202 "pic.y"
+case 167:
+#line 1214 "pic.y"
{ yyval.crn = &object::center; ;
break;}
-case 165:
-#line 1204 "pic.y"
+case 168:
+#line 1216 "pic.y"
{ yyval.crn = &object::start; ;
break;}
-case 166:
-#line 1206 "pic.y"
+case 169:
+#line 1218 "pic.y"
{ yyval.crn = &object::end; ;
break;}
-case 167:
-#line 1208 "pic.y"
+case 170:
+#line 1220 "pic.y"
{ yyval.crn = &object::north; ;
break;}
-case 168:
-#line 1210 "pic.y"
+case 171:
+#line 1222 "pic.y"
{ yyval.crn = &object::south; ;
break;}
-case 169:
-#line 1212 "pic.y"
+case 172:
+#line 1224 "pic.y"
{ yyval.crn = &object::west; ;
break;}
-case 170:
-#line 1214 "pic.y"
+case 173:
+#line 1226 "pic.y"
{ yyval.crn = &object::east; ;
break;}
-case 171:
-#line 1216 "pic.y"
+case 174:
+#line 1228 "pic.y"
{ yyval.crn = &object::north_west; ;
break;}
-case 172:
-#line 1218 "pic.y"
+case 175:
+#line 1230 "pic.y"
{ yyval.crn = &object::south_west; ;
break;}
-case 173:
-#line 1220 "pic.y"
+case 176:
+#line 1232 "pic.y"
{ yyval.crn = &object::north_east; ;
break;}
-case 174:
-#line 1222 "pic.y"
+case 177:
+#line 1234 "pic.y"
{ yyval.crn = &object::south_east; ;
break;}
-case 175:
-#line 1224 "pic.y"
+case 178:
+#line 1236 "pic.y"
{ yyval.crn = &object::west; ;
break;}
-case 176:
-#line 1226 "pic.y"
+case 179:
+#line 1238 "pic.y"
{ yyval.crn = &object::east; ;
break;}
-case 177:
-#line 1228 "pic.y"
+case 180:
+#line 1240 "pic.y"
{ yyval.crn = &object::north_west; ;
break;}
-case 178:
-#line 1230 "pic.y"
+case 181:
+#line 1242 "pic.y"
{ yyval.crn = &object::south_west; ;
break;}
-case 179:
-#line 1232 "pic.y"
+case 182:
+#line 1244 "pic.y"
{ yyval.crn = &object::north_east; ;
break;}
-case 180:
-#line 1234 "pic.y"
+case 183:
+#line 1246 "pic.y"
{ yyval.crn = &object::south_east; ;
break;}
-case 181:
-#line 1236 "pic.y"
+case 184:
+#line 1248 "pic.y"
{ yyval.crn = &object::center; ;
break;}
-case 182:
-#line 1238 "pic.y"
+case 185:
+#line 1250 "pic.y"
{ yyval.crn = &object::start; ;
break;}
-case 183:
-#line 1240 "pic.y"
+case 186:
+#line 1252 "pic.y"
{ yyval.crn = &object::end; ;
break;}
-case 184:
-#line 1245 "pic.y"
+case 187:
+#line 1257 "pic.y"
{
if (!lookup_variable(yyvsp[0].str, & yyval.x)) {
lex_error("there is no variable `%1'", yyvsp[0].str);
@@ -2511,12 +2660,12 @@ case 184:
delete yyvsp[0].str;
;
break;}
-case 185:
-#line 1253 "pic.y"
+case 188:
+#line 1265 "pic.y"
{ yyval.x = yyvsp[0].x; ;
break;}
-case 186:
-#line 1255 "pic.y"
+case 189:
+#line 1267 "pic.y"
{
if (yyvsp[-1].pl.obj != 0)
yyval.x = yyvsp[-1].pl.obj->origin().x;
@@ -2524,8 +2673,8 @@ case 186:
yyval.x = yyvsp[-1].pl.x;
;
break;}
-case 187:
-#line 1262 "pic.y"
+case 190:
+#line 1274 "pic.y"
{
if (yyvsp[-1].pl.obj != 0)
yyval.x = yyvsp[-1].pl.obj->origin().y;
@@ -2533,8 +2682,8 @@ case 187:
yyval.x = yyvsp[-1].pl.y;
;
break;}
-case 188:
-#line 1269 "pic.y"
+case 191:
+#line 1281 "pic.y"
{
if (yyvsp[-1].pl.obj != 0)
yyval.x = yyvsp[-1].pl.obj->height();
@@ -2542,8 +2691,8 @@ case 188:
yyval.x = 0.0;
;
break;}
-case 189:
-#line 1276 "pic.y"
+case 192:
+#line 1288 "pic.y"
{
if (yyvsp[-1].pl.obj != 0)
yyval.x = yyvsp[-1].pl.obj->width();
@@ -2551,8 +2700,8 @@ case 189:
yyval.x = 0.0;
;
break;}
-case 190:
-#line 1283 "pic.y"
+case 193:
+#line 1295 "pic.y"
{
if (yyvsp[-1].pl.obj != 0)
yyval.x = yyvsp[-1].pl.obj->radius();
@@ -2560,20 +2709,20 @@ case 190:
yyval.x = 0.0;
;
break;}
-case 191:
-#line 1290 "pic.y"
+case 194:
+#line 1302 "pic.y"
{ yyval.x = yyvsp[-2].x + yyvsp[0].x; ;
break;}
-case 192:
-#line 1292 "pic.y"
+case 195:
+#line 1304 "pic.y"
{ yyval.x = yyvsp[-2].x - yyvsp[0].x; ;
break;}
-case 193:
-#line 1294 "pic.y"
+case 196:
+#line 1306 "pic.y"
{ yyval.x = yyvsp[-2].x * yyvsp[0].x; ;
break;}
-case 194:
-#line 1296 "pic.y"
+case 197:
+#line 1308 "pic.y"
{
if (yyvsp[0].x == 0.0) {
lex_error("division by zero");
@@ -2582,8 +2731,8 @@ case 194:
yyval.x = yyvsp[-2].x/yyvsp[0].x;
;
break;}
-case 195:
-#line 1304 "pic.y"
+case 198:
+#line 1316 "pic.y"
{
if (yyvsp[0].x == 0.0) {
lex_error("modulus by zero");
@@ -2592,8 +2741,8 @@ case 195:
yyval.x = fmod(yyvsp[-2].x, yyvsp[0].x);
;
break;}
-case 196:
-#line 1312 "pic.y"
+case 199:
+#line 1324 "pic.y"
{
errno = 0;
yyval.x = pow(yyvsp[-2].x, yyvsp[0].x);
@@ -2607,16 +2756,16 @@ case 196:
}
;
break;}
-case 197:
-#line 1325 "pic.y"
+case 200:
+#line 1337 "pic.y"
{ yyval.x = -yyvsp[0].x; ;
break;}
-case 198:
-#line 1327 "pic.y"
+case 201:
+#line 1339 "pic.y"
{ yyval.x = yyvsp[-1].x; ;
break;}
-case 199:
-#line 1329 "pic.y"
+case 202:
+#line 1341 "pic.y"
{
errno = 0;
yyval.x = sin(yyvsp[-1].x);
@@ -2626,8 +2775,8 @@ case 199:
}
;
break;}
-case 200:
-#line 1338 "pic.y"
+case 203:
+#line 1350 "pic.y"
{
errno = 0;
yyval.x = cos(yyvsp[-1].x);
@@ -2637,8 +2786,8 @@ case 200:
}
;
break;}
-case 201:
-#line 1347 "pic.y"
+case 204:
+#line 1359 "pic.y"
{
errno = 0;
yyval.x = atan2(yyvsp[-3].x, yyvsp[-1].x);
@@ -2652,8 +2801,8 @@ case 201:
}
;
break;}
-case 202:
-#line 1360 "pic.y"
+case 205:
+#line 1372 "pic.y"
{
errno = 0;
yyval.x = log10(yyvsp[-1].x);
@@ -2663,8 +2812,8 @@ case 202:
}
;
break;}
-case 203:
-#line 1369 "pic.y"
+case 206:
+#line 1381 "pic.y"
{
errno = 0;
yyval.x = pow(10.0, yyvsp[-1].x);
@@ -2674,8 +2823,8 @@ case 203:
}
;
break;}
-case 204:
-#line 1378 "pic.y"
+case 207:
+#line 1390 "pic.y"
{
errno = 0;
yyval.x = sqrt(yyvsp[-1].x);
@@ -2685,69 +2834,69 @@ case 204:
}
;
break;}
-case 205:
-#line 1387 "pic.y"
+case 208:
+#line 1399 "pic.y"
{ yyval.x = yyvsp[-3].x > yyvsp[-1].x ? yyvsp[-3].x : yyvsp[-1].x; ;
break;}
-case 206:
-#line 1389 "pic.y"
+case 209:
+#line 1401 "pic.y"
{ yyval.x = yyvsp[-3].x > yyvsp[-1].x ? yyvsp[-3].x : yyvsp[-1].x; ;
break;}
-case 207:
-#line 1391 "pic.y"
+case 210:
+#line 1403 "pic.y"
{ yyval.x = floor(yyvsp[-1].x); ;
break;}
-case 208:
-#line 1393 "pic.y"
+case 211:
+#line 1405 "pic.y"
{ yyval.x = 1.0 + floor(((rand()&0x7fff)/double(0x7fff))*yyvsp[-1].x); ;
break;}
-case 209:
-#line 1395 "pic.y"
+case 212:
+#line 1407 "pic.y"
{
/* return a random number in the range [0,1) */
/* portable, but not very random */
yyval.x = (rand() & 0x7fff) / double(0x8000);
;
break;}
-case 210:
-#line 1401 "pic.y"
+case 213:
+#line 1413 "pic.y"
{ yyval.x = (yyvsp[-2].x < yyvsp[0].x); ;
break;}
-case 211:
-#line 1403 "pic.y"
+case 214:
+#line 1415 "pic.y"
{ yyval.x = (yyvsp[-2].x <= yyvsp[0].x); ;
break;}
-case 212:
-#line 1405 "pic.y"
+case 215:
+#line 1417 "pic.y"
{ yyval.x = (yyvsp[-2].x > yyvsp[0].x); ;
break;}
-case 213:
-#line 1407 "pic.y"
+case 216:
+#line 1419 "pic.y"
{ yyval.x = (yyvsp[-2].x >= yyvsp[0].x); ;
break;}
-case 214:
-#line 1409 "pic.y"
+case 217:
+#line 1421 "pic.y"
{ yyval.x = (yyvsp[-2].x == yyvsp[0].x); ;
break;}
-case 215:
-#line 1411 "pic.y"
+case 218:
+#line 1423 "pic.y"
{ yyval.x = (yyvsp[-2].x != yyvsp[0].x); ;
break;}
-case 216:
-#line 1413 "pic.y"
+case 219:
+#line 1425 "pic.y"
{ yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); ;
break;}
-case 217:
-#line 1415 "pic.y"
+case 220:
+#line 1427 "pic.y"
{ yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); ;
break;}
-case 218:
-#line 1417 "pic.y"
+case 221:
+#line 1429 "pic.y"
{ yyval.x = (yyvsp[0].x == 0.0); ;
break;}
}
/* the action file gets copied in in place of this dollarsign */
-#line 362 "/usr/local/lib/bison.simple"
+#line 423 "/usr/local/lib/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
@@ -2934,7 +3083,7 @@ yyerrhandle:
yystate = yyn;
goto yynewstate;
}
-#line 1421 "pic.y"
+#line 1433 "pic.y"
/* bison defines const to be empty unless __STDC__ is defined, which it
diff --git a/pic/pic.y b/pic/pic.y
index e82a35468..67a2cb4ca 100644
--- a/pic/pic.y
+++ b/pic/pic.y
@@ -35,7 +35,9 @@ extern "C" {
int rand();
}
+#ifndef __BORLANDC__
#define YYDEBUG 1
+#endif /* __BORLANDC__ */
int yylex();
void yyerror(const char *);
@@ -494,6 +496,9 @@ element:
current_position.x = $<state>2.x;
current_position.y = $<state>2.y;
current_direction = $<state>2.dir;
+ }
+ optional_element
+ {
$$ = $3;
}
| placeless_element
@@ -504,6 +509,13 @@ element:
}
;
+optional_element:
+ /* empty */
+ {}
+ | element
+ {}
+ ;
+
object_spec:
BOX
{
diff --git a/pic/troff.c b/pic/troff.c
index 6af66dd6b..2daba061a 100644
--- a/pic/troff.c
+++ b/pic/troff.c
@@ -315,7 +315,7 @@ void troff_output::simple_ellipse(int filled, const position &cent,
position c = transform(cent);
printf("\\h'%.3fi'"
"\\v'%.3fi'"
- "\\D'%c%.3fi %.3fi%'"
+ "\\D'%c%.3fi %.3fi'"
"\n.sp -1\n",
c.x - dim.x/(2.0*scale),
c.y,
@@ -358,11 +358,11 @@ void troff_output::simple_spline(const position &start,
fputs("\\D'~", stdout);
for (int i = 0; i < n; i++) {
position temp = transform(v[i]);
- distance v = temp - pos;
+ distance d = temp - pos;
pos = temp;
if (i != 0)
putchar(' ');
- printf("%.3fi %.3fi", v.x, v.y);
+ printf("%.3fi %.3fi", d.x, d.y);
}
printf("'\n.sp -1\n");
}
@@ -378,11 +378,11 @@ void troff_output::simple_polygon(int filled, const position *v, int n)
printf("\\D'%c", (filled ? 'P' : 'p'));
for (int i = 1; i < n; i++) {
position temp = transform(v[i]);
- distance v = temp - pos;
+ distance d = temp - pos;
pos = temp;
if (i != 1)
putchar(' ');
- printf("%.3fi %.3fi", v.x, v.y);
+ printf("%.3fi %.3fi", d.x, d.y);
}
printf("'\n.sp -1\n");
}
diff --git a/ps/Makefile b/ps/Makefile
index 069599ce6..4ae89bfb5 100644
--- a/ps/Makefile
+++ b/ps/Makefile
@@ -55,9 +55,7 @@ psrm.o: ps.h ../driver/printer.h ../driver/driver.h ../lib/font.h \
../lib/stringclass.h ../lib/cset.h
broken.h: FORCE
- @echo \#define BROKEN_SPOOLER_FLAGS $(BROKEN_SPOOLER_FLAGS) >broken.h.n
- @cmp -s broken.h broken.h.n || cp broken.h.n broken.h
- @rm -f broken.h.n
+ @$(SHELL) ../gendef $@ "BROKEN_SPOOLER_FLAGS=$(BROKEN_SPOOLER_FLAGS)"
psbb: psbb.o
$(OLDCC) $(LDFLAGS) -o $@ psbb.o
@@ -65,17 +63,17 @@ psbb: psbb.o
psbb.o: psbb.c
$(OLDCC) $(OLDCFLAGS) -c psbb.c
-pfbtops: pfbtops.o
- $(OLDCC) $(LDFLAGS) -o $@ pfbtops.o
+pfbtops: pfbtops.o ../lib/libgroff.a
+ $(OLDCC) $(LDFLAGS) -o $@ pfbtops.o ../lib/libgroff.a
pfbtops.o: pfbtops.c
$(OLDCC) $(OLDCFLAGS) -c pfbtops.c
saber_grops:
- #load $(INCLUDES) $(CFLAGS) $(DEFINES) ps.c psrm.c \
- ../driver/libdriver.a ../lib/libgroff.a -lm
+ #load $(INCLUDES) $(CFLAGS) $(DEFINES) psrm.c ps.c \
+ -L../driver -ldriver -L../lib -lgroff -lm
-install.bin: grops psbb
+install.bin: grops psbb pfbtops
-[ -d $(BINDIR) ] || mkdir $(BINDIR)
-rm -f $(BINDIR)/grops $(BINDIR)/psbb
cp grops psbb pfbtops $(BINDIR)
@@ -101,7 +99,7 @@ TAGS : $(SOURCES)
$(ETAGS) $(ETAGSFLAGS) $(SOURCES)
clean:
- -rm -f *.o psbb core grops broken.h
+ -rm -f *.o psbb pfbtops core grops broken.h
distclean: clean
-rm -f TAGS
diff --git a/ps/devps/prologue b/ps/devps/prologue
index 027e432f3..ff067bb0c 100644
--- a/ps/devps/prologue
+++ b/ps/devps/prologue
@@ -194,6 +194,7 @@
} if
newpath
/CNT countdictstack def
+ userdict begin
/showpage {} def
} bind def
diff --git a/ps/pfbtops.c b/ps/pfbtops.c
index 37bbf0809..bc79bce59 100644
--- a/ps/pfbtops.c
+++ b/ps/pfbtops.c
@@ -17,7 +17,7 @@ static void error(s)
static void usage()
{
- fprintf(stderr, "usage: %s [pfb_file]\n", program_name);
+ fprintf(stderr, "usage: %s [-v] [pfb_file]\n", program_name);
exit(1);
}
@@ -25,12 +25,30 @@ int main(argc, argv)
int argc;
char **argv;
{
+ int opt;
+ extern int optind;
+
program_name = argv[0];
- if (argc > 2)
+
+ while ((opt = getopt(argc, argv, "v")) != EOF) {
+ switch (opt) {
+ case 'v':
+ {
+ extern char *version_string;
+ fprintf(stderr, "pfbtops groff version %s\n", version_string);
+ fflush(stderr);
+ break;
+ }
+ case '?':
+ usage();
+ }
+ }
+
+ if (argc - optind > 1)
usage();
- if (argc == 2 && !freopen(argv[1], "r", stdin))
+ if (argc > optind && !freopen(argv[optind], "r", stdin))
{
- perror(argv[1]);
+ perror(argv[optind]);
exit(1);
}
for (;;)
diff --git a/ps/ps.c b/ps/ps.c
index 170a5f6ae..4a5f66392 100644
--- a/ps/ps.c
+++ b/ps/ps.c
@@ -450,6 +450,7 @@ class ps_printer : public printer {
string defs;
int ndefs;
resource_manager rm;
+ int invis_count;
void flush_sbuf();
void set_style(const style &);
@@ -460,6 +461,8 @@ class ps_printer : public printer {
void do_def(char *, const environment *);
void do_mdef(char *, const environment *);
void do_file(char *, const environment *);
+ void do_invis(char *, const environment *);
+ void do_endinvis(char *, const environment *);
void set_line_thickness(const environment *);
void fill_path();
void encode_fonts();
@@ -487,16 +490,10 @@ ps_printer::ps_printer()
next_encoding_index(0),
line_thickness(-1),
fill(FILL_MAX + 1),
- ndefs(0)
+ ndefs(0),
+ invis_count(0)
{
- static char temp_filename[] = "/tmp/gropsXXXXXX";
- mktemp(temp_filename);
- tempfp = fopen(temp_filename, "w+");
- if (tempfp == 0)
- fatal("can't open temporary file `%1': %2",
- temp_filename, strerror(errno));
- if (unlink(temp_filename) < 0)
- error("can't unlink `%1': %2", temp_filename, strerror(errno));
+ tempfp = xtmpfile();
out.set_file(tempfp);
if (linewidth < 0)
linewidth = DEFAULT_LINEWIDTH;
@@ -539,7 +536,7 @@ int ps_printer::set_encoding_index(ps_font *f)
void ps_printer::set_char(int i, font *f, const environment *env, int w)
{
- if (i == space_char_index)
+ if (i == space_char_index || invis_count > 0)
return;
unsigned char code = f->get_code(i);
style sty(f, env->size, env->height, env->slant);
@@ -860,6 +857,8 @@ void ps_printer::fill_path()
void ps_printer::draw(int code, int *p, int np, const environment *env)
{
+ if (invis_count > 0)
+ return;
int fill_flag = 0;
switch (code) {
case 'C':
@@ -1067,6 +1066,10 @@ void ps_printer::end_page()
{
flush_sbuf();
out.put_symbol("EP");
+ if (invis_count != 0) {
+ error("missing `endinvis' command");
+ invis_count = 0;
+ }
}
font *ps_printer::make_font(const char *nm)
@@ -1165,6 +1168,8 @@ void ps_printer::special(char *arg, const environment *env)
"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++)
;
@@ -1187,7 +1192,6 @@ void ps_printer::special(char *arg, const environment *env)
}
for (int i = 0; i < sizeof(proc_table)/sizeof(proc_table[0]); i++)
if (strncmp(command, proc_table[i].name, p - command) == 0) {
- flush_sbuf();
(this->*(proc_table[i].proc))(p, env);
return;
}
@@ -1214,6 +1218,7 @@ static int check_line_lengths(const char *p)
void ps_printer::do_exec(char *arg, const environment *env)
{
+ flush_sbuf();
while (csspace(*arg))
arg++;
if (*arg == '\0') {
@@ -1238,6 +1243,7 @@ void ps_printer::do_exec(char *arg, const environment *env)
void ps_printer::do_file(char *arg, const environment *env)
{
+ flush_sbuf();
while (csspace(*arg))
arg++;
if (*arg == '\0') {
@@ -1262,6 +1268,7 @@ void ps_printer::do_file(char *arg, const environment *env)
void ps_printer::do_def(char *arg, const environment *)
{
+ flush_sbuf();
while (csspace(*arg))
arg++;
if (!check_line_lengths(arg)) {
@@ -1278,6 +1285,7 @@ void ps_printer::do_def(char *arg, const environment *)
void ps_printer::do_mdef(char *arg, const environment *)
{
+ flush_sbuf();
char *p;
int n = (int)strtol(arg, &p, 10);
if (n == 0 && p == arg) {
@@ -1303,6 +1311,7 @@ void ps_printer::do_mdef(char *arg, const environment *)
void ps_printer::do_import(char *arg, const environment *env)
{
+ flush_sbuf();
while (*arg == ' ' || *arg == '\n')
arg++;
for (char *p = arg; *p != '\0' && *p != ' ' && *p != '\n'; p++)
@@ -1380,13 +1389,24 @@ void ps_printer::do_import(char *arg, const environment *env)
.put_fix_number(env->hpos)
.put_fix_number(env->vpos)
.put_symbol("PBEGIN");
- out.put_symbol("userdict")
- .put_symbol("begin");
rm.import_file(arg, out);
+ // do this here just in case application defines PEND
out.put_symbol("end");
out.put_symbol("PEND");
}
+void ps_printer::do_invis(char *, const environment *)
+{
+ invis_count++;
+}
+
+void ps_printer::do_endinvis(char *, const environment *)
+{
+ if (invis_count == 0)
+ error("unbalanced `endinvis' command");
+ else
+ --invis_count;
+}
printer *make_printer()
{
diff --git a/ps/ps.h b/ps/ps.h
index 1faae0bf5..ade110570 100644
--- a/ps/ps.h
+++ b/ps/ps.h
@@ -119,9 +119,3 @@ enum {
STRIP_PERCENT_BANG = 02,
STRIP_STRUCTURE_COMMENTS = 04
};
-
-
-extern "C" {
- // Sun's stdlib.h fails to declare this.
- char *mktemp(char *);
-}
diff --git a/ps/psbb.c b/ps/psbb.c
index d63bfcd8c..f59204b4a 100644
--- a/ps/psbb.c
+++ b/ps/psbb.c
@@ -19,6 +19,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdio.h>
#include <string.h>
+#include <errno.h>
struct bounding_box {
int llx, lly, urx, ury;
@@ -44,6 +45,7 @@ char **argv;
fprintf(stderr, "usage: %s filename\n", argv[0]);
exit(3);
}
+ errno = 0;
fp = fopen(argv[1], "r");
if (fp == NULL) {
fprintf(stderr, "%s: can't open `%s': ", argv[0], argv[1]);
diff --git a/ps/psrm.c b/ps/psrm.c
index 8db4432da..0b40a171e 100644
--- a/ps/psrm.c
+++ b/ps/psrm.c
@@ -272,6 +272,7 @@ void resource_manager::supply_resource(resource *r, int rank, FILE *outfp,
}
}
else {
+ errno = 0;
fp = fopen(r->filename, "r");
if (!fp) {
error("can't open `%1': %2", r->filename, strerror(errno));
@@ -338,13 +339,17 @@ static int ps_get_line(char *buf, FILE *fp)
}
current_lineno++;
int i = 0;
+ int err = 0;
while (c != '\r' && c != '\n' && c != EOF) {
if ((c < 0x1b && !white_space(c)) || c == 0x7f)
error("illegal input character code %1", int(c));
else if (i < PS_LINE_MAX)
buf[i++] = c;
- else if (++i == PS_LINE_MAX)
- error("line too long");
+ else if (!err) {
+ err = 1;
+ error("PostScript file non-conforming "
+ "because length of line exceeds 255");
+ }
c = getc(fp);
}
buf[i++] = '\n';
@@ -1057,7 +1062,7 @@ static void print_ps_string(const string &s, FILE *outfp)
break;
default:
if (str[i] < 040 || str[i] > 0176)
- fprintf(outfp, "\\%03o", str[i]);
+ fprintf(outfp, "\\%03o", str[i] & 0377);
else
putc(str[i], outfp);
break;
diff --git a/ps/tmac.ps b/ps/tmac.ps
index 07196d961..f58936f0e 100644
--- a/ps/tmac.ps
+++ b/ps/tmac.ps
@@ -101,15 +101,15 @@
. 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
-. sp \\n[ps-desht]u
. nr ps-offset \\n[.l]-\\n[.i]-\\n[ps-deswid]/2
. ie \\n[.$]>=3 \
-\h'\\n[ps-offset]u'\X'ps: import \\$1 \\n[ps-llx] \\n[ps-lly] \\n[ps-urx] \
-\\n[ps-ury] \\n[ps-deswid] \\n[ps-desht]'
+\v'\\n[ps-desht]u'\h'\\n[ps-offset]u'\X'ps: import \\$1 \
+\\n[ps-llx] \\n[ps-lly] \\n[ps-urx] \\n[ps-ury] \\n[ps-deswid] \\n[ps-desht]'
. el \
-\h'\\n[ps-offset]u'\X'ps: import \\$1 \\n[ps-llx] \\n[ps-lly] \\n[ps-urx] \
-\\n[ps-ury] \\n[ps-deswid]'
+\v'\\n[ps-desht]u'\h'\\n[ps-offset]u'\X'ps: import \\$1 \
+\\n[ps-llx] \\n[ps-lly] \\n[ps-urx] \\n[ps-ury] \\n[ps-deswid]'
. br
+. sp \\n[ps-desht]u
.\}
.sy rm /tmp/psbb\\n[$$]
..
diff --git a/ps/tmac.psatk b/ps/tmac.psatk
index 3993c86fb..b59d23a24 100644
--- a/ps/tmac.psatk
+++ b/ps/tmac.psatk
@@ -9,8 +9,8 @@ ps: mdef 5
/saved save def
currentpoint translate
\n[psatk-unit] u -\n[psatk-unit] u scale
- /showpage {} def
userdict begin
+ /showpage {} def
} bind def
/PE {
end
diff --git a/refer/Makefile b/refer/Makefile
index 879cfb750..d20928211 100644
--- a/refer/Makefile
+++ b/refer/Makefile
@@ -33,8 +33,10 @@ DEFAULT_INDEX_NAME=Ind
# If your system provides /usr/lib/eign it will be copied onto this,
# otherwise the supplied eign file will be used.
COMMON_WORDS_FILE=/usr/local/lib/groff/eign
+# Uncomment this if the POSIX pathconf() function is missing.
+PATHCONF_MISSING=#-DPATHCONF_MISSING
-CFLAGS=-g -O -Wall #-DHAVE_MMAP -DHAVE_RENAME -DHAVE_GETWD
+CFLAGS=-g -O -Wall #-DHAVE_MMAP -DHAVE_RENAME -DPATHCONF_MISSING
LDFLAGS=-g
INCLUDES=-I../lib
OLDCFLAGS=-g
@@ -48,7 +50,7 @@ ETAGSFLAGS=-p
PROGS=refer lookbib indxbib lkbib
-INDXBIB_OBJECTS=indxbib.o common.o ../lib/libgroff.a
+INDXBIB_OBJECTS=indxbib.o common.o dirnamemax.o ../lib/libgroff.a
LOOKBIB_OBJECTS=lookbib.o search.o linear.o index.o common.o \
../lib/libgroff.a
REFER_OBJECTS=refer.o ref.o token.o search.o linear.o index.o \
@@ -76,34 +78,30 @@ label.tab.c: label.y
$(YACC) $(YACCFLAGS) label.y
mv y.tab.c label.tab.c
-limits.h: genlimits
- genlimits >$@
-
-genlimits: genlimits.c
+dirnamemax.o: dirnamemax.c
defs=; \
if [ -f /usr/include/limits.h ]; \
then defs=-DHAVE_LIMITS_H; \
fi; \
if [ -f /usr/include/dirent.h ]; \
then defs="$$defs -DHAVE_DIRENT_H"; \
+ elif [ -f /usr/include/sys/dir.h ]; \
+ then defs="$$defs -DHAVE_SYS_DIR_H"; \
fi; \
- $(OLDCC) -o $@ $$defs genlimits.c
+ $(OLDCC) $(OLDCFLAGS) -c $$defs $(PATHCONF_MISSING) dirnamemax.c
suffix.h: FORCE
- @echo \#define INDEX_SUFFIX \"$(INDEX_SUFFIX)\" >suffix.h.n
- @cmp -s suffix.h.n suffix.h || cp suffix.h.n suffix.h
- @rm -f suffix.h.n
+ @$(SHELL) ../gendef $@ "INDEX_SUFFIX=\"$(INDEX_SUFFIX)\""
path.h: FORCE
- @echo \#define COMMON_WORDS_FILE \"$(COMMON_WORDS_FILE)\" >path.h.n
- @echo \#define DEFAULT_INDEX_DIR \"$(DEFAULT_INDEX_DIR)\" >>path.h.n
- @echo \#define DEFAULT_INDEX_NAME \"$(DEFAULT_INDEX_NAME)\" >>path.h.n
- @cmp -s path.h.n path.h || cp path.h.n path.h
- @rm -f path.h.n
+ @$(SHELL) ../gendef $@ \
+ "COMMON_WORDS_FILE=\"$(COMMON_WORDS_FILE)\"" \
+ "DEFAULT_INDEX_DIR=\"$(DEFAULT_INDEX_DIR)\"" \
+ "DEFAULT_INDEX_NAME \"$(DEFAULT_INDEX_NAME)\""
index.o: refid.h search.h index.h suffix.h ../lib/lib.h ../lib/cset.h \
../lib/cmap.h ../lib/errarg.h ../lib/error.h
-indxbib.o: refer.h path.h limits.h index.h suffix.h \
+indxbib.o: refer.h path.h index.h suffix.h \
../lib/errarg.h ../lib/error.h ../lib/cset.h ../lib/cmap.h \
../lib/stringclass.h ../lib/lib.h
linear.o: refid.h search.h ../lib/lib.h ../lib/errarg.h \
@@ -131,10 +129,10 @@ lkbib.o: refer.h path.h refid.h search.h ../lib/errarg.h ../lib/error.h \
../lib/stringclass.h
clean:
- -rm -f *.o $(PROGS) core a.out *.n gmon.out path.h suffix.h
+ -rm -f *.o $(PROGS) core a.out *.n gmon.out path.h suffix.h y.output
distclean: clean
- -rm -f genlimits TAGS limits.h
+ -rm -f TAGS
realclean: distclean
-rm -f label.tab.c
diff --git a/refer/TODO b/refer/TODO
index 13eb08821..0cb2af236 100644
--- a/refer/TODO
+++ b/refer/TODO
@@ -1,3 +1,13 @@
+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 #.
diff --git a/refer/command.c b/refer/command.c
index 745db7c77..b51fc8b31 100644
--- a/refer/command.c
+++ b/refer/command.c
@@ -153,6 +153,7 @@ void input_stack::push_file(const char *fn)
fn = "<standard input>";
}
else {
+ errno = 0;
fp = fopen(fn, "r");
if (fp == 0) {
error("can't open `%1': %2", fn, strerror(errno));
diff --git a/refer/dirnamemax.c b/refer/dirnamemax.c
new file mode 100644
index 000000000..201ec76ce
--- /dev/null
+++ b/refer/dirnamemax.c
@@ -0,0 +1,47 @@
+/* dir_name_max(dir) does the same as pathconf(dir, _PC_NAME_MAX) */
+
+#ifdef PATHCONF_MISSING
+
+#include <sys/types.h>
+
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif /* HAVE_LIMITS_H */
+
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif /* HAVE_DIRENT_H */
+
+#ifdef HAVE_SYS_DIR_H
+#include <sys/dir.h>
+#endif /* HAVE_SYS_DIR_H */
+
+#ifndef NAME_MAX
+#ifdef MAXNAMLEN
+#define NAME_MAX MAXNAMLEN
+#else /* !MAXNAMLEN */
+#ifdef MAXNAMELEN
+#define NAME_MAX MAXNAMELEN
+#else /* !MAXNAMELEN */
+#define NAME_MAX 14
+#endif /* !MAXNAMELEN */
+#endif /* !MAXNAMLEN */
+#endif /* !NAME_MAX */
+
+long dir_name_max(dir)
+ char *dir;
+{
+ return NAME_MAX;
+}
+
+#else /* not PATHCONF_MISSING */
+
+#include <unistd.h>
+
+long dir_name_max(dir)
+ char *dir;
+{
+ return pathconf(dir, _PC_NAME_MAX);
+}
+
+#endif /* not PATHCONF_MISSING */
diff --git a/refer/genlimits.c b/refer/genlimits.c
deleted file mode 100644
index 8f6b7bf0d..000000000
--- a/refer/genlimits.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* This tries to generate definitions of PATH_MAX and NAME_MAX. */
-
-#include <sys/types.h>
-#include <sys/param.h>
-
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#endif /* HAVE_LIMITS_H */
-
-#ifdef HAVE_DIRENT_H
-#include <dirent.h>
-#endif /* HAVE_DIRENT_H */
-
-#ifndef PATH_MAX
-#include <sys/param.h>
-#ifndef PATH_MAX
-#ifdef MAXPATHLEN
-#define PATH_MAX ((MAXPATHLEN)-1)
-#else /* !MAXPATHLEN */
-#define PATH_MAX 255
-#endif /* !MAXPATHLEN */
-#endif /* !PATH_MAX */
-#endif /* !PATH_MAX */
-
-#ifndef NAME_MAX
-#ifdef MAXNAMLEN
-#define NAME_MAX MAXNAMLEN
-#else /* !MAXNAMLEN */
-#ifdef MAXNAMELEN
-#define NAME_MAX MAXNAMELEN
-#else /* !MAXNAMELEN */
-#define NAME_MAX 14
-#endif /* !MAXNAMELEN */
-#endif /* !MAXNAMLEN */
-#endif /* !NAME_MAX */
-
-#include <stdio.h>
-
-main()
-{
- printf("#define NAME_MAX %d\n", NAME_MAX);
- printf("#define PATH_MAX %d\n", PATH_MAX);
- exit(0);
-}
diff --git a/refer/index.c b/refer/index.c
index 1647ddf54..41df7f7f5 100644
--- a/refer/index.c
+++ b/refer/index.c
@@ -24,11 +24,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <osfcn.h>
#include <sys/types.h>
#include <sys/stat.h>
-
-extern "C" {
- int stat(const char *, struct stat *);
- int fstat(int, struct stat *);
-}
+#include <errno.h>
#ifdef HAVE_MMAP
#ifdef __GNUG__
@@ -562,6 +558,7 @@ void index_search_item::read_common_words_file()
if (header.common <= 0)
return;
const char *common_words_file = munge_filename(strchr(pool, '\0') + 1);
+ errno = 0;
FILE *fp = fopen(common_words_file, "r");
if (!fp) {
error("can't open `%1': %2", common_words_file, strerror(errno));
diff --git a/refer/indxbib.c b/refer/indxbib.c
index ca73dd5ac..315194b7b 100644
--- a/refer/indxbib.c
+++ b/refer/indxbib.c
@@ -24,10 +24,13 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "refer.h"
-// limits.h defines NAME_MAX and PATH_MAX
-#include "limits.h"
#include "index.h"
+extern "C" {
+ // Sun's stdlib.h fails to declare this.
+ char *mktemp(char *);
+}
+
#define DEFAULT_HASH_TABLE_SIZE 997
#define TEMP_INDEX_TEMPLATE "indxbibXXXXXX"
@@ -90,9 +93,12 @@ static void store_reference(int filename_index, int pos, int len);
static void check_integer_arg(char opt, const char *arg, int min, int *res);
static void store_filename(const char *);
static void fwrite_or_die(const void *ptr, int size, int nitems, FILE *fp);
+static char *get_cwd();
extern "C" { void fatal_signal(int); }
+extern "C" { long dir_name_max(const char *); }
+
int main(int argc, char **argv)
{
program_name = argv[0];
@@ -162,16 +168,9 @@ int main(int argc, char **argv)
if (optind >= argc && foption == 0)
fatal("no files and no -f option");
if (!directory) {
-#ifdef HAVE_GETWD
- char path[PATH_MAX + 1];
- if (!getwd(path))
- fatal("getwd: %1", path);
-#else /* !HAVE_GETWD */
- char path[PATH_MAX + 2];
- if (!getcwd(path, PATH_MAX + 2))
- fatal("getcwd: %1", strerror(errno));
-#endif /* !HAVE_GETWD */
+ char *path = get_cwd();
store_filename(path);
+ delete path;
}
else
store_filename(directory);
@@ -183,9 +182,18 @@ int main(int argc, char **argv)
if (!basename)
basename = optind < argc ? argv[optind] : DEFAULT_INDEX_NAME;
const char *p = strrchr(basename, '/');
- if (strlen(p ? p + 1 : basename) + 2 > NAME_MAX
- || strlen(basename) + 2 > PATH_MAX)
- fatal("`%1.i' would not be a valid filename", basename);
+ long name_max;
+ if (p) {
+ char *dir = strsave(basename);
+ dir[p - basename] = '\0';
+ name_max = dir_name_max(dir);
+ delete dir;
+ }
+ else
+ name_max = dir_name_max(".");
+ const char *filename = p ? p + 1 : basename;
+ if (name_max >= 0 && strlen(filename) + sizeof(INDEX_SUFFIX) - 1 > name_max)
+ fatal("`%1.%2' is too long for a filename", filename, INDEX_SUFFIX);
if (p) {
p++;
temp_index_file = new char[p - basename + sizeof(TEMP_INDEX_TEMPLATE)];
@@ -195,7 +203,8 @@ int main(int argc, char **argv)
else {
temp_index_file = strsave(TEMP_INDEX_TEMPLATE);
}
- mktemp(temp_index_file);
+ if (!mktemp(temp_index_file) || !temp_index_file[0])
+ fatal("cannot create file name for temporary file");
signal(SIGHUP, fatal_signal);
signal(SIGINT, fatal_signal);
signal(SIGTERM, fatal_signal);
@@ -211,6 +220,7 @@ int main(int argc, char **argv)
if (foption) {
FILE *fp = stdin;
if (strcmp(foption, "-") != 0) {
+ errno = 0;
fp = fopen(foption, "r");
if (!fp)
fatal("can't open `%1': %2", foption, strerror(errno));
@@ -293,6 +303,27 @@ static void check_integer_arg(char opt, const char *arg, int min, int *res)
}
}
+static char *get_cwd()
+{
+ char *buf;
+ int size = 12;
+
+ for (;;) {
+ buf = new char[size];
+ if (getcwd(buf, size))
+ break;
+ if (errno != ERANGE)
+ fatal("cannot get current working directory: %1", strerror(errno));
+ delete buf;
+ if (size == INT_MAX)
+ fatal("current working directory longer than INT_MAX");
+ if (size > INT_MAX/2)
+ size = INT_MAX;
+ else
+ size *= 2;
+ }
+ return buf;
+}
word_list::word_list(const char *s, int n, word_list *p)
: next(p), len(n)
@@ -305,6 +336,7 @@ static void read_common_words_file()
{
if (n_ignore_words <= 0)
return;
+ errno = 0;
FILE *fp = fopen(common_words_file, "r");
if (!fp)
fatal("can't open `%1': %2", common_words_file, strerror(errno));
@@ -341,6 +373,7 @@ static void read_common_words_file()
static int do_whole_file(const char *filename)
{
+ errno = 0;
FILE *fp = fopen(filename, "r");
if (!fp) {
error("can't open `%1': %2", filename, strerror(errno));
@@ -375,6 +408,7 @@ static int do_whole_file(const char *filename)
static int do_file(const char *filename)
{
+ errno = 0;
FILE *fp = fopen(filename, "r");
if (fp == 0) {
error("can't open `%1': %2", filename, strerror(errno));
diff --git a/refer/label.tab.c b/refer/label.tab.c
index 9ed67aea2..9ecaa4461 100644
--- a/refer/label.tab.c
+++ b/refer/label.tab.c
@@ -903,7 +903,7 @@ case 19:
break;
default:
yyval.expr = yyvsp[-4].expr;
- command_error("unknown function `%1'", char(yyvsp[-4].expr));
+ command_error("unknown function `%1'", char(yyvsp[-1].num));
break;
}
;
diff --git a/refer/label.y b/refer/label.y
index 95c24a1b9..a93da4290 100644
--- a/refer/label.y
+++ b/refer/label.y
@@ -345,7 +345,7 @@ string:
break;
default:
$$ = $1;
- command_error("unknown function `%1'", char($1));
+ command_error("unknown function `%1'", char($4));
break;
}
}
diff --git a/refer/linear.c b/refer/linear.c
index 1b2aa921e..dded46625 100644
--- a/refer/linear.c
+++ b/refer/linear.c
@@ -25,11 +25,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
-
-extern "C" {
- int stat(const char *, struct stat *);
- int fstat(int, struct stat *);
-}
+#include <errno.h>
#include "lib.h"
#include "errarg.h"
@@ -327,6 +323,8 @@ int file_buffer::load(int fd, const char *filename)
nread = read(fd, &c, 1);
if (nread != 0)
error("size of `%1' increased", filename);
+ else if (memchr(buffer + 4, '\0', size < 1024 ? size : 1024) != 0)
+ error("database `%1' is a binary file", filename);
else {
close(fd);
buffer[3] = '\n';
@@ -409,11 +407,6 @@ int linear_searcher::search(const char *buffer, const char *bufend,
return 0;
}
-int linear_searcher::get_nkeys() const
-{
- return nkeys;
-}
-
class linear_search_item : public search_item {
file_buffer fbuf;
public:
diff --git a/refer/lkbib.c b/refer/lkbib.c
index 432674bd2..5656f04d9 100644
--- a/refer/lkbib.c
+++ b/refer/lkbib.c
@@ -102,13 +102,12 @@ main(int argc, char **argv)
char *start;
int len;
for (int count = 0; iter.next(&start, &len); count++) {
- if (count > 0)
- putchar('\n');
if (fwrite(start, 1, len, stdout) != len)
fatal("write error on stdout: %1", strerror(errno));
// Can happen for last reference in file.
if (start[len - 1] != '\n')
putchar('\n');
+ putchar('\n');
}
exit(!count);
}
diff --git a/refer/lookbib.c b/refer/lookbib.c
index 47a28e5a4..0429d900b 100644
--- a/refer/lookbib.c
+++ b/refer/lookbib.c
@@ -22,6 +22,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdlib.h>
#include <string.h>
#include <assert.h>
+#include <errno.h>
#include "errarg.h"
#include "error.h"
@@ -31,6 +32,10 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "refid.h"
#include "search.h"
+extern "C" {
+ int isatty(int);
+}
+
static void usage()
{
fprintf(stderr, "usage: %s [-v] [-i XYZ] [-t N] database ...\n",
@@ -85,7 +90,6 @@ main(int argc, char **argv)
if (list.nfiles() == 0)
fatal("no databases");
char line[1024];
- int first = 1;
int interactive = isatty(fileno(stdin));
for (;;) {
if (interactive) {
@@ -103,15 +107,12 @@ main(int argc, char **argv)
char *start;
int len;
for (int count = 0; iter.next(&start, &len); count++) {
- if (first)
- first = 0;
- else
- putchar('\n');
if (fwrite(start, 1, len, stdout) != len)
fatal("write error on stdout: %1", strerror(errno));
// Can happen for last reference in file.
if (start[len - 1] != '\n')
putchar('\n');
+ putchar('\n');
}
fflush(stdout);
if (interactive) {
diff --git a/refer/refer.c b/refer/refer.c
index c59573b7a..79a2e4749 100644
--- a/refer/refer.c
+++ b/refer/refer.c
@@ -27,8 +27,6 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "search.h"
#include "command.h"
-#define TEMP_TEMPLATE "/tmp/greferXXXXXX"
-
const char PRE_LABEL_MARKER = '\013';
const char POST_LABEL_MARKER = '\014';
const char LABEL_MARKER = '\015'; // label_type is added on
@@ -420,6 +418,7 @@ static void do_file(const char *filename)
fp = stdin;
}
else {
+ errno = 0;
fp = fopen(filename, "r");
if (fp == 0) {
error("can't open `%1': %2", filename, strerror(errno));
@@ -667,15 +666,7 @@ static void split_punct(string &line, string &punct)
static void divert_to_temporary_file()
{
- char temp_filename[sizeof(TEMP_TEMPLATE)];
- strcpy(temp_filename, TEMP_TEMPLATE);
- mktemp(temp_filename);
- outfp = fopen(temp_filename, "w+");
- if (outfp == 0)
- fatal("can't open temporary file `%1': %2",
- temp_filename, strerror(errno));
- if (unlink(temp_filename) < 0)
- error("can't unlink `%1': %2", temp_filename, strerror(errno));
+ outfp = xtmpfile();
}
static void store_citation(reference *ref)
@@ -736,7 +727,8 @@ static unsigned store_reference(const string &str)
reference_hash_table[i] = 0;
for (i = 0; i < old_size; i++)
if (old_table[i]) {
- for (reference **p = reference_hash_table + (h % hash_table_size);
+ for (reference **p = (reference_hash_table
+ + (old_table[i]->hash() % hash_table_size));
*p;
((p == reference_hash_table)
? (p = reference_hash_table + hash_table_size - 1)
@@ -1092,6 +1084,7 @@ void do_bib(const char *filename)
if (strcmp(filename, "-") == 0)
fp = stdin;
else {
+ errno = 0;
fp = fopen(filename, "r");
if (fp == 0) {
error("can't open `%1': %2", filename, strerror(errno));
diff --git a/refer/refer.h b/refer/refer.h
index e1bb5224b..7776382cc 100644
--- a/refer/refer.h
+++ b/refer/refer.h
@@ -22,6 +22,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdlib.h>
#include <assert.h>
#include <string.h>
+#include <errno.h>
#include "errarg.h"
#include "error.h"
diff --git a/refer/search.c b/refer/search.c
index fd87d10c8..c0f2bd9cf 100644
--- a/refer/search.c
+++ b/refer/search.c
@@ -22,6 +22,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <osfcn.h>
#include <string.h>
#include <assert.h>
+#include <errno.h>
#include "lib.h"
#include "errarg.h"
diff --git a/refer/search.h b/refer/search.h
index 41a6db3cd..e2cf8a3dd 100644
--- a/refer/search.h
+++ b/refer/search.h
@@ -53,7 +53,6 @@ public:
~linear_searcher();
int search(const char *buf, const char *bufend,
const char **startp, int *lengthp) const;
- int get_nkeys() const;
};
class search_list_iterator {
diff --git a/tbl/main.c b/tbl/main.c
index b087f49b1..4c4c1d9f0 100644
--- a/tbl/main.c
+++ b/tbl/main.c
@@ -693,10 +693,9 @@ void input_entry_format::debug_print()
putc(',', stderr);
}
-
-// return zero if we should give up on this table
-// if this is a continuation format line, current_format will be the current
-// format line
+// Return zero if we should give up on this table.
+// If this is a continuation format line, current_format will be the current
+// format line.
format *process_format(table_input &in, options *opt,
format *current_format = 0)
@@ -704,76 +703,89 @@ format *process_format(table_input &in, options *opt,
input_entry_format *list = 0;
int c = in.get();
for (;;) {
- while (c == ' ' || c == '\t' || c == opt->tab_char || c == '\n')
- c = in.get();
int pre_vline = 0;
- if (c == '|') {
- pre_vline = 1;
- c = in.get();
- while (c == ' ' || c == '\t' || c == opt->tab_char)
- c = in.get();
- if (c == '|') {
- pre_vline = 2;
- c = in.get();
- while (c == ' ' || c == '\t' || c == opt->tab_char)
- c = in.get();
+ int got_format = 0;
+ int got_period = 0;
+ format_type t;
+ for (;;) {
+ if (c == EOF) {
+ error("end of input while processing format");
+ free_input_entry_format_list(list);
+ return 0;
}
+ switch (c) {
+ case 'n':
+ case 'N':
+ t = entry_format::NUMERIC;
+ got_format = 1;
+ break;
+ case 'a':
+ case 'A':
+ got_format = 1;
+ t = entry_format::ALPHABETIC;
+ break;
+ case 'c':
+ case 'C':
+ got_format = 1;
+ t = entry_format::CENTER;
+ break;
+ case 'l':
+ case 'L':
+ got_format = 1;
+ t = entry_format::LEFT;
+ break;
+ case 'r':
+ case 'R':
+ got_format = 1;
+ t = entry_format::RIGHT;
+ break;
+ case 's':
+ case 'S':
+ got_format = 1;
+ t = entry_format::SPAN;
+ break;
+ case '^':
+ got_format = 1;
+ t = entry_format::VSPAN;
+ break;
+ case '_':
+ got_format = 1;
+ t = entry_format::HLINE;
+ break;
+ case '=':
+ got_format = 1;
+ t = entry_format::DOUBLE_HLINE;
+ break;
+ case '.':
+ got_period = 1;
+ break;
+ case '|':
+ pre_vline++;
+ break;
+ case ' ':
+ case '\t':
+ case '\n':
+ break;
+ default:
+ if (c == opt->tab_char)
+ break;
+ error("unrecognised format `%1'", char(c));
+ free_input_entry_format_list(list);
+ return 0;
+ }
+ if (got_period)
+ break;
+ c = in.get();
+ if (got_format)
+ break;
}
- if (c == '.')
- break;
- if (c == EOF) {
- error("end of input while processing format");
- free_input_entry_format_list(list);
- return 0;
- }
- format_type t;
- switch (c) {
- case 'n':
- case 'N':
- t = entry_format::NUMERIC;
- break;
- case 'a':
- case 'A':
- t = entry_format::ALPHABETIC;
- break;
- case 'c':
- case 'C':
- t = entry_format::CENTER;
- break;
- case 'l':
- case 'L':
- t = entry_format::LEFT;
- break;
- case 'r':
- case 'R':
- t = entry_format::RIGHT;
- break;
- case 's':
- case 'S':
- t = entry_format::SPAN;
+ if (got_period)
break;
- case '^':
- t = entry_format::VSPAN;
- break;
- case '_':
- t = entry_format::HLINE;
- break;
- case '=':
- t = entry_format::DOUBLE_HLINE;
- break;
- default:
- error("unrecognised format `%1'", char(c));
- free_input_entry_format_list(list);
- return 0;
- }
- c = in.get();
list = new input_entry_format(t, list);
if (pre_vline)
list->pre_vline = pre_vline;
int success = 1;
do {
- while (c == ' ' || c == '\t' || c == opt->tab_char)
- c = in.get();
switch (c) {
case 't':
case 'T':
@@ -955,8 +967,15 @@ format *process_format(table_input &in, options *opt,
c = in.get();
list->font = "I";
break;
+ case ' ':
+ case '\t':
+ c = in.get();
+ break;
default:
- success = 0;
+ if (c == opt->tab_char)
+ c = in.get();
+ else
+ success = 0;
break;
}
} while (success);
@@ -1079,7 +1098,6 @@ format *process_format(table_input &in, options *opt,
return f;
}
-
table *process_data(table_input &in, format *f, options *opt)
{
char tab_char = opt->tab_char;
@@ -1426,6 +1444,7 @@ int main(int argc, char **argv)
process_input_file(stdin);
}
else {
+ errno = 0;
FILE *fp = fopen(argv[i], "r");
if (fp == 0) {
current_lineno = -1;
diff --git a/tbl/table.c b/tbl/table.c
index f4147fb44..ea6828b9d 100644
--- a/tbl/table.c
+++ b/tbl/table.c
@@ -158,8 +158,8 @@ public:
virtual double_line_entry *to_double_line_entry();
virtual simple_entry *to_simple_entry();
virtual int line_type();
- virtual void note_double_vrule_on_right();
- virtual void note_double_vrule_on_left();
+ virtual void note_double_vrule_on_right(int);
+ virtual void note_double_vrule_on_left(int);
};
class simple_entry : public table_entry {
@@ -232,6 +232,7 @@ public:
alphabetic_text_entry(char *s, const entry_modifier *m);
void do_width();
void simple_print(int);
+ void add_tab();
};
class line_entry : public simple_entry {
@@ -240,8 +241,8 @@ protected:
char double_vrule_on_left;
public:
line_entry(const entry_modifier *);
- void note_double_vrule_on_right();
- void note_double_vrule_on_left();
+ void note_double_vrule_on_right(int);
+ void note_double_vrule_on_left(int);
void simple_print(int) = 0;
};
@@ -362,11 +363,11 @@ int table_entry::line_type()
return -1;
}
-void table_entry::note_double_vrule_on_right()
+void table_entry::note_double_vrule_on_right(int)
{
}
-void table_entry::note_double_vrule_on_left()
+void table_entry::note_double_vrule_on_left(int)
{
}
@@ -603,6 +604,13 @@ void alphabetic_text_entry::simple_print(int)
printfs("\\*[%1]", text_string_name(start_row, start_col));
}
+// The only point of this is to make `\a' ``work'' as in Unix tbl. Grrr.
+
+void alphabetic_text_entry::add_tab()
+{
+ printfs(" \\n[%1]u", column_end_reg(end_col));
+}
+
block_entry::block_entry(char *s, const entry_modifier *m)
: table_entry(m), contents(s)
{
@@ -767,14 +775,14 @@ line_entry::line_entry(const entry_modifier *m)
{
}
-void line_entry::note_double_vrule_on_right()
+void line_entry::note_double_vrule_on_right(int is_corner)
{
- double_vrule_on_right = 1;
+ double_vrule_on_right = is_corner ? 1 : 2;
}
-void line_entry::note_double_vrule_on_left()
+void line_entry::note_double_vrule_on_left(int is_corner)
{
- double_vrule_on_left = 1;
+ double_vrule_on_left = is_corner ? 1 : 2;
}
@@ -792,15 +800,19 @@ void single_line_entry::simple_print(int dont_move)
{
printfs("\\h'|\\n[%1]u",
column_divide_reg(start_col));
- if (double_vrule_on_left)
- prints("+" HALF_DOUBLE_LINE_SEP);
+ if (double_vrule_on_left) {
+ prints(double_vrule_on_left == 1 ? "-" : "+");
+ prints(HALF_DOUBLE_LINE_SEP);
+ }
prints("'");
if (!dont_move)
prints("\\v'-" BAR_HEIGHT "'");
printfs("\\s[\\n[" LINESIZE_REG "]]" "\\D'l |\\n[%1]u",
column_divide_reg(end_col+1));
- if (double_vrule_on_right)
- prints("-" HALF_DOUBLE_LINE_SEP);
+ if (double_vrule_on_right) {
+ prints(double_vrule_on_left == 1 ? "+" : "-");
+ prints(HALF_DOUBLE_LINE_SEP);
+ }
prints("0'\\s0");
if (!dont_move)
prints("\\v'" BAR_HEIGHT "'");
@@ -827,8 +839,10 @@ void double_line_entry::simple_print(int dont_move)
prints("\\v'-" BAR_HEIGHT "'");
printfs("\\h'|\\n[%1]u",
column_divide_reg(start_col));
- if (double_vrule_on_left)
- prints("+" HALF_DOUBLE_LINE_SEP);
+ if (double_vrule_on_left) {
+ prints(double_vrule_on_left == 1 ? "-" : "+");
+ prints(HALF_DOUBLE_LINE_SEP);
+ }
prints("'");
printfs("\\v'-" HALF_DOUBLE_LINE_SEP "'"
"\\s[\\n[" LINESIZE_REG "]]"
@@ -840,8 +854,10 @@ void double_line_entry::simple_print(int dont_move)
printfs("\\v'" DOUBLE_LINE_SEP "'"
"\\D'l |\\n[%1]u",
column_divide_reg(start_col));
- if (double_vrule_on_left)
- prints("+" HALF_DOUBLE_LINE_SEP);
+ if (double_vrule_on_right) {
+ prints(double_vrule_on_left == 1 ? "+" : "-");
+ prints(HALF_DOUBLE_LINE_SEP);
+ }
prints(" 0'");
prints("\\s0"
"\\v'-" HALF_DOUBLE_LINE_SEP "'");
@@ -1996,11 +2012,11 @@ void table::compute_separation_factor()
for (int i = 0; i < ncolumns - 1; i++)
total_sep += column_separation[i];
if (total_sep != 0) {
- // don't let the separation factor be less than 1n
+ // Don't let the separation factor be negative.
prints(".nr " SEPARATION_FACTOR_REG " \\n[.l]-\\n[.i]");
for (i = 0; i < ncolumns; i++)
printfs("-\\n[%1]", span_width_reg(i, i));
- printfs("/%1>?1n\n", as_string(total_sep));
+ printfs("/%1>?0\n", as_string(total_sep));
}
}
}
@@ -2387,11 +2403,15 @@ void table::build_vrule_list()
if (p->is_double)
for (int r = p->start_row; r <= p->end_row; r++) {
if (p->col > 0 && entry[r][p->col-1] != 0
- && entry[r][p->col-1]->end_col == p->col-1)
- entry[r][p->col-1]->note_double_vrule_on_right();
+ && entry[r][p->col-1]->end_col == p->col-1) {
+ int is_corner = r == p->start_row || r == p->end_row;
+ entry[r][p->col-1]->note_double_vrule_on_right(is_corner);
+ }
if (p->col < ncolumns && entry[r][p->col] != 0
- && entry[r][p->col]->start_col == p->col)
- entry[r][p->col]->note_double_vrule_on_left();
+ && entry[r][p->col]->start_col == p->col) {
+ int is_corner = r == p->start_row || r == p->end_row;
+ entry[r][p->col]->note_double_vrule_on_left(is_corner);
+ }
}
}
diff --git a/troff/Makefile b/troff/Makefile
index 3d53f7904..f0614882e 100644
--- a/troff/Makefile
+++ b/troff/Makefile
@@ -54,7 +54,7 @@ majorminor.c: ../VERSION
@echo const char \*major_version = \
\"`sed -e 's/^\(.*\)\..*$$/\1/' ../VERSION`\"\; >$@
@echo const char \*minor_version = \
- \"`sed -e 's/^.*\.\(.*\)$$/\1/' ../VERSION`\"\; >>$@
+ \"`sed -e 's/^.*\.\([0-9]*\).*$$/\1/' ../VERSION`\"\; >>$@
dictionary.o: dictionary.h $(TROFF_H) symbol.h
symbol.o: $(TROFF_H) symbol.h
@@ -73,11 +73,8 @@ column.o: dictionary.h div.h env.h $(TROFF_H) hvunits.h \
node.h reg.h request.h symbol.h token.h ../lib/stringclass.h
config.h: FORCE
- @echo \#define MACROPATH \"$(MACROPATH)\" >config.h.n
- @echo \#define HYPHENFILE \"$(HYPHENFILE)\" >>config.h.n
- @echo \#define DEVICE \"$(DEVICE)\" >>config.h.n
- @cmp -s config.h config.h.n || cp config.h.n config.h
- @rm -f config.h.n
+ @$(SHELL) ../gendef $@ "MACROPATH=\"$(MACROPATH)\"" \
+ "HYPHENFILE=\"$(HYPHENFILE)\"" "DEVICE=\"$(DEVICE)\""
TAGS : $(SOURCES)
$(ETAGS) $(ETAGSFLAGS) $(SOURCES) $(HEADERS)
@@ -94,7 +91,7 @@ distclean: clean
realclean: distclean
-install.bin : troff
+install.bin: troff
-[ -d $(BINDIR) ] || mkdir $(BINDIR)
-rm -f $(BINDIR)/gtroff
cp troff $(BINDIR)/gtroff
diff --git a/troff/env.c b/troff/env.c
index 61515b4af..dd288d183 100644
--- a/troff/env.c
+++ b/troff/env.c
@@ -53,7 +53,7 @@ static int next_line_number = 0;
charinfo *field_delimiter_char;
charinfo *padding_indicator_char;
-
+int translate_space_to_dummy = 0;
class pending_output_line {
node *nd;
@@ -314,6 +314,7 @@ void environment::add_node(node *n)
else {
if (line == 0) {
if (discarding && n->discardable()) {
+ // XXX possibly: input_line_start -= n->width();
delete n;
return;
}
@@ -405,7 +406,9 @@ void environment::space_newline()
int ss = space_size;
if (node_list_ends_sentence(line) == 1)
ss += sentence_space_size;
- hunits x = scale(env_space_width(this), ss, 12);
+ hunits x = (translate_space_to_dummy
+ ? H0
+ : scale(env_space_width(this), ss, 12));
if (line != 0 && line->merge_space(x)) {
width_total += x;
return;
@@ -426,12 +429,16 @@ void environment::space()
*hp += 1;
return;
}
- hunits x = scale(env_space_width(this), space_size, 12);
+ hunits x = (translate_space_to_dummy
+ ? H0
+ : scale(env_space_width(this), space_size, 12));
node *p = current_tab ? tab_contents : line;
hunits *tp = current_tab ? &tab_width : &width_total;
if (p && p->nspaces() == 1 && p->width() == x
&& node_list_ends_sentence(p->next) == 1) {
- hunits xx = scale(env_space_width(this), sentence_space_size, 12);
+ hunits xx = (translate_space_to_dummy
+ ? H0
+ : scale(env_space_width(this), sentence_space_size, 12));
if (p->merge_space(xx)) {
*tp += xx;
return;
@@ -1654,13 +1661,15 @@ void environment::hyphenate_line()
tem1->next = forward;
forward = tem1;
}
- // this is for characters like hyphen and emdash
- int prev_code = 0;
- for (hyphen_list *h = sl; h; h = h->next) {
- h->breakable = (prev_code != 0
- && h->next != 0
- && h->next->hyphenation_code != 0);
- prev_code = h->hyphenation_code;
+ if (!inhibit) {
+ // this is for characters like hyphen and emdash
+ int prev_code = 0;
+ for (hyphen_list *h = sl; h; h = h->next) {
+ h->breakable = (prev_code != 0
+ && h->next != 0
+ && h->next->hyphenation_code != 0);
+ prev_code = h->hyphenation_code;
+ }
}
if (hyphenation_flags != 0
&& !inhibit
@@ -1964,15 +1973,12 @@ struct tab {
hunits pos;
tab_type type;
tab(hunits, tab_type);
-#ifndef OP_DELETE_BROKEN
enum { BLOCK = 1024 };
static tab *free_list;
void *operator new(size_t);
void operator delete(void *);
-#endif /* not OP_DELETE_BROKEN */
};
-#ifndef OP_DELETE_BROKEN
tab *tab::free_list = 0;
void *tab::operator new(size_t n)
@@ -2002,8 +2008,6 @@ void tab::operator delete(void *p)
}
}
-#endif /* not OP_DELETE_BROKEN */
-
tab::tab(hunits x, tab_type t) : next(0), pos(x), type(t)
{
}
@@ -2866,6 +2870,7 @@ void hyphen_trie::read_patterns_file(const char *name)
clear();
char buf[WORD_MAX];
int num[WORD_MAX+1];
+ errno = 0;
FILE *fp = fopen(name, "r");
if (fp == 0)
fatal("can't open hyphenation patterns file `%1': %2",
diff --git a/troff/env.h b/troff/env.h
index e8ca90dc9..eaed44da9 100644
--- a/troff/env.h
+++ b/troff/env.h
@@ -307,3 +307,4 @@ void read_hyphen_file(const char *name);
extern int break_flag;
extern symbol default_family;
+extern int translate_space_to_dummy;
diff --git a/troff/input.c b/troff/input.c
index ef8a6a230..f00978209 100644
--- a/troff/input.c
+++ b/troff/input.c
@@ -167,7 +167,7 @@ private:
virtual int set_location(const char *, int)
{ return 0; }
virtual int next_file(FILE *, const char *) { return 0; }
- virtual void shift(int n) {}
+ virtual void shift(int) {}
virtual int is_boundary();
virtual int internal_level() { return 0; }
};
@@ -523,6 +523,7 @@ void next_file()
while (!tok.newline() && !tok.eof())
tok.next();
if (!nm.is_null()) {
+ errno = 0;
FILE *fp = fopen(nm.contents(), "r");
if (!fp)
error("can't open `%1': %2", nm.contents(), strerror(errno));
@@ -2527,19 +2528,16 @@ temp_iterator::~temp_iterator()
class small_temp_iterator : public input_iterator {
private:
small_temp_iterator(const char *, int);
-#ifndef OP_DELETE_BROKEN
~small_temp_iterator();
enum { BLOCK = 16 };
static small_temp_iterator *free_list;
void *operator new(size_t);
void operator delete(void *);
-#endif /* not OP_DELETE_BROKEN */
enum { SIZE = 12 };
unsigned char buf[SIZE];
friend input_iterator *make_temp_iterator(const char *);
};
-#ifndef OP_DELETE_BROKEN
small_temp_iterator *small_temp_iterator::free_list = 0;
void *small_temp_iterator::operator new(size_t n)
@@ -2572,7 +2570,6 @@ small_temp_iterator::~small_temp_iterator()
{
}
-#endif /* not OP_DELETE_BROKEN */
#ifdef __GNUG__
inline
@@ -3098,6 +3095,10 @@ void do_define_macro(define_mode mode)
term = dot_symbol;
while (!tok.newline() && !tok.eof())
tok.next();
+ const char *start_filename;
+ int start_lineno;
+ int have_start_location = input_stack::get_location(0, &start_filename,
+ &start_lineno);
node *n;
// doing this here makes the line numbers come out right
int c = get_copy(&n, 1);
@@ -3118,11 +3119,6 @@ void do_define_macro(define_mode mode)
mac.append(c);
c = get_copy(&n, 1);
}
- if (c == EOF) {
- error("end of file while defining macro");
- tok.next();
- return;
- }
if (bol && c == '.') {
const char *s = term.contents();
int d;
@@ -3132,11 +3128,6 @@ void do_define_macro(define_mode mode)
if ((unsigned char)s[i] != d)
break;
}
- if (d == EOF) {
- error("end of file while defining macro");
- tok.next();
- return;
- }
if (s[i] == 0
&& ((i == 2 && compatible_flag)
|| (d = get_copy(&n)) == ' '
@@ -3165,6 +3156,25 @@ void do_define_macro(define_mode mode)
}
c = d;
}
+ if (c == EOF) {
+ if (mode == DEFINE_NORMAL || mode == DEFINE_APPEND) {
+ if (have_start_location)
+ error_with_file_and_line(start_filename, start_lineno,
+ "end of file while defining macro `%1'",
+ nm.contents());
+ else
+ error("end of file while defining macro `%1'", nm.contents());
+ }
+ else {
+ if (have_start_location)
+ error_with_file_and_line(start_filename, start_lineno,
+ "end of file while ignoring input lines");
+ else
+ error("end of file while ignoring input lines");
+ }
+ tok.next();
+ return;
+ }
if (mode == DEFINE_NORMAL || mode == DEFINE_APPEND) {
if (c == 0)
mac.append(n);
@@ -4022,6 +4032,7 @@ void source()
else {
while (!tok.newline() && !tok.eof())
tok.next();
+ errno = 0;
FILE *fp = fopen(nm.contents(), "r");
if (fp)
input_stack::push(new file_iterator(fp, nm.contents()));
@@ -4156,6 +4167,7 @@ void do_open(int append)
if (!stream.is_null()) {
symbol filename = get_long_name(1);
if (!filename.is_null()) {
+ errno = 0;
FILE *fp = fopen(filename.contents(), append ? "a" : "w");
if (!fp) {
error("can't open `%1' for %2: %3",
@@ -4253,16 +4265,27 @@ static void init_charset_table()
void translate()
{
tok.skip();
- while (!tok.newline() && !tok.space() && !tok.eof()) {
+ while (!tok.newline() && !tok.eof()) {
+ if (tok.space()) {
+ // This is a really bizarre troff feature.
+ tok.next();
+ translate_space_to_dummy = tok.dummy();
+ if (tok.newline() || tok.eof())
+ break;
+ tok.next();
+ continue;
+ }
charinfo *ci1 = tok.get_char(1);
if (ci1 == 0)
break;
tok.next();
- if (tok.newline() || tok.space() || tok.eof()) {
+ if (tok.newline() || tok.eof()) {
ci1->set_special_translation(charinfo::TRANSLATE_SPACE);
break;
}
- if (tok.dummy())
+ if (tok.space())
+ ci1->set_special_translation(charinfo::TRANSLATE_SPACE);
+ else if (tok.dummy())
ci1->set_special_translation(charinfo::TRANSLATE_DUMMY);
else {
charinfo *ci2 = tok.get_char(1);
@@ -4328,6 +4351,14 @@ charinfo *token::get_char(int required)
return get_charinfo(nm);
if (type == TOKEN_NUMBERED_CHAR)
return get_charinfo_by_number(val);
+ if (type == TOKEN_ESCAPE) {
+ if (escape_char != 0)
+ return charset_table[escape_char];
+ else {
+ error("`\\e' used while no current escape character");
+ return 0;
+ }
+ }
if (required) {
if (type == TOKEN_EOF || type == TOKEN_NEWLINE)
warning(WARN_MISSING, "missing normal or special character");
@@ -4720,6 +4751,7 @@ void transparent_file()
if (break_flag)
curenv->do_break();
if (!filename.is_null()) {
+ errno = 0;
FILE *fp = fopen(filename.contents(), "r");
if (!fp)
error("can't open `%1': %2", filename.contents(), strerror(errno));
@@ -4842,6 +4874,7 @@ static FILE *open_file(const char *filename, string_list *dirs, char **pathp)
if (need_slash)
strcat(path, "/");
strcat(path, filename);
+ errno = 0;
FILE *fp = fopen(path, "r");
if (fp) {
*pathp = path;
@@ -4926,6 +4959,7 @@ static void process_input_file(const char *name)
fp = stdin;
}
else {
+ errno = 0;
fp = fopen(name, "r");
if (!fp)
fatal("can't open `%1': %2", name, strerror(errno));
@@ -5395,8 +5429,12 @@ void warn_request()
static void init_registers()
{
- long t;
- time(&t);
+#ifdef LONG_FOR_TIME_T
+ long
+#else /* not LONG_FOR_TIME_T */
+ time_t
+#endif /* not LONG_FOR_TIME_T */
+ t = time(0);
tm *tt = localtime(&t);
set_number_reg("dw", int(tt->tm_wday + 1));
set_number_reg("dy", int(tt->tm_mday));
diff --git a/troff/node.c b/troff/node.c
index 9a38c4f4e..aebae6658 100644
--- a/troff/node.c
+++ b/troff/node.c
@@ -1085,6 +1085,7 @@ void troff_output_file::really_copy_file(hunits x, vunits y, const char *filenam
moveto(x, y);
flush_tbuf();
do_motion();
+ errno = 0;
FILE *ifp = fopen(filename, "r");
if (ifp == 0)
error("can't open `%1': %2", filename, strerror(errno));
@@ -1272,11 +1273,11 @@ void suppress_output_file::really_print_line(hunits, vunits, node *, vunits, vun
{
}
-void suppress_output_file::really_begin_page(int pageno, vunits page_length)
+void suppress_output_file::really_begin_page(int, vunits)
{
}
-void suppress_output_file::really_transparent_char(unsigned char c)
+void suppress_output_file::really_transparent_char(unsigned char)
{
}
@@ -1292,14 +1293,10 @@ protected:
glyph_node(charinfo *, tfont *, hunits, node * = 0);
#endif
public:
-#ifndef OP_DELETE_BROKEN
void *operator new(size_t);
void operator delete(void *);
-#endif /* not OP_DELETE_BROKEN */
glyph_node(charinfo *, tfont *, node * = 0);
-#ifndef OP_DELETE_BROKEN
~glyph_node() {}
-#endif /* not OP_DELETE_BROKEN */
node *copy();
node *merge_glyph_node(glyph_node *);
node *merge_self(node *);
@@ -1336,10 +1333,8 @@ class ligature_node : public glyph_node {
ligature_node(charinfo *, tfont *, hunits, node *gn1, node *gn2, node *x = 0);
#endif
public:
-#ifndef OP_DELETE_BROKEN
void *operator new(size_t);
void operator delete(void *);
-#endif /* OP_DELETE_BROKEN */
ligature_node(charinfo *, tfont *, node *gn1, node *gn2, node *x = 0);
~ligature_node();
node *copy();
@@ -1403,7 +1398,6 @@ public:
const char *type();
};
-#ifndef OP_DELETE_BROKEN
void *glyph_node::operator new(size_t n)
{
assert(n == sizeof(glyph_node));
@@ -1437,7 +1431,6 @@ void ligature_node::operator delete(void *p)
{
delete p;
}
-#endif /* OP_DELETE_BROKEN */
glyph_node::glyph_node(charinfo *c, tfont *t, node *x)
: ci(c), tf(t), node(x)
@@ -2710,7 +2703,7 @@ void kern_pair_node::ascii_print(ascii_output_file *ascii)
}
-void node::ascii_print(ascii_output_file *ascii)
+void node::ascii_print(ascii_output_file *)
{
}
@@ -3489,7 +3482,7 @@ void bracket_node::tprint(troff_output_file *out)
out->down(totalh - y);
}
-void node::tprint(troff_output_file *out)
+void node::tprint(troff_output_file *)
{
}
diff --git a/troff/number.c b/troff/number.c
index 6dfdbce41..020034aeb 100644
--- a/troff/number.c
+++ b/troff/number.c
@@ -405,9 +405,17 @@ static int parse_term(units *v, int scale_indicator, int parenthesised)
int tem = (scale_indicator == 'v'
? curdiv->get_vertical_position().to_units()
: curenv->get_input_line_position().to_units());
- if (*v < INT_MIN + tem) {
- error("numeric overflow");
- return 0;
+ if (tem >= 0) {
+ if (*v < INT_MIN + tem) {
+ error("numeric overflow");
+ return 0;
+ }
+ }
+ else {
+ if (*v > INT_MAX + tem) {
+ error("numeric overflow");
+ return 0;
+ }
}
*v -= tem;
if (negative) {
diff --git a/troff/reg.c b/troff/reg.c
index ce71113df..941fcdfab 100644
--- a/troff/reg.c
+++ b/troff/reg.c
@@ -294,15 +294,15 @@ void define_number_reg()
return;
}
reg *r = (reg *)number_reg_dictionary.lookup(nm);
- if (r == 0) {
- r = new number_reg;
- number_reg_dictionary.define(nm, r);
- }
units v;
units prev_value;
- if (!r->get_value(&prev_value))
+ if (!r || !r->get_value(&prev_value))
prev_value = 0;
if (get_number(&v, 'u', prev_value)) {
+ if (r == 0) {
+ r = new number_reg;
+ number_reg_dictionary.define(nm, r);
+ }
r->set_value(v);
if (tok.space() && has_arg() && get_number(&v, 'u'))
r->set_increment(v);
diff --git a/troff/token.h b/troff/token.h
index 2ce4447b5..d328c3820 100644
--- a/troff/token.h
+++ b/troff/token.h
@@ -81,7 +81,6 @@ public:
int leader();
int backspace();
int delimiter(int warn = 0); // is it suitable for use as a delimiter?
- symbol special();
int dummy();
int transparent();
int left_brace();
@@ -166,11 +165,6 @@ inline int token::eof()
return type == TOKEN_EOF;
}
-inline symbol token::special()
-{
- return type == TOKEN_SPECIAL ? nm : symbol();
-}
-
inline int token::dummy()
{
return type == TOKEN_DUMMY;
diff --git a/tty/tmac.tty b/tty/tmac.tty
index 4343bd9a9..04a36a3d9 100644
--- a/tty/tmac.tty
+++ b/tty/tmac.tty
@@ -34,4 +34,6 @@
.tty-char \(sl /
.tty-char \(+- +-
.tty-char \(co (C)
+.tty-char \(<= <=
+.tty-char \(>= >=
.cp \n(_C
diff --git a/xditview/ChangeLog b/xditview/ChangeLog
index 68cf445eb..fdd39eaa9 100644
--- a/xditview/ChangeLog
+++ b/xditview/ChangeLog
@@ -1,3 +1,70 @@
+Sat Oct 12 22:58:52 1991 James Clark (jjc at jclark)
+
+ * Dvi.c (SetDevice): If the size change request is refused but a
+ larger geometry is offered, request that.
+
+Wed Oct 9 12:27:48 1991 James Clark (jjc at jclark)
+
+ * font.c (InstallFontSizes): Ignore FontNameAverageWidth component.
+
+ * Dvi.c (default_font_map): Add `adobe' to font names to avoid
+ ambiguity.
+
+ * FontMap: New file.
+ * FontMap.X100, FontMap.X75: Deleted.
+ * xtotroff.c (main, usage): Add -s and -r options.
+ (MapFont): Change the font pattern to have the selected resolution and
+ size.
+ * Imakefile (install.dev): Use FontMap and supply appropriate -s
+ and -r options.
+
+ * xtotroff.c (MapFont): Check for ambiguity by comparing canonicalized
+ font names.
+
+ * DviP.h (DviFontList): Add initialized and scalable members.
+ (font.c): Add support for scalable fonts based on R5 xditview.
+
+ * DviChar.c: Use xmalloc rather than malloc.
+ * xditview.c (xmalloc): New function.
+ * xtotroff.c (xmalloc): New function.
+ * other files: Use XtMalloc and XtFree instead of malloc and free.
+
+Thu Aug 29 20:15:31 1991 James Clark (jjc at jclark)
+
+ * draw.c (setGC): Do multiplication in floating point to avoid
+ overflow.
+
+Tue Aug 13 12:04:41 1991 James Clark (jjc at jclark)
+
+ * draw.c (FakeCharacter): Remove casts in defintion of pack2.
+
+Tue Jul 30 11:42:39 1991 James Clark (jjc at jclark)
+
+ * tmac.Xps: New file.
+ * Imakefile (install): Install tmac.Xps.
+
+Tue Jul 2 09:31:37 1991 James Clark (jjc at jclark)
+
+ * xtotroff.c (main): Pass argv[0] to usage().
+
+Sun Jun 30 12:34:06 1991 James Clark (jjc at jclark)
+
+ * xtotroff.c (MapFont): Handle the case where XLoadQueryFont
+ returns NULL.
+
+Sat Jun 29 12:32:52 1991 James Clark (jjc at jclark)
+
+ * Imakefile: Use ../gendef to generate path.h.
+
+Sun Jun 16 13:26:34 1991 James Clark (jjc at jclark)
+
+ * Imakefile (depend.o): Change to device.o.
+
+Sun Jun 2 12:17:56 1991 James Clark (jjc at jclark)
+
+ * Imakefile: Remove spaces from the beginning of variable
+ assignment lines.
+
Sun May 26 14:14:01 1991 James Clark (jjc at jclark)
* xditview.c (Syntax): Update.
diff --git a/xditview/Dvi.c b/xditview/Dvi.c
index 17eaea1e9..0f3c96d8d 100644
--- a/xditview/Dvi.c
+++ b/xditview/Dvi.c
@@ -31,30 +31,30 @@ static char Xrcsid[] = "$XConsortium: Dvi.c,v 1.9 89/12/10 16:12:25 rws Exp $";
/* Private Data */
static char default_font_map[] = "\
-TR -*-times-medium-r-normal--*-100-*-*-*-*-iso8859-1\n\
-TI -*-times-medium-i-normal--*-100-*-*-*-*-iso8859-1\n\
-TB -*-times-bold-r-normal--*-100-*-*-*-*-iso8859-1\n\
-TBI -*-times-bold-i-normal--*-100-*-*-*-*-iso8859-1\n\
-CR -*-courier-medium-r-normal--*-100-*-*-*-*-iso8859-1\n\
-CI -*-courier-medium-o-normal--*-100-*-*-*-*-iso8859-1\n\
-CB -*-courier-bold-r-normal--*-100-*-*-*-*-iso8859-1\n\
-CBI -*-courier-bold-o-normal--*-100-*-*-*-*-iso8859-1\n\
-HR -*-helvetica-medium-r-normal--*-100-*-*-*-*-iso8859-1\n\
-HI -*-helvetica-medium-o-normal--*-100-*-*-*-*-iso8859-1\n\
-HB -*-helvetica-bold-r-normal--*-100-*-*-*-*-iso8859-1\n\
-HBI -*-helvetica-bold-o-normal--*-100-*-*-*-*-iso8859-1\n\
-NR -*-new century schoolbook-medium-r-normal--*-100-*-*-*-*-iso8859-1\n\
-NI -*-new century schoolbook-medium-i-normal--*-100-*-*-*-*-iso8859-1\n\
-NB -*-new century schoolbook-bold-r-normal--*-100-*-*-*-*-iso8859-1\n\
-NBI -*-new century schoolbook-bold-i-normal--*-100-*-*-*-*-iso8859-1\n\
-S -*-symbol-medium-r-normal--*-100-*-*-*-*-adobe-fontspecific\n\
-SS -*-symbol-medium-r-normal--*-100-*-*-*-*-adobe-fontspecific\n\
+TR -adobe-times-medium-r-normal--*-100-*-*-*-*-iso8859-1\n\
+TI -adobe-times-medium-i-normal--*-100-*-*-*-*-iso8859-1\n\
+TB -adobe-times-bold-r-normal--*-100-*-*-*-*-iso8859-1\n\
+TBI -adobe-times-bold-i-normal--*-100-*-*-*-*-iso8859-1\n\
+CR -adobe-courier-medium-r-normal--*-100-*-*-*-*-iso8859-1\n\
+CI -adobe-courier-medium-o-normal--*-100-*-*-*-*-iso8859-1\n\
+CB -adobe-courier-bold-r-normal--*-100-*-*-*-*-iso8859-1\n\
+CBI -adobe-courier-bold-o-normal--*-100-*-*-*-*-iso8859-1\n\
+HR -adobe-helvetica-medium-r-normal--*-100-*-*-*-*-iso8859-1\n\
+HI -adobe-helvetica-medium-o-normal--*-100-*-*-*-*-iso8859-1\n\
+HB -adobe-helvetica-bold-r-normal--*-100-*-*-*-*-iso8859-1\n\
+HBI -adobe-helvetica-bold-o-normal--*-100-*-*-*-*-iso8859-1\n\
+NR -adobe-new century schoolbook-medium-r-normal--*-100-*-*-*-*-iso8859-1\n\
+NI -adobe-new century schoolbook-medium-i-normal--*-100-*-*-*-*-iso8859-1\n\
+NB -adobe-new century schoolbook-bold-r-normal--*-100-*-*-*-*-iso8859-1\n\
+NBI -adobe-new century schoolbook-bold-i-normal--*-100-*-*-*-*-iso8859-1\n\
+S -adobe-symbol-medium-r-normal--*-100-*-*-*-*-adobe-fontspecific\n\
+SS -adobe-symbol-medium-r-normal--*-100-*-*-*-*-adobe-fontspecific\n\
";
#define offset(field) XtOffset(DviWidget, field)
-# define MY_WIDTH(dw) ((int)(dw->dvi.paperwidth * dw->dvi.scale_factor + .5))
-# define MY_HEIGHT(dw) ((int)(dw->dvi.paperlength * dw->dvi.scale_factor + .5))
+#define MY_WIDTH(dw) ((int)(dw->dvi.paperwidth * dw->dvi.scale_factor + .5))
+#define MY_HEIGHT(dw) ((int)(dw->dvi.paperlength * dw->dvi.scale_factor + .5))
static XtResource resources[] = {
{XtNfontMap, XtCFontMap, XtRString, sizeof (char *),
@@ -272,18 +272,17 @@ SetValues (current, request, new)
DviWidget current, request, new;
{
Boolean redisplay = FALSE;
- extern char *malloc ();
char *new_map;
int cur, req;
if (current->dvi.font_map_string != request->dvi.font_map_string) {
- new_map = malloc (strlen (request->dvi.font_map_string) + 1);
+ new_map = XtMalloc (strlen (request->dvi.font_map_string) + 1);
if (new_map) {
redisplay = TRUE;
strcpy (new_map, request->dvi.font_map_string);
new->dvi.font_map_string = new_map;
if (current->dvi.font_map_string)
- free (current->dvi.font_map_string);
+ XtFree (current->dvi.font_map_string);
current->dvi.font_map_string = 0;
ParseFontMap (new);
}
@@ -383,6 +382,7 @@ SetDevice (dw, name)
char *name;
{
XtWidgetGeometry request, reply;
+ XtGeometryResult ret;
ForgetFonts (dw);
dw->dvi.device = device_load (name);
@@ -405,7 +405,14 @@ SetDevice (dw, name)
request.request_mode = CWWidth|CWHeight;
request.width = MY_WIDTH(dw);
request.height = MY_HEIGHT(dw);
- XtMakeGeometryRequest (dw, &request, &reply);
+ ret = XtMakeGeometryRequest (dw, &request, &reply);
+ if (ret == XtGeometryAlmost
+ && reply.height >= request.height
+ && reply.width >= request.width) {
+ request.width = reply.width;
+ request.height = reply.height;
+ XtMakeGeometryRequest (dw, &request, &reply);
+ }
}
static void
diff --git a/xditview/DviChar.c b/xditview/DviChar.c
index a76fd725a..2099b26d2 100644
--- a/xditview/DviChar.c
+++ b/xditview/DviChar.c
@@ -5,9 +5,11 @@
* font indexes and back
*/
-# include "DviChar.h"
+#include "DviChar.h"
-# define allocHash() ((DviCharNameHash *) malloc (sizeof (DviCharNameHash)))
+extern char *xmalloc();
+
+#define allocHash() ((DviCharNameHash *) xmalloc (sizeof (DviCharNameHash)))
struct map_list {
struct map_list *next;
@@ -19,6 +21,7 @@ static struct map_list *world;
static int standard_maps_loaded = 0;
static void load_standard_maps ();
static int hash_name ();
+static dispose_hash(), compute_hash();
DviCharNameMap *
DviFindMap (encoding)
@@ -39,8 +42,6 @@ DviRegisterMap (map)
DviCharNameMap *map;
{
struct map_list *m;
- static dispose_hash(), compute_hash();
- extern char *malloc();
if (!standard_maps_loaded)
load_standard_maps ();
@@ -48,7 +49,7 @@ DviRegisterMap (map)
if (!strcmp (m->map->encoding, map->encoding))
break;
if (!m) {
- m = (struct map_list *) malloc (sizeof *m);
+ m = (struct map_list *) xmalloc (sizeof *m);
m->next = world;
world = m;
}
@@ -661,4 +662,3 @@ load_standard_maps ()
DviRegisterMap (&ISO8859_1_map);
DviRegisterMap (&Adobe_Symbol_map);
}
-
diff --git a/xditview/DviP.h b/xditview/DviP.h
index 394b10861..c3b7d2c71 100644
--- a/xditview/DviP.h
+++ b/xditview/DviP.h
@@ -72,6 +72,8 @@ typedef struct _dviFontList {
char *dvi_name;
char *x_name;
int dvi_number;
+ Boolean initialized;
+ Boolean scalable;
DviFontSizeList *sizes;
DviCharNameMap *char_map;
DeviceFont *device_font;
diff --git a/xditview/FontMap b/xditview/FontMap
new file mode 100644
index 000000000..b8582249f
--- /dev/null
+++ b/xditview/FontMap
@@ -0,0 +1,17 @@
+TR -adobe-times-medium-r-normal--*-*-*-*-*-*-iso8859-1
+TI -adobe-times-medium-i-normal--*-*-*-*-*-*-iso8859-1
+TB -adobe-times-bold-r-normal--*-*-*-*-*-*-iso8859-1
+TBI -adobe-times-bold-i-normal--*-*-*-*-*-*-iso8859-1
+CR -adobe-courier-medium-r-normal--*-*-*-*-*-*-iso8859-1
+CI -adobe-courier-medium-o-normal--*-*-*-*-*-*-iso8859-1
+CB -adobe-courier-bold-r-normal--*-*-*-*-*-*-iso8859-1
+CBI -adobe-courier-bold-o-normal--*-*-*-*-*-*-iso8859-1
+HR -adobe-helvetica-medium-r-normal--*-*-*-*-*-*-iso8859-1
+HI -adobe-helvetica-medium-o-normal--*-*-*-*-*-*-iso8859-1
+HB -adobe-helvetica-bold-r-normal--*-*-*-*-*-*-iso8859-1
+HBI -adobe-helvetica-bold-o-normal--*-*-*-*-*-*-iso8859-1
+NR -adobe-new century schoolbook-medium-r-normal--*-*-*-*-*-*-iso8859-1
+NI -adobe-new century schoolbook-medium-i-normal--*-*-*-*-*-*-iso8859-1
+NB -adobe-new century schoolbook-bold-r-normal--*-*-*-*-*-*-iso8859-1
+NBI -adobe-new century schoolbook-bold-i-normal--*-*-*-*-*-*-iso8859-1
+S -adobe-symbol-medium-r-normal--*-*-*-*-*-*-adobe-fontspecific
diff --git a/xditview/FontMap.X100 b/xditview/FontMap.X100
deleted file mode 100644
index ab83af21c..000000000
--- a/xditview/FontMap.X100
+++ /dev/null
@@ -1,17 +0,0 @@
-TR -*-times-medium-r-normal--*-100-100-100-*-*-iso8859-1
-TI -*-times-medium-i-normal--*-100-100-100-*-*-iso8859-1
-TB -*-times-bold-r-normal--*-100-100-100-*-*-iso8859-1
-TBI -*-times-bold-i-normal--*-100-100-100-*-*-iso8859-1
-CR -*-courier-medium-r-normal--*-100-100-100-*-*-iso8859-1
-CI -*-courier-medium-o-normal--*-100-100-100-*-*-iso8859-1
-CB -*-courier-bold-r-normal--*-100-100-100-*-*-iso8859-1
-CBI -*-courier-bold-o-normal--*-100-100-100-*-*-iso8859-1
-HR -*-helvetica-medium-r-normal--*-100-100-100-*-*-iso8859-1
-HI -*-helvetica-medium-o-normal--*-100-100-100-*-*-iso8859-1
-HB -*-helvetica-bold-r-normal--*-100-100-100-*-*-iso8859-1
-HBI -*-helvetica-bold-o-normal--*-100-100-100-*-*-iso8859-1
-NR -*-new century schoolbook-medium-r-normal--*-100-100-100-*-*-iso8859-1
-NI -*-new century schoolbook-medium-i-normal--*-100-100-100-*-*-iso8859-1
-NB -*-new century schoolbook-bold-r-normal--*-100-100-100-*-*-iso8859-1
-NBI -*-new century schoolbook-bold-i-normal--*-100-100-100-*-*-iso8859-1
-S -*-symbol-medium-r-normal--*-100-100-100-*-*-adobe-fontspecific
diff --git a/xditview/FontMap.X75 b/xditview/FontMap.X75
deleted file mode 100644
index b026bea02..000000000
--- a/xditview/FontMap.X75
+++ /dev/null
@@ -1,17 +0,0 @@
-TR -*-times-medium-r-normal--*-100-75-75-*-*-iso8859-1
-TI -*-times-medium-i-normal--*-100-75-75-*-*-iso8859-1
-TB -*-times-bold-r-normal--*-100-75-75-*-*-iso8859-1
-TBI -*-times-bold-i-normal--*-100-75-75-*-*-iso8859-1
-CR -*-courier-medium-r-normal--*-100-75-75-*-*-iso8859-1
-CI -*-courier-medium-o-normal--*-100-75-75-*-*-iso8859-1
-CB -*-courier-bold-r-normal--*-100-75-75-*-*-iso8859-1
-CBI -*-courier-bold-o-normal--*-100-75-75-*-*-iso8859-1
-HR -*-helvetica-medium-r-normal--*-100-75-75-*-*-iso8859-1
-HI -*-helvetica-medium-o-normal--*-100-75-75-*-*-iso8859-1
-HB -*-helvetica-bold-r-normal--*-100-75-75-*-*-iso8859-1
-HBI -*-helvetica-bold-o-normal--*-100-75-75-*-*-iso8859-1
-NR -*-new century schoolbook-medium-r-normal--*-100-75-75-*-*-iso8859-1
-NI -*-new century schoolbook-medium-i-normal--*-100-75-75-*-*-iso8859-1
-NB -*-new century schoolbook-bold-r-normal--*-100-75-75-*-*-iso8859-1
-NBI -*-new century schoolbook-bold-i-normal--*-100-75-75-*-*-iso8859-1
-S -*-symbol-medium-r-normal--*-100-75-75-*-*-adobe-fontspecific
diff --git a/xditview/Imakefile b/xditview/Imakefile
index bd025cbda..a9302dd44 100644
--- a/xditview/Imakefile
+++ b/xditview/Imakefile
@@ -1,27 +1,32 @@
- GROFF_LIBDIR = /usr/local/lib/groff
- GROFF_FONTDIR = $(GROFF_LIBDIR)/font
- GROFF_FONTPATH = .:$(GROFF_FONTDIR):/usr/local/lib/font:/usr/lib/font
- GROFF_MACRODIR = $(GROFF_LIBDIR)/tmac
- DPIS = 75 100
-
- PROGRAMS = gxditview xtotroff
- DEPLIBS = XawClientDepLibs
+GROFF_LIBDIR = /usr/local/lib/groff
+GROFF_FONTDIR = $(GROFF_LIBDIR)/font
+GROFF_FONTPATH = .:$(GROFF_FONTDIR):/usr/local/lib/font:/usr/lib/font
+GROFF_MACRODIR = $(GROFF_LIBDIR)/tmac
+DPIS = 75 100
+
+PROGRAMS = gxditview xtotroff
+DEPLIBS = XawClientDepLibs
LOCAL_LIBRARIES = XawClientLibs
- SRCS1 = xditview.c Dvi.c draw.c font.c lex.c page.c \
- parse.c XFontName.c DviChar.c device.c
- OBJS1 = xditview.o Dvi.o draw.o font.o lex.o page.o \
- parse.o XFontName.o DviChar.o device.o
- SRCS2 = xtotroff.c XFontName.c DviChar.c
- OBJS2 = xtotroff.o XFontName.o DviChar.o
- INCLUDES = -I$(TOOLKITSRC) -I$(TOP)
- MATHLIB = -lm
- DEFINES = $(SIGNAL_DEFINES)
+SRCS1 = xditview.c Dvi.c draw.c font.c lex.c page.c \
+ parse.c XFontName.c DviChar.c device.c
+OBJS1 = xditview.o Dvi.o draw.o font.o lex.o page.o \
+ parse.o XFontName.o DviChar.o device.o
+SRCS2 = xtotroff.c XFontName.c DviChar.c
+OBJS2 = xtotroff.o XFontName.o DviChar.o
+INCLUDES = -I$(TOOLKITSRC) -I$(TOP)
+MATHLIB = -lm
+DEFINES = $(SIGNAL_DEFINES) # -DX_NOT_STDC_ENV
ComplexProgramTarget_1(gxditview,$(LOCAL_LIBRARIES),$(MATHLIB))
-NormalProgramTarget(xtotroff,$(OBJS2),$(XDEPLIB),$(XLIB), /**/)
+NormalProgramTarget(xtotroff,$(OBJS2),$(DEPXLIB),$(XLIB), /**/)
InstallAppDefaults(GXditview)
+install::
+ -[ -d $(GROFF_MACRODIR) ] || mkdir $(GROFF_MACRODIR)
+ -rm -f $(GROFF_MACRODIR)/tmac.Xps
+ cp tmac.Xps $(GROFF_MACRODIR)
+
install.dev: xtotroff
-[ -d $(GROFF_MACRODIR) ] || mkdir $(GROFF_MACRODIR)
-rm -f $(GROFF_MACRODIR)/tmac.X
@@ -37,7 +42,7 @@ install.dev: xtotroff
rm -f $(GROFF_FONTDIR)/devX$$dpi/eqnchar; \
cp eqnchar $(GROFF_FONTDIR)/devX$$dpi; \
(cd $(GROFF_FONTDIR)/devX$$dpi; \
- $$dir/xtotroff -g $$dir/FontMap.X$$dpi); \
+ $$dir/xtotroff -g -r $$dpi -s 10 $$dir/FontMap); \
[ -d $(GROFF_FONTDIR)/devX$$dpi-12 ] \
|| mkdir $(GROFF_FONTDIR)/devX$$dpi-12; \
rm -f $(GROFF_FONTDIR)/devX$$dpi-12/eqnchar; \
@@ -45,20 +50,13 @@ install.dev: xtotroff
rm -f $(GROFF_FONTDIR)/devX$$dpi-12/DESC; \
sed -e "s/res 75/res $$dpi/" -e 's/unitwidth 10/unitwidth 12/' DESC \
>$(GROFF_FONTDIR)/devX$$dpi-12/DESC; \
- sed -e "s/100-$$dpi-$$dpi/120-$$dpi-$$dpi/" \
- FontMap.X$$dpi >FontMap.X$$dpi-12; \
(cd $(GROFF_FONTDIR)/devX$$dpi-12; \
- $$dir/xtotroff -g $$dir/FontMap.X$$dpi-12); \
+ $$dir/xtotroff -g -r $$dpi -s 12 $$dir/FontMap); \
done
path.h: FORCE
- @echo \#define FONTPATH \"$(GROFF_FONTPATH)\" >path.h.n
- @cmp -s path.h.n path.h || cp path.h.n path.h
- @rm -f path.h.n
-
-depend.o: path.h
+ @/bin/sh ../gendef path.h "FONTPATH=\"$(GROFF_FONTPATH)\""
-clean::
- for dpi in $(DPIS); do $(RM) FontMap.X$$dpi-12; done
+device.o: path.h
FORCE:
diff --git a/xditview/Makefile b/xditview/Makefile
index 5adfe2757..0bbcab563 100644
--- a/xditview/Makefile
+++ b/xditview/Makefile
@@ -1,47 +1,54 @@
# Makefile generated by imake - do not edit!
-# $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $
+# $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $
#
# The cpp used on this machine replaces all newlines and multiple tabs and
# spaces in a macro expansion with a single space. Imake tries to compensate
# for this, but is not always successful.
#
-###########################################################################
+# -------------------------------------------------------------------------
# Makefile generated from "Imake.tmpl" and <Imakefile>
-# $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $
+# $XConsortium: Imake.tmpl,v 1.139 91/09/16 08:52:48 rws Exp $
#
-# Platform-specific parameters may be set in the appropriate .cf
-# configuration files. Site-wide parameters may be set in the file
+# Platform-specific parameters may be set in the appropriate <vendor>.cf
+# configuration files. Site-specific parameters should be set in the file
# site.def. Full rebuilds are recommended if any parameters are changed.
#
-# If your C preprocessor doesn't define any unique symbols, you'll need
+# If your C preprocessor does not define any unique symbols, you will need
# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
-# "make Makefile", "make Makefiles", or "make World").
-#
-# If you absolutely can't get imake to work, you'll need to set the
-# variables at the top of each Makefile as well as the dependencies at the
-# bottom (makedepend will do this automatically).
+# "make World" the first time).
#
-###########################################################################
+# -------------------------------------------------------------------------
+# site-specific configuration parameters that need to come before
+# the platform-specific parameters - edit site.def to change
+
+# site: $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
+
+# -------------------------------------------------------------------------
# platform-specific configuration parameters - edit sun.cf to change
-# platform: $XConsortium: sun.cf,v 1.38 89/12/23 16:10:10 jim Exp $
+# platform: $XConsortium: sun.cf,v 1.69 91/09/09 18:23:59 rws Exp $
+
# operating system: SunOS 4.1.1
-###########################################################################
-# site-specific configuration parameters - edit site.def to change
+# $XConsortium: sunLib.rules,v 1.6 91/03/24 17:55:58 rws Exp $
+
+# -------------------------------------------------------------------------
+# site-specific configuration parameters that go after
+# the platform-specific parameters - edit site.def to change
-# site: $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $
+# site: $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
SHELL = /bin/sh
TOP = .
CURRENT_DIR = .
- AR = ar cq
+ AR = ar clq
BOOTSTRAPCFLAGS =
CC = cc
+ AS = as
COMPRESS = compress
CPP = /lib/cpp $(STD_CPP_DEFINES)
@@ -55,9 +62,15 @@
MAKE = make
MV = mv
CP = cp
+
RANLIB = ranlib
RANLIBINSTFLAGS =
+
RM = rm -f
+ TROFF = psroff
+ MSMACROS = -ms
+ TBL = tbl
+ EQN = eqn
STD_INCLUDES =
STD_CPP_DEFINES =
STD_DEFINES =
@@ -74,27 +87,28 @@
INSTBINFLAGS = -m 0755
INSTUIDFLAGS = -m 4755
- INSTLIBFLAGS = -m 0664
+ INSTLIBFLAGS = -m 0644
INSTINCFLAGS = -m 0444
INSTMANFLAGS = -m 0444
INSTDATFLAGS = -m 0444
INSTKMEMFLAGS = -m 4755
- DESTDIR =
-
TOP_INCLUDES = -I$(INCROOT)
CDEBUGFLAGS = -O
- CCOPTIONS =
- COMPATFLAGS =
+ CCOPTIONS = -pipe
- ALLINCLUDES = $(STD_INCLUDES) $(TOP_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES)
- ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS)
+ ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
+ ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES)
CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
+
LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
- LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)
+
+ LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -L$(USRLIBDIR)
+
LDCOMBINEFLAGS = -X -r
+ DEPENDFLAGS =
MACROFILE = sun.cf
RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
@@ -108,13 +122,12 @@
$(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
$(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
-###########################################################################
+# -------------------------------------------------------------------------
# X Window System Build Parameters
-# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
+# $XConsortium: Project.tmpl,v 1.138 91/09/10 09:02:12 rws Exp $
-###########################################################################
+# -------------------------------------------------------------------------
# X Window System make variables; this need to be coordinated with rules
-# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
PATHSEP = /
USRLIBDIR = /local/lib
@@ -124,7 +137,7 @@
BUILDINCDIR = $(BUILDINCROOT)/X11
BUILDINCTOP = ..
INCDIR = $(INCROOT)/X11
- ADMDIR = $(DESTDIR)/usr/adm
+ ADMDIR = /usr/adm
LIBDIR = $(USRLIBDIR)/X11
CONFIGDIR = $(LIBDIR)/config
LINTLIBDIR = $(USRLIBDIR)/lint
@@ -132,22 +145,16 @@
FONTDIR = $(LIBDIR)/fonts
XINITDIR = $(LIBDIR)/xinit
XDMDIR = $(LIBDIR)/xdm
- AWMDIR = $(LIBDIR)/awm
TWMDIR = $(LIBDIR)/twm
- GWMDIR = $(LIBDIR)/gwm
- MANPATH = $(DESTDIR)/local/man
+ MANPATH = /local/man
MANSOURCEPATH = $(MANPATH)/man
- MANDIR = $(MANSOURCEPATH)1
- LIBMANDIR = $(MANSOURCEPATH)3
+ MANSUFFIX = 1
+ LIBMANSUFFIX = 3
+ MANDIR = $(MANSOURCEPATH)$(MANSUFFIX)
+ LIBMANDIR = $(MANSOURCEPATH)$(LIBMANSUFFIX)
+ NLSDIR = $(LIBDIR)/nls
+ PEXAPIDIR = $(LIBDIR)/PEX
XAPPLOADDIR = $(LIBDIR)/app-defaults
-
- SOXLIBREV = 4.2
- SOXTREV = 4.0
- SOXAWREV = 4.0
- SOOLDXREV = 4.0
- SOXMUREV = 4.0
- SOXEXTREV = 4.0
-
FONTCFLAGS = -t
INSTAPPFLAGS = $(INSTDATFLAGS)
@@ -155,11 +162,14 @@
IMAKE = imake
DEPEND = makedepend
RGB = rgb
- FONTC = bdftosnf
+
+ FONTC = bdftopcf
+
MKFONTDIR = mkfontdir
- MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier.sh
+ MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier
CONFIGSRC = $(TOP)/config
+ DOCUTILSRC = $(TOP)/doc/util
CLIENTSRC = $(TOP)/clients
DEMOSRC = $(TOP)/demos
LIBSRC = $(TOP)/lib
@@ -182,35 +192,67 @@
OLDXLIBSRC = $(LIBSRC)/oldX
XDMCPLIBSRC = $(LIBSRC)/Xdmcp
BDFTOSNFSRC = $(FONTSRC)/bdftosnf
- MKFONTDIRSRC = $(FONTSRC)/mkfontdir
+ BDFTOSNFSRC = $(FONTSRC)/clients/bdftosnf
+ BDFTOPCFSRC = $(FONTSRC)/clients/bdftopcf
+ MKFONTDIRSRC = $(FONTSRC)/clients/mkfontdir
+ FSLIBSRC = $(FONTSRC)/lib/fs
+ FONTSERVERSRC = $(FONTSRC)/server
EXTENSIONSRC = $(TOP)/extensions
+ XILIBSRC = $(EXTENSIONSRC)/lib/xinput
+ PHIGSLIBSRC = $(EXTENSIONSRC)/lib/PEX
+
+# $XConsortium: sunLib.tmpl,v 1.11 91/07/31 11:32:08 rws Exp $
+
+SHLIBLDFLAGS = -assert pure-text
+PICFLAGS = -pic
- DEPEXTENSIONLIB = $(USRLIBDIR)/libXext.a
- EXTENSIONLIB = -lXext
+ DEPEXTENSIONLIB =
+ EXTENSIONLIB = -lXext
DEPXLIB = $(DEPEXTENSIONLIB)
XLIB = $(EXTENSIONLIB) -lX11
- DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
- XAUTHLIB = -lXau
-
- DEPXMULIB =
+ DEPXMULIB = $(USRLIBDIR)/libXmu.sa.$(SOXMUREV)
XMULIB = -lXmu
DEPOLDXLIB =
OLDXLIB = -loldX
- DEPXTOOLLIB =
+ DEPXTOOLLIB = $(USRLIBDIR)/libXt.sa.$(SOXTREV)
XTOOLLIB = -lXt
- DEPXAWLIB =
+ DEPXAWLIB = $(USRLIBDIR)/libXaw.sa.$(SOXAWREV)
XAWLIB = -lXaw
- LINTEXTENSIONLIB = $(USRLIBDIR)/llib-lXext.ln
- LINTXLIB = $(USRLIBDIR)/llib-lX11.ln
- LINTXMU = $(USRLIBDIR)/llib-lXmu.ln
- LINTXTOOL = $(USRLIBDIR)/llib-lXt.ln
- LINTXAW = $(USRLIBDIR)/llib-lXaw.ln
+ DEPXILIB =
+ XILIB = -lXi
+
+ SOXLIBREV = 4.10
+ SOXTREV = 4.10
+ SOXAWREV = 5.0
+ SOOLDXREV = 4.10
+ SOXMUREV = 4.10
+ SOXEXTREV = 4.10
+ SOXINPUTREV = 4.10
+
+ DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
+ XAUTHLIB = -lXau
+ DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a
+ XDMCPLIB = -lXdmcp
+
+ DEPPHIGSLIB = $(USRLIBDIR)/libphigs.a
+ PHIGSLIB = -lphigs
+
+ DEPXBSDLIB = $(USRLIBDIR)/libXbsd.a
+ XBSDLIB = -lXbsd
+
+ LINTEXTENSIONLIB = $(LINTLIBDIR)/llib-lXext.ln
+ LINTXLIB = $(LINTLIBDIR)/llib-lX11.ln
+ LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln
+ LINTXTOOL = $(LINTLIBDIR)/llib-lXt.ln
+ LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln
+ LINTXI = $(LINTLIBDIR)/llib-lXi.ln
+ LINTPHIGS = $(LINTLIBDIR)/llib-lphigs.ln
DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
@@ -218,31 +260,31 @@
DEPLIBS2 = $(DEPLIBS)
DEPLIBS3 = $(DEPLIBS)
-###########################################################################
+# -------------------------------------------------------------------------
# Imake rules for building libraries, programs, scripts, and data files
-# rules: $XConsortium: Imake.rules,v 1.67 89/12/18 17:14:15 jim Exp $
+# rules: $XConsortium: Imake.rules,v 1.123 91/09/16 20:12:16 rws Exp $
-###########################################################################
+# -------------------------------------------------------------------------
# start of Imakefile
- GROFF_LIBDIR = /usr/local/lib/groff
- GROFF_FONTDIR = $(GROFF_LIBDIR)/font
+GROFF_LIBDIR = /usr/local/lib/groff
+GROFF_FONTDIR = $(GROFF_LIBDIR)/font
GROFF_FONTPATH = .:$(GROFF_FONTDIR):/usr/local/lib/font:/usr/lib/font
- GROFF_MACRODIR = $(GROFF_LIBDIR)/tmac
- DPIS = 75 100
+GROFF_MACRODIR = $(GROFF_LIBDIR)/tmac
+DPIS = 75 100
- PROGRAMS = gxditview xtotroff
- DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
+PROGRAMS = gxditview xtotroff
+DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
- SRCS1 = xditview.c Dvi.c draw.c font.c lex.c page.c \
- parse.c XFontName.c DviChar.c device.c
- OBJS1 = xditview.o Dvi.o draw.o font.o lex.o page.o \
- parse.o XFontName.o DviChar.o device.o
- SRCS2 = xtotroff.c XFontName.c DviChar.c
- OBJS2 = xtotroff.o XFontName.o DviChar.o
- INCLUDES = -I$(TOOLKITSRC) -I$(TOP)
- MATHLIB = -lm
- DEFINES = $(SIGNAL_DEFINES)
+SRCS1 = xditview.c Dvi.c draw.c font.c lex.c page.c \
+ parse.c XFontName.c DviChar.c device.c
+OBJS1 = xditview.o Dvi.o draw.o font.o lex.o page.o \
+ parse.o XFontName.o DviChar.o device.o
+SRCS2 = xtotroff.c XFontName.c DviChar.c
+OBJS2 = xtotroff.o XFontName.o DviChar.o
+INCLUDES = -I$(TOOLKITSRC) -I$(TOP)
+MATHLIB = -lm
+DEFINES = $(SIGNAL_DEFINES) # -DX_NOT_STDC_ENV
OBJS = $(OBJS1) $(OBJS2) $(OBJS3)
SRCS = $(SRCS1) $(SRCS2) $(SRCS3)
@@ -254,19 +296,23 @@ gxditview: $(OBJS1) $(DEPLIBS1)
$(CC) -o $@ $(LDOPTIONS) $(OBJS1) $(LOCAL_LIBRARIES) $(LDLIBS) $(MATHLIB) $(EXTRA_LOAD_FLAGS)
install:: gxditview
- $(INSTALL) -c $(INSTPGMFLAGS) gxditview $(BINDIR)
+ @if [ -d $(DESTDIR)$(BINDIR) ]; then set +x; \
+ else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
+ $(INSTALL) -c $(INSTPGMFLAGS) gxditview $(DESTDIR)$(BINDIR)
install.man:: gxditview.man
- $(INSTALL) -c $(INSTMANFLAGS) gxditview.man $(MANDIR)/gxditview.1
+ @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
+ else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
+ $(INSTALL) -c $(INSTMANFLAGS) gxditview.man $(DESTDIR)$(MANDIR)/gxditview.$(MANSUFFIX)
-saber_gxditview:
- #load -C $(ALLDEFINES) $(SRCS1) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES) $(MATHLIB)
+saber_gxditview:: $(SRCS1)
+ # load -C $(ALLDEFINES) $(SRCS1) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES) $(MATHLIB)
-osaber_gxditview:
- #load -C $(ALLDEFINES) $(OBJS1) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES) $(MATHLIB)
+osaber_gxditview:: $(OBJS1)
+ # load -C $(ALLDEFINES) $(OBJS1) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES) $(MATHLIB)
depend::
- $(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
+ $(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
lint:
$(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
@@ -276,7 +322,7 @@ lint1:
clean::
$(RM) $(PROGRAMS)
-xtotroff: $(OBJS2) $(XDEPLIB)
+xtotroff: $(OBJS2) $(DEPXLIB)
$(RM) $@
$(CC) -o $@ $(OBJS2) $(LDOPTIONS) $(XLIB) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
@@ -284,7 +330,14 @@ clean::
$(RM) xtotroff
install:: GXditview.ad
- $(INSTALL) -c $(INSTAPPFLAGS) GXditview.ad $(XAPPLOADDIR)/GXditview
+ @if [ -d $(DESTDIR)$(XAPPLOADDIR) ]; then set +x; \
+ else (set -x; $(MKDIRHIER) $(DESTDIR)$(XAPPLOADDIR)); fi
+ $(INSTALL) -c $(INSTAPPFLAGS) GXditview.ad $(DESTDIR)$(XAPPLOADDIR)/GXditview
+
+install::
+ -[ -d $(GROFF_MACRODIR) ] || mkdir $(GROFF_MACRODIR)
+ -rm -f $(GROFF_MACRODIR)/tmac.Xps
+ cp tmac.Xps $(GROFF_MACRODIR)
install.dev: xtotroff
-[ -d $(GROFF_MACRODIR) ] || mkdir $(GROFF_MACRODIR)
@@ -301,7 +354,7 @@ install.dev: xtotroff
rm -f $(GROFF_FONTDIR)/devX$$dpi/eqnchar; \
cp eqnchar $(GROFF_FONTDIR)/devX$$dpi; \
(cd $(GROFF_FONTDIR)/devX$$dpi; \
- $$dir/xtotroff -g $$dir/FontMap.X$$dpi); \
+ $$dir/xtotroff -g -r $$dpi -s 10 $$dir/FontMap); \
[ -d $(GROFF_FONTDIR)/devX$$dpi-12 ] \
|| mkdir $(GROFF_FONTDIR)/devX$$dpi-12; \
rm -f $(GROFF_FONTDIR)/devX$$dpi-12/eqnchar; \
@@ -309,35 +362,27 @@ install.dev: xtotroff
rm -f $(GROFF_FONTDIR)/devX$$dpi-12/DESC; \
sed -e "s/res 75/res $$dpi/" -e 's/unitwidth 10/unitwidth 12/' DESC \
>$(GROFF_FONTDIR)/devX$$dpi-12/DESC; \
- sed -e "s/100-$$dpi-$$dpi/120-$$dpi-$$dpi/" \
- FontMap.X$$dpi >FontMap.X$$dpi-12; \
(cd $(GROFF_FONTDIR)/devX$$dpi-12; \
- $$dir/xtotroff -g $$dir/FontMap.X$$dpi-12); \
+ $$dir/xtotroff -g -r $$dpi -s 12 $$dir/FontMap); \
done
path.h: FORCE
- @echo \#define FONTPATH \"$(GROFF_FONTPATH)\" >path.h.n
- @cmp -s path.h.n path.h || cp path.h.n path.h
- @rm -f path.h.n
+ @/bin/sh ../gendef path.h "FONTPATH=\"$(GROFF_FONTPATH)\""
-depend.o: path.h
-
-clean::
- for dpi in $(DPIS); do $(RM) FontMap.X$$dpi-12; done
+device.o: path.h
FORCE:
-###########################################################################
+# -------------------------------------------------------------------------
# common rules for all Makefiles - do not edit
emptyrule::
clean::
- $(RM_CMD) \#*
+ $(RM_CMD) "#"*
Makefile::
- -@if [ -f Makefile ]; then \
- echo " $(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
+ -@if [ -f Makefile ]; then set -x; \
$(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
else exit 0; fi
$(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
@@ -347,12 +392,12 @@ tags::
$(TAGS) -xw *.[ch] > TAGS
saber:
- #load $(ALLDEFINES) $(SRCS)
+ # load $(ALLDEFINES) $(SRCS)
osaber:
- #load $(ALLDEFINES) $(OBJS)
+ # load $(ALLDEFINES) $(OBJS)
-###########################################################################
+# -------------------------------------------------------------------------
# empty rules for directories that do not have SUBDIRS - do not edit
install::
@@ -365,7 +410,7 @@ Makefiles::
includes::
-###########################################################################
+# -------------------------------------------------------------------------
# dependencies generated by makedepend
# DO NOT DELETE
@@ -373,20 +418,19 @@ includes::
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/Intrinsic.h /local/include/X11/Xutil.h
-xditview.o: /local/include/X11/Xresource.h /local/include/X11/Xos.h
-xditview.o: /usr/include/strings.h /usr/include/sys/file.h
-xditview.o: /usr/include/sys/fcntlcom.h /usr/include/sys/stat.h
-xditview.o: /usr/include/sys/time.h /usr/include/sys/time.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/Xaw/Viewport.h /local/include/X11/Xaw/Form.h
-xditview.o: /local/include/X11/Xaw/Box.h /local/include/X11/Xaw/Command.h
-xditview.o: /local/include/X11/Xaw/Label.h /local/include/X11/Xaw/Simple.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: /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/Xmu/Converters.h
-xditview.o: /local/include/X11/Xaw/Dialog.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
+xditview.o: /local/include/X11/Xaw/Command.h /local/include/X11/Xaw/Label.h
+xditview.o: /local/include/X11/Xaw/Simple.h /local/include/X11/Xaw/Dialog.h
xditview.o: /local/include/X11/Xaw/SimpleMenu.h
xditview.o: /local/include/X11/Xaw/SmeBSB.h /local/include/X11/Xaw/Sme.h
xditview.o: /usr/include/signal.h /usr/include/sys/signal.h
@@ -395,87 +439,95 @@ xditview.o: /usr/include/stdio.h
Dvi.o: /local/include/X11/IntrinsicP.h /local/include/X11/Intrinsic.h
Dvi.o: /local/include/X11/Xlib.h /usr/include/sys/types.h
Dvi.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
-Dvi.o: /local/include/X11/X.h /local/include/X11/Xutil.h
-Dvi.o: /local/include/X11/Xresource.h /local/include/X11/Xos.h
-Dvi.o: /usr/include/strings.h /usr/include/sys/file.h
-Dvi.o: /usr/include/sys/fcntlcom.h /usr/include/sys/stat.h
-Dvi.o: /usr/include/sys/time.h /usr/include/sys/time.h
-Dvi.o: /local/include/X11/Core.h /local/include/X11/Composite.h
-Dvi.o: /local/include/X11/Constraint.h /local/include/X11/Object.h
-Dvi.o: /local/include/X11/RectObj.h /local/include/X11/CoreP.h
-Dvi.o: /local/include/X11/CompositeP.h /local/include/X11/ConstrainP.h
-Dvi.o: /local/include/X11/ObjectP.h /local/include/X11/RectObjP.h
-Dvi.o: /local/include/X11/StringDefs.h /local/include/X11/Xmu/Converters.h
-Dvi.o: /usr/include/stdio.h /usr/include/ctype.h DviP.h Dvi.h DviChar.h
-Dvi.o: device.h /local/include/X11/bitmaps/gray
-draw.o: /local/include/X11/Xos.h /usr/include/sys/types.h
-draw.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
-draw.o: /usr/include/strings.h /usr/include/sys/file.h
-draw.o: /usr/include/sys/fcntlcom.h /usr/include/sys/stat.h
-draw.o: /usr/include/sys/time.h /usr/include/sys/time.h
-draw.o: /local/include/X11/IntrinsicP.h /local/include/X11/Intrinsic.h
-draw.o: /local/include/X11/Xlib.h /local/include/X11/X.h
-draw.o: /local/include/X11/Xutil.h /local/include/X11/Xresource.h
-draw.o: /local/include/X11/Core.h /local/include/X11/Composite.h
-draw.o: /local/include/X11/Constraint.h /local/include/X11/Object.h
-draw.o: /local/include/X11/RectObj.h /local/include/X11/CoreP.h
-draw.o: /local/include/X11/CompositeP.h /local/include/X11/ConstrainP.h
-draw.o: /local/include/X11/ObjectP.h /local/include/X11/RectObjP.h
-draw.o: /local/include/X11/StringDefs.h /usr/include/stdio.h
-draw.o: /usr/include/ctype.h /usr/include/math.h /usr/include/floatingpoint.h
-draw.o: /usr/include/sys/ieeefp.h DviP.h Dvi.h DviChar.h device.h
-font.o: /local/include/X11/Xos.h /usr/include/sys/types.h
-font.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
-font.o: /usr/include/strings.h /usr/include/sys/file.h
-font.o: /usr/include/sys/fcntlcom.h /usr/include/sys/stat.h
-font.o: /usr/include/sys/time.h /usr/include/sys/time.h
-font.o: /local/include/X11/IntrinsicP.h /local/include/X11/Intrinsic.h
-font.o: /local/include/X11/Xlib.h /local/include/X11/X.h
-font.o: /local/include/X11/Xutil.h /local/include/X11/Xresource.h
-font.o: /local/include/X11/Core.h /local/include/X11/Composite.h
-font.o: /local/include/X11/Constraint.h /local/include/X11/Object.h
-font.o: /local/include/X11/RectObj.h /local/include/X11/CoreP.h
-font.o: /local/include/X11/CompositeP.h /local/include/X11/ConstrainP.h
-font.o: /local/include/X11/ObjectP.h /local/include/X11/RectObjP.h
-font.o: /local/include/X11/StringDefs.h /usr/include/stdio.h
-font.o: /usr/include/ctype.h DviP.h Dvi.h DviChar.h device.h XFontName.h
-lex.o: /local/include/X11/Xos.h /usr/include/sys/types.h
-lex.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
-lex.o: /usr/include/strings.h /usr/include/sys/file.h
-lex.o: /usr/include/sys/fcntlcom.h /usr/include/sys/stat.h
-lex.o: /usr/include/sys/time.h /usr/include/sys/time.h
-lex.o: /local/include/X11/IntrinsicP.h /local/include/X11/Intrinsic.h
-lex.o: /local/include/X11/Xlib.h /local/include/X11/X.h
-lex.o: /local/include/X11/Xutil.h /local/include/X11/Xresource.h
-lex.o: /local/include/X11/Core.h /local/include/X11/Composite.h
-lex.o: /local/include/X11/Constraint.h /local/include/X11/Object.h
-lex.o: /local/include/X11/RectObj.h /local/include/X11/CoreP.h
-lex.o: /local/include/X11/CompositeP.h /local/include/X11/ConstrainP.h
-lex.o: /local/include/X11/ObjectP.h /local/include/X11/RectObjP.h
-lex.o: /local/include/X11/StringDefs.h /usr/include/stdio.h DviP.h Dvi.h
-lex.o: DviChar.h device.h
-page.o: /local/include/X11/Xos.h /usr/include/sys/types.h
-page.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
-page.o: /usr/include/strings.h /usr/include/sys/file.h
-page.o: /usr/include/sys/fcntlcom.h /usr/include/sys/stat.h
-page.o: /usr/include/sys/time.h /usr/include/sys/time.h
-page.o: /local/include/X11/IntrinsicP.h /local/include/X11/Intrinsic.h
-page.o: /local/include/X11/Xlib.h /local/include/X11/X.h
-page.o: /local/include/X11/Xutil.h /local/include/X11/Xresource.h
-page.o: /local/include/X11/Core.h /local/include/X11/Composite.h
-page.o: /local/include/X11/Constraint.h /local/include/X11/Object.h
-page.o: /local/include/X11/RectObj.h /local/include/X11/CoreP.h
-page.o: /local/include/X11/CompositeP.h /local/include/X11/ConstrainP.h
-page.o: /local/include/X11/ObjectP.h /local/include/X11/RectObjP.h
-page.o: /local/include/X11/StringDefs.h /usr/include/stdio.h
-page.o: /usr/include/ctype.h DviP.h Dvi.h DviChar.h device.h
-parse.o: /local/include/X11/Xos.h /usr/include/sys/types.h
-parse.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
-parse.o: /usr/include/strings.h /usr/include/sys/file.h
-parse.o: /usr/include/sys/fcntlcom.h /usr/include/sys/stat.h
+Dvi.o: /local/include/X11/X.h /local/include/X11/Xfuncproto.h
+Dvi.o: /local/include/X11/Xosdefs.h /usr/include/stddef.h
+Dvi.o: /local/include/X11/Xutil.h /local/include/X11/Xresource.h
+Dvi.o: /usr/include/string.h /local/include/X11/Core.h
+Dvi.o: /local/include/X11/Composite.h /local/include/X11/Constraint.h
+Dvi.o: /local/include/X11/Object.h /local/include/X11/RectObj.h
+Dvi.o: /local/include/X11/CoreP.h /local/include/X11/CompositeP.h
+Dvi.o: /local/include/X11/ConstrainP.h /local/include/X11/ObjectP.h
+Dvi.o: /local/include/X11/RectObjP.h /local/include/X11/StringDefs.h
+Dvi.o: /local/include/X11/Xmu/Converters.h /usr/include/stdio.h
+Dvi.o: /usr/include/ctype.h DviP.h Dvi.h DviChar.h device.h
+Dvi.o: /local/include/X11/bitmaps/gray
+draw.o: /local/include/X11/Xos.h /local/include/X11/Xosdefs.h
+draw.o: /usr/include/sys/types.h /usr/include/sys/stdtypes.h
+draw.o: /usr/include/sys/sysmacros.h /usr/include/string.h
+draw.o: /usr/include/fcntl.h /usr/include/sys/fcntlcom.h
+draw.o: /usr/include/sys/stat.h /usr/include/unistd.h /usr/include/sys/time.h
+draw.o: /usr/include/sys/time.h /local/include/X11/IntrinsicP.h
+draw.o: /local/include/X11/Intrinsic.h /local/include/X11/Xlib.h
+draw.o: /local/include/X11/X.h /local/include/X11/Xfuncproto.h
+draw.o: /usr/include/stddef.h /local/include/X11/Xutil.h
+draw.o: /local/include/X11/Xresource.h /local/include/X11/Core.h
+draw.o: /local/include/X11/Composite.h /local/include/X11/Constraint.h
+draw.o: /local/include/X11/Object.h /local/include/X11/RectObj.h
+draw.o: /local/include/X11/CoreP.h /local/include/X11/CompositeP.h
+draw.o: /local/include/X11/ConstrainP.h /local/include/X11/ObjectP.h
+draw.o: /local/include/X11/RectObjP.h /local/include/X11/StringDefs.h
+draw.o: /usr/include/stdio.h /usr/include/ctype.h /usr/include/math.h
+draw.o: /usr/include/floatingpoint.h /usr/include/sys/ieeefp.h DviP.h Dvi.h
+draw.o: DviChar.h device.h
+font.o: /local/include/X11/Xos.h /local/include/X11/Xosdefs.h
+font.o: /usr/include/sys/types.h /usr/include/sys/stdtypes.h
+font.o: /usr/include/sys/sysmacros.h /usr/include/string.h
+font.o: /usr/include/fcntl.h /usr/include/sys/fcntlcom.h
+font.o: /usr/include/sys/stat.h /usr/include/unistd.h /usr/include/sys/time.h
+font.o: /usr/include/sys/time.h /local/include/X11/IntrinsicP.h
+font.o: /local/include/X11/Intrinsic.h /local/include/X11/Xlib.h
+font.o: /local/include/X11/X.h /local/include/X11/Xfuncproto.h
+font.o: /usr/include/stddef.h /local/include/X11/Xutil.h
+font.o: /local/include/X11/Xresource.h /local/include/X11/Core.h
+font.o: /local/include/X11/Composite.h /local/include/X11/Constraint.h
+font.o: /local/include/X11/Object.h /local/include/X11/RectObj.h
+font.o: /local/include/X11/CoreP.h /local/include/X11/CompositeP.h
+font.o: /local/include/X11/ConstrainP.h /local/include/X11/ObjectP.h
+font.o: /local/include/X11/RectObjP.h /local/include/X11/StringDefs.h
+font.o: /usr/include/stdio.h /usr/include/ctype.h DviP.h Dvi.h DviChar.h
+font.o: device.h XFontName.h
+lex.o: /local/include/X11/Xos.h /local/include/X11/Xosdefs.h
+lex.o: /usr/include/sys/types.h /usr/include/sys/stdtypes.h
+lex.o: /usr/include/sys/sysmacros.h /usr/include/string.h
+lex.o: /usr/include/fcntl.h /usr/include/sys/fcntlcom.h
+lex.o: /usr/include/sys/stat.h /usr/include/unistd.h /usr/include/sys/time.h
+lex.o: /usr/include/sys/time.h /local/include/X11/IntrinsicP.h
+lex.o: /local/include/X11/Intrinsic.h /local/include/X11/Xlib.h
+lex.o: /local/include/X11/X.h /local/include/X11/Xfuncproto.h
+lex.o: /usr/include/stddef.h /local/include/X11/Xutil.h
+lex.o: /local/include/X11/Xresource.h /local/include/X11/Core.h
+lex.o: /local/include/X11/Composite.h /local/include/X11/Constraint.h
+lex.o: /local/include/X11/Object.h /local/include/X11/RectObj.h
+lex.o: /local/include/X11/CoreP.h /local/include/X11/CompositeP.h
+lex.o: /local/include/X11/ConstrainP.h /local/include/X11/ObjectP.h
+lex.o: /local/include/X11/RectObjP.h /local/include/X11/StringDefs.h
+lex.o: /usr/include/stdio.h DviP.h Dvi.h DviChar.h device.h
+page.o: /local/include/X11/Xos.h /local/include/X11/Xosdefs.h
+page.o: /usr/include/sys/types.h /usr/include/sys/stdtypes.h
+page.o: /usr/include/sys/sysmacros.h /usr/include/string.h
+page.o: /usr/include/fcntl.h /usr/include/sys/fcntlcom.h
+page.o: /usr/include/sys/stat.h /usr/include/unistd.h /usr/include/sys/time.h
+page.o: /usr/include/sys/time.h /local/include/X11/IntrinsicP.h
+page.o: /local/include/X11/Intrinsic.h /local/include/X11/Xlib.h
+page.o: /local/include/X11/X.h /local/include/X11/Xfuncproto.h
+page.o: /usr/include/stddef.h /local/include/X11/Xutil.h
+page.o: /local/include/X11/Xresource.h /local/include/X11/Core.h
+page.o: /local/include/X11/Composite.h /local/include/X11/Constraint.h
+page.o: /local/include/X11/Object.h /local/include/X11/RectObj.h
+page.o: /local/include/X11/CoreP.h /local/include/X11/CompositeP.h
+page.o: /local/include/X11/ConstrainP.h /local/include/X11/ObjectP.h
+page.o: /local/include/X11/RectObjP.h /local/include/X11/StringDefs.h
+page.o: /usr/include/stdio.h /usr/include/ctype.h DviP.h Dvi.h DviChar.h
+page.o: device.h
+parse.o: /local/include/X11/Xos.h /local/include/X11/Xosdefs.h
+parse.o: /usr/include/sys/types.h /usr/include/sys/stdtypes.h
+parse.o: /usr/include/sys/sysmacros.h /usr/include/string.h
+parse.o: /usr/include/fcntl.h /usr/include/sys/fcntlcom.h
+parse.o: /usr/include/sys/stat.h /usr/include/unistd.h
parse.o: /usr/include/sys/time.h /usr/include/sys/time.h
parse.o: /local/include/X11/IntrinsicP.h /local/include/X11/Intrinsic.h
parse.o: /local/include/X11/Xlib.h /local/include/X11/X.h
+parse.o: /local/include/X11/Xfuncproto.h /usr/include/stddef.h
parse.o: /local/include/X11/Xutil.h /local/include/X11/Xresource.h
parse.o: /local/include/X11/Core.h /local/include/X11/Composite.h
parse.o: /local/include/X11/Constraint.h /local/include/X11/Object.h
@@ -486,32 +538,40 @@ parse.o: /local/include/X11/StringDefs.h /usr/include/stdio.h
parse.o: /usr/include/ctype.h DviP.h Dvi.h DviChar.h device.h
XFontName.o: /local/include/X11/Xlib.h /usr/include/sys/types.h
XFontName.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
-XFontName.o: /local/include/X11/X.h /local/include/X11/Xos.h
-XFontName.o: /usr/include/strings.h /usr/include/sys/file.h
-XFontName.o: /usr/include/sys/fcntlcom.h /usr/include/sys/stat.h
+XFontName.o: /local/include/X11/X.h /local/include/X11/Xfuncproto.h
+XFontName.o: /local/include/X11/Xosdefs.h /usr/include/stddef.h
+XFontName.o: /local/include/X11/Xos.h /usr/include/string.h
+XFontName.o: /usr/include/fcntl.h /usr/include/sys/fcntlcom.h
+XFontName.o: /usr/include/sys/stat.h /usr/include/unistd.h
XFontName.o: /usr/include/sys/time.h /usr/include/sys/time.h XFontName.h
XFontName.o: /usr/include/ctype.h
DviChar.o: DviChar.h
device.o: /usr/include/stdio.h /usr/include/ctype.h /local/include/X11/Xos.h
-device.o: /usr/include/sys/types.h /usr/include/sys/stdtypes.h
-device.o: /usr/include/sys/sysmacros.h /usr/include/strings.h
-device.o: /usr/include/sys/file.h /usr/include/sys/fcntlcom.h
-device.o: /usr/include/sys/stat.h /usr/include/sys/time.h
+device.o: /local/include/X11/Xosdefs.h /usr/include/sys/types.h
+device.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
+device.o: /usr/include/string.h /usr/include/fcntl.h
+device.o: /usr/include/sys/fcntlcom.h /usr/include/sys/stat.h
+device.o: /usr/include/unistd.h /usr/include/sys/time.h
device.o: /usr/include/sys/time.h /local/include/X11/Intrinsic.h
device.o: /local/include/X11/Xlib.h /local/include/X11/X.h
+device.o: /local/include/X11/Xfuncproto.h /usr/include/stddef.h
device.o: /local/include/X11/Xutil.h /local/include/X11/Xresource.h
device.o: /local/include/X11/Core.h /local/include/X11/Composite.h
device.o: /local/include/X11/Constraint.h /local/include/X11/Object.h
device.o: /local/include/X11/RectObj.h device.h path.h
xtotroff.o: /local/include/X11/Xlib.h /usr/include/sys/types.h
xtotroff.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
-xtotroff.o: /local/include/X11/X.h /usr/include/stdio.h /usr/include/ctype.h
-xtotroff.o: XFontName.h DviChar.h
+xtotroff.o: /local/include/X11/X.h /local/include/X11/Xfuncproto.h
+xtotroff.o: /local/include/X11/Xosdefs.h /usr/include/stddef.h
+xtotroff.o: /usr/include/stdio.h /usr/include/ctype.h XFontName.h DviChar.h
+xtotroff.o: /usr/include/stdlib.h
XFontName.o: /local/include/X11/Xlib.h /usr/include/sys/types.h
XFontName.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
-XFontName.o: /local/include/X11/X.h /local/include/X11/Xos.h
-XFontName.o: /usr/include/strings.h /usr/include/sys/file.h
-XFontName.o: /usr/include/sys/fcntlcom.h /usr/include/sys/stat.h
+XFontName.o: /local/include/X11/X.h /local/include/X11/Xfuncproto.h
+XFontName.o: /local/include/X11/Xosdefs.h /usr/include/stddef.h
+XFontName.o: /local/include/X11/Xos.h /usr/include/string.h
+XFontName.o: /usr/include/fcntl.h /usr/include/sys/fcntlcom.h
+XFontName.o: /usr/include/sys/stat.h /usr/include/unistd.h
XFontName.o: /usr/include/sys/time.h /usr/include/sys/time.h XFontName.h
XFontName.o: /usr/include/ctype.h
DviChar.o: DviChar.h
diff --git a/xditview/README b/xditview/README
index 50433c960..59c22b104 100644
--- a/xditview/README
+++ b/xditview/README
@@ -1,13 +1,14 @@
This is gxditview, a X11 previewer for groff based on MIT's xditview.
This version can be used with the output of gtroff -Tps as well as
-with -TX75 and -TX100. You will need X11R4 to install it.
+with -TX75 and -TX100. You will need X11R5 to install it (it might
+work on X11R4, but I haven't tested it.)
See the file INSTALL in this directory for installation instructions.
xditview is copyrighted by MIT under the usual X terms (see
-gxditiew.man); my changes to it are in the public domain.
+gxditview.man); my changes to it are in the public domain.
-Please report bugs to me.
+Please report bugs as described in the file ../BUG-REPORT.
James Clark
-jjc@jclark.uucp
+jjc@jclark.com
diff --git a/xditview/draw.c b/xditview/draw.c
index 11fbee107..ad0fbafd8 100644
--- a/xditview/draw.c
+++ b/xditview/draw.c
@@ -309,7 +309,7 @@ int FakeCharacter (dw, buf, wid)
if (buf[0] == '\0' || buf[1] == '\0' || buf[2] != '\0')
return 0;
-#define pack2(c1, c2) (((unsigned char)(c1) << 8) | (unsigned char)(c2))
+#define pack2(c1, c2) (((c1) << 8) | (c2))
switch (pack2(buf[0], buf[1])) {
case pack2('f', 'i'):
@@ -327,9 +327,11 @@ int FakeCharacter (dw, buf, wid)
case pack2('F', 'l'):
chars = "ffl";
break;
+#if 0
case pack2('e', 'm'): /* em dash */
chars = "--";
break;
+#endif
case pack2('f', '/'): /* fraction slash */
chars = "/";
break;
@@ -415,9 +417,9 @@ setGC (dw)
int desired_line_width;
if (dw->dvi.line_thickness < 0)
- desired_line_width = ((dw->dvi.device_resolution
- * dw->dvi.state->font_size)
- / (10*72*dw->dvi.sizescale));
+ desired_line_width = (int)(((double)dw->dvi.device_resolution
+ * dw->dvi.state->font_size)
+ / (10.0*72.0*dw->dvi.sizescale));
else
desired_line_width = dw->dvi.line_thickness;
@@ -563,7 +565,6 @@ DrawPolygon (dw, v, n)
int *v;
int n;
{
- extern char *malloc();
XPoint *p;
int i;
int dx, dy;
@@ -572,9 +573,7 @@ DrawPolygon (dw, v, n)
AdjustCacheDeltas (dw);
setGC (dw);
- p = (XPoint *)malloc((n + 2)*sizeof(XPoint));
- if (!p)
- return;
+ p = (XPoint *)XtMalloc((n + 2)*sizeof(XPoint));
p[0].x = XPos (dw);
p[0].y = YPos (dw);
dx = 0;
@@ -589,7 +588,7 @@ DrawPolygon (dw, v, n)
p[n+1].y = p[0].y;
XDrawLines (XtDisplay (dw), XtWindow (dw), dw->dvi.normal_GC,
p, n + 2, CoordModeOrigin);
- free(p);
+ XtFree(p);
}
@@ -598,7 +597,6 @@ DrawFilledPolygon (dw, v, n)
int *v;
int n;
{
- extern char *malloc();
XPoint *p;
int i;
int dx, dy;
@@ -609,9 +607,7 @@ DrawFilledPolygon (dw, v, n)
AdjustCacheDeltas (dw);
setFillGC (dw);
- p = (XPoint *)malloc((n + 1)*sizeof(XPoint));
- if (!p)
- return;
+ p = (XPoint *)XtMalloc((n + 1)*sizeof(XPoint));
p[0].x = XPos (dw);
p[0].y = YPos (dw);
dx = 0;
@@ -624,7 +620,7 @@ DrawFilledPolygon (dw, v, n)
}
XFillPolygon (XtDisplay (dw), XtWindow (dw), dw->dvi.fill_GC,
p, n + 1, Complex, CoordModeOrigin);
- free(p);
+ XtFree(p);
}
#define POINTS_MAX 10000
diff --git a/xditview/font.c b/xditview/font.c
index c35057f65..f4211b83e 100644
--- a/xditview/font.c
+++ b/xditview/font.c
@@ -12,8 +12,6 @@
#include "DviP.h"
#include "XFontName.h"
-extern char *malloc ();
-
static char *
savestr (s)
char *s;
@@ -22,7 +20,7 @@ savestr (s)
if (!s)
return 0;
- n = malloc (strlen (s) + 1);
+ n = XtMalloc (strlen (s) + 1);
if (n)
strcpy (n, s);
return n;
@@ -55,15 +53,44 @@ MaxFontPosition (dw)
}
static DviFontSizeList *
-LookupFontSizeBySize (f, size, sizescale)
+LookupFontSizeBySize (dw, f, size)
+ DviWidget dw;
DviFontList *f;
- int size, sizescale;
+ int size;
{
DviFontSizeList *fs, *best = 0, *smallest = 0;
int bestsize = 0;
-
+ XFontName fontName;
+ unsigned int fontNameAttributes;
+ char fontNameString[2048];
+ int decipointsize;
+
+ if (f->scalable) {
+ decipointsize = (10*size)/dw->dvi.sizescale;
+ for (best = f->sizes; best; best = best->next)
+ if (best->size == decipointsize)
+ return best;
+ best = (DviFontSizeList *) XtMalloc(sizeof *best);
+ best->next = f->sizes;
+ best->size = decipointsize;
+ f->sizes = best;
+ XParseFontName (f->x_name, &fontName, &fontNameAttributes);
+ fontNameAttributes &= ~(FontNamePixelSize|FontNameAverageWidth);
+ fontNameAttributes |= FontNameResolutionX;
+ fontNameAttributes |= FontNameResolutionY;
+ fontNameAttributes |= FontNamePointSize;
+ fontName.ResolutionX = dw->dvi.display_resolution;
+ fontName.ResolutionY = dw->dvi.display_resolution;
+ fontName.PointSize = decipointsize;
+ XFormatFontName (&fontName, fontNameAttributes, fontNameString);
+ best->x_name = savestr (fontNameString);
+ best->doesnt_exist = 0;
+ best->font = 0;
+ return best;
+ }
for (fs = f->sizes; fs; fs=fs->next) {
- if (sizescale*fs->size <= 10*size && fs->size >= bestsize) {
+ if (dw->dvi.sizescale*fs->size <= 10*size
+ && fs->size >= bestsize) {
best = fs;
bestsize = fs->size;
}
@@ -115,9 +142,10 @@ ConvertFontNameToEncoding (n)
}
DviFontSizeList *
-InstallFontSizes (dw, x_name)
+InstallFontSizes (dw, x_name, scalablep)
DviWidget dw;
char *x_name;
+ Boolean *scalablep;
{
char fontNameString[2048];
char **fonts;
@@ -127,9 +155,11 @@ InstallFontSizes (dw, x_name)
XFontName fontName;
unsigned int fontNameAttributes;
+ *scalablep = FALSE;
if (!XParseFontName (x_name, &fontName, &fontNameAttributes))
return 0;
- fontNameAttributes &= ~(FontNamePixelSize|FontNamePointSize);
+ fontNameAttributes &= ~(FontNamePixelSize|FontNamePointSize
+ |FontNameAverageWidth);
fontNameAttributes |= FontNameResolutionX;
fontNameAttributes |= FontNameResolutionY;
fontName.ResolutionX = dw->dvi.display_resolution;
@@ -138,8 +168,15 @@ InstallFontSizes (dw, x_name)
fonts = XListFonts (XtDisplay (dw), fontNameString, 10000000, &count);
sizes = 0;
for (i = 0; i < count; i++) {
- if ((size = ConvertFontNameToSize (fonts[i])) != -1) {
- new = (DviFontSizeList *) malloc (sizeof *new);
+ size = ConvertFontNameToSize (fonts[i]);
+ if (size == 0) {
+ DisposeFontSizes (dw, sizes);
+ sizes = 0;
+ *scalablep = TRUE;
+ break;
+ }
+ if (size != -1) {
+ new = (DviFontSizeList *) XtMalloc (sizeof *new);
new->next = sizes;
new->size = size;
new->x_name = savestr (fonts[i]);
@@ -153,7 +190,8 @@ InstallFontSizes (dw, x_name)
}
static
-DisposeFontSizes (fs)
+DisposeFontSizes (dw, fs)
+ DviWidget dw;
DviFontSizeList *fs;
{
DviFontSizeList *next;
@@ -161,10 +199,12 @@ DisposeFontSizes (fs)
for (; fs; fs=next) {
next = fs->next;
if (fs->x_name)
- free (fs->x_name);
- if (fs->font)
+ XtFree (fs->x_name);
+ if (fs->font) {
+ XUnloadFont (XtDisplay (dw), fs->font->fid);
XFree ((char *)fs->font);
- free ((char *) fs);
+ }
+ XtFree ((char *) fs);
}
}
@@ -176,7 +216,6 @@ InstallFont (dw, position, dvi_name, x_name)
char *x_name;
{
DviFontList *f;
- DviFontSizeList *sizes;
char *encoding;
if ((f = LookupFontByPosition (dw, position)) != NULL) {
@@ -187,29 +226,24 @@ InstallFont (dw, position, dvi_name, x_name)
!strcmp (f->x_name, x_name))
return f;
- sizes = InstallFontSizes (dw, x_name);
- if (!sizes)
- return f;
-
- DisposeFontSizes (f->sizes);
+ DisposeFontSizes (dw, f->sizes);
if (f->dvi_name)
- free (f->dvi_name);
+ XtFree (f->dvi_name);
if (f->x_name)
- free (f->x_name);
+ XtFree (f->x_name);
f->device_font = 0;
} else {
- sizes = InstallFontSizes (dw, x_name);
- if (!sizes)
- return 0;
- f = (DviFontList *) malloc (sizeof (*f));
+ f = (DviFontList *) XtMalloc (sizeof (*f));
f->next = dw->dvi.fonts;
dw->dvi.fonts = f;
}
+ f->initialized = FALSE;
f->dvi_name = savestr (dvi_name);
f->device_font = device_find_font (dw->dvi.device, dvi_name);
f->x_name = savestr (x_name);
f->dvi_number = position;
- f->sizes = sizes;
+ f->sizes = 0;
+ f->scalable = FALSE;
if (f->x_name) {
encoding = ConvertFontNameToEncoding (f->x_name);
f->char_map = DviFindMap (encoding);
@@ -236,13 +270,13 @@ ForgetFonts (dw)
DviFontList *tem = f;
if (f->sizes)
- DisposeFontSizes (f->sizes);
+ DisposeFontSizes (dw, f->sizes);
if (f->dvi_name)
- free (f->dvi_name);
+ XtFree (f->dvi_name);
if (f->x_name)
- free (f->x_name);
+ XtFree (f->x_name);
f = f->next;
- free ((char *) tem);
+ XtFree ((char *) tem);
}
/*
@@ -311,7 +345,7 @@ ParseFontMap (dw)
++m;
strncpy (x_name, s, m-s);
x_name[m-s] = '\0';
- new = (DviFontMap *) malloc (sizeof *new);
+ new = (DviFontMap *) XtMalloc (sizeof *new);
new->x_name = savestr (x_name);
new->dvi_name = savestr (dvi_name);
new->next = fm;
@@ -329,10 +363,10 @@ DestroyFontMap (font_map)
for (; font_map; font_map = next) {
next = font_map->next;
if (font_map->x_name)
- free (font_map->x_name);
+ XtFree (font_map->x_name);
if (font_map->dvi_name)
- free (font_map->dvi_name);
- free ((char *) font_map);
+ XtFree (font_map->dvi_name);
+ XtFree ((char *) font_map);
}
}
@@ -363,7 +397,13 @@ QueryFont (dw, position, size)
f = LookupFontByPosition (dw, position);
if (!f)
return dw->dvi.default_font;
- fs = LookupFontSizeBySize (f, size, dw->dvi.sizescale);
+ if (!f->initialized) {
+ f->sizes = InstallFontSizes (dw, f->x_name, &f->scalable);
+ f->initialized = TRUE;
+ }
+ fs = LookupFontSizeBySize (dw, f, size);
+ if (!fs)
+ return dw->dvi.default_font;
if (!fs->font) {
if (fs->x_name)
fs->font = XLoadQueryFont (XtDisplay (dw), fs->x_name);
diff --git a/xditview/gxditview.man b/xditview/gxditview.man
index 89634341e..0a0d5c8e2 100644
--- a/xditview/gxditview.man
+++ b/xditview/gxditview.man
@@ -50,6 +50,14 @@ it will be taken to be a command to read from.
.B Quit
Exit from
.IR gxditview .
+.PP
+The
+.B paperlength
+and
+.B paperwidth
+commands in the DESC file specify the length and width in machine units
+of the virtual page displayed by
+.IR gxditview .
.SH OPTIONS
.I Gxditview
accepts all of the standard X Toolkit command line options along with the
diff --git a/xditview/page.c b/xditview/page.c
index 553bb3f13..9284199cd 100644
--- a/xditview/page.c
+++ b/xditview/page.c
@@ -11,6 +11,10 @@
#include <ctype.h>
#include "DviP.h"
+#ifdef X_NOT_STDC_ENV
+extern long ftell();
+#endif
+
static DviFileMap *
MapPageNumberToFileMap (dw, number)
DviWidget dw;
@@ -31,7 +35,7 @@ DestroyFileMap (m)
for (; m; m = next) {
next = m->next;
- free ((char *) m);
+ XtFree ((char *) m);
}
}
@@ -46,12 +50,10 @@ RememberPagePosition(dw, number)
DviWidget dw;
int number;
{
- extern long ftell();
DviFileMap *m;
- extern char *malloc();
if (!(m = MapPageNumberToFileMap (dw, number))) {
- m = (DviFileMap *) malloc (sizeof *m);
+ m = (DviFileMap *) XtMalloc (sizeof *m);
m->page_number = number;
m->next = dw->dvi.file_map;
dw->dvi.file_map = m;
diff --git a/xditview/parse.c b/xditview/parse.c
index 2abe81404..8367c17b9 100644
--- a/xditview/parse.c
+++ b/xditview/parse.c
@@ -161,9 +161,8 @@ push_env(dw)
DviWidget dw;
{
DviState *new;
- extern char *malloc();
- new = (DviState *) malloc (sizeof (*new));
+ new = (DviState *) XtMalloc (sizeof (*new));
if (dw->dvi.state)
*new = *(dw->dvi.state);
else {
@@ -184,7 +183,7 @@ pop_env(dw)
old = dw->dvi.state;
dw->dvi.state = old->next;
- free ((char *) old);
+ XtFree ((char *) old);
}
static
diff --git a/xditview/tmac.Xps b/xditview/tmac.Xps
new file mode 100644
index 000000000..af5ac93e3
--- /dev/null
+++ b/xditview/tmac.Xps
@@ -0,0 +1,5 @@
+.mso tmac.ps
+.char \(bu \Z'\X'ps: invis'\fS\(bu\fP\X'ps: endinvis''\(bu
+.char \(em \X'ps: invis'\
+\Z'\v'-.25m'\h'.05m'\D'l .9m 0'\h'.05m''\
+\X'ps: endinvis'\(em
diff --git a/xditview/xditview.c b/xditview/xditview.c
index c984a9b9e..925b66258 100644
--- a/xditview/xditview.c
+++ b/xditview/xditview.c
@@ -1,4 +1,25 @@
/*
+ * Copyright 1991 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. M.I.T. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+/*
* xditview --
*
* Display ditroff output in an X window
@@ -521,6 +542,14 @@ char *def;
promptfunction = func;
}
+/* For DviChar.c */
+
+char *xmalloc(n)
+ int n;
+{
+ return XtMalloc(n);
+}
+
/*
Local Variables:
c-indent-level: 4
diff --git a/xditview/xtotroff.c b/xditview/xtotroff.c
index 3004d065a..16e8c263e 100644
--- a/xditview/xtotroff.c
+++ b/xditview/xtotroff.c
@@ -4,20 +4,28 @@
* convert X font metrics into troff font metrics
*/
-# include <X11/Xlib.h>
-# include <stdio.h>
-# include <ctype.h>
-# include "XFontName.h"
-# include "DviChar.h"
-
-# define charWidth(fi,c) ((fi)->per_char[(c) - (fi)->min_char_or_byte2].width)
-# define charHeight(fi,c) ((fi)->per_char[(c) - (fi)->min_char_or_byte2].ascent)
-# define charDepth(fi,c) ((fi)->per_char[(c) - (fi)->min_char_or_byte2].descent)
-# define charLBearing(fi,c) ((fi)->per_char[(c) - (fi)->min_char_or_byte2].lbearing)
-# define charRBearing(fi,c) ((fi)->per_char[(c) - (fi)->min_char_or_byte2].rbearing)
+#include <X11/Xlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include "XFontName.h"
+#include "DviChar.h"
+
+#ifdef X_NOT_STDC_ENV
+char *malloc();
+#else
+#include <stdlib.h>
+#endif
+
+#define charWidth(fi,c) ((fi)->per_char[(c) - (fi)->min_char_or_byte2].width)
+#define charHeight(fi,c) ((fi)->per_char[(c) - (fi)->min_char_or_byte2].ascent)
+#define charDepth(fi,c) ((fi)->per_char[(c) - (fi)->min_char_or_byte2].descent)
+#define charLBearing(fi,c) ((fi)->per_char[(c) - (fi)->min_char_or_byte2].lbearing)
+#define charRBearing(fi,c) ((fi)->per_char[(c) - (fi)->min_char_or_byte2].rbearing)
Display *dpy;
int groff_flag = 0;
+unsigned resolution = 75;
+unsigned point_size = 10;
int charExists (fi, c)
XFontStruct *fi;
@@ -32,6 +40,53 @@ int charExists (fi, c)
|| p->ascent != 0 || p->descent != 0 || p->attributes != 0);
}
+/* Canonicalize the font name by replacing scalable parts by *s. */
+
+CanonicalizeFontName (font_name, canon_font_name)
+ char *font_name, *canon_font_name;
+{
+ unsigned int attributes;
+ XFontName parsed;
+
+ if (!XParseFontName(font_name, &parsed, &attributes)) {
+ fprintf (stderr, "not a standard name: %s\n", font_name);
+ return 0;
+ }
+
+ attributes &= ~(FontNamePixelSize|FontNameAverageWidth
+ |FontNamePointSize
+ |FontNameResolutionX|FontNameResolutionY);
+ XFormatFontName(&parsed, attributes, canon_font_name);
+ return 1;
+}
+
+int FontNamesAmbiguous(font_name, names, count)
+char *font_name;
+char **names;
+int count;
+{
+ char name1[2048], name2[2048];
+ int i;
+
+ if (count == 1)
+ return 0;
+
+ for (i = 0; i < count; i++) {
+ if (!CanonicalizeFontName(names[i], i == 0 ? name1 : name2)) {
+ fprintf(stderr, "bad font name: %s\n", names[i]);
+ return 1;
+ }
+ if (i > 0 && strcmp(name1, name2) != 0) {
+ fprintf(stderr, "ambiguous font name: %s\n", font_name);
+ fprintf(stderr, " matches %s\n", names[0]);
+ fprintf(stderr, " and %s\n", names[i]);
+ return 1;
+ }
+
+ }
+ return 0;
+}
+
MapFont (font_name, troff_name)
char *font_name;
char *troff_name;
@@ -48,20 +103,32 @@ MapFont (font_name, troff_name)
char encoding[256];
char *s;
int wid;
+ char name_string[2048];
- names = XListFonts (dpy, font_name, 100000, &count);
- if (count < 1) {
- fprintf (stderr, "bad font name: %s\n", font_name);
+ if (!XParseFontName(font_name, &parsed, &attributes)) {
+ fprintf (stderr, "not a standard name: %s\n", font_name);
return 0;
}
- if (count > 1) {
- fprintf (stderr, "ambiguous font name: %s\n", font_name);
+
+ attributes &= ~(FontNamePixelSize|FontNameAverageWidth);
+ attributes |= FontNameResolutionX;
+ attributes |= FontNameResolutionY;
+ attributes |= FontNamePointSize;
+ parsed.ResolutionX = resolution;
+ parsed.ResolutionY = resolution;
+ parsed.PointSize = point_size*10;
+ XFormatFontName(&parsed, attributes, name_string);
+
+ names = XListFonts (dpy, name_string, 100000, &count);
+ if (count < 1) {
+ fprintf (stderr, "bad font name: %s\n", font_name);
return 0;
}
- if (!XParseFontName (names[0], &parsed, &attributes)) {
- fprintf (stderr, "not a standard name: %s\n", names[0]);
+
+ if (FontNamesAmbiguous(font_name, names, count))
return 0;
- }
+
+ XParseFontName(names[0], &parsed, &attributes);
sprintf (encoding, "%s-%s", parsed.CharSetRegistry,
parsed.CharSetEncoding);
for (s = encoding; *s; s++)
@@ -73,6 +140,14 @@ MapFont (font_name, troff_name)
return 0;
}
+ fi = XLoadQueryFont (dpy, names[0]);
+ if (!fi) {
+ fprintf (stderr, "font does not exist: %s\n", names[0]);
+ return 0;
+ }
+
+ printf ("%s -> %s\n", names[0], troff_name);
+
(void) unlink (troff_name);
out = fopen (troff_name, "w");
if (!out) {
@@ -82,7 +157,6 @@ MapFont (font_name, troff_name)
fprintf (out, "name %s\n", troff_name);
if (!strcmp (char_map->encoding, "adobe-fontspecific"))
fprintf (out, "special\n");
- fi = XLoadQueryFont (dpy, names[0]);
if (charExists (fi, ' ')) {
int w = charWidth (fi, ' ');
if (w > 0)
@@ -132,10 +206,26 @@ MapFont (font_name, troff_name)
static usage(prog)
char *prog;
{
- fprintf (stderr, "usage: %s [-g] FontMap\n", prog);
+ fprintf (stderr,
+ "usage: %s [-g] [-r resolution] [-s pointsize FontMap\n",
+ prog);
exit (1);
}
+
+/* For use by DviChar.c */
+
+char *xmalloc(n)
+int n;
+{
+ char *p = malloc(n);
+ if (!p) {
+ fprintf(stderr, "Out of memory\n");
+ exit(1);
+ }
+ return p;
+}
+
main (argc, argv)
char **argv;
{
@@ -147,14 +237,21 @@ main (argc, argv)
FILE *map;
int opt;
extern int optind;
+ extern char *optarg;
- while ((opt = getopt(argc, argv, "g")) != EOF) {
+ while ((opt = getopt(argc, argv, "gr:s:")) != EOF) {
switch (opt) {
case 'g':
groff_flag = 1;
break;
+ case 'r':
+ sscanf(optarg, "%u", &resolution);
+ break;
+ case 's':
+ sscanf(optarg, "%u", &point_size);
+ break;
default:
- usage();
+ usage(argv[0]);
}
}
if (argc - optind != 1)
@@ -187,7 +284,6 @@ main (argc, argv)
if ((*b = *a) == '\n')
break;
*b = '\0';
- printf ("%s -> %s\n", font_name, troff_name);
if (!MapFont (font_name, troff_name))
exit (1);
++position;