summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES36
-rw-r--r--ChangeLog259
-rw-r--r--INSTALL33
-rw-r--r--Makefile31
-rw-r--r--PROJECTS3
-rw-r--r--README9
-rw-r--r--VERSION2
-rw-r--r--c++test.c13
-rw-r--r--c++test.ref2
-rw-r--r--driver/driver.h1
-rw-r--r--driver/input.c66
-rw-r--r--driver/printer.c2
-rw-r--r--dvi/dvi.c3
-rw-r--r--dvi/tfmtodit.c26
-rw-r--r--eqn/Makefile2
-rw-r--r--eqn/box.c14
-rw-r--r--eqn/delim.c8
-rw-r--r--eqn/eqn.tab.c281
-rw-r--r--eqn/eqn.y3
-rw-r--r--eqn/lex.c14
-rw-r--r--eqn/other.c4
-rw-r--r--eqn/pile.c4
-rw-r--r--eqn/special.c2
-rw-r--r--eqn/text.c24
-rw-r--r--etc/grog.pl13
-rw-r--r--etc/grog.sh15
-rw-r--r--lib/font.c93
-rw-r--r--lib/font.h2
-rw-r--r--lib/fontfile.c7
-rw-r--r--lib/lib.h13
-rw-r--r--lib/new.c4
-rw-r--r--lib/ptable.h6
-rw-r--r--lib/string.c8
-rw-r--r--lib/tmpfile.c2
-rw-r--r--macros/Makefile40
-rw-r--r--macros/doc-common449
-rw-r--r--macros/doc-ditroff269
-rw-r--r--macros/doc-nroff225
-rw-r--r--macros/doc-syms234
-rw-r--r--macros/tmac.andoc1
-rw-r--r--macros/tmac.doc4670
-rw-r--r--macros/tmac.doc.old1858
-rw-r--r--macros/tmac.s2
-rw-r--r--man/gpic.man48
-rw-r--r--man/grefer.man2
-rw-r--r--man/groff_font.man2
-rw-r--r--man/groff_out.man2
-rw-r--r--man/grops.man7
-rw-r--r--man/grotty.man24
-rw-r--r--man/gtroff.man5
-rwxr-xr-xman/mdate.sh4
-rw-r--r--mm/ChangeLog59
-rw-r--r--mm/Makefile13
-rw-r--r--mm/NOTES112
-rw-r--r--mm/README3
-rw-r--r--mm/groff_mm.man94
-rw-r--r--mm/mm/0.MT116
-rw-r--r--mm/mm/4.MT68
-rw-r--r--mm/mm/5.MT35
-rw-r--r--mm/mm/ms.MT47
-rw-r--r--mm/mm/ms.cov47
-rw-r--r--mm/mm/se_ms.cov3
-rw-r--r--mm/tmac.m384
-rw-r--r--mm/tmac.mse10
-rw-r--r--pic/TODO17
-rw-r--r--pic/common.c6
-rw-r--r--pic/lex.c19
-rw-r--r--pic/object.c21
-rw-r--r--pic/pic.tab.c2307
-rw-r--r--pic/pic.tab.h7
-rw-r--r--pic/pic.y189
-rw-r--r--ps/Makefile2
-rw-r--r--ps/devps/dingbatsrmap1
-rw-r--r--ps/ps.c8
-rw-r--r--ps/psrm.c16
-rw-r--r--ps/tmac.ps38
-rw-r--r--ps/tmac.pspic41
-rw-r--r--refer/command.c4
-rw-r--r--refer/index.c26
-rw-r--r--refer/indxbib.c6
-rw-r--r--refer/label.tab.c12
-rw-r--r--refer/label.y12
-rw-r--r--refer/linear.c10
-rw-r--r--refer/ref.c11
-rw-r--r--refer/refer.c6
-rw-r--r--refer/search.c4
-rw-r--r--refer/token.c69
-rw-r--r--refer/token.h23
-rw-r--r--tbl/main.c84
-rw-r--r--tbl/table.c38
-rw-r--r--tbl/table.h25
-rw-r--r--troff/column.c8
-rw-r--r--troff/div.c4
-rw-r--r--troff/env.c57
-rw-r--r--troff/env.h21
-rw-r--r--troff/input.c78
-rw-r--r--troff/node.c159
-rw-r--r--troff/node.h32
-rw-r--r--troff/number.c7
-rw-r--r--troff/request.h2
-rw-r--r--troff/symbol.c4
-rw-r--r--tty/tmac.tty1
-rw-r--r--tty/tty.c328
-rw-r--r--xditview/ChangeLog8
-rw-r--r--xditview/TODO3
-rw-r--r--xditview/lex.c87
-rw-r--r--xditview/tmac.X1
107 files changed, 9885 insertions, 3755 deletions
diff --git a/CHANGES b/CHANGES
index 071dc2bc4..b17573dbb 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,42 @@
This file describes recent user-visible changes in groff. Bug fixes
are not described. There are more details in the man pages.
+VERSION 1.05
+============
+
+Pic
+---
+
+There is a alternative assignment operator `:=' which interacts
+differently with blocks.
+
+There is a new command `command', which allows the values of variables
+to be passed through to troff or TeX.
+
+The `print' command now accepts multiple arguments.
+
+String comparison expressions (using `==' or `!=') are allowed in more
+contexts.
+
+Grotty
+------
+
+Horizontal and vertical lines drawn with \D'l ...' will be rendered
+using -, | and + characters. This is intended to give reasonable
+results with boxed tables. It won't work well with pic.
+
+Macros
+------
+
+The -mdoc macros have been upgraded to the version in the second
+Berkeley networking release. This version is not completely
+compatible with earlier versions; the old version is still available
+as -mdoc.old. The grog script has been enhanced so that it can
+usually determine whether a document requires the old or new versions.
+
+With -TX75, -TX100 and -TXps, the PSPIC macro will produce a box
+around where the picture would appear with -Tps.
+
VERSION 1.04
============
diff --git a/ChangeLog b/ChangeLog
index 0473cf043..8ff48bfa8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,262 @@
+Wed Mar 18 09:29:10 1992 James Clark (jjc at jclark)
+
+ * Version 1.05 released.
+
+Tue Mar 17 16:50:45 1992 James Clark (jjc at jclark)
+
+ * tty/tty.c: Instead of keeping an array of glyphs and then
+ sorting it, keep a ordered linked list of glyphs for each line.
+
+ * driver/driver.h: Include stddef.h.
+
+ * tty/tty.c (compare_glyph):
+ * refer/refer.c (rcompare):
+ * troff/env.c (compare_ranges): Arguments of qsort comparison
+ function should be const void *.
+
+ * troff/number.c (parse_term):
+ * dvi/dvi.c (draw_dvi_printer::draw): Avoid initialization in
+ switch statement.
+
+ * refer/label.y (consider_authors): Don't access variables
+ constructed under a condition outside that condition: put braces
+ round for statement containing declaration; redeclare use of same
+ variable later.
+
+ * pic/pic.y (text_expr): Delete production that allows
+ parenthesised text_expr.
+ (expr): Allow a conditional_expr to appear in parentheses.
+ (conditional_expr): Rename to any_expr.
+
+ * mm: Install new version 1.01 from jh.
+
+ * lib/font.c (font::get_width): Cache scaled widths.
+ (font::font): Initialize widths_cache.
+ (font::~font): Destroy widths_cache.
+ * lib/font.h: Add font::widths_cache. Declare font_widths_cache.
+
+Mon Mar 16 10:16:10 1992 James Clark (jjc at jclark)
+
+ * c++test.c, c++test.ref: New files.
+ * Makefile: Check that the C++ compiler works.
+
+ * ps/tmac.pspic (PSPIC): Do a break.
+
+ * ps/tmac.ps: Move definition of PSPIC into...
+ * ps/tmac.pspic: New file.
+ (PSPIC): Draw box around picture, but make it invisible to grops.
+ * ps/tmac.ps: Load tmac.pspic.
+ * ps/Makefile: Install tmac.pspic.
+
+Sun Mar 15 14:18:08 1992 James Clark (jjc at jclark)
+
+ * lib/font.c (scale_round): If n is negative,
+ subtract .5 before truncating floating point result.
+
+ * lib/fontfile.c: Include <errno.h>.
+
+Tue Mar 10 14:17:03 1992 James Clark (jjc at jclark)
+
+ * driver/input.c (get_char): Inline. Don't update current_lineno.
+ Change callers to up date current_lineno if necessary.
+ Use get_char() instead of getc(current_file).
+
+Sun Mar 8 18:05:28 1992 James Clark (jjc at jclark)
+
+ * ps/tmac.ps: Fix up spacing of \(mo and \(nm.
+
+Fri Mar 6 19:38:58 1992 James Clark (jjc at jclark)
+
+ * tty/tty.c (tmac.tty): Define \(rg as (R).
+
+Tue Mar 3 10:11:25 1992 James Clark (jjc at jclark)
+
+ * lib/lib.h: New define a_delete.
+ * Use a_delete instead of delete when deleting an array of objects
+ without destructors.
+
+ * lib/lib.h: Rename adelete to ad_delete.
+ * Change uses of adelete.
+
+Mon Mar 2 12:41:05 1992 James Clark (jjc at jclark)
+
+ * eqn/eqn.y: Include lib.h.
+
+ * troff/node.c (grow_font_table): Delete old_font_table.
+
+ * mm: Install new version from jh.
+
+Fri Feb 28 10:42:23 1992 James Clark (jjc at jclark)
+
+ * tbl/table.h (format_type): Make global instead of local to class
+ entry_format. Prefix enumerators with FORMAT_.
+ * tbl/table.c, tbl/main.c: Corresponding changes.
+ * refer/token.h (token_type): Make global. Prefix enumerators
+ with TOKEN_.
+ * refer/token.[ch]: Corresponding changes.
+ * Makefile: Get rid of -DNO_NESTED_TYPES configuration option.
+
+ * troff/div.c (node::set_vertical_size): Don't name argument.
+
+Thu Feb 27 10:29:19 1992 James Clark (jjc at jclark)
+
+ * Makefile: New configuration option ARRAY_DELETE_NEEDS_SIZE.
+ * lib/lib.h: Define adelete accordingly.
+ * pic/object.c (graphic_object::graphic_object):
+ * tbl/main.c (format::~format):
+ * tbl/table.c (table::~table):
+ * refer/ref.c (reference::~reference, reference::merge,
+ reference::insert_field, reference::delete_field): Use adelete.
+
+ * Makefile: Change NESTED_TYPES to NO_NESTED_TYPES.
+ * refer/token.h:
+ * tbl/table.h: Corresponding changes.
+
+ * common.c (common_output::dashed_arc, common_output::dotted_arc):
+ Ensure total_angle is positive.
+
+Wed Feb 26 08:49:26 1992 James Clark (jjc at jclark)
+
+ * refer/ref.c (reference::merge, reference::insert_field,
+ reference::delete_field): Avoid delete[0].
+
+ * refer/token.c (init_special_chars): Move calls to cmupper
+ outside calls to init_two_char_letter to work around bug in gcc
+ 2.0.
+
+Mon Feb 24 14:20:00 1992 James Clark (jjc at jclark)
+
+ * lib/new.c (operator new): Use __builtin_new for g++.
+
+ * pic/object.c (graphic_object::~graphic_object): Don't use
+ delete [] on 0.
+
+ * pic/object.c (output::compute_scale): Initialize max_width and
+ max_height.
+
+Sat Feb 15 09:55:20 1992 James Clark (jjc at jclark)
+
+ * troff/input.c (write_request): Call fflush.
+
+ * troff/node.h (class composite_node): Move declaration to node.c
+ * troff/input.c (charinfo_to_node): Rename to ...
+ (charinfo_to_node_list): Return node list rather than composite
+ node.
+ * troff/node.c (make_composite_node): New function.
+ (make_node, add_char): Call make_composite_node instead of
+ charinfo_to_node.
+ (class composite_node): Add a tfont * member. Delete font_size
+ member.
+ (composite_node::composite_node, composite_node::copy,
+ composite_node::size): Corresponding changes.
+ (composite_node::tprint): Provide constant spacing, emboldening
+ and track kerning as specified in tfont.
+ (composite_node::width): Change width calculation accordingly.
+ * troff/env.h (environment::composite): New member.
+ (environment::is_composite, environment::set_composite): New
+ functions.
+ * troff/env.c (environment::environment): Initialize composite.
+ * troff/input.c (charinfo_to_node): Call
+ environment::set_composite.
+ * troff/node.c (make_composite_node, make_glyph_node): Use the
+ plain version of the tfont if the environment is composite.
+
+ * troff/node.c (font_info::get_space_width): Additional argument
+ giving space_size. Handle constance space correctly. Scale by
+ space_size unless constant spaced.
+ (env_sentence_space_width): New function.
+ * troff/node.h: Declare it.
+ * troff/env.h (environment::get_space_size,
+ environment::get_sentence_space_size,
+ environment::get_narrow_space_width,
+ environment::get_half_narrow_space_width): Make inline.
+ (environment::get_space_width): Make inline. Just call
+ env_space_width.
+ * troff/env.c: Delete definitions for funtions made inline.
+ (environment::space_newline, environment::space): Use
+ env_sentence_space_width(). Don't scale by space_size.
+ * troff/node.h: Move declarations of env*space_width() functions
+ into env.h.
+
+Sat Feb 8 09:30:22 1992 James Clark (jjc at jclark)
+
+ * macros/tmac.s (PS): Don't try to set negative indent.
+
+Thu Feb 6 09:00:35 1992 James Clark (jjc at jclark)
+
+ * pic/pic.y: Fix min function.
+
+Tue Jan 28 07:52:29 1992 James Clark (jjc at jclark)
+
+ * man/mdate.sh: Clear LANGUAGE.
+
+Sun Jan 19 13:02:41 1992 James Clark (jjc at jclark)
+
+ * pic/pic.y, pic/lex.c: Rename COMMAND token to COMMAND_LINE.
+ * pic/lex.c: New COMMAND keyword.
+ * pic/pic.y (print_args, print_arg): New rules.
+ (placeless_element): Use print_args for PRINT.
+ New COMMAND element.
+
+Tue Jan 7 13:14:31 1992 James Clark (jjc at jclark)
+
+ * troff/input.c (terminal): Handle missing argument correctly.
+
+ * pic/pic.y (text_expr): New rule.
+
+ * pic/pic.y: Implement := operator.
+
+Sun Jan 5 10:23:02 1992 James Clark (jjc at jclark)
+
+ * etc/grog.pl, etc/grog.sh: Distinguish old and new versions of
+ mdoc.
+
+Sat Jan 4 14:42:26 1992 James Clark (jjc at jclark)
+
+ * ps/devps/dingbatsrmap: Include this in the distribution.
+
+ * macros/tmac.doc: Replace with new version from 2nd Networking
+ Release. Fix loading of doc-* files.
+ * macros/{doc-common,doc-ditroff,doc-nroff,doc-syms}: New files.
+ * macros/tmac.doc.old: New file. Apply fixes that had been
+ applied to old tmac.doc.
+ * macros/tmac.andoc: Check that we're running under groff.
+ * macros/Makefile: Rework.
+
+Fri Jan 3 13:27:51 1992 James Clark (jjc at jclark)
+
+ * tbl/table.h (format_type):
+ * refer/token.h (token_type): If NESTED_TYPES is defined, use
+ typedef to make these types visible at file scope.
+ * Makefile: Add NESTED_TYPES configuration option.
+
+ * troff/div.c (mark): At the top level use the value of
+ nl_reg_contents rather than the current vertical position.
+
+Thu Jan 2 10:34:51 1992 James Clark (jjc at jclark)
+
+ * tty/tty.c: Implement \D for horizontal or vertical lines.
+ (tty_printer::set_char): Use vec_used+2 as serial number.
+ Don't allow size of vector to exceed USHRT_MAX-2.
+ Split off part into...
+ (tty_printer::add_char): New function.
+ (tty_printer::draw): New function.
+ (compare_glyph): Handle equal serial numbers.
+ (tty_printer::end_page): Handle overstruck characters from \D.
+ (main, usage): Implement -d option.
+
+Mon Dec 23 10:37:51 1991 James Clark (jjc at jclark)
+
+ * tbl/main.c (process_format):
+ * eqn/text.c (split_text):
+ * troff/input.c (token::next): Use inner block for declarations
+ with initializers in switch statement.
+
+Mon Dec 16 20:52:03 1991 James Clark (jjc at jclark)
+
+ * pic/common.c (common_output::dash_line): Cope with zero-length
+ lines.
+
Sun Nov 17 12:04:08 1991 James Clark (jjc at jclark)
* Version 1.04 released.
diff --git a/INSTALL b/INSTALL
index 27bd271d8..7f740367d 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,8 +1,31 @@
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.
+the appropriate version of libg++. With g++ version 1.x, you will
+also need a libg++.a that contains at least xyzzy.o (if you're using
+GNU ld) and gnulib3.o. With gcc/g++ version 2.0, you don't need
+libg++.a at all.
+
+If you're using gcc/g++ version 2.0, you'll need the following patch:
+
+*** cp-parse.y.~1~ Sat Feb 22 08:35:51 1992
+--- cp-parse.y Sun Mar 1 15:20:10 1992
+***************
+*** 1075,1081 ****
+ }
+ $$ = build_delete (type, expr, integer_three_node,
+ LOOKUP_NORMAL|LOOKUP_HAS_IN_CHARGE,
+! TYPE_HAS_DESTRUCTOR (TREE_TYPE (type)) ? $$ : 0, 1);
+ }
+ | delete '[' ']' cast_expr %prec UNARY
+ {
+--- 1075,1081 ----
+ }
+ $$ = build_delete (type, expr, integer_three_node,
+ LOOKUP_NORMAL|LOOKUP_HAS_IN_CHARGE,
+! TYPE_HAS_DESTRUCTOR (TREE_TYPE (type)) ? $$ : 0, 0);
+ }
+ | delete '[' ']' cast_expr %prec UNARY
+ {
+
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:
@@ -144,7 +167,7 @@ magnifications. The CompileFonts script in the dvi/devdvi directory
may help you to do this. (It will take a *long* time.)
If you have problems printing existing troff documents, read the
-section on `Incompatbilities' in gtroff(1). If you have existing
+section on `Incompatibilities' in gtroff(1). If you have existing
macro packages that are in the habit of omitting the space between a
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
diff --git a/Makefile b/Makefile
index d52059b17..824070f94 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
#Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc.
-# Written by James Clark (jjc@jclark.uucp)
+# Written by James Clark (jjc@jclark.com)
#
#This file is part of groff.
#
@@ -156,6 +156,10 @@ D9=-DWAIT_COREDUMP_0200
# when using wait(). Use this with the libg++ header files.
D10=-DNO_SYS_WAIT_H
+# Uncomment the next line if you C++ compiler requires delete [n] rather
+# than delete []. This is needed for g++ 1.x and cfront 2.0.
+D11=#-DARRAY_DELETE_NEEDS_SIZE
+
# 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.
@@ -207,14 +211,21 @@ GROG=grog.sh
# CC is the C++ compiler
CC=g++
+# This is the flag that tells the C++ compiler to treat a .c file as C++.
+C++LANG_FLAG=
# I'm told that -fno-inline is needed on a 68030-based Apollo
# CC=g++ -fno-inline
+# Use this with gcc/g++ version 2.
+# CC=gcc
+# C++LANG_FLAG=-xc++
+
# OLDCC is the C compiler.
OLDCC=gcc
PROFILE_FLAG=
-DEBUG_FLAG=
+DEBUG_FLAG=-g
+# With gcc/g++ 2.0 on a sparc, -O works better than -O2.
OPTIMIZE_FLAG=-O
WARNING_FLAGS=#-Wall -Wcast-qual -Wwrite-strings
@@ -222,8 +233,9 @@ WARNING_FLAGS=#-Wall -Wcast-qual -Wwrite-strings
XCFLAGS=
# CFLAGS are passed to sub makes
-CFLAGS=$(PROFILE_FLAG) $(DEBUG_FLAG) $(OPTIMIZE_FLAG) $(WARNING_FLAGS) \
-$(D1) $(D2) $(D3) $(D4) $(D5) $(D6) $(D7) $(D8) $(D9) $(D10) $(XCFLAGS)
+CFLAGS=$(C++LANG_FLAG) $(PROFILE_FLAG) $(DEBUG_FLAG) $(OPTIMIZE_FLAG) \
+$(WARNING_FLAGS) $(XCFLAGS) \
+$(D1) $(D2) $(D3) $(D4) $(D5) $(D6) $(D7) $(D8) $(D9) $(D10) $(D11)
XOLDCFLAGS=
# OLDCFLAGS are passed to sub makes
@@ -291,6 +303,16 @@ $(SUBDIRS): FORCE
troff pic tbl eqn refer etc ps tty dvi: lib
ps tty dvi: driver
+lib: c++tested
+
+c++tested: Makefile
+ @echo Testing your C++ compiler
+ $(CC) -c $(INCLUDES) $(CFLAGS) c++test.c
+ $(CC) $(LDFLAGS) -o c++test c++test.o $(LIBS)
+ ./c++test >c++test.out
+ cmp -s c++test.out c++test.ref
+ touch $@
+
TAGS: FORCE
@for dir in $(SUBDIRS); do \
echo Making TAGS in $$dir; \
@@ -300,6 +322,7 @@ TAGS: FORCE
topclean: FORCE
-rm -f shgroff
-rm -f groff *.o core device.h
+ -rm -f c++test c++test.o c++test.out c++tested
clean: topclean FORCE
@for dir in $(SUBDIRS) doc; do \
diff --git a/PROJECTS b/PROJECTS
index d4d024866..ac18de527 100644
--- a/PROJECTS
+++ b/PROJECTS
@@ -14,5 +14,4 @@ Here are some things that would be useful additions to groff:
If you want to work on one of these, I suggest you contact me first.
James Clark
-jjc@jclark.uucp
-jjc@ai.mit.edu
+jjc@jclark.com
diff --git a/README b/README
index fe73ce3e9..6c79487a1 100644
--- a/README
+++ b/README
@@ -8,10 +8,11 @@ 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++ version 1.40.3. (Do not use version
-1.39.) You will also require C++ header files that are fairly
-compliant with ANSI C.
+You will require a C++ compiler implementing at least version 2.0 of
+the C++ language. I suggest GNU C++ version 1.40.3. (Do not use
+version 1.39.) You may also be able use GNU C/C++ version 2.0, but
+you should apply the patch given in the file INSTALL. You will also
+require C++ header files that are fairly compliant with ANSI C.
See the file INSTALL for installation instructions.
diff --git a/VERSION b/VERSION
index 11a84add6..993f09564 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.04
+1.05
diff --git a/c++test.c b/c++test.c
new file mode 100644
index 000000000..7b4a0c99b
--- /dev/null
+++ b/c++test.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+
+struct A {
+ A() { fputs("A\n", stdout); }
+ ~A() { fputs("~A\n", stdout); }
+};
+
+A a;
+
+main()
+{
+ return 0;
+}
diff --git a/c++test.ref b/c++test.ref
new file mode 100644
index 000000000..f7cd656fa
--- /dev/null
+++ b/c++test.ref
@@ -0,0 +1,2 @@
+A
+~A
diff --git a/driver/driver.h b/driver/driver.h
index c375ca9a5..5fdc2727b 100644
--- a/driver/driver.h
+++ b/driver/driver.h
@@ -22,6 +22,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
+#include <stddef.h>
#include <osfcn.h>
#include <assert.h>
#include <math.h>
diff --git a/driver/input.c b/driver/input.c
index 84d0e4c15..cde2c34a2 100644
--- a/driver/input.c
+++ b/driver/input.c
@@ -42,6 +42,11 @@ environment_list::environment_list(const environment &e, environment_list *p)
{
}
+inline int get_char()
+{
+ return getc(current_file);
+}
+
void do_file(const char *filename)
{
int npages = 0;
@@ -187,7 +192,9 @@ void do_file(const char *filename)
break;
case 'w':
case ' ':
+ break;
case '\n':
+ current_lineno++;
break;
case 'p':
if (npages)
@@ -218,11 +225,17 @@ void do_file(const char *filename)
int c = get_char();
while (c == ' ')
c = get_char();
- while (c != EOF && c != ' ' && c != '\n') {
+ while (c != EOF) {
+ if (c == '\n') {
+ current_lineno++;
+ break;
+ }
int w;
pr->set_ascii_char(c, &env, &w);
env.hpos += w + kern;
c = get_char();
+ if (c == ' ')
+ break;
}
}
break;
@@ -231,7 +244,11 @@ void do_file(const char *filename)
if (npages == 0)
fatal("`t' command illegal before first `p' command");
int c;
- while ((c = get_char()) != EOF && c != ' ' && c != '\n') {
+ while ((c = get_char()) != EOF && c != ' ') {
+ if (c == '\n') {
+ current_lineno++;
+ break;
+ }
int w;
pr->set_ascii_char(c, &env, &w);
env.hpos += w;
@@ -261,7 +278,7 @@ void do_file(const char *filename)
p = new int[szp*2];
memcpy(p, oldp, szp*sizeof(int));
szp *= 2;
- delete oldp;
+ a_delete oldp;
}
}
p[np] = n;
@@ -280,7 +297,7 @@ void do_file(const char *filename)
if (i*2 < np)
env.hpos += p[i*2];
}
- delete p;
+ a_delete p;
skip_line();
}
break;
@@ -342,23 +359,15 @@ void do_file(const char *filename)
pr->end_page();
}
-int get_char()
-{
- int c = getc(current_file);
- if (c == '\n')
- current_lineno++;
- return c;
-}
-
int get_integer()
{
- int c = getc(current_file);
+ int c = get_char();
while (c == ' ')
- c = getc(current_file);
+ c = get_char();
int neg = 0;
if (c == '-') {
neg = 1;
- c = getc(current_file);
+ c = get_char();
}
if (!isascii(c) || !isdigit(c))
fatal("integer expected");
@@ -369,7 +378,7 @@ int get_integer()
total -= c - '0';
else
total += c - '0';
- c = getc(current_file);
+ c = get_char();
} while (isascii(c) && isdigit(c));
if (c != EOF)
ungetc(c, current_file);
@@ -378,13 +387,13 @@ int get_integer()
int possibly_get_integer(int *res)
{
- int c = getc(current_file);
+ int c = get_char();
while (c == ' ')
- c = getc(current_file);
+ c = get_char();
int neg = 0;
if (c == '-') {
neg = 1;
- c = getc(current_file);
+ c = get_char();
}
if (!isascii(c) || !isdigit(c)) {
if (c != EOF)
@@ -398,7 +407,7 @@ int possibly_get_integer(int *res)
total -= c - '0';
else
total += c - '0';
- c = getc(current_file);
+ c = get_char();
} while (isascii(c) && isdigit(c));
if (c != EOF)
ungetc(c, current_file);
@@ -411,9 +420,9 @@ char *get_string(int is_long)
{
static char *buf;
static int buf_size;
- int c = getc(current_file);
+ int c = get_char();
while (c == ' ')
- c = getc(current_file);
+ c = get_char();
for (int i = 0;; i++) {
if (i >= buf_size) {
if (buf_size == 0) {
@@ -426,7 +435,7 @@ char *get_string(int is_long)
buf_size *= 2;
buf = new char[buf_size];
memcpy(buf, old_buf, old_size);
- delete old_buf;
+ a_delete old_buf;
}
}
if ((!is_long && (c == ' ' || c == '\n')) || c == EOF) {
@@ -435,7 +444,7 @@ char *get_string(int is_long)
}
if (is_long && c == '\n') {
current_lineno++;
- c = getc(current_file);
+ c = get_char();
if (c == '+')
c = '\n';
else {
@@ -444,7 +453,7 @@ char *get_string(int is_long)
}
}
buf[i] = c;
- c = getc(current_file);
+ c = get_char();
}
if (c != EOF)
ungetc(c, current_file);
@@ -454,7 +463,10 @@ char *get_string(int is_long)
void skip_line()
{
int c;
- while ((c = get_char()) != EOF && c != '\n')
- ;
+ while ((c = get_char()) != EOF)
+ if (c == '\n') {
+ current_lineno++;
+ break;
+ }
}
diff --git a/driver/printer.c b/driver/printer.c
index e9c5159da..f498b8cb5 100644
--- a/driver/printer.c
+++ b/driver/printer.c
@@ -34,7 +34,7 @@ printer::printer()
printer::~printer()
{
- delete font_table;
+ a_delete font_table;
while (font_list) {
font_pointer_list *tem = font_list;
font_list = font_list->next;
diff --git a/dvi/dvi.c b/dvi/dvi.c
index e106fe682..ae7707247 100644
--- a/dvi/dvi.c
+++ b/dvi/dvi.c
@@ -643,7 +643,8 @@ void draw_dvi_printer::draw(int code, int *p, int np, const environment *env)
fill_next();
else
set_line_thickness(env);
- int rad = milliinches(p[0]/2);
+ int rad;
+ rad = milliinches(p[0]/2);
sprintf(buf, "%s 0 0 %d %d 0 6.28319",
(fill_flag ? "ia" : "ar"),
rad,
diff --git a/dvi/tfmtodit.c b/dvi/tfmtodit.c
index a563ba425..571ace1e7 100644
--- a/dvi/tfmtodit.c
+++ b/dvi/tfmtodit.c
@@ -241,14 +241,14 @@ int tfm::get_design_size()
tfm::~tfm()
{
- delete char_info;
- delete width;
- delete height;
- delete depth;
- delete italic;
- delete lig_kern;
- delete kern;
- delete param;
+ a_delete char_info;
+ a_delete width;
+ a_delete height;
+ a_delete depth;
+ a_delete italic;
+ a_delete lig_kern;
+ a_delete kern;
+ a_delete param;
}
int read2(unsigned char *&s)
@@ -293,14 +293,14 @@ int tfm::load(const char *file)
error("unexpected end of file on `%1'", file);
else
error("error on file `%1'", file);
- delete buf;
+ a_delete buf;
fclose(fp);
return 0;
}
fclose(fp);
if (lf < 6) {
error("bad tfm file `%1': impossibly short", file);
- delete buf;
+ a_delete buf;
return 0;
}
unsigned char *ptr = buf;
@@ -317,12 +317,12 @@ int tfm::load(const char *file)
np = read2(ptr);
if (6 + lh + (ec - bc + 1) + nw + nh + nd + ni + nl + nk + ne + np != lf) {
error("bad tfm file `%1': lengths do not sum", file);
- delete buf;
+ a_delete buf;
return 0;
}
if (lh < 2) {
error("bad tfm file `%1': header too short", file);
- delete buf;
+ a_delete buf;
return 0;
}
char_info = new char_info_word[ec - bc + 1];
@@ -367,7 +367,7 @@ int tfm::load(const char *file)
for (i = 0; i < np; i++)
param[i] = read4(ptr);
assert(ptr == buf + lf*4 - 2);
- delete buf;
+ a_delete buf;
return 1;
}
diff --git a/eqn/Makefile b/eqn/Makefile
index 09380867e..800c4306c 100644
--- a/eqn/Makefile
+++ b/eqn/Makefile
@@ -46,7 +46,7 @@ eqn.tab.c: eqn.y
mv y.tab.c eqn.tab.c
mv y.tab.h eqn.tab.h
-eqn.tab.o: eqn.h box.h
+eqn.tab.o: 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 ../lib/ptable.h
diff --git a/eqn/box.c b/eqn/box.c
index 634dd0705..f66dc07e4 100644
--- a/eqn/box.c
+++ b/eqn/box.c
@@ -150,7 +150,7 @@ void set_space(int n)
void set_gsize(const char *s)
{
- delete gsize;
+ a_delete gsize;
gsize = strsave(s);
}
@@ -176,19 +176,19 @@ const char *get_gbfont()
void set_gfont(const char *s)
{
- delete gfont;
+ a_delete gfont;
gfont = strsave(s);
}
void set_grfont(const char *s)
{
- delete grfont;
+ a_delete grfont;
grfont = strsave(s);
}
void set_gbfont(const char *s)
{
- delete gbfont;
+ a_delete gbfont;
gbfont = strsave(s);
}
@@ -402,7 +402,7 @@ void box_list::append(box *pp)
maxlen *= 2;
p = new box*[maxlen];
memcpy(p, oldp, sizeof(box*)*len);
- delete oldp;
+ a_delete oldp;
}
p[len++] = pp;
}
@@ -411,7 +411,7 @@ box_list::~box_list()
{
for (int i = 0; i < len; i++)
delete p[i];
- delete p;
+ a_delete p;
}
void box_list::list_check_tabs(int level)
@@ -496,7 +496,7 @@ quoted_text_box::quoted_text_box(char *s) : text(s)
quoted_text_box::~quoted_text_box()
{
- delete text;
+ a_delete text;
}
void quoted_text_box::output()
diff --git a/eqn/delim.c b/eqn/delim.c
index 4e638914e..7bf2d2a7f 100644
--- a/eqn/delim.c
+++ b/eqn/delim.c
@@ -138,11 +138,11 @@ public:
box *make_delim_box(char *l, box *pp, char *r)
{
if (l != 0 && *l == '\0') {
- delete l;
+ a_delete l;
l = 0;
}
if (r != 0 && *r == '\0') {
- delete r;
+ a_delete r;
r = 0;
}
return new delim_box(l, pp, r);
@@ -155,8 +155,8 @@ delim_box::delim_box(char *l, box *pp, char *r)
delim_box::~delim_box()
{
- delete left;
- delete right;
+ a_delete left;
+ a_delete right;
delete p;
}
diff --git a/eqn/eqn.tab.c b/eqn/eqn.tab.c
index eeb58029a..2bd58e2ac 100644
--- a/eqn/eqn.tab.c
+++ b/eqn/eqn.tab.c
@@ -66,6 +66,7 @@
#include <string.h>
#include <stdlib.h>
+#include "lib.h"
#include "box.h"
extern int non_empty_flag;
char *strsave(const char *);
@@ -73,7 +74,7 @@ char *strsave(const char *);
int yylex();
void yyerror(const char *);
-#line 32 "eqn.y"
+#line 33 "eqn.y"
typedef union {
char *str;
box *b;
@@ -148,26 +149,66 @@ static const char yytranslate[] = { 0,
56, 57, 58, 59, 60
};
+static const short yyprhs[] = { 0,
+ 0, 1, 3, 5, 8, 10, 13, 16, 18, 22,
+ 26, 32, 38, 40, 43, 47, 51, 53, 57, 59,
+ 63, 69, 71, 73, 76, 79, 81, 83, 85, 89,
+ 92, 95, 98, 101, 106, 112, 116, 119, 122, 125,
+ 129, 133, 136, 139, 142, 145, 149, 153, 157, 161,
+ 165, 169, 173, 176, 180, 182, 184, 188, 192, 197,
+ 199, 202, 204, 208, 212, 217, 220, 223, 226, 229,
+ 231, 233, 235, 237
+};
+
+static const short yyrhs[] = { -1,
+ 67, 0, 68, 0, 67, 68, 0, 69, 0, 37,
+ 68, 0, 38, 68, 0, 70, 0, 70, 14, 69,
+ 0, 70, 15, 70, 0, 70, 15, 70, 14, 69,
+ 0, 70, 15, 70, 15, 69, 0, 71, 0, 5,
+ 70, 0, 70, 3, 70, 0, 70, 4, 70, 0,
+ 72, 0, 73, 7, 71, 0, 73, 0, 73, 6,
+ 72, 0, 73, 6, 73, 7, 71, 0, 26, 0,
+ 27, 0, 42, 27, 0, 43, 26, 0, 61, 0,
+ 62, 0, 63, 0, 64, 67, 65, 0, 11, 76,
+ 0, 8, 76, 0, 9, 76, 0, 10, 76, 0,
+ 32, 64, 77, 65, 0, 12, 82, 67, 13, 82,
+ 0, 12, 82, 67, 0, 73, 23, 0, 73, 24,
+ 0, 73, 41, 0, 73, 22, 73, 0, 73, 44,
+ 73, 0, 18, 73, 0, 19, 73, 0, 20, 73,
+ 0, 21, 73, 0, 17, 81, 73, 0, 16, 81,
+ 73, 0, 28, 74, 73, 0, 29, 74, 73, 0,
+ 31, 74, 73, 0, 30, 74, 73, 0, 39, 81,
+ 73, 0, 40, 73, 0, 45, 81, 73, 0, 81,
+ 0, 67, 0, 75, 25, 67, 0, 64, 75, 65,
+ 0, 74, 64, 75, 65, 0, 80, 0, 77, 80,
+ 0, 67, 0, 78, 25, 67, 0, 64, 78, 65,
+ 0, 74, 64, 78, 65, 0, 33, 79, 0, 34,
+ 79, 0, 35, 79, 0, 36, 79, 0, 26, 0,
+ 27, 0, 81, 0, 64, 0, 65, 0
+};
+
#if YYDEBUG != 0
static const short yyrline[] = { 0,
- 123, 125, 129, 132, 142, 145, 147, 151, 154, 156,
- 158, 160, 164, 167, 169, 171, 175, 178, 182, 185,
- 187, 191, 194, 196, 198, 200, 202, 204, 206, 208,
- 210, 212, 214, 216, 218, 220, 222, 224, 226, 228,
- 230, 232, 234, 236, 238, 240, 242, 244, 246, 248,
- 250, 252, 254, 256, 260, 270, 273, 277, 280, 284,
- 287, 291, 294, 298, 301, 305, 308, 310, 312, 316,
- 318, 322, 325, 327
+ 124, 126, 130, 133, 143, 146, 148, 152, 155, 157,
+ 159, 161, 165, 168, 170, 172, 176, 179, 183, 186,
+ 188, 192, 195, 197, 199, 201, 203, 205, 207, 209,
+ 211, 213, 215, 217, 219, 221, 223, 225, 227, 229,
+ 231, 233, 235, 237, 239, 241, 243, 245, 247, 249,
+ 251, 253, 255, 257, 261, 271, 274, 278, 281, 285,
+ 288, 292, 295, 299, 302, 306, 309, 311, 313, 317,
+ 319, 323, 326, 328
};
-static const char * const yytname[] = { 0,
+static const char * const yytname[] = { "$",
"error","$illegal.","OVER","SMALLOVER","SQRT","SUB","SUP","LPILE","RPILE","CPILE",
"PILE","LEFT","RIGHT","TO","FROM","SIZE","FONT","ROMAN","BOLD","ITALIC",
"FAT","ACCENT","BAR","UNDER","ABOVE","TEXT","QUOTED_TEXT","FWD","BACK","DOWN",
"UP","MATRIX","COL","LCOL","RCOL","CCOL","MARK","LINEUP","TYPE","VCENTER",
"PRIME","SPLIT","NOSPLIT","UACCENT","SPECIAL","SPACE","GFONT","GSIZE","DEFINE","NDEFINE",
"TDEFINE","SDEFINE","UNDEF","IFDEF","INCLUDE","DELIM","CHARTYPE","SET","GRFONT","GBFONT",
-"'^'","'~'","'\\t'","'{'","'}'","top"
+"'^'","'~'","'\\t'","'{'","'}'","top","equation","mark","from_to","sqrt_over",
+"script","nonsup","simple","number","pile_element_list","pile_arg","column_list","column_element_list","column_arg","column",
+"text","delim",""
};
#endif
@@ -324,8 +365,6 @@ static const short yycheck[] = { 0,
-1, -1, -1, -1, -1, -1, 61, 62, 63, 64,
-1, -1, -1, 41, -1, -1, 44
};
-#define YYPURE 1
-
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/local/lib/bison.simple"
@@ -347,15 +386,19 @@ static const short yycheck[] = { 0,
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.
@@ -394,17 +437,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 */
@@ -416,7 +463,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 */
@@ -440,18 +487,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;
@@ -461,7 +506,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()
{
@@ -490,7 +552,7 @@ yyparse()
int yystacksize = YYINITDEPTH;
-#ifndef YYPURE
+#ifdef YYPURE
int yychar;
YYSTYPE yylval;
int yynerrs;
@@ -711,12 +773,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
@@ -724,15 +789,15 @@ yyreduce:
switch (yyn) {
case 2:
-#line 126 "eqn.y"
+#line 127 "eqn.y"
{ yyvsp[0].b->top_level(); non_empty_flag = 1; ;
break;}
case 3:
-#line 131 "eqn.y"
+#line 132 "eqn.y"
{ yyval.b = yyvsp[0].b; ;
break;}
case 4:
-#line 133 "eqn.y"
+#line 134 "eqn.y"
{
list_box *lb = yyvsp[-1].b->to_list_box();
if (!lb)
@@ -742,293 +807,293 @@ case 4:
;
break;}
case 5:
-#line 144 "eqn.y"
+#line 145 "eqn.y"
{ yyval.b = yyvsp[0].b; ;
break;}
case 6:
-#line 146 "eqn.y"
+#line 147 "eqn.y"
{ yyval.b = make_mark_box(yyvsp[0].b); ;
break;}
case 7:
-#line 148 "eqn.y"
+#line 149 "eqn.y"
{ yyval.b = make_lineup_box(yyvsp[0].b); ;
break;}
case 8:
-#line 153 "eqn.y"
+#line 154 "eqn.y"
{ yyval.b = yyvsp[0].b; ;
break;}
case 9:
-#line 155 "eqn.y"
+#line 156 "eqn.y"
{ yyval.b = make_limit_box(yyvsp[-2].b, 0, yyvsp[0].b); ;
break;}
case 10:
-#line 157 "eqn.y"
+#line 158 "eqn.y"
{ yyval.b = make_limit_box(yyvsp[-2].b, yyvsp[0].b, 0); ;
break;}
case 11:
-#line 159 "eqn.y"
+#line 160 "eqn.y"
{ yyval.b = make_limit_box(yyvsp[-4].b, yyvsp[-2].b, yyvsp[0].b); ;
break;}
case 12:
-#line 161 "eqn.y"
+#line 162 "eqn.y"
{ yyval.b = make_limit_box(yyvsp[-4].b, make_limit_box(yyvsp[-2].b, yyvsp[0].b, 0), 0); ;
break;}
case 13:
-#line 166 "eqn.y"
+#line 167 "eqn.y"
{ yyval.b = yyvsp[0].b; ;
break;}
case 14:
-#line 168 "eqn.y"
+#line 169 "eqn.y"
{ yyval.b = make_sqrt_box(yyvsp[0].b); ;
break;}
case 15:
-#line 170 "eqn.y"
+#line 171 "eqn.y"
{ yyval.b = make_over_box(yyvsp[-2].b, yyvsp[0].b); ;
break;}
case 16:
-#line 172 "eqn.y"
+#line 173 "eqn.y"
{ yyval.b = make_small_over_box(yyvsp[-2].b, yyvsp[0].b); ;
break;}
case 17:
-#line 177 "eqn.y"
+#line 178 "eqn.y"
{ yyval.b = yyvsp[0].b; ;
break;}
case 18:
-#line 179 "eqn.y"
+#line 180 "eqn.y"
{ yyval.b = make_script_box(yyvsp[-2].b, 0, yyvsp[0].b); ;
break;}
case 19:
-#line 184 "eqn.y"
+#line 185 "eqn.y"
{ yyval.b = yyvsp[0].b; ;
break;}
case 20:
-#line 186 "eqn.y"
+#line 187 "eqn.y"
{ yyval.b = make_script_box(yyvsp[-2].b, yyvsp[0].b, 0); ;
break;}
case 21:
-#line 188 "eqn.y"
+#line 189 "eqn.y"
{ yyval.b = make_script_box(yyvsp[-4].b, yyvsp[-2].b, yyvsp[0].b); ;
break;}
case 22:
-#line 193 "eqn.y"
+#line 194 "eqn.y"
{ yyval.b = split_text(yyvsp[0].str); ;
break;}
case 23:
-#line 195 "eqn.y"
+#line 196 "eqn.y"
{ yyval.b = new quoted_text_box(yyvsp[0].str); ;
break;}
case 24:
-#line 197 "eqn.y"
+#line 198 "eqn.y"
{ yyval.b = split_text(yyvsp[0].str); ;
break;}
case 25:
-#line 199 "eqn.y"
+#line 200 "eqn.y"
{ yyval.b = new quoted_text_box(yyvsp[0].str); ;
break;}
case 26:
-#line 201 "eqn.y"
+#line 202 "eqn.y"
{ yyval.b = new half_space_box; ;
break;}
case 27:
-#line 203 "eqn.y"
+#line 204 "eqn.y"
{ yyval.b = new space_box; ;
break;}
case 28:
-#line 205 "eqn.y"
+#line 206 "eqn.y"
{ yyval.b = new tab_box; ;
break;}
case 29:
-#line 207 "eqn.y"
+#line 208 "eqn.y"
{ yyval.b = yyvsp[-1].b; ;
break;}
case 30:
-#line 209 "eqn.y"
+#line 210 "eqn.y"
{ yyvsp[0].pb->set_alignment(CENTER_ALIGN); yyval.b = yyvsp[0].pb; ;
break;}
case 31:
-#line 211 "eqn.y"
+#line 212 "eqn.y"
{ yyvsp[0].pb->set_alignment(LEFT_ALIGN); yyval.b = yyvsp[0].pb; ;
break;}
case 32:
-#line 213 "eqn.y"
+#line 214 "eqn.y"
{ yyvsp[0].pb->set_alignment(RIGHT_ALIGN); yyval.b = yyvsp[0].pb; ;
break;}
case 33:
-#line 215 "eqn.y"
+#line 216 "eqn.y"
{ yyvsp[0].pb->set_alignment(CENTER_ALIGN); yyval.b = yyvsp[0].pb; ;
break;}
case 34:
-#line 217 "eqn.y"
+#line 218 "eqn.y"
{ yyval.b = yyvsp[-1].mb; ;
break;}
case 35:
-#line 219 "eqn.y"
+#line 220 "eqn.y"
{ yyval.b = make_delim_box(yyvsp[-3].str, yyvsp[-2].b, yyvsp[0].str); ;
break;}
case 36:
-#line 221 "eqn.y"
+#line 222 "eqn.y"
{ yyval.b = make_delim_box(yyvsp[-1].str, yyvsp[0].b, 0); ;
break;}
case 37:
-#line 223 "eqn.y"
+#line 224 "eqn.y"
{ yyval.b = make_overline_box(yyvsp[-1].b); ;
break;}
case 38:
-#line 225 "eqn.y"
+#line 226 "eqn.y"
{ yyval.b = make_underline_box(yyvsp[-1].b); ;
break;}
case 39:
-#line 227 "eqn.y"
+#line 228 "eqn.y"
{ yyval.b = make_prime_box(yyvsp[-1].b); ;
break;}
case 40:
-#line 229 "eqn.y"
+#line 230 "eqn.y"
{ yyval.b = make_accent_box(yyvsp[-2].b, yyvsp[0].b); ;
break;}
case 41:
-#line 231 "eqn.y"
+#line 232 "eqn.y"
{ yyval.b = make_uaccent_box(yyvsp[-2].b, yyvsp[0].b); ;
break;}
case 42:
-#line 233 "eqn.y"
+#line 234 "eqn.y"
{ yyval.b = new font_box(strsave(get_grfont()), yyvsp[0].b); ;
break;}
case 43:
-#line 235 "eqn.y"
+#line 236 "eqn.y"
{ yyval.b = new font_box(strsave(get_gbfont()), yyvsp[0].b); ;
break;}
case 44:
-#line 237 "eqn.y"
+#line 238 "eqn.y"
{ yyval.b = new font_box(strsave(get_gfont()), yyvsp[0].b); ;
break;}
case 45:
-#line 239 "eqn.y"
+#line 240 "eqn.y"
{ yyval.b = new fat_box(yyvsp[0].b); ;
break;}
case 46:
-#line 241 "eqn.y"
+#line 242 "eqn.y"
{ yyval.b = new font_box(yyvsp[-1].str, yyvsp[0].b); ;
break;}
case 47:
-#line 243 "eqn.y"
+#line 244 "eqn.y"
{ yyval.b = new size_box(yyvsp[-1].str, yyvsp[0].b); ;
break;}
case 48:
-#line 245 "eqn.y"
+#line 246 "eqn.y"
{ yyval.b = new hmotion_box(yyvsp[-1].n, yyvsp[0].b); ;
break;}
case 49:
-#line 247 "eqn.y"
+#line 248 "eqn.y"
{ yyval.b = new hmotion_box(-yyvsp[-1].n, yyvsp[0].b); ;
break;}
case 50:
-#line 249 "eqn.y"
+#line 250 "eqn.y"
{ yyval.b = new vmotion_box(yyvsp[-1].n, yyvsp[0].b); ;
break;}
case 51:
-#line 251 "eqn.y"
+#line 252 "eqn.y"
{ yyval.b = new vmotion_box(-yyvsp[-1].n, yyvsp[0].b); ;
break;}
case 52:
-#line 253 "eqn.y"
+#line 254 "eqn.y"
{ yyvsp[0].b->set_spacing_type(yyvsp[-1].str); yyval.b = yyvsp[0].b; ;
break;}
case 53:
-#line 255 "eqn.y"
+#line 256 "eqn.y"
{ yyval.b = new vcenter_box(yyvsp[0].b); ;
break;}
case 54:
-#line 257 "eqn.y"
+#line 258 "eqn.y"
{ yyval.b = make_special_box(yyvsp[-1].str, yyvsp[0].b); ;
break;}
case 55:
-#line 262 "eqn.y"
+#line 263 "eqn.y"
{
int n;
if (sscanf(yyvsp[0].str, "%d", &n) == 1)
yyval.n = n;
- delete yyvsp[0].str;
+ a_delete yyvsp[0].str;
;
break;}
case 56:
-#line 272 "eqn.y"
+#line 273 "eqn.y"
{ yyval.pb = new pile_box(yyvsp[0].b); ;
break;}
case 57:
-#line 274 "eqn.y"
+#line 275 "eqn.y"
{ yyvsp[-2].pb->append(yyvsp[0].b); yyval.pb = yyvsp[-2].pb; ;
break;}
case 58:
-#line 279 "eqn.y"
+#line 280 "eqn.y"
{ yyval.pb = yyvsp[-1].pb; ;
break;}
case 59:
-#line 281 "eqn.y"
+#line 282 "eqn.y"
{ yyvsp[-1].pb->set_space(yyvsp[-3].n); yyval.pb = yyvsp[-1].pb; ;
break;}
case 60:
-#line 286 "eqn.y"
+#line 287 "eqn.y"
{ yyval.mb = new matrix_box(yyvsp[0].col); ;
break;}
case 61:
-#line 288 "eqn.y"
+#line 289 "eqn.y"
{ yyvsp[-1].mb->append(yyvsp[0].col); yyval.mb = yyvsp[-1].mb; ;
break;}
case 62:
-#line 293 "eqn.y"
+#line 294 "eqn.y"
{ yyval.col = new column(yyvsp[0].b); ;
break;}
case 63:
-#line 295 "eqn.y"
+#line 296 "eqn.y"
{ yyvsp[-2].col->append(yyvsp[0].b); yyval.col = yyvsp[-2].col; ;
break;}
case 64:
-#line 300 "eqn.y"
+#line 301 "eqn.y"
{ yyval.col = yyvsp[-1].col; ;
break;}
case 65:
-#line 302 "eqn.y"
+#line 303 "eqn.y"
{ yyvsp[-1].col->set_space(yyvsp[-3].n); yyval.col = yyvsp[-1].col; ;
break;}
case 66:
-#line 307 "eqn.y"
+#line 308 "eqn.y"
{ yyvsp[0].col->set_alignment(CENTER_ALIGN); yyval.col = yyvsp[0].col; ;
break;}
case 67:
-#line 309 "eqn.y"
+#line 310 "eqn.y"
{ yyvsp[0].col->set_alignment(LEFT_ALIGN); yyval.col = yyvsp[0].col; ;
break;}
case 68:
-#line 311 "eqn.y"
+#line 312 "eqn.y"
{ yyvsp[0].col->set_alignment(RIGHT_ALIGN); yyval.col = yyvsp[0].col; ;
break;}
case 69:
-#line 313 "eqn.y"
+#line 314 "eqn.y"
{ yyvsp[0].col->set_alignment(CENTER_ALIGN); yyval.col = yyvsp[0].col; ;
break;}
case 70:
-#line 317 "eqn.y"
+#line 318 "eqn.y"
{ yyval.str = yyvsp[0].str; ;
break;}
case 71:
-#line 319 "eqn.y"
+#line 320 "eqn.y"
{ yyval.str = yyvsp[0].str; ;
break;}
case 72:
-#line 324 "eqn.y"
+#line 325 "eqn.y"
{ yyval.str = yyvsp[0].str; ;
break;}
case 73:
-#line 326 "eqn.y"
+#line 327 "eqn.y"
{ yyval.str = strsave("{"); ;
break;}
case 74:
-#line 328 "eqn.y"
+#line 329 "eqn.y"
{ yyval.str = strsave("}"); ;
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;
@@ -1215,5 +1280,5 @@ yyerrhandle:
yystate = yyn;
goto yynewstate;
}
-#line 331 "eqn.y"
+#line 332 "eqn.y"
diff --git a/eqn/eqn.y b/eqn/eqn.y
index c6f8fc439..ff5aef60d 100644
--- a/eqn/eqn.y
+++ b/eqn/eqn.y
@@ -21,6 +21,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <string.h>
#include <stdlib.h>
+#include "lib.h"
#include "box.h"
extern int non_empty_flag;
char *strsave(const char *);
@@ -263,7 +264,7 @@ number:
int n;
if (sscanf($1, "%d", &n) == 1)
$$ = n;
- delete $1;
+ a_delete $1;
}
;
diff --git a/eqn/lex.c b/eqn/lex.c
index 1b165932a..790c15f9d 100644
--- a/eqn/lex.c
+++ b/eqn/lex.c
@@ -41,7 +41,7 @@ definition::definition() : is_macro(1), contents(0), is_simple(0)
definition::~definition()
{
if (is_macro)
- delete contents;
+ a_delete contents;
}
declare_ptable(definition)
@@ -355,7 +355,7 @@ file_input::file_input(FILE *f, const char *fn, input *p)
file_input::~file_input()
{
- delete filename;
+ a_delete filename;
fclose(fp);
}
@@ -419,7 +419,7 @@ macro_input::macro_input(const char *str, input *x) : input(x)
macro_input::~macro_input()
{
- delete s;
+ a_delete s;
}
int macro_input::get()
@@ -446,7 +446,7 @@ top_input::top_input(const char *str, const char *fn, int ln, input *x)
top_input::~top_input()
{
- delete filename;
+ a_delete filename;
}
int top_input::get()
@@ -488,8 +488,8 @@ argument_macro_input::argument_macro_input(const char *body, int ac,
argument_macro_input::~argument_macro_input()
{
for (int i = 0; i < argc; i++)
- delete argv[i];
- delete s;
+ a_delete argv[i];
+ a_delete s;
}
int argument_macro_input::get()
@@ -906,7 +906,7 @@ void do_definition(int is_simple)
macro_table.define(name, def);
}
else if (def->is_macro) {
- delete def->contents;
+ a_delete def->contents;
}
get_delimited_text();
token_buffer += '\0';
diff --git a/eqn/other.c b/eqn/other.c
index eba99e742..41f518033 100644
--- a/eqn/other.c
+++ b/eqn/other.c
@@ -412,7 +412,7 @@ void size_box::output()
size_box::~size_box()
{
- delete size;
+ a_delete size;
}
void size_box::debug_print()
@@ -429,7 +429,7 @@ font_box::font_box(char *s, box *pp) : pointer_box(pp), f(s)
font_box::~font_box()
{
- delete f;
+ a_delete f;
}
int font_box::compute_metrics(int style)
diff --git a/eqn/pile.c b/eqn/pile.c
index 89337ad1d..aae171f1a 100644
--- a/eqn/pile.c
+++ b/eqn/pile.c
@@ -224,7 +224,7 @@ matrix_box::~matrix_box()
{
for (int i = 0; i < len; i++)
delete p[i];
- delete p;
+ a_delete p;
}
void matrix_box::append(column *pp)
@@ -234,7 +234,7 @@ void matrix_box::append(column *pp)
maxlen *= 2;
p = new column*[maxlen];
memcpy(p, oldp, sizeof(column*)*len);
- delete oldp;
+ a_delete oldp;
}
p[len++] = pp;
}
diff --git a/eqn/special.c b/eqn/special.c
index 69ed1b74f..175fadc46 100644
--- a/eqn/special.c
+++ b/eqn/special.c
@@ -65,7 +65,7 @@ special_box::special_box(char *s, box *pp) :macro_name(s), pointer_box(pp)
special_box::~special_box()
{
- delete macro_name;
+ a_delete macro_name;
}
int special_box::compute_metrics(int style)
diff --git a/eqn/text.c b/eqn/text.c
index c5fbd2d90..100148cc3 100644
--- a/eqn/text.c
+++ b/eqn/text.c
@@ -161,7 +161,7 @@ void box::set_spacing_type(char *type)
error("unrecognised type `%1'", type);
else
spacing_type = t;
- delete type;
+ a_delete type;
}
char_box::char_box(unsigned char cc)
@@ -232,7 +232,7 @@ special_char_box::special_char_box(const char *t)
special_char_box::~special_char_box()
{
- delete s;
+ a_delete s;
}
void special_char_box::output()
@@ -276,7 +276,7 @@ void set_char_type(const char *type, char *ch)
int ft = lookup_font_type(type);
if (st < 0 && ft < 0) {
error("bad character type `%1'", type);
- delete ch;
+ a_delete ch;
return;
}
box *b = split_text(ch);
@@ -418,14 +418,16 @@ box *split_text(char *text)
}
break;
case '[':
- char *ch = s;
- while (*s != ']' && *s != '\0')
- s++;
- if (*s == '\0')
- lex_error("bad escape");
- else {
- *s++ = '\0';
- b = new special_char_box(ch);
+ {
+ char *ch = s;
+ while (*s != ']' && *s != '\0')
+ s++;
+ if (*s == '\0')
+ lex_error("bad escape");
+ else {
+ *s++ = '\0';
+ b = new special_char_box(ch);
+ }
}
break;
case 'f':
diff --git a/etc/grog.pl b/etc/grog.pl
index 0a5d236bd..6eb171d60 100644
--- a/etc/grog.pl
+++ b/etc/grog.pl
@@ -76,6 +76,17 @@ sub process {
elsif (/^\.Dd/) {
$mdoc++;
}
+ elsif (/^\.(Tp|Dp|De|Cx|Cl)/) {
+ $mdoc_old = 1;
+ }
+ # In the old version of -mdoc `Oo' is a toggle, in the new it's
+ # closed by `Oc'.
+ elsif (/^\.Oo/) {
+ $Oo++;
+ }
+ elsif (/^\.Oc/) {
+ $Oo--;
+ }
if (/^\.so/) {
chop;
s/^.so *//;
@@ -110,7 +121,7 @@ elsif ($P > 0) {
push(@command, "-mm");
}
elsif ($mdoc > 0) {
- push(@command, "-mdoc");
+ push(@command, ($mdoc_old || $Oo > 0) ? "-mdoc.old" : "-mdoc");
}
push(@command, "--") if @ARGV && $ARGV[0] =~ /^-./;
diff --git a/etc/grog.sh b/etc/grog.sh
index 0d3b3bd88..ec9fd33d1 100644
--- a/etc/grog.sh
+++ b/etc/grog.sh
@@ -20,12 +20,12 @@ do
esac
done
-egrep -h '^\.(P|[LI]P|[pnil]p|Dd|TS|EQ|TH|SH|so|\[|R1)' $* \
+egrep -h '^\.(P|[LI]P|[pnil]p|Dd|Tp|Dp|De|Cx|Cl|Oo|Oc|TS|EQ|TH|SH|so|\[|R1)' $* \
| sed -e '/^\.so/s/^.*$/.SO_START\
&\
.SO_END/' \
| $soelim \
-| egrep '^\.(P|[LI]P|[pnil]p|Dd|TS|EQ|TH|SH|\[|R1|SO_START|SO_END)' \
+| egrep '^\.(P|[LI]P|[pnil]p|Dd|Tp|Dp|De|Cx|Cl|Oo|Oc|TS|EQ|TH|SH|\[|R1|SO_START|SO_END)' \
| awk '
/^\.SO_START$/ { so = 1 }
/^\.SO_END$/ { so = 0 }
@@ -39,6 +39,9 @@ egrep -h '^\.(P|[LI]P|[pnil]p|Dd|TS|EQ|TH|SH|so|\[|R1)' $* \
/^\.SH/ { SH++ }
/^\.[pnil]p/ { me++ }
/^\.Dd/ { mdoc++ }
+/^\.(Tp|Dp|De|Cx|Cl)/ { mdoc_old++ }
+/^\.Oo/ { Oo++ }
+/^\.Oc/ { Oo-- }
END {
if (files ~ /^-/)
@@ -60,8 +63,12 @@ END {
printf " -ms"
else if (P > 0)
printf " -mm"
- else if (mdoc > 0)
- printf " -mdoc"
+ else if (mdoc > 0) {
+ if (mdoc_old > 0 || Oo > 0)
+ printf " -mdoc.old"
+ else
+ printf " -mdoc"
+ }
if (opts != "")
printf "%s", opts
if (files != "")
diff --git a/lib/font.c b/lib/font.c
index b6ec8a7f4..c23432779 100644
--- a/lib/font.c
+++ b/lib/font.c
@@ -52,6 +52,15 @@ struct font_kern_list {
font_kern_list(int, int, int, font_kern_list * = 0);
};
+struct font_widths_cache {
+ font_widths_cache *next;
+ int point_size;
+ int *width;
+
+ font_widths_cache(int, int, font_widths_cache *);
+ ~font_widths_cache();
+};
+
/* text_file */
struct text_file {
@@ -77,8 +86,8 @@ text_file::text_file(FILE *p, char *s)
text_file::~text_file()
{
- delete buf;
- delete path;
+ a_delete buf;
+ a_delete path;
if (fp)
fclose(fp);
}
@@ -105,7 +114,7 @@ int text_file::next()
char *old_buf = buf;
buf = new char[size*2];
memcpy(buf, old_buf, size);
- delete old_buf;
+ a_delete old_buf;
size *= 2;
}
buf[i++] = c;
@@ -139,7 +148,7 @@ void text_file::error(const char *format,
font::font(const char *s)
: special(0), ligatures(0), kern_hash_table(0), space_width(0),
- ch(0), ch_used(0), ch_size(0), ch_index(0), nindices(0)
+ ch(0), ch_used(0), ch_size(0), ch_index(0), nindices(0), widths_cache(0)
{
name = new char[strlen(s) + 1];
strcpy(name, s);
@@ -150,8 +159,8 @@ font::font(const char *s)
font::~font()
{
- delete ch;
- delete ch_index;
+ a_delete ch;
+ a_delete ch_index;
if (kern_hash_table) {
for (int i = 0; i < KERN_HASH_TABLE_SIZE; i++) {
font_kern_list *kerns = kern_hash_table[i];
@@ -161,10 +170,15 @@ font::~font()
delete tem;
}
}
- delete kern_hash_table;
+ a_delete kern_hash_table;
+ }
+ a_delete name;
+ a_delete internalname;
+ while (widths_cache) {
+ font_widths_cache *tem = widths_cache;
+ widths_cache = widths_cache->next;
+ delete tem;
}
- delete name;
- delete internalname;
}
static int scale_round(int n, int x, int y)
@@ -176,12 +190,13 @@ static int scale_round(int n, int x, int y)
if (n >= 0) {
if (n <= (INT_MAX - y2)/x)
return (n*x + y2)/y;
+ return int(n*double(x)/double(y) + .5);
}
else {
if (-(unsigned)n <= (-(unsigned)INT_MIN - y2)/x)
return (n*x - y2)/y;
+ return int(n*double(x)/double(y) - .5);
}
- return int(n*double(x)/double(y) + .5);
}
inline int font::scale(int w, int sz)
@@ -205,10 +220,48 @@ int font::is_special()
return special;
}
+font_widths_cache::font_widths_cache(int ps, int ch_size,
+ font_widths_cache *p = 0)
+: next(p), point_size(ps)
+{
+ width = new int[ch_size];
+ for (int i = 0; i < ch_size; i++)
+ width[i] = -1;
+}
+
+font_widths_cache::~font_widths_cache()
+{
+ a_delete width;
+}
+
int font::get_width(int c, int point_size)
{
- assert(c >= 0 && c < nindices && ch_index[c] >= 0);
- return scale(ch[ch_index[c]].width, point_size);
+ assert(c >= 0 && c < nindices);
+ int i = ch_index[c];
+ assert(i >= 0);
+
+ if (point_size == unitwidth)
+ return ch[i].width;
+
+ if (!widths_cache)
+ widths_cache = new font_widths_cache(point_size, ch_size);
+ else if (widths_cache->point_size != point_size) {
+ for (font_widths_cache **p = &widths_cache; *p; p = &(*p)->next)
+ if ((*p)->point_size == point_size)
+ break;
+ if (*p) {
+ font_widths_cache *tem = *p;
+ *p = (*p)->next;
+ tem->next = widths_cache;
+ widths_cache = tem;
+ }
+ else
+ widths_cache = new font_widths_cache(point_size, ch_size, widths_cache);
+ }
+ int &w = widths_cache->width[i];
+ if (w < 0)
+ w = scale(ch[i].width, point_size);
+ return w;
}
int font::get_height(int c, int point_size)
@@ -325,7 +378,7 @@ void font::alloc_ch_index(int index)
memcpy(ch_index, old_ch_index, sizeof(short)*old_nindices);
for (int i = old_nindices; i < nindices; i++)
ch_index[i] = -1;
- delete old_ch_index;
+ a_delete old_ch_index;
}
}
@@ -339,7 +392,7 @@ void font::extend_ch()
font_char_metric *old_ch = ch;
ch = new font_char_metric[ch_size];
memcpy(ch, old_ch, old_ch_size*sizeof(font_char_metric));
- delete old_ch;
+ a_delete old_ch;
}
}
@@ -353,14 +406,14 @@ void font::compact()
short *old_ch_index = ch_index;
ch_index = new short[i];
memcpy(ch_index, old_ch_index, i*sizeof(short));
- delete old_ch_index;
+ a_delete old_ch_index;
nindices = i;
}
if (ch_used < ch_size) {
font_char_metric *old_ch = ch;
ch = new font_char_metric[ch_used];
memcpy(ch, old_ch, ch_used*sizeof(font_char_metric));
- delete old_ch;
+ a_delete old_ch;
ch_size = ch_used;
}
}
@@ -477,13 +530,13 @@ int font::load()
nargv *= 2;
argv = new char *[nargv];
memcpy(argv, old_argv, sizeof(char*)*old_nargv);
- delete old_argv;
+ a_delete old_argv;
}
argv[argc++] = p;
p = strtok(0, WS);
} while (p != 0);
handle_unknown_font_command(argc, argv);
- delete argv;
+ a_delete argv;
}
else
break;
@@ -757,7 +810,7 @@ int font::load_desc()
sizes = new int[n*2];
memcpy(sizes, old_sizes, n*sizeof(int));
n *= 2;
- delete old_sizes;
+ a_delete old_sizes;
}
sizes[i++] = lower;
if (lower == 0)
@@ -788,7 +841,7 @@ int font::load_desc()
style_table[j] = old_style_table[j];
for (; j < style_table_size; j++)
style_table[j] = 0;
- delete old_style_table;
+ a_delete old_style_table;
}
char *tem = new char[strlen(p) + 1];
strcpy(tem, p);
diff --git a/lib/font.h b/lib/font.h
index a8b7ffb5b..482b140cc 100644
--- a/lib/font.h
+++ b/lib/font.h
@@ -21,6 +21,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
struct font_kern_list;
struct font_char_metric;
+struct font_widths_cache;
class font {
public:
@@ -88,6 +89,7 @@ private:
char *name;
char *internalname;
double slant;
+ font_widths_cache *widths_cache;
static char *dev_name;
static char *cl_font_dirs;
diff --git a/lib/fontfile.c b/lib/fontfile.c
index 780368065..77c57c797 100644
--- a/lib/fontfile.c
+++ b/lib/fontfile.c
@@ -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 "font.h"
#include "lib.h"
#include "fontpath.h"
@@ -62,13 +63,13 @@ void font::command_line_font_dir(const char *dir)
if (need_colon)
strcat(cl_font_dirs, ":");
strcat(cl_font_dirs, dir);
- delete old_dirs;
+ a_delete old_dirs;
}
}
void font::forget_command_line_font_dirs()
{
- delete cl_font_dirs;
+ a_delete cl_font_dirs;
cl_font_dirs = 0;
}
@@ -107,7 +108,7 @@ FILE *font::open_file(const char *name, char **pathp)
*pathp = path;
return fp;
}
- delete path;
+ a_delete path;
if (*p == '\0')
break;
}
diff --git a/lib/lib.h b/lib/lib.h
index 14e0b6567..9e4350011 100644
--- a/lib/lib.h
+++ b/lib/lib.h
@@ -68,3 +68,16 @@ inline int illegal_input_char(int c)
(not including the -). */
#define INT_DIGITS 10
+
+/* ad_delete deletes an array of objects with destructors;
+a_delete deletes an array of objects without destructors */
+
+#ifdef ARRAY_DELETE_NEEDS_SIZE
+/* for 2.0 systems */
+#define ad_delete(size) delete [size]
+#define a_delete delete
+#else /* not ARRAY_DELETE_NEEDS_SIZE */
+/* for ARM systems */
+#define ad_delete(size) delete []
+#define a_delete delete []
+#endif /* not ARRAY_DELETE_NEEDS_SIZE */
diff --git a/lib/new.c b/lib/new.c
index 56fbe2a21..26ffe1974 100644
--- a/lib/new.c
+++ b/lib/new.c
@@ -29,7 +29,11 @@ static void ewrite(const char *s)
write(2, s, strlen(s));
}
+#ifdef __GNUG__
+void *__builtin_new(size_t size)
+#else
void *operator new(size_t size)
+#endif
{
char *p = (char *)malloc(unsigned(size));
if (p != 0)
diff --git a/lib/ptable.h b/lib/ptable.h
index 719fed74d..dd180da79 100644
--- a/lib/ptable.h
+++ b/lib/ptable.h
@@ -83,7 +83,7 @@ PTABLE(T)::PTABLE(T)() \
PTABLE(T)::~PTABLE(T)() \
{ \
for (unsigned i = 0; i < size; i++) { \
- delete v[i].key; \
+ a_delete v[i].key; \
delete v[i].val; \
} \
} \
@@ -110,7 +110,7 @@ void PTABLE(T)::define(const char *key, T *val) \
for (unsigned i = 0; i < old_size; i++) \
if (oldv[i].key != 0) { \
if (oldv[i].val == 0) \
- delete oldv[i].key; \
+ a_delete oldv[i].key; \
else { \
for (unsigned j = unsigned(hash_string(oldv[i].key) % size); \
v[j].key != 0; \
@@ -124,7 +124,7 @@ void PTABLE(T)::define(const char *key, T *val) \
v[n].key != 0; \
n = (n == 0 ? size - 1 : n - 1)) \
; \
- delete oldv; \
+ a_delete oldv; \
} \
char *temp = new char[strlen(key)+1]; \
strcpy(temp, key); \
diff --git a/lib/string.c b/lib/string.c
index d6a75684a..75325ee27 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -39,7 +39,7 @@ static char *salloc(int len, int *sizep)
static void sfree(char *ptr, int)
{
- delete ptr;
+ a_delete ptr;
}
static char *sfree_alloc(char *ptr, int oldsz, int len, int *sizep)
@@ -48,7 +48,7 @@ static char *sfree_alloc(char *ptr, int oldsz, int len, int *sizep)
*sizep = oldsz;
return ptr;
}
- delete ptr;
+ a_delete ptr;
if (len == 0) {
*sizep = 0;
return 0;
@@ -64,7 +64,7 @@ static char *srealloc(char *ptr, int oldsz, int oldlen, int newlen, int *sizep)
return ptr;
}
if (newlen == 0) {
- delete ptr;
+ a_delete ptr;
*sizep = 0;
return 0;
}
@@ -72,7 +72,7 @@ static char *srealloc(char *ptr, int oldsz, int oldlen, int newlen, int *sizep)
char *p = new char[*sizep = newlen*2];
if (oldlen < newlen && oldlen != 0)
memcpy(p, ptr, oldlen);
- delete ptr;
+ a_delete ptr;
return p;
}
}
diff --git a/lib/tmpfile.c b/lib/tmpfile.c
index c048b1832..b91893204 100644
--- a/lib/tmpfile.c
+++ b/lib/tmpfile.c
@@ -82,7 +82,7 @@ FILE *xtmpfile()
#endif /* not HAVE_MKSTEMP */
if (unlink(templ) < 0)
error("cannot unlink `%1': %2", templ, strerror(errno));
- delete templ;
+ a_delete templ;
return fp;
}
diff --git a/macros/Makefile b/macros/Makefile
index 58df33720..e9af24f06 100644
--- a/macros/Makefile
+++ b/macros/Makefile
@@ -18,37 +18,37 @@
#Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
MACRODIR=/usr/local/lib/groff/tmac
+MACROMODE=444
TMAC_S=gs
+STRIP=sed -e '/%beginstrip%/,$$s/[ ]*\\".*//' -e '/^\.$$/d'
-all: tmac.e.strip
-
-tmac.e.strip: tmac.e
- -rm -f $@
- sed -e '/%beginstrip%/,$$s/[ ]*\\".*//' -e '/^\.$$/d' tmac.e >$@
-
+all:
clean:
- -rm -f tmac.e.strip
-
distclean: clean
realclean: distclean
-
TAGS:
install.nobin: all
-[ -d $(MACRODIR) ] || mkdir $(MACRODIR)
- -rm -f $(MACRODIR)/tmac.an
- cp tmac.an $(MACRODIR)
- -rm -f $(MACRODIR)/tmac.e
- cp tmac.e.strip $(MACRODIR)/tmac.e
+ -for file in tmac.an tmac.andoc tmac.pic; do \
+ rm -f $(MACRODIR)/$$file; \
+ cp $$file $(MACRODIR)/$$file; \
+ chmod $(MACROMODE) $(MACRODIR)/$$file; \
+ done
+ -for file in tmac.e tmac.doc tmac.doc.old; do \
+ rm -f $(MACRODIR)/$$file; \
+ $(STRIP) $$file >$(MACRODIR)/$$file; \
+ chmod $(MACROMODE) $(MACRODIR)/$$file; \
+ done
-rm -f $(MACRODIR)/tmac.$(TMAC_S)
cp tmac.s $(MACRODIR)/tmac.$(TMAC_S)
- -rm -f $(MACRODIR)/tmac.pic
- cp tmac.pic $(MACRODIR)
- -rm -f $(MACRODIR)/tmac.doc
- cp tmac.doc $(MACRODIR)
- -rm -f $(MACRODIR)/tmac.andoc
- cp tmac.andoc $(MACRODIR)
+ chmod $(MACROMODE) $(MACRODIR)/tmac.$(TMAC_S)
+ -[ -d $(MACRODIR)/mdoc ] || mkdir $(MACRODIR)/mdoc
+ -for file in doc-common doc-ditroff doc-nroff doc-syms; do \
+ rm -f $(MACRODIR)/mdoc/$$file; \
+ $(STRIP) $$file >$(MACRODIR)/mdoc/$$file; \
+ chmod $(MACROMODE) $(MACRODIR)/mdoc/$$file; \
+ done
install.bin:
-
install: install.bin install.nobin
diff --git a/macros/doc-common b/macros/doc-common
new file mode 100644
index 000000000..2d25d0b78
--- /dev/null
+++ b/macros/doc-common
@@ -0,0 +1,449 @@
+.\" Copyright (c) 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)doc-common 5.7 (Berkeley) 8/5/91
+.\"
+.\" %beginstrip%
+.nr %A 1
+.nr %J 1
+.nr %N 1
+.nr %O 1
+.nr %R 1
+.nr %T 1
+.nr %V 1
+.nr Ad 12n
+.nr Ac 3
+.nr Ao 12n
+.nr Ap 2
+.nr An 12n
+.nr Aq 12n
+.nr Ar 12n
+.nr Bc 3
+.nr Bl 1
+.nr Bo 12n
+.nr Bq 12n
+.nr Bx 12n
+.nr Cd 12n
+.nr Cm 10n
+.nr Co 15n
+.nr Cx 20n
+.nr Dc 3
+.nr Do 10n
+.nr Dq 12n
+.nr Ds 6n
+.nr Dq 12n
+.nr Dv 12n
+.nr tI \n(Dsu
+.nr Ec 3
+.nr El 1
+.nr Eo 12n
+.nr Eq 12n
+.nr Em 10n
+.nr Er 12n
+.nr Ev 15n
+.nr Ex 10n
+.nr Fa 12n
+.nr Fl 10n
+.nr Fc 3
+.nr Fo 16n
+.nr Fn 16n
+.nr Hl 1
+.nr I1 6n
+.nr I2 12n
+.nr I3 18n
+.nr Ic 10n
+.nr Li 16n
+.nr Ms 6n
+.nr Nm 10n
+.nr No 12n
+.nr Ns 2
+.nr Oo 10n
+.nr Oc 3
+.nr Op 14n
+.nr Pa 32n
+.nr Pf 12n
+.nr Pc 3
+.nr Po 12n
+.nr Pq 12n
+.nr Ql 16n
+.nr Qc 3
+.nr Qo 12n
+.nr Qq 12n
+.nr Sc 3
+.nr So 12n
+.nr Sq 12n
+.nr Sy 6n
+.nr Sx 16n
+.nr Ra 1
+.nr Rj 1
+.nr Rn 1
+.nr Ro 1
+.nr Rr 1
+.nr Rt 1
+.nr Rv 1
+.nr Tn 10n
+.nr Ta 1
+.nr Tv 1
+.nr Tx 22n
+.nr Ux 10n
+.nr Va 12n
+.nr Xc 3
+.nr Xo 1
+.nr Xr 10n
+.ds sV \& \&
+.ds hV \&\ \&
+.ds iV \& \&
+.ds tV \&\\t\&
+.\" Punctuation values (3 = closing punctuation, 4 = opening)
+.nr z. 3
+.nr z, 3
+.nr z: 3
+.nr z; 3
+.nr z( 4
+.nr z) 3
+.nr z[ 4
+.nr z] 3
+.\" Matching pairs
+.ds z( z)
+.ds z[ z]
+.ds z< z>
+.\" This is disgusting, troff not parse ``if'' stmt properly
+.nr z0 0
+.nr z1 0
+.nr z2 0
+.nr z3 0
+.nr z4 0
+.nr z5 0
+.nr z6 0
+.nr z7 0
+.nr z8 0
+.nr z9 0
+.nr z# 0
+.\" Header assembly macros
+.de Dt
+.ds dT UNTITLED
+.ds vT LOCAL
+.ds cH Null
+.if !"\\$1"" .ds dT \\$1
+.if !"\\$2"" \{\
+. ds cH \\$2
+.\" . if "\\$3"" \{\
+. if \\$2>=1 .if \\$2<=8 \{\
+. ds vT UNIX Reference Manual
+. if \\$2>1 .if \\$2<6 .ds vT UNIX Programmer's Manual
+. if "\\$2"8" .ds vT UNIX System Manager's Manual
+. nr sN \\$2
+. \}
+. if "\\$2"unass" .ds vT DRAFT
+. if "\\$2"draft" .ds vT DRAFT
+. if "\\$2"paper" .ds vT UNTITLED
+.\" . \}
+.\}
+.if !"\\$3"" \{\
+. if "\\$3"USD" .ds vT UNIX User's Supplementary Documents
+. if "\\$3"PS1" .ds vT UNIX Programmers's Supplementary Documents
+. if "\\$3"AMD" .ds vT UNIX Ancestral Manual Documents
+. if "\\$3"SMM" .ds vT UNIX System Manager's Manual
+. if "\\$3"URM" .ds vT UNIX Reference Manual
+. if "\\$3"PRM" .ds vT UNIX Programmers's Manual
+. if "\\$3"IND" .ds vT UNIX Manual Master Index
+.\" . if "\\$3"CON" .ds vT UNIX Contributed Software Manual
+.\" . if "\\$3"IMP" .ds vT UNIX Implementation Notes
+.\" . if "\\$3"HOW" .ds vT UNIX How Pocket Manual
+. if "\\$3"LOCAL" .ds vT UNIX Local Manual
+. if "\\$3"tahoe" .as vT \ (Tahoe Architecture)
+. if "\\$3"vax" .as vT \ (VAX Architecture)
+. if "\\$3"hp300" .as vT \ (HP300 Architecture)
+. if "\\*(vT"LOCAL" .ds vT \\$3
+.\}
+..
+.\" NS Os macro - Operating System (behaviour changes after first call)
+.\" . ds vT \f(CODRAFT\fP\ \ \-\-\ \ \\*(vT\ \ \-\-\ \ \f(CODRAFT
+.\" . ds dD \f(CODRAFT\fP\ \ \-\-\ \ \\*(dD\ \ \-\-\ \ \f(CODRAFT
+.\" .ds vT \s+4\f(CODRAFT\fP\s-4\ \ \-\-\ \ \\*(vT\ \ \-\-\ \ \s+4\f(CODRAFT\s-4
+.\" .ds dD \s+4\f(CODRAFT\fP\s-4\ \ \-\-\ \ \\*(dD\ \ \-\-\ \ \s+4\f(CODRAFT\s-4
+.de Os
+.ds oS Null
+.if "\\$1"" \{\
+. ds oS BSD Experimental
+.\}
+.if "\\$2"" \{\
+. ds aa Non-Null
+.\}
+.if "\\$1"ATT" \{\
+. ds oS AT&T
+. if "\\$2"" .as oS \0UNIX
+. if "\\$2"7th" .as oS \07th Edition
+. if "\\$2"7" .as oS \07th Edition
+. if "\\$2"III" .as oS \0System III
+. if "\\$2"3" .as oS \0System III
+. if "\\$2"V" .as oS \0System V
+. if "\\$2"V.2" .as oS \0System V Release 2
+. if "\\$2"V.3" .as oS \0System V Release 3
+. if "\\$2"V.4" .as oS \0System V Release 4
+.\}
+.if "\\$1"BSD" \{\
+. if "\\$2"3" .ds oS 3rd Berkeley Distribution
+. if "\\$2"4" .ds oS 4th Berkeley Distribution
+. if "\\$2"4.1" .ds oS 4.1 Berkeley Distribution
+. if "\\$2"4.2" .ds oS 4.2 Berkeley Distribution
+. if "\\$2"4.3" .ds oS 4.3 Berkeley Distribution
+. if "\\$2"4.3T" .ds oS 4.3-Tahoe Berkeley Distribution
+. if "\\$2"4.3R" .ds oS 4.3-Reno Berkeley Distribution
+. if "\\$2"4.3t" .ds oS 4.3-Tahoe Berkeley Distribution
+. if "\\$2"4.3r" .ds oS 4.3-Reno Berkeley Distribution
+. if "\\$2"4.4" .ds oS BSD Experimental
+.\}
+.if "\\*(oS"Null" .ds oS \0\\$1
+.if "\\*(aa"Non-Null" .as oS \0\\$2
+.rm aa
+..
+.de Dd
+.if !"\\*(dD"" .nr gX 1
+.ie \\n(.$>0 \{\
+. ie \\n(.$==3 \{\
+. ds dD \\$1 \\$2 \\$3
+. \}
+. el \{\
+. if "\\n(mo"1" .ds dD January
+. if "\\n(mo"2" .ds dD February
+. if "\\n(mo"3" .ds dD March
+. if "\\n(mo"4" .ds dD April
+. if "\\n(mo"5" .ds dD May
+. if "\\n(mo"6" .ds dD June
+. if "\\n(mo"7" .ds dD July
+. if "\\n(mo"8" .ds dD August
+. if "\\n(mo"9" .ds dD September
+. if "\\n(mo"10" .ds dD October
+. if "\\n(mo"11" .ds dD November
+. if "\\n(mo"12" .ds dD December
+. as dD \&\ \\n(dy, 19\\n(yr
+. \}
+.\}
+.el \{\
+. ds dD Epoch
+.\}
+..
+.de hM
+.ev 1
+.pL
+.if !\\n(cR 'sp \\n(Hmu
+.tl @\\*(Hs\\*(hT\fP@\\*(Vs\\*(vT\fP@\\*(Hs\\*(hT\fP@
+'sp \\n(Hmu
+.ev
+..
+.de fM
+.ie \\n(cR 'br
+.el \{\
+. ev 1
+. pL
+. if !\\n(cR \{\
+' sp \\n(Fmu
+. tl @\\*(Hs\\*(oS\fP@\\*(Vs\\*(dD\fP@%@
+' bp
+. \}
+. ev
+.\}
+.\" .tm IN 444 fM .k == \\n(.k and nl == \\n(nl
+..
+.de lM
+.fl
+.if \\n(cR \{\
+' sp
+. tl @\\*(Hs\\*(oS\fP@\\*(Vs\\*(dD\fP@%@
+. pl \\n(nlu
+.\}
+..
+.de Pp
+.sp \\n(Ppu
+.ne 2
+.ns
+..
+.de Lp
+.Pp
+..
+.de LP
+.tm Not a \-mdoc command: .LP
+..
+.de PP
+.tm Not a \-mdoc command: .PP
+..
+.de pp
+.tm Not a \-mdoc command: .pp
+..
+.de Nd
+\&\-\& \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.de Ss
+.sp
+.ne 2
+.ti -.25i
+\&\\*(sH\\$1 \|\\$2 \|\\$3 \|\\$4 \|\\$5 \|\\$6 \|\\$7 \|\\$8 \|\\$9
+\&\fP\s0
+.ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
+.if !\\n(cR .ne 2
+.br
+..
+.de Rd
+.tm MDOC REGISTER DUMP
+.tm Db==\\n(Db register DEBUG MODE
+.tm L[0-9] registers - stack of list types
+.tm L0==\\n(L0
+.tm L1==\\n(L1
+.tm L2==\\n(L2
+.tm L3==\\n(L3
+.tm L4==\\n(L4
+.tm L5==\\n(L5
+.tm L6==\\n(L6
+.tm L7==\\n(L7
+.tm L8==\\n(L8
+.tm L9==\\n(L9
+.tm O[0-9] registers - stack of indent
+.tm O0==\\n(O0
+.tm O1==\\n(O1
+.tm O2==\\n(O2
+.tm O3==\\n(O3
+.tm O4==\\n(O4
+.tm O5==\\n(O5
+.tm O6==\\n(O6
+.tm O7==\\n(O7
+.tm O8==\\n(O8
+.tm O9==\\n(O9
+.tm aC==\\n(aC register argument counter (aV/fV)
+.tm aJ==\\n(aJ register (for vR)
+.tm aN==\\n(aN register
+.tm aP==\\n(aP register argument pointer (aV)
+.tm aT==\\n(aT register argument type
+.tm aa==\\n(aa local register
+.tm bK==\\n(bK register - Book Name flag
+.tm cF==\\n(cF register save current font
+.tm cI==\\n(cI register - column indent width
+.tm cZ==\\n(cZ register save current font size
+.tm dK==\\n(dK register - Date flag
+.tm d[0-9] registers - display-type stack
+.tm d0==\\n(d0
+.tm d1==\\n(d1
+.tm d2==\\n(d2
+.tm d3==\\n(d3
+.tm d4==\\n(d4
+.tm d5==\\n(d5
+.tm d6==\\n(d6
+.tm d7==\\n(d7
+.tm d8==\\n(d8
+.tm d9==\\n(d9
+.tm dZ==\\n(dZ register diversion count
+.tm fD==\\n(fD register subroutine test (in synopsis only)
+.tm fV==\\n(fV register argument counter (must set to \\n(.$ prior to
+.tm fY==\\n(fY register - dick with old style function declarations (fortran)
+.tm fZ==\\n(fZ register also subroutine count (in synopsis only)
+.tm h[0-9] register horizontal tag stack (continuous if 1, break if
+.tm h0==\\n(h0
+.tm h1==\\n(h1
+.tm h2==\\n(h2
+.tm h3==\\n(h3
+.tm h4==\\n(h4
+.tm h5==\\n(h5
+.tm h6==\\n(h6
+.tm h7==\\n(h7
+.tm h8==\\n(h8
+.tm h9==\\n(h9
+.tm iD==\\n(iD local register
+.tm iI==\\n(iI local register (indent for inline debug mode)
+.tm iN==\\n(iN register DEBUG MODE (inline if 1, to stderr if
+.tm iS==\\n(iS register - indent second command line in a synopsis
+.tm jK==\\n(jK register - [reference] Journal Name flag
+.tm jM==\\n(jM local register
+.tm jN==\\n(jN local register
+.tm lC==\\n(lC register - list type stack counter
+.tm lK==\\n(lK register count of lines read from input file
+.tm nK==\\n(nK register - [reference] issue number flag
+.tm nU==\\n(nU register count
+.tm oK==\\n(oK register - [reference] optional information flag
+.tm oM==\\n(oM register (extension possible)
+.tm o[0-9] register offset stack (nested tags)
+.tm o0==\\n(o0
+.tm o1==\\n(o1
+.tm o2==\\n(o2
+.tm o3==\\n(o3
+.tm o4==\\n(o4
+.tm o5==\\n(o5
+.tm o6==\\n(o6
+.tm o7==\\n(o7
+.tm o8==\\n(o8
+.tm o9==\\n(o9
+.tm oM==\\n(oM register open ended line flag
+.tm pK==\\n(pK register - [reference] page number flag
+.tm qK==\\n(qK register - Corporate or Foreign Author flag
+.tm rK==\\n(rK register - [reference] report flag
+.tm rS==\\n(rS register - Reference Start flag
+.tm sM==\\n(sM register - default is one (space mode on)
+.tm tK==\\n(tK register - reference title flag
+.tm tP==\\n(tP register tag flag (for diversions)
+.tm tX==\\n(tX register (initial class)
+.tm tY==\\n(tY register (next possible lC value)
+.tm t[0-9] register tag string stack (nested tags)
+.tm t0==\\n(t0
+.tm t1==\\n(t1
+.tm t2==\\n(t2
+.tm t3==\\n(t3
+.tm t4==\\n(t4
+.tm t5==\\n(t5
+.tm t6==\\n(t6
+.tm t7==\\n(t7
+.tm t8==\\n(t8
+.tm t9==\\n(t9
+.tm uK==\\n(uK register - reference author(s) counter
+.tm vK==\\n(vK register - reference volume flag
+.tm v[0-9] register vertical tag break stack
+.tm v0==\\n(v0
+.tm v1==\\n(v1
+.tm v2==\\n(v2
+.tm v3==\\n(v3
+.tm v4==\\n(v4
+.tm v5==\\n(v5
+.tm v6==\\n(v6
+.tm v7==\\n(v7
+.tm v8==\\n(v8
+.tm v9==\\n(v9
+.tm w[0-9] register tag stack (nested tags)
+.tm w0==\\n(w0
+.tm w1==\\n(w1
+.tm w2==\\n(w2
+.tm w3==\\n(w3
+.tm w4==\\n(w4
+.tm w5==\\n(w5
+.tm w6==\\n(w6
+.tm w7==\\n(w7
+.tm w8==\\n(w8
+.tm w9==\\n(w9
+.tm xX==\\n(xX local register
+.tm END OF REGISTER DUMP
+..
diff --git a/macros/doc-ditroff b/macros/doc-ditroff
new file mode 100644
index 000000000..d63923eb5
--- /dev/null
+++ b/macros/doc-ditroff
@@ -0,0 +1,269 @@
+.\" Copyright (c) 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)doc-ditroff 5.8 (Berkeley) 8/5/91
+.\"
+.\" tmac.mdoc-ditroff
+.\" %beginstrip%
+.\"
+.ds aD \fI\s10
+.ds aR \f(CO\s10
+.ds cM \f(CB\s10
+.ds dF \fR\s10
+.ds eM \fI\s10
+.ds eR \fC\s10
+.ds eV \fC\s10
+.ds fA \f(CO\s10
+.ds fD \f(CB\s10
+.ds fL \f(CB\s10
+.ds fN \f(CB\s10
+.ds fP \fP\s0
+.ds fS \s0
+.ds fT \f(CO\s10
+.ds Hs \fR\s10
+.ds iC \f(CB\s10
+.ds lI \fC
+.ds lP \fR\|(\|\fP\s10
+.ds lp \fR(\fP\s10
+.ds rP \fR\|)\|\fP\s10
+.ds rp \fR)\fP\s10
+.ds lB \fR\^[\^\fP\s10
+.ds rB \fR\^]\fP\s10
+.ds mL \fB\s10
+.ds nM \f(CB\s10
+.ds nO \fR\s10
+.ds nT \s0
+.ds pA \fC\s10
+.ds Pu \fR{\ .\ ,\ :\ ;\ (\ )\ [\ ]\ \fR}
+.ds rA \fR\s10
+.ds rT \f(CO\s10
+.ds sH \fB\s10
+.ds sP \s0
+.ds sY \fB\s10
+.ds sX \fR\s10
+.ds tF \fR
+.ds tN \s9
+.ds vA \fI\s10
+.ds Vs \fR\s10
+.ds vT \f(CB\s10
+.ds xR \fC\s10
+.tr *\(**
+.nr sI \w\fC,u*5
+.nr Ti \n(sIu
+.nr Pp .5v
+.ds lS \0
+.nr lS \w'\0'u
+.nr dI 6n
+.de pL
+.nr Hm .5i
+.nr Fm .5i
+.nr ll 6.5i
+.ll 6.5i
+.nr lt 6.5i
+.lt 6.5i
+.nr po 1i
+.po 1.i
+.nr dV .5v
+..
+.ds <= \(<=
+.ds >= \(>=
+.ds Lq \&``
+.ds Rq \&''
+.ds ua \(ua
+.ds aa \(aa
+.ds ga \(ga
+.ds sR \&'
+.ds sL \&`
+.ds q \&"
+.\" Math stuff
+.ds Pi \(*p
+.ds Ne \(!=
+.ds Le \(<=
+.ds Ge \(>=
+.ds Lt <
+.ds Gt >
+.ds Pm \(+-
+.ds If \(if
+.ds Na \fINaN\fP
+.ds Ba \fR\&|\fP
+.\"
+.nr gX 0
+.de hK
+.ds hT \\*(dT
+.if !"\\*(cH"Null" \{\
+. ie !"\\*(gP"Null" .as hT \|(\|\\*(cH\\*(gP\|)
+. el .as hT \\|(\\|\\*(cH\\|)
+.\}
+.if "\\*(cH"Null" \{\
+. if !"\\*(gP"Null" .as hT \&\|(\|\\*(gP\|)
+.\}
+.wh 0 hM
+.wh -1.25i fM
+.\" .tm Here is gX == \\n(gX
+.ie \\n(gX==1 \{\
+. rm n1
+. if \\n(.g .br
+. if !\\n(.g .bp
+.\}
+.el \{\
+. if \\n(.g .br
+. if !\\n(.g 'bp
+.\}
+.nr % 1
+.nr gX 0
+.em lM
+..
+.\"
+.nr fW \w\fC0
+.de sW
+.nr sW \w\fC\\$1
+.ie \\n(sW>=\\n(fW \{\
+. ie \\n(sW%\\n(fW .nr sW (\\n(sW/\\n(fW)+1
+. el .nr sW \\n(sW/\\n(fW
+.\}
+.el \{\
+. ie \\n(sW>0 .nr sW 1
+. el .nr sW 0
+.\}
+..
+.\"
+.de aW
+.nr sW \w\fC\\*(A\\$1
+.ie \\n(sW>=\\n(fW \{\
+. ie \\n(sW%\\n(fW .nr sW (\\n(sW/\\n(fW)+1
+. el .nr sW \\n(sW/\\n(fW
+.\}
+.el \{\
+. ie \\n(sW>0 .nr sW 1
+. el .nr sW 0
+.\}
+..
+.\" NS Ql macro - Quoted literal define
+.de Ql
+.if \\n(aC==0 \{\
+. ds mN Ql
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. nr fV \\n(.$
+. fV
+.\}
+.nr aP \\n(aP+1
+.aW \\n(aP
+.nr aP \\n(aP-1
+.if \\n(sW>2 .Li
+.if \\n(sW<=2 \{\
+.\" Db on
+. if (\\n(aP>0) \{\
+. ds A\\n(aP Li
+. nr aP \\n(aP -1
+. \}
+. if (\\n(aP==0) \{\
+. rm C0 C1 C2 C3 C4 C5 C6 C7 C8 C9
+. rm S1 S2 S3 S4 S5 S6 S7 S8 S9
+. rn A8 A9
+. rn A7 A8
+. rn A6 A7
+. rn A5 A6
+. rn A4 A5
+. rn A3 A4
+. rn A2 A3
+. rn A1 A2
+. ds A1 Li
+. nr fV \\n(aC+1
+. nr aC 0
+. fV
+. \}
+. ds qL \&\\*(sL
+. ds qR \&\\*(sR
+. En
+.\" Db off
+.\}
+..
+.\" NS Sh macro - Section Headers
+.\" NS nS register - Section Header SYNOPSIS flag
+.\" NS nF register - Section Header FILES flag
+.\" NS nA register - Section Header SEE ALSO flag
+.\" NS nT register - Section Header STANDARDS flag
+.de Sh
+.nr nS 0
+.nr sE 0
+.nr iS 0
+'ad
+.ie "\\$1"NAME" \{\
+. hK
+' in 0
+.\}
+.el \{\
+. nr nS 0
+. nr nA 0
+. nr nF 0
+. nr nT 0
+. nr nY 0
+. nr oT 0
+. if "\\$1"SYNOPSIS" \{\
+. na
+. nr nS 1
+. \}
+. if "\\$1"DESCRIPTION" \{\
+. nr fY 0
+. nr fZ 0
+. nr fB 0
+. nr Fb 0
+. ds Fb
+. \}
+. if "\\$1"SEE" \{\
+. nr nA 1
+. na
+. \}
+. if "\\$1"FILES" .nr nF 1
+. if "\\$1"STANDARDS" .nr nT 1
+. if "\\$1"AUTHORS" .nr nY 1
+. if "\\$1"SEE" .nr sE 1
+. in 0
+. nr aN 0
+.\}
+.pL
+'sp
+.ns
+.ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
+.if !\\n(cR .ne 3
+'fi
+\&\\*(sH\\$1 \|\\$2 \|\\$3 \|\\$4 \|\\$5 \|\\$6 \|\\$7 \|\\$8 \|\\$9
+\&\fP\s0\&
+.in \\n(.iu+\\n(Tiu
+.ns
+..
diff --git a/macros/doc-nroff b/macros/doc-nroff
new file mode 100644
index 000000000..c036f2181
--- /dev/null
+++ b/macros/doc-nroff
@@ -0,0 +1,225 @@
+.\" Copyright (c) 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)doc-nroff 5.6 (Berkeley) 8/5/91
+.\"
+.\" tmac.mdoc-nroff
+.\" %beginstrip%
+.\"
+.ds aD \fI
+.ds aR \fI
+.ds cM \fB
+.ds dF \fR
+.ds eM \fI
+.ds eR \fR
+.ds eV \fR
+.ds fA \fI
+.ds fD \fB
+.ds fL \fB
+.ds fN \fB
+.ds fP \fP
+.ds fS
+.ds fT \fI
+.ds Hs \fR
+.ds iC \fB
+.ds lI \fR
+.ds lP \fR\|(\fP
+.ds rP \fR\|)\fP
+.ds lp \fR\|(\fP
+.ds rp \fR\|)\fP
+.ds lB \fR\|[\|\fP
+.ds rB \fR\|]\fP
+.ds mL \fB
+.ds nM \fB
+.ds nO \fR
+.ds pA \fI
+.ds Pu {\ .\ ,\ ;\ :\ (\ )\ [\ ]}
+.ds rA \fR
+.ds rT \fI
+.ds sH \fB
+.ds sP
+.ds sY \fB
+.ds sX \fI
+.ds tF \fR
+.ds tN
+.ds vA \fI
+.ds Vs \fR
+.ds vT \fB
+.ds xR \fR
+.\" MISCELLANEOUS
+.nr sI .5i
+.nr Ti .5i
+.nr cR 1
+.nr Pp 1v
+.ds lS \0\0
+.nr lS \w'\0\0'u
+.nr dI 6n
+.\"
+.de pL
+.ie \\n(cR .nr Hm 0
+.el .nr Hm .5i
+.nr Fm .5i
+.nr ll 78n
+.ll 78n
+.nr lt 78n
+.lt 78n
+.nr po 0i
+.po 0i
+.nr dV 1v
+.ad l
+.na
+..
+.ds <= \&<\&=
+.ds >= \&>\&=
+.ds Rq ''
+.ds Lq ``
+.ds ua ^
+.ds aa \'
+.ds ga \`
+.ds sL `
+.ds sR '
+.ds q \&"
+.\" Math stuff
+.ds Pi pi
+.ds Ne !=
+.ds Le <=
+.ds Ge >=
+.ds Lt <
+.ds Gt >
+.ds Pm +-
+.ds If infinity
+.ds Na \fINaN\fP
+.ds Ba \fR\&|\fP
+
+.\"
+.de hK
+.nr % 1
+.ds hT \\*(dT
+.if !"\\*(cH"Null" \{\
+. ie !"\\*(gP"Null" .as hT \|(\|\\*(cH\\*(gP\|)
+. el .as hT \\|(\\|\\*(cH\\|)
+.\}
+.if "\\*(cH"Null" .if !"\\*(gP"Null" .as hT \&\|(\|\\*(gP\|)
+.ie \\n(cR \{\
+. hM
+. wh -1v fM
+.\}
+.el \{\
+. wh 0 hM
+. wh -1.167i fM
+.\}
+.if \\n(nl==0:\\n(nl==-1 'bp
+.em lM
+..
+.nr fW \w'0'
+.de sW
+.nr sW \w\\$1
+.ie \\n(sW>=\\n(fW \{\
+. ie \\n(sW%\\n(fW .nr sW (\\n(sW/\\n(fW)+1
+. el .nr sW \\n(sW/\\n(fW
+.\}
+.el .nr sW 0
+..
+.de aW
+.nr sW \w\\*(A\\$1
+.ie \\n(sW>=\\n(fW \{\
+. ie \\n(sW%\\n(fW .nr sW (\\n(sW/\\n(fW)+1
+. el .nr sW \\n(sW/\\n(fW
+.\}
+.el .nr sW 0
+..
+.\" NS Ql macro - Quoted literal define
+.de Ql
+.if \\n(aC==0 \{\
+. ds mN Ql
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
+.\}
+.ds qL \&\\*(sL
+.ds qR \&\\*(sR
+.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Sh macro - Section Headers
+.\" NS nS register - Section Header SYNOPSIS flag
+.\" NS nF register - Section Header FILES flag
+.\" NS nA register - Section Header SEE ALSO flag
+.\" NS nT register - Section Header STANDARDS flag
+.de Sh
+.nr nS 0
+.nr sE 0
+.nr iS 0
+.ie "\\$1"NAME" \{\
+. hK
+' in 0
+.\}
+.el \{\
+. nr nS 0
+. nr nA 0
+. nr nF 0
+. nr nT 0
+. nr nY 0
+. nr aN 0
+. nr oT 0
+. if "\\$1"SEE" .nr nA 1
+. if "\\$1"FILES" .nr nF 1
+. if "\\$1"STANDARDS" .nr nT 1
+. if "\\$1"SYNOPSIS" .nr nS 1
+. if "\\$1"DESCRIPTION" \{\
+. rr fB
+. rr Fb
+. ds Fb
+. nr fY 0
+. nr fZ 0
+. \}
+. if "\\$1"AUTHORS" .nr nY 1
+. in 0
+.\}
+.pL
+'sp
+.ns
+.ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
+.if !\\n(cR .ne 3
+'fi
+\&\\*(sH\\$1 \|\\$2 \|\\$3 \|\\$4 \|\\$5 \|\\$6 \|\\$7 \|\\$8 \|\\$9
+\&\fP\s0\&
+.in \\n(.iu+\\n(Tiu
+.if "\\$1"SEE" .nr sE 1
+.ns
+..
diff --git a/macros/doc-syms b/macros/doc-syms
new file mode 100644
index 000000000..a9504e9bd
--- /dev/null
+++ b/macros/doc-syms
@@ -0,0 +1,234 @@
+.\" Copyright (c) 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)doc-syms 5.6 (Berkeley) 8/5/91
+.\"
+.\" %beginstrip%
+.\" NS Ux macro - UNIX
+.de Ux
+.nr cF \\n(.f
+.nr cZ \\n(.s
+.ds aa \&\f\\n(cF\s\\n(cZ
+.as b1 \&\\*(tNUNIX\\*(aa
+.rm aa
+.if \\n(aC==0 \{\
+. if \\n(.$>0 .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.\}
+.ie \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. ie \\n(C\\n(aP==1 \{\
+. \\*(A\\n(aP
+. \}
+. el .nR
+.\}
+.el .aZ
+..
+.\" NS Bx macro -BSD UNIX (fix smaller nroff version)
+.de Bx
+.nr cF \\n(.f
+.nr cZ \\n(.s
+.ds aa \&\f\\n(cF\s\\n(cZ
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 \&\\*(tNBSD\\*(aa \\*(tNUNIX\\*(aa
+. el .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.\}
+.if "\\$1"-alpha" \{\
+\&currently in alpha test.
+. aY
+.\}
+.if "\\$1"-beta" \{\
+\&currently in beta test.
+. aY
+.\}
+.if "\\$1"-devel" \{\
+\&currently under development.
+. aY
+.\}
+.if \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. ie \\n(C\\n(aP==2 \{\
+. as b1 \&\\*(A\\n(aP\&\\*(tNBSD\\*(aa
+. ie \\n(aC>\\n(aP \{\
+. nr jj \\n(aP+1
+. ie \\n(C\\n(jj==2 \{\
+. if "\\*(A\\n(jj"Reno" \{\
+. nr aP \\n(aP+1
+. as b1 \&\-\\*(A\\n(jj
+. \}
+. if "\\*(A\\n(jj"reno" \{\
+. nr aP \\n(aP+1
+. as b1 \&\-Reno
+. \}
+. if "\\*(A\\n(jj"Tahoe" \{\
+. nr aP \\n(aP+1
+. as b1 \&\-\\*(A\\n(jj
+. \}
+. if "\\*(A\\n(jj"tahoe" \{\
+. nr aP \\n(aP+1
+. as b1 \&\-Tahoe
+. \}
+. ie \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. nR
+. \}
+. el .aZ
+. \}
+. el \{\
+. nr aP \\n(aP+1
+. nR
+. \}
+. rr jj
+. \}
+. el .aZ
+. \}
+. el \{\
+. as b1 \&\\*(tNBSD\\*(aa U\\*(tNNIX\\*(aa
+. nR
+. \}
+.\}
+..
+.\" Ns Ud macro - prints "currently under development" (HISTORY section)
+.de Ud
+\&currently under development.
+..
+.\" Ns At macro - AT&T UNIX
+.de At
+.nr cF \\n(.f
+.nr cZ \\n(.s
+.ds aa \&\f\\n(cF\s\\n(cZ
+.if \\n(.$==2 \{\
+. if "\\$1"32v" \&Version 32V \\*(tNAT&T UNIX\\*(aa\\$2
+. if "\\$1"v6" \&Version 6 \\*(tNAT&T UNIX\\*(aa\\$2
+. if "\\$1"v7" \&Version 7 \\*(tNAT&T UNIX\\*(aa\\$2
+. if "\\$1"V" \&\\*(tNAT&T\\*(aa System V \\*(tNUNIX\\*(aa\\$2
+. if "\\$1"V.1" \&\\*(tNAT&T\\*(aa System V.1 \\*(tNUNIX\\*(aa\\$2
+. if "\\$1"V.4" \&\\*(tNAT&T\\*(aa System V.4 \\*(tNUNIX\\*(aa\\$2
+.\}
+.if \\n(.$==1 \{\
+. if "\\$1"32v" \&Version 32V \\*(tNAT&T UNIX\\*(aa
+. if "\\$1"v6" \&Version 6 \\*(tNAT&T UNIX\\*(aa
+. if "\\$1"v7" \&Version 7 \\*(tNAT&T UNIX\\*(aa
+. if "\\$1"V" \&\\*(tNAT&T\\*(aa System V \\*(tNUNIX\\*(aa
+. if "\\$1"V.1" \&\\*(tNAT&T\\*(aa System V.1 \\*(tNUNIX\\*(aa
+. if "\\$1"V.4" \&\\*(tNAT&T\\*(aa System V.4 \\*(tNUNIX\\*(aa
+.\}
+..
+.\" The Bt macro should go away now
+.\" Ns Bt macro - prints "is currently in beta test." (HISTORY section)
+.de Bt
+\&is currently in beta test.
+..
+.\" NS St macro - standards (posix, ansi - formal standard names)
+.ds Px \\*(tNPOSIX
+.ds Ai \\*(tNANSI
+.de St
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 \{\
+.tm Usage: .St [-p1003.1-88 | -p1003.2 | -ansiC-89 | -iso ] \\*(Pu ... (#\\n(.c)
+. \}
+. el \{\
+. ds mN St
+. nr aP 0
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
+. \}
+.\}
+.if \\n(aC>\\n(aP \{\
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. ds aa \&\f\\n(cF\s\\n(cZ
+. nr aP \\n(aP+1
+. if "\\*(A\\n(aP"-p1003.1-88" \{\
+. ie \\n(sT==1 \{\
+. ds b1 \&\\*(tNIEEE Std\\*(aa1003.1-1988\\*(sV
+. as b1 (``\\*(tN\\*(Px\\*(aa'')
+. \}
+. el \{\
+. ds b1 \&\\*(tNIEEE Std\\*(aa1003.1-1988\\*(sV
+. as b1 (``\\*(tN\\*(Px\\*(aa'')
+. \}
+. \}
+. if "\\*(A\\n(aP"-p1003.2" \{\
+. ie \\n(sT==1 \{\
+. ds b1 \&\\*(tNIEEE Std\\*(aa1003.2
+. as b1 (``\\*(tN\\*(Px\\*(aa'')
+. \}
+. el \{\
+. ds b1 \&\\*(tNIEEE Std\\*(aa1003.2\\*(sV
+. as b1 (``\\*(tN\\*(Px\\*(aa'')
+. \}
+. \}
+. if "\\*(A\\n(aP"-ansiC" \{\
+. ie \\n(sT==1 \{\
+. ds b1 \&\\*(tNANSI C\\*(aa3.159-1989\\*(sV
+. as b1 (``\\*(tNANSI C\\*(aa'')
+. \}
+. el \{\
+. ds b1 \&\\*(tNANSI C\\*(aa3.159-1989\\*(sV
+. as b1 (``\\*(tNANSI C\\*(aa'')
+. \}
+. \}
+. if "\\*(A\\n(aP"-ansiC-89" \{\
+. ie \\n(sT==1 \{\
+. ds b1 \&\\*(tNANSI C\\*(aa3.159-1989\\*(sV
+. as b1 (``\\*(tNANSI C\\*(aa'')
+. \}
+. el \{\
+. ds b1 \&\\*(tNANSI C\\*(aa3.159-1989\\*(sV
+. as b1 (``\\*(tNANSI C\\*(aa'')
+. \}
+. \}
+. if "\\*(A\\n(aP"-iso8802-3" \{\
+. ie \\n(sT==1 \{\
+. ds b1 \&\\*(tNISO \\*(aa8802-3: 1989\\*(sV
+.\" . as b1 (``\\*(tNANSI C\\*(aa'')
+. \}
+. el \{\
+. ds b1 \&\\*(tNISO \\*(aa8802-3: 1989\\*(sV
+.\" . as b1 (``\\*(tNANSI C\\*(aa'')
+. \}
+. \}
+. ie \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. nR
+. \}
+. el .aZ
+.\}
+..
diff --git a/macros/tmac.andoc b/macros/tmac.andoc
index cd870c3b3..fd1bad062 100644
--- a/macros/tmac.andoc
+++ b/macros/tmac.andoc
@@ -1,4 +1,5 @@
.\" Load either tmac.an or tmac.doc.
+.if !\n(.g .ab These macros require groff.
.de Dd
.rm Dd
.mso tmac.doc
diff --git a/macros/tmac.doc b/macros/tmac.doc
index 80986bc3b..e575df7c3 100644
--- a/macros/tmac.doc
+++ b/macros/tmac.doc
@@ -1,1825 +1,3427 @@
-.\"
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
-.\" Redistribution and use in source and binary forms are permitted provided
-.\" that: (1) source distributions retain this entire copyright notice and
-.\" comment, and (2) distributions including binaries display the following
-.\" acknowledgement: ``This product includes software developed by the
-.\" University of California, Berkeley and its contributors'' in the
-.\" documentation or other materials provided with the distribution and in
-.\" all advertising materials mentioning features or use of this software.
-.\" Neither the name of the University nor the names of its contributors may
-.\" be used to endorse or promote products derived from this software without
-.\" specific prior written permission.
-.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
-.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
-.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
.\"
-.\" @(#)tmac.doc 5.9 (Berkeley) 7/24/90
-.\" Modified by jjc@jclark.UUCP for groff.
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
.\"
-.if !\n(.g .ab This version of \-mdoc works only with groff.
-.\" Assume nroff on crt's only if cR==1
-.if n .nr cR 1
-.\" STRING CONSTANTS
-.\" DITROFF
-.if t \{\
-.\" Address Style
-.ds aD \fI
-.\" Argument Reference Style
-.ds aR \f(CO
-.\" Interactive Comand Modifier (flag)
-.ds cM \f(CB
-.\" Emphasis (in the English sense - usually italics)
-.ds eM \fI
-.\" Errno Style
-.ds eR \fC
-.\" Environment Variable Style
-.ds eV \fC
-.\" Command Line Flag Style
-.ds fL \f(CB
-.\" Header String Style
-.ds Hs \fR
-.\" Interactive Command Style
-.ds iC \f(CB
-.\" Literal Style
-.ds lI \fC
-.\" Left Parenthesis Style
-.ds lP \fR\|(\|\fP
-.\" Right Parenthesis Style
-.ds rP \fR\|)\|\fP
-.\" Options Open Bracket Style
-.ds lB \fR\^[\^\fP
-.\" Options Open Bracket Style
-.ds rB \fR\^]\fP
-.\" Name (subject of manpage) Style
-.ds nM \f(CB
-.\" Pathname Style
-.ds pA \fC
-.\" Accepted punctuation string for -mdoc syntax
-.ds Pu \fR[.,:;(\^)[\^]\fR]
-.\" Section Header Style
-.ds Sp \s12\fB
-.\" .ds sT \s-2\fR
-.\" Symbolic Emphasis (boldface)
-.ds sY \f(CB
-.\" Generic Variable Style
-.ds vA \fI
-.\" Volume Title Style
-.ds Vs \fR
-.\" Cross Reference STyle (man page only)
-.ds xR \fC
-.\" Math *
-.tr *\(**
-.\}
-.\" NROFF
-.if n \{\
-.\" Address Style
-.ds aD \fI
-.\" Argument Reference Style
-.ds aR \fI
-.\" Interactive Command Modifier (flag)
-.ds cM \fB
-.\" Emphasis (in the English sense - usually italics)
-.ds eM \fI
-.\" Errno Style
-.ds eR \fR
-.\" Environment Variable Style
-.ds eV \fR
-.\" Command Line Flag Style
-.ds fL \fB
-.\" Header String Style
-.ds Hs \fR
-.\" Interactive Command Style
-.ds iC \fB
-.\" Literal Style
-.ds lI \fR
-.\" Left Parenthesis Style
-.ds lP \fR\|(\fP
-.\" Right Parenthesis Style
-.ds rP \fR\|)\fP
-.\" Options Open Bracket Style
-.ds lB \fR\|[\|\fP
-.\" Options Open Bracket Style
-.ds rB \fR\|]\fP
-.\" Name (subject of manpage) Style
-.ds nM \fB
-.\" Pathname Style
-.ds pA \fI
-.\" Accepted punctuation string for -mdoc syntax
-.ds Pu [.,;:()[]]
-.\" Section Header Style
-.ds Sp \s12\fB
-.\" .ds sT \s-2\fR
-.\" .ds sT \s-2\fR
-.\" Symbol, Mode or Mask Style
-.ds sY \fB
-.\" Generic Variable Style
-.ds vA \fI
-.\" Volume Title Style
-.ds Vs \fR
-.\" Cross Reference Style (man page only)
-.ds xR \fR
-.\}
-.\" INDENTS - Subheaders(sI), Text(Ti) between Section Headers and Subsects
+.\" @(#)doc 5.8 (Berkeley) 8/5/91
+.\" Modified by jjc@jclark.com as follows: the doc-* files are assumed to be
+.\" installed as mdoc/doc-* rather than tmac.doc-* (the filename
+.\" `tmac.doc-common' would be too long); when using groff, the doc-* files
+.\" are loaded using the `mso' request.
+.\"
+.\" .mdoc-parse - attempt to parse troff request arguments
+.\" %beginstrip%
+.if \n(.g \{\
+.cp 0
+.ftr C CR
+.\}
+.if \n(.g .ig
+.de sO
+.so /usr/share/tmac/\\$1
+..
+.if !\n(.g .ig
+.de sO
+.mso mdoc/\\$1
+..
.if t \{\
-. nr sI \w'\fC,'u*5
-. nr Ti \n(sIu
+. sO doc-ditroff
.\}
.if n \{\
-. nr sI .5i
-. nr Ti .5i
-.\}
-.\" Flags for macros names which are used only for .Ds
-.nr dI 6n
-.nr dC 1
-.nr dL 1
-.nr dR 1
-.\" INDENT WIDTHS (for Lists)
-.\" Width Needed for Address Tag (indented amount)
-.nr Ad 12n
-.\" Angle Quote Width
-.nr Aq 12n
-.\" Width Needed for Argument
-.nr Ar 12n
-.\" Width Needed for Column offset
-.nr Cl 15n
-.\" Width neeeded for Interactive Command Modifier
-.nr Cm 10n
-.\" Width Needed for Complex Expressions
-.nr Cx 20n
-.\" Indent Width Needed for Display (right and left margins)
-.nr Ds 6n
-.\" Double Quote Width
-.nr Dq 12n
-.\" tI is dependent on Ds and used by .Dp
-.nr tI \n(Dsu
-.\" Width Needed for Display
-.nr Em 10n
-.\" Width Needed for Errno Types
-.nr Er 15n
-.\" Width Needed for Environment Variables
-.nr Ev 15n
-.\" Width Needed for Example Indent
-.nr Ex 10n
-.\" Width Needed for Flag
-.nr Fl 10n
-.\" Width Needed for Function
-.nr Fn 16n
-.\" Width neeeded for Interactive Command Name
-.nr Ic 10n
-.\" Width Needed for Constant
-.nr Li 16n
-.\" Width Needed for Math Symbol ? not sure if needed
-.nr Ms 6n
-.\" Width Needed for Name
-.nr Nm 10n
-.\" Width Needed for Option Begin
-.nr Ob 14n
-.\" Width Needed for Option End
-.nr Oe 14n
-.\" Width Needed for Option (one line)
-.nr Op 14n
-.\" Width Needed for Pathname
-.nr Pa 32n
-.\" Parenthesis Quote Width
-.nr Pq 12n
-.\" Single Quote Width
-.nr Sq 12n
-.\" Width Needed for Symbols, Modes or Masks
-.nr Sy 6n
-.\" Width needed for default or unknown text width
-.nr Tx 22n
-.\" Width Needed for Generic Variable
-.nr Va 12n
-.\" Width Needed for Cross Reference, should the cross ref be annotated.
-.nr Xr 10n
-.\" PARAGRAPH SPACE
-.if t \{\
-. nr Pp .5v
+. sO doc-nroff
+.\}
+.sO doc-common
+.sO doc-syms
+.\" NS Db macro - start/stop DEBUG MODE
+.\" NS Db register DEBUG MODE
+.\" NS iN register DEBUG MODE (inline if 1, to stderr if 0 (default))
+.nr Db 0
+.de Db
+.ie \\n(.$==0 \{\
+. ie \\n(Db==0 \{\
+.tm DEBUGGING ON
+. nr Db 1
+. \}
+. el \{\
+.tm DEBUGGING OFF
+. nr Db 0
+. \}
.\}
-.if n \{\
-. nr Pp 1v
+.el \{\
+. if "\\$1"on" \{\
+.tm DEBUGGING ON
+. nr Db 1
+. \}
+. if "\\$1"off" \{\
+.tm DEBUGGING OFF
+. nr Db 0
+. \}
.\}
-.\" PAGE LAYOUT
-.\" .Li Tagged Paragraph Style - zero if break on oversized tag
-.\" one if add em space and continue filling line.
-.nr tP 0
-.\" Page Layout Macro
-.de pL
-.\" DITROFF
-.ie t \{\
-.\" Header Margin
-. nr Hm .5i
-.\" Footer Margin
-. nr Fm .5i
-.\" Line length
-. nr ll 5.5i
-.\" Line length
-. ll 5.5i
-.\" Title length
-. nr lt 5.5i
-.\" Title length
-. lt 5.5i
-.\" Page offset
-. nr po 1.56i
-.\" Page offset
-. po 1.56i
-.\" Vertical space distance (from Section headers/Lists/Subsections)
-. nr vV .5v
-.\" em space
-. ds tP \|\|\|\|\|\|
+..
+.\" NS aV macro - parse argument vector (recursive) (.aV arg ... )
+.\" NS fV macro - parse argument vector (recursive) (.fV)
+.\" NS aC register argument counter (aV/fV)
+.\" NS fV register argument counter (must set to \\n(.$ prior to reuqest) (fV)
+.\" NS A[0-9] argument vector (aV/fV)
+.\" NS C[0-9] reg. arg type(1=macro, 2=arg, 3=punct-suf, 4=punct-pre) (aV/fV)
+.\" NS S[0-9] space vector (sV)
+.\" NS aP register argument pointer (aV)
+.\" NS yU local string used for debugging
+.\" NS iI local register (indent for inline debug mode)
+.\" NS mN name of calling request (set in each user requestable macro)
+.de aV
+.nr aC \\n(aC+1
+.ie "\\$1"|" \{\
+. if "\\*(mN"Op" .ds A\\n(aC \fR\\$1\fP
+. if "\\*(mN"Ar" .ds A\\n(aC \fR\\$1\fP
+. if "\\*(mN"Fl" .ds A\\n(aC \fR\\$1\fP
+. if "\\*(mN"Cm" .ds A\\n(aC \fR\\$1\fP
+. if "\\*(mN"It" .ds A\\n(aC \fR\\$1\fP
+.\}
+.el .ds A\\n(aC \\$1
+.aU \\n(aC
+.nr C\\n(aC \\n(aT
+.s\\n(aT
+.if \\n(Db \{\
+. if \\n(aT==1 .ds yU Executable
+. if \\n(aT==2 .ds yU String
+. if \\n(aT==3 .ds yU Closing Punctuation or suffix
+. if \\n(aT==4 .ds yU Opening Punctuation or prefix
+. if \\n(iN==1 \{\
+. br
+. nr iI \\n(.iu
+. in -\\n(iIu
+. if \\n(aC==1 \{\
+\&\fBDEBUG(argv) MACRO:\fP `.\\*(mN' \fBLine #:\fP \\n(.c
+. \}
+\&\t\fBArgc:\fP \\n(aC \fBArgv:\fP `\\*(A\\n(aC' \fBLength:\fP \\n(sW
+\&\t\fBSpace:\fP `\\*(S\\n(aC' \fBClass:\fP \\*(yU
+. \}
+. if \\n(iN==0 \{\
+. if \\n(aC==1 \{\
+. tm DEBUG(argv) MACRO: `.\\*(mN' Line #: \\n(.c
+. \}
+. tm \tArgc: \\n(aC Argv: `\\*(A\\n(aC' Length: \\n(sW
+. tm \tSpace: `\\*(S\\n(aC' Class: \\*(yU
+. \}
+.\}
+.ie \\n(.$==1 \{\
+. nr aP 0
+. ie \\n(dZ==1 \{\
+. if \\n(oM>1 .as b1 \\*(S0
+. \}
+. el \{\
+. if \\n(oM>0 \{\
+. if \\n(fC==0 .as b1 \\*(S0
+. \}
+. \}
+. ds S0 \\*(S\\n(aC
+. if \\n(Db \{\
+. if \\n(iN==1 \{\
+\&MACRO REQUEST: \t.\\*(mN \\*(A1 \\*(A2 \\*(A3 \\*(A4 \\*(A5 \\*(A6 \\*(A7 \\*(A8 \\*(A9
+. br
+. in \\n(iIu
+. \}
+. if \\n(iN==0 \{\
+.tm \tMACRO REQUEST: .\\*(mN \\*(A1 \\*(A2 \\*(A3 \\*(A4 \\*(A5 \\*(A6 \\*(A7 \\*(A8 \\*(A9
+. \}
+. \}
+.\}
+.el .aV \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.de fV
+.nr aC \\n(aC+1
+.if "\\*(A\\n(aC"|" \{\
+. if "\\*(mN"Op" .ds A\\n(aC \fR\\*(A\\n(aC\fP
+. if "\\*(mN"Ar" .ds A\\n(aC \fR\\*(A\\n(aC\fP
+. if "\\*(mN"Fl" .ds A\\n(aC \fR\&\\*(A\\n(aC\fP
+. if "\\*(mN"Cm" .ds A\\n(aC \fR\\*(A\\n(aC\fP
+. if "\\*(mN"It" .ds A\\n(aC \fR\\*(A\\n(aC\fP
+.\}
+.aU \\n(aC
+.nr C\\n(aC \\n(aT
+.s\\n(aT
+.if \\n(Db \{\
+. if \\n(aT==1 .ds yU Executable
+. if \\n(aT==2 .ds yU String
+. if \\n(aT==3 .ds yU Closing Punctuation or suffix
+. if \\n(aT==4 .ds yU Opening Punctuation or prefix
+. if \\n(iN==1 \{\
+. br
+. nr iI \\n(.iu
+. in -\\n(iIu
+. if \\n(aC==1 \{\
+\&\fBDEBUG(fargv) MACRO:\fP `.\\*(mN' \fBLine #:\fP \\n(.c
+. \}
+\&\t\fBArgc:\fP \\n(aC \fBArgv:\fP `\\*(A\\n(aC' \fBLength:\fP \\n(sW
+\&\t\fBSpace:\fP `\\*(S\\n(aC' \fBClass:\fP \\*(yU
+. \}
+. if \\n(iN==0 \{\
+. if \\n(aC==1 \{\
+. tm DEBUG(fargv) MACRO: `.\\*(mN' Line #: \\n(.c
+. \}
+. tm \tArgc: \\n(aC Argv: `\\*(A\\n(aC' Length: \\n(sW
+. tm \tSpace: `\\*(S\\n(aC' Class: \\*(yU
+. \}
+.\}
+.ie \\n(fV==1 \{\
+. nr aP 0
+. ie \\n(dZ==1 \{\
+. if \\n(oM>1 .as b1 \\*(S0
+. \}
+. el \{\
+. if \\n(oM>0 \{\
+. if \\n(fC==0 .as b1 \\*(S0
+. \}
+. \}
+. ds S0 \\*(S\\n(aC
+. nr fV 0
+. if \\n(Db \{\
+. ie \\n(iN \{\
+\&\tMACRO REQUEST: .\\*(mN \\*(A1 \\*(A2 \\*(A3 \\*(A4 \\*(A5 \\*(A6 \\*(A7 \\*(A8 \\*(A9
+. br
+. in \\n(iIu
+. \}
+. el \{\
+.tm \tMACRO REQUEST: .\\*(mN \\*(A1 \\*(A2 \\*(A3 \\*(A4 \\*(A5 \\*(A6 \\*(A7 \\*(A8 \\*(A9
+. \}
+. \}
.\}
.el \{\
-.\" Line length
-. nr ll 78n
-. ll 78n
-.\" Title length
-. nr lt 78n
-.\" Title length
-. lt 78n
-.\" Page offset
-. nr po 0i
-.\" Page offset
-. po 0i
-.\" Vertical space distance (from Section headers/Lists/Subsections)
-. nr vV 1v
-.\" em space
-. ds tP \0\0
-.\" Test for crt
-. ie \\n(cR .nr Hm 0
-. el .nr Hm .5i
-.\" Footer Margin
-. nr Fm .5i
-.\}
-..
-.\" Adjustment mode
-.if n \{\
-.ad l
-.na
-..
+. nr fV \\n(fV-1
+. fV
.\}
-.\" PREDEFINED STRINGS
-.if t \{\
-. ds <= \(<=
-. ds >= \(>=
-. ds Lq \&``
-. ds Rq \&''
-. ds ua \(ua
-. ds aa \(aa
-. ds ga \(ga
-. ds sR \(aa
-. ds sL \(ga
+..
+.\" NS aX macro - stuff saved strings into `b1' (used by -diag list)
+.de aX
+.nr aP \\n(aP+1
+.as b1 \&\\*(A\\n(aP
+.ie \\n(fV==1 \{\
+. nr aP 0
+. nr fV 0
.\}
-.if n \{\
-. ds <= \&<\&=
-. ds >= \&>\&=
-. ds Rq ''
-. ds Lq ``
-. ds ua ^
-. ds aa '
-. ds ga `
-. ds sL `
-. ds sR '
-.\}
-.\" Note: The distances from the bottom or top of the page are set
-.\" in headers (macro .hK): to -1.25 for troff, and -1.167 for nroff
-.\" bottoms, and top is 0.
-.\"
-.\" .Dt Document/manpage_title section/chapter volume
-.\" The \{ and \} is necessary as roff doesn't nest if-elses
-.\" properly, especially with .ds.
-.\" TODO: separate Dt into Dt, Ch and Vt for supp docs.
-.de Dt
-.ds dT UNTITLED
-.ds vT Local
-.ds cH Null
-.\" Volume and Section Number or Chapter Number
-.if !"\\$1"" .ds dT \\$1
-.if !"\\$2"" \{\
-. ds cH \\$2
-. if "\\$3"" \{\
-. \" Volume Title if none given
-. if \\$2>=1 .if \\$2<=8 \{\
-. ds vT UNIX Reference Manual
-. if \\$2>1 .if \\$2<6 .ds vT UNIX Programmer's Manual
-. if "\\$2"8" .ds vT UNIX System Manager's Manual
-. \}
-. if "\\$2"unass" .ds vT DRAFT
-. if "\\$2"draft" .ds vT DRAFT
-. if "\\$2"paper" .ds vT Null
-. \}
-.\}
-.if !"\\$3"" \{\
-. \" Volume Title if given
-. if "\\$3"USD" .ds vT UNIX User's Supplementary Documents
-. if "\\$3"PS1" .ds vT UNIX Programmers's Supplementary Documents
-. if "\\$3"AMD" .ds vT UNIX Ancestral Manual Documents
-. if "\\$3"SMM" .ds vT UNIX System Manager's Manual
-. if "\\$3"URM" .ds vT UNIX Reference Manual
-. if "\\$3"PRM" .ds vT UNIX Programmers's Manual
-. if "\\$3"IND" .ds vT UNIX Manual Master Index
-. if "\\$3"CON" .ds vT UNIX Contributed Software Manual
-. if "\\$3"IMP" .ds vT UNIX Implementation Notes
-. if "\\$3"HOW" .ds vT UNIX How Pocket Manual
-. if "\\$3"LOCAL" .ds vT UNIX Local Manual
-. if "\\*(vT"Local" .ds vT \\$3
+.el \{\
+. as b1 \&\\*(sV
+. nr fV \\n(fV-1
+. aX
.\}
..
-.\"
-.\" .Os Operating System/Standard and Release or Version Number
-.\"
-.de Os
-.ds oS Null
-.if "\\$1"" \{\
-. ds oS 4.4 Berkeley UNIX
-.\}
-.if "\\$2"" \{\
-. ds o1 Non-Null
-.\}
-.if "\\$1"ATT" \{\
-. ds oS AT&T
-. if "\\$2"" .as oS \0UNIX
-. if "\\$2"7th" .as oS \07th Edition
-. if "\\$2"7" .as oS \07th Edition
-. if "\\$2"III" .as oS \0System III
-. if "\\$2"3" .as oS \0System III
-. if "\\$2"V" .as oS \0System V
-. if "\\$2"V.2" .as oS \0System V Release 2
-. if "\\$2"V.3" .as oS \0System V Release 3
-. if "\\$2"V.4" .as oS \0System V Release 4
-.\}
-.if "\\$1"BSD" \{\
-. if "\\$2"3" .ds oS 3rd Berkeley Distribution
-. if "\\$2"4" .ds oS 4th Berkeley Distribution
-. if "\\$2"4.1" .ds oS 4.1 Berkeley Distribution
-. if "\\$2"4.2" .ds oS 4.2 Berkeley Distribution
-. if "\\$2"4.3" .ds oS 4.3 Berkeley Distribution
-. if "\\$2"4.3+" .ds oS 4.3+tahoe Berkeley Distribution
-. if "\\$2"4.4" .ds oS 4.4 Berkeley Distribution
-.\}
-.if "\\*(oS"Null" .ds oS \\$1
-.if "\\*(o1"Non-Null" .as oS \0\\$2
-.rm o1
+.\" NS aI macro - append arg to arg vector: .aI [arg] [type] (used by .En only)
+.de aI
+.ie \\n(aC<9 \{\
+. nr aC \\n(aC+1
+. ds A\\n(aC \\$1
+. nr C\\n(aC \\$2
+. s\\$2
+. ds xV S\\n(aC
+.\}
+.el \{\
+. tm Usage: Too many arguments (maximum of 8 accepted) (#\\n(.c)
+. tm \\*(A1 \\*(A2 \\*(A3 \\*(A4 \\*(A5 \\*(A6 \\*(A7 \\*(A8 \\*(A9
+.\}
..
.\"
-.\" Standards
-.\"
-.\" .de St
-.\" .ds sT Null
-.\" .if "\\$1"POSIX" \{\
-.\" . ds sT IEEE Standard POSIX
-.\" . if \\$2 .as sT \0\\$2
-.\" .\}
-.\" .if "\\$1"ANSI" \{\
-.\" . ds sT ANSI Standard
-.\" . if \\$2 .as sT \0\\$2
-.\" .\}
-.\" .if "\\$1"ISO" \{\
-.\" . ds sT ISO Standard
-.\" . if \\$2 .as sT \0\\$2
-.\" .\}
-.\" .if "\\*(sT"Null" .ds sR \\$3
-.\" ..
-.\"
-.\" .de Gp
-.\" .ie !"\\$1"" .ds gP \&\\$1 \\$2 \\$3 \\$4 \\$5
-.\" .el .ds gP Null
-.\" ..
-.\"
-.\"
-.de Dd
-.nr aa 0
-.ie \\n(.$>0 \{\
-. ie \\n(.$<4 \{\
-. ds dD \\$1 \\$2 \\$3
+.\" NS aZ macro - print buffer (pB) and clean up arg vectors (aY)
+.de aZ
+.pB
+.aY
+..
+.\" NS aY macro - clean up arg vector
+.de aY
+.rm C0 C1 C2 C3 C4 C5 C6 C7 C8 C9
+.rm A0 A1 A2 A3 A4 A5 A6 A7 A8 A9
+.rm S1 S2 S3 S4 S5 S6 S7 S8 S9
+.nr aC 0
+.nr aP 0
+..
+.\" NS pB macro - test for end of vector (eol) (print b1 buffer or divert)
+.de pB
+.ie \\n(dZ==1 \{\
+. if \\n(oM==1 \{\&\\*(b1
+. rm S0
+. ds b1
+. \}
+. if \\n(oM==0 \{\
+. x2
. \}
-. el .tm Usage: .Dd Month Day, Year (e.g July 4, 1977).
.\}
.el \{\
-. ds dD Epoch
+. ie \\n(oM==0 \{\&\\*(b1
+. rm S0
+. ds b1
+. \}
+. el \{\
+. if ((\\n(sM==1)&(\\n(tP==0)) \{\
+. x1
+. \}
+. \}
.\}
+.hy
+..
+.\" NS x1 macro - save buffer and divert if tP flag set
+.\" NS eB diversion string
+.\" NS b2 string save of buffer
+.\" NS lK register count of lines read from input file
+.de x1
+.nr dZ \\n(dZ+1
+.ds b2 \\*(b1
+.ds b1
+.nr lK \\n(.c
+.ev 2
+.fi
+.di eB
..
.\"
-.\" House Keeping Macro - Make sense of dT, cH, vT, sT, gP and dS
-.\" TODO: Try to get else's for efficiency
-.\" TODO: GET RID OF .wh -1.167i (its in v7)
+.\" NS x2 macro - end diversion and print
+.\" NS b0 string local temporary
+.de x2
+.br
+.di
+.ev
+.ie (\\n(.c-\\n(lK>1) \{\
+. ds b0 \&\\*(eB\\
+. ds b1 \\*(b2\\*(b0\\*(b1
+.\}
+.el .ds b1 \\*(b2\\*(b1
+\&\\*(b1
+.rm eB b2 b0 b1
+.nr dZ \\n(dZ-1
+..
+.\" NS Fl macro - flags (appends - and prints flags)
+.\" NS cF register save current font
+.\" NS cZ register save current font size
+.de Fl
+.as b1 \&\\*(fL
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 \{\
+. as b1 \&\|\-\|\fP\s0
+. pB
+. \}
+. el \{\
+. ds mN Fl
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
+.\}
+.if \\n(aC>0 \{\
+. ie (\\n(aC-\\n(aP)==0 \{\
+. as b1 \&\|\-\fP\s0
+. aZ
+. \}
+. el \{\
+. nr aP \\n(aP+1
+. ie \\n(C\\n(aP==1 \{\
+. as b1 \&\|\-\fP\s0
+. \\*(A\\n(aP
+. \}
+. el \{\
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. if \\n(C\\n(aP==3 \{\
+. as b1 \&\|\-\|
+. \}
+. fR
+. \}
+. \}
+.\}
+..
.\"
+.\" NS fR macro - Fl flag recursion routine (special handling)
+.\" NS jM local register
+.\" NS jN local register
.\"
-.de hK
-.nr % 1
-.ds hT \\*(dT
-.if !"\\*(cH"Null" \{\
-. ie !"\\*(gP"Null" .as hT \|(\|\\*(cH\\*(gP\|)
-. el .as hT \\|(\\|\\*(cH\\|)
-.\}
-.if "\\*(cH"Null" .if !"\\*(gP"Null" .as hT \&\|(\|\\*(gP\|)
-.if t \{\
-. wh 0 hM
-. wh -1.25i fM
+.de fR
+.hy 0
+.nr jM \\n(C\\n(aP
+.ie \\n(jM==1 \{\
+. as b1 \&\fP\s0
+. \\*(A\\n(aP
.\}
-.if n \{\
-. ie \\n(cR \{\
-. hM
-. wh -0v fM
+.el \{\
+. nr jN \\n(aP
+. ie \\n(jM==2 \{\
+. ie !"\\*(A\\n(aP"\\*(Ba" \{\
+. ie !"\\*(A\\n(aP"\fR|\fP" \{\
+. ie "\\*(A\\n(aP"-" .as b1 \&\|\-\^\-\|
+. el .as b1 \&\|\-\\*(A\\n(aP
+. \}
+. el .as b1 \&\\*(A\\n(aP
+. \}
+. el .as b1 \&\\*(A\\n(aP
+. \}
+. el .as b1 \&\f\\n(cF\s\\n(cZ\\*(A\\n(aP\fP\s0
+. ie \\n(aC==\\n(aP \{\
+. if \\n(jM==4 .as b1 \&\|\-
+. as b1 \&\fP\s0
+. aZ
. \}
. el \{\
-. wh 0 hM
-. wh -1.167i fM
+. nr aP \\n(aP+1
+. ie ((\\n(C\\n(aP==3)&(\\n(C\\n(jN==4)) .as b1 \&\|\-
+. el .as b1 \&\\*(S\\n(jN
+. fR \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
. \}
.\}
-.if n \{\
-. if \\n(nl==0:\\n(nl==-1 'bp
-.\}
-.if t 'bp
-.em lM
+.rr jM jN
..
-.\" Header Macro
.\"
-.de hM
-.ev 1
-.pL
-.if !\\n(cR 'sp \\n(Hmu
-.tl @\\*(Hs\\*(hT\fP@\\*(Vs\\*(vT\fP@\\*(Hs\\*(hT\fP@
-'sp \\n(Hmu
-.ev
+.\" NS nR macro - general name recursion routine
+.\" NS jM local register
+.\" NS jN local register
+.de nR
+.hy 0
+.nr jM \\n(C\\n(aP
+.ie \\n(jM==1 \{\
+. as b1 \&\f\\n(cF\s\\n(cZ
+. \\*(A\\n(aP
+.\}
+.el \{\
+. nr jN \\n(aP
+. ie \\n(jM==2 .as b1 \&\\*(A\\n(aP
+. el .as b1 \&\f\\n(cF\s\\n(cZ\\*(A\\n(aP\fP\s0
+. ie \\n(aC==\\n(aP \{\
+. as b1 \&\f\\n(cF\s\\n(cZ
+. aZ
+. \}
+. el \{\
+. nr aP \\n(aP+1
+. as b1 \&\\*(S\\n(jN
+. nR
+. \}
+.\}
+.rr jM jN
..
+.\" NS Ar macro - command line `argument' macro
.\"
-.de fM
-.ev 1
-.pL
-.if !\\n(cR \{\
-' sp \\n(Fmu
-. tl @\\*(Hs\\*(oS\fP@\\*(Vs\\*(dD\fP@%@
-' bp
-.\}
-.if \\n(cR \{\
-.\" . tl @\\*(Hs\\*(oS\fP@\\*(Vs\\*(dD\fP@%@
-.\" ' bp
+.de Ar
+.as b1 \\*(aR
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 \{\
+. as b1 file\ ...\fP\s0
+. pB
+. \}
+. el \{\
+. ds mN Ar
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
.\}
-.ev
-..
-.de lM
-.fl
-.if \\n(cR \{\
-. fM
-. pl \\n(nlu
+.if \\n(aC>0 \{\
+. ie (\\n(aC-\\n(aP)==0 \{\
+. as b1 \&file\ ...\fP\s0
+. aZ
+. \}
+. el \{\
+. nr aP \\n(aP+1
+. ie \\n(C\\n(aP==1 \{\
+. as b1 \&file\ ...\fP\s0
+. \\*(A\\n(aP
+. \}
+. el \{\
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. if \\n(C\\n(aP==3 \{\
+. as b1 \&file\ ...
+. \}
+. nR
+. \}
+. \}
.\}
..
-.de Pp
-.sp \\n(Ppu
-.ne 2
-.ns
-..
-.de Lp
-.Pp
-..
-.de LP
-.tm Not a \-mdoc command: .LP
-..
-.de PP
-.tm Not a \-mdoc command: .PP
-..
-.de pp
-.tm Not a \-mdoc command: .pp
-..
-.de Co
-.tm Not a \-mdoc command: .Co
-..
-.nr z. 1
-.nr z, 1
-.nr z: 1
-.nr z; 1
-.nr z) 1
-.nr z( 1
-.nr z[ 1
-.nr z] 1
-.\" This is disgusting, troff not parse if stmt properly
-.nr z1 0
-.nr z2 0
-.nr z3 0
-.nr z4 0
-.nr z5 0
-.nr z6 0
-.nr z7 0
-.nr z8 0
-.nr z9 0
-.nr z0 0
-.nr z# 0
-.\"
+.\" NS Ad macro - Addresses
.de Ad
-.ie \\n(.$==0 \{\
-. tm Usage: .Ad address [...] \\*(Pu
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .Ad address ... \\*(Pu (#\\n(.c)
+. el \{\
+. ds mN Ad
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
.\}
-.el \{\
-. ds sV \\*(aD
+.if \\n(aC>\\n(aP \{\
+. as b1 \\*(aD
+. nr aP \\n(aP+1
. nr cF \\n(.f
-. ie "\\*(iM"" .ds f1 \&\\*(sV
-. el .as f1 \&\\*(sV
-. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. ft \\n(cF
+. nr cZ \\n(.s
+. nR
+.\}
+..
+.\" NS Cd macro - Config declaration (for section 4 SYNOPSIS) (not callable)
+.\" needs work - not very translatable
+.de Cd
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .Cd Configuration file declaration (#\\n(.c)
+. el \{\
+. ds mN Cd
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
+. \}
+.\}
+.br
+.if \\n(aC>\\n(aP \{\
+. as b1 \\*(nM
+. nr aP \\n(aP+1
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. ie \\n(nS \{\
+. if "\\*(mN"Cd" \{\
+. rs
+. ie \\n(nS>1 .br
+. el \{\
+. if \\n(iS==0 .nr iS \\n(Dsu
+. \}
+. in +\\n(iSu
+. ti -\\n(iSu
+. nr nS \\n(nS+1
+. \}
+. nR
+. in -\\n(iSu
+. \}
+. el .nR
.\}
..
-.\"
-.\" Command Line Argument Macro
-.\"
-.de Ar
-.ie \\n(.$==0 \{\
-. ie !"\\*(iM"" .as f1 \&[\|\\*(aRfile\ ...\fP\|]
-. el \&[\|\\*(aRfile\ ...\fP\|]
+.\" NS Cm macro - Interactive command modifier (flag)
+.de Cm
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .Cm Interactive command modifier ... \\*(Pu (#\\n(.c)
+. el \{\
+. ds mN Cm
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
+. \}
.\}
-.el \{\
-. ds sV \\*(aR
+.if \\n(aC>\\n(aP \{\
+. as b1 \\*(cM
+. nr aP \\n(aP+1
. nr cF \\n(.f
-. ie "\\*(iM"" .ds f1 \&\\*(sV
-. el .as f1 \&\\*(sV
-. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. ft \\n(cF
+. nr cZ \\n(.s
+. nR
.\}
..
-.\"
+.\" NS Dv macro - define variable
+.de Dv
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .Dv define_variable ... \\*(Pu (#\\n(.c)
+. el \{\
+. ds mN Dv
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
+.\}
+.if \\n(aC>\\n(aP \{\
+. as b1 \\*(eR
+. nr aP \\n(aP+1
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. nR
+.\}
+..
+.\" NS Em macro - Emphasis
.de Em
-.ie \\n(.$==0 \{\
-. tm Usage: .Em text ... \\*(Pu
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 \{\
+. tm Usage: .Em text ... \\*(Pu (#\\n(.c)
+. \}
+. el \{\
+. ds mN Em
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
+. \}
.\}
-.el \{\
-. ds sV \\*(eM
+.if \\n(aC>\\n(aP \{\
+. as b1 \\*(eM
+. nr aP \\n(aP+1
. nr cF \\n(.f
-. ie "\\*(iM"" .ds f1 \&\\*(sV
-. el .as f1 \&\\*(sV
-. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. ft \\n(cF
+. nr cZ \\n(.s
+. nR
.\}
..
-.\"
+.\" NS Er macro - Errnotype
.de Er
-.ie \\n(.$==0 \{\
-. tm Usage: .Er ERRNOTYPE ... \\*(Pu
-. \}
-.el \{\
-. ds sV \\*(eR
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .Er ERRNOTYPE ... \\*(Pu (#\\n(.c)
+. el \{\
+. ds mN Er
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
+.\}
+.if \\n(aC>\\n(aP \{\
+. as b1 \\*(eR
+. nr aP \\n(aP+1
. nr cF \\n(.f
-. ie "\\*(iM"" .ds f1 \&\\*(sV
-. el .as f1 \&\\*(sV
-. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. ft \\n(cF
+. nr cZ \\n(.s
+. nR
.\}
..
-.\"
+.\" NS Ev macro - Environment variable
.de Ev
-.ie \\n(.$==0 \{\
-. tm Usage: .Ev ENVIRONMENT_VARIABLE(s) ... \\*(Pu
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .Ev ENVIRONMENT_VARIABLE ... \\*(Pu (#\\n(.c)
+. el \{\
+. ds mN Ev
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
. \}
-.el \{\
-. ds sV \\*(eV
-. nr cF \\n(.f
-. ie "\\*(iM"" .ds f1 \&\\*(sV
-. el .as f1 \&\\*(sV
-. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. ft \\n(cF
-.\}
-..
-.\"
-.\" Flag Name Macro
-.\"
-.de Fl
-.ie \\n(.$==0 \{\
-. ie !"\\*(iM"" .as f1 \&\\*(fL\-\fP
-. el \&\\*(fL\-\fP
.\}
-.el \{\
-. nr rZ 0
-. sW \\$1
-. if (\\n(sW==1&\\n(.$==1) .rZ \\$1
-. ds sV \\*(fL
+.if \\n(aC>\\n(aP \{\
+. as b1 \\*(eV
+. nr aP \\n(aP+1
. nr cF \\n(.f
-. ie \\n(rZ \{\
-. ie "\\*(iM"" .ds f1 \&\\*(sV\-\f\\n(cF\\$1
-. el \&\\*(sV\-\f\\n(cF\\$1
-. \}
-. el \{\
-. ie "\\*(iM"" .ds f1 \&\\*(sV
-. el .as f1 \&\\*(sV
-. fB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. ft \\n(cF
+. nr cZ \\n(.s
+. nR
+.\}
+..
+.\" NS Fd macro - function declaration - not callable (& no err check)
+.\" NS fD register subroutine test (in synopsis only)
+.\" NS fY register subroutine count (in synopsis only) (fortran only)
+.\" NS fZ register also subroutine count (in synopsis only)
+.de Fd
+.ds mN Fd
+.if \\n(nS>0 \{\
+.\" if a variable type was the last thing given, want vertical space
+. if \\n(fX>0 \{\
+. Pp
+. nr fX 0
. \}
+.\" if a subroutine was the last thing given, want vertical space
+. if \\n(fZ>0 \{\
+. ie \\n(fD==0 \{\
+. Pp
+. rs
+. \}
+. el .br
+. \}
+. nr fD \\n(fD+1
.\}
+.nr cF \\n(.f
+.nr cZ \\n(.s
+\&\\*(fD\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.br
+.ft \\n(cF
+.fs \\n(cZ
..
-.\" Interactive Commands Macro
-.\"
-.de Ic
-.ie \\n(.$==0 \{\
-. tm Usage: .Ic Interactive Commands(s) ... \\*(Pu
+.\" NS Fr macro - function return value - not callable (at the moment)
+.de Fr
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .Fr Function_return_value... \\*(Pu (#\\n(.c)
+. el \{\
+. ds mN Fr
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
.\}
-.el \{\
-. ds sV \\*(iC
+.if \\n(aC>\\n(aP \{\
+. as b1 \\*(aR
+. nr aP \\n(aP+1
. nr cF \\n(.f
-. ie "\\*(iM"" .ds f1 \&\\*(sV
-. el .as f1 \&\\*(sV
-. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. ft \\n(cF
+. nr cZ \\n(.s
+. nR
.\}
..
-.\"
-.\" Interactive Command Modifiers (flags)
-.\"
-.de Cm
-.ie \\n(.$==0 \{\
-. tm Usage: .Cm Interactive Command Modifier(s) ... \\*(Pu
+.\" NS Ic macro - Interactive command
+.de Ic
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .Ic Interactive command ... \\*(Pu (#\\n(.c)
+. el \{\
+. ds mN Ic
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
.\}
-.el \{\
-. ds sV \\*(cM
+.if \\n(aC>\\n(aP \{\
+. as b1 \\*(iC
+. nr aP \\n(aP+1
. nr cF \\n(.f
-. ie "\\*(iM"" .ds f1 \&\\*(sV
-. el .as f1 \&\\*(sV
-. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. ft \\n(cF
+. nr cZ \\n(.s
+. nR
.\}
..
-.\"
+.\" NS Li macro - literals
.de Li
-.ie \\n(.$==0 \{\
-. tm Usage: .Li literal ... \\*(Pu
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage .Li argument ... \\*(Pu (#\\n(.c)
+. el \{\
+. ds mN Li
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
. \}
-.el \{\
-. ds sV \\*(lI
+.\}
+.if \\n(aC>\\n(aP \{\
+. as b1 \\*(lI
+. nr aP \\n(aP+1
. nr cF \\n(.f
-. ie "\\*(iM"" .ds f1 \&\\*(sV
-. el .as f1 \&\\*(sV
-. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. ft \\n(cF
+. nr cZ \\n(.s
+. nR
.\}
..
-.\" If in nroff or any other case where the default font
-.\" is constant width, and literal means zilch, single quote instead.
-.ie n \{\
-.de Ql
-. ie \\n(.$==0 \{\
-. tm Usage: .Ql literal ... \\*(Pu
-. \}
+.\" NS Or macro - Pipe symbol (OR)
+.de Or
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .Or ... \\*(Pu (#\\n(.c)
. el \{\
-. Sq \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. ds mN Or
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
. \}
-..
.\}
-.el \{\
-.de Ql
-. ie \\n(.$==0 \{\
-. tm Usage: .Ql literal ... \\*(Pu
-. \}
+.if \\n(aC>\\n(aP \{\
+. as b1 \\*(iC
+. nr aP \\n(aP+1
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. nR
+.\}
+..
+.\" NS Ms macro - Math symbol
+.de Ms
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .Ms Math symbol ... \\*(Pu (#\\n(.c)
. el \{\
-. Li \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. ds mN Ms
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
. \}
-..
.\}
-.\"
+.if \\n(aC>\\n(aP \{\
+. as b1 \\*(sY
+. nr aP \\n(aP+1
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. nR
+.\}
+..
+.\" NS Nm macro - Name of command or page topic
+.\" NS n1 string - save first invocation of .Nm
+.\" NS iS register - indent second command line in a synopsis
.de Nm
-.ie \\n(.$==0 \{\
-. if "\\*(n1"" .tm Usage: .Nm Name(s) ... \\*(Pu
-. ie !"\\*(iM"" .as f1 \&\\*(nM\\*(n1\\$1\fP
-. el \&\\*(nM\\*(n1\\$1\fP
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 \{\
+. ie "\\*(n1"" .tm Usage: .Nm Name(s) ... \\*(Pu (#\\n(.c)
+. el \&\\*(nM\\*(n1\fP\s0
+. \}
+. el \{\
+. ds mN Nm
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
+. \}
.\}
-.el \{\
-. ds sV \\*(nM
-. nr cF \\n(.f
-. if \\n(nS \{\
-. rs
-. in -\\n(iSu
-. ie \\n(nS>1 .br
+.if \\n(aC>0 \{\
+. ie \\n(aC==\\n(aP \{\
+. as b1 \&\\*(nM\\*(n1\fP\s0
+. aZ
+. \}
+. el \{\
+. as b1 \\*(nM
+. nr aP \\n(aP+1
+. ie \\n(C\\n(aP==1 \{\
+. as b1 \&\\*(n1\fP\s0
+. \\*(A\\n(aP
+. \}
. el \{\
-. sW \\$1
-. nr iS ((\\n(sW+1)*\\n(fW)u
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. if \\n(nS \{\
+. if "\\*(mN"Nm" \{\
+. rs
+. in -\\n(iSu
+. ie \\n(nS>1 .br
+. el \{\
+. if \\n(iS==0 \{\
+. sw \\$1
+. nr iS ((\\n(sWu+1)*\\n(fW)u
+. \}
+. \}
+. in +\\n(iSu
+. ti -\\n(iSu
+. nr nS \\n(nS+1
+. \}
+. \}
+. if "\\*(n1"" .ds n1 \\*(A\\n(aP
+. nR
. \}
-. in +\\n(iSu
-. ti -\\n(iSu
-. nr nS \\n(nS+1
. \}
-. if "\\*(n1"" .ds n1 \\$1
-. ie "\\*(iM"" .ds f1 \&\\*(sV
-. el .as f1 \&\\*(sV
-. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. ft \\n(cF
.\}
..
-.\"
+.\" NS Pa macro - Pathname
.de Pa
-.ie \\n(.$==0 \{\
-\&\\*(pA~\fP
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 \&\\*(pA~\fP\s0
+. el \{\
+. ds mN Pa
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
.\}
-.el \{\
-. ds sV \\*(pA
+.if \\n(aC>\\n(aP \{\
+. as b1 \\*(pA
+. nr aP \\n(aP+1
. nr cF \\n(.f
-. ie "\\*(iM"" .ds f1 \&\\*(sV
-. el .as f1 \&\\*(sV
-. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. ft \\n(cF
+. nr cZ \\n(.s
+. nR
.\}
..
-.\"
+.\" NS Sy macro - Symbolics
.de Sy
-.ie \\n(.$==0 \{\
-. tm Usage: .Sy Symbolic Text ... \\*(Pu
-. \}
-.el \{\
-. ds sV \\*(sY
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .Sy symbolic_text ... \\*(Pu (#\\n(.c)
+. el \{\
+. ds mN Sy
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
+. \}
+.\}
+.if \\n(aC>\\n(aP \{\
+. as b1 \\*(sY
+. nr aP \\n(aP+1
. nr cF \\n(.f
-. ie "\\*(iM"" .ds f1 \&\\*(sV
-. el .as f1 \&\\*(sV
-. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. ft \\n(cF
+. nr cZ \\n(.s
+. nR
.\}
..
-.\"
-.de Ms
-.ie \\n(.$==0 \{\
-. tm Usage: .Ms Math Symbol ... \\*(Pu
-. \}
-.el \{\
-. ds sV \\*(sY
+.\" NS Tn macro - Trade Name Macro
+.de Tn
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .Tn Trade_name(s) ... \\*(Pu (#\\n(.c)
+. el \{\
+. ds mN Tn
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
+.\}
+.if \\n(aC>\\n(aP \{\
+. as b1 \\*(tN\\*(tF
+. nr aP \\n(aP+1
. nr cF \\n(.f
-. ie "\\*(iM"" .ds f1 \&\\*(sV
-. el .as f1 \&\\*(sV
-. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. ft \\n(cF
+. nr cZ \\n(.s
+. nR
.\}
..
-.\"
+.\" NS nN macro - Trade Name Macro for inside of reference
+.de nN
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .Tn Trade_name(s) ... \\*(Pu (#\\n(.c)
+. el \{\
+. ds mN Tn
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
+.\}
+.if \\n(aC>\\n(aP \{\
+. as b1 \\*(tN
+. nr aP \\n(aP+1
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. rR
+.\}
+..
+.\" NS Va macro - variable name macro
.de Va
-.ie \\n(.$==0 \{\
-. tm Usage: .Va variable_name(s) ... \\*(Pu
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .Va variable_name(s) ... \\*(Pu (#\\n(.c)
+. el \{\
+. ds mN Va
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
.\}
-.el \{\
-. ds sV \\*(vA
+.if \\n(aC>\\n(aP \{\
+. as b1 \\*(vA
+. nr aP \\n(aP+1
. nr cF \\n(.f
-. ie "\\*(iM"" .ds f1 \&\\*(sV
-. el .as f1 \&\\*(sV
-. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. ft \\n(cF
+. nr cZ \\n(.s
+. nR
.\}
..
.\"
-.de nB
-.hy 0
-.if \\n(.$==0 .tm Usage error: called with empty arguments (empty quotes)?
-.ie \\n(.$>1 \{\
-. rZ \\$1
-. ie \\n(rZ .as f1 \&\f\\n(cF\\$1\fP
-. el .as f1 \&\\$1
-. rZ \\$2
-. if !\\n(rZ \{\
-. ie !"\\*(iM""\{\
-.\" I surrender
-. if "\\*(iM"Tp" .as f1 \&\ \&
-. if "\\*(iM"Dp" .as f1 \&\ \&
-. if "\\*(iM"Op" .as f1 \&\ \&
-. if "\\*(iM"Cx" .as f1 \&\ \&
-. if "\\*(iM"Dq" .as f1 \& \&
-. if "\\*(iM"Sq" .as f1 \& \&
-. if "\\*(iM"Pq" .as f1 \& \&
-. if "\\*(iM"Aq" .as f1 \& \&
-. \}
-. el .as f1 \& \&
-. \}
-. nB \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.\" NS No macro - Normal text macro (default text style if mess up)
+.de No
+.as b1 \\*(nO
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .No must be called with arguments (#\\n(.c)
+. el \{\
+. ds mN No
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
+.\}
+.if \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. ie \\n(C\\n(aP==1 \{\
+. \\*(A\\n(aP
+. \}
+. el \{\
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. nR
+. \}
+.\}
+..
+.\"------------------------------------------------------------------------
+.\" NS Op macro - Option Expression
+.de Op
+.if \\n(aC==0 \{\
+. ds mN Op
+.\}
+.\" .ds qL \&\\*(lO
+.\" .ds qR \&\\*(rO
+.ds qL \&\\*(lB
+.ds qR \&\\*(rB
+.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
+..
+.\" NS Aq macro - Enclose string in angle brackets
+.de Aq
+.if \\n(aC==0 .ds mN Aq
+.ds qL \&<
+.ds qR \&>
+.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Bq macro - Enclose string in square brackets
+.de Bq
+.if \\n(aC==0 .ds mN Bq
+.ds qL \&\\*(lB
+.ds qR \&\\*(rB
+.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Dq macro - Enclose string in double quotes
+.de Dq
+.if \\n(aC==0 .ds mN Dq
+.ds qL \&\\*(Lq
+.ds qR \&\\*(Rq
+.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Eq macro - Enclose string in double quotes
+.de Eq
+.if \\n(aC==0 .ds mN Eq
+.ds qL \\$1
+.ds qR \\$2
+.En \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Pq macro - Enclose string in parenthesis
+.de Pq
+.if \\n(aC==0 .ds mN Pq
+.ds qL \&\\*(lP
+.ds qR \&\\*(rP
+.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Ql macro - Quoted literal is in file mdoc-[dit|n|g]roff (too large
+.\" an if-else to carry along recursively for `if n ...')
+.\"
+.\" NS Sq macro - Enclose string in single quotes
+.de Qq
+.if \\n(aC==0 .ds mN Qq
+.ds qL \&\\*q
+.ds qR \&\\*q
+.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Sq macro - Enclose string in single quotes
+.de Sq
+.if \\n(aC==0 .ds mN Sq
+.ds qL \&\\*(sL
+.ds qR \&\\*(sR
+.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\"
+.\" NS Es macro - Set up strings for .En call
+.de Es
+.if \\n(aC==0 \{\
+. ie \\n(.$>2 .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. el \{\
+. ds qL \\$1
+. ds qR \\$2
+. \}
+.\}
+.if \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. ds qL \\*(A\\n(aP
+. nr aP \\n(aP+1
+. ds qR \\*(A\\n(aP
+. ie \\n(aC>\\n(aP .c\\n(C\\n(aP
+. el .aZ
+.\}
+..
+.\" .tm En beg arg(A[\\n(aP])==\\*(A\\n(aP;
+.\" .tm En oM==\\n(oM; dZ==\\n(dZ; Xt==\\n(Xt; aC==\\n(aC
+.\" NS En macro - Enclose string with given args (eg [ and ] etc)
+.\" NS qL string variable set by calling macro
+.\" NS qR string variable set by calling macro
+.\" NS aJ register (for vR)
+.de En
+.ie \\n(aC==0 \{\
+. ie \\n(.$==0 \{\
+. as b1 \&\\*(qL\\*(qR
+. pB
+. \}
+. el \{\
+.\". as mN (En)
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. as b1 \&\\*(qL
+. \}
.\}
.el \{\
-. rZ \\$1
-. ie \\n(rZ .as f1 \&\f\\n(cF\\$1
-. el .as f1 \&\\$1\f\\n(cF
-. if "\\*(iM"" \{\&\\*(f1
-. ds f1
+. as b1 \&\\*(qL
+.\}
+.if \\n(aC>0 \{\
+. ie (\\n(aC-\\n(aP)==0 \{\
+. as b1 \&\\*(qR
+. aZ
+. \}
+. el \{\
+. ie \\n(C\\n(aC==3 \{\
+. nr aJ \\n(aC-1
+. vR
+. nr aJ \\n(aJ+1
+. ds A\\n(aJ \&\\*(qR\\*(A\\n(aJ
+. nr aJ 0
+. \}
+. el .aI \&\\*(qR 3
+. nr aP \\n(aP+1
+. if \\n(C\\n(aP==1 .\\*(A\\n(aP
+. if \\n(C\\n(aP>1 \{\
+. nr aP \\n(aP-1
+. No
+. \}
. \}
-. hy
.\}
..
-.de fB
-.hy 0
-.if \\n(.$==0 .tm Usage error: called with empty arguments (empty quotes)?
-.ie \\n(.$>1 \{\
-. rZ \\$1
-. ie \\n(rZ .as f1 \&\f\\n(cF\\$1\fP
+.\" NS vR macro - vector routine (for En, trace backwards past trail punct)
+.de vR
+.if \\n(C\\n(aJ==3 \{\
+. nr aJ \\n(aJ-1
+. vR
+.\}
+..
+.\"------------------------------------------------------------------------
+.\" NS Ao macro - Angle open
+.de Ao
+.if \\n(aC==0 .ds mN Ao
+.ds qL \&<
+.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Ac macro - Angle close
+.de Ac
+.if \\n(aC==0 .ds mN Ac
+.ds qR \&>
+.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Bo macro - Bracket open
+.de Bo
+.if \\n(aC==0 .ds mN Bo
+.ds qL \&[
+.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Bc macro - Bracket close
+.de Bc
+.if \\n(aC==0 .ds mN Bc
+.ds qR \&]
+.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Do macro - Double Quote open
+.de Do
+.if \\n(aC==0 .ds mN Do
+.ds qL \&\\*(Lq
+.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Dc macro - Double Quote close
+.de Dc
+.if \\n(aC==0 .ds mN Dc
+.ds qR \&\\*(Rq
+.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Eo macro - Enclose open
+.de Eo
+.if \\n(aC==0 .ds mN Eo
+.ds qL \\$1
+.eO \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Ec macro - Enclose close
+.de Ec
+.if \\n(aC==0 .ds mN Ec
+.ds qR \\$1
+.eC \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Oo macro - Option open
+.de Oo
+.if \\n(aC==0 .ds mN Oo
+.ds qL \&[
+.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Oc macro - Option close
+.de Oc
+.if \\n(aC==0 .ds mN Oc
+.ds qR \&]
+.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Po macro - Parenthesis open
+.de Po
+.if \\n(aC==0 .ds mN Po
+.ds qL \&(
+.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Pc macro - Parenthesis close
+.de Pc
+.if \\n(aC==0 .ds mN Pc
+.ds qR \&)
+.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Qo macro - Straight Double Quote open
+.de Qo
+.if \\n(aC==0 .ds mN Qo
+.ds qL \&\\*q
+.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Qc macro - Straight Double Quote close
+.de Qc
+.if \\n(aC==0 .ds mN Qc
+.ds qR \&\\*q
+.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS So macro - Single Quote open
+.de So
+.if \\n(aC==0 .ds mN So
+.ds qL \&\\*(sL
+.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Sc macro - Single Quote close
+.de Sc
+.if \\n(aC==0 .ds mN Sc
+.ds qR \&\\*(sR
+.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Xo macro - Extend open (continue)
+.de Xo
+.if \\n(aC==0 .ds mN Xo
+.\" .nr mN 1
+.ds qL
+.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Xe macro - Extend close (end)
+.de Xc
+.\" .nr mN 0
+.if \\n(aC==0 .ds mN Xc
+.ds qR
+.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS eO macro - enclose string open
+.\" NS oM register (extension possible)
+.de eO
+.nr oM \\n(oM+1
+.\" .tm eO last arg==A[\\n(aC]==\\*(A\\n(aC; aP==\\n(aP; oM==\\n(oM; dZ==\\n(dZ;
+.ie \\n(aC==0 \{\
+. ie \\n(.$>0 \{\
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. as b1 \\*(qL
+. \}
. el \{\
-. ie "\\$1"-" .as f1 \&\-\-
-. el .as f1 \&\-\\$1
-. \}
-. rZ \\$2
-. if !\\n(rZ \{\
-. ie !"\\*(iM""\{\
-.\" I surrender
-. if "\\*(iM"Tp" .as f1 \&\ \&
-. if "\\*(iM"Dp" .as f1 \&\ \&
-. if "\\*(iM"Op" .as f1 \&\ \&
-. if "\\*(iM"Cx" .as f1 \&\ \&
-. if "\\*(iM"Dq" .as f1 \& \&
-. if "\\*(iM"Sq" .as f1 \& \&
-. if "\\*(iM"Pq" .as f1 \& \&
-. if "\\*(iM"Aq" .as f1 \& \&
-. \}
-. el .as f1 \& \&
+. as b1 \\*(qL
+. if (\\n(dZ==0)&(\\n(sM==1) \{\
+. nr dZ \\n(dZ+1
+. ds b2 \\*(b1
+. ds b1
+. nr lK \\n(.c
+. ev 2
+. fi
+. di eB
+. \}
. \}
-. fB \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
.\}
.el \{\
-. rZ \\$1
-. ie \\n(rZ .as f1 \&\f\\n(cF\\$1
-. el \{\
-. ie "\\$1"-" .as f1 \&\-\-\f\\n(cF
-. el .as f1 \&\-\\$1\f\\n(cF
+. as b1 \\*(qL
+.\}
+.ie \\n(aC>0 \{\
+. if \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. ie \\n(C\\n(aP==1 .\\*(A\\n(aP
+. el \{\
+. nr aP \\n(aP-1
+. No
+. \}
. \}
-. if "\\*(iM"" \{\&\\*(f1
-. ds f1
+. if \\n(aC==\\n(aP \{\
+. if \\n(tP==1 \{\
+.\" .tm SETTING Xt!!!
+. nr Xt 1
+. \}
+.\".\" . ds S0
+.\"CHANGED ds S0 \\*(iV
+. aY
. \}
-. hy
+.\}
+.el \{\
+. if \\n(oM>1 .as b1 \\*(sV
.\}
..
.\"
-.\" Single quoted Items
-.\" eF, sB g[0-9] and f2
-.de Sq
-.nr eF 0
-.ie \\n(.$==0 \{\
-. ie "\\*(iM"" \&\\*(sL\&\\*sR
-. el .as f1 \&\\*(sL\&\\*(sR
+.\" NS eC macro - enclose string close
+.\" NS aa local register
+.de eC
+.nr oM \\n(oM-1
+.\" tm eC last arg==A[\\n(aC]==\\*(A\\n(aC; aP==\\n(aP; oM==\\n(oM; dZ==\\n(dZ;
+.as b1 \\*(qR
+.if \\n(aC==0 \{\
+. ie \\n(.$>0 \{\
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
+. el \{\
+. ie "\\*(xB"" \{\
+. pB
+. \}
+. el \{\
+. pB
+.\\*(L\\n(lC
+. nr Xt 0
+. ds xB
+. \}
+. \}
.\}
-.el \{\
-. ie "\\*(iM"" \{\
-. ds f1 \&\\*(sL
-. ds iM Sq
-. \}
-. el .as f1 \&\\*(sL
-. sB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. ie \\n(eF>0 .\\*(g1 \\*(g2 \\*(g3 \\*(g4 \\*(g5 \\*(g6 \\*(g7 \\*(g8
-. el .as f1 \\*(g0
-. as f1 \\*(sR
-. if !"\\*(f2"" .as f1 \\*(f2
-. if "\\*(iM"Sq" \{\
-\&\\*(f1
-. ds f1
-. ds iM
-. \}
-. ds f2
-. rm g0 g1 g2 g3 g4 g5 g6 g7 g8 g9
-. nr eF 0
+.if \\n(aC>0 \{\
+. ie \\n(aC==\\n(aP \{\
+. ie \\n(oM==0 \{\
+. aZ
+. \}
+. el .aY
+. \}
+. el \{\
+. nr aa \\n(aP+1
+. if \\n(C\\n(aa==2 .as b1 \\*(S\\n(aC
+.\" tm CURRENT arg (aP==\\*(A\\n(aP and ap+1==\\*(A\\n(aa) tP==\\n(tP Xt==\\n(Xt
+. rr aa
+. if \\n(tP>0 \{\
+.\" tm UNSETTING Xt==\\n(Xt!!!!
+. if \\n(Xt>0 .nr Xt \\n(Xt-1
+.\" tm NOW Xt==\\n(Xt!!!!
+. \}
+. No
+. \}
.\}
..
-.\"
-.\" Double quoted Items
-.de Dq
-.nr Ef 0
-.ie \\n(.$==0 \{\
-. ie "\\*(iM"" \&\\*(Lq\&\\*(Rq
-. el .as f1 \&\\*(Lq\&\\*(Rq
+.\"------------------------------------------------------------------------
+.\" NS Pf macro - Prefix (calls .pF)
+.de Pf
+.if \\n(aC==0 .ds mN Pf
+.ds qL \&\\$1
+.pF \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS pF macro - Prefix (for prefixing open quotes, brackets etc)
+.de pF
+.ie \\n(aC==0 \{\
+. as b1 \&\\*(qL
+. ie \\n(.$<2 \{\
+. tm Warning: Missing arguments - prefix .Pf)
+. pB
+. \}
+. el .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
.\}
.el \{\
-. ie "\\*(iM"" \{\
-. ds f1 \&\\*(Lq
-. ds iM Dq
-. \}
-. el .as f1 \&\\*(Lq
-. Sb \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. ie \\n(Ef>0 .\\*(k1 \\*(k2 \\*(k3 \\*(k4 \\*(k5 \\*(k6 \\*(k7 \\*(k8
-. el .as f1 \\*(k0
-. as f1 \\*(Rq
-. if !"\\*(f4"" .as f1 \\*(f4
-. if "\\*(iM"Dq" \{\
-\&\\*(f1
-. ds f1
-. ds iM
-. \}
-. ds f4
-. rm k0 k1 k2 k3 k4 k5 k6 k7 k8 k9
-. nr Ef 0
+. ie (\\n(aC-\\n(aP)>1 \{\
+. nr aP \\n(aP+1
+. as b1 \&\\*(A\\n(aP
+. \}
+. el .tm Warning: .Pf: trailing prefix (#\\n(.c)
+.\}
+.if \\n(aC>0 \{\
+. ie (\\n(aC-\\n(aP)==0 .aZ
+. el \{\
+. nr aP \\n(aP+1
+. c\\n(C\\n(aP
+. \}
.\}
..
-.\"
-.\" Parenthesis quoted Items
-.de Pq
-.nr pQ 0
-.ie \\n(.$==0 \{\
-. ie "\\*(iM"" \&(\&)
-. el .as f1 \&(\&)
+.\" NS Ns macro - remove space (space remove done by .aV or .fV)
+.de Ns
+.if \\n(aC==0 \{\
+. ds mN Ns
+. ie \\n(.$>0 .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. el .tm Usage: .Ns must be called with arguments (#\\n(.c)
+.\}
+.No
+..
+.de Ap
+.if \\n(aC==0 \{\
+. ds mN Ap
+. tm Usage: Ap "cannot be first request on a line (no .Ap)" (#\\n(.c)
+.\}
+.as b1 \&'
+.No
+..
+.\" NS Hv macro - Hard (unpaddable) Space vector
+.\" NS iV string inter-vector space
+.\" NS sV string inter-argument space
+.de Hv
+.ds iV \\*(sV
+.ds sV \\*(hV
+..
+.\" NS Sv macro - Soft Space vector (troff limitation)
+.de Sv
+.ds sV \\*(iV
+..
+.\" NS Tv macro - Tab Space vector
+.de Tv
+.ds sV \\*(tV
+..
+.\" NS Sm macro - Space mode
+.\" NS sM register - default is one (space mode on)
+.nr sM 1
+.de Sm
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm "Usage: .Sm [off | on]" (#\\n(.c)
+. el \{\
+. ds mN Sm
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
+.\}
+.if \\n(aC>0 \{\
+. nr aP \\n(aP+1
+. if "\\*(A\\n(aP"on" \{\
+. ds sV \\*(iV
+. nr sM 1
+. \}
+. if "\\*(A\\n(aP"off" \{\
+. ds sV
+. rm S0 S1 S2 S3 S4 S5 S6 S7 S8 S9
+. nr sM 0
+. \}
+. ie \\n(aC>\\n(aP \{\
+. No
+. \}
+. el .aY
+.\}
+..
+.\"------------------------------------------------------------------------
+.\" Size and Argument type macros
+.\" NS aT macro - argument type
+.\" NS aU macro - argument type (same as .aT but uses A[1-9] strings
+.\" NS aT register argument type
+.if \n(.g \{\
+.de aT
+.nr aT 0
+.ie \\n(sW>2:(\A'\\$1'==0) \{\
+. nr aT 2
.\}
.el \{\
-. ie "\\*(iM"" \{\
-. ds f1 \&(
-. ds iM Pq
-. \}
-. el .as f1 \&(
-. pB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. ie \\n(pQ>0 .\\*(y1 \\*(y2 \\*(y3 \\*(y4 \\*(y5 \\*(y6 \\*(y7 \\*(y8
-. el .as f1 \\*(y0
-. as f1 \&)
-. if !"\\*(f3"" .as f1 \\*(f3
-. if "\\*(iM"Pq" \{\
-\&\\*(f1
-. ds f1
-. ds iM
-. \}
-. ds f3
-. rm y0 y1 y2 y3 y4 y5 y6 y7 y8 y9
-. nr pQ 0
+. if \\n(sW==1 \{\
+. ie \\n(z\\$1>2 \{\
+. nr aT \\n(z\\$1
+. \}
+. el .nr aT 2
+. \}
+. if \\n(sW==2 \{\
+. ie \\n(\\$1 \{\
+. nr aT 1
+. \}
+. el .nr aT 2
+. \}
.\}
..
-.\" eF, sB g[0-9] and f2
-.de sB
-.hy 0
-.ie \\n(.$==0 .tm Sick Logic: macro sB
+.de aU
+.nr aT 0
+.aW \\$1
+.ie \\n(sW>2:(\A'\\*(A\\$1'==0) .nr aT 2
.el \{\
-. ie \\n(eF>=1 .nr eF \\n(eF+1
-. el \{\
-. mN \\$1
-. if \\n(mN .nr eF \\n(eF+1
+. if \\n(sW==1 \{\
+. ie \\n(z\\*(A\\$1>2 \{\
+. nr aT \\n(z\\*(A\\$1
+. \}
+. el .nr aT 2
. \}
-. rZ \\$1
-. ie \\n(rZ .as f2 \\$1
-. el \{\
-. ie \\n(eF<1 .as g\\n(eF \\$1
-. el .as g\\n(eF \\$1
-. \}
-. if \\n(.$>1 \{\
-. rZ \\$2
-. if \\n(rZ==0 \{\
-. if \\n(eF<1 \{\
-. as g\\n(eF \& \&
-. \}
+. if \\n(sW==2 \{\
+. ie (\\n(\\*(A\\$1) \{\
+. nr aT 1
. \}
-. sB \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. el .nr aT 2
. \}
.\}
..
-.de Sb
-.hy 0
-.ie \\n(.$==0 .tm Sick Logic: macro Sb
+.\}
+.if !\n(.g \{\
+.de aT
+.nr aT 0
+.ie \\n(sW>2 \{\
+. nr aT 2
+.\}
.el \{\
-. ie \\n(Ef>=1 .nr Ef \\n(Ef+1
-. el \{\
-. mN \\$1
-. if \\n(mN .nr Ef \\n(Ef+1
+. if \\n(sW==1 \{\
+. ie \\n(z\\$1>2 \{\
+. nr aT \\n(z\\$1
+. \}
+. el .nr aT 2
+. \}
+. if \\n(sW==2 \{\
+. ie \\n(\\$1 \{\
+. nr aT 1
+. \}
+. el .nr aT 2
. \}
-. rZ \\$1
-. ie \\n(rZ .as f4 \\$1
-. el \{\
-. ie \\n(Ef<1 .as k\\n(Ef \\$1
-. el .as k\\n(Ef \\$1
-. \}
-. if \\n(.$>1 \{\
-. rZ \\$2
-. if \\n(rZ==0 \{\
-. if \\n(Ef<1 \{\
-. as k\\n(Ef \& \&
-. \}
-. \}
-. Sb \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. \}
.\}
..
-.de pB
-.hy 0
-.ie \\n(.$==0 .tm Sick Logic: macro pB
+.de aU
+.nr aT 0
+.aW \\$1
+.ie \\n(sW>2 .nr aT 2
.el \{\
-. ie \\n(pQ>=1 .nr pQ \\n(pQ+1
-. el \{\
-. mN \\$1
-. if \\n(mN .nr pQ \\n(pQ+1
-. \}
-. rZ \\$1
-. ie \\n(rZ .as f3 \\$1
-. el \{\
-. ie \\n(pQ<1 .as y\\n(pQ \\$1
-. el .as y\\n(pQ \\$1
-. \}
-. if \\n(.$>1 \{\
-. rZ \\$2
-. if \\n(rZ==0 \{\
-. if \\n(pQ<1 \{\
-. as y\\n(pQ \& \&
-. \}
-. \}
-. pB \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. \}
+. if \\n(sW==1 \{\
+. ie \\n(z\\*(A\\$1>2 \{\
+. nr aT \\n(z\\*(A\\$1
+. \}
+. el .nr aT 2
+. \}
+. if \\n(sW==2 \{\
+. ie (\\n(\\*(A\\$1) \{\
+. nr aT 1
+. \}
+. el .nr aT 2
+. \}
.\}
..
-.de aQ
-.hy 0
-.ie \\n(.$==0 .tm Bad Syntax: .Aq
+.\}
+.\" NS s1 macro - set spacing for class type 1
+.\" NS s2 macro - set spacing for class type 2
+.\" NS s3 macro - set spacing for class type 3
+.\" NS s1 macro - set spacing for class type 1
+.\" NS s2 macro - set spacing for class type 2
+.\" NS s3 macro - set spacing for class type 3
+.\" NS s4 macro - set spacing for class type 4
+.\" NS S[0-9] string spacing
+.\" NS xX local register
+.\" NS aa local register
+.de s0
+.tm MDOC-ERROR: bogus type 0 (can't set space '\\*(A\\n(aC') (#\\n(.c)
+..
+.de s1
+.if \\n(\\*(A\\n(aC==3 \{\
+. nr xX \\n(aC-1
+. rm S\\n(xX
+. ds S\\n(aC \\*(sV
+.\}
+.if \\n(\\*(A\\n(aC==2 \{\
+. nr xX \\n(aC-1
+.\" this kludge can probably go away, but need to double check first
+. ie "\\*(A\\n(aC"Nb" .ds S\\n(xX \\*(hV
+. el .rm S\\n(xX
+.\}
+..
+.de s2
+.ds S\\n(aC \\*(sV
+..
+.de s3
+.if \\n(aC>1 \{\
+. nr xX \\n(aC-1
+. rm S\\n(xX
+.\}
+.ds S\\n(aC \\*(sV
+..
+.de s4
+.nr aa 0
+..
+.\" Class switches (on current argument aP)
+.\" NS c0 macro - catch errors (non-existent class type 0)
+.\" NS c1 macro - call request if type 1
+.\" NS c2 macro - call .No if type 2
+.\" NS c3 macro - call .No if type 3
+.\" NS c4 macro - call .No if type 4
+.de c0
+.tm MDOC-ERROR: bogus class 0 (can't determine '\\*(A\\n(aC') (#\\n(.c)
+..
+.de c1
+.\\*(A\\n(aP
+..
+.de c2
+.nr aP \\n(aP-1
+.No
+..
+.de c3
+.nr aP \\n(aP-1
+.No
+..
+.de c4
+.nr aP \\n(aP-1
+.No
+..
+.\" NS y1 macro - ignore if class 1
+.\" NS y2 macro - ignore if class 2
+.\" NS y3 macro - append if type 3
+.\" NS y4 macro - append if type 4
+.de y1
+.nr aa 1
+..
+.de y2
+.nr aa 1
+..
+.de y3
+.as b1 \\*(A\\n(aP
+.nr aP \\n(aP+1
+.n\\C\\n(aP
+..
+.de y4
+.as b1 \\*(A\\n(aP
+.nr aP \\n(aP+1
+.n\\C\\n(aP
+..
+.\"--------------------------------------------------------------------------
+.\" Ns Bf macro - Begin Font Mode (will be begin-mode/end-mode in groff & TeX)
+.\" Ns Ef macro - End Font Mode
+.de Bf
+.ds mN Bf
+.ie \\n(.$>0 \{\
+. nr bF \\n(.f
+. nr bZ \\n(.s
+. if "\\$1"Em" \&\\*(eM\c
+. if "\\$1"Li" \&\\*(lI\c
+. if "\\$1"Sy" \&\\*(sY\c
+. if "\\$1"-emphasis" \&\\*(eM\c
+. if "\\$1"-literal" \&\\*(lI\c
+. if "\\$1"-symbolic" \&\\*(sY\c
+.\}
+.el .tm Usage .Bf [Em | emphasis | Li | literal | Sy | symbolic] (#\\n(.c)
+..
+.de Ef
+.ds mN Ef
+.ie \\n(.$>0 .tm Usage .Ef (does not take arguments) (#\\n(.c)
+.el \&\f\\n(bF\s\\n(bZ
+..
+.\" Ns Bk macro - Begin Keep
+.\" Ns Ek macro - End Keep
+.\" Ns kS string - keep type
+.de Bk
+.ds mN Bk
+.ie \\n(.$==0 \{\
+.tm Usage: .Bk [-lines | -words] (#\\n(.c)
+.\}
.el \{\
-. ie \\n(aQ>=1 .nr aQ \\n(aQ+1
-. el \{\
-. mN \\$1
-. if \\n(mN .nr aQ \\n(aQ+1
-. \}
-. rZ \\$1
-. ie \\n(rZ .as aZ \\$1
-. el \{\
-. ie \\n(aQ<1 .as a\\n(aQ \\$1
-. el .as a\\n(aQ \\$1
-. \}
-. if \\n(.$>1 \{\
-. rZ \\$2
-. if \\n(rZ==0 \{\
-. if \\n(aQ<1 \{\
-. as a\\n(aQ \& \&
-. \}
-. \}
-. aQ \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. \}
+. if !"\\*(kS"" .tm .Bk: nesting keeps not implemented yet. (#\\n(.c)
+. if "\\$1"-lines" .tm .Bd -lines: Not implemented yet. (#\\n(.c)
+. if "\\$1"-words" .Hv
+. ds kS \\$1
.\}
..
-.\" Angle Bracket Quoted Items
-.de Aq
-.nr aQ 0
+.de Ek
+.ds mN Ek
+.ie \\n(.$>0 .tm Usage .Ek (does not take arguments) (#\\n(.c)
+.el \{\
+. if "\\*(kS"-lines" .tm .Bd -lines: Not implemented yet. (#\\n(.c)
+. if "\\*(kS"-words" .Sv
+. rm kS
+.\}
+..
+.\" NS Bd macro - Begin Display display-type [offset string]
+.\" NS Ed macro - end Display
+.\" NS O[0-9] registers - stack of indent
+.\" NS d[0-9] registers - display-type stack
+.de Bd
+.ds mN Bd
.ie \\n(.$==0 \{\
-. ie "\\*(iM"" \&<\&>
-. el .as f1 \&<\&>
+.tm Usage: .Bd [-literal | -filled | -ragged | -unfilled] [-offset [string]] [-compact] (#\\n(.c)
.\}
.el \{\
-. ie "\\*(iM"" \{\
-. ds f1 \&<
-. ds iM Aq
+. ds aa
+. nr bV 0
+. nr iD 0
+. nr dP \\n(dP+1
+. if "\\$1"-literal" \{\
+. nr iD \\n(iD+1
+. ds d\\n(dP dL
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. ie t \{\&\\*(lI
+' ta 9n 18n 27n 36n 45n 54n 63n 72n
+. \}
+. el \{\
+' ta 8n 16n 24n 32n 40n 48n 56n 64n 72n
+. \}
+. nf
. \}
-. el .as f1 \&<
-. aQ \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
-. ie \\n(aQ>0 .\\*(a1 \\*(a2 \\*(a3 \\*(a4 \\*(a5 \\*(a6 \\*(a7 \\*(a8
-. el .as f1 \\*(a0
-. as f1 \&>
-. if !"\\*(aZ"" .as f1 \\*(aZ
-. if "\\*(iM"Aq" \{\
-\&\\*(f1
-. ds f1
-. ds iM
+. if "\\$1"-filled" \{\
+. nr iD \\n(iD+1
+. ds d\\n(dP dF
+. br
+. \}
+. if "\\$1"-ragged" \{\
+. nr iD \\n(iD+1
+. ds d\\n(dP dR
+. na
. \}
-. ds aZ
-. rm a0 a1 a2 a3 a4 a5 a6 a7 a8
-. nr aQ 0
+. if "\\$1"-unfilled" \{\
+. nr iD \\n(iD+1
+. ds d\\n(dP dU
+. nf
+. \}
+.\" .tm Here is argc: \\n(.$ and here is iD \\n(iD
+. if ((\\n(iD>=1)&(\\n(.$>\\n(iD)) \{\
+. bV \\$2 \\$3 \\$4
+. \}
+. if \\n(O\\n(dP>0 'in \\n(.iu+\\n(O\\n(dPu
+. if (\\n(bV==0) \{\
+. if (\\n(nS==0) \{\
+. ie "\\*(d\\n(dP"dR" .sp \\n(dVu
+. el 'sp \\n(dVu
+. \}
+. \}
+. if \\n(cR==0 .ne 2v
+. nr bV 0
+. nr iD 0
+.\}
+..
+.\" NS bV macro - resolve remaining .Bd arguments
+.de bV
+.\" .tm in bV with args: \\$1 \\$2 \\$3
+.nr iD 1
+.ds bY
+.if "\\$1"-offset" \{\
+. ds bY \\$2
+. if "\\*(bY"left" \{\
+. nr iD \\n(iD+1
+. nr O\\n(dP 0
+. \}
+. if "\\*(bY"right" \{\
+. nr iD \\n(iD+1
+. nr O\\n(dP (\\n(.l/3)u
+. \}
+. if "\\*(bY"center" \{\
+. nr iD \\n(iD+1
+. nr O\\n(dP (\\n(.l-\\n(.i)/4u
+. \}
+. if "\\*(bY"indent" \{\
+. nr iD \\n(iD+1
+. nr O\\n(dP \\n(dIu
+. \}
+. if "\\*(bY"indent-two" \{\
+. nr iD \\n(iD+1
+. nr O\\n(dP \\n(dIu+\\n(dIu
+. \}
+. if \\n(iD==1 \{\
+. nr iD \\n(iD+1
+. sW "\\*(bY"
+. ie \\n(sW>2 \{\
+. ie ((\\*(bY>9n)&(\\*(bY<100n)) \{\
+. nr O\\n(dP \\*(bY
+. \}
+. el .nr O\\n(dP (\\n(sW)*\\n(fWu
+. \}
+. el \{\
+. if \\n(sW==2 .aT \\*(bY
+. ie \\n(aT==1 \{\
+. nr O\\n(dP \\n(\\*(bY
+. \}
+. el .nr O\\n(dP \\*(bY
+. \}
+. \}
.\}
-..
-.\" macro Name test, return macro register value if true
-.de mN
-.nr mN 0
-.if \A'\\$1' \{\
-. sW \\$1
-. if \\n(sW==2 \{\
-. if \\n(\\$1 .nr mN \\n(\\$1
+.if "\\$1"-compact" \{\
+. nr bV 1
+.\}
+.if \\n(iD<\\n(.$ \{\
+. ie "\\*(bY"" \{\
+. bV \\$2 \\$3
+. \}
+. el \{\
+. bV \\$3
. \}
.\}
..
-.\" Punctuation test (using z registers), return 1 if true
-.de rZ
-.nr rZ 0
-.if \A'\\$1' \{\
-. sW \\$1
-. if \\n(sW==1 \{\
-. if \\n(z\\$1==1 \{\
-. nr rZ 1
+.\" NS Ed macro - end display
+.de Ed
+.ds mN Ed
+.br
+.if \\n(dP==0 .tm mdoc: Extraneous .Ed
+.if "\\*(d\\n(dP"dL" \{\
+. ft \\n(cF
+. fz \\n(cZ
+.\}
+.in \\n(.iu-\\n(O\\n(dPu
+.rr O\\n(dP
+.rm d\\n(dP
+.nr dP \\n(dP-1
+.fi
+.if t .ad
+..
+.\"--------------------------------------------------------------------------
+.\" NS Bl macro - begin list (.Bl list-type)
+.\" NS L[0-9] registers - stack of list types
+.de Bl
+.ie \\n(.$==0 \{\
+.tm Usage: .Bl [[-hang | -tag] [-width]] [ -item | -enum | -bullet | -diag] (#\\n(.c)
+.\}
+.el \{\
+. ds mN Bl
+. nr aP 0
+. nr lC \\n(lC+1
+. ds A1 \\$2
+. ds A2 \\$3
+. ds A3 \\$4
+. ds A4 \\$5
+. ds A5 \\$6
+. ds A6 \\$7
+. ds A7 \\$8
+. ds A8 \\$9
+. nr fV \\n(.$-1
+. if "\\$1"-hang" \{\
+. nr aP \\n(aP+1
+. ds L\\n(lC hL
+. nr w\\n(lC 6n
+. nr tC 1
+. \}
+. if "\\$1"-tag" \{\
+. nr aP \\n(aP+1
+. ds L\\n(lC tL
+. nr tC 1
+. \}
+. if "\\$1"-item" \{\
+. nr aP \\n(aP+1
+. ds L\\n(lC iT
+. nr tC 1
+. \}
+. if "\\$1"-enum" \{\
+. nr aP \\n(aP+1
+. ds L\\n(lC nU
+. nr w\\n(lC 3n
+. nr tC 1
+. \}
+. if "\\$1"-bullet" \{\
+. nr aP \\n(aP+1
+. ds L\\n(lC bU
+. nr w\\n(lC 2n
+. nr tC 1
+. \}
+. if "\\$1"-dash" \{\
+. nr aP \\n(aP+1
+. ds L\\n(lC hU
+. nr w\\n(lC 2n
+. nr tC 1
+. \}
+. if "\\$1"-hyphen" \{\
+. nr aP \\n(aP+1
+. ds L\\n(lC hU
+. nr w\\n(lC 2n
+. nr tC 1
+. \}
+. if "\\$1"-inset" \{\
+. nr aP \\n(aP+1
+. ds L\\n(lC lL
+. nr tC 1
+. \}
+. if "\\$1"-diag" \{\
+. nr aP \\n(aP+1
+. ds L\\n(lC mL
+. nr mL 1
+. \}
+. if "\\$1"-ohang" \{\
+. nr aP \\n(aP+1
+. ds L\\n(lC oL
+. nr tC 1
+. \}
+. if "\\$1"-column" \{\
+. nr aP \\n(aP+1
+. ds L\\n(lC cL
+. \}
+. ie \\n(aP==0 \{\
+. tm \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. tm Usage: .Bl [[-inset|-tag] -width] [-item|-enum|-bullet|-diag] (#\\n(.c)
+. \}
+. el \{\
+. tY
+. if (\\n(aP==1)&(\\n(aP<\\n(.$) \{\
+. nr aP 0
+. lV
+. if "\\*(L\\n(lC"cL" \{\
+. W\\n(wV
+. nr w\\n(lC 0
+' in -\\n(eWu
+. ie \\n(v\\n(lC==1 \{\
+. nr aa 0
+. \}
+. el \{\
+. sp \\n(dVu
+. \}
+. nf
+. nr wV 0
+. \}
. \}
. \}
+. nr aP 0
+.\" . ds b1
+. aY
+.\" .tm Here is L[\\n(lC]==\\*(L\\n(lC
.\}
..
-.\"
-.\" sW returns number of characters in a string
-.if t \{\
-.nr fW \w'\fC,'
-.de sW
-.nr sW \w'\fC\\$1'
+.if \n(.g \{\
+. nr i 10
+. while \ni<100 \{\
+. nr num!\nin 1
+. nr i +1
+. \}
.\}
-.if n \{\
-.nr fW \w'0'
-.de sW
-.nr sW \w'\\$1'
-.\}
-.ie \\n(sW>=\\n(fW \{\
-. ie \\n(sW%\\n(fW .nr sW (\\n(sW/\\n(fW)+1
-. el .nr sW \\n(sW/\\n(fW
-.\}
-.el .nr sW 0
-..
-.\" Option Expression -
-.\" TODO - add line overflow check (right!)
-.nr eP 0
-.ds e1
-.nr oE 0
-.nr hP 0
-.ds hP
-.nr Ep 0
-.de Op
-.hy 0
-.if "\\*(iM"" \{\
-. ds iM Op
-. ds f1 \&
+.\" NS lV macro - resolve remaining .Bl arguments
+.de lV
+.nr aP \\n(aP+1
+.if \\n(fV>=\\n(aP \{\
+. nr iD 0
+. if "\\*(A\\n(aP"-compact" \{\
+. nr iD 1
+. nr v\\n(lC 1
+. \}
+. if "\\*(A\\n(aP"-width" \{\
+. nr iD 1
+. nr aP \\n(aP+1
+. nr tW 1
+. ds t\\n(lC TagwidtH
+. ds tS \\*(A\\n(aP
+. aW \\n(aP
+. ie \\n(sW>2 \{\
+. nr w\\n(lC (\\n(sW)*\\n(fWu
+. if \\n(sW==3 \{\
+. ie \\n(.g \{\
+. if \A'\\*(tS' .if r num!\\*(tS \{\
+. nr w\\n(lC \\*(tS
+. \}
+. \}
+. el \{\
+. if (\\*(tS>9n)&(\\*(tS<99n) \{\
+. nr w\\n(lC \\*(tSu
+. \}
+. \}
+. \}
+. \}
+. el \{\
+. aT \\*(tS
+. ie \\n(aT==1 \{\
+. nr w\\n(lC \\n(\\*(tS
+. \}
+. el \{\
+. nr w\\n(lC \\*(tSu
+. \}
+. \}
+. \}
+. if "\\*(A\\n(aP"-offset" \{\
+. nr iD 1
+. nr aP \\n(aP+1
+. ie "\\*(A\\n(aP"indent" \{\
+. nr o\\n(lC \\n(Dsu
+. \}
+. el \{\
+. ds tS \\*(A\\n(aP
+. aW \\n(aP
+. ie \\n(sW>2 \{\
+. nr o\\n(lC (\\n(sW)*\\n(fWu
+. ie \\n(.g \{\
+. if \A'\\*(tS' .if r num!\\*(tS \{\
+. nr o\\n(lC \\*(tS
+. \}
+. \}
+. el \{\
+. if (\\*(tS>9n)&(\\*(tS<100n) \{\
+. nr o\\n(lC \\*(tS
+. \}
+. \}
+. \}
+. el \{\
+. ie \\n(C\\n(aP==1 .nr o\\n(lC \\n(\\*(tS
+. el .nr o\\n(lC \\*(tS
+. \}
+. \}
+. \}
+. if \\n(iD==0 \{\
+. if "\\*(L\\n(lC"cL" \{\
+. nr wV \\n(wV+1
+. ds A\\n(wV \\*(A\\n(aP
+. \}
+. \}
+. if \\n(fV>\\n(aP .lV
.\}
-.as f1 \&\\*(lB
-.\" .tm Op: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-.dO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-.ie !"\\$1"Cx" .oE
-.el .nr oE \\n(oE+1
..
-.\"
-.\" just for mike, with every bite of garlic in mind (oops, i mean burp).
-.\" dO: go dOwn an argument vector and test each argument to see if
-.\" a macro name or punctuation. stash in respective place along
-.\" with its arguments.
-.nr oO 0
-.nr oP 0
-.nr aO 0
-.de dO
-.mN \\$1
-.ie \\n(mN \{\
-. if \\n(oP \{\
-. if \\n(hP \{\
-. nr oZ 1
-. oZ
-. Oz
-. \}
-. if \\n(e1==1 \{\
-.\\*(e1 \\*(e2 \\*(e3 \\*(e4 \\*(e5 \\*(e6 \\*(e7 \\*(e8 \\*(e9
-. \}
-. uO
-. if !(\\n(oO:\\n(aO) .as f1 \& \&
-. \}
-. ie "\\$1"Op" \{\
-. as f1 \&\\*(lB
-. nr aO \\n(aO+1
-. \}
-. el \{\
-. nr eP \\n(eP+1
-. ds e\\n(eP \\$1
-. nr e\\n(eP 1
-. \}
+.\" NS El macro - end list
+.\" NS iD local register
+.de El
+.ie \\n(.$>0 \{\
+. tm Usage: .El (#\\n(.c)
.\}
.el \{\
-.\" .tm dO: $1: \\$1: eP \\n(eP e[\\n(eP]: \\*(e\\n(ePEE
-. rZ \\$1
-. ie \\n(rZ \{\
-.\" .tm dO:rZ: $1: \\$1: eP \\n(eP e[\\n(eP]: \\*(e\\n(eP
-. nr hP \\n(hP+1
-. ds h\\n(hP \\$1
+. ds mN El
+. nr iD 0
+. if "\\*(L\\n(lC"cL" \{\
+. nr iD 1
+. cC
. \}
-. el \{\
-.\" .tm dO:word $1: \\$1: eP \\n(eP e[\\n(eP]: \\*(e\\n(ePEE
-. if \\n(eP==0:\\n(e\\n(eP==1 .nr eP \\n(eP+1
-. if \\n(eZ .as e\\n(eP \& \&
-. as e\\n(eP " \&\\$1
-.\" . ds e\\n(eP \&\\$1
-. nr eZ \\n(eZ+1
+. if "\\*(L\\n(lC"nU" \{\
+. nr nU 0
. \}
+. if \\n(mL>0 \{\
+. nr iD 1
+. nr mL 0
+. tZ
+. nr lC \\n(lC-1
+. tY
+. \}
+. if "\\*(L\\n(lC"iT" \{\
+' in \\n(.iu-\\n(o\\n(lCu
+. tZ
+. nr lC \\n(lC-1
+. tY
+. nr iD 1
+. \}
+. if "\\*(L\\n(lC"oL" \{\
+' in \\n(.iu-\\n(o\\n(lCu
+. tZ
+. nr lC \\n(lC-1
+. tY
+. nr iD 1
+. \}
+. if "\\*(L\\n(lC"lL" \{\
+' in \\n(.iu-\\n(o\\n(lCu
+. tZ
+. nr lC \\n(lC-1
+. tY
+. nr iD 1
+. \}
+. if \\n(iD==0 \{\
+. lE
+. \}
+. br
+. nr iD 0
.\}
-.nr oP 1
-.ie \\n(.$>1 \{\
-. dO \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS It macro - list item
+.\" NS iD local register
+.\" NS aA save pA font string for section FILES (no underline if nroff)
+.de It
+.if "\\*(L\\n(lC"" \{\
+. tm Usage .Bl -list-type [-width [string] | -compact | -offset [string]] (#\\n(.c)
+. tm .It \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
.\}
-.el \{\
-. ie \\n(e1 \{\
-.\\*(e1 \\*(e2 \\*(e3 \\*(e4 \\*(e5 \\*(e6 \\*(e7 \\*(e8 \\*(e9
+.\" .tm Here is L[\\n(lC]==\\*(L\\n(lC
+.ne 3v
+.ie \\n(.$>0 \{\
+. ds mN It
+. ds b1
+. nr iD 0
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. if "\\*(L\\n(lC"mL" \{\
+. nr iD 1
+. nr aP 0
+. aX
+. \\*(L\\n(lC
. \}
-. el \{\
-. as f1 \\*(e1
+. if "\\*(L\\n(lC"cL" \{\
+. ds b1
+. nr aP 0
+. nr iD 1
+. \\*(L\\n(lC
+. \}
+. if "\\*(L\\n(lC"iT" \{\
+. nr aP 0
+. nr iD 1
+. \\*(L\\n(lC
+. \}
+. if \\n(iD==0 \{\
+. fV
+.\" tm ------------------------------------------------------------------------
+.\" tm It list-type==\\*(L\\n(lC, aP==\\n(aP
+.\" tm It beg arg(A[1])==\\*(A1; oM==\\n(oM; dZ==\\n(dZ; Xt==\\n(Xt; aC==\\n(aC
+. nr oM \\n(oM+1
+. nr tP 1
+. nr aP \\n(aP+1
+. nr tX \\n(C\\n(aP
+. ds tX \\*(A\\n(aP
+. if \\n(nF==1 \{\
+. ds aA \\*(pA
+. if n .ds pA \\*(nO
+. \}
+. ie \\n(C\\n(aP==1 \{\
+. \\*(A\\n(aP
+. \}
+. el \{\
+. nr aP \\n(aP-1
+. No
+. \}
+.\" tm in It here is b1==\\*(b1
+.\" tm It mid arg(A[1])==\\*(A1; oM==\\n(oM; dZ==\\n(dZ; Xt==\\n(Xt; aC==\\n(aC
+. ie \\n(Xt==1 .ds xB \&\\*(L\\n(lC
+. el .\\*(L\\n(lC
. \}
+. nr iD 0
.\}
+.el .\\*(L\\n(lC
..
-.\" handle old style arguments such as the arg -Idir
-.\" in adb, .Oo is a toggle.
-.de Oo
-.ie \\n(oO .nr oO 0
-.el .nr oO 1
-..
-.\" stash punctuation
-.de oZ
-.if \\n(hP>=\\n(oZ \{\
-. nr eP \\n(eP+1
-. ds e\\n(eP \\*(h\\n(oZ
-. nr oZ \\n(oZ+1
-. oZ
-.\}
-..
-.\" clean up punctuation vector
-.de Oz
-.if \\n(hP>0 \{\
-. rm h\\n(hP
-. nr hP \\n(hP-1
-. Oz
-.\}
-..
-.\" uO: go back up created vector cleaning it up along the way
-.de uO
-.if \\n(eP>0 \{\
-. rm e\\n(eP
-. rr e\\n(eP
-. nr eP \\n(eP-1
-. nr oP 0
-. nr eZ 0
-. uO
-.\}
-..
-.\" option end
-.de oE
-.uO
-.ie \\n(hP \{\
-. as f1 \\*(rB\\*(h1\\*(h2\\*(h3
-. Oz
-. nr oZ 0
+.\" NS lL macro - .It item of list-type inset
+.de lL
+.lY
+.br
+\&\\*(b1
+.nr oM \\n(oM-1
+.nr tP 0
+.ds b1
+.aY
+'fi
+..
+.\" NS hL macro - .It item of list-type hanging label (as opposed to tagged)
+.de hL
+.lX
+.nr bb \\n(w\\n(lCu+\\n(lSu
+.ti -\\n(bbu
+.ie \w\\*(b1u>=(\\n(w\\n(lCu) \&\\*(b1
+.el \&\\*(b1\h'|\\n(bbu'\c
+.nr oM \\n(oM-1
+.ds b1
+.nr tP 0
+.aY
+'fi
+..
+.\" NS oL macro - .It item of list-type overhanging label
+.de oL
+.lY
+\&\\*(b1
+.br
+.nr oM \\n(oM-1
+.ds b1
+.nr tP 0
+.aY
+'fi
+..
+.\" NS iT macro - .It item of list-type [empty label]
+.de iT
+.lY
+.br
+.\" .ds b1
+.aY
+'fi
+..
+.\" NS nU macro - Enumerated list
+.\" NS nU register count
+.\" NS hU macro - Hyphen paragraph list (sub bullet list)
+.\" NS bU macro - Bullet paragraph list
+.de nU
+.nr oM \\n(oM+1
+.nr nU \\n(nU+1
+.ds b1 \&\\n(nU.
+.uL
+..
+.de bU
+.nr oM \\n(oM+1
+.nr bU \\n(bU+1
+.ds b1 \&\\*(sY\&\(bu\fP
+.uL
+..
+.de hU
+.nr oM \\n(oM+1
+.nr bU \\n(bU+1
+.ds b1 \&\\*(sY\&\-\fP
+.uL
+..
+.\" NS uL macro - .It item of list-type enum/bullet/hyphen
+.de uL
+.lX
+.nr bb \\n(w\\n(lCu+\\n(lSu
+.ti -\\n(bbu
+.ie \w\\*(b1u>=(\\n(w\\n(lCu) \&\\*(b1
+.el \&\\*(b1\h'|\\n(bbu'\c
+.nr oM \\n(oM-1
+.\" .nr dZ \\n(dZ+1
+.ds b1
+.nr tP 0
+.aY
+'fi
+..
+.\" NS mL macro - .It item of list-type diagnostic-message
+.de mL
+.nr cF \\n(.f
+.nr cZ \\n(.s
+.ie \\n(mL==1 \{\
+. nr zB \\n(.c
+. ie (\\n(zB-\\n(zA)>1 .Pp
+. el .br
+. nr zA \\n(zB
+. nr zB 0
.\}
.el \{\
-. as f1 \\*(rB
+. nr zA \\n(.c
+. br
.\}
-.ie "\\*(iM"Op" \{\
-. if \\n(aO .aO
-.if t \{\
-. if (\\n(.lu-\\n(.ku-\\n(.ou-(2*\\n(fWu))<\w'\fC\\*(f1'u .br
+\&\\*(sY\\*(b1\f\\n(cF\s\\n(cZ\\*(lS\c
+.aY
+.ds b1
+'fi
+..
+.\" NS tL macro - .It item of list-type "tag"
+.de tL
+.\" tm in tL here is b1==\\*(b1
+.if \\n(tW==0 .lW
+.lX
+.nr bb \\n(w\\n(lCu+\\n(lSu
+.ti -\\n(bbu
+.ie (\w\\*(b1u)>(\\n(w\\n(lCu) \{\&\\*(b1
+. br
+.\}
+.el \&\\*(b1\h'|\\n(bbu'\c
+.if \\n(nF==1 \{\
+. if n .ds pA \\*(aA
+.\}
+.nr oM \\n(oM-1
+.nr tP 0
+.\" .nr dZ \\n(dZ+1
+.ds b1
+.aY
+'fi
+..
+.\" NS lW macro - resolve unknown label/tag width (if .Bl [inset | tag] only)
+.de lW
+.if !"TagwidtH"\\*(t\\n(lC" \{\
+. ie \\n(tX==1 \{\
+. ds t\\n(lN \\*(tX
+. nr w\\n(lN \\n(\\*(tX
+. \}
+. el \{\
+. ds t\\n(lN No
+. nr w\\n(lN \\n(No
+. \}
+. if !"\\*(t\\n(lC"\\*(t\\n(lN" .nr tC 1
.\}
-.if n \{\
-. nr aa \w'\\*(f1'u
-.\" . nr qq \\n(.lu-\\n(.ku-\\n(.ou
-.\" \&aa == \\n(aa, f1==\\*(f1, qq==\\n(qq
-. if (\\n(.lu-\\n(.ku-\\n(.ou-\\n(aau)<=(8*\\n(fWu) .br
+..
+.\" NS lX macro - set up vertical spacing (if compact) and offset+indent (all)
+.de lX
+.ie \\n(tC \{\
+. nr tC 0
+. nr tW 0
+. if \\n(v\\n(lC==0 .sp \\n(dVu
+. in \\n(.iu+\\n(w\\n(lCu+\\n(o\\n(lCu+\\n(lSu
.\}
-\&\\*(f1
-. ds iM
-. ds f1
-. hy
+.el \{\
+. ie \\n(v\\n(lC==1 \{\
+. nr aa 0
+. \}
+. el \{\
+. sp \\n(dVu
+. \}
.\}
-.el .nr oE \\n(oE-1
-..
-.de aO
-.as f1 \\*(rB
-.nr aO \\n(aO-1
-.if \\n(aO >0 .aO
+.if !\\n(cR .ne 2v
..
-.\"
-.de Xr
-.if \\n(.$<=1 \{\
-. ie \\n(.$==1 \{\
-. if !"\\*(iM"" .as f1 \&\\*(xR\\$1\fP
-. if "\\*(iM"" \&\\*(xR\\$1\fP
-. \}
-. el .tm Xr Usage: .Xr manpage_name [section#] \\*(Pu
+.\" NS lY macro - set up vertical spacing (if compact) and offset+indent (all)
+.de lY
+.ie \\n(tC \{\
+. nr tC 0
+. nr tW 0
+. if \\n(v\\n(lC==0 .sp \\n(dVu
+. in \\n(.iu+\\n(o\\n(lCu
.\}
-.if \\n(.$==2 \{\
-. rZ \\$2
-. ie "\\*(iM"" \{\
-. ie \\n(rZ \&\\*(xR\\$1\fP\\$2
-. el \&\\*(xR\\$1\fP(\\$2)
+.el \{\
+. ie \\n(v\\n(lC==1 \{\
+. nr aa 0
. \}
. el \{\
-. ie \\n(rZ .as f1 \&\\*(xR\\$1\fP\\$2
-. el .as f1 \&\\*(xR\\$1\fP(\\$2)
+. sp \\n(dVu
. \}
.\}
-.if \\n(.$>=3 \{\
-. rZ \\$2
-. ie \\n(rZ \{\
-. ie !"\\*(iM"" .as f1 \&\\*(xR\\$1\fP\\$2\\$3\\$4\\$5\\$6\\$7\\$8
-. el \&\\*(xR\\$1\fP\\$2\\$3\\$4\\$5\\$6\\$7\\$8
+.if !\\n(cR .ne 2v
+..
+.\" NS tS temporary string
+.\" NS hL macro - hanging list function
+.\" NS tS temporary string
+.\" NS hL macro - hanging list function
+.\" NS lT macro - tagged list function
+.\" NS lE macro - list end function
+.\" NS tX string (initial string)
+.\" NS tX register (initial class)
+.\" NS tC parameter change flag
+.\" NS Xt save current list-type flag
+.\" NS lC register - list type stack counter
+.\" NS tP register tag flag (for diversions)
+.\" NS w[0-9] register tag stack (nested tags)
+.\" NS t[0-9] register tag string stack (nested tags)
+.\" NS o[0-9] register offset stack (nested tags)
+.\" NS v[0-9] register vertical tag break stack
+.\" NS h[0-9] register horizontal tag stack (continuous if 1, break if 0)
+.nr lC 0
+.nr wV 0
+.nr w1 0
+.nr o1 0
+.nr v1 0
+.nr h1 0
+.ds t\n(lC
+.de lE
+.\" IN lC o[\\n(lC]==\\n(o\\n(lC, w[\\n(lC]==\\n(w\\n(lC,
+.ie \\n(o\\n(lC>0 \{\
+' in \\n(.iu-(\\n(w\\n(lCu)-(\\n(o\\n(lCu)-\\n(lSu
+. rr o\\n(lC
+.\}
+.el 'in \\n(.iu-\\n(w\\n(lCu-\\n(lSu
+.if \\n(lC<=0 .tm Extraneous .El call (#\\n(.c)
+.tZ
+.nr lC \\n(lC-1
+.tY
+..
+.\" NS tY macro - set up next block for list
+.\" NS tZ macro - decrement stack
+.\" NS tY register (next possible lC value)
+.de tY
+.nr tY (\\n(lC+1)
+.nr w\\n(tY 0
+.nr h\\n(tY 0
+.nr o\\n(tY 0
+.ds t\\n(tY \\*(t\\n(lC
+.ds L\\n(tY
+.nr v\\n(tY 0
+..
+.de tZ
+.rm L\\n(tY
+.rr w\\n(tY
+.rr h\\n(tY
+.rr o\\n(tY
+.rm t\\n(tY
+.rr v\\n(tY
+.nr tY \\n(tY-1
+..
+.\" initial values
+.nr w1 0
+.nr o1 0
+.nr h1 0
+.ds t1
+.nr v1 0
+.nr tY 1
+.\" NS Xr macro - cross reference (man page only)
+.de Xr
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .Xr manpage_name [section#] \\*(Pu (#\\n(.c)
+. el \{\
+. ds mN Xr
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
. \}
+.\}
+.if \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. ie \\n(C\\n(aP==1 .tm Usage: .Xr manpage_name [section#] \\*(Pu (#\\n(.c)
. el \{\
-. rZ \\$3
-. ie \\n(rZ \{\
-. if !"\\*(iM"" \{\
-. as f1 \&\\*(xR\\$1\fP(\\$2)\\$3\\$4\\$5\\$6\\$7\\$8
-. \}
-. if "\\*(iM"" \{\
-\&\\*(xR\\$1\fP(\\$2)\\$3\\$4\\$5\\$6\\$7\\$8
+. ie \\n(C\\n(aP>2 .y\\n(C\\n(aP
+. el \{\
+. as b1 \&\\*(xR\\*(A\\n(aP\fP\s0
+. if \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. if \\n(C\\n(aP==2 \{\
+. as b1 \&(\\*(A\\n(aP)
+. nr aP \\n(aP+1
+. \}
+. if \\n(aC>=\\n(aP \{\
+. c\\n(C\\n(aP
+. \}
. \}
. \}
-. el \{\
-. tm rZ = \\n(rZ the arg is \\$3
-. tm Xr-XX Usage: .Xr manpage_name [section#] \\*(Pu
+. aZ
+. \}
+.\}
+..
+.\" NS Sx macro - cross section reference
+.de Sx
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Sx Usage: .Sx Section Header \\*(Pu (#\\n(.c)
+. el \{\
+. ds mN Sx
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
+.\}
+.\}
+.if \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. as b1 \\*(sX
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. nR
+.\}
+..
+.\" NS cC macro - column-list end-list
+.\" NS eW macro - column indent width
+.\" NS cI register - column indent width
+.\" NS W[1-5] macro - establish tabs for list-type column
+.de cC
+'in \\n(.iu-\\n(o\\n(lCu-\\n(w\\n(lCu
+.ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
+.fi
+.tZ
+.nr lC \\n(lC-1
+.tY
+..
+.de W1
+.ta \w\\*(A1 u
+.nr eW \w\\*(A1 u
+'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
+..
+.de W2
+.ta \w\\*(A1 u +\w\\*(A2 u
+.nr eW \w\\*(A1 u+\w\\*(A2 u
+'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
+..
+.de W3
+.ta \w\\*(A1 u +\w\\*(A2 u +\w\\*(A3 u
+.nr eW \w\\*(A1 u+\w\\*(A2 u+\w\\*(A3 u
+'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
+..
+.de W4
+.ta \w\\*(A1 u +\w\\*(A2 u +\w\\*(A3 u +\w\\*(A4 u
+.nr eW \w\\*(A1 u+\w\\*(A2 u +\w\\*(A3 u +\w\\*(A4 u
+'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
+..
+.de W5
+.ta \w\\*(A1 u +\w\\*(A2 u +\w\\*(A3 u +\w\\*(A4 u +\w\\*(A5 u
+.nr eW \w\\*(A1 u +\w\\*(A2 u +\w\\*(A3 u +\w\\*(A4 u +\w\\*(A5 u
+' in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
+..
+.\" This is packed abnormally close, intercol width should be an option
+.de W6
+.ta \w\\*(A1 u +\w\\*(A2 u +\w\\*(A3 u +\w\\*(A4 u +\w\\*(A5 u +\w\\*(A6
+.nr eW \w\\*(A1 u +\w\\*(A2 u +\w\\*(A3 u +\w\\*(A4 u +\w\\*(A5 u +\w\\*(A6
+' in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
+..
+.\" NS cL macro - column items
+.de cL
+.if \\n(w\\n(lC==0 .nr w\\n(lC \\n(eWu
+.if \\n(.u==0 \{\
+. fi
+' in \\n(.iu+\\n(eWu
+.\}
+.ti -\\n(eWu
+.fV
+.nr aP \\n(aP+1
+.ie \\n(aC>=\\n(aP \{\
+. if "\\*(A\\n(aP"Ta" \{\
+. nr jJ \\n(aP-1
+. rm S\\n(jJ
+. rr jJ
+. \}
+. c\\n(C\\n(aP
+.\}
+.el .tm Usage: .It column_string [Ta [column_string ...] ] (#\\n(.c)
+..
+.\" NS Ta macro - append tab (\t)
+.de Ta
+.ie \\n(aC>0 \{\
+. nr aP \\n(aP+1
+. ie \\n(aC>=\\n(aP \{\
+. if "\\*(A\\n(aP"Ta" \{\
+. nr jJ \\n(aP-1
+. rm S\\n(jJ
+. rr jJ
. \}
+. as b1 \\t
+. c\\n(C\\n(aP
+. \}
+. el \{\
+. as b1 \\t\\c
+. rm S\\n(aP
+. pB
+. aY
+.\" . ds b1
. \}
.\}
+.el \{\
+. tm Usage: Ta must follow column entry: e.g. (#\\n(.c)
+. tm .It column_string [Ta [column_string ...] ]
+.\}
..
.\"
-.\"
-.de Ex
-.tm Ex defunct, Use .Dl: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-..
-.\" Display (one) Line of text.
+.\" NS Dl macro - display (one line) literal
.de Dl
-.ie "\\*(iM"" \{\
-' ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
-. in \\n(.iu+\\n(Dsu
-. mN \\$1
-. ie \\n(mN .\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+'ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
+.in \\n(.iu+\\n(Dsu
+.ie \\n(aC==0 \{\
+. ie \\n(.$==0 \{\
+. tm Usage: .Dl argument ... (#\\n(.c)
+. \}
. el \{\
-. nr cF \\n(.f
-.\" Literal font is none specified
-\&\\*(lI\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. ft \\n(cF
+. ds mN Dl
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
+. Li
. \}
-. in \\n(.iu-\\n(Dsu
.\}
.el \{\
-. mN \\$1
-. ie \\n(mN .\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
+. tm Usage: .Dl not callable by other macros (#\\n(.c)
+.\}
+.in \\n(.iu-\\n(Dsu
+..
+.\"
+.\" NS D1 macro - display (one line)
+.de D1
+'ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
+.in \\n(.iu+\\n(Dsu
+.ie \\n(aC==0 \{\
+. ie \\n(.$==0 \{\
+. tm Usage: .D1 argument ... (#\\n(.c)
+. \}
. el \{\
-. nr cF \\n(.f
-. ds f1 \&\\*(lI\\&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
-. as f1 \&\f\\n(cF
+. ds mN D1
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
+. nr aP \\n(aP+1
+. ie \\n(C\\n(aP==1 .\\*(A\\n(aP
+. el .No
. \}
.\}
+.el \{\
+. tm Usage: .D1 not callable by other macros (#\\n(.c)
+.\}
+.in \\n(.iu-\\n(Dsu
+..
+.\" NS Ex macro - DEFUNCT
+.de Ex
+.tm Ex defunct, Use .D1: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
..
.\"
+.\" NS Ex macro - DEFUNCT
+.de Ex
+.tm Ex defunct, Use .D1: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
.\"
-.\" user set Tagged Paragraph Width (used in both Dp and Tp)
-.de Tw
-.ie \\n(.$==0 \{\
-. nr aa 0
+.\" NS Vt macro - Variable type (for forcing old style variable declarations)
+.\" this is not done in the same manner as .Ot for fortrash - clean up later
+.de Vt
+.\" if a function declaration was the last thing given, want vertical space
+.if \\n(fD>0 \{\
+. Pp
+. nr fD 0
.\}
-.el \{\
-. mN \\$1
-. ie \\n(sW>2 \{\
-. nr tW (\\n(sW+3)*\\n(fWu)
+.\" if a subroutine was the last thing given, want vertical space
+.if \\n(fZ>0 \{\
+. ie \\n(fX==0 \{\
+. Pp
+. rs
. \}
-. el \{\
-. ie \\n(mN .nr tW \\n(mN
-. el .nr tW \\$1
+. el .br
+.\}
+.nr fX \\n(fX+1
+.nr cF \\n(.f
+.nr cZ \\n(.s
+\\*(fT\&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.ie \\n(oT==0 .br
+.el \&\ \&
+.ft \\n(cF
+.fs \\n(cZ
+..
+.\"
+.\" NS Ft macro - Function type
+.nr fZ 0
+.de Ft
+.if \\n(nS>0 \{\
+. if \\n(fZ>0 \{\
+. Pp
+. nr fD 0
+. nr fX 0
+. \}
+. if \\n(fD>0 \{\
+. Pp
+. nr fD 0
+. nr fX 0
. \}
-. nr tF 1
+. if \\n(fX>0 \{\
+. Pp
+. nr fX 0
+. \}
+. nr fY 1
.\}
+.nr cF \\n(.f
+.nr cZ \\n(.s
+\&\\*(fT\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.ft \\n(cF
+.fs \\n(cZ
+.\" .br
..
.\"
-.de Dw
-.Tw \\$1
+.\" NS Ot macro - Old Function type (fortran - no newline)
+.\" Ns oT register
+.nr oT 0
+.de Ot
+.nr oT 1
+.if \\n(nS>0 \{\
+. if \\n(fZ>0 \{\
+. Pp
+. nr fD 0
+. nr fX 0
+. \}
+. if \\n(fD>0 \{\
+. Pp
+. nr fD 0
+. nr fX 0
+. \}
+. if \\n(fX>0 \{\
+. Pp
+. nr fX 0
+. \}
+. nr fY 1
+.\}
+.if \\n(.$==4 .as b1 \&\\*(fT\&\\$1 \\$2 \\$3 \\$4
+.if \\n(.$==3 .as b1 \&\\*(fT\&\\$1 \\$2 \\$3
+.if \\n(.$==2 .as b1 \&\\*(fT\&\\$1 \\$2
+.if \\n(.$==1 .as b1 \&\\*(fT\&\\$1
+.as b1 \&\ \fP
..
.\"
-.de Di
-.ie \\n(.$==0 \{\
-. nr tI \\n(Dsu
+.\" NS Fa macro - Function arguments
+.de Fa
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .Fa Function Arguments ... \\*(Pu (#\\n(.c)
+. el \{\
+. ds mN Fa
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
+. \}
+.\}
+.ie \\n(fC>0 \{\
+. fC
.\}
.el \{\
-. sW \\$1
-. if \\n(sW>=2 \{\
-. nr tI \\$1u
+. if \\n(aC>\\n(aP \{\
+. as b1 \\*(fA
+. nr aP \\n(aP+1
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. nR
+. if \\n(nS>0 \{\
+. if \\n(fZ>0 .br
+. \}
. \}
-. if \\n(sW<2 \{\
-. if "\\$1"L" \{\
-. nr tI 0
+.\}
+..
+.\" NS fC macro - interal .Fa for .FO and .Fc
+.de fC
+.ie \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+.\" . nr aa \\n(aP
+.\" . if \\n(nS>0 \{\
+. ds Fb
+. nr fB 0
+. nr Fb 0
+. fB \\*(A\\n(aP
+. if \\n(fB>1 \{\
+. rm A\\n(aP
+. rn Fb A\\n(aP
. \}
+.\" . \}
+. if \\n(fC>1 \{\
+. as b1 \&\f\\n(cF\s\\n(cZ,\\*(S\\n(aP\\*(fA\\*(A\\n(aP\fP\s0
+.\" . as b1 \&\\,\\*(S\\n(aP\fP\s0\\*(fA\\*(A\\n(aP\fP\s0
. \}
+. if \\n(fC==1 \{\
+. as b1 \&\|\\*(fA\\*(A\\n(aP\fP\s0
+. \}
+. nr fC \\n(fC+1
+. fC
+.\}
+.el \{\
+. aY
.\}
..
-.\" tagged paragraph
-.\" initialize baby stack variables
-.nr np 0
-.nr p1 0
-.ds s\n(np
+.\" NS Fn macro - functions
+.\" NS fY register - dick with old style function declarations (fortran)
+.\" NS fZ register - break a line when more than one function in a synopsis
.\"
-.de Tp
-.ie "\\$1"" .pE p s np
-.el \{\
-. ds iM Tp
-. mN \\$1
-. ie \\n(tF \{\
-. ds tC Tw
-. nr tC 1
-. nr tF 0
-. \}
+.de Fn
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .Fn function_name function_arg(s) ... \\*(Pu (#\\n(.c)
. el \{\
-. if !"Tw"\\*(s\\n(np" \{\
-. ie \\n(mN \{\
-. ds tC \\$1
-. nr tW \\n(mN
-. \}
-. el \{\
-. ds tC Tx
-. nr tW \\n(Tx
-. \}
-. if !"\\*(tC"\\*(s\\n(np" .nr tC 1
+. ds mN Fn
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
+. \}
+.\}
+.if \\n(nS>0 \{\
+.\" if there is/has been more than one subroutine declaration
+. if \\n(fY==0 \{\
+. if \\n(fZ>0 \{\
+. Pp
+. nr fX 0
+. nr fD 0
. \}
. \}
-. sp \\n(vVu
-. if !\\n(cR .ne 2
-. if \\n(tC \{\
-. nr np \\n(np+1
-. nr p\\n(np \\n(tW
-. ds s\\n(np \\*(tC
-. nr tC 0
-. ds tC
-. in \\n(.iu+\\n(p\\n(npu
+. if \\n(fY==1 \{\
+. br
+. nr fX 0
+. nr fD 0
+. nr fY 0
+. \}
+. if \\n(fD>0 \{\
+. Pp
+. nr fX 0
. \}
-. ie \\n(mN \{\
-. ds f1
-. \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. if !"\\$1"Cx" .pT st p np
+. if \\n(fX>0 \{\
+. Pp
+. nr fD 0
. \}
+. nr fZ \\n(fZ+1
+. nr fY 0
+. rs
+. ie \\n(nS>1 .br
. el \{\
-. br
-. ev 1
-. fi
-. di Td
-\&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. br
-. di
-. ev
-. na
-. ds tD \\*(Td\\
-. pT di p np
+. if \\n(iS==0 \{\
+. nr iS ((8)*\\n(fW)u
+. \}
+. \}
+. in +\\n(iSu
+. ti -\\n(iSu
+. nr nS \\n(nS+1
+.\}
+.if \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. as b1 \\*(fN\\*(A\\n(aP\fP\s0\\*(lp
+. ie \\n(aC>\\n(aP \{\
+. as b1 \\*(fA
+. nr aP \\n(aP+1
+. f\\n(C\\n(aP
+. \}
+. el \{\
+. as b1 \|\\*(rp
+. aZ
+. \}
+. if \\n(nS>0 \{\
+. in -\\n(iSu
. \}
.\}
..
.\"
-.\"
-.\" Complex Expression Macro
-.\"
-.\" TODO: add length across line boundary check (like Li)
-.de Cx
-.hy 0
-.ie \\n(.$==0 \{\
-. if "\\*(iM"Cx" \{\
-. ds iM
-. if \\n(oE .oE
-\&\\*(f1
-. ds f1
+.\" NS f1 macro - class switch
+.\" NS f2 macro - handle function arguments
+.\" NS f3 macro - punctuation
+.\" NS f4 macro - write out function
+.de f1
+.as b1 \\*(rp\f\\n(cF\s\\n(cZ
+.\\*(A\\n(aP
+..
+.de f2
+.if \\n(nS>0 \{\
+. ds Fb
+. nr fB 0
+. nr Fb 0
+. fB \\*(A\\n(aP
+. if \\n(fB>1 \{\
+. rm A\\n(aP
+. rn Fb A\\n(aP
. \}
-. if "\\*(iM"Tp" .pT st p np
-. if "\\*(iM"Dp" .pT st q mp
.\}
-.el \{\
-. if "\\*(iM"" \{\
-. ds iM Cx
-. ds f1 \&
-. \}
-. mN \\$1
-.\" Here are the args: `\\$1' `\\$2' `\\$3' `\\$4'
-. ie \\n(mN .\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. el \{\
-. as f1 \&\\$1
-. if \\n(.$>1 .Cx \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.as b1 \\*(A\\n(aP
+.ie \\n(aC>\\n(aP \{\
+. nr aa \\n(aP
+. nr aP \\n(aP+1
+. if \\n(C\\n(aP==2 \{\
+. as b1 \&\|\f\\n(cF\s\\n(cZ,\\*(S\\n(aa\fP\s0\|
. \}
+. f\\n(C\\n(aP
+.\}
+.el \{\
+. as b1 \\*(rp\f\\n(cF\s\\n(cZ
+. aZ
.\}
..
-.\" Prefix string in default font to content specified string
-.de Pf
-.Cx \\$1
-.\\$2 \\$3 \\$4 \\$5
-.Cx
+.de f3
+.as b1 \\*(rp\f\\n(cF\s\\n(cZ\\*(A\\n(aP
+.ie \\n(aC>\\n(aP \{\
+. No
+.\}
+.el .aZ
..
-.\" Suffix string in default font to content specified string
-.de Sf
-.Cx \\$1 \\$2
-.Cx \\$3
-.Cx
+.de f4
+.as b1 \\*(rp\f\\n(cF\s\\n(cZ\\*(S\\n(aP\\*(A\\n(aP
+.ie \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. No
+.\}
+.el .aZ
..
-.\" Simple Option Begin
-.de Ob
+.de Fo
.hy 0
-.ie "\\*(iM"" \{\
-. ev 2
-. fi
-. di oB
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .Fo function_name
+. el \{\
+. ds mN Fo
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
+. \}
.\}
-.el \{\
-.tm shouldn't be here
-. as f1 \&[
-. mN \\$1
-. ie \\n(mN .\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.if \\n(nS>0 \{\
+.\" if there is/has been more than one subroutine declaration
+. if \\n(fY==0 \{\
+. if \\n(fZ>0 \{\
+. Pp
+. nr fX 0
+. nr fD 0
+. \}
+. \}
+. if \\n(fY==1 \{\
+. br
+. nr fX 0
+. nr fD 0
+. nr fY 0
+. \}
+. if \\n(fD>0 \{\
+. Pp
+. nr fX 0
+. \}
+. if \\n(fX>0 \{\
+. Pp
+. nr fD 0
+. \}
+. nr fZ \\n(fZ+1
+. nr fY 0
+. rs
+. ie \\n(nS>1 .br
. el \{\
-. as f1 \&\\$1
-. if \\n(.$>1 .Oc \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. if \\n(iS==0 \{\
+. nr iS ((8)*\\n(fW)u
+. \}
+. \}
+. in +\\n(iSu
+. ti -\\n(iSu
+. nr nS \\n(nS+1
+.\}
+.if \\n(aC>\\n(aP \{\
+. nr oM \\n(oM+1
+. nr fC 1
+. nr aP \\n(aP+1
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. as b1 \\*(fN\\*(A\\n(aP\fP\s0\\*(lp
+. aY
+.\}
+..
+.de Fc
+.if \\n(aC==0 \{\
+. if \\n(.$>0 \{\
+. ds mN Fo
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
. \}
.\}
-..
-.de Oc
-.as f1 \&\\$1
-.if \\n(.$>1 .Oc \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-..
-.de Oe
-.hy 0
-.ie "\\*(iM"" \{\
-. br
-. di
-. ev
-. ds bO \\*(oB\\
-\&[\\*(bO\&]
+.nr fC 0
+.nr oM \\n(oM-1
+.as b1 \|\\*(rp
+.ie \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. \\*(A\\n(aP
.\}
.el \{\
-. as f1 \&]
+. aZ
+.\}
+.if \\n(nS>0 \{\
+. in -\\n(iSu
.\}
+.hy
..
-.\" White space for Cx
-.de Ws
-.Cx \&\ \&
+.\" NS fb macro - if SYNOPSIS, set hard space inbetween function args
+.\" NS fb register - count of words in a function argument
+.\" NS Fb register - counter
+.\" NS Fb string - temporary string
+.de fB
+.\" .tm fB==\\n(fB, Fb==\\n(Fb, 1==\\$1 2==\\$2 3==\\$3 4==\\$4 5==\\$5 6==\\$6
+.if \\n(fB==0 \{\
+. nr fB \\n(.$
+. nr Fb 0
+. ds Fb
+.\}
+.nr Fb \\n(Fb+1
+.as Fb \&\\$1
+.if \\n(Fb<\\n(fB \{\
+. as Fb \&\\*(hV
+. fB \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.\}
..
-.\" tagged paragraph
-.\" initialize baby stack variables
-.nr mp 0
-.nr q1 0
-.ds r\n(np
+.\" NS Fc - Function close - not implemented yet
+.\" NS Fo - Function open - not implemented yet
.\"
-.\" Complex Dp tag
-.de Dc
-.Dp Cx \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
-..
-.\" Complex Tp tag
-.de Tc
-.Tp Cx \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
-..
-.\" Tag with a flag and an argument with a space
-.de Ta
-.if "\\$2"" \{\
-. Tp Fl \\$1
+.\" Very crude references, stash all reference info into strings (usual
+.\" use of b1 buffer, then b1 contents copied to string of retrievable
+.\" naming convention), print out reference on .Re request and clean up.
+.\" Ordering very limited, no fancy citations, but can do articles, journals
+.\" and books - need to add several missing options (like city etc).
+.\" should be able to grab a refer entry, massage it a wee bit (prefix
+.\" a `.' to the %[A-Z]) and not worry (ha!)
+.\"
+.\" NS Rs macro - Reference Start
+.\" NS rS register - Reference Start flag
+.\" NS rS string - Reference Start buffer name for next save (of b1 buffer)
+.de Rs
+.nr rS 1
+.rC
+.if \\n(nA==1 .Pp
+.nr Kl 0
+..
+.\" NS Re macro - Reference End
+.de Re
+.rZ
+.rC
+.nr rS 0
+..
+.\" NS rC macro - reference cleanup
+.de rC
+.nr uK 0
+.nr jK 0
+.nr nK 0
+.nr oK 0
+.nr qK 0
+.nr rK 0
+.nr tK 0
+.nr vK 0
+.nr dK 0
+.nr pK 0
+.nr bK 0
+.ds rS
+.rm U1 U2 U3 U4 U5 U6 U7 U8
+.rm uK jK nK oK rK qK tK vK dK pK bK
+..
+.\" NS rZ macro - reference print
+.de rZ
+.if \\n(uK \{\&\\*(U1,
+. nr aK 1
+. if (\\n(uK>1 \{\
+. aK
+. \}
+. nr Kl -\\n(uK
.\}
-.el \{\
-. Tp Fl \\$1
-. Cx \&\ \&
-. Ar \\$2 \\$3
-. Cx
+.if \\n(tK \{\
+. nr Kl \\n(Kl-1
+. if \\n(Kl==0 \{\
+. ie (\\n(jK==1):(\\n(bK==1) \{\&\\*q\\*(tK\\*q.
+. \}
+. el \{\&\\*(eM\\*(tK\\*(nO.
+. \}
+. \}
+. if \\n(Kl>0 \{\
+. ie (\\n(jK==1):(\\n(bK==1) \{\&\\*q\\*(tK\\*q,
+. \}
+. el \{\&\\*(eM\\*(tK\\*(nO,
+. \}
+. \}
+.\}
+.if \\n(bK \{\
+. nr Kl \\n(Kl-1
+. if \\n(Kl==0 \&\\*(eM\\*(bK\\*(nO.
+. if \\n(Kl>0 \&\\*(eM\\*(bK\\*(nO,
+.\}
+.if \\n(jK \{\
+. nr Kl \\n(Kl-1
+. if \\n(Kl==0 \&\\*(eM\\*(jK\\*(nO.
+. if \\n(Kl>0 \&\\*(eM\\*(jK\\*(nO,
+.\}
+.if \\n(rK \{\
+. nr Kl \\n(Kl-1
+. if \\n(Kl==0 \&\\*(rK.
+. if \\n(Kl>0 \&\\*(rK,
+.\}
+.if \\n(nK \{\
+. nr Kl \\n(Kl-1
+. if \\n(Kl==0 \&\\*(nK.
+. if \\n(Kl>0 \&\\*(nK,
+.\}
+.if \\n(vK \{\
+. nr Kl \\n(Kl-1
+. if \\n(Kl==0 \&\\*(vK.
+. if \\n(Kl>0 \&\\*(vK,
+.\}
+.if \\n(pK \{\
+. nr Kl \\n(Kl-1
+. if \\n(Kl==0 \&\\*(pK.
+. if \\n(Kl>0 \&\\*(pK,
+.\}
+.if \\n(qK \{\
+. nr Kl \\n(Kl-1
+. if \\n(Kl==0 \&\\*(qK.
+. if \\n(Kl>0 \&\\*(qK,
+.\}
+.if \\n(dK \{\
+. nr Kl \\n(Kl-1
+. if \\n(Kl==0 \&\\*(dK.
+. if \\n(Kl>0 \&\\*(dK,
+.\}
+.if \\n(oK \{\
+. nr Kl \\n(Kl-1
+. if \\n(Kl==0 \&\\*(oK.
+. if \\n(Kl>0 \&\\*(oK,
+.\}
+.if \\n(Kl>0 .tm unresolved reference problem
+..
+.\" NS aK macro - print out reference authors
+.de aK
+.nr aK \\n(aK+1
+.ie (\\n(uK-\\n(aK)==0 \{\&and \\*(U\\n(aK,
+.\}
+.el \{\&\\*(U\\n(aK,
+. aK
+.\}
+..
+.\" NS %A macro - reference author(s)
+.\" NS uK register - reference author(s) counter
+.\" NS U[1-9] strings - reference author(s) names
+.de %A
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .%A Author_name (#\\n(.c)
+. el \{\
+. nr uK \\n(uK+1
+. nr Kl \\n(Kl+1
+. ds rS U\\n(uK
+. ds mN %A
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
+.\}
+.if \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. rR
.\}
..
-.de Da
-.Dp Cx Fl \\$1
-.Ws
-.Ar \\$2 \\$3
-.Cx
-..
-.de To
-.Tp Cx Fl \\$1
-.Ar \\$2 \\$3
-.Cx
-..
-.de Do
-.Dp Cx Fl \\$1
-.Ar \\$2 \\$3
-.Cx
+.\" NS %B macro - [reference] Book Name
+.\" NS bK string - Book Name
+.\" NS bK register - Book Name flag
+.de %B
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .%B Book Name (#\\n(.c)
+. el \{\
+. ds mN %B
+. if \\n(rS>0 \{\
+. nr bK \\n(bK+1
+. nr Kl \\n(Kl+1
+. ds rS bK
+. \}
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
+. \}
+.\}
+.if \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. ie \\n(rS==0 \{\
+. as b1 \&\\*(eM
+. nR
+. \}
+. el .rR
+.\}
..
-.\" Blended tag toggle
-.de Bt
-.ie \\n(tP==0 .nr tP 1
-.el .nr tP 0
+.\" NS %D macro - [reference] Date
+.\" NS dK string - Date String
+.\" NS dK register - Date flag
+.de %D
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .%D Date (#\\n(.c)
+. el \{\
+. ds mN %D
+. nr dK \\n(dK+1
+. nr Kl \\n(Kl+1
+. ds rS dK
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
+. \}
+.\}
+.if \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. rR
+.\}
..
-.\" Bullet paragraph
-.de Bu
-.Tp Sy \&\(bu
+.\" NS %J macro - [reference] Journal Name
+.\" NS jK register - [reference] Journal Name flag
+.\" NS jK string - [reference] Journal Name
+.de %J
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .%J Journal Name (#\\n(.c)
+. el \{\
+. ds mN %J
+. nr jK \\n(jK+1
+. ds rS jK
+. nr Kl \\n(Kl+1
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
+. \}
+.\}
+.if \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. rR
+.\}
..
-.\" Display tagged paragraph
-.de Dp
-.ie "\\$1"" \{\
-. pE q r mp
-. sp \\n(vVu
+.\" NS %N macro - [reference] issue number
+.\" NS nK register - [reference] issue number flag
+.\" NS nK string - [reference] issue number
+.de %N
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .%N issue number (#\\n(.c)
+. el \{\
+. nr nK \\n(nK+1
+. nr Kl \\n(Kl+1
+. ds rS nK
+. ds mN %N
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
.\}
-.el \{\
-. ds iM Dp
-. mN \\$1
-. ie \\n(tF \{\
-. ds tC Tw
-. nr tC 1
-. nr tF 0
-. \}
-. el \{\
-. if !"Tw"\\*(r\\n(mp" \{\
-. ie \\n(mN \{\
-. ds tC \\$1
-. nr tW \\n(mN
-. \}
-. el \{\
-. ds tC Tx
-. nr tW \\n(Tx
-. \}
-. if !"\\*(tC"\\*(r\\n(mp" .nr tC 1
-. \}
-. \}
-. if !\\n(cR .ne 2
-. if \\n(tC \{\
-. nr mp \\n(mp+1
-. nr q\\n(mp \\n(tW
-. ds r\\n(mp \\*(tC
-. nr tC 0
-. ds tC
-. ie \\n(tIu==\\n(Dsu .nr i\\n(mp \\n(Dsu
-. el \{\
-. nr i\\n(mp \\n(tIu
-. nr tI \\n(Dsu
-. \}
-. in \\n(.iu+\\n(i\\n(mpu
-. sp \\n(vVu
-. in \\n(.iu+\\n(\\q\\n(mpu
-. \}
-. ie \\n(mN \{\
-. \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. if !"\\$1"Cx" .pT st q mp
-. \}
+.if \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. rR
+.\}
+..
+.\" NS %O macro - [reference] optional information
+.\" NS oK register - [reference] optional information flag
+.\" NS oK string - [reference] optional information
+.de %O
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .%O optional information ... \\*(Pu (#\\n(.c)
. el \{\
-. br
-. ev 1
-. fi
-. di Td
-\&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-. br
-. di
-. ev
-. na
-. ds tD \\*(Td\\
-. pT di q mp
-. \}
+. ds mN %O
+. nr oK \\n(oK+1
+. nr Kl \\n(Kl+1
+. ds rS oK
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
+. \}
+.\}
+.if \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. rR
.\}
..
-.\"
-.\" .pE number_stack string_stack counter
-.de pE
-.ie "\\$3"mp" \{\
-. in \\n(.iu-(\\n(\\$1\\n(\\$3u)-(\\n(i\\n(mpu)
-. rr i\\n(mp
-.\}
-.el .in \\n(.iu-\\n(\\$1\\n(\\$3u
-.\" .in \\n(.iu-\\n(\\$1\\n(\\$3u
-.if \\n(\\$3<=0 .tm Extraneous call .Tp or .Dp
-.rr \\$1\\n(\\$3
-.rm \\$2\\n(\\$3
-.nr \\$3 \\n(\\$3-1
-.ds iM
+.\" NS %P macro - [reference] page numbers
+.\" NS pK register - [reference] page number flag
+.\" NS pK string - [reference] page number
+.de %P
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .%P page numbers ... \\*(Pu (#\\n(.c)
+. el \{\
+. ds mN %P
+. nr pK \\n(pK+1
+. nr Kl \\n(Kl+1
+. ds rS pK
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
+. \}
+.\}
+.if \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. rR
+.\}
..
-.\"
-.\" .pT [st or di] number_stack counter
-.de pT
-.ie "\\$1"st" \{\
-. nr bb \\n(\\$2\\n(\\$3u
-. ti -\\n(bbu
-. ie (\\n(\\$2\\n(\\$3u-2n)<=\w'\\*(f1'u \{\&\\*(f1\\*(tP
-. if \\n(tP==0 .br
+.\" NS %Q macro - Corporate or Foreign Author
+.\" NS qK string - Corporate or Foreign Author
+.\" NS qK register - Corporate or Foreign Author flag
+.de %Q
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .%Q Corporate or Foreign Author (#\\n(.c)
+. el \{\
+. ds mN %Q
+. nr qK \\n(qK+1
+. nr Kl \\n(Kl+1
+. ds rS qK
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
. \}
-. el \\*(f1\h'|\\n(\\$2\\n(\\$3u'\c
.\}
-.el \{\
-. ti -\\n(\\$2\\n(\\$3u
-. ie (\\n(\\$2\\n(\\$3u-2n)<=\\n(dlu \{\&\\*(tD\\*(tP
-. if !\\n(tP .br
+.if \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. rR
+.\}
+..
+.\" NS %R macro - [reference] report name
+.\" NS rK string - [reference] report name
+.\" NS rK register - [reference] report flag
+.de %R
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .%R reference report (#\\n(.c)
+. el \{\
+. ds mN %R
+. nr rK \\n(rK+1
+. nr Kl \\n(Kl+1
+. ds rS rK
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
. \}
-. el \\*(tD\h'|\\n(\\$2\\n(\\$3u'\c
-. if t 'ad
.\}
-. ds iM
-. ds f1
-'fi
+.if \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. rR
+.\}
..
-.\"
-.\" The new SH
-.\"
-.de Sh
-.\" set Sh state off, check for list state before calling indent (.In)
-.nr nS 0
-.nr sE 0
-.ie "\\$1"NAME" \{\
-.\" name state on, housekeep (headers & footers)
-. hK
-' in 0
+.\" NS %T macro - reference title
+.\" NS tK string - reference title
+.\" NS tK register - reference title flag
+.de %T
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .%T (#\\n(.c)
+. el \{\
+. ds mN %T
+. if \\n(rS>0 \{\
+. nr tK \\n(tK+1
+. nr Kl \\n(Kl+1
+. ds rS tK
+. \}
+. ds A1 \\$1
+. ds A2 \\$2
+. ds A3 \\$3
+. ds A4 \\$4
+. ds A5 \\$5
+. ds A6 \\$6
+. ds A7 \\$7
+. ds A8 \\$8
+. ds A9 \\$9
+. nr fV \\n(.$
+. fV
+. \}
.\}
-.el \{\
-. if "\\$1"SYNOPSIS" .nr nS 1
-. in 0
+.if \\n(aC>\\n(aP \{\
+.\" . ie \\n(jS==1 \{\
+.\" . nr cF \\n(.f
+.\" . nr cZ \\n(.s
+.\" . ds qL \&\\*(Lq\\*(rA
+.\" . ds qR \&\\*(Rq\f\\n(cF\s\\n(cZ
+.\" . En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.\" . \}
+.\" . el \{\
+. nr aP \\n(aP+1
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. ie \\n(rS==0 \{\
+. as b1 \&\\*(eM
+. nR
+. \}
+. el .rR
+.\" . \}
.\}
-.pL
-'sp
-.ns
-.ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
-.if !\\n(cR .ne 3
-'fi
-\&\fB\\$1 \|\\$2 \|\\$3 \|\\$4 \|\\$5 \|\\$6 \|\\$7 \|\\$8 \|\\$9
-\&\fP\&
-.in \\n(.iu+\\n(Tiu
-.if "\\$1"SEE" .nr sE 1
-.ns
..
-.\"
-.\" Nd minus sign for an en dash used in .Sh Name
-.de Nd
-\&\-\& \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-..
-.de Ss
-.sp
-.ti -.25i
-\&\fB\\$1 \|\\$2 \|\\$3 \|\\$4 \|\\$5 \|\\$6 \|\\$7 \|\\$8 \|\\$9
-\&\fP\&
-.ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
-.if !\\n(cR .ne 2
-.br
+.\" NS %V macro - reference volume
+.\" NS vK string - reference volume
+.\" NS vK register - reference volume flag
+.de %V
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .%V Volume , ... \\*(Pu (#\\n(.c)
+. el \{\
+. ds mN %V
+. nr vK \\n(vK+1
+. nr Kl \\n(Kl+1
+. ds rS vK
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
+.\}
+.if \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. rR
+.\}
..
-.\" .if "\\$1"Ss" .in \\n(.iu+\\n(sIu
-.\"..
-.\"
-.\"
-.\" Column Macro
-.\"
+.\" NS rR macro - reference recursion routine
+.\" NS jM local register
+.\" NS jN local register
+.de rR
.hy 0
-.de Cw
-.ie \\n(.$==0 \{\
-. br
-. in \\n(.iu-\\n(eWu
-. ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
+.nr jM \\n(C\\n(aP
+.ie \\n(jM==1 \{\
+.\" . as b1 \&\f\\n(cF\s\\n(cZ
+. ie "\\*(A\\n(aP"Tn" \{\
+. nN
+. \}
+. el \{\
+. if \\n(aC>8 .tm Usage: \\*(mN - maximum 8 arguments (#\\n(.c)
+. aI rR 1
+. \\*(A\\n(aP
+. \}
.\}
.el \{\
-. Pp
-. if \\n(.$==1 \{\
-. ta \w'\\$1 'u
-. nr eW \w'\\$1 'u
-' in \\n(.iu+\\n(eWu
-. \}
-. if \\n(.$==2 \{\
-. ta \w'\\$1 'u +\w'\\$2 'u
-. nr eW \w'\\$1 'u+\w'\\$2 'u
-' in \\n(.iu+\\n(eWu
-. \}
-. if \\n(.$==3 \{\
-. ta \w'\\$1 'u +\w'\\$2 'u +\w'\\$3 'u
-. nr eW \w'\\$1 'u+\w'\\$2 'u+\w'\\$3 'u
-' in \\n(.iu+\\n(eWu
-. \}
-. if \\n(.$==4 \{\
-. ta \w'\\$1 'u +\w'\\$2 'u +\w'\\$3 'u +\w'\\$4 'u
-. nr eW \w'\\$1 'u+\w'\\$2 'u+\w'\\$3 'u +\w'\\$4 'u
-' in \\n(.iu+\\n(eWu
+. nr jN \\n(aP
+. ie \\n(jM==2 .as b1 \&\\*(A\\n(aP
+. el .as b1 \&\\*(A\\n(aP
+.\" . el .as b1 \&\f\\n(cF\s\\n(cZ\\*(A\\n(aP\fP\s0
+. ie \\n(aC==\\n(aP \{\
+.\" . as b1 \&\f\\n(cF\s\\n(cZ
+. rD
. \}
-. if \\n(.$==5 \{\
-.ta \w'\\$1 'u +\w'\\$2 'u +\w'\\$3 'u +\w'\\$4 'u +\w'\\$5 'u
-.nr eW \w'\\$1 'u +\w'\\$2 'u +\w'\\$3 'u +\w'\\$4 'u +\w'\\$5 'u
-' in \\n(.iu+\\n(eWu
+. el \{\
+. nr aP \\n(aP+1
+. as b1 \&\\*(S\\n(jN
+. rR
. \}
.\}
+.rr jM jN
..
-.de Cl
-.ti -\\n(eWu
-.mN \\$1
-.ie \\n(mN .\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-.el \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.\" NS rD macro - save b1 buffer in to appropriate name
+.de rD
+.as \\*(rS \\*(b1
+.ds b1
+.ds rS
+.aY
..
-.nr dQ 0
-.de Ds
-.ie !"\\$1"" \{\
-. mN d\\$1
-. if \\n(mN \{\
-. nr dQ \\n(dQ+1
-. d\\$1
-. \}
+.\" NS Hf macro - source include header files.
+.de Hf
+.Pp
+File:
+.Pa \\$1
+.Pp
+.nr cF \\n(.f
+.nr cZ \\n(.s
+.ie t \{\
+\&\\*(lI
+.br
+.ta +9n 18n 27n 36n 45n 54n 63n 72n
.\}
-.el .br
-.nf
-..
-.de Df
-.ie !"\\$1"" \{\
-. mN d\\$1
-. if \\n(mN \{\
-. nr dQ \\n(dQ+1
-. d\\$1
-. \}
+.el \{\
+.ta +8n 16n 24n 32n 40n 48n 56n 64n 72n
.\}
-.el .br
-..
-.de Dn
-\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
.nf
-..
-.de dI
-.nr d\\n(dQ \\n(dIu
-.in \\n(.iu+\\n(dIu
-..
-.de dC
-.nr d\\n(dQ (\\n(.l-\\n(.i)/4u
-.in \\n(.iu+\\n(d\\n(dQu
-..
-.de dR
-.nr d\\n(dQ (\\n(.l/3)u
-.in \\n(.iu+\\n(d\\n(dQu
-..
-.de dL
-.nr aa 0
-..
-.de De
-.br
-.if \\n(d\\n(dQ \{\
-. in \\n(.iu-\\n(d\\n(dQu
-. rr d\\n(dQ
-. nr dQ \\n(dQ-1
-.\}
+.so \\$1
.fi
+.ft \\n(cF
+.fz \\n(cZ
+.Pp
..
-.\"
-.de Fn
-.ie \\n(.$==0 \{\
-. tm Usage: .Fn function_name function_arg(s) ... \\*(Pu
-.\}
-.el \{\
-. nr cF \\n(.f
-. ie \\n(.$==1 .ds f1 \&\\*(nM\\$1\fP\\*(lP\fP\\*(rP\fP
+.\" NS An macro - author name
+.\" NS aN register
+.nr aN 0
+.de An
+.if \\n(nY==1 \{\
+. ie \\n(aN==1 \{\
+. br
+. \}
. el \{\
-. ds f1 \\*(nM\\$1\fP\\*(lP
-. nr aa 0
-. rC \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. nr aN 1
. \}
-. if "\\*(iM"" \{\\&\\*(f1
-. ds f1
+.\}
+.if \\n(aC==0 \{\
+. ie \\n(.$==0 .tm Usage: .An author_name ... \\*(Pu (#\\n(.c)
+. el \{\
+. ds mN An
+. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
. \}
.\}
+.if \\n(aC>\\n(aP \{\
+. nr aP \\n(aP+1
+. nr cF \\n(.f
+. nr cZ \\n(.s
+. nR
+.\}
..
-.\"
-.de rC
-.rZ \\$1
-.ie \\n(rZ \{\
-. as f1 \f\\n(cF\\*(rP\f\\n(cF\\$1\\$2\\$3\\$4\\$5\\$6\\$7
+.\" NS Sf macro -defunct
+.de Sf
+.tm .Sf defunct, use prefix or Ns
+..
+.ds rV "function returns the value 0 if successful; otherwise the value -1 is returned and the global variable \\*(vAerrno\fP is set to indicate the error.
+.\" Ns Rv macro - return values
+.\" Ns rV string - standard return message
+.de Rv
+.ie \\n(.$==0 \{\
+.tm Usage: .Rv [-std] (#\\n(.c)
.\}
.el \{\
-. ie \\n(aa .as f1 \fP, \\*(aR\\$1
-. el .as f1 \\*(aR\\$1
-. nr aa 1
-. ie \\n(.$>1 .rC \\$2 \\$3 \\$4 \\$5 \\$6 \\$7
-. el .as f1 \fP\\*(rP\fP
+. ds mN Rv
+.\" . nr aP 0
+.\" . nr lR \\n(lR+1
+.\" . ds A1 \\$2
+.\" . ds A2 \\$3
+.\" . ds A3 \\$4
+.\" . ds A4 \\$5
+.\" . ds A5 \\$6
+.\" . ds A6 \\$7
+.\" . ds A7 \\$8
+.\" . ds A8 \\$9
+.\" . nr fV \\n(.$-1
+. if "\\$1"-std" \{\
+. nr cH \\*(cH
+. if (\\n(cH<2):(\\n(cH>3) .tm Usage: .Rv -std sections 2 and 3 only
+. br
+\&The
+.Fn \\$2
+\&\\*(rV
+. \}
.\}
..
diff --git a/macros/tmac.doc.old b/macros/tmac.doc.old
new file mode 100644
index 000000000..51a0ec005
--- /dev/null
+++ b/macros/tmac.doc.old
@@ -0,0 +1,1858 @@
+.\"
+.\" Copyright (c) 1990 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)tmac.doc.old 5.2 (Berkeley) 3/13/91
+.\" Slightly modified by jjc@jclark.com to work with groff as well.
+.\"
+.\" Assume nroff on crt's only if cR==1
+.if n .nr cR 1
+.\" STRING CONSTANTS
+.\" DITROFF
+.if t \{\
+.\" Address Style
+.ds aD \fI
+.\" Argument Reference Style
+.ds aR \f(CO
+.\" Interactive Comand Modifier (flag)
+.ds cM \f(CB
+.\" Emphasis (in the English sense - usually italics)
+.ds eM \fI
+.\" Errno Style
+.ds eR \fC
+.\" Environment Variable Style
+.ds eV \fC
+.\" Command Line Flag Style
+.ds fL \f(CB
+.\" Header String Style
+.ds Hs \fR
+.\" Interactive Command Style
+.ds iC \f(CB
+.\" Literal Style
+.ds lI \fC
+.\" Left Parenthesis Style
+.ds lP \fR\|(\|\fP
+.\" Right Parenthesis Style
+.ds rP \fR\|)\|\fP
+.\" Options Open Bracket Style
+.ds lB \fR\^[\^\fP
+.\" Options Open Bracket Style
+.ds rB \fR\^]\fP
+.\" Name (subject of manpage) Style
+.ds nM \f(CB
+.\" Pathname Style
+.ds pA \fC
+.\" Accepted punctuation string for -mdoc syntax
+.ds Pu \fR[.,:;(\^)[\^]\fR]
+.\" Section Header Style
+.ds Sp \s12\fB
+.\" .ds sT \s-2\fR
+.\" Symbolic Emphasis (boldface)
+.ds sY \f(CB
+.\" Generic Variable Style
+.ds vA \fI
+.\" Volume Title Style
+.ds Vs \fR
+.\" Cross Reference STyle (man page only)
+.ds xR \fC
+.\" Math *
+.tr *\(**
+.\}
+.\" NROFF
+.if n \{\
+.\" Address Style
+.ds aD \fI
+.\" Argument Reference Style
+.ds aR \fI
+.\" Interactive Command Modifier (flag)
+.ds cM \fB
+.\" Emphasis (in the English sense - usually italics)
+.ds eM \fI
+.\" Errno Style
+.ds eR \fR
+.\" Environment Variable Style
+.ds eV \fR
+.\" Command Line Flag Style
+.ds fL \fB
+.\" Header String Style
+.ds Hs \fR
+.\" Interactive Command Style
+.ds iC \fB
+.\" Literal Style
+.ds lI \fR
+.\" Left Parenthesis Style
+.ds lP \fR\|(\fP
+.\" Right Parenthesis Style
+.ds rP \fR\|)\fP
+.\" Options Open Bracket Style
+.ds lB \fR\|[\|\fP
+.\" Options Open Bracket Style
+.ds rB \fR\|]\fP
+.\" Name (subject of manpage) Style
+.ds nM \fB
+.\" Pathname Style
+.ds pA \fI
+.\" Accepted punctuation string for -mdoc syntax
+.ds Pu [.,;:()[]]
+.\" Section Header Style
+.ds Sp \s12\fB
+.\" .ds sT \s-2\fR
+.\" .ds sT \s-2\fR
+.\" Symbol, Mode or Mask Style
+.ds sY \fB
+.\" Generic Variable Style
+.ds vA \fI
+.\" Volume Title Style
+.ds Vs \fR
+.\" Cross Reference Style (man page only)
+.ds xR \fR
+.\}
+.\" INDENTS - Subheaders(sI), Text(Ti) between Section Headers and Subsects
+.if t \{\
+. nr sI \w'\fC,'u*5
+. nr Ti \n(sIu
+.\}
+.if n \{\
+. nr sI .5i
+. nr Ti .5i
+.\}
+.\" Flags for macros names which are used only for .Ds
+.nr dI 6n
+.nr dC 1
+.nr dL 1
+.nr dR 1
+.\" INDENT WIDTHS (for Lists)
+.\" Width Needed for Address Tag (indented amount)
+.nr Ad 12n
+.\" Angle Quote Width
+.nr Aq 12n
+.\" Width Needed for Argument
+.nr Ar 12n
+.\" Width Needed for Column offset
+.nr Cl 15n
+.\" Width neeeded for Interactive Command Modifier
+.nr Cm 10n
+.\" Width Needed for Complex Expressions
+.nr Cx 20n
+.\" Indent Width Needed for Display (right and left margins)
+.nr Ds 6n
+.\" Double Quote Width
+.nr Dq 12n
+.\" tI is dependent on Ds and used by .Dp
+.nr tI \n(Dsu
+.\" Width Needed for Display
+.nr Em 10n
+.\" Width Needed for Errno Types
+.nr Er 15n
+.\" Width Needed for Environment Variables
+.nr Ev 15n
+.\" Width Needed for Example Indent
+.nr Ex 10n
+.\" Width Needed for Flag
+.nr Fl 10n
+.\" Width Needed for Function
+.nr Fn 16n
+.\" Width neeeded for Interactive Command Name
+.nr Ic 10n
+.\" Width Needed for Constant
+.nr Li 16n
+.\" Width Needed for Math Symbol ? not sure if needed
+.nr Ms 6n
+.\" Width Needed for Name
+.nr Nm 10n
+.\" Width Needed for Option Begin
+.nr Ob 14n
+.\" Width Needed for Option End
+.nr Oe 14n
+.\" Width Needed for Option (one line)
+.nr Op 14n
+.\" Width Needed for Pathname
+.nr Pa 32n
+.\" Parenthesis Quote Width
+.nr Pq 12n
+.\" Single Quote Width
+.nr Sq 12n
+.\" Width Needed for Symbols, Modes or Masks
+.nr Sy 6n
+.\" Width needed for default or unknown text width
+.nr Tx 22n
+.\" Width Needed for Generic Variable
+.nr Va 12n
+.\" Width Needed for Cross Reference, should the cross ref be annotated.
+.nr Xr 10n
+.\" PARAGRAPH SPACE
+.if t \{\
+. nr Pp .5v
+.\}
+.if n \{\
+. nr Pp 1v
+.\}
+.\" PAGE LAYOUT
+.\" .Li Tagged Paragraph Style - zero if break on oversized tag
+.\" one if add em space and continue filling line.
+.nr tP 0
+.\" Page Layout Macro
+.de pL
+.\" DITROFF
+.ie t \{\
+.\" Header Margin
+. nr Hm .5i
+.\" Footer Margin
+. nr Fm .5i
+.\" Line length
+. nr ll 5.5i
+.\" Line length
+. ll 5.5i
+.\" Title length
+. nr lt 5.5i
+.\" Title length
+. lt 5.5i
+.\" Page offset
+. nr po 1.56i
+.\" Page offset
+. po 1.56i
+.\" Vertical space distance (from Section headers/Lists/Subsections)
+. nr vV .5v
+.\" em space
+. ds tP \|\|\|\|\|\|
+.\}
+.el \{\
+.\" Line length
+. nr ll 78n
+. ll 78n
+.\" Title length
+. nr lt 78n
+.\" Title length
+. lt 78n
+.\" Page offset
+. nr po 0i
+.\" Page offset
+. po 0i
+.\" Vertical space distance (from Section headers/Lists/Subsections)
+. nr vV 1v
+.\" em space
+. ds tP \0\0
+.\" Test for crt
+. ie \\n(cR .nr Hm 0
+. el .nr Hm .5i
+.\" Footer Margin
+. nr Fm .5i
+.\}
+..
+.\" Adjustment mode
+.if n \{\
+.ad l
+.na
+..
+.\}
+.\" PREDEFINED STRINGS
+.if t \{\
+. ds <= \(<=
+. ds >= \(>=
+. ds Lq \&``
+. ds Rq \&''
+. ds ua \(ua
+. ds aa \(aa
+. ds ga \(ga
+. ds sR \(aa
+. ds sL \(ga
+.\}
+.if n \{\
+. ds <= \&<\&=
+. ds >= \&>\&=
+. ds Rq ''
+. ds Lq ``
+. ds ua ^
+. ds aa '
+. ds ga `
+. ds sL `
+. ds sR '
+.\}
+.\" Note: The distances from the bottom or top of the page are set
+.\" in headers (macro .hK): to -1.25 for troff, and -1.167 for nroff
+.\" bottoms, and top is 0.
+.\"
+.\" .Dt Document/manpage_title section/chapter volume
+.\" The \{ and \} is necessary as roff doesn't nest if-elses
+.\" properly, especially with .ds.
+.\" TODO: separate Dt into Dt, Ch and Vt for supp docs.
+.de Dt
+.ds dT UNTITLED
+.ds vT Local
+.ds cH Null
+.\" Volume and Section Number or Chapter Number
+.if !"\\$1"" .ds dT \\$1
+.if !"\\$2"" \{\
+. ds cH \\$2
+. if "\\$3"" \{\
+. \" Volume Title if none given
+. if \\$2>=1 .if \\$2<=8 \{\
+. ds vT UNIX Reference Manual
+. if \\$2>1 .if \\$2<6 .ds vT UNIX Programmer's Manual
+. if "\\$2"8" .ds vT UNIX System Manager's Manual
+. \}
+. if "\\$2"unass" .ds vT DRAFT
+. if "\\$2"draft" .ds vT DRAFT
+. if "\\$2"paper" .ds vT Null
+. \}
+.\}
+.if !"\\$3"" \{\
+. \" Volume Title if given
+. if "\\$3"USD" .ds vT UNIX User's Supplementary Documents
+. if "\\$3"PS1" .ds vT UNIX Programmers's Supplementary Documents
+. if "\\$3"AMD" .ds vT UNIX Ancestral Manual Documents
+. if "\\$3"SMM" .ds vT UNIX System Manager's Manual
+. if "\\$3"URM" .ds vT UNIX Reference Manual
+. if "\\$3"PRM" .ds vT UNIX Programmers's Manual
+. if "\\$3"IND" .ds vT UNIX Manual Master Index
+. if "\\$3"CON" .ds vT UNIX Contributed Software Manual
+. if "\\$3"IMP" .ds vT UNIX Implementation Notes
+. if "\\$3"HOW" .ds vT UNIX How Pocket Manual
+. if "\\$3"LOCAL" .ds vT UNIX Local Manual
+. if "\\*(vT"Local" .ds vT \\$3
+.\}
+..
+.\"
+.\" .Os Operating System/Standard and Release or Version Number
+.\"
+.de Os
+.ds oS Null
+.if "\\$1"" \{\
+. ds oS \fIBSD Experimental\fP
+.\" . ds oS (\fIBag o' Bits\fP)
+.\}
+.if "\\$2"" \{\
+. ds o1 Non-Null
+.\}
+.if "\\$1"ATT" \{\
+. ds oS AT&T
+. if "\\$2"" .as oS \0UNIX
+. if "\\$2"7th" .as oS \07th Edition
+. if "\\$2"7" .as oS \07th Edition
+. if "\\$2"III" .as oS \0System III
+. if "\\$2"3" .as oS \0System III
+. if "\\$2"V" .as oS \0System V
+. if "\\$2"V.2" .as oS \0System V Release 2
+. if "\\$2"V.3" .as oS \0System V Release 3
+. if "\\$2"V.4" .as oS \0System V Release 4
+.\}
+.if "\\$1"BSD" \{\
+. if "\\$2"3" .ds oS 3rd Berkeley Distribution
+. if "\\$2"4" .ds oS 4th Berkeley Distribution
+. if "\\$2"4.1" .ds oS 4.1 Berkeley Distribution
+. if "\\$2"4.2" .ds oS 4.2 Berkeley Distribution
+. if "\\$2"4.3" .ds oS 4.3 Berkeley Distribution
+. if "\\$2"4.3+" .ds oS 4.3+tahoe Berkeley Distribution
+.\}
+.if "\\*(oS"Null" .ds oS \\$1
+.if "\\*(o1"Non-Null" .as oS \0\\$2
+.rm o1
+..
+.\"
+.\" Standards
+.\"
+.\" .de St
+.\" .ds sT Null
+.\" .if "\\$1"POSIX" \{\
+.\" . ds sT IEEE Standard POSIX
+.\" . if \\$2 .as sT \0\\$2
+.\" .\}
+.\" .if "\\$1"ANSI" \{\
+.\" . ds sT ANSI Standard
+.\" . if \\$2 .as sT \0\\$2
+.\" .\}
+.\" .if "\\$1"ISO" \{\
+.\" . ds sT ISO Standard
+.\" . if \\$2 .as sT \0\\$2
+.\" .\}
+.\" .if "\\*(sT"Null" .ds sR \\$3
+.\" ..
+.\"
+.\" .de Gp
+.\" .ie !"\\$1"" .ds gP \&\\$1 \\$2 \\$3 \\$4 \\$5
+.\" .el .ds gP Null
+.\" ..
+.\"
+.\"
+.de Dd
+.nr aa 0
+.ie \\n(.$>0 \{\
+. ie \\n(.$<4 \{\
+. ds dD \\$1 \\$2 \\$3
+. \}
+. el .tm Usage: .Dd Month Day, Year (e.g July 4, 1977).
+.\}
+.el \{\
+. ds dD Epoch
+.\}
+..
+.\"
+.\" House Keeping Macro - Make sense of dT, cH, vT, sT, gP and dS
+.\" TODO: Try to get else's for efficiency
+.\" TODO: GET RID OF .wh -1.167i (its in v7)
+.\"
+.\"
+.de hK
+.nr % 1
+.ds hT \\*(dT
+.if !"\\*(cH"Null" \{\
+. ie !"\\*(gP"Null" .as hT \|(\|\\*(cH\\*(gP\|)
+. el .as hT \\|(\\|\\*(cH\\|)
+.\}
+.if "\\*(cH"Null" .if !"\\*(gP"Null" .as hT \&\|(\|\\*(gP\|)
+.if t \{\
+. wh 0 hM
+. wh -1.25i fM
+.\}
+.if n \{\
+. ie \\n(cR \{\
+. hM
+. wh -0v fM
+. \}
+. el \{\
+. wh 0 hM
+. wh -1.167i fM
+. \}
+.\}
+.if n \{\
+. if \\n(nl==0:\\n(nl==-1 'bp
+.\}
+.if t 'bp
+.em lM
+..
+.\" Header Macro
+.\"
+.de hM
+.ev 1
+.pL
+.if !\\n(cR 'sp \\n(Hmu
+.tl @\\*(Hs\\*(hT\fP@\\*(Vs\\*(vT\fP@\\*(Hs\\*(hT\fP@
+'sp \\n(Hmu
+.ev
+..
+.\"
+.de fM
+.ev 1
+.pL
+.if !\\n(cR \{\
+' sp \\n(Fmu
+. tl @\\*(Hs\\*(oS\fP@\\*(Vs\\*(dD\fP@%@
+' bp
+.\}
+.if \\n(cR \{\
+.\" . tl @\\*(Hs\\*(oS\fP@\\*(Vs\\*(dD\fP@%@
+.\" ' bp
+.\}
+.ev
+..
+.de lM
+.fl
+.if \\n(cR \{\
+. fM
+. pl \\n(nlu
+.\}
+..
+.de Pp
+.sp \\n(Ppu
+.ne 2
+.ns
+..
+.de Lp
+.Pp
+..
+.de LP
+.tm Not a \-mdoc command: .LP
+..
+.de PP
+.tm Not a \-mdoc command: .PP
+..
+.de pp
+.tm Not a \-mdoc command: .pp
+..
+.de Co
+.tm Not a \-mdoc command: .Co
+..
+.nr z. 1
+.nr z, 1
+.nr z: 1
+.nr z; 1
+.nr z) 1
+.nr z( 1
+.nr z[ 1
+.nr z] 1
+.\" This is disgusting, troff not parse if stmt properly
+.nr z1 0
+.nr z2 0
+.nr z3 0
+.nr z4 0
+.nr z5 0
+.nr z6 0
+.nr z7 0
+.nr z8 0
+.nr z9 0
+.nr z0 0
+.nr z# 0
+.\"
+.de Ad
+.ie \\n(.$==0 \{\
+. tm Usage: .Ad address [...] \\*(Pu
+.\}
+.el \{\
+. ds sV \\*(aD
+. nr cF \\n(.f
+. ie "\\*(iM"" .ds f1 \&\\*(sV
+. el .as f1 \&\\*(sV
+. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. ft \\n(cF
+.\}
+..
+.\"
+.\" Command Line Argument Macro
+.\"
+.de Ar
+.ie \\n(.$==0 \{\
+. ie !"\\*(iM"" .as f1 \&[\|\\*(aRfile\ ...\fP\|]
+. el \&[\|\\*(aRfile\ ...\fP\|]
+.\}
+.el \{\
+. ds sV \\*(aR
+. nr cF \\n(.f
+. ie "\\*(iM"" .ds f1 \&\\*(sV
+. el .as f1 \&\\*(sV
+. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. ft \\n(cF
+.\}
+..
+.\"
+.de Em
+.ie \\n(.$==0 \{\
+. tm Usage: .Em text ... \\*(Pu
+.\}
+.el \{\
+. ds sV \\*(eM
+. nr cF \\n(.f
+. ie "\\*(iM"" .ds f1 \&\\*(sV
+. el .as f1 \&\\*(sV
+. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. ft \\n(cF
+.\}
+..
+.\"
+.de Er
+.ie \\n(.$==0 \{\
+. tm Usage: .Er ERRNOTYPE ... \\*(Pu
+. \}
+.el \{\
+. ds sV \\*(eR
+. nr cF \\n(.f
+. ie "\\*(iM"" .ds f1 \&\\*(sV
+. el .as f1 \&\\*(sV
+. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. ft \\n(cF
+.\}
+..
+.\"
+.de Ev
+.ie \\n(.$==0 \{\
+. tm Usage: .Ev ENVIRONMENT_VARIABLE(s) ... \\*(Pu
+. \}
+.el \{\
+. ds sV \\*(eV
+. nr cF \\n(.f
+. ie "\\*(iM"" .ds f1 \&\\*(sV
+. el .as f1 \&\\*(sV
+. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. ft \\n(cF
+.\}
+..
+.\"
+.\" Flag Name Macro
+.\"
+.de Fl
+.ie \\n(.$==0 \{\
+. ie !"\\*(iM"" .as f1 \&\\*(fL\-\fP
+. el \&\\*(fL\-\fP
+.\}
+.el \{\
+. nr rZ 0
+. sW \\$1
+. if (\\n(sW==1&\\n(.$==1) .rZ \\$1
+. ds sV \\*(fL
+. nr cF \\n(.f
+. ie \\n(rZ \{\
+. ie "\\*(iM"" .ds f1 \&\\*(sV\-\f\\n(cF\\$1
+. el \&\\*(sV\-\f\\n(cF\\$1
+. \}
+. el \{\
+. ie "\\*(iM"" .ds f1 \&\\*(sV
+. el .as f1 \&\\*(sV
+. fB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. ft \\n(cF
+. \}
+.\}
+..
+.\" Interactive Commands Macro
+.\"
+.de Ic
+.ie \\n(.$==0 \{\
+. tm Usage: .Ic Interactive Commands(s) ... \\*(Pu
+.\}
+.el \{\
+. ds sV \\*(iC
+. nr cF \\n(.f
+. ie "\\*(iM"" .ds f1 \&\\*(sV
+. el .as f1 \&\\*(sV
+. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. ft \\n(cF
+.\}
+..
+.\"
+.\" Interactive Command Modifiers (flags)
+.\"
+.de Cm
+.ie \\n(.$==0 \{\
+. tm Usage: .Cm Interactive Command Modifier(s) ... \\*(Pu
+.\}
+.el \{\
+. ds sV \\*(cM
+. nr cF \\n(.f
+. ie "\\*(iM"" .ds f1 \&\\*(sV
+. el .as f1 \&\\*(sV
+. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. ft \\n(cF
+.\}
+..
+.\"
+.de Li
+.ie \\n(.$==0 \{\
+. tm Usage: .Li literal ... \\*(Pu
+. \}
+.el \{\
+. ds sV \\*(lI
+. nr cF \\n(.f
+. ie "\\*(iM"" .ds f1 \&\\*(sV
+. el .as f1 \&\\*(sV
+. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. ft \\n(cF
+.\}
+..
+.\" If in nroff or any other case where the default font
+.\" is constant width, and literal means zilch, single quote instead.
+.ie n \{\
+.de Ql
+. ie \\n(.$==0 \{\
+. tm Usage: .Ql literal ... \\*(Pu
+. \}
+. el \{\
+. Sq \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
+..
+.\}
+.el \{\
+.de Ql
+. ie \\n(.$==0 \{\
+. tm Usage: .Ql literal ... \\*(Pu
+. \}
+. el \{\
+. Li \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
+..
+.\}
+.\"
+.de Nm
+.ie \\n(.$==0 \{\
+. if "\\*(n1"" .tm Usage: .Nm Name(s) ... \\*(Pu
+. ie !"\\*(iM"" .as f1 \&\\*(nM\\*(n1\\$1\fP
+. el \&\\*(nM\\*(n1\\$1\fP
+.\}
+.el \{\
+. ds sV \\*(nM
+. nr cF \\n(.f
+. if \\n(nS \{\
+. rs
+. in -\\n(iSu
+. ie \\n(nS>1 .br
+. el \{\
+. sW \\$1
+. nr iS ((\\n(sW+1)*\\n(fW)u
+. \}
+. in +\\n(iSu
+. ti -\\n(iSu
+. nr nS \\n(nS+1
+. \}
+. if "\\*(n1"" .ds n1 \\$1
+. ie "\\*(iM"" .ds f1 \&\\*(sV
+. el .as f1 \&\\*(sV
+. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. ft \\n(cF
+.\}
+..
+.\"
+.de Pa
+.ie \\n(.$==0 \{\
+\&\\*(pA~\fP
+.\}
+.el \{\
+. ds sV \\*(pA
+. nr cF \\n(.f
+. ie "\\*(iM"" .ds f1 \&\\*(sV
+. el .as f1 \&\\*(sV
+. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. ft \\n(cF
+.\}
+..
+.\"
+.de Sy
+.ie \\n(.$==0 \{\
+. tm Usage: .Sy Symbolic Text ... \\*(Pu
+. \}
+.el \{\
+. ds sV \\*(sY
+. nr cF \\n(.f
+. ie "\\*(iM"" .ds f1 \&\\*(sV
+. el .as f1 \&\\*(sV
+. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. ft \\n(cF
+.\}
+..
+.\"
+.de Ms
+.ie \\n(.$==0 \{\
+. tm Usage: .Ms Math Symbol ... \\*(Pu
+. \}
+.el \{\
+. ds sV \\*(sY
+. nr cF \\n(.f
+. ie "\\*(iM"" .ds f1 \&\\*(sV
+. el .as f1 \&\\*(sV
+. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. ft \\n(cF
+.\}
+..
+.\"
+.de Va
+.ie \\n(.$==0 \{\
+. tm Usage: .Va variable_name(s) ... \\*(Pu
+.\}
+.el \{\
+. ds sV \\*(vA
+. nr cF \\n(.f
+. ie "\\*(iM"" .ds f1 \&\\*(sV
+. el .as f1 \&\\*(sV
+. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. ft \\n(cF
+.\}
+..
+.\"
+.de nB
+.hy 0
+.if \\n(.$==0 .tm Usage error: called with empty arguments (empty quotes)?
+.ie \\n(.$>1 \{\
+. rZ \\$1
+. ie \\n(rZ .as f1 \&\f\\n(cF\\$1\fP
+. el .as f1 \&\\$1
+. rZ \\$2
+. if !\\n(rZ \{\
+. ie !"\\*(iM""\{\
+.\" I surrender
+. if "\\*(iM"Tp" .as f1 \&\ \&
+. if "\\*(iM"Dp" .as f1 \&\ \&
+. if "\\*(iM"Op" .as f1 \&\ \&
+. if "\\*(iM"Cx" .as f1 \&\ \&
+. if "\\*(iM"Dq" .as f1 \& \&
+. if "\\*(iM"Sq" .as f1 \& \&
+. if "\\*(iM"Pq" .as f1 \& \&
+. if "\\*(iM"Aq" .as f1 \& \&
+. \}
+. el .as f1 \& \&
+. \}
+. nB \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.\}
+.el \{\
+. rZ \\$1
+. ie \\n(rZ .as f1 \&\f\\n(cF\\$1
+. el .as f1 \&\\$1\f\\n(cF
+. if "\\*(iM"" \{\&\\*(f1
+. ds f1
+. \}
+. hy
+.\}
+..
+.de fB
+.hy 0
+.if \\n(.$==0 .tm Usage error: called with empty arguments (empty quotes)?
+.ie \\n(.$>1 \{\
+. rZ \\$1
+. ie \\n(rZ .as f1 \&\f\\n(cF\\$1\fP
+. el \{\
+. ie "\\$1"-" .as f1 \&\-\-
+. el .as f1 \&\-\\$1
+. \}
+. rZ \\$2
+. if !\\n(rZ \{\
+. ie !"\\*(iM""\{\
+.\" I surrender
+. if "\\*(iM"Tp" .as f1 \&\ \&
+. if "\\*(iM"Dp" .as f1 \&\ \&
+. if "\\*(iM"Op" .as f1 \&\ \&
+. if "\\*(iM"Cx" .as f1 \&\ \&
+. if "\\*(iM"Dq" .as f1 \& \&
+. if "\\*(iM"Sq" .as f1 \& \&
+. if "\\*(iM"Pq" .as f1 \& \&
+. if "\\*(iM"Aq" .as f1 \& \&
+. \}
+. el .as f1 \& \&
+. \}
+. fB \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.\}
+.el \{\
+. rZ \\$1
+. ie \\n(rZ .as f1 \&\f\\n(cF\\$1
+. el \{\
+. ie "\\$1"-" .as f1 \&\-\-\f\\n(cF
+. el .as f1 \&\-\\$1\f\\n(cF
+. \}
+. if "\\*(iM"" \{\&\\*(f1
+. ds f1
+. \}
+. hy
+.\}
+..
+.\"
+.\" Single quoted Items
+.\" eF, sB g[0-9] and f2
+.de Sq
+.nr eF 0
+.ie \\n(.$==0 \{\
+. ie "\\*(iM"" \&\\*(sL\&\\*sR
+. el .as f1 \&\\*(sL\&\\*(sR
+.\}
+.el \{\
+. ie "\\*(iM"" \{\
+. ds f1 \&\\*(sL
+. ds iM Sq
+. \}
+. el .as f1 \&\\*(sL
+. sB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. ie \\n(eF>0 .\\*(g1 \\*(g2 \\*(g3 \\*(g4 \\*(g5 \\*(g6 \\*(g7 \\*(g8
+. el .as f1 \\*(g0
+. as f1 \\*(sR
+. if !"\\*(f2"" .as f1 \\*(f2
+. if "\\*(iM"Sq" \{\
+\&\\*(f1
+. ds f1
+. ds iM
+. \}
+. ds f2
+. rm g0 g1 g2 g3 g4 g5 g6 g7 g8 g9
+. nr eF 0
+.\}
+..
+.\"
+.\" Double quoted Items
+.de Dq
+.nr Ef 0
+.ie \\n(.$==0 \{\
+. ie "\\*(iM"" \&\\*(Lq\&\\*(Rq
+. el .as f1 \&\\*(Lq\&\\*(Rq
+.\}
+.el \{\
+. ie "\\*(iM"" \{\
+. ds f1 \&\\*(Lq
+. ds iM Dq
+. \}
+. el .as f1 \&\\*(Lq
+. Sb \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. ie \\n(Ef>0 .\\*(k1 \\*(k2 \\*(k3 \\*(k4 \\*(k5 \\*(k6 \\*(k7 \\*(k8
+. el .as f1 \\*(k0
+. as f1 \\*(Rq
+. if !"\\*(f4"" .as f1 \\*(f4
+. if "\\*(iM"Dq" \{\
+\&\\*(f1
+. ds f1
+. ds iM
+. \}
+. ds f4
+. rm k0 k1 k2 k3 k4 k5 k6 k7 k8 k9
+. nr Ef 0
+.\}
+..
+.\"
+.\" Parenthesis quoted Items
+.de Pq
+.nr pQ 0
+.ie \\n(.$==0 \{\
+. ie "\\*(iM"" \&(\&)
+. el .as f1 \&(\&)
+.\}
+.el \{\
+. ie "\\*(iM"" \{\
+. ds f1 \&(
+. ds iM Pq
+. \}
+. el .as f1 \&(
+. pB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. ie \\n(pQ>0 .\\*(y1 \\*(y2 \\*(y3 \\*(y4 \\*(y5 \\*(y6 \\*(y7 \\*(y8
+. el .as f1 \\*(y0
+. as f1 \&)
+. if !"\\*(f3"" .as f1 \\*(f3
+. if "\\*(iM"Pq" \{\
+\&\\*(f1
+. ds f1
+. ds iM
+. \}
+. ds f3
+. rm y0 y1 y2 y3 y4 y5 y6 y7 y8 y9
+. nr pQ 0
+.\}
+..
+.\" eF, sB g[0-9] and f2
+.de sB
+.hy 0
+.ie \\n(.$==0 .tm Sick Logic: macro sB
+.el \{\
+. ie \\n(eF>=1 .nr eF \\n(eF+1
+. el \{\
+. mN \\$1
+. if \\n(mN .nr eF \\n(eF+1
+. \}
+. rZ \\$1
+. ie \\n(rZ .as f2 \\$1
+. el \{\
+. ie \\n(eF<1 .as g\\n(eF \\$1
+. el .as g\\n(eF \\$1
+. \}
+. if \\n(.$>1 \{\
+. rZ \\$2
+. if \\n(rZ==0 \{\
+. if \\n(eF<1 \{\
+. as g\\n(eF \& \&
+. \}
+. \}
+. sB \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
+.\}
+..
+.de Sb
+.hy 0
+.ie \\n(.$==0 .tm Sick Logic: macro Sb
+.el \{\
+. ie \\n(Ef>=1 .nr Ef \\n(Ef+1
+. el \{\
+. mN \\$1
+. if \\n(mN .nr Ef \\n(Ef+1
+. \}
+. rZ \\$1
+. ie \\n(rZ .as f4 \\$1
+. el \{\
+. ie \\n(Ef<1 .as k\\n(Ef \\$1
+. el .as k\\n(Ef \\$1
+. \}
+. if \\n(.$>1 \{\
+. rZ \\$2
+. if \\n(rZ==0 \{\
+. if \\n(Ef<1 \{\
+. as k\\n(Ef \& \&
+. \}
+. \}
+. Sb \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
+.\}
+..
+.de pB
+.hy 0
+.ie \\n(.$==0 .tm Sick Logic: macro pB
+.el \{\
+. ie \\n(pQ>=1 .nr pQ \\n(pQ+1
+. el \{\
+. mN \\$1
+. if \\n(mN .nr pQ \\n(pQ+1
+. \}
+. rZ \\$1
+. ie \\n(rZ .as f3 \\$1
+. el \{\
+. ie \\n(pQ<1 .as y\\n(pQ \\$1
+. el .as y\\n(pQ \\$1
+. \}
+. if \\n(.$>1 \{\
+. rZ \\$2
+. if \\n(rZ==0 \{\
+. if \\n(pQ<1 \{\
+. as y\\n(pQ \& \&
+. \}
+. \}
+. pB \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
+.\}
+..
+.de aQ
+.hy 0
+.ie \\n(.$==0 .tm Bad Syntax: .Aq
+.el \{\
+. ie \\n(aQ>=1 .nr aQ \\n(aQ+1
+. el \{\
+. mN \\$1
+. if \\n(mN .nr aQ \\n(aQ+1
+. \}
+. rZ \\$1
+. ie \\n(rZ .as aZ \\$1
+. el \{\
+. ie \\n(aQ<1 .as a\\n(aQ \\$1
+. el .as a\\n(aQ \\$1
+. \}
+. if \\n(.$>1 \{\
+. rZ \\$2
+. if \\n(rZ==0 \{\
+. if \\n(aQ<1 \{\
+. as a\\n(aQ \& \&
+. \}
+. \}
+. aQ \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
+.\}
+..
+.\" Angle Bracket Quoted Items
+.de Aq
+.nr aQ 0
+.ie \\n(.$==0 \{\
+. ie "\\*(iM"" \&<\&>
+. el .as f1 \&<\&>
+.\}
+.el \{\
+. ie "\\*(iM"" \{\
+. ds f1 \&<
+. ds iM Aq
+. \}
+. el .as f1 \&<
+. aQ \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
+. ie \\n(aQ>0 .\\*(a1 \\*(a2 \\*(a3 \\*(a4 \\*(a5 \\*(a6 \\*(a7 \\*(a8
+. el .as f1 \\*(a0
+. as f1 \&>
+. if !"\\*(aZ"" .as f1 \\*(aZ
+. if "\\*(iM"Aq" \{\
+\&\\*(f1
+. ds f1
+. ds iM
+. \}
+. ds aZ
+. rm a0 a1 a2 a3 a4 a5 a6 a7 a8
+. nr aQ 0
+.\}
+..
+.\" macro Name test, return macro register value if true
+.if \n(.g .ig
+.de mN
+.nr mN 0
+.sW \\$1
+.if \\n(sW==2 \{\
+. if \\n(\\$1 .nr mN \\n(\\$1
+.\}
+..
+.if !\n(.g .ig
+.de mN
+.nr mN 0
+.if \A'\\$1' \{\
+. sW \\$1
+. if \\n(sW==2 \{\
+. if \\n(\\$1 .nr mN \\n(\\$1
+. \}
+.\}
+..
+.\" Punctuation test (using z registers), return 1 if true
+.if \n(.g .ig
+.de rZ
+.nr rZ 0
+.sW \\$1
+.if \\n(sW==1 \{\
+. if \\n(z\\$1==1 \{\
+. nr rZ 1
+. \}
+.\}
+..
+.if !\n(.g .ig
+.de rZ
+.nr rZ 0
+.if \A'\\$1' \{\
+. sW \\$1
+. if \\n(sW==1 \{\
+. if \\n(z\\$1==1 \{\
+. nr rZ 1
+. \}
+. \}
+.\}
+..
+.\"
+.\" sW returns number of characters in a string
+.if t \{\
+.nr fW \w'\fC,'
+.de sW
+.nr sW \w'\fC\\$1'
+.\}
+.if n \{\
+.nr fW \w'0'
+.de sW
+.nr sW \w'\\$1'
+.\}
+.ie \\n(sW>=\\n(fW \{\
+. ie \\n(sW%\\n(fW .nr sW (\\n(sW/\\n(fW)+1
+. el .nr sW \\n(sW/\\n(fW
+.\}
+.el .nr sW 0
+..
+.\" Option Expression -
+.\" TODO - add line overflow check (right!)
+.nr eP 0
+.ds e1
+.nr oE 0
+.nr hP 0
+.ds hP
+.nr Ep 0
+.de Op
+.hy 0
+.if "\\*(iM"" \{\
+. ds iM Op
+. ds f1 \&
+.\}
+.as f1 \&\\*(lB
+.\" .tm Op: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.dO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.ie !"\\$1"Cx" .oE
+.el .nr oE \\n(oE+1
+..
+.\"
+.\" just for mike, with every bite of garlic in mind (oops, i mean burp).
+.\" dO: go dOwn an argument vector and test each argument to see if
+.\" a macro name or punctuation. stash in respective place along
+.\" with its arguments.
+.nr oO 0
+.nr oP 0
+.nr aO 0
+.de dO
+.mN \\$1
+.ie \\n(mN \{\
+. if \\n(oP \{\
+. if \\n(hP \{\
+. nr oZ 1
+. oZ
+. Oz
+. \}
+. if \\n(e1==1 \{\
+.\\*(e1 \\*(e2 \\*(e3 \\*(e4 \\*(e5 \\*(e6 \\*(e7 \\*(e8 \\*(e9
+. \}
+. uO
+. if !(\\n(oO:\\n(aO) .as f1 \& \&
+. \}
+. ie "\\$1"Op" \{\
+. as f1 \&\\*(lB
+. nr aO \\n(aO+1
+. \}
+. el \{\
+. nr eP \\n(eP+1
+. ds e\\n(eP \\$1
+. nr e\\n(eP 1
+. \}
+.\}
+.el \{\
+.\" .tm dO: $1: \\$1: eP \\n(eP e[\\n(eP]: \\*(e\\n(ePEE
+. rZ \\$1
+. ie \\n(rZ \{\
+.\" .tm dO:rZ: $1: \\$1: eP \\n(eP e[\\n(eP]: \\*(e\\n(eP
+. nr hP \\n(hP+1
+. ds h\\n(hP \\$1
+. \}
+. el \{\
+.\" .tm dO:word $1: \\$1: eP \\n(eP e[\\n(eP]: \\*(e\\n(ePEE
+. if \\n(eP==0:\\n(e\\n(eP==1 .nr eP \\n(eP+1
+. if \\n(eZ .as e\\n(eP \& \&
+. as e\\n(eP " \&\\$1
+.\" . ds e\\n(eP \&\\$1
+. nr eZ \\n(eZ+1
+. \}
+.\}
+.nr oP 1
+.ie \\n(.$>1 \{\
+. dO \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.\}
+.el \{\
+. ie \\n(e1 \{\
+.\\*(e1 \\*(e2 \\*(e3 \\*(e4 \\*(e5 \\*(e6 \\*(e7 \\*(e8 \\*(e9
+. \}
+. el \{\
+. as f1 \\*(e1
+. \}
+.\}
+..
+.\" handle old style arguments such as the arg -Idir
+.\" in adb, .Oo is a toggle.
+.de Oo
+.ie \\n(oO .nr oO 0
+.el .nr oO 1
+..
+.\" stash punctuation
+.de oZ
+.if \\n(hP>=\\n(oZ \{\
+. nr eP \\n(eP+1
+. ds e\\n(eP \\*(h\\n(oZ
+. nr oZ \\n(oZ+1
+. oZ
+.\}
+..
+.\" clean up punctuation vector
+.de Oz
+.if \\n(hP>0 \{\
+. rm h\\n(hP
+. nr hP \\n(hP-1
+. Oz
+.\}
+..
+.\" uO: go back up created vector cleaning it up along the way
+.de uO
+.if \\n(eP>0 \{\
+. rm e\\n(eP
+. rr e\\n(eP
+. nr eP \\n(eP-1
+. nr oP 0
+. nr eZ 0
+. uO
+.\}
+..
+.\" option end
+.de oE
+.uO
+.ie \\n(hP \{\
+. as f1 \\*(rB\\*(h1\\*(h2\\*(h3
+. Oz
+. nr oZ 0
+.\}
+.el \{\
+. as f1 \\*(rB
+.\}
+.ie "\\*(iM"Op" \{\
+. if \\n(aO .aO
+.if t \{\
+. if (\\n(.lu-\\n(.ku-\\n(.ou-(2*\\n(fWu))<\w'\fC\\*(f1'u .br
+.\}
+.if n \{\
+. nr aa \w'\\*(f1'u
+.\" . nr qq \\n(.lu-\\n(.ku-\\n(.ou
+.\" \&aa == \\n(aa, f1==\\*(f1, qq==\\n(qq
+. if (\\n(.lu-\\n(.ku-\\n(.ou-\\n(aau)<=(8*\\n(fWu) .br
+.\}
+\&\\*(f1
+. ds iM
+. ds f1
+. hy
+.\}
+.el .nr oE \\n(oE-1
+..
+.de aO
+.as f1 \\*(rB
+.nr aO \\n(aO-1
+.if \\n(aO >0 .aO
+..
+.\"
+.de Xr
+.if \\n(.$<=1 \{\
+. ie \\n(.$==1 \{\
+. if !"\\*(iM"" .as f1 \&\\*(xR\\$1\fP
+. if "\\*(iM"" \&\\*(xR\\$1\fP
+. \}
+. el .tm Xr Usage: .Xr manpage_name [section#] \\*(Pu
+.\}
+.if \\n(.$==2 \{\
+. rZ \\$2
+. ie "\\*(iM"" \{\
+. ie \\n(rZ \&\\*(xR\\$1\fP\\$2
+. el \&\\*(xR\\$1\fP(\\$2)
+. \}
+. el \{\
+. ie \\n(rZ .as f1 \&\\*(xR\\$1\fP\\$2
+. el .as f1 \&\\*(xR\\$1\fP(\\$2)
+. \}
+.\}
+.if \\n(.$>=3 \{\
+. rZ \\$2
+. ie \\n(rZ \{\
+. ie !"\\*(iM"" .as f1 \&\\*(xR\\$1\fP\\$2\\$3\\$4\\$5\\$6\\$7\\$8
+. el \&\\*(xR\\$1\fP\\$2\\$3\\$4\\$5\\$6\\$7\\$8
+. \}
+. el \{\
+. rZ \\$3
+. ie \\n(rZ \{\
+. if !"\\*(iM"" \{\
+. as f1 \&\\*(xR\\$1\fP(\\$2)\\$3\\$4\\$5\\$6\\$7\\$8
+. \}
+. if "\\*(iM"" \{\
+\&\\*(xR\\$1\fP(\\$2)\\$3\\$4\\$5\\$6\\$7\\$8
+. \}
+. \}
+. el \{\
+. tm rZ = \\n(rZ the arg is \\$3
+. tm Xr-XX Usage: .Xr manpage_name [section#] \\*(Pu
+. \}
+. \}
+.\}
+..
+.\"
+.\"
+.de Ex
+.tm Ex defunct, Use .Dl: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" Display (one) Line of text.
+.de Dl
+.ie "\\*(iM"" \{\
+' ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
+. in \\n(.iu+\\n(Dsu
+. mN \\$1
+. ie \\n(mN .\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. el \{\
+. nr cF \\n(.f
+.\" Literal font is none specified
+\&\\*(lI\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. ft \\n(cF
+. \}
+. in \\n(.iu-\\n(Dsu
+.\}
+.el \{\
+. mN \\$1
+. ie \\n(mN .\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
+. el \{\
+. nr cF \\n(.f
+. ds f1 \&\\*(lI\\&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
+. as f1 \&\f\\n(cF
+. \}
+.\}
+..
+.\"
+.\"
+.\" user set Tagged Paragraph Width (used in both Dp and Tp)
+.de Tw
+.ie \\n(.$==0 \{\
+. nr aa 0
+.\}
+.el \{\
+. mN \\$1
+. ie \\n(sW>2 \{\
+. nr tW (\\n(sW+3)*\\n(fWu)
+. \}
+. el \{\
+. ie \\n(mN .nr tW \\n(mN
+. el .nr tW \\$1
+. \}
+. nr tF 1
+.\}
+..
+.\"
+.de Dw
+.Tw \\$1
+..
+.\"
+.de Di
+.ie \\n(.$==0 \{\
+. nr tI \\n(Dsu
+.\}
+.el \{\
+. sW \\$1
+. if \\n(sW>=2 \{\
+. nr tI \\$1u
+. \}
+. if \\n(sW<2 \{\
+. if "\\$1"L" \{\
+. nr tI 0
+. \}
+. \}
+.\}
+..
+.\" tagged paragraph
+.\" initialize baby stack variables
+.nr np 0
+.nr p1 0
+.ds s\n(np
+.\"
+.de Tp
+.ie "\\$1"" .pE p s np
+.el \{\
+. ds iM Tp
+. mN \\$1
+. ie \\n(tF \{\
+. ds tC Tw
+. nr tC 1
+. nr tF 0
+. \}
+. el \{\
+. if !"Tw"\\*(s\\n(np" \{\
+. ie \\n(mN \{\
+. ds tC \\$1
+. nr tW \\n(mN
+. \}
+. el \{\
+. ds tC Tx
+. nr tW \\n(Tx
+. \}
+. if !"\\*(tC"\\*(s\\n(np" .nr tC 1
+. \}
+. \}
+. sp \\n(vVu
+. if !\\n(cR .ne 2
+. if \\n(tC \{\
+. nr np \\n(np+1
+. nr p\\n(np \\n(tW
+. ds s\\n(np \\*(tC
+. nr tC 0
+. ds tC
+. in \\n(.iu+\\n(p\\n(npu
+. \}
+. ie \\n(mN \{\
+. ds f1
+. \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. if !"\\$1"Cx" .pT st p np
+. \}
+. el \{\
+. br
+. ev 1
+. fi
+. di Td
+\&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. br
+. di
+. ev
+. na
+. ds tD \\*(Td\\
+. pT di p np
+. \}
+.\}
+..
+.\"
+.\"
+.\" Complex Expression Macro
+.\"
+.\" TODO: add length across line boundary check (like Li)
+.de Cx
+.hy 0
+.ie \\n(.$==0 \{\
+. if "\\*(iM"Cx" \{\
+. ds iM
+. if \\n(oE .oE
+\&\\*(f1
+. ds f1
+. \}
+. if "\\*(iM"Tp" .pT st p np
+. if "\\*(iM"Dp" .pT st q mp
+.\}
+.el \{\
+. if "\\*(iM"" \{\
+. ds iM Cx
+. ds f1 \&
+. \}
+. mN \\$1
+.\" Here are the args: `\\$1' `\\$2' `\\$3' `\\$4'
+. ie \\n(mN .\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. el \{\
+. as f1 \&\\$1
+. if \\n(.$>1 .Cx \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
+.\}
+..
+.\" Prefix string in default font to content specified string
+.de Pf
+.Cx \\$1
+.\\$2 \\$3 \\$4 \\$5
+.Cx
+..
+.\" Suffix string in default font to content specified string
+.de Sf
+.Cx \\$1 \\$2
+.Cx \\$3
+.Cx
+..
+.\" Simple Option Begin
+.de Ob
+.hy 0
+.ie "\\*(iM"" \{\
+. ev 2
+. fi
+. di oB
+.\}
+.el \{\
+.tm shouldn't be here
+. as f1 \&[
+. mN \\$1
+. ie \\n(mN .\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. el \{\
+. as f1 \&\\$1
+. if \\n(.$>1 .Oc \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
+.\}
+..
+.de Oc
+.as f1 \&\\$1
+.if \\n(.$>1 .Oc \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.de Oe
+.hy 0
+.ie "\\*(iM"" \{\
+. br
+. di
+. ev
+. ds bO \\*(oB\\
+\&[\\*(bO\&]
+.\}
+.el \{\
+. as f1 \&]
+.\}
+..
+.\" White space for Cx
+.de Ws
+.Cx \&\ \&
+..
+.\" tagged paragraph
+.\" initialize baby stack variables
+.nr mp 0
+.nr q1 0
+.ds r\n(np
+.\"
+.\" Complex Dp tag
+.de Dc
+.Dp Cx \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
+..
+.\" Complex Tp tag
+.de Tc
+.Tp Cx \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
+..
+.\" Tag with a flag and an argument with a space
+.de Ta
+.if "\\$2"" \{\
+. Tp Fl \\$1
+.\}
+.el \{\
+. Tp Fl \\$1
+. Cx \&\ \&
+. Ar \\$2 \\$3
+. Cx
+.\}
+..
+.de Da
+.Dp Cx Fl \\$1
+.Ws
+.Ar \\$2 \\$3
+.Cx
+..
+.de To
+.Tp Cx Fl \\$1
+.Ar \\$2 \\$3
+.Cx
+..
+.de Do
+.Dp Cx Fl \\$1
+.Ar \\$2 \\$3
+.Cx
+..
+.\" Blended tag toggle
+.de Bt
+.ie \\n(tP==0 .nr tP 1
+.el .nr tP 0
+..
+.\" Bullet paragraph
+.de Bu
+.Tp Sy \&\(bu
+..
+.\" Display tagged paragraph
+.de Dp
+.ie "\\$1"" \{\
+. pE q r mp
+. sp \\n(vVu
+.\}
+.el \{\
+. ds iM Dp
+. mN \\$1
+. ie \\n(tF \{\
+. ds tC Tw
+. nr tC 1
+. nr tF 0
+. \}
+. el \{\
+. if !"Tw"\\*(r\\n(mp" \{\
+. ie \\n(mN \{\
+. ds tC \\$1
+. nr tW \\n(mN
+. \}
+. el \{\
+. ds tC Tx
+. nr tW \\n(Tx
+. \}
+. if !"\\*(tC"\\*(r\\n(mp" .nr tC 1
+. \}
+. \}
+. if !\\n(cR .ne 2
+. if \\n(tC \{\
+. nr mp \\n(mp+1
+. nr q\\n(mp \\n(tW
+. ds r\\n(mp \\*(tC
+. nr tC 0
+. ds tC
+. ie \\n(tIu==\\n(Dsu .nr i\\n(mp \\n(Dsu
+. el \{\
+. nr i\\n(mp \\n(tIu
+. nr tI \\n(Dsu
+. \}
+. in \\n(.iu+\\n(i\\n(mpu
+. sp \\n(vVu
+. in \\n(.iu+\\n(\\q\\n(mpu
+. \}
+. ie \\n(mN \{\
+. \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. if !"\\$1"Cx" .pT st q mp
+. \}
+. el \{\
+. br
+. ev 1
+. fi
+. di Td
+\&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. br
+. di
+. ev
+. na
+. ds tD \\*(Td\\
+. pT di q mp
+. \}
+.\}
+..
+.\"
+.\" .pE number_stack string_stack counter
+.de pE
+.ie "\\$3"mp" \{\
+. in \\n(.iu-(\\n(\\$1\\n(\\$3u)-(\\n(i\\n(mpu)
+. rr i\\n(mp
+.\}
+.el .in \\n(.iu-\\n(\\$1\\n(\\$3u
+.\" .in \\n(.iu-\\n(\\$1\\n(\\$3u
+.if \\n(\\$3<=0 .tm Extraneous call .Tp or .Dp
+.rr \\$1\\n(\\$3
+.rm \\$2\\n(\\$3
+.nr \\$3 \\n(\\$3-1
+.ds iM
+..
+.\"
+.\" .pT [st or di] number_stack counter
+.de pT
+.ie "\\$1"st" \{\
+. nr bb \\n(\\$2\\n(\\$3u
+. ti -\\n(bbu
+. ie (\\n(\\$2\\n(\\$3u-2n)<=\w'\\*(f1'u \{\&\\*(f1\\*(tP
+. if \\n(tP==0 .br
+. \}
+. el \\*(f1\h'|\\n(\\$2\\n(\\$3u'\c
+.\}
+.el \{\
+. ti -\\n(\\$2\\n(\\$3u
+. ie (\\n(\\$2\\n(\\$3u-2n)<=\\n(dlu \{\&\\*(tD\\*(tP
+. if !\\n(tP .br
+. \}
+. el \\*(tD\h'|\\n(\\$2\\n(\\$3u'\c
+. if t 'ad
+.\}
+. ds iM
+. ds f1
+'fi
+..
+.\"
+.\" The new SH
+.\"
+.de Sh
+.\" set Sh state off, check for list state before calling indent (.In)
+.nr nS 0
+.nr sE 0
+.ie "\\$1"NAME" \{\
+.\" name state on, housekeep (headers & footers)
+. hK
+' in 0
+.\}
+.el \{\
+. if "\\$1"SYNOPSIS" .nr nS 1
+. in 0
+.\}
+.pL
+'sp
+.ns
+.ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
+.if !\\n(cR .ne 3
+'fi
+\&\fB\\$1 \|\\$2 \|\\$3 \|\\$4 \|\\$5 \|\\$6 \|\\$7 \|\\$8 \|\\$9
+\&\fP\&
+.in \\n(.iu+\\n(Tiu
+.if "\\$1"SEE" .nr sE 1
+.ns
+..
+.\"
+.\" Nd minus sign for an en dash used in .Sh Name
+.de Nd
+\&\-\& \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.de Ss
+.sp
+.ti -.25i
+\&\fB\\$1 \|\\$2 \|\\$3 \|\\$4 \|\\$5 \|\\$6 \|\\$7 \|\\$8 \|\\$9
+\&\fP\&
+.ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
+.if !\\n(cR .ne 2
+.br
+..
+.\" .if "\\$1"Ss" .in \\n(.iu+\\n(sIu
+.\"..
+.\"
+.\"
+.\" Column Macro
+.\"
+.hy 0
+.de Cw
+.ie \\n(.$==0 \{\
+. br
+. in \\n(.iu-\\n(eWu
+. ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
+.\}
+.el \{\
+. Pp
+. if \\n(.$==1 \{\
+. ta \w'\\$1 'u
+. nr eW \w'\\$1 'u
+' in \\n(.iu+\\n(eWu
+. \}
+. if \\n(.$==2 \{\
+. ta \w'\\$1 'u +\w'\\$2 'u
+. nr eW \w'\\$1 'u+\w'\\$2 'u
+' in \\n(.iu+\\n(eWu
+. \}
+. if \\n(.$==3 \{\
+. ta \w'\\$1 'u +\w'\\$2 'u +\w'\\$3 'u
+. nr eW \w'\\$1 'u+\w'\\$2 'u+\w'\\$3 'u
+' in \\n(.iu+\\n(eWu
+. \}
+. if \\n(.$==4 \{\
+. ta \w'\\$1 'u +\w'\\$2 'u +\w'\\$3 'u +\w'\\$4 'u
+. nr eW \w'\\$1 'u+\w'\\$2 'u+\w'\\$3 'u +\w'\\$4 'u
+' in \\n(.iu+\\n(eWu
+. \}
+. if \\n(.$==5 \{\
+.ta \w'\\$1 'u +\w'\\$2 'u +\w'\\$3 'u +\w'\\$4 'u +\w'\\$5 'u
+.nr eW \w'\\$1 'u +\w'\\$2 'u +\w'\\$3 'u +\w'\\$4 'u +\w'\\$5 'u
+' in \\n(.iu+\\n(eWu
+. \}
+.\}
+..
+.de Cl
+.ti -\\n(eWu
+.mN \\$1
+.ie \\n(mN .\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.el \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.nr dQ 0
+.de Ds
+.ie !"\\$1"" \{\
+. mN d\\$1
+. if \\n(mN \{\
+. nr dQ \\n(dQ+1
+. d\\$1
+. \}
+.\}
+.el .br
+.nf
+..
+.de Df
+.ie !"\\$1"" \{\
+. mN d\\$1
+. if \\n(mN \{\
+. nr dQ \\n(dQ+1
+. d\\$1
+. \}
+.\}
+.el .br
+..
+.de Dn
+\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.nf
+..
+.de dI
+.nr d\\n(dQ \\n(dIu
+.in \\n(.iu+\\n(dIu
+..
+.de dC
+.nr d\\n(dQ (\\n(.l-\\n(.i)/4u
+.in \\n(.iu+\\n(d\\n(dQu
+..
+.de dR
+.nr d\\n(dQ (\\n(.l/3)u
+.in \\n(.iu+\\n(d\\n(dQu
+..
+.de dL
+.nr aa 0
+..
+.de De
+.br
+.if \\n(d\\n(dQ \{\
+. in \\n(.iu-\\n(d\\n(dQu
+. rr d\\n(dQ
+. nr dQ \\n(dQ-1
+.\}
+.fi
+..
+.\"
+.de Fn
+.ie \\n(.$==0 \{\
+. tm Usage: .Fn function_name function_arg(s) ... \\*(Pu
+.\}
+.el \{\
+. nr cF \\n(.f
+. ie \\n(.$==1 .ds f1 \&\\*(nM\\$1\fP\\*(lP\fP\\*(rP\fP
+. el \{\
+. ds f1 \\*(nM\\$1\fP\\*(lP
+. nr aa 0
+. rC \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+. \}
+. if "\\*(iM"" \{\\&\\*(f1
+. ds f1
+. \}
+.\}
+..
+.\"
+.de rC
+.rZ \\$1
+.ie \\n(rZ \{\
+. as f1 \f\\n(cF\\*(rP\f\\n(cF\\$1\\$2\\$3\\$4\\$5\\$6\\$7
+.\}
+.el \{\
+. ie \\n(aa .as f1 \fP, \\*(aR\\$1
+. el .as f1 \\*(aR\\$1
+. nr aa 1
+. ie \\n(.$>1 .rC \\$2 \\$3 \\$4 \\$5 \\$6 \\$7
+. el .as f1 \fP\\*(rP\fP
+.\}
+..
diff --git a/macros/tmac.s b/macros/tmac.s
index 4430bdf71..d6f329226 100644
--- a/macros/tmac.s
+++ b/macros/tmac.s
@@ -1575,7 +1575,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
.ie \\n[.$]<2 .@error bad arguments to PS (not preprocessed with pic?)
.el \{\
. ds@need (u;\\$1)+1v
-. in +(u;\\n[.l]-\\n[.i]-\\$2/2)
+. in +(u;\\n[.l]-\\n[.i]-\\$2/2>?0)
.\}
..
.de PE
diff --git a/man/gpic.man b/man/gpic.man
index 6f7c9ad11..b87e467fb 100644
--- a/man/gpic.man
+++ b/man/gpic.man
@@ -246,19 +246,24 @@ can be any character not occurring in
can be any character not occurring in
.IR if-false .
.TP
-\fBprint\fR \fIexpr\fR
-.ns
-.TP
-\fBprint\fR \fIposition\fR
-.ns
+\fBprint\fR \fIarg\fR\|.\|.\|.
+Concatenate the arguments and print as a line on stderr.
+Each
+.I arg
+must be an expression, a position, or text.
+This is useful for debugging.
.TP
-\fBprint\fR \fB"\fItext\*(ic\fB"\fR
-Print the value of
-.IR expr ,
-.I position
+\fBcommand\fR \fIarg\fR\|.\|.\|.
+Concatenate the arguments
+and pass them through as a line to troff or\*(tx.
+Each
+.I arg
+must be an expression, a position, or text.
+This has a similar effect to a line beginning with
+.B .
or
-.I text
-on stderr.
+.BR \e ,
+but allows the values of variables to be passed through.
.TP
\fBsh\fR \fIX\fR \fIcommand\fR \fIX\fR
Pass
@@ -377,6 +382,20 @@ Be very careful that you specify an appropriate format string;
gpic does only very limited checking of the string.
This is deprecated in favour of
.BR sprintf .
+.TP
+.IB variable := expr
+This is similar to
+.B =
+except
+.I variable
+must already be defined,
+and the value of
+.I variable
+will be changed only in the innermost block in which it is defined.
+(By contrast,
+.B =
+defines the variable in the current block if it is not already defined there,
+and then changes the value in the current block.)
.LP
Arguments of the form
.IP
@@ -450,6 +469,13 @@ deprecated)
.br
\fIe1\fB < \fIe2\fR
.br
+\fB"\fIstr1\*(ic\fB" == "\fIstr2\*(ic\fB"\fR
+.br
+\fB"\fIstr1\*(ic\fB" != "\fIstr2\*(ic\fB"\fR
+.br
+.LP
+String comparison expressions must be parenthesised in some contexts
+to avoid ambiguity.
.SS Other Changes
.LP
A bare expression,
diff --git a/man/grefer.man b/man/grefer.man
index b856de4e6..9a90ac6c5 100644
--- a/man/grefer.man
+++ b/man/grefer.man
@@ -742,7 +742,7 @@ disambiguation by qualifying the date in some way.
The label used in the text would typically be some combination of the
author and date.
In most cases you should also use the
-.B no-label-reference
+.B no-label-in-reference
command.
For example,
.RS
diff --git a/man/groff_font.man b/man/groff_font.man
index 5ae0e29df..1caa1c0a2 100644
--- a/man/groff_font.man
+++ b/man/groff_font.man
@@ -5,7 +5,7 @@
.TP \\$1
..
.TH GROFF_FONT @MAN5EXT@ "@MDATE@" "Groff Version @VERSION@"
-.SH SYNOPSIS
+.SH NAME
groff_font \- format of groff device and font description files
.SH DESCRIPTION
The groff font format is roughly a superset of the ditroff
diff --git a/man/groff_out.man b/man/groff_out.man
index e07be5669..c94f04402 100644
--- a/man/groff_out.man
+++ b/man/groff_out.man
@@ -4,7 +4,7 @@
.ie \n(.g .ds ic \/
.el .ds ic \^
.TH GROFF_OUT @MAN5EXT@ "@MDATE@" "Groff Version @VERSION@"
-.SH SYNOPSIS
+.SH NAME
groff_out \- format of groff output
.SH DESCRIPTION
The output format used by groff is very similar to that used
diff --git a/man/grops.man b/man/grops.man
index 53b102a8f..945315c2b 100644
--- a/man/grops.man
+++ b/man/grops.man
@@ -740,6 +740,13 @@ Encoding used for text fonts.
Macros for use with
.BR grops .
.TP
+.B @MACRODIR@/tmac.pspic
+Definition of
+.B PSPIC
+macro,
+automatically loaded by
+.BR tmac.ps .
+.TP
.BI /tmp/grops XXXXXX
Temporary file.
.SH "SEE ALSO"
diff --git a/man/grotty.man b/man/grotty.man
index a114e7107..ba25beb5d 100644
--- a/man/grotty.man
+++ b/man/grotty.man
@@ -5,7 +5,7 @@ grotty \- groff driver for typewriter-like devices
.SH SYNOPSIS
.B grotty
[
-.B \-hfbuoBUv
+.B \-hfbuodBUv
] [
.BI \-F dir
] [
@@ -127,6 +127,23 @@ Use only underlining for bold, italic characters.
.B \-o
Suppress overstriking (other than for bold or underlined characters).
.TP
+.B \-d
+Ignore all
+.B \eD
+commands.
+Without this
+.B grotty
+will render
+.B \eD'l\|.\|.\|.'
+commands that have at least at least one zero argument
+(and so are either horizontal or vertical)
+using
+.BR \- ,
+.B |
+and
+.B +
+characters.
+.TP
.B \-v
Print the version number.
.SH FILES
@@ -163,7 +180,10 @@ is intended only for simple documents.
.LP
There is no support for fractional horizontal or vertical motions.
.LP
-There is no pic support.
+There is no support for
+.B \eD
+commands
+other than horizontal and vertical lines.
.LP
Characters above the first line (ie with a vertical position of 0)
cannot be printed.
diff --git a/man/gtroff.man b/man/gtroff.man
index 0336d6f20..b8ce8c303 100644
--- a/man/gtroff.man
+++ b/man/gtroff.man
@@ -492,7 +492,7 @@ may not contain newlines; use
.B \e!
if you want to embed newlines in a diversion.
The escape sequence
-.B \e!
+.B \e?
is also recognised in copy mode and turned into a single internal
code; it is this code that terminates
.IR anything .
@@ -715,6 +715,9 @@ needs to be printed,
.I string
will be processed in a temporary environment and the result
will be wrapped up into a single object.
+Any emboldening, constant spacing or track kerning will be applied
+to this object rather than to individual characters in
+.IR string .
A character defined by this request can be used just like
a normal character provided by the output device.
In particular other characters can be translated to it
diff --git a/man/mdate.sh b/man/mdate.sh
index 4edd6e68c..4d89166be 100755
--- a/man/mdate.sh
+++ b/man/mdate.sh
@@ -2,6 +2,10 @@
# Print the modification date of $1 `nicely'.
+# Don't want foreign dates.
+
+LANGUAGE=
+
(date; ls -l $1) | awk '
BEGIN {
full["Jan"] = "January"; number["Jan"] = 1;
diff --git a/mm/ChangeLog b/mm/ChangeLog
index 0ddbcd390..d259f5312 100644
--- a/mm/ChangeLog
+++ b/mm/ChangeLog
@@ -1,3 +1,62 @@
+Fri Mar 6 09:36:09 1992 Joergen Haegg (jh at efd.lth.se)
+
+ * version 1.01
+ * two .LI without text between should not be printed
+ on the same row. Now fixed.
+ * figure titles and friends fixed, now possible with many .FG
+ in a DS/DE. Didn't always position correctly in previous version,
+ but is now always printed as it should.
+
+Sat Jan 25 15:47:21 1992 Joergen Haegg (jh at efd.lth.se)
+
+ * version 1.00
+ * No betaversion anymore!
+ * Fixed headernumbers within appendixes.
+ * DS did not keep the same font as before DS.
+ * mmse did a line break.
+
+Fri Jan 24 14:38:16 1992 Joergen Haegg (jh at efd.lth.se)
+
+ * version 0.16
+ * bug in TC, multiple line headers did not wrap correctly.
+ * added support for mm/locale and mm/language_locale.
+ * cov*default-firm in locale sets name of firm in the MT covers.
+ * cov*location-xxxx in locale sets location xxxx to the contents
+ of cov*location-xxxx. Used in the MT covers.
+ * hanging indent in lists fixed.
+ * use larger empty lines if .nroff is defined.
+ * macros, like .P, can now be used inside abstracts.
+ * .S do not reset indentation anymore.
+ * .RS aA now sets a string, not an integer.
+ * appendix with .APP or .APPSK added.
+
+Thu Nov 28 22:00:59 1991 Joergen Haegg (jh at efd.lth.se)
+
+ * version 0.15
+ * Fixed .AU in MT 0-3, added support for variable Au.
+ * Bug in the positioning of the foot-notes.
+ * lists not indented properly.
+ * Hps1 and Hps2 added.
+ * COVER had to have an argument.
+ * table of contents can now have multiline header.
+ * .HU now increments headingvariable H?
+ * added the inclusion of a locale file.
+
+Sat Nov 23 14:40:17 1991 Joergen Haegg (jh at efd.lth.se)
+
+ * version 0.14
+ * bug when using -rO fixed.
+ * MT 1-4 added. Thanks to Dave Yearke for that. (don't use MT myself :-)
+ * default is now MT 1
+ * .EQ/.EN can be used outside of .DS/.DE without complaints. But
+ I don't recommend it. Neither does the DWB books.
+ * LI don't break lines now if arg too big.
+ * PGFORM did not reset indent.
+ * Added the numbervariable Hps.
+ * Rewritten and added MT 0-5 + "string".
+ * Added TM.
+ * Indent to AS added
+
Wed Nov 6 15:18:40 1991 Joergen Haegg (jh at efd.lth.se)
* version 0.13
diff --git a/mm/Makefile b/mm/Makefile
index 0f495d913..4722c3303 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -28,7 +28,9 @@ MAN7DIR=/usr/local/man/man$(MAN7EXT)
MAN1EXT=1
SHELL=/bin/sh
-FILES=0.MT ms.MT ms.cov se_ms.cov
+FILES=0.MT 5.MT 4.MT ms.cov se_ms.cov
+# local configurationfiles with defaultvalues.
+LOCALE = locale se_locale
.SUFFIXES: .man .n
@@ -50,7 +52,7 @@ all: groff_mm.n groff_mmse.n
groff_mm.n: ../VERSION
tar:
- tar cvf mm.tar tmac* mm *.man Makefile ChangeLog README
+ tar cvf mm.tar tmac* mm *.man Makefile ChangeLog README NOTES
clean:
-rm -f groff_mm.n groff_mmse.n
@@ -62,8 +64,11 @@ 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; \
+ rm -f $(MACRODIR)/mm/$$f; \
+ cp mm/$$f $(MACRODIR)/mm; \
+ done
+ for f in $(LOCALE); do \
+ [ -f $(MACRODIR)/mm/$$f ] || touch $(MACRODIR)/mm/$$f; \
done
-[ -d $(MAN7DIR) ] || mkdir $(MAN7DIR)
-rm -f $(MAN7DIR)/groff_mm.$(MAN7EXT)
diff --git a/mm/NOTES b/mm/NOTES
new file mode 100644
index 000000000..241b5299e
--- /dev/null
+++ b/mm/NOTES
@@ -0,0 +1,112 @@
+######################################################################
+
+Implementation notes. (Or how to make your own national mm)
+
+Different commands:
+
+COVER [arg]
+MT [arg [addressee]]
+The arg is part of a filename in mm/*.MT or mm/*.cov.
+This file is read when the macro is executed. Therefore it must be
+put before any text output.
+In each file there are definitions of all extra macros needed for the
+cover sheet. MT files is only for compatibility reasons, and has several
+limits due to that it don't know when the cover starts, and cannot
+change sizes. Use COVER for new coversheet macros.
+
+But with MT it is possible to write all of the AT&T covers.
+An example can be found in mm/0.MT.
+
+When writing a new cover using COVER, have in mind that the cover
+should print the page with the COVEND macro. This macro
+should be defined by the new macrofile.
+
+Here is a part of ms.cov:
+> .\"-----------------
+> .de COVEND
+> .sp |4.2c
+> .cov@print-title
+> .cov@print-authors
+> .cov@print-firm
+> .cov@print-abstract
+> .cov@print-date
+This is important, since COVER disables the page header.
+> .pg@enable-top-trap
+Should begin with page one (normally).
+> .bp 1
+And enable the trap at the page footer.
+> .pg@enable-trap
+> ..
+
+#########################
+
+Variables for covers:
+I = integer
+S = string
+D = diversion
+
+Name Type Desc.
+cov*au I The number of authors.
+
+cov*title-size I Pointsize in the title.
+
+cov*title-font S Font for title
+
+cov*title D Title collected with .TL.
+
+cov*title-size I Number of lines in the title.
+
+cov*au!x!y S Author(s) given to .AU
+cov*at!x!y S Author(s) title given to .AT
+ x is the author-index [1-cov*au],
+ y is the argument-index [1-9].
+ Look at the table with indexes.
+
+cov*firm I Author(s) firm.
+
+cov*abs-arg I Argument to abstract.
+
+cov*abs-ind I Indent for abstract.
+
+cov*abstract D The abstract.
+
+cov*abstract-size I Pointsize for abstract.
+
+cov*abstract-font S Font for abstract.
+
+cov*abstract-width I Abstract width (points)
+
+cov*abstract-lines I Lines in the abstract
+
+cov*new-date S The date (todays date if ND is not used)
+
+cov*mt-type S MT type
+cov*mt-addresse S MT addressee
+
+
+##########################
+Argument-index for cov*au:
+
+Index Desc.
+1 name
+2 initials
+3 location
+4 department
+5 extension
+6 room
+7 arg 7
+8 arg 8
+9 arg 9
+
+The location is set to the contents of string cov*location-xxxx
+if location is equal to xxxx and cov*location-xxxx is defined
+in the file locale.
+
+
+Argument-index for cov*at:
+
+Index Desc.
+1 title 1
+. .
+. .
+9 title 9
diff --git a/mm/README b/mm/README
index 05145713e..181c84ff9 100644
--- a/mm/README
+++ b/mm/README
@@ -11,6 +11,9 @@ of tmac.m) and the version of groff.
Any new ideas or improvements are welcome.
+Newest version is available with anonymous FTP
+at ftp.efd.lth.se [130.235.48.4], as pub/groff/mm<something>.Z
+
This README should be bigger :-)
Jörgen.
diff --git a/mm/groff_mm.man b/mm/groff_mm.man
index 008390557..922665e5a 100644
--- a/mm/groff_mm.man
+++ b/mm/groff_mm.man
@@ -21,7 +21,7 @@ no letter macros implemented (yet).
no Bell Labs localisms implemented.
.TP
.B \(bu
-the macros OK, PM and TM is not implemented.
+the macros OK and PM is not implemented.
.TP
.B \(bu
groff mm does not support cut marks
@@ -32,6 +32,20 @@ english text to the preferred language. Use \fBm@TMAC_M@se\fP as an example.
.LP
Groff mm has several extensions:
.TP
+.B "APP name text"
+Begin an appendix with name \fIname\fP. Automatic naming occurs if
+\fIname\fP is "". The appendixes starts with \fBA\fP if auto is used.
+An new page is ejected, and a header is also produced if the number
+variable \fBAph\fP is non-zero. This is the default.
+The appendix always appear in the 'List of contents' with correct
+pagenumber. The name \fIAPPENDIX\fP can be changed by setting
+the string \fBApp\fP to the desired text.
+.TP
+.B "APPSK name pages text"
+Same as \fB.APP\fP, but the pagenr is incremented with \fIpages\fP.
+This is used when diagrams or other non-formatted documents are
+included as appendixes.
+.TP
.B B1
Begin box (as the ms macro)
Draws a box around the text.
@@ -45,13 +59,25 @@ 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.
+\fBCOVER\fP begins a coversheet definition. It is important
+that \fB.COVER\fP appears before any normal text.
+\fB.COVER\fP uses \fIarg\fP to build the filename
+@TMAC_MDIR@/\fIarg\fP.cov. Therefore it is possible to create unlimited
+types of coversheets.
\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.
+\fB.COVER\fP requires a \fB.COVEND\fP at the end of the coverdefinition.
+Always use this order of the covermacros:
+.nf
+\&.COVER
+\&.TL
+\&.AF
+\&.AU
+\&.AT
+\&.AS
+\&.AE
+\&.COVEND
+.fi
+However, only \fB.TL\fP and \fB.AU\fP are required.
.TP
.B COVEND
This finish the cover description and prints the cover-page.
@@ -98,11 +124,9 @@ 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.
+Memorandum type 0 thru 5 are supported, including \fI"string"\fP.
\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.
@@ -143,6 +167,30 @@ End verbatim output.
.LP
New variables in m@TMAC_M@:
.TP
+.B App
+A string containing the word "APPENDIX".
+.TP
+.B Aph
+Print an appendix-page for every new appendix
+if this numbervariable is non-zero.
+No output will occur if \fBAph\fP is zero, but there will always
+be an appendix-entry in the 'List of contents'.
+.TP
+.B Hps
+Numbervariable with the heading pre-space level. If the heading-level
+is less than or equal to \fBHps\fP, then two lines will precede the
+section heading instead of one. Default is first level only.
+The real amount of lines is controlled by the variables \fBHps1\fP and
+\fBHps2\fP.
+.TP
+.B Hps1
+This is the number of lines preceding \fB.H\fP when the heading-level
+is greater than \fBHps\fP. Value is in units, normally 0.5v.
+.TP
+.B Hps2
+This is the number of lines preceding \fB.H\fP when the heading-level
+is less than or equal to \fBHps\fP. Value is in units, normally 1v.
+.TP
.B Lifg
String containing \fIFigure\fP.
.TP
@@ -158,6 +206,10 @@ String containing \fIEquation\fP.
.B Licon
String containing \fICONTENTS\fP.
.TP
+.B Lsp
+.TP
+The size of an empty line. Normally 0.5v, but it is 1v
+if \fBn\fP is set (\fB.nroff\fP).
.B "MO1 - MO12"
Strings containing \fIJanuary\fI to \fIDecember\fP.
.TP
@@ -166,6 +218,10 @@ String containing "See chapter \e\e*[Qrfh], page \e\en[Qrfp].".
.TP
.B .mgm
Always 1.
+.LP
+A file called \fBlocale\fP or \fIlang\fP\fB_locale\fP is read
+after the initiation of the global variables. It is therefore
+possible to localize the macros with companyname and so on.
.sp 3
.LP
The following standard macros are implemented:
@@ -186,7 +242,7 @@ Authors firm
Start autoincrement list
.TP
.B "AS [arg [indent]]"
-Abstract start
+Abstract start. Indent is specified in 'ens', but scaling is allowed.
.TP
.B "AT title1 [title2 ...]"
Authors title
@@ -233,7 +289,6 @@ right adjusted text and block may be used (R or RB as \fIformat\fP).
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.
@@ -251,7 +306,6 @@ Equation start.
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.
@@ -263,7 +317,6 @@ Footnote end.
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.
@@ -397,7 +450,6 @@ Space vertically. \fIlines\fP can have any scalingfactor, like \fI3i\fP or
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.
@@ -415,6 +467,10 @@ Table header.
.B TL
Begin title of memorandom.
.TP
+.B TM [num1 [num2 [...]]]
+Technical memorandumnumbers used in \fB.MT\fP. Unlimited number
+of arguments may be given.
+.TP
.B TP
Top of page user-defined macro.
.TP
@@ -579,11 +635,7 @@ Paragraph type.
.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 BUGS
.SH AUTHOR
Jörgen Hägg, Lund Institute of Technology, Sweden <jh@efd.lth.se>
.SH FILES
@@ -593,6 +645,8 @@ Jörgen Hägg, Lund Institute of Technology, Sweden <jh@efd.lth.se>
.B @TMAC_MDIR@*.cov
.TP
.B @TMAC_MDIR@*.MT
+.TP
+.B @TMAC_MDIR@locale
.SH "SEE ALSO"
.BR groff (@MAN1EXT@),
.BR gtroff (@MAN1EXT@),
diff --git a/mm/mm/0.MT b/mm/mm/0.MT
index cbc73c7f8..debe2191d 100644
--- a/mm/mm/0.MT
+++ b/mm/mm/0.MT
@@ -1,30 +1,32 @@
.\"------------
-.\" Cover sheet. Memorandum type 0
-.\" version 0.10
-.\" MT covers will be maintained at low priority.
+.\" Cover sheet. Memorandum type 0-3 and "string".
.\"------------
.PH "''''"
.OH "''''"
.EH "''''"
+.if !r Au .nr Au 1
+.nr cov*mt0-ind 1.1c
.de cov@print-title
-.MOVE 5.6c 1.5c
+.MOVE 4.8c 1.5c
.S 8
subject:
-.br
-.sp -1.4
+.sp -1.1
.S
-.in 1.2c
-.\" .MOVE \\n[misc*cur-bline]u 2.7c
-.nf
+.PGFORM
.B
+.ll 9c
.cov*title
.R
+.ll
+.nf
+.if d cov*title-charge-case \fBCharge Case \\*[cov*title-charge-case]\fP
+.if d cov*title-file-case \fBFile Case \\*[cov*title-file-case]\fP
.fi
-.PGFORM
..
.\"------------
.de cov@print-authors
-.MOVE 6.5c 13.5c
+.MOVE 5.7c 13.3c
+.nf
.S 8
\\$1:
.br
@@ -34,15 +36,47 @@ subject:
.B
.nr cov*i 0 1
.while \\n+[cov*i]<=\\n[cov*au] \{\
-\\*[cov*au!\\n[cov*i]!1]
-.br
+. cov@print-au1 \\n[cov*i] 1
+. if \\n[Au] \{\
+. cov@print-au2 \\n[cov*i] 3 4
+. cov@print-au2 \\n[cov*i] 6 5
+. cov@print-au1 \\n[cov*i] 7
+. cov@print-au1 \\n[cov*i] 8
+. cov@print-au1 \\n[cov*i] 9
+. \}
+. if \\n[cov*i]<\\n[cov*au] .SP 1
.\}
.R
+.if r cov*mt-tm-max \{\
+. SP 1
+. nr cov*i 0 1
+. B
+TM
+. in 1.5c
+. sp -1
+. while \\n+[cov*i]<\\n[cov*mt-tm-max] \\*[cov*mt-tm!\\n[cov*i]]
+. in
+. R
+.\}
+.fi
.PGFORM
..
.\"------------
+.\" index arg1
+.de cov@print-au1
+.if d cov*au!\\$1!\\$2 \\*[cov*au!\\$1!\\$2]
+..
+.\"------------
+.de cov@print-au2
+.\" index arg1 arg2
+.if d cov*au!\\$1!\\$2 \\*[cov*au!\\$1!\\$2] \c
+.if \\$3=5 .if d cov*au!\\$1!\\$3 x\c
+.if d cov*au!\\$1!\\$3 \\*[cov*au!\\$1!\\$3]\c
+.br
+..
+.\"------------
.de cov@print-date
-.MOVE 5.6c 13.5c
+.MOVE 4.8c 13.3c
.S 8
\\$1:
.br
@@ -55,36 +89,56 @@ subject:
..
.\"------------
.de cov@print-firm
-.MOVE 4c 0 17.7c
-.S 18
-.rj \\n[cov*title-size]
+.if d cov*firm \{\
+. MOVE 2.8c 0 17.7c
+. S 18
+. rj 1
\fB\\*[cov*firm]\fP
-.S
-.PGFORM
+. S
+. PGFORM
+.\}
..
.\"------------
.de cov@print-abstract
-.MOVE 8.1c
-.ce
+.SP 3
+.if d cov*abstract \{\
+. misc@ev-keep cov*ev
+. if \\n[cov*abs-ind]>0 \{\
+. in +\\n[cov*abs-ind]u
+. ll -\\n[cov*abs-ind]u
+. \}
+. ce
\fI\\$1\fP
-.SP 1c
-.ev cov*ev
-.init@reset
-.nf
-.ll \\n[@ll]u
-.if d cov*abstract .cov*abstract
-.ev
+. SP 1.5
+. fi
+. cov*abstract
+. br
+. ev
+.\}
..
.\"-----------------
+.ds cov*mt0-txt!1 MEMORANDUM FOR FILE
+.ds cov*mt0-txt!2 PROGRAMMER'S NOTES
+.ds cov*mt0-txt!3 ENGINEER'S NOTES
+.if d cov*default-firm .if !d cov*firm .ds cov*firm \\*[cov*default-firm]
+.\"
.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
+. SP 3
+. if (\*[cov*mt-type]>=1)&(\*[cov*mt-type]<=3) \{\
+. ce
+\fI\*[cov*mt0-txt!\*[cov*mt-type]]\fP
+. SP 1.5
+. \}
+. if \*[cov*mt-type]=6 \{\
+. ce
+\fI\*[cov*mt-type-text]\fP
+. SP 1.5
+. \}
. pg@enable-top-trap
. pg@enable-trap
. ds cov*mt-printed
diff --git a/mm/mm/4.MT b/mm/mm/4.MT
new file mode 100644
index 000000000..752f65440
--- /dev/null
+++ b/mm/mm/4.MT
@@ -0,0 +1,68 @@
+.\"------------
+.\" Cover sheet. Memorandum type 4
+.\"------------
+.PH "''''"
+.OH "''''"
+.EH "''''"
+.de cov@print-title
+.MOVE 2.4c
+.S 12
+.ad c
+.fi
+.B
+.cov*title
+.br
+.S
+.R
+.ad b
+.PGFORM
+..
+.\"------------
+.de cov@print-authors
+.SP 0.5
+.I
+.nr cov*i 0 1
+.while \\n+[cov*i]<=\\n[cov*au] \{\
+.ce
+\\*[cov*au!\\n[cov*i]!1]
+.br
+.\}
+.R
+.PGFORM
+..
+.\"------------
+.de cov@print-firm
+.SP 0.5
+.ce
+\\*[cov*firm]
+..
+.\"------------
+.de cov@print-abstract
+.SP 2
+.if d cov*abstract \{\
+. misc@ev-keep cov*ev
+. if \\n[cov*abs-ind]>0 \{\
+. in +\\n[cov*abs-ind]u
+. ll -\\n[cov*abs-ind]u
+. \}
+. ce
+\fIABSTRACT\fP
+. SP 2
+. fi
+. cov*abstract
+. br
+. ev
+.\}
+..
+.\"-----------------
+.if d cov*default-firm .if !d cov*firm .ds cov*firm \\*[cov*default-firm]
+.if !d cov*mt-printed \{\
+. cov@print-title
+. cov@print-authors
+. cov@print-firm
+. cov@print-abstract
+. SP 3
+. pg@enable-top-trap
+. pg@enable-trap
+. ds cov*mt-printed
+.\}
diff --git a/mm/mm/5.MT b/mm/mm/5.MT
new file mode 100644
index 000000000..3d0484cf4
--- /dev/null
+++ b/mm/mm/5.MT
@@ -0,0 +1,35 @@
+.\"------------
+.\" Cover sheet. Memorandum type 5
+.\"------------
+.PH "''''"
+.OH "''''"
+.EH "''''"
+.nr cov*mt0-ind 1.1c
+.de cov@print-title
+.B
+.ll 9c
+.cov*title
+.R
+.ll
+.nf
+.if d cov*title-charge-case \fBCharge Case \\*[cov*title-charge-case]\fP
+.if d cov*title-file-case \fBFile Case \\*[cov*title-file-case]\fP
+.fi
+..
+.\"------------
+.de cov@print-date
+.rj 1
+.B "\\*[cov*new-date]"
+.br
+..
+.\"------------
+.if !d cov*mt-printed \{\
+. SP 1.9c
+. cov@print-title
+. SP 1.2c
+. cov@print-date
+. SP 3
+. pg@enable-top-trap
+. pg@enable-trap
+. ds cov*mt-printed
+.\}
diff --git a/mm/mm/ms.MT b/mm/mm/ms.MT
deleted file mode 100644
index 6bffba5a1..000000000
--- a/mm/mm/ms.MT
+++ /dev/null
@@ -1,47 +0,0 @@
-.\"------------
-.\" 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
index 673c2530c..c88645f45 100644
--- a/mm/mm/ms.cov
+++ b/mm/mm/ms.cov
@@ -1,13 +1,21 @@
.\"------------
.\" 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]
+.misc@ev-keep cov*ev
+.init@reset
+.ad c
+.hy 0
+.fi
+.B
.cov*title
+.br
+.ad b
+.R
+.ev
..
.\"------------
.de cov@print-authors
@@ -19,8 +27,10 @@
. nr cov*j 0 1
. while \\n+[cov*j]<=9 \{\
. if d cov*at!\\n[cov*i]!\\n[cov*j] \{\
-. ce
+. if \w'\\*[cov*at!\\n[cov*i]!\\n[cov*j]]' \{\
+. ce
\s-1\\*[cov*at!\\n[cov*i]!\\n[cov*j]]\s0
+. .\}
. \}
. \}
.\}
@@ -32,21 +42,23 @@
\\*[cov*firm]
..
.\"------------
-.nr cur*abstract-ll 12.6c
-.\"
.de cov@print-abstract
.SP 2
-.if \\n[.$] \{\
+.if d cov*abstract \{\
+. misc@ev-keep cov*ev
+. init@reset
+. if \\n[cov*abs-ind]>0 \{\
+. in +\\n[cov*abs-ind]u
+. ll -\\n[cov*abs-ind]u
+. \}
. ce
-\\$1
+\fI\\$1\fP
+. SP 1.5
+. fi
+. cov*abstract
+. br
+. ev
.\}
-.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
@@ -55,13 +67,18 @@
..
.\"-----------------
.de COVEND
+.if d cov*default-firm .if !d cov*firm .ds cov*firm \\*[cov*default-firm]
.sp |4.2c
.cov@print-title
.cov@print-authors
.cov@print-firm
-.cov@print-abstract
+.cov@print-abstract ABSTRACT
.cov@print-date
.pg@enable-top-trap
.bp 1
.pg@enable-trap
+.if \\n[cov*abs-arg] \{\
+. cov@print-abstract ABSTRACT
+. SP 2
+.\}
..
diff --git a/mm/mm/se_ms.cov b/mm/mm/se_ms.cov
index 92f90da7a..e6431f25e 100644
--- a/mm/mm/se_ms.cov
+++ b/mm/mm/se_ms.cov
@@ -1,3 +1,2 @@
-.\" version 0.8
-.mso mac.gm/ms.cov
+.mso mm/ms.cov
.nr cur*abstract-ll 11c
diff --git a/mm/tmac.m b/mm/tmac.m
index c98b8b950..c156df74f 100644
--- a/mm/tmac.m
+++ b/mm/tmac.m
@@ -1,5 +1,5 @@
.\" Version:
-.ds RE 0.13
+.ds RE 1.01
.ig
Copyright (C) 1991 Free Software Foundation, Inc.
mgm is written by Jörgen Hägg (jh@efd.lth.se)
@@ -141,8 +141,8 @@ Index array!index
.ie r W .nr @ll \n[W]
.el .nr @ll 6i
.\" page offset
-.ie r O .nr @ll \n[O]
-.el .nr @po .75i
+.ie r O .nr @po \n[O]
+.el .nr @po 1i
.\"
.\" cheating...
.\".pl 100i
@@ -153,12 +153,36 @@ Index array!index
.\"---------------------------------------------
.\" New variables
.\"
+.\" Appendix name
+.ds App APPENDIX
+.\" print appendixheader, 0 == don't
+.nr Aph 1
+.\"
+.\" header prespace level. If level <= Hps, then two lines will be printed
+.\" before the header instead of one.
+.nr Hps 1
+.\"
+.\" These variables controls the number of lines preceding .H.
+.\" Hps1 is the number of lines when level > Hps
+.nr Hps1 0.5v
+.if n .nr Hps1 1v
+.\"
+.\" Hps2 is the number of lines when level >= Hps
+.nr Hps2 1v
+.if n .nr Hps2 2v
+.\"
+.\" flag for mkindex
+.if !r Idxf .nr Idxf 0
.\" Change these in the national configuration file
.ds Lifg Figure
.ds Litb TABLE
.ds Liex Exhibit
.ds Liec Equation
.ds Licon CONTENTS
+.\"
+.\" Lsp controls the height of an empty line. Normally 0.5v
+.nr Lsp 0.5v
+.if n .nr Lsp 1v
.ds MO1 January
.ds MO2 February
.ds MO3 March
@@ -176,6 +200,11 @@ Index array!index
.\" test for mgm macro. This can be used if the text must test
.\" what macros is used.
.nr .mgm 1
+.\"
+.\"---------------------------------------------
+.\" set local variables.
+.ie d @language .mso mm/\\*[@language]_locale
+.el .mso mm/locale
.\"---------------------------------------------
.if \n[D] .tm Groff mm, version \*[RE].
.\" ####### module init ######
@@ -213,6 +242,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\" ####### module par #################################
.nr par@ind-flag 1 \" indent on following P if Pt=2
.nr hd*last-pos -1
+.nr hd*last-hpos -1
.nr par*number 0 1
.af par*number 01
.nr par*num-count 0 1
@@ -226,7 +256,11 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\" paragraph
.de P
.\" skip P if previous heading
-.if !((\\n[nl]=\\n[hd*last-pos]):(\\n[nl]=(\\n[hd*last-pos]-.5v))) \{\
+.ie !((\\n[nl]=\\n[hd*last-pos]):(\\n[nl]=(\\n[hd*last-pos]-.5v))) \{\
+. if \\n[D]>2 .tm Paragraph
+. par@doit \\$*
+.\}
+.el .if !(\\n[hd*last-hpos]=\\n[.k]) \{\
. if \\n[D]>2 .tm Paragraph
. par@doit \\$*
.\}
@@ -334,6 +368,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.po \\n[@po]u
.pl \\n[@pl]u
.nr @cur-ll \\n[@ll]
+.in 0
.pg@move-trap
..
.\"-------------
@@ -397,7 +432,8 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
. el .nr @vs \\*[misc*b]
. \}
.\}
-.init@reset
+'ps \\n[@ps]
+'vs \\n[@vs]
.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]
@@ -418,7 +454,6 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
..
.\"------------
.de RD
-.tm \\$@
.di misc*rd
'fl
.rd \\$1
@@ -470,9 +505,6 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.de PM
.tm "PM: not implemented"
..
-.de TM
-.tm "TM: not implemented"
-..
.\" ######## module hd #################
.\" support for usermacro
.nr hd*htype 0
@@ -484,9 +516,10 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.als }2 hd*suf-space
.aln ;3 hd*need
.\"-------------
-.\" .hd@split varable index val1 val2 ...
+.\" .hd@split varable index name val1 val2 ...
.de hd@split
-.nr hd*sp-tmp \\$2+2
+.if \\$2>(\\n[.$]-3) .@error "\\$3 must have at least \\$2 values (\\*[\\$3]).
+.nr hd*sp-tmp \\$2+3
.ds \\$1 \\$[\\n[hd*sp-tmp]]
..
.de HU
@@ -511,9 +544,9 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.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
+.nr H\\n[hd*level] +1
+.ie \\n[hd*level]<=\\n[Hps] .SP \\n[Hps2]u\" pre-space
+.el .SP \\n[Hps1]u
.\"
.\" hd*mark is the text written to the left of the header.
.ds hd*mark \\n[H1].
@@ -554,10 +587,10 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\" 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
+.hd@split hd*font \\n[hd*level] HF \\*[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
+.hd@split hd*new-ps \\n[hd*level] HP \\*[HP]\" get point size
.ie (\\*[hd*new-ps]=0):(\w@\\*[hd*new-ps]@=0) \{\
. if \\n[hd*htype] \{\
. if '\\*[hd*font]'3' .ps -1z
@@ -609,6 +642,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\"---------- user macro HZ ----------
.if d HZ .HZ \\n[hd*level] \\n[hd*arg1] "\\$2\\$3"
.nr hd*last-pos \\n[nl]
+.nr hd*last-hpos \\n[.k]
.nr par@ind-flag 0
..
.\"--------
@@ -645,6 +679,9 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.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]
+.\" last-pos points to the position of the footer and bottom
+.\" block below foot-notes.
+.nr pg*last-pos \\n[@pl]u-(\\n[pg*block-size]u+\\n[pg*foot-margin]u+\\n[pg*footer-size]u)
..
.de pg@enable-trap
.wh \\n[pg*foot-trap]u pg@footer
@@ -691,6 +728,9 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\" HEADER
.de pg@header
.if \\n[D]>1 .tm \\n[.F]:\\n[c.]: header for page# \\n[%]
+.if \\n[Idxf] \{\
+.tl '<pagenr\ \\n[%]>'''
+.\}
.if \\n[pg*top-enabled] \{\
. if \\n[pg*top-margin] .sp \\n[pg*top-margin]u
. ev pg*tl-ev
@@ -749,6 +789,8 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
..
.\"-------------------------
.de pg@print-footer
+.\" jump to the position just below the foot-notes.
+'sp |\\n[pg*last-pos]u+1v
.\" check if there are any bottom block
.if d pg*block-div .pg@block
.\"
@@ -840,6 +882,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
\c
.ds@print-float 3
.ev
+.if d ref*div .RP
..
.\"-------------------------
.\" set top and bottom margins $$$ (not implemented yet)
@@ -1055,6 +1098,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.ev
.rm ft*div
.nr ft*note-size 0
+.pg@move-trap
..
.\"-----------------
.\" check if any pending footnotes, see pg@header
@@ -1096,6 +1140,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.ds@start 1 DF \\$*
..
.\"---------------
+.nr ds*format 0\" dummy value for .En/.EQ
.nr ds*format!0 0\" no indent
.nr ds*format!L 0\" no indent
.nr ds*format!I 1\" indent
@@ -1140,7 +1185,9 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.misc@push ds-form \\n[ds*format]
.misc@push ds-ffloat \\n[ds*ffloat]
.nr ds*i \\n[.i]
+.nr ds*ftmp \\n[.f]
.misc@ev-keep ds*ev!\\n+[ds*snr]
+.ft \\n[ds*ftmp]
.\"
.init@reset
'in \\n[ds*i]u
@@ -1163,8 +1210,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.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
+.if \\n[ds*ffloat] .SP \\n[Lsp]u
.di
.nr ds*width \\n[dl]
.nr ds*height \\n[dn]
@@ -1197,13 +1243,13 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
. if (\\n[ds*height]<\\n[ds*i])&(\\n[.t]<(\\n[ds*height])) \{\
. ne \\n[.t]u+1v
. \}
-. if \\n[Ds] .SP 0.5
+. if \\n[Ds] .SP \\n[Lsp]u
.\}
-.el .SP 0.5
+.el .SP \\n[Lsp]u
.ds*div!\\n[ds*snr]
-.ie !\\n[ds*ffloat] .if \\n[Ds] .SP 0.5
+.ie !\\n[ds*ffloat] .if \\n[Ds] .SP \\n[Lsp]u
.el \{\
-. SP 0.5
+. SP \\n[Lsp]u
. di
.\}
.rm ds*div!\\n[ds*snr]
@@ -1306,6 +1352,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.ds li*mark 0
.nr li*li-spc 0
.nr li*lvl 0 1
+.nr li*cur-vpos 0
.\"--------------------------
.\" the major list-begin macro.
.\" If type == -1 a 'break' will occur.
@@ -1320,9 +1367,9 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.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*tind (n;0\\$1)\" text-indent
+.nr li*mind (n;0\\$2)\" mark-indent
+.nr li*pad (n;0\\$3)\" pad
.nr li*type 0\\$4\" type
.ds li*mark \\$5\" mark
.ie !'\\$6'' .nr li*li-spc \\$6\" LI-space
@@ -1356,20 +1403,39 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.if \\n[.$]=2 .ds li*c-mark \\$1\ \\*[li*c-mark]
.if '\\*[li*c-mark]'\ ' .ds li*c-mark
.\"
+.nr li*text-begin \\n[li*tind]>?\w'\\*[li*c-mark]\ '
+.ti -\\n[li*tind]u
+.\" no indentation if hanging indent
+.if (\w'\\*[li*c-mark]'=0)&((\\n[.$]=0):(\w'\\$1'=0)) .nr li*text-begin 0
+\Z'\&\\*[li*c-mark]'\h'\\n[li*text-begin]u'\&\c
+.if \\n[li*type]=-1 .br
+..
+.\"
+.\"
+.ig
.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
+.\" Give hanging row if arg1=="" or null and mark is empty
+.ie (\w'\\*[li*c-mark]'=0)&((\\n[.$]=0):(\w'\\$1'=0)) \{\
+. ti -\\n[li*tind]u
.\}
.el \{\
-.ti -\\n[li*tind]u
+. \" don't break if arg too big
+. ie (\w'\\*[li*c-mark]'>\\n[li*tind])&(\\n[li*type]>-1) \{\
+. ti -\\n[li*tind]u
+\&\\*[li*c-mark] \c
+. \}
+. el \{\
+. ie \\n[li*c-tind]>\\n[li*tind] .ti -\\n[li*tind]u
+. el .ti -\\n[li*c-tind]u
+\&\\*[li*c-mark]
+. br
+. \" break line if .BVL or no text between two .LI
+. if \\n[li*type]>-1 .sp -1
+. \}
.\}
..
.\"-------------
@@ -1410,12 +1476,12 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\}
..
.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[.$]>3 .@error "ML: too many arguments"
+.nr li*ml-width \w'\\$1'u+1n
+.if \\n[.$]<2 .LB \\n[li*ml-width]u 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
+. ie '\\$2'' .LB \\n[li*ml-width]u 0 1 0 "\\$1" 0 1
. el .LB \\n[Li] 0 1 0 "\\$1" 0 1
.\}
..
@@ -1432,7 +1498,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.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
+. ie '\\$1'' .LB \\n[Pi] 0 1 0 \\*[BU] 0 1
. el .LB 0\\$1 0 1 0 \\*[BU] 0 1
.\}
..
@@ -1441,7 +1507,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.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
+. ie '\\$1'' .LB \\n[Pi] 0 1 0 \(em 0 1
. el .LB 0\\$1 0 1 0 \(em 0 1
.\}
..
@@ -1450,7 +1516,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.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
+. ie '\\$1'' .LB 6 0 2 4 1 0 1
. el .LB 0\\$1 0 2 4 1 0 1
.\}
..
@@ -1599,6 +1665,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\"-----------
.\" Table of contents with friends (module lix)
.de TC
+.br
.\" print any pending displays
.pg@end-of-text
.if \w'\\$1'>0 .nr toc*slevel \\$1
@@ -1662,8 +1729,12 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
\\..
..
.\"-----------
+.\" level mark text pagenumber
.de toc@set
.if \\$1<=\\n[toc*slevel] .SP \\n[toc*spacing]u
+.ne 2v
+.na
+.fi
.nr toc*ind 0
.nr toc*i 0 1
.ie d Ci \{\
@@ -1674,24 +1745,39 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
. nr toc*ind +\\n[toc*hl!\\n[toc*i]]u
. \}
.\}
-.if \\n[toc*ind] .ti +\\n[toc*ind]u
+.nr toc*text \\n[toc*ind]u+\\n[toc*hl!\\$1]u
+.in \\n[toc*text]u
+.ti -\\n[toc*hl!\\$1]u
.\"
.\" length of headernum space
.nr toc*i \\n[toc*hl!\\$1]-\w'\\$2'
.\"
+.ll \\n[@ll]u-\w'\\$4'u-2m
+.\" ragged right ---------------------------------
.ie \\$1>\\n[toc*tlevel] \{\
-\\$2\h'\\n[toc*i]u'\\$3\ \ \ \\$4
+\\$2
+. sp -1
+\\$3\ \ \ \\$4
+. br
.\}
.el \{\
+. \" unnumbered heading --------------------
. 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
+. in \\n[toc*ind]u
+\\$3\h'1m'
. \}
+. \" normal heading ------------------------
. 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
+\\$2
+. sp -1
+\\$3\h'1m'
. \}
+. ll \\n[@ll]u
+. sp -1
+. nr toc*sep (u;\\n[.l]-\\n[.n]-\\n[.i]-\w'\\$4')-1m
+\h'|\\n[.n]u'\l'\\n[toc*sep]u.'\h'1m'\\$4
.\}
+.ll \\n[@ll]u
..
.\"########################### module lix ############################
.\" LIST OF figures, tables, exhibits and equations
@@ -1732,7 +1818,8 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\}
.nr lix*pgnr \\n[%]
.\" print line if not between DS/DE
-.if \\n[ds*lvl]<1 .lix@print-text
+.ie \\n[ds*lvl]<1 .lix@print-text "\\*[lix*lable]" "\\*[lix*text]"
+.el .lix@embedded-text "\\*[lix*lable]" "\\*[lix*text]"
.\"
.\" save line for LIST OF XXX
.if !r lix*wth\\$1 .nr lix*wth\\$1 0
@@ -1742,21 +1829,33 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
..
.\"-----------
.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
+.SP \\n[Lsp]u
+.misc@ev-keep lix
+.init@reset
+.br
+.ie (\w'\\$1\\$2')>(\\n[.l]-\\n[.i]) \{\
+. in +\w'\\$1'u
+. ti 0
.\}
+.el .ce 1
+\fB\\$1\fP\\$2
+.br
+.ev
+..
+.\" hide printout until diversion is evaluated
+.de lix@embedded-text
+\!.SP \\n[Lsp]u
+\!.misc@ev-keep lix
+\!.init@reset
+\!.br
+\!.ie (\w'\\$1\\$2')>(\\n[.l]-\\n[.i]) \{\
+\!. in +\w'\\$1'u
+\!. ti 0
+\!.\}
+\!.el .ce 1
+\!\fB\\$1\fP\\$2
+\!.br
+\!.ev
..
.\"------------
.\" print complete list of XXXX
@@ -1888,7 +1987,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.ds Rf \v'-.4m'\s-3[\\n+[ref*nr]]\s0\v'.4m'
.\" start reference
.de RS
-.if !''\\$1' .nr \\$1 \\n[ref*nr]
+.if !''\\$1' .ds \\$1 \\n[ref*nr]
.ev ref*ev
.da ref*div
.init@reset
@@ -1909,6 +2008,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.nr ref*i 0\\$2
.if \\n[ref*i]<2 .SK
.SP 2
+.toc@save 1 "" "\\*[Rp]" \\n[%]
.ev ref*ev
.ce
\fI\\*[Rp]\fP
@@ -1922,6 +2022,62 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.ev
.if (\\n[ref*i]=0:\\n[ref*i]=2) .SK
..
+.\"########################### module app ############################
+.\"
+.nr app*nr 0 1
+.af app*nr A
+.nr app*dnr 0 1
+.\"------------
+.\" .APP name text
+.\" name == "" -> autonumber
+.de APP
+.if \\n[.$]<2 .@error "APP: too few arguments"
+.app@set-ind "\\$1"
+.\"
+.ie \\n[Aph] .app@header \\*[app*ind] "\\$2"
+.el .bp
+.app@index "\\*[app*ind]" "\\$2"
+..
+.\"------------
+.\" .APPSK name pages text
+.\" name == "" -> autonumber
+.de APPSK
+.if \\n[.$]<2 .@error "APPSK: too few arguments"
+.app@set-ind "\\$1"
+.\"
+.ie \\n[Aph] .app@header \\*[app*ind] "\\$3"
+.el .bp
+.app@index "\\*[app*ind]" "\\$3"
+.pn +\\$2
+..
+.\"------------
+.de app@set-ind
+.ie \w'\\$1' .ds app*ind \\$1
+.el \{\
+. if !\\n[app*dnr] \{\
+. nr H1 0 1
+. af H1 A
+. \}
+. ds app*ind \\n+[app*nr]
+. nr H1 \\n+[app*dnr]
+.\}
+..
+.\"------------
+.de app@index
+.toc@save 1 "" "\\*[App] \\$1: \\$2" \\n[%]
+..
+.\"------------
+.\" app@heaer name text
+.de app@header
+.bp
+.SP \\n[Lsp]u*4u
+.ce 1
+\s+4\fB\\*[App]\ \\$1\fP\s0
+.SP \\n[Lsp]u*2u
+.if \w'\\$2'<\\n[.l] .ce 1
+\fB\s+2\\$2\s0\fP
+.SP \\n[Lsp]u*4u
+..
.\"########################### module cov ############################
.\" title stored in diversion cov*title
.\" abstract stored in diversion cov*abstract
@@ -1936,37 +2092,44 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\"
.\"
.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
+.if \\n[.$]>0 .ds cov*title-charge-case \\$1
+.if \\n[.$]>1 .ds cov*title-file-case \\$2
.pg@disable-top-trap
-.misc@ev-keep cov*ev
+.ev cov*ev
.init@reset
-.ft \\*[cov*title-font]
-.S \\n[cov*title-size]
+.hy 0
+.eo
.di cov*title
-.nf
-.in 0
..
-.de TLE
-.br
-.di
-.nr cov*title-size \\n[dn]/\\n[.v]
-.ev
+.\"-------------------
+.de cov@title-end
+.ec
+.if '\\n[.z]'cov*title' \{\
+. br
+. di
+. asciify cov*title
+. ev
+.\}
..
+.\"-------------------
.\" .AU name [initials [loc [dept [ext [room [arg [arg [arg]]]]]]]]
.de AU
+.cov@title-end
.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]]
.\}
+.if (\\n[.$]>=3)&(\w'\\$3') \{\
+. if d cov*location-\\$3] \{\
+. ds cov*au!3!\\n[cov*au] \\*[cov*location-\\$3]
+. \}
+.\}
..
+.\"-------------------
.\" .AT title1 [title2 [... [title9] ]]]]
.\" Well, thats all that COVEND look for.
.\" Must appear directly after .AU
@@ -1977,7 +2140,9 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
. ds cov*at!\\n[cov*au]!\\n[cov*i] "\\$[\\n[cov*i]]
.\}
..
+.\"-------------------
.de AF
+.cov@title-end
.if \\n[.$]<1 .@error "AF: no arguments"
.ds cov*firm \\$1
..
@@ -1986,21 +2151,13 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.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
+.nr cov*abs-ind (n;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
+.nf
+.de cov*abstract AE
..
.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 :-)
@@ -2011,29 +2168,46 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.pg@disable-top-trap
.ds cov*new-date \\$1
..
+.\"-------------------
+.\" save technical numbers.
+.de TM
+.nr cov*i 0 1
+.while \\n[.$]>=\\n+[cov*i] .ds cov*mt-tm!\\n[cov*i] \\$[\\n[cov*i]]
+.nr cov*mt-tm-max \\n[.$]
+..
.\"-----------------------
.\" cover sheet
.\" the file must have the following last lines (somewhere):
.\" .pg@enable-top-trap
.\" .bp 1
.\" .pg@enable-trap
+.ds cov*mt-file!0 0.MT
+.ds cov*mt-file!1 0.MT
+.ds cov*mt-file!2 0.MT
+.ds cov*mt-file!3 0.MT
+.ds cov*mt-file!4 4.MT
+.ds cov*mt-file!5 5.MT
+.ds cov*mt-file!6 0.MT
+.\"------------
.de MT
-.ie \\n[.$] .ds cov*mt-type \\$1
-.el .ds cov*mt-type 0
+.ie \\n[.$] \{\
+. ie d cov*mt-file!\\$1 .ds cov*mt-type \\$1
+. el .ds cov*mt-type 6
+.\}
+.el .ds cov*mt-type 1
.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]
+.ds cov*mt-type-text "\\$1
+.ie d @language .ds cov*str mm/\\*[@language]_
+.el .ds cov*str mm/
+.mso \\*[cov*str]\\*[cov*mt-file!\\*[cov*mt-type]]
..
.de COVER
-.if !\\n[.$] .@error "COVER: no arguments"
+.ie !\\n[.$] .ds cov*cov-type ms
+.el .ds cov*cov-type \\$1
.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]
+.ie d @language .ds cov*str mm/\\*[@language]_\\*[cov*cov-type].cov
+.el .ds cov*str mm/\\*[cov*cov-type].cov
+.mso \\*[cov*str]
..
.\"########################### module qrf ############################
.\" forward and backward reference thru special files.
@@ -2099,11 +2273,11 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
. ie !d \\*[qrf*name]-xx .tm "GETHN:\\$1 not defined"
. el \{\
. ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-xx]
-. el \\*[\\*[qrf*name]-xx]
+. el \\*[\\*[qrf*name]-xx]\c
. \}
.\}
.\" The answer...
-.el <->42<->
+.el <->42<->\c
..
.\"---------------
.\" get header-number, output X.X.X. in pass 1
@@ -2116,10 +2290,10 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
. ie !d \\*[qrf*name]-hn .tm "GETHN:\\$1 not defined"
. el \{\
. ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-hn]
-. el \\*[\\*[qrf*name]-hn]
+. el \\*[\\*[qrf*name]-hn]\c
. \}
.\}
-.el X.X.X.
+.el X.X.X.\c
..
.\"---------------
.\" get page-number, output 9999 in pass 1
@@ -2132,10 +2306,10 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
. 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 \\n[\\*[qrf*name]-pn]\c
. \}
.\}
-.el 9999
+.el 9999\c
..
.\"----------
.de GETR
diff --git a/mm/tmac.mse b/mm/tmac.mse
index 32f63fe0b..d27b618c2 100644
--- a/mm/tmac.mse
+++ b/mm/tmac.mse
@@ -1,6 +1,6 @@
-.\" version 0.11
-.ie (\n[.x]>=1)&(\n[.y]>=2) .mso tmac.@TMAC_M@
-.el .so /usr/local/lib/groff/tmac/tmac.@TMAC_M@
+.\" swedish version of mm
+.\" for mgm version 1.00
+.mso tmac.m
.ds @language se
.\"
.ds Lf Figurer
@@ -14,7 +14,9 @@
.\" page offset
.if !r O .nr @po 3.5c
.\" set the above parameters
-.PGFORM
+.ll \n[@ll]u
+.po \n[@po]u
+.pl \n[@pl]u
.ds Lifg Figur
.ds Litb Tabell
.ds Liex Uppställning
diff --git a/pic/TODO b/pic/TODO
index 03c02fd83..2346b575e 100644
--- a/pic/TODO
+++ b/pic/TODO
@@ -9,8 +9,9 @@ In troff mode without -x, fake \D't' with .ps commands.
Perhaps an option to set command char.
-Add an output class for dumb line printers. It wouldn't be pretty
-but it would be better than nothing. Integrate it with texinfo.
+Add an output class for dumb line printers. It wouldn't be pretty but
+it would be better than nothing. Integrate it with texinfo. Useful
+for groff -Tascii as well.
Option to allow better positioning of arrowheads on arcs.
@@ -21,6 +22,16 @@ the opportunity to handle arrowheads themselves.
Consider whether the line thickness should scale.
-Consider whether the tesg in a for loop should be fuzzy (as it is in grap).
+Consider whether the test in a for loop should be fuzzy (as it
+apparently is in grap).
Possibly change fillval so that zero is black.
+
+Provide a way of getting text blocks (positioned with `.in' rather
+than \h), into pic. Should be possible to use block of diverted text
+in pic. Possibly something similar to T{ and T} in tbl.
+
+Option to provide macro backtraces.
+
+Have a path that is searched by `copy' statement. Set by environment
+variable or command line option.
diff --git a/pic/common.c b/pic/common.c
index 1f31c04fb..d6d240922 100644
--- a/pic/common.c
+++ b/pic/common.c
@@ -112,6 +112,8 @@ void common_output::dashed_arc(const position &start, const position &cent,
double rad = hypot(c - start);
double dash_angle = lt.dash_width/rad;
double total_angle = end_angle - start_angle;
+ while (total_angle < 0)
+ total_angle += M_PI + M_PI;
if (total_angle <= dash_angle*2.0) {
solid_arc(cent, rad, start_angle, end_angle, lt);
return;
@@ -138,6 +140,8 @@ void common_output::dotted_arc(const position &start, const position &cent,
distance end_offset = end - c;
double start_angle = atan2(start_offset.y, start_offset.x);
double total_angle = atan2(end_offset.y, end_offset.x) - start_angle;
+ while (total_angle < 0)
+ total_angle += M_PI + M_PI;
double rad = hypot(c - start);
int ndots = int(total_angle/(lt.dash_width/rad) + .5);
if (ndots == 0)
@@ -292,6 +296,8 @@ void common_output::dash_line(const position &start, const position &end,
{
distance dist = end - start;
double length = hypot(dist);
+ if (length == 0.0)
+ return;
double pos = 0.0;
for (;;) {
if (*offsetp >= dash_width) {
diff --git a/pic/lex.c b/pic/lex.c
index 1984c6483..c687bea63 100644
--- a/pic/lex.c
+++ b/pic/lex.c
@@ -135,7 +135,7 @@ macro_input::macro_input(const char *str)
macro_input::~macro_input()
{
- delete s;
+ a_delete s;
}
int macro_input::get()
@@ -184,8 +184,8 @@ argument_macro_input::argument_macro_input(const char *body, int ac, char **av)
argument_macro_input::~argument_macro_input()
{
for (int i = 0; i < argc; i++)
- delete argv[i];
- delete s;
+ a_delete argv[i];
+ a_delete s;
}
int argument_macro_input::get()
@@ -445,6 +445,7 @@ int lookup_keyword(const char *str, int len)
"center", CENTER,
"chop", CHOP,
"circle", CIRCLE,
+ "command", COMMAND,
"copy", COPY,
"cos", COS,
"cw", CW,
@@ -828,7 +829,7 @@ int get_token(int lookup_flag)
token_buffer += char(c);
}
context_buffer = token_buffer;
- return COMMAND;
+ return COMMAND_LINE;
}
switch (c) {
case EOF:
@@ -1313,8 +1314,8 @@ for_input::for_input(char *vr, double t, int bim, double b, char *bd)
for_input::~for_input()
{
- delete var;
- delete body;
+ a_delete var;
+ a_delete body;
}
int for_input::get()
@@ -1475,8 +1476,8 @@ copy_thru_input::copy_thru_input(const char *b, const char *u)
copy_thru_input::~copy_thru_input()
{
- delete body;
- delete until;
+ a_delete body;
+ a_delete until;
}
int copy_thru_input::get()
@@ -1742,7 +1743,7 @@ int yylex()
case NUMBER:
yylval.x = token_double;
return t;
- case COMMAND:
+ case COMMAND_LINE:
case TEXT:
token_buffer += '\0';
if (!input_stack::get_location(&yylval.lstr.filename,
diff --git a/pic/object.c b/pic/object.c
index d417f6518..94f0f6213 100644
--- a/pic/object.c
+++ b/pic/object.c
@@ -35,7 +35,7 @@ output::output() : desired_height(0.0), desired_width(0.0), args(0)
output::~output()
{
- delete args;
+ a_delete args;
}
void output::set_desired_width_height(double wid, double ht)
@@ -46,7 +46,7 @@ void output::set_desired_width_height(double wid, double ht)
void output::set_args(const char *s)
{
- delete args;
+ a_delete args;
if (s == 0 || *s == '\0')
args = 0;
else
@@ -100,9 +100,9 @@ double output::compute_scale(double sc, const position &ll, const position &ur)
if (sc <= 0.0)
sc = 1.0;
distance sdim = dim/sc;
- double max_width;
+ double max_width = 0.0;
lookup_variable("maxpswid", &max_width);
- double max_height;
+ double max_height = 0.0;
lookup_variable("maxpsht", &max_height);
if ((max_width > 0.0 && sdim.x > max_width)
|| (max_height > 0.0 && sdim.y > max_height)) {
@@ -401,7 +401,7 @@ text_item::text_item(char *t, const char *fn, int ln)
text_item::~text_item()
{
- delete text;
+ a_delete text;
}
object_spec::object_spec(object_type t) : type(t)
@@ -456,7 +456,7 @@ command_object::command_object(char *p, const char *fn, int ln)
command_object::~command_object()
{
- delete s;
+ a_delete s;
}
void command_object::print()
@@ -536,7 +536,7 @@ text_piece::text_piece()
text_piece::~text_piece()
{
- delete text;
+ a_delete text;
}
class graphic_object : public object {
@@ -623,7 +623,8 @@ void graphic_object::print_text()
graphic_object::~graphic_object()
{
- delete [ntext] text;
+ if (text)
+ ad_delete(ntext) text;
}
class rectangle_object : public graphic_object {
@@ -1292,7 +1293,7 @@ void spline_object::print()
line_object::~line_object()
{
- delete v;
+ a_delete v;
}
linear_object *object_spec::make_line(position *curpos, direction *dirp)
@@ -1727,7 +1728,7 @@ string_list::string_list(char *s)
string_list::~string_list()
{
- delete str;
+ a_delete str;
}
/* A path is used to hold the argument to the with attribute. For example,
diff --git a/pic/pic.tab.c b/pic/pic.tab.c
index bdbe2af9b..3479be8ad 100644
--- a/pic/pic.tab.c
+++ b/pic/pic.tab.c
@@ -5,7 +5,7 @@
#define VARIABLE 259
#define NUMBER 260
#define TEXT 261
-#define COMMAND 262
+#define COMMAND_LINE 262
#define DELIMITED 263
#define ORDINAL 264
#define LEFT_ARROW_HEAD 265
@@ -107,8 +107,9 @@
#define FILL 361
#define ALIGNED 362
#define SPRINTF 363
-#define DEFINE 364
-#define UNDEF 365
+#define COMMAND 364
+#define DEFINE 365
+#define UNDEF 366
#line 19 "pic.y"
@@ -130,6 +131,9 @@ extern "C" {
int rand();
}
+/* Maximum number of characters produced by printf("%g") */
+#define GDIGITS 14
+
#ifndef __BORLANDC__
#define YYDEBUG 1
#endif /* __BORLANDC__ */
@@ -161,7 +165,7 @@ char *format_number(const char *form, double n);
char *do_sprintf(const char *form, const double *v, int nv);
-#line 71 "pic.y"
+#line 74 "pic.y"
typedef union {
char *str;
int n;
@@ -205,26 +209,26 @@ typedef
-#define YYFINAL 376
+#define YYFINAL 400
#define YYFLAG -32768
-#define YYNTBASE 131
+#define YYNTBASE 132
-#define YYTRANSLATE(x) ((unsigned)(x) <= 365 ? yytranslate[x] : 172)
+#define YYTRANSLATE(x) ((unsigned)(x) <= 366 ? yytranslate[x] : 176)
static const short yytranslate[] = { 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 120, 2, 2, 2, 119, 2, 2, 111,
- 129, 117, 115, 112, 116, 130, 118, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 124, 122, 113,
- 123, 114, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 121, 2, 2, 2, 120, 2, 2, 112,
+ 130, 118, 116, 113, 117, 131, 119, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 125, 123, 114,
+ 124, 115, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 127, 2, 128, 121, 2, 2, 2, 2, 2, 2,
+ 128, 2, 129, 122, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 125, 2, 126, 2, 2, 2, 2, 2,
+ 2, 2, 126, 2, 127, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -248,137 +252,143 @@ static const short yytranslate[] = { 0,
76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
- 106, 107, 108, 109, 110
+ 106, 107, 108, 109, 110, 111
};
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
+ 26, 31, 33, 35, 37, 39, 41, 44, 47, 48,
+ 52, 55, 56, 57, 65, 66, 67, 74, 75, 86,
+ 88, 89, 94, 96, 98, 101, 104, 108, 110, 113,
+ 115, 117, 119, 120, 126, 127, 130, 132, 134, 138,
+ 142, 146, 150, 154, 158, 162, 166, 169, 170, 173,
+ 177, 179, 184, 189, 194, 195, 196, 203, 205, 206,
+ 208, 210, 212, 214, 216, 218, 220, 222, 224, 226,
+ 229, 233, 234, 239, 243, 247, 251, 255, 258, 261,
+ 265, 268, 272, 275, 279, 282, 286, 290, 294, 298,
+ 302, 306, 309, 312, 316, 319, 323, 326, 330, 333,
+ 337, 340, 343, 346, 349, 352, 355, 358, 361, 364,
+ 367, 370, 373, 377, 380, 382, 388, 389, 393, 395,
+ 397, 399, 403, 407, 413, 419, 426, 428, 433, 437,
+ 441, 443, 446, 449, 453, 455, 457, 459, 463, 465,
+ 468, 471, 474, 476, 478, 480, 482, 484, 486, 488,
+ 491, 493, 496, 500, 502, 504, 507, 509, 514, 518,
+ 522, 525, 527, 529, 531, 533, 535, 537, 539, 541,
+ 543, 545, 547, 549, 551, 553, 555, 558, 561, 564,
+ 567, 569, 571, 574, 577, 580, 583, 585, 587, 589,
+ 591, 593, 596, 599, 602, 605, 608, 612, 616, 620,
+ 624, 628, 632, 635, 639, 644, 649, 656, 661, 666,
+ 671, 678, 685, 690, 695, 699, 703, 707, 711, 715,
+ 719, 723, 727, 731
};
-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
+static const short yyrhs[] = { 135,
+ 0, 133, 0, 135, 134, 135, 0, 154, 0, 134,
+ 136, 154, 0, 0, 136, 0, 123, 0, 136, 123,
+ 0, 4, 124, 151, 0, 4, 125, 124, 151, 0,
+ 14, 0, 15, 0, 16, 0, 17, 0, 7, 0,
+ 109, 146, 0, 84, 146, 0, 0, 83, 138, 8,
+ 0, 77, 6, 0, 0, 0, 77, 6, 78, 139,
+ 8, 140, 150, 0, 0, 0, 77, 78, 141, 8,
+ 142, 150, 0, 0, 87, 4, 124, 175, 31, 175,
+ 153, 88, 143, 8, 0, 148, 0, 0, 148, 90,
+ 144, 8, 0, 145, 0, 102, 0, 102, 4, 0,
+ 145, 4, 0, 145, 113, 4, 0, 147, 0, 146,
+ 147, 0, 175, 0, 160, 0, 162, 0, 0, 89,
+ 151, 35, 149, 8, 0, 0, 103, 6, 0, 175,
+ 0, 152, 0, 160, 94, 160, 0, 160, 93, 160,
+ 0, 152, 91, 152, 0, 152, 91, 175, 0, 175,
+ 91, 152, 0, 152, 92, 152, 0, 152, 92, 175,
+ 0, 175, 92, 152, 0, 121, 152, 0, 0, 34,
+ 175, 0, 34, 118, 175, 0, 158, 0, 3, 125,
+ 135, 154, 0, 3, 125, 135, 163, 0, 3, 125,
+ 135, 166, 0, 0, 0, 126, 155, 133, 127, 156,
+ 157, 0, 137, 0, 0, 154, 0, 18, 0, 19,
+ 0, 20, 0, 21, 0, 22, 0, 23, 0, 24,
+ 0, 25, 0, 160, 0, 104, 175, 0, 104, 175,
+ 160, 0, 0, 128, 159, 133, 129, 0, 158, 26,
+ 175, 0, 158, 27, 175, 0, 158, 28, 175, 0,
+ 158, 29, 175, 0, 158, 175, 0, 158, 14, 0,
+ 158, 14, 175, 0, 158, 15, 0, 158, 15, 175,
+ 0, 158, 17, 0, 158, 17, 175, 0, 158, 16,
+ 0, 158, 16, 175, 0, 158, 30, 162, 0, 158,
+ 31, 162, 0, 158, 32, 162, 0, 158, 33, 173,
+ 0, 158, 34, 165, 0, 158, 35, 0, 158, 36,
+ 0, 158, 36, 175, 0, 158, 37, 0, 158, 37,
+ 175, 0, 158, 106, 0, 158, 106, 175, 0, 158,
+ 38, 0, 158, 38, 175, 0, 158, 39, 0, 158,
+ 40, 0, 158, 10, 0, 158, 11, 0, 158, 12,
+ 0, 158, 85, 0, 158, 86, 0, 158, 160, 0,
+ 158, 41, 0, 158, 42, 0, 158, 43, 0, 158,
+ 44, 0, 158, 105, 175, 0, 158, 107, 0, 6,
+ 0, 108, 112, 6, 161, 130, 0, 0, 161, 113,
+ 175, 0, 163, 0, 166, 0, 165, 0, 162, 116,
+ 165, 0, 162, 117, 165, 0, 112, 162, 113, 162,
+ 130, 0, 175, 164, 162, 49, 162, 0, 175, 114,
+ 162, 113, 162, 115, 0, 48, 0, 45, 46, 47,
+ 48, 0, 175, 113, 175, 0, 112, 165, 130, 0,
+ 167, 0, 167, 174, 0, 174, 167, 0, 174, 45,
+ 167, 0, 50, 0, 3, 0, 169, 0, 167, 131,
+ 3, 0, 13, 0, 9, 13, 0, 9, 170, 0,
+ 168, 170, 0, 18, 0, 19, 0, 20, 0, 21,
+ 0, 22, 0, 23, 0, 25, 0, 128, 129, 0,
+ 6, 0, 131, 3, 0, 171, 131, 3, 0, 174,
+ 0, 171, 0, 171, 174, 0, 172, 0, 9, 13,
+ 170, 172, 0, 13, 170, 172, 0, 9, 170, 172,
+ 0, 3, 172, 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, 166, 62, 0, 166, 63, 0, 166, 64,
+ 0, 166, 65, 0, 166, 66, 0, 175, 116, 175,
+ 0, 175, 117, 175, 0, 175, 118, 175, 0, 175,
+ 119, 175, 0, 175, 120, 175, 0, 175, 122, 175,
+ 0, 117, 175, 0, 112, 151, 130, 0, 67, 112,
+ 151, 130, 0, 68, 112, 151, 130, 0, 69, 112,
+ 151, 113, 151, 130, 0, 70, 112, 151, 130, 0,
+ 71, 112, 151, 130, 0, 72, 112, 151, 130, 0,
+ 73, 112, 151, 113, 151, 130, 0, 74, 112, 151,
+ 113, 151, 130, 0, 75, 112, 151, 130, 0, 76,
+ 112, 151, 130, 0, 76, 112, 130, 0, 175, 114,
+ 175, 0, 175, 95, 175, 0, 175, 115, 175, 0,
+ 175, 96, 175, 0, 175, 94, 175, 0, 175, 93,
+ 175, 0, 175, 91, 175, 0, 175, 92, 175, 0,
+ 121, 175, 0
};
#if YYDEBUG != 0
static const short yyrline[] = { 0,
- 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
+ 269, 271, 279, 284, 287, 291, 293, 296, 298, 301,
+ 307, 319, 321, 323, 325, 327, 332, 337, 342, 345,
+ 350, 357, 360, 362, 370, 373, 375, 382, 385, 391,
+ 399, 402, 413, 414, 418, 421, 423, 427, 430, 448,
+ 456, 458, 466, 470, 473, 476, 480, 483, 487, 494,
+ 500, 502, 504, 506, 508, 510, 512, 517, 520, 522,
+ 526, 541, 543, 551, 557, 563, 570, 573, 581, 584,
+ 588, 593, 597, 601, 606, 613, 620, 627, 634, 639,
+ 644, 651, 666, 678, 684, 690, 696, 702, 721, 728,
+ 735, 742, 749, 756, 763, 770, 777, 784, 799, 811,
+ 817, 824, 836, 842, 848, 854, 860, 865, 871, 887,
+ 904, 909, 914, 919, 924, 929, 934, 939, 946, 955,
+ 964, 973, 982, 988, 995, 1000, 1010, 1017, 1038, 1041,
+ 1049, 1052, 1057, 1062, 1067, 1072, 1079, 1081, 1084, 1087,
+ 1091, 1094, 1100, 1106, 1112, 1120, 1131, 1135, 1143, 1146,
+ 1150, 1165, 1181, 1184, 1186, 1188, 1190, 1192, 1194, 1196,
+ 1198, 1202, 1207, 1214, 1222, 1226, 1233, 1239, 1245, 1251,
+ 1257, 1265, 1268, 1270, 1272, 1274, 1276, 1278, 1280, 1282,
+ 1284, 1286, 1288, 1290, 1292, 1294, 1296, 1298, 1300, 1302,
+ 1304, 1306, 1308, 1310, 1312, 1314, 1316, 1318, 1320, 1324,
+ 1333, 1335, 1342, 1349, 1356, 1363, 1370, 1372, 1374, 1376,
+ 1384, 1392, 1405, 1407, 1409, 1418, 1427, 1440, 1449, 1458,
+ 1467, 1469, 1471, 1473, 1475, 1481, 1483, 1485, 1487, 1489,
+ 1491, 1493, 1495, 1497
};
static const char * const yytname[] = { "$",
-"error","$illegal.","LABEL","VARIABLE","NUMBER","TEXT","COMMAND","DELIMITED","ORDINAL","LEFT_ARROW_HEAD",
+"error","$illegal.","LABEL","VARIABLE","NUMBER","TEXT","COMMAND_LINE","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",
"TO","AT","WITH","BY","THEN","DOTTED","DASHED","CHOP","SAME","INVISIBLE",
@@ -388,597 +398,605 @@ static const char * const yytname[] = { "$",
"EXP","SQRT","MAX","MIN","INT","RAND","COPY","THRU","TOP","BOTTOM",
"UPPER","LOWER","SH","PRINT","CW","CCW","FOR","DO","IF","ELSE",
"ANDAND","OROR","NOTEQUAL","EQUALEQUAL","LESSEQUAL","GREATEREQUAL","LEFT_CORNER","RIGHT_CORNER","CENTER","END",
-"START","RESET","UNTIL","PLOT","THICKNESS","FILL","ALIGNED","SPRINTF","DEFINE","UNDEF",
-"'('","','","'<'","'>'","'+'","'-'","'*'","'/'","'%'","'!'",
-"'^'","';'","'='","':'","'{'","'}'","'['","']'","')'","'.'",
-"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",""
+"START","RESET","UNTIL","PLOT","THICKNESS","FILL","ALIGNED","SPRINTF","COMMAND","DEFINE",
+"UNDEF","'('","','","'<'","'>'","'+'","'-'","'*'","'/'","'%'",
+"'!'","'^'","';'","'='","':'","'{'","'}'","'['","']'","')'",
+"'.'","top","element_list","middle_element_list","optional_separator","separator","placeless_element","@1","@2","@3",
+"@4","@5","@6","@7","reset_variables","print_args","print_arg","simple_if","@8","until",
+"any_expr","text_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
static const short yyr1[] = { 0,
- 131, 131, 132, 133, 133, 134, 134, 135, 135, 136,
- 136, 136, 136, 136, 136, 136, 136, 136, 137, 136,
- 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, 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
+ 132, 132, 133, 134, 134, 135, 135, 136, 136, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 138, 137,
+ 137, 139, 140, 137, 141, 142, 137, 143, 137, 137,
+ 144, 137, 137, 137, 145, 145, 145, 146, 146, 147,
+ 147, 147, 149, 148, 150, 150, 151, 151, 152, 152,
+ 152, 152, 152, 152, 152, 152, 152, 153, 153, 153,
+ 154, 154, 154, 154, 155, 156, 154, 154, 157, 157,
+ 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
+ 158, 159, 158, 158, 158, 158, 158, 158, 158, 158,
+ 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
+ 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
+ 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
+ 158, 158, 158, 158, 160, 160, 161, 161, 162, 162,
+ 163, 163, 163, 163, 163, 163, 164, 164, 165, 165,
+ 166, 166, 166, 166, 166, 167, 167, 167, 168, 168,
+ 169, 169, 170, 170, 170, 170, 170, 170, 170, 170,
+ 170, 171, 171, 172, 172, 172, 173, 173, 173, 173,
+ 173, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 175,
+ 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
+ 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
+ 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
+ 175, 175, 175, 175
};
static const short yyr2[] = { 0,
1, 1, 3, 1, 3, 0, 1, 1, 2, 3,
- 1, 1, 1, 1, 1, 2, 2, 2, 0, 3,
+ 4, 1, 1, 1, 1, 1, 2, 2, 0, 3,
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, 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,
- 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
+ 0, 4, 1, 1, 2, 2, 3, 1, 2, 1,
+ 1, 1, 0, 5, 0, 2, 1, 1, 3, 3,
+ 3, 3, 3, 3, 3, 3, 2, 0, 2, 3,
+ 1, 4, 4, 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, 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, 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,
+ 8, 2, 1, 7, 0, 0, 125, 16, 12, 13,
+ 14, 15, 71, 72, 73, 74, 75, 76, 77, 78,
+ 0, 19, 0, 0, 0, 34, 0, 0, 0, 65,
+ 82, 6, 68, 33, 30, 4, 61, 79, 9, 6,
+ 0, 0, 21, 25, 0, 146, 200, 201, 0, 149,
+ 185, 186, 145, 172, 173, 174, 175, 176, 177, 178,
+ 179, 180, 181, 182, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 183, 184, 0, 0, 191, 192,
+ 197, 199, 198, 0, 0, 0, 18, 38, 41, 42,
+ 129, 131, 130, 141, 0, 147, 0, 40, 0, 0,
+ 0, 0, 48, 0, 0, 47, 35, 80, 0, 17,
+ 6, 6, 3, 7, 36, 0, 31, 113, 114, 115,
+ 89, 91, 95, 93, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 102, 103, 105, 109, 111, 112, 119,
+ 120, 121, 122, 116, 117, 0, 107, 124, 118, 88,
+ 0, 10, 0, 22, 0, 20, 161, 150, 153, 154,
+ 155, 156, 157, 158, 159, 0, 151, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 187, 189, 193,
+ 195, 188, 190, 194, 196, 0, 0, 131, 47, 213,
+ 234, 39, 0, 0, 202, 203, 204, 205, 206, 0,
+ 142, 152, 0, 143, 0, 137, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 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
+ 0, 0, 0, 57, 234, 43, 0, 0, 0, 0,
+ 0, 0, 0, 81, 127, 0, 0, 0, 5, 37,
+ 0, 90, 92, 96, 94, 84, 85, 86, 87, 97,
+ 0, 98, 99, 0, 0, 0, 0, 165, 167, 100,
+ 164, 0, 101, 0, 104, 106, 110, 123, 108, 146,
+ 200, 14, 15, 62, 0, 63, 64, 11, 0, 26,
+ 160, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 225, 0, 214, 0, 140, 132, 133, 148, 144, 0,
+ 232, 233, 231, 230, 227, 229, 139, 0, 226, 228,
+ 207, 208, 209, 210, 211, 212, 0, 0, 0, 51,
+ 52, 54, 55, 50, 49, 53, 232, 56, 233, 226,
+ 0, 66, 83, 32, 171, 0, 0, 0, 162, 0,
+ 166, 0, 47, 23, 45, 215, 216, 0, 218, 219,
+ 220, 0, 0, 223, 224, 0, 0, 0, 0, 0,
+ 44, 0, 126, 69, 0, 170, 169, 163, 45, 0,
+ 27, 0, 0, 0, 134, 138, 0, 135, 58, 128,
+ 70, 67, 168, 24, 46, 217, 221, 222, 136, 0,
+ 0, 0, 59, 28, 60, 0, 29, 0, 0, 0
};
-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 yydefgoto[] = { 398,
+ 2, 32, 237, 4, 33, 45, 279, 369, 155, 345,
+ 396, 241, 34, 87, 88, 35, 319, 371, 186, 103,
+ 391, 36, 111, 364, 382, 37, 112, 104, 331, 90,
+ 91, 222, 92, 105, 94, 95, 96, 167, 258, 259,
+ 260, 97, 106
};
-static const short yypact[] = { -107,
--32768,-32768, 574, -104, -103, -97,-32768,-32768,-32768,-32768,
+static const short yypact[] = { -98,
+-32768,-32768, 615, -95, -79, -102,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-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,
+ 13,-32768, 832, 61, 942, 73, 1370, -20, 832,-32768,
+-32768, -98,-32768, 5, -6,-32768, 722,-32768,-32768, -98,
+ 942, -29, 33,-32768, 112,-32768,-32768,-32768, 32,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-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
+-32768,-32768,-32768,-32768, 10, 29, 47, 49, 52, 53,
+ 54, 60, 68, 70,-32768,-32768, -1, 58,-32768,-32768,
+-32768,-32768,-32768, 1052, 1370, 1370, 832,-32768,-32768, -77,
+-32768,-32768, 321, 1949, 156,-32768, 198, 1979, 59, 942,
+ 942, 90, -59, -11, 321, 869,-32768, 284, 167, 832,
+ -98, -98,-32768, 592,-32768, 199,-32768,-32768,-32768,-32768,
+ 1814, 1814, 1654, 1734, 1370, 1370, 1370, 1370, 1472, 1472,
+ 1472, 251, 1574,-32768, 1814, 1814, 1814,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768, 1370, 1814,-32768,-32768, 979,
+ 476,-32768, 942,-32768, 205,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768, 77,-32768, 942, 942, 942,
+ 942, 942, 942, 942, 942, 942, 357,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768, 84, -57, 87, 1995, 96,
+ 96,-32768, 1574, 1574,-32768,-32768,-32768,-32768,-32768, 216,
+-32768,-32768, 18, 92, 178,-32768, 1370, 1370, 1370, 1370,
+ 1370, 1370, 1370, 1472, 1370, 1370, 1370, 1370, 1370, 1370,
+ 1370, 1472, 1370,-32768, 96,-32768, 942, 942, 1, 1,
+ 942, 942, 1370,-32768,-32768, 100, 615, 101,-32768,-32768,
+ 221, 979, 979, 979, 979, 979, 979, 979, 979, -77,
+ 1979, -77, -77, 1885, 260, 156, 229, 1938,-32768,-32768,
+-32768, 1162,-32768, 569, 979, 979, 979, 979, 979, -79,
+ -102, 212, 213,-32768, -77, -28, 331,-32768, 225,-32768,
+-32768, 104, 105, 125, 110, 111, 115, 129, 135, 120,
+-32768, 121,-32768, 1472,-32768,-32768,-32768,-32768, 92, 206,
+ 801, 1089, 911, 911, 237, 237, 979, -37, 224, 237,
+ 143, 143, 96, 96, 96, 96, -31, 200, 244,-32768,
+ 801, 165, 1191,-32768,-32768,-32768, 801, 165, 1191, 237,
+ -93,-32768,-32768,-32768,-32768, 156, 1885, 1885,-32768, 256,
+-32768, 87, 759,-32768, 172,-32768,-32768, 942,-32768,-32768,
+-32768, 942, 942,-32768,-32768, -49, 222, 1472, 1472, 1370,
+-32768, 1370,-32768, 615, 1885,-32768,-32768,-32768, 172, 280,
+-32768, 157, 158, 159,-32768,-32768, -45, -77, 532, 979,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1264,
+ 209, 1370, 979,-32768, 979, 290,-32768, 299, 301,-32768
};
static const short yypgoto[] = {-32768,
- 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
+ 19,-32768, 26, 281,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768, 292, -76,-32768,-32768, -46, -24, -89,
+-32768, -109,-32768,-32768,-32768,-32768,-32768, 7,-32768, -82,
+ 174,-32768, -60, 6, -84,-32768,-32768, -87,-32768, -211,
+-32768, -91, -23
};
-#define YYLAST 2114
-
-
-static const short yytable[] = { 94,
- 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, 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,
+#define YYLAST 2117
+
+
+static const short yytable[] = { 98,
+ 102, 187, 201, 108, 239, 98, 7, 202, 115, 38,
+ 192, 224, 204, 150, 178, 179, 152, 359, 43, 362,
+ 46, 41, 42, 188, 1, 3, 49, 39, 93, 89,
+ 50, 227, 228, 192, 93, 89, 363, 157, 193, 194,
+ 261, 274, 335, 149, 158, 40, 250, 252, 253, 159,
+ 160, 161, 162, 163, 164, 294, 165, 113, 193, 194,
+ 189, 190, 191, 98, 99, 151, 193, 194, 275, 389,
+ 193, 194, 263, 182, 183, 358, 107, 225, 193, 194,
+ 375, 229, 230, 117, 193, 194, 98, -129, -129, 93,
+ 44, 109, 93, 89, 153, 180, 181, 242, 243, 244,
+ 245, 246, 247, 248, 249, 251, 251, 251, 28, 264,
+ 154, 265, 266, 267, 234, 93, 89, 116, 299, 156,
+ 38, 168, 268, 269, 226, 366, 367, 251, 278, 236,
+ 238, 308, 296, 297, 93, 93, 93, 320, 322, 317,
+ 169, 326, 328, 282, 283, 284, 285, 286, 287, 288,
+ 289, 290, 292, 383, 184, 185, 277, 38, 170, 166,
+ 171, 157, 261, 172, 173, 174, 341, 337, 338, 264,
+ 264, 175, 235, 159, 160, 161, 162, 163, 164, 176,
+ 165, 177, 223, 301, 302, 303, 304, 305, 306, 307,
+ 309, 310, 311, 312, 313, 314, 315, 316, 251, 318,
+ 46, 342, 240, 321, 323, 281, 49, 327, 329, 330,
+ 50, 356, 280, 293, -185, -186, 295, 221, 298, 93,
+ -185, -186, 200, 300, -185, -186, 332, 93, 334, 333,
+ 360, 339, 344, 346, 347, 324, 325, 348, 343, 349,
+ 350, 352, 203, 38, 351, 261, 261, 353, 365, 354,
+ 355, 361, 357, 254, 381, 227, -185, -186, 368, 255,
+ 218, 219, 220, 256, 221, 157, 51, 52, 205, 376,
+ 251, 206, 336, 261, 370, 377, 378, 159, 160, 161,
+ 162, 163, 164, 166, 165, 385, 386, 387, 388, 7,
+ 207, 208, 209, 210, 211, 212, 394, 397, 399, 93,
+ 400, 54, 55, 56, 57, 58, 59, 60, 61, 62,
+ 63, 64, 114, 233, 215, 216, 217, 218, 219, 220,
+ 110, 221, 384, 372, 276, 0, 0, 373, 374, 75,
+ 76, 77, 78, 0, 251, 251, 379, 0, 380, 216,
+ 217, 218, 219, 220, 0, 221, 0, 79, 80, 81,
+ 82, 83, 216, 217, 218, 219, 220, 0, 221, 46,
+ 47, 48, 7, 93, 93, 49, 393, 0, 395, 50,
+ 38, 0, 51, 52, 207, 208, 209, 210, 211, 212,
+ 0, 257, 195, 196, 197, 198, 199, 166, 0, 0,
+ 0, 28, 195, 196, 197, 198, 199, 233, 215, 216,
+ 217, 218, 219, 220, 0, 221, 53, 54, 55, 56,
+ 57, 58, 59, 60, 61, 62, 63, 64, 0, 0,
+ 0, 0, 0, 65, 66, 67, 68, 69, 70, 71,
+ 72, 73, 74, 0, 0, 75, 76, 77, 78, 0,
+ 0, 0, 0, 0, 0, 0, -130, -130, 0, 0,
+ 0, 0, 0, 79, 80, 81, 82, 83, 0, 0,
+ 0, 0, 0, 0, 28, 0, 0, 0, 100, 0,
+ 0, 0, 0, 85, 0, 0, 0, 101, 270, 271,
+ 48, 7, 8, 0, 49, 0, 291, 0, 50, 9,
+ 10, 272, 273, 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, 53, 54, 55, 56, 57,
+ 58, 59, 60, 61, 62, 63, 64, 0, 0, 0,
+ 0, 0, 65, 66, 67, 68, 69, 70, 71, 72,
+ 73, 74, 21, 0, 75, 76, 77, 78, 22, 23,
+ 0, 0, 24, 0, 25, 390, 0, 0, 0, 0,
+ 0, 0, 79, 80, 81, 82, 83, 26, 0, 27,
+ 0, 0, 0, 28, 29, 0, 0, 84, 0, 0,
+ 0, 0, 85, 0, 5, 6, 86, 7, 8, 0,
+ 0, 30, 0, 31, 0, 9, 10, 11, 12, 13,
+ 14, 15, 16, 17, 18, 19, 20, 5, 6, 0,
+ 7, 8, 207, 208, 209, 210, 211, 212, 9, 10,
+ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
+ 0, 0, 0, 0, 0, 233, 215, 216, 217, 218,
+ 219, 220, 0, 221, 0, 0, 0, 0, 0, 207,
+ 208, 209, 210, 211, 212, 0, 0, 0, 21, 0,
+ 0, 0, 0, 0, 22, 23, 0, 0, 24, 0,
+ 25, 213, 233, 215, 216, 217, 218, 219, 220, 0,
+ 221, 21, 0, 26, 0, 27, 0, 22, 23, 28,
+ 29, 24, 0, 25, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 39, 0, 26, 30, 27, 31,
+ 0, 0, 28, 29, 46, 47, 48, 7, 0, 0,
+ 49, 118, 119, 120, 50, 121, 122, 123, 124, 0,
+ 30, 0, 31, 0, 0, 0, 0, 125, 126, 127,
+ 128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
+ 138, 139, 140, 141, 142, 143, 0, 0, 0, 0,
+ 0, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+ 62, 63, 64, 0, 0, 0, 0, 0, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 0, 0,
+ 75, 76, 77, 78, 0, 0, 144, 145, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 79, 80,
+ 81, 82, 83, 0, 0, 0, 146, 147, 148, 28,
+ 0, 0, 0, 100, 46, 47, 48, 7, 85, 0,
+ 49, 0, 86, 0, 50, 0, 0, 51, 52, 231,
+ 232, 209, 210, 211, 212, 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, 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, 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, 28, 0, 47,
- 96, 0, 0, 48, 0, 83, 49, 50, 0, 84,
+ 0, 213, 233, 215, 216, 217, 218, 219, 220, 0,
+ 221, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+ 62, 63, 64, 209, 210, 211, 212, 0, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 0, 0,
+ 75, 76, 77, 78, 233, 215, 216, 217, 218, 219,
+ 220, 0, 221, 0, 0, 0, 0, 0, 79, 80,
+ 81, 82, 83, 0, 0, 0, 0, 0, 0, 28,
+ 0, 0, 0, 84, 46, 47, 48, 7, 85, 0,
+ 49, 0, 86, 0, 50, 0, 0, 51, 52, 231,
+ 232, 209, 210, 211, 212, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,
+ 0, 0, 233, 215, 216, 217, 218, 219, 220, 0,
+ 221, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+ 62, 63, 64, 0, 0, 211, 212, 0, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 0, 0,
+ 75, 76, 77, 78, 233, 215, 216, 217, 218, 219,
+ 220, 0, 221, 0, 0, 0, 0, 0, 79, 80,
+ 81, 82, 83, 0, 0, 0, 0, 0, 0, 28,
+ 0, 0, 0, 100, 46, 47, 48, 7, 85, 0,
+ 49, 0, 101, 0, 50, 0, 0, 51, 52, 207,
+ 208, 209, 210, 211, 212, 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, 368, 48, 0,
- 84, 49, 50, 197, 198, 199, 200, 201, 202, 0,
+ 0, 0, 233, 215, 216, 217, 218, 219, 220, 0,
+ 221, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+ 62, 63, 64, 0, 0, 0, 0, 0, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 0, 0,
+ 75, 76, 77, 78, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 79, 80,
+ 81, 82, 83, 0, 0, 0, 0, 0, 0, 28,
+ 0, 0, 0, 84, 46, 47, 48, 7, 85, 0,
+ 49, 0, 101, 0, 50, 0, 0, 51, 52, 207,
+ 0, 209, 210, 211, 212, 0, 0, 0, 0, 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, 233, 215, 216, 217, 218, 219, 220, 0,
+ 221, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+ 62, 63, 64, 0, 0, 0, 0, 0, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 0, 0,
+ 75, 76, 77, 78, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 79, 80,
+ 81, 82, 83, 0, 0, 0, 46, 47, 48, 28,
+ 0, 0, 49, 262, 0, 0, 50, 0, 85, 51,
+ 52, 231, 101, 209, 210, 211, 212, 0, 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, 233, 215, 216, 217, 218, 219,
+ 220, 0, 221, 53, 54, 55, 56, 57, 58, 59,
+ 60, 61, 62, 63, 64, 0, 0, 0, 0, 0,
+ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ 0, 0, 75, 76, 77, 78, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 79, 80, 81, 82, 83, 0, 0, 0, 0, 0,
+ 0, 0, 46, 47, 48, 100, 0, 0, 49, 0,
+ 85, 392, 50, 0, 86, 51, 52, 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, 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, 82, 0, 0,
- 48, 0, 83, 49, 50, 0, 84, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 53,
+ 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+ 64, 0, 0, 0, 0, 0, 65, 66, 67, 68,
+ 69, 70, 71, 72, 73, 74, 0, 0, 75, 76,
+ 77, 78, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 79, 80, 81, 82,
+ 83, 0, 0, 0, 46, 47, 48, 0, 0, 0,
+ 49, 100, 0, 0, 50, 0, 85, 51, 52, 0,
+ 86, 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, 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, -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,
- 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, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+ 62, 63, 64, 0, 0, 0, 0, 0, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 0, 0,
+ 75, 76, 77, 78, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 79, 80,
+ 81, 82, 83, 0, 0, 0, 46, 47, 48, 0,
+ 0, 0, 49, 84, 0, 0, 50, 0, 85, 51,
+ 52, 0, 86, 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, 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, 53, 54, 55, 56, 57, 58, 59,
+ 60, 61, 62, 63, 64, 0, 0, 0, 0, 0,
+ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ 0, 0, 75, 76, 77, 78, 46, 47, 48, 0,
+ 0, 0, 49, 0, 0, 0, 50, 0, 0, 0,
+ 79, 80, 81, 82, 83, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 262, 0, 0, 0, 0,
+ 85, 0, 0, 0, 86, 0, 0, 0, -185, 0,
+ 0, 0, 0, 53, 54, 55, 56, 57, 58, 59,
+ 60, 61, 62, 63, 64, 0, 0, 0, 0, 0,
+ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ 0, 0, 75, 76, 77, 78, 46, 47, 48, 0,
+ 0, 0, 49, 0, 0, 0, 50, 0, 0, 0,
+ 79, 80, 81, 82, 83, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 100, 0, 0, 0, 0,
+ 85, 0, 0, 0, 86, 0, 0, 0, -186, 0,
+ 0, 0, 0, 53, 54, 55, 56, 57, 58, 59,
+ 60, 61, 62, 63, 64, 0, 0, 0, 0, 0,
+ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ 0, 0, 75, 76, 77, 78, 46, 47, 48, 0,
+ 0, 0, 49, 0, 0, 0, 50, 0, 0, 0,
+ 79, 80, 81, 82, 83, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 100, 0, 0, 0, 0,
+ 85, 0, 0, 0, 86, 0, 0, 0, 0, 0,
+ 0, 0, 0, 53, 54, 55, 56, 57, 58, 59,
+ 60, 61, 62, 63, 64, 0, 0, 0, 0, 0,
+ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ 0, 0, 75, 76, 77, 78, 0, 0, 0, 0,
+ 51, 52, 0, 0, 0, 0, 0, 0, 0, 0,
+ 79, 80, 81, 82, 83, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 100, 0, 0, 0, 0,
+ 85, 0, 0, 0, 86, 54, 55, 56, 57, 58,
+ 59, 60, 61, 62, 63, 64, 0, 0, 0, 0,
+ 0, 0, 0, 51, 52, 0, 0, 0, 0, 0,
+ 0, 0, 0, 75, 76, 77, 78, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 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,
- 210, 0, 211, 197, 198, 199, 200, 201, 202, 0,
+ 0, 79, 80, 81, 82, 83, 0, 0, 54, 55,
+ 56, 57, 58, 59, 60, 61, 62, 63, 64, 54,
+ 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
+ 0, 0, 0, 0, 0, 257, 75, 76, 77, 78,
+ 0, 0, 0, 205, 0, 0, 206, 75, 76, 77,
+ 78, 0, 0, 0, 79, 80, 81, 82, 83, 205,
+ 0, 0, 206, 0, 0, 79, 80, 81, 82, 83,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 218, 205, 206, 207, 208,
- 209, 210, 0, 211
+ 0, 0, 0, 0, 0, 0, 0, 0, 340, 207,
+ 208, 209, 210, 211, 212, 0, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 231, 232, 209, 210, 211,
+ 212, 213, 214, 215, 216, 217, 218, 219, 220, 0,
+ 221, 0, 0, 0, 0, 0, 0, 213, 214, 215,
+ 216, 217, 218, 219, 220, 0, 221
};
static const short yycheck[] = { 23,
- 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, 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,
+ 25, 84, 94, 27, 114, 29, 6, 95, 4, 3,
+ 87, 101, 97, 37, 16, 17, 41, 49, 6, 113,
+ 3, 124, 125, 84, 123, 0, 9, 123, 23, 23,
+ 13, 91, 92, 110, 29, 29, 130, 6, 116, 117,
+ 132, 151, 254, 37, 13, 125, 129, 130, 131, 18,
+ 19, 20, 21, 22, 23, 113, 25, 32, 116, 117,
+ 84, 85, 86, 87, 4, 40, 116, 117, 151, 115,
+ 116, 117, 133, 16, 17, 113, 4, 101, 116, 117,
+ 130, 93, 94, 90, 116, 117, 110, 116, 117, 84,
+ 78, 112, 87, 87, 124, 97, 98, 121, 122, 123,
+ 124, 125, 126, 127, 128, 129, 130, 131, 108, 133,
+ 78, 135, 136, 137, 108, 110, 110, 113, 203, 8,
+ 114, 112, 146, 147, 35, 337, 338, 151, 153, 111,
+ 112, 214, 193, 194, 129, 130, 131, 227, 228, 222,
+ 112, 231, 232, 168, 169, 170, 171, 172, 173, 174,
+ 175, 176, 177, 365, 97, 98, 151, 151, 112, 128,
+ 112, 6, 254, 112, 112, 112, 258, 255, 256, 193,
+ 194, 112, 6, 18, 19, 20, 21, 22, 23, 112,
+ 25, 112, 124, 207, 208, 209, 210, 211, 212, 213,
+ 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
+ 3, 262, 4, 227, 228, 129, 9, 231, 232, 233,
+ 13, 294, 8, 130, 3, 3, 130, 122, 3, 214,
+ 9, 9, 131, 46, 13, 13, 127, 222, 8, 129,
+ 31, 3, 8, 130, 130, 229, 230, 113, 262, 130,
+ 130, 113, 45, 237, 130, 337, 338, 113, 336, 130,
+ 130, 8, 47, 3, 364, 91, 45, 45, 3, 9,
+ 118, 119, 120, 13, 122, 6, 16, 17, 45, 48,
+ 294, 48, 13, 365, 103, 358, 359, 18, 19, 20,
+ 21, 22, 23, 128, 25, 6, 130, 130, 130, 6,
+ 91, 92, 93, 94, 95, 96, 88, 8, 0, 294,
+ 0, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+ 60, 61, 32, 114, 115, 116, 117, 118, 119, 120,
+ 29, 122, 369, 348, 151, -1, -1, 352, 353, 79,
+ 80, 81, 82, -1, 358, 359, 360, -1, 362, 116,
+ 117, 118, 119, 120, -1, 122, -1, 97, 98, 99,
+ 100, 101, 116, 117, 118, 119, 120, -1, 122, 3,
+ 4, 5, 6, 358, 359, 9, 390, -1, 392, 13,
+ 364, -1, 16, 17, 91, 92, 93, 94, 95, 96,
+ -1, 131, 62, 63, 64, 65, 66, 128, -1, -1,
+ -1, 108, 62, 63, 64, 65, 66, 114, 115, 116,
+ 117, 118, 119, 120, -1, 122, 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, 116, 117, -1, -1,
+ -1, -1, -1, 97, 98, 99, 100, 101, -1, -1,
+ -1, -1, -1, -1, 108, -1, -1, -1, 112, -1,
+ -1, -1, -1, 117, -1, -1, -1, 121, 3, 4,
+ 5, 6, 7, -1, 9, -1, 130, -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, 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, 34, -1, -1, -1, -1,
+ -1, -1, 97, 98, 99, 100, 101, 102, -1, 104,
+ -1, -1, -1, 108, 109, -1, -1, 112, -1, -1,
+ -1, -1, 117, -1, 3, 4, 121, 6, 7, -1,
+ -1, 126, -1, 128, -1, 14, 15, 16, 17, 18,
+ 19, 20, 21, 22, 23, 24, 25, 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, -1, 114, 115, 116, 117, 118,
+ 119, 120, -1, 122, -1, -1, -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, 120, -1,
+ 122, 77, -1, 102, -1, 104, -1, 83, 84, 108,
+ 109, 87, -1, 89, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 123, -1, 102, 126, 104, 128,
+ -1, -1, 108, 109, 3, 4, 5, 6, -1, -1,
+ 9, 10, 11, 12, 13, 14, 15, 16, 17, -1,
+ 126, -1, 128, -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, -1, 112, 3, 4, 5, 6, 117, -1,
+ 9, -1, 121, -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,
- -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, -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, 108, -1, 9,
- 111, -1, -1, 13, -1, 116, 16, 17, -1, 120,
+ -1, 113, 114, 115, 116, 117, 118, 119, 120, -1,
+ 122, 50, 51, 52, 53, 54, 55, 56, 57, 58,
+ 59, 60, 61, 93, 94, 95, 96, -1, 67, 68,
+ 69, 70, 71, 72, 73, 74, 75, 76, -1, -1,
+ 79, 80, 81, 82, 114, 115, 116, 117, 118, 119,
+ 120, -1, 122, -1, -1, -1, -1, -1, 97, 98,
+ 99, 100, 101, -1, -1, -1, -1, -1, -1, 108,
+ -1, -1, -1, 112, 3, 4, 5, 6, 117, -1,
+ 9, -1, 121, -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,
- -1, -1, -1, -1, -1, -1, -1, -1, 6, -1,
+ -1, -1, 114, 115, 116, 117, 118, 119, 120, -1,
+ 122, 50, 51, 52, 53, 54, 55, 56, 57, 58,
+ 59, 60, 61, -1, -1, 95, 96, -1, 67, 68,
+ 69, 70, 71, 72, 73, 74, 75, 76, -1, -1,
+ 79, 80, 81, 82, 114, 115, 116, 117, 118, 119,
+ 120, -1, 122, -1, -1, -1, -1, -1, 97, 98,
+ 99, 100, 101, -1, -1, -1, -1, -1, -1, 108,
+ -1, -1, -1, 112, 3, 4, 5, 6, 117, -1,
+ 9, -1, 121, -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,
- 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, -1,
+ -1, -1, 114, 115, 116, 117, 118, 119, 120, -1,
+ 122, 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, 108,
+ -1, -1, -1, 112, 3, 4, 5, 6, 117, -1,
+ 9, -1, 121, -1, 13, -1, -1, 16, 17, 91,
+ -1, 93, 94, 95, 96, -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, 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, 114, 115, 116, 117, 118, 119, 120, -1,
+ 122, 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, 3, 4, 5, 108,
+ -1, -1, 9, 112, -1, -1, 13, -1, 117, 16,
+ 17, 91, 121, 93, 94, 95, 96, -1, -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, 114, 115, 116, 117, 118, 119,
+ 120, -1, 122, 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, -1, 3, 4, 5, 112, -1, -1, 9, -1,
+ 117, 118, 13, -1, 121, 16, 17, -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, -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, 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, 3, 4, 5, -1, -1, -1,
+ 9, 112, -1, -1, 13, -1, 117, 16, 17, -1,
+ 121, -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, -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, -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, 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, 3, 4, 5, -1,
+ -1, -1, 9, 112, -1, -1, 13, -1, 117, 16,
+ 17, -1, 121, -1, -1, -1, -1, -1, -1, -1,
-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, 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,
- 119, -1, 121, 91, 92, 93, 94, 95, 96, -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, -1, 112, -1, -1, -1, -1,
+ 117, -1, -1, -1, 121, -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, -1, 112, -1, -1, -1, -1,
+ 117, -1, -1, -1, 121, -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, -1, 112, -1, -1, -1, -1,
+ 117, -1, -1, -1, 121, -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,
+ 16, 17, -1, -1, -1, -1, -1, -1, -1, -1,
+ 97, 98, 99, 100, 101, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 112, -1, -1, -1, -1,
+ 117, -1, -1, -1, 121, 51, 52, 53, 54, 55,
+ 56, 57, 58, 59, 60, 61, -1, -1, -1, -1,
+ -1, -1, -1, 16, 17, -1, -1, -1, -1, -1,
+ -1, -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, 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, 131, 79, 80, 81, 82,
+ -1, -1, -1, 45, -1, -1, 48, 79, 80, 81,
+ 82, -1, -1, -1, 97, 98, 99, 100, 101, 45,
+ -1, -1, 48, -1, -1, 97, 98, 99, 100, 101,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 113, 114, 115, 116, 117,
- 118, 119, -1, 121
+ -1, -1, -1, -1, -1, -1, -1, -1, 131, 91,
+ 92, 93, 94, 95, 96, -1, -1, -1, -1, 131,
+ -1, -1, -1, -1, -1, 91, 92, 93, 94, 95,
+ 96, 113, 114, 115, 116, 117, 118, 119, 120, -1,
+ 122, -1, -1, -1, -1, -1, -1, 113, 114, 115,
+ 116, 117, 118, 119, 120, -1, 122
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/local/lib/bison.simple"
@@ -1404,91 +1422,96 @@ yyreduce:
switch (yyn) {
case 2:
-#line 268 "pic.y"
+#line 272 "pic.y"
{
if (olist.head)
print_picture(olist.head);
;
break;}
case 3:
-#line 277 "pic.y"
+#line 281 "pic.y"
{ yyval.pl = yyvsp[-1].pl; ;
break;}
case 4:
-#line 282 "pic.y"
+#line 286 "pic.y"
{ yyval.pl = yyvsp[0].pl; ;
break;}
case 5:
-#line 284 "pic.y"
+#line 288 "pic.y"
{ yyval.pl = yyvsp[-2].pl; ;
break;}
case 10:
-#line 299 "pic.y"
+#line 303 "pic.y"
{
define_variable(yyvsp[-2].str, yyvsp[0].x);
- delete yyvsp[-2].str;
+ a_delete yyvsp[-2].str;
;
break;}
case 11:
-#line 304 "pic.y"
-{ current_direction = UP_DIRECTION; ;
+#line 308 "pic.y"
+{
+ place *p = lookup_label(yyvsp[-3].str);
+ if (!p) {
+ lex_error("variable `%1' not defined", yyvsp[-3].str);
+ YYABORT;
+ }
+ p->obj = 0;
+ p->x = yyvsp[0].x;
+ p->y = 0.0;
+ a_delete yyvsp[-3].str;
+ ;
break;}
case 12:
-#line 306 "pic.y"
-{ current_direction = DOWN_DIRECTION; ;
+#line 320 "pic.y"
+{ current_direction = UP_DIRECTION; ;
break;}
case 13:
-#line 308 "pic.y"
-{ current_direction = LEFT_DIRECTION; ;
+#line 322 "pic.y"
+{ current_direction = DOWN_DIRECTION; ;
break;}
case 14:
-#line 310 "pic.y"
-{ current_direction = RIGHT_DIRECTION; ;
+#line 324 "pic.y"
+{ current_direction = LEFT_DIRECTION; ;
break;}
case 15:
-#line 312 "pic.y"
-{
- olist.append(make_command_object(yyvsp[0].lstr.str,
- yyvsp[0].lstr.filename,
- yyvsp[0].lstr.lineno));
- ;
+#line 326 "pic.y"
+{ current_direction = RIGHT_DIRECTION; ;
break;}
case 16:
-#line 318 "pic.y"
+#line 328 "pic.y"
{
- fprintf(stderr, "%g\n", yyvsp[0].x);
- fflush(stderr);
+ olist.append(make_command_object(yyvsp[0].lstr.str, yyvsp[0].lstr.filename,
+ yyvsp[0].lstr.lineno));
;
break;}
case 17:
-#line 323 "pic.y"
+#line 333 "pic.y"
{
- fprintf(stderr, "%s\n", yyvsp[0].lstr.str);
- delete yyvsp[0].lstr.str;
- fflush(stderr);
+ olist.append(make_command_object(yyvsp[0].lstr.str, yyvsp[0].lstr.filename,
+ yyvsp[0].lstr.lineno));
;
break;}
case 18:
-#line 329 "pic.y"
+#line 338 "pic.y"
{
- fprintf(stderr, "%g, %g\n", yyvsp[0].pair.x, yyvsp[0].pair.y);
- fflush(stderr);
+ fprintf(stderr, "%s\n", yyvsp[0].lstr.str);
+ fflush(stderr);
;
break;}
case 19:
-#line 334 "pic.y"
+#line 343 "pic.y"
{ delim_flag = 1; ;
break;}
case 20:
-#line 336 "pic.y"
+#line 345 "pic.y"
{
delim_flag = 0;
system(yyvsp[0].str);
- delete yyvsp[0].str;
+ a_delete yyvsp[0].str;
;
break;}
case 21:
-#line 342 "pic.y"
+#line 351 "pic.y"
{
if (yychar < 0)
do_lookahead();
@@ -1497,48 +1520,48 @@ case 21:
;
break;}
case 22:
-#line 349 "pic.y"
+#line 358 "pic.y"
{ delim_flag = 2; ;
break;}
case 23:
-#line 351 "pic.y"
+#line 360 "pic.y"
{ delim_flag = 0; ;
break;}
case 24:
-#line 353 "pic.y"
+#line 362 "pic.y"
{
if (yychar < 0)
do_lookahead();
copy_file_thru(yyvsp[-5].lstr.str, yyvsp[-2].str, yyvsp[0].str);
// do not delete the filename
- delete yyvsp[-2].str;
- delete yyvsp[0].str;
+ a_delete yyvsp[-2].str;
+ a_delete yyvsp[0].str;
;
break;}
case 25:
-#line 362 "pic.y"
+#line 371 "pic.y"
{ delim_flag = 2; ;
break;}
case 26:
-#line 364 "pic.y"
+#line 373 "pic.y"
{ delim_flag = 0; ;
break;}
case 27:
-#line 366 "pic.y"
+#line 375 "pic.y"
{
if (yychar < 0)
do_lookahead();
copy_rest_thru(yyvsp[-2].str, yyvsp[0].str);
- delete yyvsp[-2].str;
- delete yyvsp[0].str;
+ a_delete yyvsp[-2].str;
+ a_delete yyvsp[0].str;
;
break;}
case 28:
-#line 374 "pic.y"
+#line 383 "pic.y"
{ delim_flag = 1; ;
break;}
case 29:
-#line 376 "pic.y"
+#line 385 "pic.y"
{
delim_flag = 0;
if (yychar < 0)
@@ -1547,21 +1570,21 @@ case 29:
;
break;}
case 30:
-#line 383 "pic.y"
+#line 392 "pic.y"
{
if (yychar < 0)
do_lookahead();
if (yyvsp[0].if_data.x != 0.0)
push_body(yyvsp[0].if_data.body);
- delete yyvsp[0].if_data.body;
+ a_delete yyvsp[0].if_data.body;
;
break;}
case 31:
-#line 391 "pic.y"
+#line 400 "pic.y"
{ delim_flag = 1; ;
break;}
case 32:
-#line 393 "pic.y"
+#line 402 "pic.y"
{
delim_flag = 0;
if (yychar < 0)
@@ -1570,76 +1593,152 @@ case 32:
push_body(yyvsp[-3].if_data.body);
else
push_body(yyvsp[0].str);
- delete yyvsp[-3].if_data.body;
- delete yyvsp[0].str;
+ a_delete yyvsp[-3].if_data.body;
+ a_delete yyvsp[0].str;
;
break;}
case 34:
-#line 406 "pic.y"
+#line 415 "pic.y"
{ define_variable("scale", 1.0); ;
break;}
case 35:
-#line 411 "pic.y"
-{ reset(yyvsp[0].str); delete yyvsp[0].str; ;
+#line 420 "pic.y"
+{ reset(yyvsp[0].str); a_delete yyvsp[0].str; ;
break;}
case 36:
-#line 413 "pic.y"
-{ reset(yyvsp[0].str); delete yyvsp[0].str; ;
+#line 422 "pic.y"
+{ reset(yyvsp[0].str); a_delete yyvsp[0].str; ;
break;}
case 37:
-#line 415 "pic.y"
-{ reset(yyvsp[0].str); delete yyvsp[0].str; ;
+#line 424 "pic.y"
+{ reset(yyvsp[0].str); a_delete yyvsp[0].str; ;
break;}
case 38:
-#line 420 "pic.y"
-{ delim_flag = 1; ;
+#line 429 "pic.y"
+{ yyval.lstr = yyvsp[0].lstr; ;
break;}
case 39:
-#line 422 "pic.y"
-{ delim_flag = 0; yyval.if_data.x = yyvsp[-3].x; yyval.if_data.body = yyvsp[0].str; ;
+#line 431 "pic.y"
+{
+ yyval.lstr.str = new char[strlen(yyvsp[-1].lstr.str) + strlen(yyvsp[0].lstr.str) + 1];
+ strcpy(yyval.lstr.str, yyvsp[-1].lstr.str);
+ strcat(yyval.lstr.str, yyvsp[0].lstr.str);
+ a_delete yyvsp[-1].lstr.str;
+ a_delete yyvsp[0].lstr.str;
+ if (yyvsp[-1].lstr.filename) {
+ yyval.lstr.filename = yyvsp[-1].lstr.filename;
+ yyval.lstr.lineno = yyvsp[-1].lstr.lineno;
+ }
+ else if (yyvsp[0].lstr.filename) {
+ yyval.lstr.filename = yyvsp[0].lstr.filename;
+ yyval.lstr.lineno = yyvsp[0].lstr.lineno;
+ }
+ ;
break;}
case 40:
-#line 427 "pic.y"
-{ yyval.str = 0; ;
+#line 450 "pic.y"
+{
+ yyval.lstr.str = new char[GDIGITS + 1];
+ sprintf(yyval.lstr.str, "%g", yyvsp[0].x);
+ yyval.lstr.filename = 0;
+ yyval.lstr.lineno = 0;
+ ;
break;}
case 41:
-#line 429 "pic.y"
-{ yyval.str = yyvsp[0].lstr.str; ;
+#line 457 "pic.y"
+{ yyval.lstr = yyvsp[0].lstr; ;
break;}
case 42:
-#line 434 "pic.y"
-{ yyval.x = yyvsp[0].x; ;
+#line 459 "pic.y"
+{
+ yyval.lstr.str = new char[GDIGITS + 2 + GDIGITS + 1];
+ sprintf(yyval.lstr.str, "%g, %g", yyvsp[0].pair.x, yyvsp[0].pair.y);
+ yyval.lstr.filename = 0;
+ yyval.lstr.lineno = 0;
+ ;
break;}
case 43:
-#line 436 "pic.y"
+#line 468 "pic.y"
+{ delim_flag = 1; ;
+ break;}
+case 44:
+#line 470 "pic.y"
+{ delim_flag = 0; yyval.if_data.x = yyvsp[-3].x; yyval.if_data.body = yyvsp[0].str; ;
+ break;}
+case 45:
+#line 475 "pic.y"
+{ yyval.str = 0; ;
+ break;}
+case 46:
+#line 477 "pic.y"
+{ yyval.str = yyvsp[0].lstr.str; ;
+ break;}
+case 47:
+#line 482 "pic.y"
+{ yyval.x = yyvsp[0].x; ;
+ break;}
+case 48:
+#line 484 "pic.y"
+{ yyval.x = yyvsp[0].x; ;
+ break;}
+case 49:
+#line 489 "pic.y"
{
yyval.x = strcmp(yyvsp[-2].lstr.str, yyvsp[0].lstr.str) == 0;
- delete yyvsp[-2].lstr.str;
- delete yyvsp[0].lstr.str;
+ a_delete yyvsp[-2].lstr.str;
+ a_delete yyvsp[0].lstr.str;
;
break;}
-case 44:
-#line 442 "pic.y"
+case 50:
+#line 495 "pic.y"
{
yyval.x = strcmp(yyvsp[-2].lstr.str, yyvsp[0].lstr.str) != 0;
- delete yyvsp[-2].lstr.str;
- delete yyvsp[0].lstr.str;
+ a_delete yyvsp[-2].lstr.str;
+ a_delete yyvsp[0].lstr.str;
;
break;}
-case 45:
-#line 450 "pic.y"
+case 51:
+#line 501 "pic.y"
+{ yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); ;
+ break;}
+case 52:
+#line 503 "pic.y"
+{ yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); ;
+ break;}
+case 53:
+#line 505 "pic.y"
+{ yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); ;
+ break;}
+case 54:
+#line 507 "pic.y"
+{ yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); ;
+ break;}
+case 55:
+#line 509 "pic.y"
+{ yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); ;
+ break;}
+case 56:
+#line 511 "pic.y"
+{ yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); ;
+ break;}
+case 57:
+#line 513 "pic.y"
+{ yyval.x = (yyvsp[0].x == 0.0); ;
+ break;}
+case 58:
+#line 519 "pic.y"
{ yyval.by.val = 1.0; yyval.by.is_multiplicative = 0; ;
break;}
-case 46:
-#line 452 "pic.y"
+case 59:
+#line 521 "pic.y"
{ yyval.by.val = yyvsp[0].x; yyval.by.is_multiplicative = 0; ;
break;}
-case 47:
-#line 454 "pic.y"
+case 60:
+#line 523 "pic.y"
{ yyval.by.val = yyvsp[0].x; yyval.by.is_multiplicative = 1; ;
break;}
-case 48:
-#line 459 "pic.y"
+case 61:
+#line 528 "pic.y"
{
yyval.pl.obj = yyvsp[0].spec->make_object(&current_position,
&current_direction);
@@ -1654,93 +1753,93 @@ case 48:
}
;
break;}
-case 49:
-#line 473 "pic.y"
-{ yyval.pl = yyvsp[0].pl; define_label(yyvsp[-3].str, & yyval.pl); delete yyvsp[-3].str; ;
+case 62:
+#line 542 "pic.y"
+{ yyval.pl = yyvsp[0].pl; define_label(yyvsp[-3].str, & yyval.pl); a_delete yyvsp[-3].str; ;
break;}
-case 50:
-#line 475 "pic.y"
+case 63:
+#line 544 "pic.y"
{
yyval.pl.obj = 0;
yyval.pl.x = yyvsp[0].pair.x;
yyval.pl.y = yyvsp[0].pair.y;
define_label(yyvsp[-3].str, & yyval.pl);
- delete yyvsp[-3].str;
+ a_delete yyvsp[-3].str;
;
break;}
-case 51:
-#line 483 "pic.y"
+case 64:
+#line 552 "pic.y"
{
yyval.pl = yyvsp[0].pl;
define_label(yyvsp[-3].str, & yyval.pl);
- delete yyvsp[-3].str;
+ a_delete yyvsp[-3].str;
;
break;}
-case 52:
-#line 489 "pic.y"
+case 65:
+#line 558 "pic.y"
{
yyval.state.x = current_position.x;
yyval.state.y = current_position.y;
yyval.state.dir = current_direction;
;
break;}
-case 53:
-#line 495 "pic.y"
+case 66:
+#line 564 "pic.y"
{
current_position.x = yyvsp[-2].state.x;
current_position.y = yyvsp[-2].state.y;
current_direction = yyvsp[-2].state.dir;
;
break;}
-case 54:
-#line 501 "pic.y"
+case 67:
+#line 570 "pic.y"
{
yyval.pl = yyvsp[-3].pl;
;
break;}
-case 55:
-#line 505 "pic.y"
+case 68:
+#line 574 "pic.y"
{
yyval.pl.obj = 0;
yyval.pl.x = current_position.x;
yyval.pl.y = current_position.y;
;
break;}
-case 56:
-#line 514 "pic.y"
+case 69:
+#line 583 "pic.y"
{;
break;}
-case 57:
-#line 516 "pic.y"
+case 70:
+#line 585 "pic.y"
{;
break;}
-case 58:
-#line 521 "pic.y"
+case 71:
+#line 590 "pic.y"
{
yyval.spec = new object_spec(BOX_OBJECT);
;
break;}
-case 59:
-#line 525 "pic.y"
+case 72:
+#line 594 "pic.y"
{
yyval.spec = new object_spec(CIRCLE_OBJECT);
;
break;}
-case 60:
-#line 529 "pic.y"
+case 73:
+#line 598 "pic.y"
{
yyval.spec = new object_spec(ELLIPSE_OBJECT);
;
break;}
-case 61:
-#line 533 "pic.y"
+case 74:
+#line 602 "pic.y"
{
yyval.spec = new object_spec(ARC_OBJECT);
yyval.spec->dir = current_direction;
;
break;}
-case 62:
-#line 538 "pic.y"
+case 75:
+#line 607 "pic.y"
{
yyval.spec = new object_spec(LINE_OBJECT);
lookup_variable("lineht", & yyval.spec->segment_height);
@@ -1748,8 +1847,8 @@ case 62:
yyval.spec->dir = current_direction;
;
break;}
-case 63:
-#line 545 "pic.y"
+case 76:
+#line 614 "pic.y"
{
yyval.spec = new object_spec(ARROW_OBJECT);
lookup_variable("lineht", & yyval.spec->segment_height);
@@ -1757,8 +1856,8 @@ case 63:
yyval.spec->dir = current_direction;
;
break;}
-case 64:
-#line 552 "pic.y"
+case 77:
+#line 621 "pic.y"
{
yyval.spec = new object_spec(MOVE_OBJECT);
lookup_variable("moveht", & yyval.spec->segment_height);
@@ -1766,8 +1865,8 @@ case 64:
yyval.spec->dir = current_direction;
;
break;}
-case 65:
-#line 559 "pic.y"
+case 78:
+#line 628 "pic.y"
{
yyval.spec = new object_spec(SPLINE_OBJECT);
lookup_variable("lineht", & yyval.spec->segment_height);
@@ -1775,31 +1874,31 @@ case 65:
yyval.spec->dir = current_direction;
;
break;}
-case 66:
-#line 566 "pic.y"
+case 79:
+#line 635 "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 67:
-#line 571 "pic.y"
+case 80:
+#line 640 "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 68:
-#line 576 "pic.y"
+case 81:
+#line 645 "pic.y"
{
yyval.spec = new object_spec(TEXT_OBJECT);
yyval.spec->text = new text_item(format_number(yyvsp[0].lstr.str, yyvsp[-1].x),
yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno);
- delete yyvsp[0].lstr.str;
+ a_delete yyvsp[0].lstr.str;
;
break;}
-case 69:
-#line 583 "pic.y"
+case 82:
+#line 652 "pic.y"
{
saved_state *p = new saved_state;
yyval.pstate = p;
@@ -1815,8 +1914,8 @@ case 69:
olist.append(make_mark_object());
;
break;}
-case 70:
-#line 598 "pic.y"
+case 83:
+#line 667 "pic.y"
{
current_position.x = yyvsp[-2].pstate->x;
current_position.y = yyvsp[-2].pstate->y;
@@ -1829,40 +1928,40 @@ case 70:
delete yyvsp[-2].pstate;
;
break;}
-case 71:
-#line 610 "pic.y"
+case 84:
+#line 679 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->height = yyvsp[0].x;
yyval.spec->flags |= HAS_HEIGHT;
;
break;}
-case 72:
-#line 616 "pic.y"
+case 85:
+#line 685 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->radius = yyvsp[0].x;
yyval.spec->flags |= HAS_RADIUS;
;
break;}
-case 73:
-#line 622 "pic.y"
+case 86:
+#line 691 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->width = yyvsp[0].x;
yyval.spec->flags |= HAS_WIDTH;
;
break;}
-case 74:
-#line 628 "pic.y"
+case 87:
+#line 697 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->radius = yyvsp[0].x/2.0;
yyval.spec->flags |= HAS_RADIUS;
;
break;}
-case 75:
-#line 634 "pic.y"
+case 88:
+#line 703 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= HAS_SEGMENT;
@@ -1882,8 +1981,8 @@ case 75:
}
;
break;}
-case 76:
-#line 653 "pic.y"
+case 89:
+#line 722 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->dir = UP_DIRECTION;
@@ -1891,8 +1990,8 @@ case 76:
yyval.spec->segment_pos.y += yyval.spec->segment_height;
;
break;}
-case 77:
-#line 660 "pic.y"
+case 90:
+#line 729 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->dir = UP_DIRECTION;
@@ -1900,8 +1999,8 @@ case 77:
yyval.spec->segment_pos.y += yyvsp[0].x;
;
break;}
-case 78:
-#line 667 "pic.y"
+case 91:
+#line 736 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->dir = DOWN_DIRECTION;
@@ -1909,8 +2008,8 @@ case 78:
yyval.spec->segment_pos.y -= yyval.spec->segment_height;
;
break;}
-case 79:
-#line 674 "pic.y"
+case 92:
+#line 743 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->dir = DOWN_DIRECTION;
@@ -1918,8 +2017,8 @@ case 79:
yyval.spec->segment_pos.y -= yyvsp[0].x;
;
break;}
-case 80:
-#line 681 "pic.y"
+case 93:
+#line 750 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->dir = RIGHT_DIRECTION;
@@ -1927,8 +2026,8 @@ case 80:
yyval.spec->segment_pos.x += yyval.spec->segment_width;
;
break;}
-case 81:
-#line 688 "pic.y"
+case 94:
+#line 757 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->dir = RIGHT_DIRECTION;
@@ -1936,8 +2035,8 @@ case 81:
yyval.spec->segment_pos.x += yyvsp[0].x;
;
break;}
-case 82:
-#line 695 "pic.y"
+case 95:
+#line 764 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->dir = LEFT_DIRECTION;
@@ -1945,8 +2044,8 @@ case 82:
yyval.spec->segment_pos.x -= yyval.spec->segment_width;
;
break;}
-case 83:
-#line 702 "pic.y"
+case 96:
+#line 771 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->dir = LEFT_DIRECTION;
@@ -1954,8 +2053,8 @@ case 83:
yyval.spec->segment_pos.x -= yyvsp[0].x;
;
break;}
-case 84:
-#line 709 "pic.y"
+case 97:
+#line 778 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->flags |= HAS_FROM;
@@ -1963,8 +2062,8 @@ case 84:
yyval.spec->from.y = yyvsp[0].pair.y;
;
break;}
-case 85:
-#line 716 "pic.y"
+case 98:
+#line 785 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
if (yyval.spec->flags & HAS_SEGMENT)
@@ -1980,8 +2079,8 @@ case 85:
yyval.spec->to.y = yyvsp[0].pair.y;
;
break;}
-case 86:
-#line 731 "pic.y"
+case 99:
+#line 800 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->flags |= HAS_AT;
@@ -1994,16 +2093,16 @@ case 86:
}
;
break;}
-case 87:
-#line 743 "pic.y"
+case 100:
+#line 812 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->flags |= HAS_WITH;
yyval.spec->with = yyvsp[0].pth;
;
break;}
-case 88:
-#line 749 "pic.y"
+case 101:
+#line 818 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->flags |= HAS_SEGMENT;
@@ -2011,8 +2110,8 @@ case 88:
yyval.spec->segment_pos.y += yyvsp[0].pair.y;
;
break;}
-case 89:
-#line 756 "pic.y"
+case 102:
+#line 825 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
if (yyval.spec->flags & HAS_SEGMENT) {
@@ -2025,55 +2124,55 @@ case 89:
}
;
break;}
-case 90:
-#line 768 "pic.y"
+case 103:
+#line 837 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= IS_DOTTED;
lookup_variable("dashwid", & yyval.spec->dash_width);
;
break;}
-case 91:
-#line 774 "pic.y"
+case 104:
+#line 843 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->flags |= IS_DOTTED;
yyval.spec->dash_width = yyvsp[0].x;
;
break;}
-case 92:
-#line 780 "pic.y"
+case 105:
+#line 849 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= IS_DASHED;
lookup_variable("dashwid", & yyval.spec->dash_width);
;
break;}
-case 93:
-#line 786 "pic.y"
+case 106:
+#line 855 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->flags |= IS_DASHED;
yyval.spec->dash_width = yyvsp[0].x;
;
break;}
-case 94:
-#line 792 "pic.y"
+case 107:
+#line 861 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= IS_DEFAULT_FILLED;
;
break;}
-case 95:
-#line 797 "pic.y"
+case 108:
+#line 866 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->flags |= IS_FILLED;
yyval.spec->fill = yyvsp[0].x;
;
break;}
-case 96:
-#line 803 "pic.y"
+case 109:
+#line 872 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
// line chop chop means line chop 0 chop 0
@@ -2090,8 +2189,8 @@ case 96:
}
;
break;}
-case 97:
-#line 819 "pic.y"
+case 110:
+#line 888 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
if (yyval.spec->flags & IS_DEFAULT_CHOPPED) {
@@ -2109,57 +2208,57 @@ case 97:
}
;
break;}
-case 98:
-#line 836 "pic.y"
+case 111:
+#line 905 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= IS_SAME;
;
break;}
-case 99:
-#line 841 "pic.y"
+case 112:
+#line 910 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= IS_INVISIBLE;
;
break;}
-case 100:
-#line 846 "pic.y"
+case 113:
+#line 915 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= HAS_LEFT_ARROW_HEAD;
;
break;}
-case 101:
-#line 851 "pic.y"
+case 114:
+#line 920 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= HAS_RIGHT_ARROW_HEAD;
;
break;}
-case 102:
-#line 856 "pic.y"
+case 115:
+#line 925 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= (HAS_LEFT_ARROW_HEAD|HAS_RIGHT_ARROW_HEAD);
;
break;}
-case 103:
-#line 861 "pic.y"
+case 116:
+#line 930 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= IS_CLOCKWISE;
;
break;}
-case 104:
-#line 866 "pic.y"
+case 117:
+#line 935 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags &= ~IS_CLOCKWISE;
;
break;}
-case 105:
-#line 871 "pic.y"
+case 118:
+#line 940 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
for (text_item **p = & yyval.spec->text; *p; p = &(*p)->next)
@@ -2167,8 +2266,8 @@ case 105:
*p = new text_item(yyvsp[0].lstr.str, yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno);
;
break;}
-case 106:
-#line 878 "pic.y"
+case 119:
+#line 947 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
if (yyval.spec->text) {
@@ -2178,8 +2277,8 @@ case 106:
}
;
break;}
-case 107:
-#line 887 "pic.y"
+case 120:
+#line 956 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
if (yyval.spec->text) {
@@ -2189,8 +2288,8 @@ case 107:
}
;
break;}
-case 108:
-#line 896 "pic.y"
+case 121:
+#line 965 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
if (yyval.spec->text) {
@@ -2200,8 +2299,8 @@ case 108:
}
;
break;}
-case 109:
-#line 905 "pic.y"
+case 122:
+#line 974 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
if (yyval.spec->text) {
@@ -2211,47 +2310,47 @@ case 109:
}
;
break;}
-case 110:
-#line 914 "pic.y"
+case 123:
+#line 983 "pic.y"
{
yyval.spec = yyvsp[-2].spec;
yyval.spec->flags |= HAS_THICKNESS;
yyval.spec->thickness = yyvsp[0].x;
;
break;}
-case 111:
-#line 920 "pic.y"
+case 124:
+#line 989 "pic.y"
{
yyval.spec = yyvsp[-1].spec;
yyval.spec->flags |= IS_ALIGNED;
;
break;}
-case 112:
-#line 928 "pic.y"
+case 125:
+#line 997 "pic.y"
{
yyval.lstr = yyvsp[0].lstr;
;
break;}
-case 113:
-#line 932 "pic.y"
+case 126:
+#line 1001 "pic.y"
{
yyval.lstr.filename = yyvsp[-2].lstr.filename;
yyval.lstr.lineno = yyvsp[-2].lstr.lineno;
yyval.lstr.str = do_sprintf(yyvsp[-2].lstr.str, yyvsp[-1].dv.v, yyvsp[-1].dv.nv);
- delete yyvsp[-1].dv.v;
- delete yyvsp[-2].lstr.str;
+ a_delete yyvsp[-1].dv.v;
+ a_delete yyvsp[-2].lstr.str;
;
break;}
-case 114:
-#line 943 "pic.y"
+case 127:
+#line 1012 "pic.y"
{
yyval.dv.v = 0;
yyval.dv.nv = 0;
yyval.dv.maxv = 0;
;
break;}
-case 115:
-#line 949 "pic.y"
+case 128:
+#line 1018 "pic.y"
{
yyval.dv = yyvsp[-2].dv;
if (yyval.dv.nv >= yyval.dv.maxv) {
@@ -2264,110 +2363,110 @@ case 115:
yyval.dv.maxv *= 2;
yyval.dv.v = new double[yyval.dv.maxv];
memcpy(yyval.dv.v, oldv, yyval.dv.nv*sizeof(double));
- delete oldv;
+ a_delete oldv;
}
}
yyval.dv.v[yyval.dv.nv] = yyvsp[0].x;
yyval.dv.nv += 1;
;
break;}
-case 116:
-#line 971 "pic.y"
+case 129:
+#line 1040 "pic.y"
{ yyval.pair = yyvsp[0].pair; ;
break;}
-case 117:
-#line 973 "pic.y"
+case 130:
+#line 1042 "pic.y"
{
position pos = yyvsp[0].pl;
yyval.pair.x = pos.x;
yyval.pair.y = pos.y;
;
break;}
-case 118:
-#line 982 "pic.y"
+case 131:
+#line 1051 "pic.y"
{ yyval.pair = yyvsp[0].pair; ;
break;}
-case 119:
-#line 984 "pic.y"
+case 132:
+#line 1053 "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 120:
-#line 989 "pic.y"
+case 133:
+#line 1058 "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 121:
-#line 994 "pic.y"
+case 134:
+#line 1063 "pic.y"
{
yyval.pair.x = yyvsp[-3].pair.x;
yyval.pair.y = yyvsp[-1].pair.y;
;
break;}
-case 122:
-#line 999 "pic.y"
+case 135:
+#line 1068 "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 123:
-#line 1004 "pic.y"
+case 136:
+#line 1073 "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 126:
-#line 1017 "pic.y"
+case 139:
+#line 1086 "pic.y"
{ yyval.pair.x = yyvsp[-2].x; yyval.pair.y = yyvsp[0].x; ;
break;}
-case 127:
-#line 1019 "pic.y"
+case 140:
+#line 1088 "pic.y"
{ yyval.pair = yyvsp[-1].pair; ;
break;}
-case 128:
-#line 1024 "pic.y"
+case 141:
+#line 1093 "pic.y"
{ yyval.pl = yyvsp[0].pl; ;
break;}
-case 129:
-#line 1026 "pic.y"
+case 142:
+#line 1095 "pic.y"
{
path pth(yyvsp[0].crn);
if (!pth.follow(yyvsp[-1].pl, & yyval.pl))
YYABORT;
;
break;}
-case 130:
-#line 1032 "pic.y"
+case 143:
+#line 1101 "pic.y"
{
path pth(yyvsp[-1].crn);
if (!pth.follow(yyvsp[0].pl, & yyval.pl))
YYABORT;
;
break;}
-case 131:
-#line 1038 "pic.y"
+case 144:
+#line 1107 "pic.y"
{
path pth(yyvsp[-2].crn);
if (!pth.follow(yyvsp[0].pl, & yyval.pl))
YYABORT;
;
break;}
-case 132:
-#line 1044 "pic.y"
+case 145:
+#line 1113 "pic.y"
{
yyval.pl.x = current_position.x;
yyval.pl.y = current_position.y;
yyval.pl.obj = 0;
;
break;}
-case 133:
-#line 1053 "pic.y"
+case 146:
+#line 1122 "pic.y"
{
place *p = lookup_label(yyvsp[0].str);
if (!p) {
@@ -2375,33 +2474,33 @@ case 133:
YYABORT;
}
yyval.pl = *p;
- delete yyvsp[0].str;
+ a_delete yyvsp[0].str;
;
break;}
-case 134:
-#line 1063 "pic.y"
+case 147:
+#line 1132 "pic.y"
{
yyval.pl.obj = yyvsp[0].obj;
;
break;}
-case 135:
-#line 1067 "pic.y"
+case 148:
+#line 1136 "pic.y"
{
path pth(yyvsp[0].str);
if (!pth.follow(yyvsp[-2].pl, & yyval.pl))
YYABORT;
;
break;}
-case 136:
-#line 1076 "pic.y"
+case 149:
+#line 1145 "pic.y"
{ yyval.n = 1; ;
break;}
-case 137:
-#line 1078 "pic.y"
+case 150:
+#line 1147 "pic.y"
{ yyval.n = yyvsp[-1].n; ;
break;}
-case 138:
-#line 1083 "pic.y"
+case 151:
+#line 1152 "pic.y"
{
int count = 0;
for (object *p = olist.head; p != 0; p = p->next)
@@ -2416,8 +2515,8 @@ case 138:
}
;
break;}
-case 139:
-#line 1097 "pic.y"
+case 152:
+#line 1166 "pic.y"
{
int count = 0;
for (object *p = olist.tail; p != 0; p = p->prev)
@@ -2432,240 +2531,240 @@ case 139:
}
;
break;}
-case 140:
-#line 1114 "pic.y"
+case 153:
+#line 1183 "pic.y"
{ yyval.obtype = BOX_OBJECT; ;
break;}
-case 141:
-#line 1116 "pic.y"
+case 154:
+#line 1185 "pic.y"
{ yyval.obtype = CIRCLE_OBJECT; ;
break;}
-case 142:
-#line 1118 "pic.y"
+case 155:
+#line 1187 "pic.y"
{ yyval.obtype = ELLIPSE_OBJECT; ;
break;}
-case 143:
-#line 1120 "pic.y"
+case 156:
+#line 1189 "pic.y"
{ yyval.obtype = ARC_OBJECT; ;
break;}
-case 144:
-#line 1122 "pic.y"
+case 157:
+#line 1191 "pic.y"
{ yyval.obtype = LINE_OBJECT; ;
break;}
-case 145:
-#line 1124 "pic.y"
+case 158:
+#line 1193 "pic.y"
{ yyval.obtype = ARROW_OBJECT; ;
break;}
-case 146:
-#line 1126 "pic.y"
+case 159:
+#line 1195 "pic.y"
{ yyval.obtype = SPLINE_OBJECT; ;
break;}
-case 147:
-#line 1128 "pic.y"
+case 160:
+#line 1197 "pic.y"
{ yyval.obtype = BLOCK_OBJECT; ;
break;}
-case 148:
-#line 1130 "pic.y"
+case 161:
+#line 1199 "pic.y"
{ yyval.obtype = TEXT_OBJECT; ;
break;}
-case 149:
-#line 1135 "pic.y"
+case 162:
+#line 1204 "pic.y"
{
yyval.pth = new path(yyvsp[0].str);
;
break;}
-case 150:
-#line 1139 "pic.y"
+case 163:
+#line 1208 "pic.y"
{
yyval.pth = yyvsp[-2].pth;
yyval.pth->append(yyvsp[0].str);
;
break;}
-case 151:
-#line 1147 "pic.y"
+case 164:
+#line 1216 "pic.y"
{
yyval.pth = new path(yyvsp[0].crn);
;
break;}
-case 152:
-#line 1154 "pic.y"
+case 165:
+#line 1223 "pic.y"
{
yyval.pth = yyvsp[0].pth;
;
break;}
-case 153:
-#line 1158 "pic.y"
+case 166:
+#line 1227 "pic.y"
{
yyval.pth = yyvsp[-1].pth;
yyval.pth->append(yyvsp[0].crn);
;
break;}
-case 154:
-#line 1166 "pic.y"
+case 167:
+#line 1235 "pic.y"
{
yyval.pth = yyvsp[0].pth;
;
break;}
-case 155:
-#line 1171 "pic.y"
+case 168:
+#line 1240 "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 156:
-#line 1177 "pic.y"
+case 169:
+#line 1246 "pic.y"
{
lex_warning("`last %1' in `with' argument ignored",
object_type_name(yyvsp[-1].obtype));
yyval.pth = yyvsp[0].pth;
;
break;}
-case 157:
-#line 1183 "pic.y"
+case 170:
+#line 1252 "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 158:
-#line 1189 "pic.y"
+case 171:
+#line 1258 "pic.y"
{
lex_warning("initial `%1' in `with' argument ignored", yyvsp[-1].str);
- delete yyvsp[-1].str;
+ a_delete yyvsp[-1].str;
yyval.pth = yyvsp[0].pth;
;
break;}
-case 159:
-#line 1198 "pic.y"
+case 172:
+#line 1267 "pic.y"
{ yyval.crn = &object::north; ;
break;}
-case 160:
-#line 1200 "pic.y"
+case 173:
+#line 1269 "pic.y"
{ yyval.crn = &object::east; ;
break;}
-case 161:
-#line 1202 "pic.y"
+case 174:
+#line 1271 "pic.y"
{ yyval.crn = &object::west; ;
break;}
-case 162:
-#line 1204 "pic.y"
+case 175:
+#line 1273 "pic.y"
{ yyval.crn = &object::south; ;
break;}
-case 163:
-#line 1206 "pic.y"
+case 176:
+#line 1275 "pic.y"
{ yyval.crn = &object::north_east; ;
break;}
-case 164:
-#line 1208 "pic.y"
+case 177:
+#line 1277 "pic.y"
{ yyval.crn = &object:: south_east; ;
break;}
-case 165:
-#line 1210 "pic.y"
+case 178:
+#line 1279 "pic.y"
{ yyval.crn = &object::north_west; ;
break;}
-case 166:
-#line 1212 "pic.y"
+case 179:
+#line 1281 "pic.y"
{ yyval.crn = &object::south_west; ;
break;}
-case 167:
-#line 1214 "pic.y"
+case 180:
+#line 1283 "pic.y"
{ yyval.crn = &object::center; ;
break;}
-case 168:
-#line 1216 "pic.y"
+case 181:
+#line 1285 "pic.y"
{ yyval.crn = &object::start; ;
break;}
-case 169:
-#line 1218 "pic.y"
+case 182:
+#line 1287 "pic.y"
{ yyval.crn = &object::end; ;
break;}
-case 170:
-#line 1220 "pic.y"
+case 183:
+#line 1289 "pic.y"
{ yyval.crn = &object::north; ;
break;}
-case 171:
-#line 1222 "pic.y"
+case 184:
+#line 1291 "pic.y"
{ yyval.crn = &object::south; ;
break;}
-case 172:
-#line 1224 "pic.y"
+case 185:
+#line 1293 "pic.y"
{ yyval.crn = &object::west; ;
break;}
-case 173:
-#line 1226 "pic.y"
+case 186:
+#line 1295 "pic.y"
{ yyval.crn = &object::east; ;
break;}
-case 174:
-#line 1228 "pic.y"
+case 187:
+#line 1297 "pic.y"
{ yyval.crn = &object::north_west; ;
break;}
-case 175:
-#line 1230 "pic.y"
+case 188:
+#line 1299 "pic.y"
{ yyval.crn = &object::south_west; ;
break;}
-case 176:
-#line 1232 "pic.y"
+case 189:
+#line 1301 "pic.y"
{ yyval.crn = &object::north_east; ;
break;}
-case 177:
-#line 1234 "pic.y"
+case 190:
+#line 1303 "pic.y"
{ yyval.crn = &object::south_east; ;
break;}
-case 178:
-#line 1236 "pic.y"
+case 191:
+#line 1305 "pic.y"
{ yyval.crn = &object::west; ;
break;}
-case 179:
-#line 1238 "pic.y"
+case 192:
+#line 1307 "pic.y"
{ yyval.crn = &object::east; ;
break;}
-case 180:
-#line 1240 "pic.y"
+case 193:
+#line 1309 "pic.y"
{ yyval.crn = &object::north_west; ;
break;}
-case 181:
-#line 1242 "pic.y"
+case 194:
+#line 1311 "pic.y"
{ yyval.crn = &object::south_west; ;
break;}
-case 182:
-#line 1244 "pic.y"
+case 195:
+#line 1313 "pic.y"
{ yyval.crn = &object::north_east; ;
break;}
-case 183:
-#line 1246 "pic.y"
+case 196:
+#line 1315 "pic.y"
{ yyval.crn = &object::south_east; ;
break;}
-case 184:
-#line 1248 "pic.y"
+case 197:
+#line 1317 "pic.y"
{ yyval.crn = &object::center; ;
break;}
-case 185:
-#line 1250 "pic.y"
+case 198:
+#line 1319 "pic.y"
{ yyval.crn = &object::start; ;
break;}
-case 186:
-#line 1252 "pic.y"
+case 199:
+#line 1321 "pic.y"
{ yyval.crn = &object::end; ;
break;}
-case 187:
-#line 1257 "pic.y"
+case 200:
+#line 1326 "pic.y"
{
if (!lookup_variable(yyvsp[0].str, & yyval.x)) {
lex_error("there is no variable `%1'", yyvsp[0].str);
YYABORT;
}
- delete yyvsp[0].str;
+ a_delete yyvsp[0].str;
;
break;}
-case 188:
-#line 1265 "pic.y"
+case 201:
+#line 1334 "pic.y"
{ yyval.x = yyvsp[0].x; ;
break;}
-case 189:
-#line 1267 "pic.y"
+case 202:
+#line 1336 "pic.y"
{
if (yyvsp[-1].pl.obj != 0)
yyval.x = yyvsp[-1].pl.obj->origin().x;
@@ -2673,8 +2772,8 @@ case 189:
yyval.x = yyvsp[-1].pl.x;
;
break;}
-case 190:
-#line 1274 "pic.y"
+case 203:
+#line 1343 "pic.y"
{
if (yyvsp[-1].pl.obj != 0)
yyval.x = yyvsp[-1].pl.obj->origin().y;
@@ -2682,8 +2781,8 @@ case 190:
yyval.x = yyvsp[-1].pl.y;
;
break;}
-case 191:
-#line 1281 "pic.y"
+case 204:
+#line 1350 "pic.y"
{
if (yyvsp[-1].pl.obj != 0)
yyval.x = yyvsp[-1].pl.obj->height();
@@ -2691,8 +2790,8 @@ case 191:
yyval.x = 0.0;
;
break;}
-case 192:
-#line 1288 "pic.y"
+case 205:
+#line 1357 "pic.y"
{
if (yyvsp[-1].pl.obj != 0)
yyval.x = yyvsp[-1].pl.obj->width();
@@ -2700,8 +2799,8 @@ case 192:
yyval.x = 0.0;
;
break;}
-case 193:
-#line 1295 "pic.y"
+case 206:
+#line 1364 "pic.y"
{
if (yyvsp[-1].pl.obj != 0)
yyval.x = yyvsp[-1].pl.obj->radius();
@@ -2709,20 +2808,20 @@ case 193:
yyval.x = 0.0;
;
break;}
-case 194:
-#line 1302 "pic.y"
+case 207:
+#line 1371 "pic.y"
{ yyval.x = yyvsp[-2].x + yyvsp[0].x; ;
break;}
-case 195:
-#line 1304 "pic.y"
+case 208:
+#line 1373 "pic.y"
{ yyval.x = yyvsp[-2].x - yyvsp[0].x; ;
break;}
-case 196:
-#line 1306 "pic.y"
+case 209:
+#line 1375 "pic.y"
{ yyval.x = yyvsp[-2].x * yyvsp[0].x; ;
break;}
-case 197:
-#line 1308 "pic.y"
+case 210:
+#line 1377 "pic.y"
{
if (yyvsp[0].x == 0.0) {
lex_error("division by zero");
@@ -2731,8 +2830,8 @@ case 197:
yyval.x = yyvsp[-2].x/yyvsp[0].x;
;
break;}
-case 198:
-#line 1316 "pic.y"
+case 211:
+#line 1385 "pic.y"
{
if (yyvsp[0].x == 0.0) {
lex_error("modulus by zero");
@@ -2741,8 +2840,8 @@ case 198:
yyval.x = fmod(yyvsp[-2].x, yyvsp[0].x);
;
break;}
-case 199:
-#line 1324 "pic.y"
+case 212:
+#line 1393 "pic.y"
{
errno = 0;
yyval.x = pow(yyvsp[-2].x, yyvsp[0].x);
@@ -2756,16 +2855,16 @@ case 199:
}
;
break;}
-case 200:
-#line 1337 "pic.y"
+case 213:
+#line 1406 "pic.y"
{ yyval.x = -yyvsp[0].x; ;
break;}
-case 201:
-#line 1339 "pic.y"
+case 214:
+#line 1408 "pic.y"
{ yyval.x = yyvsp[-1].x; ;
break;}
-case 202:
-#line 1341 "pic.y"
+case 215:
+#line 1410 "pic.y"
{
errno = 0;
yyval.x = sin(yyvsp[-1].x);
@@ -2775,8 +2874,8 @@ case 202:
}
;
break;}
-case 203:
-#line 1350 "pic.y"
+case 216:
+#line 1419 "pic.y"
{
errno = 0;
yyval.x = cos(yyvsp[-1].x);
@@ -2786,8 +2885,8 @@ case 203:
}
;
break;}
-case 204:
-#line 1359 "pic.y"
+case 217:
+#line 1428 "pic.y"
{
errno = 0;
yyval.x = atan2(yyvsp[-3].x, yyvsp[-1].x);
@@ -2801,8 +2900,8 @@ case 204:
}
;
break;}
-case 205:
-#line 1372 "pic.y"
+case 218:
+#line 1441 "pic.y"
{
errno = 0;
yyval.x = log10(yyvsp[-1].x);
@@ -2812,8 +2911,8 @@ case 205:
}
;
break;}
-case 206:
-#line 1381 "pic.y"
+case 219:
+#line 1450 "pic.y"
{
errno = 0;
yyval.x = pow(10.0, yyvsp[-1].x);
@@ -2823,8 +2922,8 @@ case 206:
}
;
break;}
-case 207:
-#line 1390 "pic.y"
+case 220:
+#line 1459 "pic.y"
{
errno = 0;
yyval.x = sqrt(yyvsp[-1].x);
@@ -2834,64 +2933,64 @@ case 207:
}
;
break;}
-case 208:
-#line 1399 "pic.y"
+case 221:
+#line 1468 "pic.y"
{ yyval.x = yyvsp[-3].x > yyvsp[-1].x ? yyvsp[-3].x : yyvsp[-1].x; ;
break;}
-case 209:
-#line 1401 "pic.y"
-{ yyval.x = yyvsp[-3].x > yyvsp[-1].x ? yyvsp[-3].x : yyvsp[-1].x; ;
+case 222:
+#line 1470 "pic.y"
+{ yyval.x = yyvsp[-3].x < yyvsp[-1].x ? yyvsp[-3].x : yyvsp[-1].x; ;
break;}
-case 210:
-#line 1403 "pic.y"
+case 223:
+#line 1472 "pic.y"
{ yyval.x = floor(yyvsp[-1].x); ;
break;}
-case 211:
-#line 1405 "pic.y"
+case 224:
+#line 1474 "pic.y"
{ yyval.x = 1.0 + floor(((rand()&0x7fff)/double(0x7fff))*yyvsp[-1].x); ;
break;}
-case 212:
-#line 1407 "pic.y"
+case 225:
+#line 1476 "pic.y"
{
/* return a random number in the range [0,1) */
/* portable, but not very random */
yyval.x = (rand() & 0x7fff) / double(0x8000);
;
break;}
-case 213:
-#line 1413 "pic.y"
+case 226:
+#line 1482 "pic.y"
{ yyval.x = (yyvsp[-2].x < yyvsp[0].x); ;
break;}
-case 214:
-#line 1415 "pic.y"
+case 227:
+#line 1484 "pic.y"
{ yyval.x = (yyvsp[-2].x <= yyvsp[0].x); ;
break;}
-case 215:
-#line 1417 "pic.y"
+case 228:
+#line 1486 "pic.y"
{ yyval.x = (yyvsp[-2].x > yyvsp[0].x); ;
break;}
-case 216:
-#line 1419 "pic.y"
+case 229:
+#line 1488 "pic.y"
{ yyval.x = (yyvsp[-2].x >= yyvsp[0].x); ;
break;}
-case 217:
-#line 1421 "pic.y"
+case 230:
+#line 1490 "pic.y"
{ yyval.x = (yyvsp[-2].x == yyvsp[0].x); ;
break;}
-case 218:
-#line 1423 "pic.y"
+case 231:
+#line 1492 "pic.y"
{ yyval.x = (yyvsp[-2].x != yyvsp[0].x); ;
break;}
-case 219:
-#line 1425 "pic.y"
+case 232:
+#line 1494 "pic.y"
{ yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); ;
break;}
-case 220:
-#line 1427 "pic.y"
+case 233:
+#line 1496 "pic.y"
{ yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); ;
break;}
-case 221:
-#line 1429 "pic.y"
+case 234:
+#line 1498 "pic.y"
{ yyval.x = (yyvsp[0].x == 0.0); ;
break;}
}
@@ -3083,7 +3182,7 @@ yyerrhandle:
yystate = yyn;
goto yynewstate;
}
-#line 1433 "pic.y"
+#line 1502 "pic.y"
/* bison defines const to be empty unless __STDC__ is defined, which it
diff --git a/pic/pic.tab.h b/pic/pic.tab.h
index 33af90e0e..d9a20d525 100644
--- a/pic/pic.tab.h
+++ b/pic/pic.tab.h
@@ -20,7 +20,7 @@ typedef union {
#define VARIABLE 259
#define NUMBER 260
#define TEXT 261
-#define COMMAND 262
+#define COMMAND_LINE 262
#define DELIMITED 263
#define ORDINAL 264
#define LEFT_ARROW_HEAD 265
@@ -122,8 +122,9 @@ typedef union {
#define FILL 361
#define ALIGNED 362
#define SPRINTF 363
-#define DEFINE 364
-#define UNDEF 365
+#define COMMAND 364
+#define DEFINE 365
+#define UNDEF 366
extern YYSTYPE yylval;
diff --git a/pic/pic.y b/pic/pic.y
index 67a2cb4ca..cb44f1b5b 100644
--- a/pic/pic.y
+++ b/pic/pic.y
@@ -35,6 +35,9 @@ extern "C" {
int rand();
}
+/* Maximum number of characters produced by printf("%g") */
+#define GDIGITS 14
+
#ifndef __BORLANDC__
#define YYDEBUG 1
#endif /* __BORLANDC__ */
@@ -91,7 +94,7 @@ char *do_sprintf(const char *form, const double *v, int nv);
%token <str> VARIABLE
%token <x> NUMBER
%token <lstr> TEXT
-%token <lstr> COMMAND
+%token <lstr> COMMAND_LINE
%token <str> DELIMITED
%token <n> ORDINAL
%token LEFT_ARROW_HEAD
@@ -197,6 +200,7 @@ char *do_sprintf(const char *form, const double *v, int nv);
%token FILL
%token ALIGNED
%token SPRINTF
+%token COMMAND
%token DEFINE
%token UNDEF
@@ -244,7 +248,7 @@ works */
%right '!'
%right '^'
-%type <x> expr conditional_expr
+%type <x> expr any_expr text_expr
%type <by> optional_by
%type <pair> expr_pair position_not_place
%type <if_data> simple_if
@@ -258,7 +262,7 @@ works */
%type <n> optional_ordinal_last
%type <str> until
%type <dv> sprintf_args
-%type <lstr> text
+%type <lstr> text print_args print_arg
%%
@@ -295,10 +299,22 @@ separator:
;
placeless_element:
- VARIABLE '=' conditional_expr
+ VARIABLE '=' any_expr
{
define_variable($1, $3);
- delete $1;
+ a_delete $1;
+ }
+ | VARIABLE ':' '=' any_expr
+ {
+ place *p = lookup_label($1);
+ if (!p) {
+ lex_error("variable `%1' not defined", $1);
+ YYABORT;
+ }
+ p->obj = 0;
+ p->x = $4;
+ p->y = 0.0;
+ a_delete $1;
}
| UP
{ current_direction = UP_DIRECTION; }
@@ -308,27 +324,20 @@ placeless_element:
{ current_direction = LEFT_DIRECTION; }
| RIGHT
{ current_direction = RIGHT_DIRECTION; }
- | COMMAND
+ | COMMAND_LINE
{
- olist.append(make_command_object($1.str,
- $1.filename,
- $1.lineno));
+ olist.append(make_command_object($1.str, $1.filename,
+ $1.lineno));
}
- | PRINT expr
+ | COMMAND print_args
{
- fprintf(stderr, "%g\n", $2);
- fflush(stderr);
+ olist.append(make_command_object($2.str, $2.filename,
+ $2.lineno));
}
- | PRINT text
+ | PRINT print_args
{
fprintf(stderr, "%s\n", $2.str);
- delete $2.str;
- fflush(stderr);
- }
- | PRINT position
- {
- fprintf(stderr, "%g, %g\n", $2.x, $2.y);
- fflush(stderr);
+ fflush(stderr);
}
| SH
{ delim_flag = 1; }
@@ -336,7 +345,7 @@ placeless_element:
{
delim_flag = 0;
system($3);
- delete $3;
+ a_delete $3;
}
| COPY TEXT
{
@@ -355,8 +364,8 @@ placeless_element:
do_lookahead();
copy_file_thru($2.str, $5, $7);
// do not delete the filename
- delete $5;
- delete $7;
+ a_delete $5;
+ a_delete $7;
}
| COPY THRU
{ delim_flag = 2; }
@@ -367,8 +376,8 @@ placeless_element:
if (yychar < 0)
do_lookahead();
copy_rest_thru($4, $6);
- delete $4;
- delete $6;
+ a_delete $4;
+ a_delete $6;
}
| FOR VARIABLE '=' expr TO expr optional_by DO
{ delim_flag = 1; }
@@ -385,7 +394,7 @@ placeless_element:
do_lookahead();
if ($1.x != 0.0)
push_body($1.body);
- delete $1.body;
+ a_delete $1.body;
}
| simple_if ELSE
{ delim_flag = 1; }
@@ -398,8 +407,8 @@ placeless_element:
push_body($1.body);
else
push_body($4);
- delete $1.body;
- delete $4;
+ a_delete $1.body;
+ a_delete $4;
}
| reset_variables
| RESET
@@ -408,15 +417,54 @@ placeless_element:
reset_variables:
RESET VARIABLE
- { reset($2); delete $2; }
+ { reset($2); a_delete $2; }
| reset_variables VARIABLE
- { reset($2); delete $2; }
+ { reset($2); a_delete $2; }
| reset_variables ',' VARIABLE
- { reset($3); delete $3; }
+ { reset($3); a_delete $3; }
;
+print_args:
+ print_arg
+ { $$ = $1; }
+ | print_args print_arg
+ {
+ $$.str = new char[strlen($1.str) + strlen($2.str) + 1];
+ strcpy($$.str, $1.str);
+ strcat($$.str, $2.str);
+ a_delete $1.str;
+ a_delete $2.str;
+ if ($1.filename) {
+ $$.filename = $1.filename;
+ $$.lineno = $1.lineno;
+ }
+ else if ($2.filename) {
+ $$.filename = $2.filename;
+ $$.lineno = $2.lineno;
+ }
+ }
+ ;
+
+print_arg:
+ expr %prec ','
+ {
+ $$.str = new char[GDIGITS + 1];
+ sprintf($$.str, "%g", $1);
+ $$.filename = 0;
+ $$.lineno = 0;
+ }
+ | text
+ { $$ = $1; }
+ | position %prec ','
+ {
+ $$.str = new char[GDIGITS + 2 + GDIGITS + 1];
+ sprintf($$.str, "%g, %g", $1.x, $1.y);
+ $$.filename = 0;
+ $$.lineno = 0;
+ }
+
simple_if:
- IF conditional_expr THEN
+ IF any_expr THEN
{ delim_flag = 1; }
DELIMITED
{ delim_flag = 0; $$.x = $2; $$.body = $5; }
@@ -429,21 +477,42 @@ until:
{ $$ = $2.str; }
;
-conditional_expr:
+any_expr:
expr
{ $$ = $1; }
- | text EQUALEQUAL text
+ | text_expr
+ { $$ = $1; }
+ ;
+
+text_expr:
+ text EQUALEQUAL text
{
$$ = strcmp($1.str, $3.str) == 0;
- delete $1.str;
- delete $3.str;
+ a_delete $1.str;
+ a_delete $3.str;
}
| text NOTEQUAL text
{
$$ = strcmp($1.str, $3.str) != 0;
- delete $1.str;
- delete $3.str;
+ a_delete $1.str;
+ a_delete $3.str;
}
+ | text_expr ANDAND text_expr
+ { $$ = ($1 != 0.0 && $3 != 0.0); }
+ | text_expr ANDAND expr
+ { $$ = ($1 != 0.0 && $3 != 0.0); }
+ | expr ANDAND text_expr
+ { $$ = ($1 != 0.0 && $3 != 0.0); }
+ | text_expr OROR text_expr
+ { $$ = ($1 != 0.0 || $3 != 0.0); }
+ | text_expr OROR expr
+ { $$ = ($1 != 0.0 || $3 != 0.0); }
+ | expr OROR text_expr
+ { $$ = ($1 != 0.0 || $3 != 0.0); }
+ | '!' text_expr
+ { $$ = ($2 == 0.0); }
+ ;
+
optional_by:
/* empty */
@@ -470,20 +539,20 @@ element:
}
}
| LABEL ':' optional_separator element
- { $$ = $4; define_label($1, & $$); delete $1; }
+ { $$ = $4; define_label($1, & $$); a_delete $1; }
| LABEL ':' optional_separator position_not_place
{
$$.obj = 0;
$$.x = $4.x;
$$.y = $4.y;
define_label($1, & $$);
- delete $1;
+ a_delete $1;
}
| LABEL ':' optional_separator place
{
$$ = $4;
define_label($1, & $$);
- delete $1;
+ a_delete $1;
}
| '{'
{
@@ -577,7 +646,7 @@ object_spec:
$$ = new object_spec(TEXT_OBJECT);
$$->text = new text_item(format_number($3.str, $2),
$3.filename, $3.lineno);
- delete $3.str;
+ a_delete $3.str;
}
| '['
{
@@ -933,8 +1002,8 @@ text:
$$.filename = $3.filename;
$$.lineno = $3.lineno;
$$.str = do_sprintf($3.str, $4.v, $4.nv);
- delete $4.v;
- delete $3.str;
+ a_delete $4.v;
+ a_delete $3.str;
}
;
@@ -958,7 +1027,7 @@ sprintf_args:
$$.maxv *= 2;
$$.v = new double[$$.maxv];
memcpy($$.v, oldv, $$.nv*sizeof(double));
- delete oldv;
+ a_delete oldv;
}
}
$$.v[$$.nv] = $3;
@@ -1057,7 +1126,7 @@ label:
YYABORT;
}
$$ = *p;
- delete $1;
+ a_delete $1;
}
| nth_primitive
{
@@ -1188,7 +1257,7 @@ path:
| LABEL relative_path
{
lex_warning("initial `%1' in `with' argument ignored", $1);
- delete $1;
+ a_delete $1;
$$ = $2;
}
;
@@ -1259,7 +1328,7 @@ expr:
lex_error("there is no variable `%1'", $1);
YYABORT;
}
- delete $1;
+ a_delete $1;
}
| NUMBER
{ $$ = $1; }
@@ -1335,9 +1404,9 @@ expr:
}
| '-' expr %prec '!'
{ $$ = -$2; }
- | '(' expr ')'
+ | '(' any_expr ')'
{ $$ = $2; }
- | SIN '(' expr ')'
+ | SIN '(' any_expr ')'
{
errno = 0;
$$ = sin($3);
@@ -1346,7 +1415,7 @@ expr:
YYABORT;
}
}
- | COS '(' expr ')'
+ | COS '(' any_expr ')'
{
errno = 0;
$$ = cos($3);
@@ -1355,7 +1424,7 @@ expr:
YYABORT;
}
}
- | ATAN2 '(' expr ',' expr ')'
+ | ATAN2 '(' any_expr ',' any_expr ')'
{
errno = 0;
$$ = atan2($3, $5);
@@ -1368,7 +1437,7 @@ expr:
YYABORT;
}
}
- | LOG '(' expr ')'
+ | LOG '(' any_expr ')'
{
errno = 0;
$$ = log10($3);
@@ -1377,7 +1446,7 @@ expr:
YYABORT;
}
}
- | EXP '(' expr ')'
+ | EXP '(' any_expr ')'
{
errno = 0;
$$ = pow(10.0, $3);
@@ -1386,7 +1455,7 @@ expr:
YYABORT;
}
}
- | SQRT '(' expr ')'
+ | SQRT '(' any_expr ')'
{
errno = 0;
$$ = sqrt($3);
@@ -1395,13 +1464,13 @@ expr:
YYABORT;
}
}
- | MAX '(' expr ',' expr ')'
- { $$ = $3 > $5 ? $3 : $5; }
- | MIN '(' expr ',' expr ')'
+ | MAX '(' any_expr ',' any_expr ')'
{ $$ = $3 > $5 ? $3 : $5; }
- | INT '(' expr ')'
+ | MIN '(' any_expr ',' any_expr ')'
+ { $$ = $3 < $5 ? $3 : $5; }
+ | INT '(' any_expr ')'
{ $$ = floor($3); }
- | RAND '(' expr ')'
+ | RAND '(' any_expr ')'
{ $$ = 1.0 + floor(((rand()&0x7fff)/double(0x7fff))*$3); }
| RAND '(' ')'
{
diff --git a/ps/Makefile b/ps/Makefile
index 4ae89bfb5..599389f7b 100644
--- a/ps/Makefile
+++ b/ps/Makefile
@@ -85,6 +85,8 @@ install.nobin:
-[ -d $(MACRODIR) ] || mkdir $(MACRODIR)
-rm -f $(MACRODIR)/tmac.ps
cp tmac.ps $(MACRODIR)
+ -rm -f $(MACRODIR)/tmac.pspic
+ cp tmac.pspic $(MACRODIR)
-rm -f $(MACRODIR)/tmac.psatk
cp tmac.psatk $(MACRODIR)
@echo Making install.nobin in devps
diff --git a/ps/devps/dingbatsrmap b/ps/devps/dingbatsrmap
new file mode 100644
index 000000000..ccc14cb2d
--- /dev/null
+++ b/ps/devps/dingbatsrmap
@@ -0,0 +1 @@
+a12 lh
diff --git a/ps/ps.c b/ps/ps.c
index 4a5f66392..969340904 100644
--- a/ps/ps.c
+++ b/ps/ps.c
@@ -369,8 +369,8 @@ ps_font::ps_font(const char *nm)
ps_font::~ps_font()
{
- delete encoding;
- delete reencoded_name;
+ a_delete encoding;
+ a_delete reencoded_name;
}
void ps_font::handle_unknown_font_command(int argc, const char **argv)
@@ -650,7 +650,7 @@ void ps_printer::define_encoding(const char *encoding, int encoding_index)
}
lineno++;
}
- delete path;
+ a_delete path;
out.put_literal_symbol(make_encoding_name(encoding_index));
out.put_delimiter('[');
for (i = 0; i < 256; i++) {
@@ -688,7 +688,7 @@ void ps_printer::encode_fonts()
reencode_font((ps_font *)f->p);
}
}
- delete done_encoding;
+ a_delete done_encoding;
}
void ps_printer::set_style(const style &sty)
diff --git a/ps/psrm.c b/ps/psrm.c
index 0b40a171e..2c869bbbf 100644
--- a/ps/psrm.c
+++ b/ps/psrm.c
@@ -80,7 +80,7 @@ resource::resource(resource_type t, string &n, string &v, unsigned r)
resource::~resource()
{
- delete filename;
+ a_delete filename;
}
void resource::print_type_and_name(FILE *outfp)
@@ -181,8 +181,8 @@ void resource_manager::document_setup(ps_output &out)
*tail[i] = resource_list;
resource_list = head[i];
}
- delete head;
- delete tail;
+ a_delete head;
+ a_delete tail;
// check it
for (r = resource_list; r; r = r->next)
if (r->next)
@@ -236,7 +236,7 @@ void resource_manager::output_prolog(ps_output &out)
putc('\n', outfp);
process_file(-1, fp, path, outfp);
fclose(fp);
- delete path;
+ a_delete path;
fputs("%%EndResource\n", outfp);
}
@@ -267,7 +267,7 @@ void resource_manager::supply_resource(resource *r, int rank, FILE *outfp,
fp = font::open_file(r->filename, &path);
if (!fp) {
error("can't find `%1'", r->filename);
- delete r->filename;
+ a_delete r->filename;
r->filename = 0;
}
}
@@ -276,7 +276,7 @@ void resource_manager::supply_resource(resource *r, int rank, FILE *outfp,
fp = fopen(r->filename, "r");
if (!fp) {
error("can't open `%1': %2", r->filename, strerror(errno));
- delete r->filename;
+ a_delete r->filename;
r->filename = 0;
}
else
@@ -299,7 +299,7 @@ void resource_manager::supply_resource(resource *r, int rank, FILE *outfp,
process_file(rank, fp, path, outfp);
fclose(fp);
if (r->type == RESOURCE_FONT)
- delete path;
+ a_delete path;
if (outfp) {
if (r->type == RESOURCE_FILE && is_document)
fputs("%%EndDocument\n", outfp);
@@ -1003,7 +1003,7 @@ void resource_manager::read_download_file()
fatal_with_file_and_line(path, lineno, "missing filename");
lookup_font(p)->filename = strsave(q);
}
- delete path;
+ a_delete path;
fclose(fp);
}
diff --git a/ps/tmac.ps b/ps/tmac.ps
index f58936f0e..545e2d1ab 100644
--- a/ps/tmac.ps
+++ b/ps/tmac.ps
@@ -21,6 +21,8 @@
.ftr ZI ZCMI
.ftr C CR
.char \(rn \h'-\w'\(sr'u'\(rn\h'\w'\(sr'u'
+.char \(mo \h'.08m'\(mo\h'-.08m'
+.char \(nm \h'.08m'\(nm\h'-.08m'
.char \[parenlefttp] \[parenlefttp]\h'.016m'
.char \[parenleftbt] \[parenleftbt]\h'.016m'
.char \[parenleftex] \[parenleftex]\h'.016m'
@@ -78,38 +80,4 @@
.\}
.if !c\['c] .ps-achar \['c] \[aa] c
.if !c\['C] .ps-achar \['C] \[aa] C
-.de ps-bb
-.nr ps-nargs \\n[.$]
-.if \\n[ps-nargs]=4 \{\
-. nr ps-llx 0\\$1
-. nr ps-lly 0\\$2
-. nr ps-urx 0\\$3
-. nr ps-ury 0\\$4
-.\}
-..
-.de PSPIC
-.sy echo .ps-bb `psbb \\$1` >/tmp/psbb\\n[$$]
-.so /tmp/psbb\\n[$$]
-.if \\n[ps-nargs]=4 \{\
-. nr ps-wid (\\n[ps-urx]-\\n[ps-llx])
-. nr ps-ht (\\n[ps-ury]-\\n[ps-lly])
-. if \\n[ps-wid]<0 .nr ps-wid 0-\\n[ps-wid]
-. if \\n[ps-ht]<0 .nr ps-ht 0-\\n[ps-ht]
-. ie \\n[.$]>=2 .nr ps-deswid (i;\\$2)
-. el .nr ps-deswid \\n[.l]-\\n[.i]<?\\n[ps-wid]p
-. ie \\n[.$]>=3 .nr ps-desht (i;\\$3)
-. el .nr ps-desht \\n[ps-deswid]*1000+(\\n[ps-wid]/2)/\\n[ps-wid]\
-*\\n[ps-ht]+500/1000
-. ne \\n[ps-desht]u+1v
-. nr ps-offset \\n[.l]-\\n[.i]-\\n[ps-deswid]/2
-. ie \\n[.$]>=3 \
-\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 \
-\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[$$]
-..
+.mso tmac.pspic
diff --git a/ps/tmac.pspic b/ps/tmac.pspic
new file mode 100644
index 000000000..9923907ff
--- /dev/null
+++ b/ps/tmac.pspic
@@ -0,0 +1,41 @@
+.\" Define the PSPIC macro.
+.\" When used other than with -Tps, it will draw a box around where
+.\" the picture would go.
+.de ps-bb
+.nr ps-nargs \\n[.$]
+.if \\n[ps-nargs]=4 \{\
+. nr ps-llx 0\\$1
+. nr ps-lly 0\\$2
+. nr ps-urx 0\\$3
+. nr ps-ury 0\\$4
+.\}
+..
+.de PSPIC
+.br
+.sy echo .ps-bb `psbb \\$1` >/tmp/psbb\\n[$$]
+.so /tmp/psbb\\n[$$]
+.if \\n[ps-nargs]=4 \{\
+. nr ps-wid (\\n[ps-urx]-\\n[ps-llx])
+. nr ps-ht (\\n[ps-ury]-\\n[ps-lly])
+. if \\n[ps-wid]<0 .nr ps-wid 0-\\n[ps-wid]
+. if \\n[ps-ht]<0 .nr ps-ht 0-\\n[ps-ht]
+. ie \\n[.$]>=2 .nr ps-deswid (i;\\$2)
+. el .nr ps-deswid \\n[.l]-\\n[.i]<?\\n[ps-wid]p
+. ie \\n[.$]>=3 .nr ps-desht (i;\\$3)
+. el .nr ps-desht \\n[ps-deswid]*1000+(\\n[ps-wid]/2)/\\n[ps-wid]\
+*\\n[ps-ht]+500/1000
+. ne \\n[ps-desht]u+1v
+. nr ps-offset \\n[.l]-\\n[.i]-\\n[ps-deswid]/2
+. ie \\n[.$]>=3 .ds ps-desht \\n[ps-desht]
+. el .ds ps-desht \" empty
+\h'\\n[ps-offset]u'\
+\X'ps: invis'\
+\Z'\D'p 0 \\n[ps-desht]u \\n[ps-deswid]u 0 0 -\\n[ps-desht]u''\
+\X'ps: endinvis'\
+\v'\\n[ps-desht]u'\X'ps: import \\$1 \
+\\n[ps-llx] \\n[ps-lly] \\n[ps-urx] \\n[ps-ury] \\n[ps-deswid] \\*[ps-desht]'
+. br
+. sp \\n[ps-desht]u
+.\}
+.sy rm /tmp/psbb\\n[$$]
+..
diff --git a/refer/command.c b/refer/command.c
index b51fc8b31..069e58e34 100644
--- a/refer/command.c
+++ b/refer/command.c
@@ -53,7 +53,7 @@ input_item::input_item(string &s, const char *fn, int ln)
input_item::~input_item()
{
- delete filename;
+ a_delete filename;
}
inline int input_item::peek_char()
@@ -786,7 +786,7 @@ static void command_loop()
for (int i = 0; i < argc; i++)
argv[i].s = ptr = strchr(ptr, '\0') + 1;
execute_command(command.contents(), argc, argv);
- delete argv;
+ a_delete argv;
if (res == -1)
break;
}
diff --git a/refer/index.c b/refer/index.c
index 41df7f7f5..cd4c564f8 100644
--- a/refer/index.c
+++ b/refer/index.c
@@ -138,12 +138,12 @@ index_search_item::~index_search_item()
out_of_date_files = out_of_date_files->next;
delete tem;
}
- delete filename_buffer;
- delete key_buffer;
+ a_delete filename_buffer;
+ a_delete key_buffer;
if (common_words_table) {
for (int i = 0; i < common_words_table_size; i++)
- delete common_words_table[i];
- delete common_words_table;
+ a_delete common_words_table[i];
+ a_delete common_words_table;
}
}
@@ -291,7 +291,7 @@ search_item *make_index_search_item(const char *filename, int fid)
if (fd < 0)
return 0;
index_search_item *item = new index_search_item(index_filename, fid);
- delete index_filename;
+ a_delete index_filename;
if (!item->load(fd)) {
close(fd);
delete item;
@@ -324,9 +324,9 @@ index_search_item_iterator::index_search_item_iterator(index_search_item *ind,
index_search_item_iterator::~index_search_item_iterator()
{
- delete temp_list;
- delete buf;
- delete query;
+ a_delete temp_list;
+ a_delete buf;
+ a_delete query;
delete out_of_date_files_iter;
}
@@ -414,7 +414,7 @@ int index_search_item_iterator::get_tag(int tagno,
}
if (!err) {
if (length + 2 > buflen) {
- delete buf;
+ a_delete buf;
buflen = length + 2;
buf = new char[buflen];
}
@@ -442,7 +442,7 @@ const char *index_search_item::munge_filename(const char *filename)
int need_slash = (cwd[0] != 0 && strchr(cwd, '\0')[-1] != '/');
int len = strlen(cwd) + strlen(filename) + need_slash + 1;
if (len > filename_buflen) {
- delete filename_buffer;
+ a_delete filename_buffer;
filename_buflen = len;
filename_buffer = new char[len];
}
@@ -509,7 +509,7 @@ const int *index_search_item::search(const char *ptr, int length,
{
const char *end = ptr + length;
if (*temp_listp) {
- delete *temp_listp;
+ a_delete *temp_listp;
*temp_listp = 0;
}
const int *first_list = 0;
@@ -539,12 +539,12 @@ const int *index_search_item::search(const char *ptr, int length,
const int *list = search1(&ptr, end);
if (list != 0) {
if (*list < 0) {
- delete matches;
+ a_delete matches;
return list;
}
merge(matches, matches, list);
if (*matches < 0) {
- delete matches;
+ a_delete matches;
return &minus_one;
}
}
diff --git a/refer/indxbib.c b/refer/indxbib.c
index 315194b7b..e28bb5c83 100644
--- a/refer/indxbib.c
+++ b/refer/indxbib.c
@@ -170,7 +170,7 @@ int main(int argc, char **argv)
if (!directory) {
char *path = get_cwd();
store_filename(path);
- delete path;
+ a_delete path;
}
else
store_filename(directory);
@@ -187,7 +187,7 @@ int main(int argc, char **argv)
char *dir = strsave(basename);
dir[p - basename] = '\0';
name_max = dir_name_max(dir);
- delete dir;
+ a_delete dir;
}
else
name_max = dir_name_max(".");
@@ -314,7 +314,7 @@ static char *get_cwd()
break;
if (errno != ERANGE)
fatal("cannot get current working directory: %1", strerror(errno));
- delete buf;
+ a_delete buf;
if (size == INT_MAX)
fatal("current working directory longer than INT_MAX");
if (size > INT_MAX/2)
diff --git a/refer/label.tab.c b/refer/label.tab.c
index 9ecaa4461..c41ededaf 100644
--- a/refer/label.tab.c
+++ b/refer/label.tab.c
@@ -1277,7 +1277,7 @@ void format_expr::evaluate(int tentative, const reference &ref,
sprintf(ptr, "%0*d", width, num + first_number);
result += ptr;
if (ptr != buf)
- delete ptr;
+ a_delete ptr;
}
}
@@ -1742,7 +1742,7 @@ label_info *lookup_label(const string &label)
;
*p = old_table[i];
}
- delete old_table;
+ a_delete old_table;
}
return result;
}
@@ -1817,14 +1817,16 @@ static void consider_authors(reference **start, reference **end, int i)
}
}
consider_authors(name_start, p, i + 1);
- if (last_name_start == name_start)
+ if (last_name_start == name_start) {
for (reference **q = last_name_start; q < p; q++)
(*q)->set_last_name_unambiguous(i);
+ }
// If we have an author list <A B C D> and <A B C E>, then the lists
// need author D and E respectively.
- if (name_start > start || p < end)
- for (q = last_name_start; q < p; q++)
+ if (name_start > start || p < end) {
+ for (reference **q = last_name_start; q < p; q++)
(*q)->need_author(i);
+ }
}
}
diff --git a/refer/label.y b/refer/label.y
index a93da4290..77ce23bce 100644
--- a/refer/label.y
+++ b/refer/label.y
@@ -516,7 +516,7 @@ void format_expr::evaluate(int tentative, const reference &ref,
sprintf(ptr, "%0*d", width, num + first_number);
result += ptr;
if (ptr != buf)
- delete ptr;
+ a_delete ptr;
}
}
@@ -981,7 +981,7 @@ label_info *lookup_label(const string &label)
;
*p = old_table[i];
}
- delete old_table;
+ a_delete old_table;
}
return result;
}
@@ -1056,14 +1056,16 @@ static void consider_authors(reference **start, reference **end, int i)
}
}
consider_authors(name_start, p, i + 1);
- if (last_name_start == name_start)
+ if (last_name_start == name_start) {
for (reference **q = last_name_start; q < p; q++)
(*q)->set_last_name_unambiguous(i);
+ }
// If we have an author list <A B C D> and <A B C E>, then the lists
// need author D and E respectively.
- if (name_start > start || p < end)
- for (q = last_name_start; q < p; q++)
+ if (name_start > start || p < end) {
+ for (reference **q = last_name_start; q < p; q++)
(*q)->need_author(i);
+ }
}
}
diff --git a/refer/linear.c b/refer/linear.c
index dded46625..afae2d018 100644
--- a/refer/linear.c
+++ b/refer/linear.c
@@ -144,7 +144,7 @@ const char *bmpattern::search(const char *buf, const char *end) const
bmpattern::~bmpattern()
{
- delete pat;
+ a_delete pat;
}
inline int bmpattern::length() const
@@ -285,7 +285,7 @@ file_buffer::file_buffer()
file_buffer::~file_buffer()
{
- delete buffer;
+ a_delete buffer;
}
const char *file_buffer::get_start() const
@@ -334,7 +334,7 @@ int file_buffer::load(int fd, const char *filename)
return 1;
}
}
- delete buffer;
+ a_delete buffer;
buffer = 0;
}
close(fd);
@@ -368,7 +368,7 @@ linear_searcher::linear_searcher(const char *query, int query_len,
}
assert(nkeys <= nk);
if (nkeys == 0) {
- delete keys;
+ a_delete keys;
keys = 0;
}
}
@@ -377,7 +377,7 @@ linear_searcher::~linear_searcher()
{
for (int i = 0; i < nkeys; i++)
delete keys[i];
- delete keys;
+ a_delete keys;
}
int linear_searcher::search(const char *buffer, const char *bufend,
diff --git a/refer/ref.c b/refer/ref.c
index 5d96bfde8..de4f6b31b 100644
--- a/refer/ref.c
+++ b/refer/ref.c
@@ -152,7 +152,7 @@ reference::reference(const char *start, int len, reference_id *ridp)
reference::~reference()
{
if (nfields > 0)
- delete [nfields] field;
+ ad_delete(nfields) field;
}
// ref is the inline, this is the database ref
@@ -174,7 +174,8 @@ void reference::merge(reference &ref)
if (temp_fields[i].length() > 0)
nfields++;
if (nfields != old_nfields) {
- delete [old_nfields] field;
+ if (old_nfields > 0)
+ ad_delete(old_nfields) field;
field = new string[nfields];
}
int j = 0;
@@ -206,7 +207,8 @@ void reference::insert_field(unsigned char c, string &s)
field[pos].move(s);
for (i = pos; i < nfields; i++)
field[i + 1].move(old_field[i]);
- delete [nfields] old_field;
+ if (nfields > 0)
+ ad_delete(nfields) old_field;
nfields++;
field_index[c] = pos;
for (i = c + 1; i < 256; i++)
@@ -224,7 +226,8 @@ void reference::delete_field(unsigned char c)
field[i].move(old_field[i]);
for (i = field_index[c]; i < nfields - 1; i++)
field[i].move(old_field[i + 1]);
- delete [nfields] old_field;
+ if (nfields > 0)
+ ad_delete(nfields) old_field;
nfields--;
field_index[c] = NULL_FIELD_INDEX;
for (i = c + 1; i < 256; i++)
diff --git a/refer/refer.c b/refer/refer.c
index 79a2e4749..279ea44c3 100644
--- a/refer/refer.c
+++ b/refer/refer.c
@@ -679,7 +679,7 @@ static void store_citation(reference *ref)
citation_max *= 2;
citation = new reference *[citation_max];
memcpy(citation, old_citation, ncitations*sizeof(reference *));
- delete old_citation;
+ a_delete old_citation;
}
}
citation[ncitations++] = ref;
@@ -736,7 +736,7 @@ static unsigned store_reference(const string &str)
;
*p = old_table[i];
}
- delete old_table;
+ a_delete old_table;
}
}
if (label_in_text)
@@ -915,7 +915,7 @@ void label_processing_state::process(int c)
extern "C" {
-static int rcompare(void *p1, void *p2)
+static int rcompare(const void *p1, const void *p2)
{
return compare_reference(**(reference **)p1, **(reference **)p2);
}
diff --git a/refer/search.c b/refer/search.c
index c0f2bd9cf..2cee4e08d 100644
--- a/refer/search.c
+++ b/refer/search.c
@@ -87,7 +87,7 @@ search_list_iterator::search_list_iterator(search_list *p, const char *q)
search_list_iterator::~search_list_iterator()
{
list->niterators -= 1;
- delete query;
+ a_delete query;
delete iter;
}
@@ -112,7 +112,7 @@ search_item::search_item(const char *nm, int fid)
search_item::~search_item()
{
- delete name;
+ a_delete name;
}
int search_item::is_named(const char *nm) const
diff --git a/refer/token.c b/refer/token.c
index 03e4697ae..8418291ff 100644
--- a/refer/token.c
+++ b/refer/token.c
@@ -79,13 +79,13 @@ int get_token(const char **ptr, const char *end)
}
token_info::token_info()
-: type(OTHER), sort_key(0), other_case(0)
+: type(TOKEN_OTHER), sort_key(0), other_case(0)
{
}
void token_info::set(token_type t, const char *sk, const char *oc)
{
- assert(oc == 0 || t == UPPER || t == LOWER);
+ assert(oc == 0 || t == TOKEN_UPPER || t == TOKEN_LOWER);
type = t;
sort_key = sk;
other_case = oc;
@@ -96,7 +96,7 @@ void token_info::sortify(const char *start, const char *end, string &result)
{
if (sort_key)
result += sort_key;
- else if (type == UPPER || type == LOWER) {
+ else if (type == TOKEN_UPPER || type == TOKEN_LOWER) {
for (; start < end; start++)
if (csalpha(*start))
result += cmlower(*start);
@@ -107,7 +107,7 @@ int token_info::sortify_non_empty(const char *start, const char *end) const
{
if (sort_key)
return *sort_key != '\0';
- if (type != UPPER && type != LOWER)
+ if (type != TOKEN_UPPER && type != TOKEN_LOWER)
return 0;
for (; start < end; start++)
if (csalpha(*start))
@@ -119,7 +119,7 @@ int token_info::sortify_non_empty(const char *start, const char *end) const
void token_info::lower_case(const char *start, const char *end,
string &result) const
{
- if (type != UPPER) {
+ if (type != TOKEN_UPPER) {
while (start < end)
result += *start++;
}
@@ -134,7 +134,7 @@ void token_info::lower_case(const char *start, const char *end,
void token_info::upper_case(const char *start, const char *end,
string &result) const
{
- if (type != LOWER) {
+ if (type != TOKEN_LOWER) {
while (start < end)
result += *start++;
}
@@ -194,31 +194,31 @@ static void init_ascii()
char buf[2];
buf[0] = *p;
buf[1] = '\0';
- store_token(strsave(buf), token_info::LOWER);
+ store_token(strsave(buf), TOKEN_LOWER);
buf[0] = cmupper(buf[0]);
- store_token(strsave(buf), token_info::UPPER);
+ store_token(strsave(buf), TOKEN_UPPER);
}
for (p = "0123456789"; *p; p++) {
char buf[2];
buf[0] = *p;
buf[1] = '\0';
const char *s = strsave(buf);
- store_token(s, token_info::OTHER, s);
+ store_token(s, TOKEN_OTHER, s);
}
for (p = ".,:;?!"; *p; p++) {
char buf[2];
buf[0] = *p;
buf[1] = '\0';
- store_token(strsave(buf), token_info::PUNCT);
+ store_token(strsave(buf), TOKEN_PUNCT);
}
- store_token("-", token_info::HYPHEN);
+ store_token("-", TOKEN_HYPHEN);
}
static void store_letter(const char *lower, const char *upper,
const char *sort_key = 0)
{
- store_token(lower, token_info::LOWER, sort_key, upper);
- store_token(upper, token_info::UPPER, sort_key, lower);
+ store_token(lower, TOKEN_LOWER, sort_key, upper);
+ store_token(upper, TOKEN_UPPER, sort_key, lower);
}
static void init_letter(unsigned char uc_code, unsigned char lc_code,
@@ -267,8 +267,8 @@ static void init_latin1()
init_letter(0xdd, 0xfd, "y");
init_letter(0xde, 0xfe, THORN_SORT_KEY);
- store_token("\337", token_info::LOWER, "ss", "SS");
- store_token("\377", token_info::LOWER, "y", "Y");
+ store_token("\337", TOKEN_LOWER, "ss", "SS");
+ store_token("\377", TOKEN_LOWER, "y", "Y");
}
static void init_two_char_letter(char l1, char l2, char u1, char u2,
@@ -297,23 +297,30 @@ static void init_two_char_letter(char l1, char l2, char u1, char u2,
static void init_special_chars()
{
for (const char *p = "':^`~"; *p; p++)
- for (const char *q = "aeiouy"; *q; q++)
- init_two_char_letter(*p, *q, *p, cmupper(*q));
- for (p = "/l/o~n,coeaeij"; *p; p += 2)
- init_two_char_letter(p[0], p[1], cmupper(p[0]), cmupper(p[1]));
+ for (const char *q = "aeiouy"; *q; q++) {
+ // Use a variable to work around bug in gcc 2.0
+ char c = cmupper(*q);
+ init_two_char_letter(*p, *q, *p, c);
+ }
+ for (p = "/l/o~n,coeaeij"; *p; p += 2) {
+ // Use variables to work around bug in gcc 2.0
+ char c0 = cmupper(p[0]);
+ char c1 = cmupper(p[1]);
+ init_two_char_letter(p[0], p[1], c0, c1);
+ }
init_two_char_letter('v', 's', 'v', 'S', "s");
init_two_char_letter('v', 'z', 'v', 'Z', "z");
init_two_char_letter('o', 'a', 'o', 'A', "a");
init_two_char_letter('T', 'p', 'T', 'P', THORN_SORT_KEY);
init_two_char_letter('-', 'd', '-', 'D');
- store_token("\\(ss", token_info::LOWER, 0, "SS");
- store_token("\\[ss]", token_info::LOWER, 0, "SS");
+ store_token("\\(ss", TOKEN_LOWER, 0, "SS");
+ store_token("\\[ss]", TOKEN_LOWER, 0, "SS");
- store_token("\\(Sd", token_info::LOWER, "d", "\\(-D");
- store_token("\\[Sd]", token_info::LOWER, "d", "\\[-D]");
- store_token("\\(hy", token_info::HYPHEN);
- store_token("\\[hy]", token_info::HYPHEN);
+ store_token("\\(Sd", TOKEN_LOWER, "d", "\\(-D");
+ store_token("\\[Sd]", TOKEN_LOWER, "d", "\\[-D]");
+ store_token("\\(hy", TOKEN_HYPHEN);
+ store_token("\\[hy]", TOKEN_HYPHEN);
}
static void init_strings()
@@ -324,12 +331,12 @@ static void init_strings()
for (const char *p = "'`^^,:~v_o./;"; *p; p++) {
buf[2] = *p;
buf[3] = '\0';
- store_token(strsave(buf), token_info::ACCENT);
+ store_token(strsave(buf), TOKEN_ACCENT);
buf[2] = '[';
buf[3] = *p;
buf[4] = ']';
buf[5] = '\0';
- store_token(strsave(buf), token_info::ACCENT);
+ store_token(strsave(buf), TOKEN_ACCENT);
}
// -ms special letters
@@ -342,9 +349,9 @@ static void init_strings()
store_letter("\\*(oe", "\\*(Oe", "oe");
store_letter("\\*[oe]", "\\*[Oe]", "oe");
- store_token("\\*3", token_info::LOWER, "y", "Y");
- store_token("\\*8", token_info::LOWER, "ss", "SS");
- store_token("\\*q", token_info::LOWER, "o", "O");
+ store_token("\\*3", TOKEN_LOWER, "y", "Y");
+ store_token("\\*8", TOKEN_LOWER, "ss", "SS");
+ store_token("\\*q", TOKEN_LOWER, "o", "O");
}
struct token_initer {
@@ -359,5 +366,5 @@ token_initer::token_initer()
init_latin1();
init_special_chars();
init_strings();
- default_token_info.set(token_info::OTHER);
+ default_token_info.set(TOKEN_OTHER);
}
diff --git a/refer/token.h b/refer/token.h
index 15311ab1a..d5ce51194 100644
--- a/refer/token.h
+++ b/refer/token.h
@@ -18,9 +18,16 @@ 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. */
+enum token_type {
+ TOKEN_OTHER,
+ TOKEN_UPPER,
+ TOKEN_LOWER,
+ TOKEN_ACCENT,
+ TOKEN_PUNCT,
+ TOKEN_HYPHEN
+};
+
class token_info {
-public:
- enum token_type { OTHER, UPPER, LOWER, ACCENT, PUNCT, HYPHEN };
private:
token_type type;
const char *sort_key;
@@ -42,32 +49,32 @@ public:
inline int token_info::is_upper() const
{
- return type == UPPER;
+ return type == TOKEN_UPPER;
}
inline int token_info::is_lower() const
{
- return type == LOWER;
+ return type == TOKEN_LOWER;
}
inline int token_info::is_accent() const
{
- return type == ACCENT;
+ return type == TOKEN_ACCENT;
}
inline int token_info::is_other() const
{
- return type == OTHER;
+ return type == TOKEN_OTHER;
}
inline int token_info::is_punct() const
{
- return type == PUNCT;
+ return type == TOKEN_PUNCT;
}
inline int token_info::is_hyphen() const
{
- return type == HYPHEN;
+ return type == TOKEN_HYPHEN;
}
int get_token(const char **ptr, const char *end);
diff --git a/tbl/main.c b/tbl/main.c
index 4c4c1d9f0..affafb0f1 100644
--- a/tbl/main.c
+++ b/tbl/main.c
@@ -486,7 +486,7 @@ entry_modifier::~entry_modifier()
{
}
-entry_format::entry_format() : type(LEFT)
+entry_format::entry_format() : type(FORMAT_LEFT)
{
}
@@ -497,31 +497,31 @@ entry_format::entry_format(format_type t) : type(t)
void entry_format::debug_print() const
{
switch (type) {
- case LEFT:
+ case FORMAT_LEFT:
putc('l', stderr);
break;
- case CENTER:
+ case FORMAT_CENTER:
putc('c', stderr);
break;
- case RIGHT:
+ case FORMAT_RIGHT:
putc('r', stderr);
break;
- case NUMERIC:
+ case FORMAT_NUMERIC:
putc('n', stderr);
break;
- case ALPHABETIC:
+ case FORMAT_ALPHABETIC:
putc('a', stderr);
break;
- case SPAN:
+ case FORMAT_SPAN:
putc('s', stderr);
break;
- case VSPAN:
+ case FORMAT_VSPAN:
putc('^', stderr);
break;
- case HLINE:
+ case FORMAT_HLINE:
putc('_', stderr);
break;
- case DOUBLE_HLINE:
+ case FORMAT_DOUBLE_HLINE:
putc('=', stderr);
break;
default:
@@ -607,7 +607,7 @@ void format::add_rows(int n)
vline = new char*[nrows + n];
for (i = 0; i < nrows; i++)
vline[i] = old_vline[i];
- delete old_vline;
+ a_delete old_vline;
for (i = 0; i < n; i++) {
vline[nrows + i] = new char[ncolumns + 1];
for (int j = 0; j < ncolumns + 1; j++)
@@ -617,7 +617,7 @@ void format::add_rows(int n)
entry = new entry_format *[nrows + n];
for (i = 0; i < nrows; i++)
entry[i] = old_entry[i];
- delete old_entry;
+ a_delete old_entry;
for (i = 0; i < n; i++)
entry[nrows + i] = new entry_format[ncolumns];
nrows += n;
@@ -625,15 +625,15 @@ void format::add_rows(int n)
format::~format()
{
- delete separation;
- delete [ncolumns] width;
- delete equal;
+ a_delete separation;
+ ad_delete(ncolumns) width;
+ a_delete equal;
for (int i = 0; i < nrows; i++) {
- delete vline[i];
- delete [ncolumns] entry[i];
+ a_delete vline[i];
+ ad_delete(ncolumns) entry[i];
}
- delete vline;
- delete entry;
+ a_delete vline;
+ a_delete entry;
}
struct input_entry_format : entry_format {
@@ -716,45 +716,45 @@ format *process_format(table_input &in, options *opt,
switch (c) {
case 'n':
case 'N':
- t = entry_format::NUMERIC;
+ t = FORMAT_NUMERIC;
got_format = 1;
break;
case 'a':
case 'A':
got_format = 1;
- t = entry_format::ALPHABETIC;
+ t = FORMAT_ALPHABETIC;
break;
case 'c':
case 'C':
got_format = 1;
- t = entry_format::CENTER;
+ t = FORMAT_CENTER;
break;
case 'l':
case 'L':
got_format = 1;
- t = entry_format::LEFT;
+ t = FORMAT_LEFT;
break;
case 'r':
case 'R':
got_format = 1;
- t = entry_format::RIGHT;
+ t = FORMAT_RIGHT;
break;
case 's':
case 'S':
got_format = 1;
- t = entry_format::SPAN;
+ t = FORMAT_SPAN;
break;
case '^':
got_format = 1;
- t = entry_format::VSPAN;
+ t = FORMAT_VSPAN;
break;
case '_':
got_format = 1;
- t = entry_format::HLINE;
+ t = FORMAT_HLINE;
break;
case '=':
got_format = 1;
- t = entry_format::DOUBLE_HLINE;
+ t = FORMAT_DOUBLE_HLINE;
break;
case '.':
got_period = 1;
@@ -817,12 +817,14 @@ format *process_format(table_input &in, options *opt,
case '7':
case '8':
case '9':
- int w = 0;
- do {
- w = w*10 + (c - '0');
- c = in.get();
- } while (c != EOF && csdigit(c));
- list->separation = w;
+ {
+ int w = 0;
+ do {
+ w = w*10 + (c - '0');
+ c = in.get();
+ } while (c != EOF && csdigit(c));
+ list->separation = w;
+ }
break;
case 'f':
case 'F':
@@ -1085,9 +1087,9 @@ format *process_format(table_input &in, options *opt,
free_input_entry_format_list(list);
for (col = 0; col < ncolumns; col++) {
entry_format *e = f->entry[f->nrows-1] + col;
- if (e->type != entry_format::HLINE
- && e->type != entry_format::DOUBLE_HLINE
- && e->type != entry_format::SPAN)
+ if (e->type != FORMAT_HLINE
+ && e->type != FORMAT_DOUBLE_HLINE
+ && e->type != FORMAT_SPAN)
break;
}
if (col >= ncolumns) {
@@ -1160,10 +1162,10 @@ table *process_data(table_input &in, format *f, options *opt)
while (format_index < f->nrows - 1) {
for (int c = 0; c < ncolumns; c++) {
entry_format *e = f->entry[format_index] + c;
- if (e->type != entry_format::HLINE
- && e->type != entry_format::DOUBLE_HLINE
+ if (e->type != FORMAT_HLINE
+ && e->type != FORMAT_DOUBLE_HLINE
// Unfortunately tbl treats a span as needing data.
- // && e->type != entry_format::SPAN
+ // && e->type != FORMAT_SPAN
)
break;
}
@@ -1185,7 +1187,7 @@ table *process_data(table_input &in, format *f, options *opt)
if (c == '\n')
--ln;
while (col < ncolumns
- && line_format[col].type == entry_format::SPAN) {
+ && line_format[col].type == FORMAT_SPAN) {
tbl->add_entry(current_row, col, "", &line_format[col],
current_filename, ln);
col++;
diff --git a/tbl/table.c b/tbl/table.c
index ea6828b9d..bcad17c36 100644
--- a/tbl/table.c
+++ b/tbl/table.c
@@ -438,7 +438,7 @@ text_entry::text_entry(char *s, const entry_modifier *m)
text_entry::~text_entry()
{
- delete contents;
+ a_delete contents;
}
@@ -618,7 +618,7 @@ block_entry::block_entry(char *s, const entry_modifier *m)
block_entry::~block_entry()
{
- delete contents;
+ a_delete contents;
}
void block_entry::position_vertically()
@@ -1199,19 +1199,19 @@ table::table(int nc, unsigned f, int ls)
table::~table()
{
for (int i = 0; i < nrows; i++) {
- delete entry[i];
- delete vline[i];
+ a_delete entry[i];
+ a_delete vline[i];
}
- delete entry;
- delete vline;
+ a_delete entry;
+ a_delete vline;
while (entry_list) {
table_entry *tem = entry_list;
entry_list = entry_list->next;
delete tem;
}
- delete [ncolumns] minimum_width;
- delete column_separation;
- delete equal;
+ ad_delete(ncolumns) minimum_width;
+ a_delete column_separation;
+ a_delete equal;
while (stuff_list) {
stuff *tem = stuff_list;
stuff_list = stuff_list->next;
@@ -1222,7 +1222,7 @@ table::~table()
vrule_list = vrule_list->next;
delete tem;
}
- delete row_is_all_lines;
+ a_delete row_is_all_lines;
}
void table::set_delim(char c1, char c2)
@@ -1465,11 +1465,11 @@ void table::add_entry(int r, int c, const string &str, const entry_format *f,
int is_block = str.search('\n') >= 0;
char *s;
switch (f->type) {
- case entry_format::SPAN:
+ case FORMAT_SPAN:
assert(str.empty());
do_hspan(r, c);
break;
- case entry_format::LEFT:
+ case FORMAT_LEFT:
if (!str.empty()) {
s = str.extract();
if (is_block)
@@ -1480,7 +1480,7 @@ void table::add_entry(int r, int c, const string &str, const entry_format *f,
else
e = new empty_entry(f);
break;
- case entry_format::CENTER:
+ case FORMAT_CENTER:
if (!str.empty()) {
s = str.extract();
if (is_block)
@@ -1491,7 +1491,7 @@ void table::add_entry(int r, int c, const string &str, const entry_format *f,
else
e = new empty_entry(f);
break;
- case entry_format::RIGHT:
+ case FORMAT_RIGHT:
if (!str.empty()) {
s = str.extract();
if (is_block)
@@ -1502,7 +1502,7 @@ void table::add_entry(int r, int c, const string &str, const entry_format *f,
else
e = new empty_entry(f);
break;
- case entry_format::NUMERIC:
+ case FORMAT_NUMERIC:
if (!str.empty()) {
s = str.extract();
if (is_block) {
@@ -1520,7 +1520,7 @@ void table::add_entry(int r, int c, const string &str, const entry_format *f,
else
e = new empty_entry(f);
break;
- case entry_format::ALPHABETIC:
+ case FORMAT_ALPHABETIC:
if (!str.empty()) {
s = str.extract();
if (is_block)
@@ -1531,16 +1531,16 @@ void table::add_entry(int r, int c, const string &str, const entry_format *f,
else
e = new empty_entry(f);
break;
- case entry_format::VSPAN:
+ case FORMAT_VSPAN:
do_vspan(r, c);
break;
- case entry_format::HLINE:
+ case FORMAT_HLINE:
if (str.length() != 0)
error_with_file_and_line(fn, ln,
"non-empty data entry for `_' format ignored");
e = new single_line_entry(f);
break;
- case entry_format::DOUBLE_HLINE:
+ case FORMAT_DOUBLE_HLINE:
if (str.length() != 0)
error_with_file_and_line(fn, ln,
"non-empty data entry for `=' format ignored");
diff --git a/tbl/table.h b/tbl/table.h
index 4a2744049..24872c1f0 100644
--- a/tbl/table.h
+++ b/tbl/table.h
@@ -48,19 +48,20 @@ struct entry_modifier {
~entry_modifier();
};
+enum format_type {
+ FORMAT_LEFT,
+ FORMAT_CENTER,
+ FORMAT_RIGHT,
+ FORMAT_NUMERIC,
+ FORMAT_ALPHABETIC,
+ FORMAT_SPAN,
+ FORMAT_VSPAN,
+ FORMAT_HLINE,
+ FORMAT_DOUBLE_HLINE
+};
+
struct entry_format : entry_modifier {
- enum format_type {
- LEFT,
- CENTER,
- RIGHT,
- NUMERIC,
- ALPHABETIC,
- SPAN,
- VSPAN,
- HLINE,
- DOUBLE_HLINE,
- }
- type;
+ format_type type;
entry_format(format_type);
entry_format();
diff --git a/troff/column.c b/troff/column.c
index 690a8c1eb..44b22c843 100644
--- a/troff/column.c
+++ b/troff/column.c
@@ -464,8 +464,8 @@ justification_spec::justification_spec(vunits h)
justification_spec::~justification_spec()
{
- delete type;
- delete amount;
+ a_delete type;
+ a_delete amount;
}
void justification_spec::append(symbol t, vunits v)
@@ -486,12 +486,12 @@ void justification_spec::append(symbol t, vunits v)
int i;
for (i = 0; i < n; i++)
type[i] = old_type[i];
- delete old_type;
+ a_delete old_type;
vunits *old_amount = amount;
amount = new vunits[maxn];
for (i = 0; i < n; i++)
amount[i] = old_amount[i];
- delete old_amount;
+ a_delete old_amount;
}
assert(n < maxn);
type[n] = t;
diff --git a/troff/div.c b/troff/div.c
index f3a980091..1297fce3e 100644
--- a/troff/div.c
+++ b/troff/div.c
@@ -59,7 +59,7 @@ vertical_size::vertical_size(vunits vs, int ls)
post = V0;
}
-void node::set_vertical_size(vertical_size *v)
+void node::set_vertical_size(vertical_size *)
{
}
@@ -870,6 +870,8 @@ void mark()
symbol s = get_name();
if (s.is_null())
curdiv->marked_place = curdiv->get_vertical_position();
+ else if (curdiv == topdiv)
+ set_number_reg(s, nl_reg_contents);
else
set_number_reg(s, curdiv->get_vertical_position().to_units());
skip_line();
diff --git a/troff/env.c b/troff/env.c
index dd288d183..5ec43ede4 100644
--- a/troff/env.c
+++ b/troff/env.c
@@ -192,7 +192,7 @@ void widow_control_request()
size_range *font_size::size_table = 0;
int font_size::nranges = 0;
-static int compare_ranges(void *p1, void *p2)
+static int compare_ranges(const void *p1, const void *p2)
{
return ((size_range *)p1)->min - ((size_range *)p2)->min;
}
@@ -373,42 +373,17 @@ void environment::add_italic_correction()
line = line->add_italic_correction(&width_total);
}
-int environment::get_space_size()
-{
- return space_size;
-}
-
-int environment::get_sentence_space_size()
-{
- return sentence_space_size;
-}
-
-hunits environment::get_space_width()
-{
- return scale(env_space_width(this), space_size, 12);
-}
-
-hunits environment::get_narrow_space_width()
-{
- return env_narrow_space_width(this);
-}
-
-hunits environment::get_half_narrow_space_width()
-{
- return env_half_narrow_space_width(this);
-}
-
void environment::space_newline()
{
assert(!current_tab && !current_field);
if (interrupted)
return;
- int ss = space_size;
- if (node_list_ends_sentence(line) == 1)
- ss += sentence_space_size;
- hunits x = (translate_space_to_dummy
- ? H0
- : scale(env_space_width(this), ss, 12));
+ hunits x = H0;
+ if (!translate_space_to_dummy) {
+ x = env_space_width(this);
+ if (node_list_ends_sentence(line) == 1)
+ x += env_sentence_space_width(this);
+ }
if (line != 0 && line->merge_space(x)) {
width_total += x;
return;
@@ -429,16 +404,12 @@ void environment::space()
*hp += 1;
return;
}
- hunits x = (translate_space_to_dummy
- ? H0
- : scale(env_space_width(this), space_size, 12));
+ hunits x = translate_space_to_dummy ? H0 : env_space_width(this);
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 = (translate_space_to_dummy
- ? H0
- : scale(env_space_width(this), sentence_space_size, 12));
+ hunits xx = translate_space_to_dummy ? H0 : env_sentence_space_width(this);
if (p->merge_space(xx)) {
*tp += xx;
return;
@@ -607,7 +578,8 @@ environment::environment(symbol nm)
hyphen_line_count(0),
hyphen_line_max(-1),
hyphenation_space(H0),
- hyphenation_margin(H0)
+ hyphenation_margin(H0),
+ composite(0)
{
prev_family = family = lookup_family(default_family);
prev_fontno = fontno = 1;
@@ -684,7 +656,8 @@ environment::environment(const environment *e)
hyphen_line_max(e->hyphen_line_max),
hyphen_line_count(0),
hyphenation_space(e->hyphenation_space),
- hyphenation_margin(e->hyphenation_margin)
+ hyphenation_margin(e->hyphenation_margin),
+ composite(0)
{
}
@@ -2062,7 +2035,7 @@ const char *tab_stops::to_string()
int need = count*12 + 3;
if (buf == 0 || need > buf_size) {
if (buf)
- delete buf;
+ a_delete buf;
buf_size = need;
buf = new char[buf_size];
}
@@ -2724,7 +2697,7 @@ static void hyphen_word()
memcpy(tem, pos, npos+1);
tem = (unsigned char *)exception_dictionary.lookup(symbol(buf), tem);
if (tem)
- delete tem;
+ a_delete tem;
}
}
skip_line();
diff --git a/troff/env.h b/troff/env.h
index eaed44da9..01b7d77a6 100644
--- a/troff/env.h
+++ b/troff/env.h
@@ -62,6 +62,13 @@ inline int font_size::to_points()
return p/sizescale;
}
+struct environment;
+
+hunits env_digit_width(environment *);
+hunits env_space_width(environment *);
+hunits env_sentence_space_width(environment *);
+hunits env_narrow_space_width(environment *);
+hunits env_half_narrow_space_width(environment *);
struct tab;
@@ -160,6 +167,7 @@ class environment {
int hyphen_line_max;
hunits hyphenation_space;
hunits hyphenation_margin;
+ int composite; // used for construction of composite char?
pending_output_line *pending_lines;
#ifdef WIDOW_CONTROL
int widow_control;
@@ -192,6 +200,8 @@ public:
~environment();
int is_dummy() { return dummy; }
int is_empty();
+ int is_composite() { return composite; }
+ void set_composite() { composite = 1; }
vunits get_vertical_spacing(); // .v
int get_line_spacing(); // .L
int get_point_size() { return size.to_scaled_points(); }
@@ -218,11 +228,12 @@ public:
vunits get_prev_char_depth();
hunits get_text_length(); // .k
hunits get_prev_text_length(); // .n
- hunits get_space_width();
- int get_space_size(); // in ems/36
- int get_sentence_space_size();
- hunits get_narrow_space_width();
- hunits get_half_narrow_space_width();
+ hunits get_space_width() { return env_space_width(this); }
+ int get_space_size() { return space_size; } // in ems/36
+ int get_sentence_space_size() { return sentence_space_size; }
+ hunits get_narrow_space_width() { return env_narrow_space_width(this); }
+ hunits get_half_narrow_space_width()
+ { return env_half_narrow_space_width(this); }
hunits get_input_line_position();
const char *get_tabs();
int get_hyphenation_flags();
diff --git a/troff/input.c b/troff/input.c
index f00978209..fe00d88ae 100644
--- a/troff/input.c
+++ b/troff/input.c
@@ -588,7 +588,7 @@ static symbol read_long_escape_name()
int c = get_char_for_escape_name();
if (c == 0) {
if (buf != abuf)
- delete buf;
+ a_delete buf;
return NULL_SYMBOL;
}
if (i + 2 > buf_size) {
@@ -602,7 +602,7 @@ static symbol read_long_escape_name()
buf = new char[buf_size*2];
memcpy(buf, old_buf, buf_size);
buf_size *= 2;
- delete old_buf;
+ a_delete old_buf;
}
}
if (c == ']' && input_stack::get_level() == start_level)
@@ -619,7 +619,7 @@ static symbol read_long_escape_name()
}
else {
symbol s(buf);
- delete buf;
+ a_delete buf;
return s;
}
}
@@ -1206,13 +1206,15 @@ void token::next()
type = TOKEN_LEADER;
return;
case 0:
- assert(n != 0);
- token_node *tn = n->get_token_node();
- if (tn)
- *this = tn->tk;
- else {
- nd = n;
- type = TOKEN_NODE;
+ {
+ assert(n != 0);
+ token_node *tn = n->get_token_node();
+ if (tn)
+ *this = tn->tk;
+ else {
+ nd = n;
+ type = TOKEN_NODE;
+ }
}
return;
default:
@@ -1743,7 +1745,7 @@ symbol get_long_name(int required)
buf = new char[buf_size*2];
memcpy(buf, old_buf, buf_size);
buf_size *= 2;
- delete old_buf;
+ a_delete old_buf;
}
}
if ((buf[i] = tok.ch()) == 0)
@@ -1760,7 +1762,7 @@ symbol get_long_name(int required)
return symbol(buf);
else {
symbol s(buf);
- delete buf;
+ a_delete buf;
return s;
}
}
@@ -2522,7 +2524,7 @@ temp_iterator::temp_iterator(const char *s, int len)
temp_iterator::~temp_iterator()
{
- delete base;
+ a_delete base;
}
class small_temp_iterator : public input_iterator {
@@ -3474,7 +3476,7 @@ static symbol get_delim_name()
buf = new char[buf_size*2];
memcpy(buf, old_buf, buf_size);
buf_size *= 2;
- delete old_buf;
+ a_delete old_buf;
}
}
tok.next();
@@ -3484,7 +3486,7 @@ static symbol get_delim_name()
if ((buf[i] = tok.ch()) == 0) {
error("missing delimiter (got %1)", tok.description());
if (buf != abuf)
- delete buf;
+ a_delete buf;
return NULL_SYMBOL;
}
i++;
@@ -3500,7 +3502,7 @@ static symbol get_delim_name()
}
else {
symbol s(buf);
- delete buf;
+ a_delete buf;
return s;
}
}
@@ -4149,11 +4151,13 @@ const char *input_char_description(int c)
void terminal()
{
- int c;
- while ((c = get_copy(NULL)) == ' ' || c == '\t')
- ;
- for (; c != '\n' && c != EOF; c = get_copy(NULL))
- fputs(asciify(c), stderr);
+ if (!tok.newline() && !tok.eof()) {
+ int c;
+ while ((c = get_copy(NULL)) == ' ' || c == '\t')
+ ;
+ for (; c != '\n' && c != EOF; c = get_copy(NULL))
+ fputs(asciify(c), stderr);
+ }
fputc('\n', stderr);
fflush(stderr);
tok.next();
@@ -4229,6 +4233,7 @@ void write_request()
for (; c != '\n' && c != EOF; c = get_copy(NULL))
fputs(asciify(c), fp);
fputc('\n', fp);
+ fflush(fp);
tok.next();
}
@@ -4667,7 +4672,7 @@ char *read_string()
s = new char[len*2];
memcpy(s, tem, len);
len *= 2;
- delete tem;
+ a_delete tem;
}
s[i++] = c;
}
@@ -4676,7 +4681,7 @@ char *read_string()
s[i] = '\0';
tok.next();
if (i == 0) {
- delete s;
+ a_delete s;
return 0;
}
return s;
@@ -4703,7 +4708,7 @@ void system_request()
error("empty command");
else {
system_status = system(command);
- delete command;
+ a_delete command;
}
}
@@ -4880,7 +4885,7 @@ static FILE *open_file(const char *filename, string_list *dirs, char **pathp)
*pathp = path;
return fp;
}
- delete path;
+ a_delete path;
dirs = dirs->next;
}
return 0;
@@ -4913,7 +4918,7 @@ static FILE *open_mac_file(const char *mac, char **path)
strcpy(s, MACRO_PREFIX);
strcat(s, mac);
FILE *fp = open_file(s, mac_dirs, path);
- delete s;
+ a_delete s;
return fp;
}
@@ -4924,7 +4929,7 @@ static void process_macro_file(const char *mac)
if (!fp)
fatal("can't find macro file %1", mac);
const char *s = symbol(path).contents();
- delete path;
+ a_delete path;
input_stack::push(new file_iterator(fp, s));
tok.next();
process_input_stack();
@@ -4942,7 +4947,7 @@ void macro_source()
FILE *fp = open_file(nm.contents(), mac_dirs, &path);
if (fp) {
input_stack::push(new file_iterator(fp, symbol(path).contents()));
- delete path;
+ a_delete path;
}
else
error("can't find macro file `%1'", nm.contents());
@@ -4999,7 +5004,7 @@ static void do_register_assignment(const char *s)
units n;
if (evaluate_expression(p + 1, &n))
set_number_reg(buf, n);
- delete buf;
+ a_delete buf;
}
}
@@ -5027,7 +5032,7 @@ static void do_string_assignment(const char *s)
memcpy(buf, s, p - s);
buf[p - s] = 0;
set_string(buf, p + 1);
- delete buf;
+ a_delete buf;
}
}
@@ -5541,14 +5546,14 @@ static request_or_macro *lookup_request(symbol nm)
}
-node *charinfo_to_node(charinfo *ci, const environment *envp)
+node *charinfo_to_node_list(charinfo *ci, const environment *envp)
{
macro *mac = ci->set_macro(0);
assert(mac != 0);
environment *oldenv = curenv;
environment env(envp);
curenv = &env;
- font_size sz = env.get_font_size();
+ curenv->set_composite();
token old_tok = tok;
input_stack::add_boundary();
string_iterator *si = new string_iterator(*mac, "composite character", ci->nm);
@@ -5569,12 +5574,11 @@ node *charinfo_to_node(charinfo *ci, const environment *envp)
tok.process();
}
node *n = curenv->extract_output_line();
- composite_node *cn = new composite_node(n, ci, sz);
input_stack::remove_boundary();
ci->set_macro(mac);
tok = old_tok;
curenv = oldenv;
- return cn;
+ return n;
}
static node *read_draw_node()
@@ -5606,7 +5610,7 @@ static node *read_draw_node()
for (int j = 0; j < maxpoints; j++)
point[j] = oldpoint[j];
maxpoints *= 2;
- delete oldpoint;
+ a_delete oldpoint;
}
if (!get_hunits(&point[i].h, 'm')) {
err = 1;
@@ -5664,11 +5668,11 @@ static node *read_draw_node()
}
draw_node *dn = new draw_node(type, point, npoints,
curenv->get_font_size());
- delete point;
+ a_delete point;
return dn;
}
else {
- delete point;
+ a_delete point;
}
}
}
diff --git a/troff/node.c b/troff/node.c
index aebae6658..a315a9488 100644
--- a/troff/node.c
+++ b/troff/node.c
@@ -106,7 +106,7 @@ public:
int is_named(symbol);
symbol get_name();
tfont *get_tfont(font_size, int, int, int);
- hunits get_space_width(font_size);
+ hunits get_space_width(font_size, int);
hunits get_narrow_space_width(font_size);
hunits get_half_narrow_space_width(font_size);
int get_bold(hunits *);
@@ -345,9 +345,16 @@ symbol font_info::get_name()
return internal_name;
}
-hunits font_info::get_space_width(font_size fs)
+hunits font_info::get_space_width(font_size fs, int space_size)
{
- return hunits(fm->get_space_width(fs.to_scaled_points()));
+ if (is_constant_spaced == CONSTANT_SPACE_NONE)
+ return scale(hunits(fm->get_space_width(fs.to_scaled_points())),
+ space_size, 12);
+ else if (is_constant_spaced == CONSTANT_SPACE_ABSOLUTE)
+ return constant_space;
+ else
+ return scale(constant_space*fs.to_scaled_points(),
+ units_per_inch, 36*72*sizescale);
}
hunits font_info::get_narrow_space_width(font_size fs)
@@ -982,7 +989,7 @@ void troff_output_file::set_font(tfont *tf)
font_position = new symbol[nfont_positions];
memcpy(font_position, old_font_position,
old_nfont_positions*sizeof(symbol));
- delete old_font_position;
+ a_delete old_font_position;
}
font_position[n] = nm;
}
@@ -1118,7 +1125,7 @@ troff_output_file::~troff_output_file()
put('\n');
}
put("x stop\n");
- delete font_position;
+ a_delete font_position;
}
troff_output_file::troff_output_file()
@@ -2774,17 +2781,6 @@ void ligature_node::asciify(macro *m)
delete this;
}
-void composite_node::asciify(macro *m)
-{
- unsigned char c = ci->get_ascii_code();
- if (c != 0) {
- m->append(c);
- delete this;
- }
- else
- m->append(this);
-}
-
void break_char_node::asciify(macro *m)
{
ch->asciify(m);
@@ -3044,8 +3040,34 @@ void special_node::tprint_end(troff_output_file *out)
/* composite_node */
-composite_node::composite_node(node *p, charinfo *c, font_size s, node *x)
- : node(x), n(p), ci(c), sz(s)
+class composite_node : public node {
+ charinfo *ci;
+ node *n;
+ tfont *tf;
+public:
+ composite_node(node *, charinfo *, tfont *, node * = 0);
+ ~composite_node();
+ node *copy();
+ hunits width();
+ node *last_char_node();
+ units size();
+ void tprint(troff_output_file *);
+ hyphenation_type get_hyphenation_type();
+ int overlaps_horizontally();
+ int overlaps_vertically();
+ void ascii_print(ascii_output_file *);
+ void asciify(macro *);
+ hyphen_list *get_hyphen_list(hyphen_list *tail);
+ node *add_self(node *, hyphen_list **);
+ tfont *get_tfont();
+ int same(node *);
+ const char *type();
+ void vertical_extent(vunits *, vunits *);
+ vunits vertical_width();
+};
+
+composite_node::composite_node(node *p, charinfo *c, tfont *t, node *x)
+: node(x), n(p), ci(c), tf(t)
{
}
@@ -3056,14 +3078,21 @@ composite_node::~composite_node()
node *composite_node::copy()
{
- return new composite_node(copy_node_list(n), ci, sz);
+ return new composite_node(copy_node_list(n), ci, tf);
}
hunits composite_node::width()
{
- hunits x = H0;
+ hunits x;
+ if (tf->get_constant_space(&x))
+ return x;
+ x = H0;
for (node *tem = n; tem; tem = tem->next)
x += tem->width();
+ hunits offset;
+ if (tf->get_bold(&offset))
+ x += offset;
+ x += tf->get_track_kern();
return x;
}
@@ -3082,7 +3111,7 @@ vunits composite_node::vertical_width()
units composite_node::size()
{
- return sz.to_units();
+ return tf->get_size().to_units();
}
hyphenation_type composite_node::get_hyphenation_type()
@@ -3100,6 +3129,17 @@ int composite_node::overlaps_vertically()
return ci->overlaps_vertically();
}
+void composite_node::asciify(macro *m)
+{
+ unsigned char c = ci->get_ascii_code();
+ if (c != 0) {
+ m->append(c);
+ delete this;
+ }
+ else
+ m->append(this);
+}
+
void composite_node::ascii_print(ascii_output_file *ascii)
{
unsigned char c = ci->get_ascii_code();
@@ -3131,10 +3171,7 @@ node *composite_node::add_self(node *nn, hyphen_list **p)
tfont *composite_node::get_tfont()
{
- if (n)
- return n->get_tfont();
- else
- return 0;
+ return tf;
}
node *reverse_node_list(node *n)
@@ -3243,7 +3280,7 @@ const char *draw_node::type()
draw_node::~draw_node()
{
if (point)
- delete point;
+ a_delete point;
}
hunits draw_node::width()
@@ -3531,7 +3568,53 @@ void dbreak_node::tprint(troff_output_file *out)
void composite_node::tprint(troff_output_file *out)
{
+ hunits bold_offset;
+ int is_bold = tf->get_bold(&bold_offset);
+ hunits track_kern = tf->get_track_kern();
+ hunits constant_space;
+ int is_constant_spaced = tf->get_constant_space(&constant_space);
+ hunits x = H0;
+ if (is_constant_spaced) {
+ x = constant_space;
+ for (node *tem = n; tem; tem = tem->next)
+ x -= tem->width();
+ if (is_bold)
+ x -= bold_offset;
+ hunits x2 = x/2;
+ out->right(x2);
+ x -= x2;
+ }
+ if (is_bold) {
+ int hpos = out->get_hpos();
+ int vpos = out->get_vpos();
+ tprint_reverse_node_list(out, n);
+ out->moveto(hpos, vpos);
+ out->right(bold_offset);
+ }
tprint_reverse_node_list(out, n);
+ if (is_constant_spaced)
+ out->right(x);
+ else
+ out->right(track_kern);
+}
+
+node *make_composite_node(charinfo *s, environment *env)
+{
+ int fontno = env_definite_font(env);
+ if (fontno < 0) {
+ error("no current font");
+ return 0;
+ }
+ assert(fontno < font_table_size && font_table[fontno] != 0);
+ node *n = charinfo_to_node_list(s, env);
+ font_size fs = env->get_font_size();
+ int char_height = env->get_char_height();
+ int char_slant = env->get_char_slant();
+ tfont *tf = font_table[fontno]->get_tfont(fs, char_height, char_slant,
+ fontno);
+ if (env->is_composite())
+ tf = tf->get_plain();
+ return new composite_node(n, s, tf);
}
node *make_glyph_node(charinfo *s, environment *env, int no_error_message = 0)
@@ -3601,6 +3684,8 @@ node *make_glyph_node(charinfo *s, environment *env, int no_error_message = 0)
int char_height = env->get_char_height();
int char_slant = env->get_char_slant();
tfont *tf = font_table[fontno]->get_tfont(fs, char_height, char_slant, fn);
+ if (env->is_composite())
+ tf = tf->get_plain();
return new glyph_node(s, tf);
}
@@ -3617,7 +3702,7 @@ node *make_node(charinfo *ci, environment *env)
ci = tem;
macro *mac = ci->get_macro();
if (mac)
- return charinfo_to_node(ci, env);
+ return make_composite_node(ci, env);
else
return make_glyph_node(ci, env);
}
@@ -3655,7 +3740,7 @@ node *node::add_char(charinfo *ci, environment *env, hunits *widthp)
ci = tem;
macro *mac = ci->get_macro();
if (mac) {
- res = charinfo_to_node(ci, env);
+ res = make_composite_node(ci, env);
if (res) {
res->next = this;
*widthp += res->width();
@@ -4150,6 +4235,7 @@ static void grow_font_table(int n)
if (old_font_table_size)
memcpy(font_table, old_font_table,
old_font_table_size*sizeof(font_info *));
+ a_delete old_font_table;
for (int i = old_font_table_size; i < font_table_size; i++)
font_table[i] = 0;
}
@@ -4269,7 +4355,7 @@ font_family::font_family(symbol s)
font_family::~font_family()
{
- delete map;
+ a_delete map;
}
int font_family::make_definite(int i)
@@ -4288,7 +4374,7 @@ int font_family::make_definite(int i)
map_size = i + 10;
map = new int[map_size];
memcpy(map, old_map, old_map_size*sizeof(int));
- delete old_map;
+ a_delete old_map;
for (int j = old_map_size; j < map_size; j++)
map[j] = -1;
}
@@ -4491,11 +4577,20 @@ hunits env_space_width(environment *env)
int fn = env_definite_font(env);
font_size fs = env->get_font_size();
if (fn < 0 || fn >= font_table_size || font_table[fn] == 0)
- return fs.to_units()/3;
+ return scale(fs.to_units()/3, env->get_space_size(), 12);
else
- return font_table[fn]->get_space_width(fs);
+ return font_table[fn]->get_space_width(fs, env->get_space_size());
}
+hunits env_sentence_space_width(environment *env)
+{
+ int fn = env_definite_font(env);
+ font_size fs = env->get_font_size();
+ if (fn < 0 || fn >= font_table_size || font_table[fn] == 0)
+ return scale(fs.to_units()/3, env->get_sentence_space_size(), 12);
+ else
+ return font_table[fn]->get_space_width(fs, env->get_sentence_space_size());
+}
hunits env_half_narrow_space_width(environment *env)
{
diff --git a/troff/node.h b/troff/node.h
index 63b8d6cbf..51e2a16b1 100644
--- a/troff/node.h
+++ b/troff/node.h
@@ -403,33 +403,6 @@ public:
const char *type();
};
-class charinfo;
-
-class composite_node : public node {
- charinfo *ci;
- node *n;
- font_size sz;
-public:
- composite_node(node *, charinfo *, font_size, node * = 0);
- ~composite_node();
- node *copy();
- hunits width();
- node *last_char_node();
- units size();
- void tprint(troff_output_file *);
- hyphenation_type get_hyphenation_type();
- int overlaps_horizontally();
- int overlaps_vertically();
- void ascii_print(ascii_output_file *);
- void asciify(macro *);
- hyphen_list *get_hyphen_list(hyphen_list *tail);
- node *add_self(node *, hyphen_list **);
- tfont *get_tfont();
- int same(node *);
- const char *type();
- void vertical_extent(vunits *, vunits *);
- vunits vertical_width();
-};
struct hvpair {
hunits h;
@@ -454,6 +427,7 @@ public:
const char *type();
};
+class charinfo;
node *make_node(charinfo *ci, environment *);
int character_exists(charinfo *, environment *);
@@ -462,10 +436,6 @@ node *reverse_node_list(node *n);
void delete_node_list(node *);
node *copy_node_list(node *);
-hunits env_digit_width(environment *);
-hunits env_space_width(environment *);
-hunits env_narrow_space_width(environment *);
-hunits env_half_narrow_space_width(environment *);
int get_bold_fontno(int f);
inline hyphen_list::hyphen_list(unsigned char code, hyphen_list *p)
diff --git a/troff/number.c b/troff/number.c
index 020034aeb..319dd60aa 100644
--- a/troff/number.c
+++ b/troff/number.c
@@ -402,9 +402,10 @@ static int parse_term(units *v, int scale_indicator, int parenthesised)
tok.next();
if (!parse_term(v, scale_indicator, parenthesised))
return 0;
- int tem = (scale_indicator == 'v'
- ? curdiv->get_vertical_position().to_units()
- : curenv->get_input_line_position().to_units());
+ int tem;
+ tem = (scale_indicator == 'v'
+ ? curdiv->get_vertical_position().to_units()
+ : curenv->get_input_line_position().to_units());
if (tem >= 0) {
if (*v < INT_MIN + tem) {
error("numeric overflow");
diff --git a/troff/request.h b/troff/request.h
index 405a8ee4e..7e31022ff 100644
--- a/troff/request.h
+++ b/troff/request.h
@@ -76,4 +76,4 @@ extern int no_break_flag; // indicates whether request was invoked with . or '
class charinfo;
class environment;
-node *charinfo_to_node(charinfo *, const environment *);
+node *charinfo_to_node_list(charinfo *, const environment *);
diff --git a/troff/symbol.c b/troff/symbol.c
index ff0d7cf5c..5261c1e47 100644
--- a/troff/symbol.c
+++ b/troff/symbol.c
@@ -105,7 +105,7 @@ symbol::symbol(const char *p, int how)
--pp) {
symbol temp(*pp, 1); /* insert it into the new table */
}
- delete old_table;
+ a_delete old_table;
for (pp = table + hc % table_size;
*pp != 0;
(pp == table ? pp = table + table_size - 1 : --pp))
@@ -134,7 +134,7 @@ symbol concat(symbol s1, symbol s2)
strcpy(buf, s1.contents());
strcat(buf, s2.contents());
symbol res(buf);
- delete buf;
+ a_delete buf;
return res;
}
diff --git a/tty/tmac.tty b/tty/tmac.tty
index 04a36a3d9..c58480bd4 100644
--- a/tty/tmac.tty
+++ b/tty/tmac.tty
@@ -34,6 +34,7 @@
.tty-char \(sl /
.tty-char \(+- +-
.tty-char \(co (C)
+.tty-char \(rg (R)
.tty-char \(<= <=
.tty-char \(>= >=
.cp \n(_C
diff --git a/tty/tty.c b/tty/tty.c
index fdb953853..5fdc56c8e 100644
--- a/tty/tty.c
+++ b/tty/tty.c
@@ -1,6 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.uucp)
+/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+ Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -33,8 +33,14 @@ static int form_feed_flag = 0;
static int bold_flag = 1;
static int underline_flag = 1;
static int overstrike_flag = 1;
+static int draw_flag = 1;
-enum { UNDERLINE_MODE = 01, BOLD_MODE = 02 };
+enum {
+ UNDERLINE_MODE = 01,
+ BOLD_MODE = 02,
+ VDRAW_MODE = 04,
+ HDRAW_MODE = 010
+};
// Mode to use for bold-underlining.
static unsigned char bold_underline_mode = BOLD_MODE|UNDERLINE_MODE;
@@ -90,34 +96,61 @@ void tty_font::handle_x_command(int argc, const char **argv)
}
#endif
-// hpos and vpos must be non-adjacent, to work round a bug in g++ 1.37.1
-
-struct glyph {
+class glyph {
+ static glyph *free_list;
+public:
+ glyph *next;
unsigned short hpos;
- unsigned short serial;
- unsigned short vpos;
unsigned char code;
unsigned char mode;
+ void *operator new(size_t);
+ void operator delete(void *);
+ inline int draw_mode() { return mode & (VDRAW_MODE|HDRAW_MODE); }
};
+glyph *glyph::free_list = 0;
+
+void *glyph::operator new(size_t)
+{
+ if (!free_list) {
+ const int BLOCK = 1024;
+ free_list = (glyph *)new char[sizeof(glyph)*BLOCK];
+ for (int i = 0; i < BLOCK - 1; i++)
+ free_list[i].next = free_list + i + 1;
+ free_list[BLOCK - 1].next = 0;
+ }
+ glyph *p = free_list;
+ free_list = free_list->next;
+ p->next = 0;
+ return p;
+}
+
+void glyph::operator delete(void *p)
+{
+ if (p) {
+ ((glyph *)p)->next = free_list;
+ free_list = (glyph *)p;
+ }
+}
+
class tty_printer : public printer {
- enum { INITIAL_VEC_SIZE = 32 };
- glyph *vec;
- int vec_used;
- int vec_size;
+ glyph **lines;
int lines_per_page;
int columns_per_page;
+ int cached_v;
+ int cached_vpos;
+ void add_char(unsigned char, int, int, unsigned char);
public:
tty_printer();
~tty_printer();
void set_char(int, font *, const environment *, int);
+ void draw(int code, int *p, int np, const environment *env);
void begin_page(int) { }
void end_page();
font *make_font(const char *);
};
-tty_printer::tty_printer()
-: vec_used(0), vec_size(0), vec(0)
+tty_printer::tty_printer() : cached_v(0)
{
if (font::paperlength == 0)
lines_per_page = DEFAULT_LINES_PER_PAGE;
@@ -125,8 +158,11 @@ tty_printer::tty_printer()
fatal("paperlength not a multiple of vertical resolution");
else
lines_per_page = font::paperlength/font::vert;
- if (lines_per_page > USHRT_MAX || lines_per_page <= 0)
- fatal("ridiculous paperlength");
+ if (lines_per_page <= 0)
+ fatal("paperlength too small");
+ lines = new glyph *[lines_per_page];
+ for (int i = 0; i < lines_per_page; i++)
+ lines[i] = 0;
columns_per_page = font::paperwidth/font::hor;
// If columns_per_page is zero, we won't truncate.
if (columns_per_page < 0)
@@ -135,149 +171,185 @@ tty_printer::tty_printer()
tty_printer::~tty_printer()
{
- delete vec;
+ a_delete lines;
}
void tty_printer::set_char(int i, font *f, const environment *env, int w)
{
- int h = env->hpos;
+ if (w != font::hor)
+ fatal("width of character not equal to horizontal resolution");
+ add_char(f->get_code(i), env->hpos, env->vpos, ((tty_font *)f)->get_mode());
+}
+
+void tty_printer::add_char(unsigned char c, int h, int v, unsigned char mode)
+{
+#if 0
+ // This is too expensive.
if (h % font::hor != 0)
fatal("horizontal position not a multiple of horizontal resolution");
- h /= font::hor;
- if (h < 0) {
+#endif
+ int hpos = h / font::hor;
+ if (hpos < 0) {
error("character to the left of first column discarded");
return;
}
- if (columns_per_page != 0 && h >= columns_per_page) {
+ if (columns_per_page != 0 && hpos >= columns_per_page) {
error("character to the right of last column discarded");
return;
}
- if (h > USHRT_MAX) {
+ if (hpos > USHRT_MAX) {
error("character with ridiculously large horizontal position discarded");
return;
}
- int v = env->vpos;
- if (v % font::vert != 0)
- fatal("vertical position not a multiple of vertical resolution");
- v /= font::vert;
- // Note that the first output line corresponds to groff position font::vert.
- if (v <= 0) {
- error("character above first line discarded");
- return;
- }
- if (v > lines_per_page) {
- error("character below last line discarded");
- return;
- }
- if (w != font::hor)
- fatal("width of character not equal to horizontal resolution");
- if (vec_used >= vec_size) {
- if (vec_size == 0)
- vec_size = INITIAL_VEC_SIZE;
- else {
- if (vec_size > USHRT_MAX/2) {
- if (vec_size >= USHRT_MAX)
- fatal("too many characters on the page");
- vec_size = USHRT_MAX;
- }
- else
- vec_size *= 2;
+ int vpos;
+ if (v == cached_v && cached_v != 0)
+ vpos = cached_vpos;
+ else {
+ if (v % font::vert != 0)
+ fatal("vertical position not a multiple of vertical resolution");
+ vpos = v / font::vert;
+ if (vpos > lines_per_page) {
+ error("character below last line discarded");
+ return;
+ }
+ // Note that the first output line corresponds to groff
+ // position font::vert.
+ if (vpos <= 0) {
+ error("character above first line discarded");
+ return;
}
- glyph *old_vec = vec;
- vec = new glyph [vec_size];
- if (vec_used)
- memcpy(vec, old_vec, vec_used*sizeof(glyph));
- delete old_vec;
+ cached_v = v;
+ cached_vpos = vpos;
}
- // We need a stable sort, but qsort is not stable, so we fake it.
- vec[vec_used].serial = vec_used;
- vec[vec_used].hpos = h;
- vec[vec_used].vpos = v;
- vec[vec_used].code = f->get_code(i);
- vec[vec_used].mode = ((tty_font *)f)->get_mode();
- vec_used++;
+ glyph *g = new glyph;
+ g->hpos = hpos;
+ g->code = c;
+ g->mode = mode;
+
+ // The list will be reversed later. After reversal, it must be in
+ // increasing order of hpos, with HDRAW characters before VDRAW
+ // characters before normal characters at each hpos, and otherwise
+ // in order of occurrence.
+
+ for (glyph **pp = lines + (vpos - 1); *pp; pp = &(*pp)->next)
+ if ((*pp)->hpos < hpos
+ || ((*pp)->hpos == hpos && (*pp)->draw_mode() >= g->draw_mode()))
+ break;
+
+ g->next = *pp;
+ *pp = g;
}
-extern "C" {
-static int compare_glyph(void *p1, void *p2)
+void tty_printer::draw(int code, int *p, int np, const environment *env)
{
- int v1 = ((glyph *)p1)->vpos;
- int v2 = ((glyph *)p2)->vpos;
- if (v1 < v2)
- return -1;
- if (v1 > v2)
- return 1;
- int h1 = ((glyph *)p1)->hpos;
- int h2 = ((glyph *)p2)->hpos;
- if (h1 < h2)
- return -1;
- if (h1 > h2)
- return 1;
- if (((glyph *)p1)->serial < ((glyph *)p2)->serial)
- return -1;
- return 1;
-}
+ if (code != 'l' || !draw_flag)
+ return;
+ if (np != 2) {
+ error("2 arguments required for line");
+ return;
+ }
+ if (p[0] == 0) {
+ // vertical line
+ int v = env->vpos;
+ int len = p[1];
+ if (len < 0) {
+ v += len;
+ len = -len;
+ }
+ while (len >= 0) {
+ add_char('|', env->hpos, v, VDRAW_MODE);
+ len -= font::vert;
+ v += font::vert;
+ }
+ }
+ if (p[1] == 0) {
+ // horizontal line
+ int h = env->hpos;
+ int len = p[0];
+ if (len < 0) {
+ h += len;
+ len = -len;
+ }
+ while (len >= 0) {
+ add_char('-', h, env->vpos, HDRAW_MODE);
+ len -= font::hor;
+ h += font::hor;
+ }
+ }
}
void tty_printer::end_page()
{
- qsort(vec, vec_used, sizeof(glyph), compare_glyph);
- int hpos = 0;
- int vpos = 1;
- // We have already discarded characters with vpos < 1 or > lines_per_page.
- for (int i = 0; i < vec_used; i++) {
- assert(vpos <= vec[i].vpos);
- if (!overstrike_flag
- && i + 1 < vec_used
- && vec[i].hpos == vec[i + 1].hpos
- && vec[i].vpos == vec[i + 1].vpos)
- continue;
- for (; vpos < vec[i].vpos; vpos++) {
- putchar('\n');
- hpos = 0;
- }
- if (hpos > vec[i].hpos) {
- putchar('\b');
- hpos--;
+ for (int last_line = lines_per_page; last_line > 0; last_line--)
+ if (lines[last_line - 1])
+ break;
+
+ for (int i = 0; i < last_line; i++) {
+ glyph *p = lines[i];
+ lines[i] = 0;
+ glyph *g = 0;
+ while (p) {
+ glyph *tem = p->next;
+ p->next = g;
+ g = p;
+ p = tem;
}
- else {
- if (horizontal_tab_flag) {
- for (;;) {
- int next_tab_pos = ((hpos + TAB_WIDTH) / TAB_WIDTH) * TAB_WIDTH;
- if (next_tab_pos > vec[i].hpos)
- break;
- putchar('\t');
- hpos = next_tab_pos;
+ int hpos = 0;
+
+ glyph *nextp;
+ for (p = g; p; delete p, p = nextp) {
+ nextp = p->next;
+ if (nextp && p->hpos == nextp->hpos) {
+ if (!overstrike_flag)
+ continue;
+ if (p->draw_mode() == HDRAW_MODE && nextp->draw_mode() == VDRAW_MODE) {
+ nextp->code = '+';
+ continue;
+ }
+ if (p->draw_mode() != 0 && p->draw_mode() == nextp->draw_mode()) {
+ nextp->code = p->code;
+ continue;
}
}
- for (; hpos < vec[i].hpos; hpos++)
- putchar(' ');
- }
- assert(hpos == vec[i].hpos && vpos == vec[i].vpos);
- if (vec[i].mode & UNDERLINE_MODE) {
- putchar('_');
- putchar('\b');
- }
- if (vec[i].mode & BOLD_MODE) {
- putchar(vec[i].code);
- putchar('\b');
+ if (hpos > p->hpos) {
+ putchar('\b');
+ hpos--;
+ }
+ else {
+ if (horizontal_tab_flag) {
+ for (;;) {
+ int next_tab_pos = ((hpos + TAB_WIDTH) / TAB_WIDTH) * TAB_WIDTH;
+ if (next_tab_pos > p->hpos)
+ break;
+ putchar('\t');
+ hpos = next_tab_pos;
+ }
+ }
+ for (; hpos < p->hpos; hpos++)
+ putchar(' ');
+ }
+ assert(hpos == p->hpos);
+ if (p->mode & UNDERLINE_MODE) {
+ putchar('_');
+ putchar('\b');
+ }
+ if (p->mode & BOLD_MODE) {
+ putchar(p->code);
+ putchar('\b');
+ }
+ putchar(p->code);
+ hpos++;
}
- putchar(vec[i].code);
- hpos++;
+ putchar('\n');
}
if (form_feed_flag) {
- if (hpos != 0) {
- putchar('\n');
- vpos++;
- }
- if (vpos <= lines_per_page)
+ if (last_line < lines_per_page)
putchar('\f');
}
else {
- for (; vpos <= lines_per_page; vpos++)
+ for (; last_line < lines_per_page; last_line++)
putchar('\n');
}
- vec_used = 0;
}
font *tty_printer::make_font(const char *nm)
@@ -298,7 +370,7 @@ int main(int argc, char **argv)
static char stderr_buf[BUFSIZ];
setbuf(stderr, stderr_buf);
int c;
- while ((c = getopt(argc, argv, "F:vhfbuoBU")) != EOF)
+ while ((c = getopt(argc, argv, "F:vhfbuoBUd")) != EOF)
switch(c) {
case 'v':
{
@@ -337,6 +409,10 @@ int main(int argc, char **argv)
case 'F':
font::command_line_font_dir(optarg);
break;
+ case 'd':
+ // Ignore \D commands.
+ draw_flag = 0;
+ break;
case '?':
usage();
break;
@@ -355,7 +431,7 @@ int main(int argc, char **argv)
static void usage()
{
- fprintf(stderr, "usage: %s [-hfvbuoBU] [-F dir] [files ...]\n",
+ fprintf(stderr, "usage: %s [-hfvbuodBU] [-F dir] [files ...]\n",
program_name);
exit(1);
}
diff --git a/xditview/ChangeLog b/xditview/ChangeLog
index fdd39eaa9..759230930 100644
--- a/xditview/ChangeLog
+++ b/xditview/ChangeLog
@@ -1,3 +1,11 @@
+Mon Mar 16 10:21:58 1992 James Clark (jjc at jclark)
+
+ * tmac.X: Load tmac.pspic.
+
+Sun Mar 8 11:27:19 1992 James Clark (jjc at jclark)
+
+ * Lex.c (GetLine, GetWord, GetNumber): Rewrite.
+
Sat Oct 12 22:58:52 1991 James Clark (jjc at jclark)
* Dvi.c (SetDevice): If the size change request is refused but a
diff --git a/xditview/TODO b/xditview/TODO
index eb69bf915..88a0dae2e 100644
--- a/xditview/TODO
+++ b/xditview/TODO
@@ -10,3 +10,6 @@ specified in a resource (similar format to FontMap).
The initial width of the dialog box should expand to accomodate the
default value.
+
+Option in Print dialog to specify that only the current page should be
+printed.
diff --git a/xditview/lex.c b/xditview/lex.c
index 76e86e7ee..32831bdac 100644
--- a/xditview/lex.c
+++ b/xditview/lex.c
@@ -8,18 +8,16 @@ DviGetAndPut(dw, cp)
DviWidget dw;
int *cp;
{
- if (dw->dvi.ungot)
- {
- dw->dvi.ungot = 0;
- *cp = getc (dw->dvi.file);
- }
- else
- {
- *cp = getc (dw->dvi.file);
- if (*cp != EOF)
- putc (*cp, dw->dvi.tmpFile);
- }
- return *cp;
+ if (dw->dvi.ungot) {
+ dw->dvi.ungot = 0;
+ *cp = getc (dw->dvi.file);
+ }
+ else {
+ *cp = getc (dw->dvi.file);
+ if (*cp != EOF)
+ putc (*cp, dw->dvi.tmpFile);
+ }
+ return *cp;
}
char *
@@ -29,20 +27,20 @@ GetLine(dw, Buffer, Length)
int Length;
{
int i = 0, c;
- char *p = Buffer;
- Length--; /* Save room for final NULL */
+ Length--; /* Save room for final '\0' */
- while (i < Length && DviGetC (dw, &c) != EOF && c != '\n')
- if (p)
- *p++ = c;
- if (c == '\n' && p) /* Retain the newline like fgets */
- *p++ = c;
- if (c == '\n')
- DviUngetC(dw, c);
- if (p)
- *p = NULL;
- return (Buffer);
+ while (DviGetC (dw, &c) != EOF) {
+ if (Buffer && i < Length)
+ Buffer[i++] = c;
+ if (c == '\n') {
+ DviUngetC(dw, c);
+ break;
+ }
+ }
+ if (Buffer)
+ Buffer[i] = '\0';
+ return Buffer;
}
char *
@@ -52,21 +50,21 @@ GetWord(dw, Buffer, Length)
int Length;
{
int i = 0, c;
- char *p = Buffer;
- Length--; /* Save room for final NULL */
- while (DviGetC(dw, &c) != EOF && (c == ' ' || c == '\n'))
+ Length--; /* Save room for final '\0' */
+ while (DviGetC(dw, &c) == ' ' || c == '\n')
;
- if (c != EOF)
- DviUngetC(dw, c);
- while (i < Length && DviGetC(dw, &c) != EOF && c != ' ' && c != '\n')
- if (p)
- *p++ = c;
- if (c != EOF)
- DviUngetC(dw, c);
- if (p)
- *p = NULL;
- return (Buffer);
+ while (c != EOF) {
+ if (Buffer && i < Length)
+ Buffer[i++] = c;
+ if (DviGetC(dw, &c) == ' ' || c == '\n') {
+ DviUngetC(dw, c);
+ break;
+ }
+ }
+ if (Buffer)
+ Buffer[i] = '\0';
+ return Buffer;
}
GetNumber(dw)
@@ -75,21 +73,22 @@ GetNumber(dw)
int i = 0, c;
int negative = 0;
- while (DviGetC(dw, &c) != EOF && (c == ' ' || c == '\n'))
+ while (DviGetC(dw, &c) == ' ' || c == '\n')
;
- if (c != EOF)
- DviUngetC(dw, c);
-
- while (DviGetC(dw, &c) != EOF && c >= '0' && c <= '9') {
+ if (c == '-') {
+ negative = 1;
+ DviGetC(dw, &c);
+ }
+
+ for (; c >= '0' && c <= '9'; DviGetC(dw, &c)) {
if (negative)
i = i*10 - (c - '0');
else
i = i*10 + c - '0';
}
-
if (c != EOF)
DviUngetC(dw, c);
- return (i);
+ return i;
}
/*
diff --git a/xditview/tmac.X b/xditview/tmac.X
index 13e2862f3..1b969a52c 100644
--- a/xditview/tmac.X
+++ b/xditview/tmac.X
@@ -32,3 +32,4 @@
.if !c\(rh .tr \(rh\(rA
.if '\*(.T'X100' .char \(rn \h'-\w'\(sr'u'\(rn\h'\w'\(sr'u'
.cp \n(_C
+.if !\n(.C .mso tmac.pspic