changes required to compile under GNO v2.0.6

This commit is contained in:
gdr 1997-03-20 06:40:51 +00:00
parent 50a93eb0a9
commit bf22c21098
16 changed files with 317 additions and 132 deletions

View File

@ -1,16 +1,20 @@
CHANGES
-------
2.0
1.2 (18 March 97)
- Maintenance of nroff has been taken over by Devin Reade,
<gdr@myrias.com>
- Fixed a significant number of memory trashing bugs with the
help of Insight.
- Fixed a significant number of memory trashing bugs. Most of
them were of the walking-off-an-array variety.
- Optimized for speed, mainly by translating some functions
into inline code via macros.
into inline code via macros. Not much of a change, but improved
by 5-20%, depending on the man page being processed. To get
much more optimization than this, nroff needs to be redesigned.
- Prototyped, indented and otherwise cleaned up code. Made use
of some GNO v2.0.6 libc routines to reduce source code size.
- Indented source.
- Added rVersion resource fork and describe(1) entry.
- Minor updates to the nroff.1, man.7, and ms.7 man pages.
=== The remaining versions listed below were by Mike Horwath, ===
=== <mfrankow@seq.hamline.edu> and Jawaid Bazyar <bazyar@hypermall.com> ===

View File

@ -35,4 +35,9 @@ Compatibility
Bugs
----
This program uses recursion, Not A Good Thing on the IIgs.
It really needs a rewrite.
It really needs a rewrite. In the interim, I have left stack
overflow checking on. It currently uses 6k of stack which
is too much for a well behaved program of this size.
The -ms package has not been reviewed recently and is not believed
to be generally usable.

View File

@ -19,12 +19,14 @@
* - Heavily hacked up to conform to "real" nroff by Bill Rosenkranz
* - Heavily modified by Devin Reade to avoid memory trashing bugs.
*
* $Id: command.c,v 1.1 1997/03/14 06:22:26 gdr Exp $
* $Id: command.c,v 1.2 1997/03/20 06:40:50 gdr Exp $
*/
#ifdef __ORCAC__
segment "command___";
#pragma noroot
#pragma optimize 79
#endif
#include <stdio.h>
@ -33,11 +35,11 @@ segment "command___";
#ifdef __GNO__
#include <err.h>
#else
#include "err.h"
#include "unix/err.h"
#endif
#ifdef sparc
#include "sunos.h"
#include "unix/sunos.h"
#endif
#include "nroff.h"

View File

@ -20,11 +20,13 @@
* - Heavily hacked up to conform to "real" nroff by Bill Rosenkranz
* - Heavily modified by Devin Reade to avoid memory trashing bugs.
*
* $Id: escape.c,v 1.1 1997/03/14 06:22:27 gdr Exp $
* $Id: escape.c,v 1.2 1997/03/20 06:40:50 gdr Exp $
*/
#ifdef __ORCAC__
segment "escape____";
#pragma noroot
#pragma optimize 79
#endif
#define INVERSE '\xF'
@ -36,11 +38,11 @@ segment "escape____";
#ifdef __GNO__
#include <err.h>
#else
#include "err.h"
#include "unix/err.h"
#endif
#ifdef sparc
#include "sunos.h"
#include "unix/sunos.h"
#endif
#include "nroff.h"

View File

@ -19,11 +19,13 @@
* - Heavily hacked up to conform to "real" nroff by Bill Rosenkranz
* - Heavily modified by Devin Reade to avoid memory trashing bugs.
*
* $Id: io.c,v 1.1 1997/03/14 06:22:27 gdr Exp $
* $Id: io.c,v 1.2 1997/03/20 06:40:50 gdr Exp $
*/
#ifdef __ORCAC__
segment "io________";
#pragma noroot
#pragma optimize 79
#endif
#include <stdio.h>
@ -34,12 +36,12 @@ segment "io________";
#include <err.h>
#include <termcap.h>
#else
#include "err.h"
#include "termcap.h"
#include "unix/err.h"
#include "unix/termcap.h"
#endif
#ifdef sparc
#include "sunos.h"
#include "unix/sunos.h"
#endif
#include "nroff.h"
@ -322,4 +324,3 @@ putc_lpr (char c, FILE *fp)
}
#endif /* NOT_USED */

View File

@ -19,11 +19,13 @@
* - Heavily hacked up to conform to "real" nroff by Bill Rosenkranz
* - Heavily modified by Devin Reade to avoid memory trashing bugs.
*
* $Id: low.c,v 1.1 1997/03/14 06:22:27 gdr Exp $
* $Id: low.c,v 1.2 1997/03/20 06:40:50 gdr Exp $
*/
#ifdef __ORCAC__
segment "low_______";
#pragma noroot
#pragma optimize 79
#endif
#include <stdio.h>
@ -33,11 +35,11 @@ segment "low_______";
#ifdef __GNO__
#include <err.h>
#else
#include "err.h"
#include "unix/err.h"
#endif
#ifdef sparc
#include "sunos.h"
#include "unix/sunos.h"
#endif
#include "nroff.h"
@ -925,4 +927,3 @@ wait_for_char (void) {
Cconin ();
}
#endif

View File

@ -19,20 +19,22 @@
* - Heavily hacked up to conform to "real" nroff by Bill Rosenkranz
* - Heavily modified by Devin Reade to avoid memory trashing bugs.
*
* $Id: macros.c,v 1.1 1997/03/14 06:22:27 gdr Exp $
* $Id: macros.c,v 1.2 1997/03/20 06:40:50 gdr Exp $
*/
#ifdef __ORCAC__
segment "macros____";
#pragma noroot
#pragma optimize 78
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "err.h"
#include "unix/err.h"
#ifdef sparc
#include "sunos.h"
#include "unix/sunos.h"
#endif
#include "nroff.h"
@ -92,9 +94,9 @@ defmac (char *line, FILE *infp)
char defn[MXMLEN];
char newend[10];
#undef BORK
#ifdef BORK
fprintf(stderr, "DEBUG: defmac: \"%s\"\n", line);
fprintf(stderr, "DEBUG defmac (%s:%d): \"%s\"\n", __FILE__, __LINE__, line);
#endif
/*

View File

@ -1,15 +1,16 @@
#
# Makefile for nroff(1).
#
# $Id: makefile.mk,v 1.1 1997/03/14 06:22:28 gdr Exp $
# $Id: makefile.mk,v 1.2 1997/03/20 06:40:50 gdr Exp $
#
IIGS = FALSE # TRUE or FALSE
IIGS = TRUE # TRUE or FALSE
USE_INSIGHT = FALSE # TRUE or FALSE
BINDIR = /usr/bin
TMACDIR = /usr/lib/tmac
MANDIR = /usr/man
INSTALL = /usr/bin/install
#
###### end of configuration
@ -19,26 +20,29 @@ PROFILE = # -pg
.IF $(IIGS) == TRUE
DEFINES =
OPTIMIZE =
LDLIBS =
.ELIF $(USE_INSIGHT) == TRUE
OPTIMIZE = -v -w -G1
LDFLAGS += -v
LDLIBS = -l/lib/ltermcap -l/trenco4/gno.src/lib/libc/libc.v211b2
.ELIF $(USE_INSIGHT) == TRUE
CC = insight
DEFINES =
OPTIMIZE = -g
LDLIBS = int.tqs -ltermcap
.ELSE
LDLIBS = unix/int.tqs -ltermcap
.ELSE
CC = gcc
DEFINES = # -DDEBUG
OPTIMIZE = $(PROFILE) -g
LDLIBS = $(PROFILE) -ltermcap
.END
.END
.IF $(IIGS) == TRUE
UX_SRC =
UX_OBJ =
REZ_OBJ = nroff.r
.ELSE
UX_SRC = err.c
UX_OBJ = err.o
UX_SRC = unix/err.c
UX_OBJ = unix/err.o
REZ_OBJ =
.END
GCC_PARANOIA = \
@ -55,9 +59,9 @@ GCC_FLAGS =
.END
CFLAGS = $(OPTIMIZE) $(GCC_FLAGS) $(DEFINES)
CFLAGS += $(OPTIMIZE) $(GCC_FLAGS) $(DEFINES)
SUNOS_H = sunos.h
SUNOS_H = unix/sunos.h
OBJS = main.o command.o escape.o io.o low.o macros.o strings.o \
text.o $(UX_OBJ)
SRCS = main.c command.c escape.c io.c low.c macros.c strings.c \
@ -65,8 +69,9 @@ SRCS = main.c command.c escape.c io.c low.c macros.c strings.c \
default: nroff
nroff: $(OBJS)
nroff: $(OBJS) $(REZ_OBJ)
$(CC) -o $@ $(LDFLAGS) $(OBJS) $(LDLIBS)
copyfork $(REZ_OBJ) $@ -r
clobber:
$(RM) -f nroff $(OBJS)
@ -79,13 +84,14 @@ callchart:
cflow $(SRCS) > $@
install:
$(RM) -f /bin/nroff
$(INSTALL) -d $(BINDIR) $(TMACDIR) $(MANDIR)/man1 $(MANDIR)/man7
$(INSTALL) -m755 nroff $(BINDIR)
$(INSTALL) -m644 tmac.an $(TMACDIR)
$(INSTALL) -m644 tmac.s $(TMACDIR)
$(INSTALL) -m644 nroff.1 $(TMACDIR)/man1
$(INSTALL) -m644 man.7 $(TMACDIR)/man7
$(INSTALL) -m644 ms.7 $(TMACDIR)/man7
$(INSTALL) -m644 nroff.1 $(MANDIR)/man1
$(INSTALL) -m644 man.7 $(MANDIR)/man7
$(INSTALL) -m644 ms.7 $(MANDIR)/man7
#
# additional dependancies

View File

@ -1,15 +1,20 @@
.\" man(7) manpage by rosenkra@convex.com (Bill Rosenkranz, 7/22/90)
.\" modifications by Devin Reade, 18 March 97
.\"
.TH MAN 7
.\" $Id: man.7,v 1.2 1997/03/20 06:40:50 gdr Exp $
.\"
.TH MAN 7 "18 March 1997"
.SH NAME
man - nroff macro package for manual pages
.SH SYNOPSIS
nroff -man file ...
.BR nroff
.BR -man
.IR file ...
.SH DESCRIPTION
These macros are used to lay out reference pages for manuals.
.PP
Any text argument
t
.I t
may be zero to six words.
Quotes may be used to include blanks in a 'word'.
Text
@ -21,27 +26,44 @@ reaching a non-indented paragraph (i.e. at .SH or .SS).
In contrast with normal Unix procedure, all indents (tabs) are 8 spaces
instead of 5.
This can be changed by modifying tmac.an.
.SH FILES
.ec |
\lib\tmac\tmac.an the macro library
.ec \
.SH SEE ALSO
nroff(1), man(1)
.SH "REQUEST SUMMARY"
.nf
.cc +
Request Cause Explanation
Break?
.B t no Text t is bold. Quote to imbed blanks.
.I t no Text t is italic. Quote to imbed blanks.
.B t ... no Text \fIt\fR and subsequent arguments
are bold. Quote to imbed blanks.
There is no intervening space.
.I t ... no Text \fIt\fR and subsequent arguments
are italic. Quote to imbed blanks.
There is no intervening space.
.R t ... no Text \fIt\fR and subsequent arguments
are roman. Quote to imbed blanks.
There is no intervening space.
.BR t ... no Alternate bold and roman fonts for
specified arguments. There is no
intervening space.
.RB t ... no Alternate roman and bold fonts for
specified arguments. There is no
intervening space.
.IR t ... no Alternate italic and roman fonts for
specified arguments. There is no
intervening space.
.RI t ... no Alternate roman and italic fonts for
specified arguments. There is no
intervening space.
.LP yes Begin paragraph. Set prevailing
indent to 8.
.PP yes Same as .LP.
.IP x yes Set prevailing indent to 8. Begin
indented paragraph with hanging tag
given by first argument. Tag x is
given by first argument. Tag \fIx\fR is
always placed on a separate line.
.LP yes Same as .PP.
.PP yes Begin paragraph. Set prevailing
indent to 8.
.TP x yes Same as .IP. Note that this is a deviation from
normal Unix usage. This macro should be avoided
until it is fixed.
.HP yes Indented paragraph without tag.
.RE yes End of relative indent. Set prevailing
indent to amount of starting .RS.
.RP x yes Like .IP, but use relative indent. Must
@ -50,11 +72,18 @@ Request Cause Explanation
in distance 8.
.SH t yes Subhead. Quote to imbed blanks.
.SS t yes Subsection. Quote to imbed blanks. No
indent for t.
.TH n s c v d yes Begin page named n of chapter s; c is
the chapter name; d is the date of the
most recent change; v is version number.
indent for \fBt\fR.
.TH n s d v c yes Begin page named \fIn\fR of chapter number \fIs\fR.
\fId\fR is the date of the most recent change
or the current date (prefixed by
"\fBPrinted:\fR") if not specified. \fIv\fR is the
version number, or \fBGNO\fR if not specified.
\fIc\fR is the chapter name. If \fIc\fR is not
specified, it is derived based on the
value of \fIs\fR.
Sets prevailing indent and tabs to 8.
.EX no Exit now, leaving no extra space the
end of the document.
+cc .
.fi
@ -67,7 +96,7 @@ with this macro package:
.cc +
.\\\|" this is a comment
.TH DEMO 1 "Commands Manual" "Version 1.0" "\\\|*\|(DA"
.TH DEMO 1 "\\\|*\|(DA" "Version 1.0" "Commands Manual"
.SH NAME
demo - show how to use -man package \\\|" this is a comment
.SH SYNOPSIS
@ -246,3 +275,8 @@ net: rosenkra@convex.com
CIS: 71460,17
GENIE: W.ROSENKRANZ
.fi
.SH FILES
\fB/usr/lib/tmac/tmac.an\fR \- the macro library
.SH SEE ALSO
nroff(1), man(1)

View File

@ -31,10 +31,6 @@ initialization, and the last two may be used even before initialization:
.fi
Font changes with \f are also allowed;
for example, '\\fIword\\fR' will italicize word.
.SH FILES
.ec |
\lib\tmac\tmac.s
.ec \
.SH REQUESTS
.nf
.cc +
@ -102,4 +98,5 @@ net: rosenkra@convex.com
CIS: 71460,17
GENIE: W.ROSENKRANZ
.fi
.SH FILES
/usr/lib/tmac/tmac.s

View File

@ -1,14 +1,25 @@
.\" nroff(1) manpage by rosenkra@convex.com (Bill Rosenkranz, 7/22/90)
.\" modifications by Devin Reade, 18 March 97
.\"
.TH NROFF 1
.\" $Id: nroff.1,v 1.2 1997/03/20 06:40:51 gdr Exp $
.\"
.TH NROFF 1 "18 March 1997"
.SH NAME
nroff - text processor (Version 1.10)
nroff - text processing typesetter
.SH SYNOPSIS
nroff [options] file [...]
.BR nroff
[
.I options
]
.I file
[...]
.SH DESCRIPTION
Nroff is a text processor and formatter based on the design
.BR nroff
is a text processor and formatter based on the design
provided in "Software Tools" by Kernighan and Plauger.
It has been modified to closely resemble the Unix(tm) nroff command.
It has been modified to closely resemble the Unix(tm)
.BR nroff
command.
The text and commands found in the file(s)
are processed to generate formatted text.
Note that one (and only one) of the files can be "-" which reads
@ -49,7 +60,8 @@ Causes output to stop after page n.
Input from stdin.
.sp
.SH ENVIRONMENT
Nroff recognizes the following environment variables from the shell:
.BR nroff
recognizes the following environment variables from the shell:
.IP TMACDIR
An alternate directory to find the files tmac.* ("." for example).
The default is c:\\lib\\tmac under TOS and /usr/lib/tmac under
@ -57,7 +69,9 @@ Minix or Unix(tm).
.IP TMPDIR
An alternate directory to place any temporary files.
The default is the current directory.
Note that nroff does not currently use any temporary files.
Note that
.BR nroff
does not currently use any temporary files.
.SH COMMANDS
Commands typically are distinguished by a period in column one
of the input
@ -69,8 +83,8 @@ the right margin to a particular column, or the argument may be
preceded by a plus sign or a minus sign to indicate that the
parameter should be modified relative to a previous setting.
The following commands are recognized (those marked "extension"
are requests added to the basic set provided by Unix(tm) nroff):
.\"
are requests added to the basic set provided by Unix(tm)
.BR nroff ):
.IP .ad
Begin line adjustment.
If fill mode is not on, adjustment is defered until it is back on.
@ -103,7 +117,8 @@ The second format above indicates that the field width, i.e. number
of digits, is specified by the number of digits in the format type.
.\"
.IP .bd
Ignored by nroff.
Ignored by
.BR nroff .
.\"
.IP .bo (extension)
Causes the following lines of text to appear in boldface.
@ -136,7 +151,9 @@ A non-zero argument leaves them in the output.
The default is to remove backspaces.
.\"
.IP .cc
Changes the nroff command character to that specified by the
Changes the
.BR nroff
command character to that specified by the
character argument.
If no argument is provided, the default is a period (\.).
.\"
@ -145,7 +162,8 @@ Causes the next line of text to appear centered on the output.
The optional argument specifies if more than one line is to be centered.
.\"
.IP .cs
Ignored by nroff.
Ignored by
.BR nroff .
.\"
.IP .cu
Causes the next line(s) of text to be continuously underlined.
@ -156,7 +174,9 @@ Any normal underlining or boldface commands currently in effect will be
terminated.
.\"
.IP .c2
Changes the nroff no break character to that specified by the
Changes the
.BR nroff
no break character to that specified by the
character argument.
If no argument is provided, the default is a single quote.
.\"
@ -191,7 +211,9 @@ text.
Strings are stored on the macro name space.
.\"
.IP .ec
Changes the nroff escape character to that specified by the
Changes the
.BR nroff
escape character to that specified by the
character argument.
If no argument is provided, the default is a backslash.
.\"
@ -210,7 +232,9 @@ Designates the end of a macro definition.
Turn the escape mechanism off.
.\"
.IP .ex
Exit nroff at this point in the processing.
Exit
.BR nroff
at this point in the processing.
Ex forces all files closed and flushes the output.
.\"
.IP .fi
@ -260,8 +284,17 @@ Format is:
.if !"str1"str2" command
.fi
Here c is a single letter: n (true if nroff), t (true if troff), e (true
if even page), or o (true if odd page).
Here c is a single letter:
.IR n
(true if
.BR nroff ),
.IR t
(true if
.BR troff ),
.IR e
(true if even page), or
.IR o
(true if odd page).
N is a numerical experssion and can include operators +, -, *, /, % (mod),
>, <, >=, <=, = (or ==), & (and), or : (or).
If the result is greater than 0, the condition evaluates true.
@ -290,7 +323,8 @@ output in order to align or justify the right margin.
The default is to justify.
.\"
.IP .lg
Ignored by nroff.
Ignored by
.BR nroff .
.\"
.IP .ll
Sets the current line length.
@ -333,7 +367,8 @@ Margin character. The first argument is the character to use,
the second is the distance to the right of the right margin
to place the margin character. Useful for change bars.
No arguments turns the capability off. Note that with this
nroff, the margin character is always a single character only
.BR nroff ,
the margin character is always a single character only
and this distance is prefered to be in inches (e.g. 0.2i).
The default space is 0.2i (2 spaces).
.\"
@ -401,7 +436,8 @@ the number of spaces specified.
This feature may also be invoked by a switch on the command line.
.\"
.IP .ps
Ignored by nroff.
Ignored by
.BR nroff .
.\"
.IP .rr
Removes a number register.
@ -419,7 +455,8 @@ Specifies a number of blank lines to be output before
printing the next line of text.
.\"
.IP .ss
Ignored by nroff.
Ignored by
.BR nroff .
.\"
.IP .ti
Temporarily alters the indentation or left margin value for a single
@ -435,7 +472,9 @@ Unlike the \.cu command, this command causes only alphanumerics
to be underlined, skipping punctuation and white space.
Underline and boldface are mutually exclusive.
.PP
The following nroff commands, normally available, are currently
The following
.BR nroff
commands, normally available, are currently
not implemented in this version:
.cc +
\.fp, \.mk, \.rt, \.vs, \.sv, \.os, \.ns, \.rs, \.am, \.as, \.rm, \.rn,
@ -562,7 +601,9 @@ There are several missing features, notably diversions, traps,
conditionals, all the hard stuff.
This means you can't use some existing macro packages (yet, I hope).
There is no complete -ms and -me packages as a result.
The goal is to make this nroff work with all the SunOS macro packages
The goal is to make this
.BR nroff
work with all the SunOS macro packages
sometime before Unix becomes obsolete!
.PP
If you make additions to this code, please mail the changes to me so I
@ -571,6 +612,23 @@ can make formal distributions.
Undoubtedly more than I know about.
Here are a few:
.PP
[GNO] This program uses recursion, which is Not a Good Thing on the
IIgs. The
current implementation has been compiled to use 6k of stack, which
is entirely too much for a well behaved program of this size. Stack
checking has been left activated, so if you run out of stack the
worst you should get is an error message.
.PP
[GNO] The tmac.s macro package has not been reviewed recently and is
not believed to be generally usable.
.PP
[GNO] The
.BR nroff (1),
.BR man (1),
and
.BR ms (1)
man pages don\'t completely follow the GNO style guidelines.
.PP
The ability to perform numerical calculations on registers is not
implemented.
.PP
@ -590,7 +648,7 @@ write to intermediate files on small memory systems (i.e. Minix).
.SH FILES
.nf
.ec |
\lib\tmac\tmac.* predefined macros (see ENVIRONMENT)
/lib/tmac/tmac.* predefined macros (see ENVIRONMENT)
nroff.dbg debugging output
stderr default error output stream
stdout output stream
@ -599,6 +657,9 @@ stdout output stream
.fi
.SH AUTHOR
.nf
Various bug fixes for GNO by Devin Reade <gdr@myrias.com>,
March 1997.
Adapted for Atari ST (TOS) and Minix by Bill Rosenkranz 11/89
net: rosenkra@convex.com
@ -634,25 +695,33 @@ yourself to things which would port easily to other environments.
All the man macros available here should port without effort
to a more complete Unix(tm) environment.
.PP
Nroff as it stands can certainly be useful.
.BR nroff
as it stands can certainly be useful.
I recommend you don't
use the commands marked "extension".
Study the source for the man pages here (nroff(1), ms(7), and man(7)) as
well as the macro packages (tmac.an and tmac.s) and the examples to find
Study the source for the man pages
.BR nroff (1),
.BR ms (7),
and
.BR man (7)
as well as the macro packages (tmac.an and tmac.s) and the examples to find
out the quirks.
Some things may not quite work like they do under Unix(tm), but it is
fairly close for what is here.
.SH REFERENCES
This document briefly describes the workings of nroff.
This document briefly describes the workings of
.BR nroff .
It is certainly not the definitive work on text processing.
I suggest you go out and get a good book (there are several on the market)
or refer to the Unix(tm) manuals for more help.
Nroff is just like a compiler and is much more complicated than (say) the C
.BR nroff
is just like a compiler and is much more complicated than (say) the C
language which only has a handful of rules and is much more thoroughly
documented.
Good luck!
.SH REQUEST SUMMARY
The following table summarizes the nroff requests currently available:
The following table summarizes the
.BR nroff
requests currently available:
.nf
.ne 8
.cc +

View File

@ -22,14 +22,17 @@
* - Heavily hacked up to conform to "real" nroff by Bill Rosenkranz
* - Heavily modified by Devin Reade to avoid memory trashing bugs.
*
* $Id: nroff.c,v 1.1 1997/03/14 06:22:27 gdr Exp $
* $Id: nroff.c,v 1.2 1997/03/20 06:40:50 gdr Exp $
*/
#ifdef __ORCAC__
segment "main______";
#pragma stacksize 6144
#pragma optimize 79
#endif
#include <stdio.h>
#include <stdarg.h>
#include <sys/types.h>
#include <sys/time.h>
#include <time.h>
@ -40,14 +43,15 @@ segment "main______";
#ifdef __GNO__
#include <err.h>
#include <termcap.h>
#include <gno/gno.h>
#else
#include "err.h"
#include "termcap.h"
#include "unix/err.h"
#include "unix/termcap.h"
#endif
#ifdef sparc
#include <memory.h>
#include "sunos.h"
#include "unix/sunos.h"
#endif
#include "nroff.h"
@ -103,6 +107,13 @@ static char *version = "(GNO) v1.2, 5 Mar 97 gdr";
*
*************************************************************************/
#ifdef CHECK_STACK
static void
stackCleanup (void) {
fprintf(stderr, "stack usage: %d bytes\n", _endStackCheck());
}
#endif
int
main (int argc, char *argv[]) {
register int i;
@ -115,6 +126,10 @@ main (int argc, char *argv[]) {
char *ps;
#ifdef __GNO__
#ifdef CHECK_STACK
_beginStackCheck();
atexit(stackCleanup);
#endif
if (argc > 0) {
progname = __prognameGS();
} else {
@ -211,14 +226,14 @@ main (int argc, char *argv[]) {
/*
* parse cmdline flags
*/
for (i = 1; i < argc; ++i) {
for (i = 1; i < argc; ++i) {
if (*argv[i] == '-' || *argv[i] == '+') {
if (pswitch (argv[i], &swflg) == ERR) {
err_exit (-1);
}
}
}
/*
* loop on files
*/

View File

@ -1,5 +1,5 @@
Name: nroff
Version: 1.2 (17 Mar 97)
Version: 1.2 (18 Mar 97)
Shell: ORCA/Shell, GNO/ME
Author: Various. Maintained by Devin Reade.
Contact: gdr@myrias.com

View File

@ -19,11 +19,13 @@
* - Heavily hacked up to conform to "real" nroff by Bill Rosenkranz
* - Heavily modified by Devin Reade to avoid memory trashing bugs.
*
* $Id: strings.c,v 1.1 1997/03/14 06:22:29 gdr Exp $
* $Id: strings.c,v 1.2 1997/03/20 06:40:51 gdr Exp $
*/
#ifdef __ORCAC__
segment "strings___";
#pragma noroot
#pragma optimize 79
#endif
#include <stdio.h>
@ -32,11 +34,11 @@ segment "strings___";
#ifdef __GNO__
#include <err.h>
#else
#include "err.h"
#include "unix/err.h"
#endif
#ifdef sparc
#include "sunos.h"
#include "unix/sunos.h"
#endif
#include "nroff.h"

View File

@ -20,11 +20,13 @@
* - Heavily hacked up to conform to "real" nroff by Bill Rosenkranz
* - Heavily modified by Devin Reade to avoid memory trashing bugs.
*
* $Id: text.c,v 1.1 1997/03/14 06:22:29 gdr Exp $
* $Id: text.c,v 1.2 1997/03/20 06:40:51 gdr Exp $
*/
#ifdef __ORCAC__
segment "text______";
#pragma noroot
#pragma optimize 78
#endif
#include <stdio.h>
@ -33,7 +35,7 @@ segment "text______";
#ifdef __GNO__
#include <termcap.h>
#else
#include "termcap.h"
#include "unix/termcap.h"
#endif
#include "nroff.h"
@ -846,4 +848,3 @@ void
setPrinting(int val) {
co.lpr = val;
}

View File

@ -1,5 +1,5 @@
.\" set this non-zero to turn on debugging
.nr Z 1
.nr Z 0
.\" **************************************************************************
.\"
.\" -man package for nroff. not quite unix(tm), but adequate/working...
@ -11,6 +11,10 @@
.\" v1.10 7/22/90 rosenkra@convex.com (Bill Rosenkranz)
.\" freely distributable (no copyright, etc.)
.\"
.\" Modifications for GNO by Devin Reade <gdr@myrias.com>
.\"
.\" $Id: tmac.an,v 1.2 1997/03/20 06:40:51 gdr Exp $
.\"
.\" **************************************************************************
.\"
.\" some perdefined strings (quotes, etc)
@ -44,6 +48,19 @@
.if \n(mo=10 .ds Dy "Oct \n(dy
.if \n(mo=11 .ds Dy "Nov \n(dy
.if \n(mo=12 .ds Dy "Dec \n(dy
.\" Dz day month year:
.if \n(mo=1 .ds Dz "\n(dy Jan 19\n(yr
.if \n(mo=2 .ds Dz "\n(dy Feb 19\n(yr
.if \n(mo=3 .ds Dz "\n(dy Mar 19\n(yr
.if \n(mo=4 .ds Dz "\n(dy Apr 19\n(yr
.if \n(mo=5 .ds Dz "\n(dy May 19\n(yr
.if \n(mo=6 .ds Dz "\n(dy Jun 19\n(yr
.if \n(mo=7 .ds Dz "\n(dy Jul 19\n(yr
.if \n(mo=8 .ds Dz "\n(dy Aug 19\n(yr
.if \n(mo=9 .ds Dz "\n(dy Sep 19\n(yr
.if \n(mo=10 .ds Dz "\n(dy Oct 19\n(yr
.if \n(mo=11 .ds Dz "\n(dy Nov 19\n(yr
.if \n(mo=12 .ds Dz "\n(dy Dec 19\n(yr
.ds Da "\n(hh:\n(mm:\n(ss \n(mo/\n(dy/\n(yr
.ds Yr "19\n(yr
.ds DY "\*(Dy, \*(Yr
@ -55,6 +72,7 @@
.\"
.\" DW Sun
.\" Dy Mar 4
.\" Dz 4 Mar 1990
.\" DY Mar 4, 1990
.\" Yr 1990
.\" TM 16:34:00
@ -87,13 +105,15 @@
.\" ----------------------------------------------------------------------- TH
.\" main page heading
.\"
.\" fields are usually: 1-name, 2-section, 3-section name, 4-version, 5-date
.\" 1,2,3 are on header, 4,5 and page on footer. empty strings are skipped
.\" fields are usually: 1-name, 2-section, 3-date, 4-version, 5-section_name
.\" 1,2,5 are on header, 3,4 and page on footer. empty strings are skipped
.\" by making the arg "". this must be first! there is an extra field at the
.\" end ($6) which, if "ONLINE", prints the page without page breaks (i.e.
.\" headers/footers).
.\"
.\" $1 $2 $3
.\" headers/footers). If the date isn't specified, then it's prefixed by
.\" the string "Printed: ". If the version isn't given, it defaults to
.\" the string "GNO".
.\"
.\" $1 $2 $5
.\" | | |
.\" v v v
.\" NAME (1) Section NAME (1)
@ -101,9 +121,9 @@
.\" Version Date Page n
.\" ^ ^
.\" | |
.\" $4 $5
.\" $4 $3
.\"
.\" .TH NAME 1 "Commands" "Version 1.0" "7 March 1990" ["ONLINE"]
.\" .TH NAME 1 "7 March 1990" GNO "Commands and Applications" ["ONLINE"]
.\"
.\" there is an extension here: if the 6th argument is "ONLINE" then the
.\" resultant output does not have any headers/footers. this is useful for
@ -114,22 +134,29 @@
.if $2=0 .ds Se "General Information
.if $2=1 .ds Se "Commands and Applications
.if $2=2 .ds Se "System Calls
.if $2=3 .ds Se "Library Calls
.if $2=4 .ds Se "Hardware and Special Files
.if $2=3 .ds Se "Library Routines
.if "$2"3F" .ds Se "Fortran Routines
.if $2=4 .ds Se "Devices
.if $2=5 .ds Se "File Formats
.if $2=6 .ds Se "Games
.if $2=7 .ds Se "Miscellaneous
.if $2=8 .ds Se "Administation Commands
.if $2=8 .ds Se "System Administation
.ds gn "GNO
.if !"$4"" .ds gn $4
.\" if the 6th arg is "ONLINE", set up for online docs output (no head/foot)
.if !"$6"ONLINE" .pl 66
.if "$6"ONLINE" .m1 0
.if "$6"ONLINE" .m2 0
.if "$6"ONLINE" .m3 0
.if "$6"ONLINE" .m4 0
.if !"$6"ONLINE" .tl |$1 ($2)|$3|$1 ($2)|
.if !"$6"ONLINE" .if "$3"" .tl |$1 ($2)|\*(Se|$1 ($2)|
.if !"$6"ONLINE" .fo |$4|$5|Page %|
.if !"$6"ONLINE" .if "$4"" .fo |\*(CT|$5|Page %|
.if !"$6"ONLINE" .tl |$1 ($2)|$5|$1 ($2)|
.if !"$6"ONLINE" .if "$5"" .tl |$1 ($2)|\*(Se|$1 ($2)|
.if !"$6"ONLINE" .fo |\*(gn|$3|Page %|
.if !"$6"ONLINE" .if "$3"" .fo |\*(gn|Printed: \*(Dz|Page %|
.\" gdr .if !"$6"ONLINE" .tl |$1 ($2)|$3|$1 ($2)|
.\" gdr .if !"$6"ONLINE" .if "$3"" .tl |$1 ($2)|\*(Se|$1 ($2)|
.\" gdr .if !"$6"ONLINE" .fo |$4|$5|Page %|
.\" gdr .if !"$6"ONLINE" .if "$4"" .fo |\*(CT|$5|Page %|
.\" this is used by macro EX (exit)
.if "$6"ONLINE" .nr X 1
.\" change to 0.5i for "normal" nroff output...
@ -153,7 +180,7 @@
.nr X 1
..
.de UC
.if t .ds ]W GNO/ME Version 1.0
.if t .ds ]W GNO/ME Version 2.0.6
..
.\" ----------------------------------------------------------------------- EX
.\" exit NOW! (no extra space at end of document)
@ -182,9 +209,14 @@
.\" indented paragraph with tag (no clue what the difference is)
.\"
.de TP
.IP
.\" .if \n(.$ \{ $1 $2 \}
.\" .if !\n(.$ \{ \fBHAS NO ARGS\fR \}
.br
.sp 1
.\" change to 0.5i for "normal" nroff output...
.in 0.8i
\&$1 $2 $3 $4 $5 $6 $7 $8 $9
.br
.\" change to 0.5i for "normal" nroff output...
.in +0.8i
..
.\" ----------------------------------------------------------------------- IP
.\" indented paragraph with tag (from this line)
@ -275,19 +307,19 @@
.\" italic text (must handle at least 2 args)
.\"
.de I
\&\fI$1\fR$2
\&\fI$1$2$3$4$5$6\fP
..
.\" ----------------------------------------------------------------------- B
.\" bold text (must handle at least 2 args)
.\"
.de B
\&\fB$1\fR$2
\&\fB$1$2$3$4$5$6\fP
..
.\" ----------------------------------------------------------------------- R
.\" Roman text
.\"
.de R
\&\fR$1$2
\&\fR$1$2$3$4$5$6\fP
..
.\" ----------------------------------------------------------------------- IR
.\" alternate italic and Roman text (must handle at least 6 args)
@ -313,6 +345,18 @@
.de RB
\&\fR$1\fB$2\fR$3\fB$4\fR$5\fB$6\fR
..
.\" ----------------------------------------------------------------------- BI
.\" alternate bold and italic text (must handle at least 6 args)
.\"
.de BI
\&\fB$1\fR\fI$2\fR\fB$3\fR\fI$4\fR\fB$5\fR\fI$6\fR
..
.\" ----------------------------------------------------------------------- IB
.\" alternate italic and bold text (must handle at least 6 args)
.\"
.de IB
\&\fI$1\fR\fB$2\fR\fI$3\fR\fB$4\fR\fI$5\fR\fB$6\fR
..
.\" ----------------------------------------------------------------------- SM
.\" small text
.\"