home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-08-12 | 29.3 KB | 1,115 lines |
- Newsgroups: comp.sources.misc
- From: amc@wuecl.wustl.edu (Adam Costello)
- Subject: v38i116: par - paragraph reformatter, v1.20, Part03/03
- Message-ID: <1993Aug12.140716.8078@sparky.sterling.com>
- X-Md4-Signature: c69d33279cfa417133a6572245b0287f
- Sender: kent@sparky.sterling.com (Kent Landfield)
- Organization: Sterling Software
- Date: Thu, 12 Aug 1993 14:07:16 GMT
- Approved: kent@sparky.sterling.com
-
- Submitted-by: amc@wuecl.wustl.edu (Adam Costello)
- Posting-number: Volume 38, Issue 116
- Archive-name: par/part03
- Environment: ANSI-C
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of shell archive."
- # Contents: Par120 Par120/par.1 Par120/protoMakefile
- # Wrapped by amc@wuecl on Mon Aug 9 11:01:34 1993
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test ! -d 'Par120' ; then
- echo shar: Creating directory \"'Par120'\"
- mkdir 'Par120'
- fi
- if test -f 'Par120/par.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Par120/par.1'\"
- else
- echo shar: Extracting \"'Par120/par.1'\" \(25639 characters\)
- sed "s/^X//" >'Par120/par.1' <<'END_OF_FILE'
- X.\"*********************
- X.\"* par.1 *
- X.\"* for Par 1.20 *
- X.\"* Copyright 1993 by *
- X.\"* Adam M. Costello *
- X.\"*********************
- X.\"
- X.\" This is nroff -man (or troff -man) code.
- X.\"
- X.TH par 1 "10 August 1993" "Par 1.20" "USER COMMANDS"
- X.SH NAME
- Xpar \- filter for reformatting paragraphs
- X.SH SYNOPSIS
- X.ds O \fR[\fP
- X.ds C \fR]\fP
- X.de OP
- X.BI \*O\ \\$1 \\$2\ \*C
- X..
- X.TP .5i
- X.B par
- X.na
- X.OP version
- X.OP h \*Ohang\*C
- X.OP p prefix
- X.OP s suffix
- X.OP w width
- X.OP d \*Odiv\*C
- X.OP f \*Ofit\*C
- X.OP j \*Ojust\*C
- X.OP l \*Olast\*C
- X.OP t \*Otouch\*C
- X.br
- X.ad
- X.SH DESCRIPTION
- X.ie t .ds Q ``
- X.el .ds Q ""
- X.ie t .ds U ''
- X.el .ds U ""
- X.de IT
- X.LP
- X\h'-\w"\\$1\ "u'\\$1\ \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
- X..
- X.LP
- X.B par
- Xis a filter which copies its input to its output, changing
- Xall white characters (except newlines) to spaces, and
- Xreformatting each paragraph. Paragraphs are delimited
- Xby vacant lines, which are lines containing no more
- Xthan a prefix, suffix, and intervening spaces (see the
- X.SM DETAILS
- Xsection for a precise definition).
- X.LP
- XEach output paragraph is generated from
- Xthe corresponding input lines as follows:
- X.RS
- X.LP
- X.IT 1. An optional prefix and/or suffix
- Xis removed from each input line.
- X.IT 2. The remainder is divided into
- Xwords (delimited by spaces).
- X.IT 3. The words are joined into lines
- Xto make an eye-pleasing paragraph.
- X.IT 4. The prefixes and suffixes are reattached.
- X.RE
- X.LP
- XIf there are suffixes, spaces are inserted before
- Xthem so that they all end in the same column.
- X.SH TERMS
- X.TP 1i
- Xbody character
- XA member of the set of characters defined by the
- X.SM PARBODY
- Xenvironment variable (see the
- X.SM ENVIRONMENT
- Xsection).
- X.TP
- Xcomprelen
- XThe comprelen of a non-empty set of lines is the
- Xlength of the longest string of non-body characters
- Xappearing at the beginning of every line in the set.
- X.TP
- Xcomsuflen
- XGiven a non-empty set
- X.I S
- Xof lines, let
- X.I p
- Xbe the comprelen of
- X.IR S .
- XLet
- X.I T
- Xbe the set of lines which result from stripping the first
- X.I p
- Xcharacters from each line in
- X.IR S .
- XLet
- X.I c
- Xbe the longest string of non-body characters
- Xappearing at the end of every line in
- X.IR T .
- XStrip
- X.I c
- Xof all initial spaces except the last. The length of
- X.I c
- Xis the comsuflen of
- X.IR S .
- X.TP
- XIP
- XInput paragraph.
- X.TP
- XOP
- XOutput paragraph.
- X.TP
- Xwhite character
- XA space, formfeed, newline, carriage
- Xreturn, tab, or vertical tab.
- X.SH OPTIONS
- X.LP
- XAny command line argument may begin with one
- Xminus sign (\-) which is ignored. Generally, more
- Xthan one option may appear in a single command
- Xline argument, but there is one exception: the
- X.B version
- Xoption must have a whole argument all to itself.
- X.TP 1i
- X.B version
- XCauses all remaining arguments to be ignored. No input
- Xis read. \*Qpar 1.20\*U is printed on the output. Of
- Xcourse, this will change in future releases of Par.
- X.LP
- XAll remaining options are used to set values of variables.
- XValues set by command line options hold for all paragraphs
- Xin the input. Unset variables are given default values.
- XAny unset variables whose default values depend on
- Xthe IP are recomputed separately for each paragraph.
- X.LP
- XThe approximate role of each
- Xvariable is described here. See the
- X.SM DETAILS
- Xsection for a much more complete and precise description.
- X.LP
- XThe first four variables,
- X.IR hang ,
- X.IR prefix ,
- X.IR suffix ,
- Xand
- X.IR width ,
- Xmay be set to any unsigned decimal integer less than 10000.
- X.TP 1i
- X.BI h\fR[ hang\fR]
- XMainly affects the default values of
- X.I prefix
- Xand
- X.IR suffix .
- XDefaults to 0. If the
- X.B h
- Xoption is given without a number, the
- Xvalue 1 is inferred. (See also the
- X.B p
- Xand
- X.B s
- Xoptions.)
- X.TP
- X.BI p prefix
- XThe first
- X.I prefix
- Xcharacters of each line of the OP are copied from the first
- X.I prefix
- Xcharacters of the corresponding line
- Xof the IP. Defaults to 0 if there are
- Xless than
- X.IR hang \ +\ 2
- Xlines in the IP. Otherwise, defaults to the comprelen
- Xof all the lines in the IP except the first
- X.I hang
- Xof them. (See also the
- X.B h
- Xoption.)
- X.TP
- X.BI s suffix
- XThe last
- X.I suffix
- Xcharacters of each line of the OP are copied from the last
- X.I suffix
- Xcharacters of the corresponding line of the
- XIP. Defaults to 0 if there are less than
- X.IR hang \ +\ 2
- Xlines in the IP.
- XOtherwise, defaults to the comsuflen of
- Xall the lines of the IP except the first
- X.I hang
- Xof them. (See also the
- X.B h
- Xoption.)
- X.TP
- X.BI w width
- XNo line in the OP will contain more than
- X.I width
- Xcharacters, not including the
- Xtrailing newlines. Defaults to 72.
- X.LP
- XThe remaining five variables,
- X.IR div,
- X.IR fit,
- X.IR just,
- X.IR last,
- Xand
- X.IR touch,
- Xmay be set to either 0 or 1. If the number is
- Xabsent in the option, the value 1 is inferred.
- X.TP 1i
- X.BI d\fR[ div\fR]
- XIf
- X.I div
- Xis 1, then each block of text that would normally count
- Xas a paragraph (delimited by vacant lines) will be
- Xfurther subdivided into paragraphs as follows. Let
- X.I p
- Xbe the comprelen of all the lines in the
- Xblock. Let a line's status be 1 if its
- X.RI ( p \ +\ 1)st
- Xcharacter is a space, 0 otherwise. Every line in the
- Xblock whose status is the same as the status of the
- Xfirst line will begin a new paragraph. Defaults to 0.
- X.TP
- X.BI f\fR[ fit\fR]
- XIf
- X.I fit
- Xis 1 and
- X.I just
- Xis 0,
- X.B par
- Xwill try to make the lines in the OP as nearly the
- Xsame length as possible, even if it means making
- Xthe OP narrower. Defaults to 0. (See also the
- X.B j
- Xoption.)
- X.TP
- X.BI j\fR[ just\fR]
- XIf
- X.I just
- Xis 1,
- X.B par
- Xjustifies the OP, inserting spaces between words
- Xso that all lines in the OP have length
- X.I width
- X(except the last, if
- X.I last
- Xis 0).
- X.I fit
- Xhas no effect if
- X.I just
- Xis 1. Defaults to 0. (See also the
- X.BR w ,
- X.BR l ,
- Xand
- X.B f
- Xoptions.)
- X.TP
- X.BI l\fR[ last\fR]
- XIf
- X.I last
- Xis 1,
- X.B par
- Xtries to make the last line of the OP about
- Xthe same length as the others. Defaults to 0.
- X.TP
- X.BI t\fR[ touch\fR]
- XHas no effect if
- X.I suffix
- Xis 0 or
- X.I just
- Xis 1. Otherwise, if
- X.I touch
- Xis 0, all lines in the OP have length
- X.IR width .
- XIf
- X.I touch
- Xis 1, then the length of the lines is decreased until the
- Xsuffixes touch the body of the OP. Defaults to the logical
- X.SM OR
- Xof
- X.I fit
- Xand
- X.IR last .
- X(See also the
- X.BR s ,
- X.BR j ,
- X.BR w ,
- X.BR f ,
- Xand
- X.B l
- Xoptions.)
- X.LP
- XIf the value of any variable is set more
- Xthan once, the last value is used. When
- Xunset variables are assigned default values,
- X.I hang
- Xis assigned before
- X.IR prefix ,
- Xand
- X.I fit
- Xand
- X.I last
- Xare assigned before
- X.I touch
- X(because of the dependencies).
- X.LP
- XIt is an error if
- X.I width
- X<=
- X.I prefix
- X+
- X.IR suffix .
- X.SH ENVIRONMENT
- X.TP 1i
- X.SM PARINIT
- XIf set,
- X.B par
- Xwill read command line options from
- X.SM PARINIT
- Xbefore it reads them from the command line.
- X.TP
- X.SM PARBODY
- XAll and only the characters appearing in the value of
- X.SM PARBODY
- Xcount as body characters (which are used for determining
- Xcomprelens and comsuflens). The underscore is an escape
- Xcharacter, which may begin the following escape sequences:
- X.RS 2i
- X.IT __\ = an underscore
- X.IT _s\ = a space
- X.IT _A\ = all upper case characters
- X.IT _a\ = all lower case characters
- X.IT _0\ = all decimal digits
- X.IT _x\fIhh\fP\ = the character represented
- Xby the two hexadecimal digits
- X.I hh
- X(which may be upper or lower case)
- X.RE
- X.RS 1i
- X.LP
- XIf
- X.SM PARBODY
- Xis not set, there are no body characters.
- X.LP
- XA good value for
- X.SM PARBODY
- Xmight be \*Q_a_A.\*U, but it depends on the application.
- X.RE
- X.LP
- XIf a
- X.SM NUL
- Xcharacter appears in the value of an environment variable,
- Xit and the rest of the string will not be seen by
- X.BR par .
- X.SH DETAILS
- X.LP
- XEvery white
- Xcharacter in the input (unless it is a newline)
- Xis changed into a space immediately after it
- Xhas been read. NUL characters in the input are
- Xinvisible, just as if they weren't there at all.
- X.LP
- XLines are terminated by newline characters, but the
- Xnewlines are not considered to be included in the lines.
- XIf the last character of the input is a non-newline,
- Xthen a newline will be inferred immediately after
- Xit (but if the input is empty, no newline will be
- Xinferred; the number of input lines will be 0). Thus,
- Xthe input can always be viewed as a sequence of lines.
- X.LP
- XVacant lines in the input are defined
- Xrecursively by the following rules:
- X.RS
- X.IT 1) Any line which is empty or
- Xcontains only spaces is vacant.
- X.IT 2) Suppose
- X.I A
- Xand
- X.I B
- Xare two vacant lines with at
- Xleast two lines between them. Let
- X.I p
- Xand
- X.I s
- Xbe the comprelen and comsuflen of the intervening
- Xlines. Any intervening line which, if stripped of
- Xits first
- X.I p
- Xcharacters and last
- X.I s
- Xcharacters, would be empty, or would
- Xcontain only spaces, is vacant.
- X.IT 3) If a line cannot be shown to
- Xbe vacant by repeated application of
- Xrules 1 and 2, then it is not vacant.
- X.RE
- X.LP
- XA subsequence of non-vacant lines in the input is called
- Xa block if there is no non-vacant line immediately
- Xabove or below it (i.e., if it is maximal). If
- X.I div
- Xis 0, then the IPs are exactly the blocks. If
- X.I div
- Xis 1, then the IPs are the subdivisions
- Xof the blocks as described in the
- X.SM OPTIONS
- Xsection in the entry for
- X.IR div .
- X.LP
- XEach vacant line of the input is copied to the
- Xoutput unchanged except that any trailing spaces
- Xare stripped. The remainder of this section
- Xdescribes the process which is applied independently
- Xto each IP to construct the corresponding OP.
- X.LP
- XAfter the values of the variables are determined (see the
- X.SM OPTIONS
- Xsection), the first
- X.I prefix
- Xcharacters and the last
- X.I suffix
- Xcharacters of each input line are removed and remembered.
- XIt is an error for any line to contain fewer than
- X.IR prefix \ +\ suffix
- Xcharacters.
- X.LP
- XThe remaining text is treated as a sequence of
- Xcharacters, not lines. The text is broken into
- Xwords, which are delimited by spaces. That is, a
- X.I word
- Xis a maximal sub-sequence of non-spaces. If
- Xthere is at least one word, and the first word
- Xis preceeded only by spaces, then the first
- Xword is expanded to include those spaces.
- X.LP
- XLet
- X.I L
- X=
- X.I width
- X\-
- X.I prefix
- X\-
- X.IR suffix .
- X.LP
- XEvery word which contains more than
- X.I L
- Xcharacters is broken, after each
- X.IR L th
- Xcharacter, into multiple words.
- X.LP
- XThese words are reassembled, preserving their
- Xorder, into lines. If
- X.I just
- Xis 0, adjacent words within a line are separated by
- Xa single space, and line breaks are chosen so that
- Xthe paragraph satisfies the following properties:
- X.RS 1i
- X.IT 1) No line contains more than
- X.I L
- Xcharacters.
- X.IT 2) If
- X.I fit
- Xis 1, the difference between the lengths of the
- Xshortest and longest lines is as small as possible.
- X.IT 3) The shortest line is as long as
- Xpossible, subject to properties 1 and 2.
- X.IT 4) Let
- X.I target
- Xbe
- X.I L
- Xif
- X.I fit
- Xis 0, or the length of the longest line if
- X.I fit
- Xis 1. The sum of the squares of the differences between
- X.I target
- Xand the lengths of the lines is as small as
- Xpossible, subject to properties 1, 2, and 3.
- X.RE
- X.RS .5i
- X.LP
- XIf
- X.I last
- Xis 0, then the last line does not count as a line
- Xfor the purposes of properties 2, 3, and 4 above.
- X.LP
- XIf all the words fit on a single line, then
- Xthe properties as worded above don't make much
- Xsense. In that case, no line breaks are inserted.
- X.RE
- X.LP
- XIf
- X.I just
- Xis 1, then adjacent words within a line are separated by
- Xone space plus zero or more extra spaces, the value of
- X.I fit
- Xis disregarded, and line breaks are chosen so that
- Xthe paragraph satisfies the following properties:
- X.RS 1i
- X.IT 1) Every line contains exactly
- X.I L
- Xcharacters.
- X.IT 2) The largest inter-word gap is as
- Xsmall as possible, subject to property 1.
- X.IT 3) The sum of the squares of the numbers
- Xof extra spaces required in each inter-word gap is
- Xas small as possible, subject to properties 1 and 2.
- X.RE
- X.RS .5i
- X.LP
- XIf
- X.I last
- Xis 0, then the last line does not count as a
- Xline for the purposes of property 1, and it
- Xdoes not require or contain any extra spaces.
- X.LP
- XExtra spaces are distributed as uniformly as
- Xpossible among the inter-word gaps in each line.
- X.LP
- XSome paragraphs are impossible to justify,
- Xbecause they contain words too long relative to
- X.IR L .
- XIf this is the case, it is considered an error (see the
- X.SM DIAGNOSTICS
- Xsection).
- X.RE
- X.LP
- XIf the number of lines in the
- Xresulting paragraph is less than
- X.IR hang ,
- Xthen empty lines are added at the end
- Xto bring the number of lines up to
- X.IR hang .
- X.LP
- XIf
- X.I just
- Xis 0 and
- X.I touch
- Xis 1, then
- X.I L
- Xis changed to be the length of the longest line.
- X.LP
- XIf
- X.I suffix
- Xis not 0, then each line is padded at the
- Xend with spaces to bring its length up to
- X.IR L .
- X.LP
- XTo each line is prepended
- X.I prefix
- Xcharacters. Let
- X.I n
- Xbe the number of lines in the IP. The
- Xcharacters which are prepended to the
- X.IR i th
- Xline are chosen as follows:
- X.RS
- X.LP
- X.IT 1) If
- X.I i
- X<=
- X.IR n ,
- Xthen the characters are copied from the ones
- Xthat were removed from the beginning of the
- X.IR n th
- Xinput line.
- X.IT 2) If
- X.I i
- X>
- X.I n
- X>
- X.IR hang ,
- Xthen the characters are copied from the ones that were
- Xremoved from the beginning of the last input line.
- X.IT 3) If
- X.I i
- X>
- X.I n
- Xand
- X.I n
- X<=
- X.IR hang ,
- Xthen the characters are all spaces.
- X.RE
- X.LP
- XThen to each line is appended
- X.I suffix
- Xcharacters. The characters which are appended to the
- X.IR i th
- Xline are chosen as follows:
- X.RS
- X.LP
- X.IT 1) If
- X.I i
- X<=
- X.IR n ,
- Xthen the characters are copied from the
- Xones that were removed from the end of the
- X.IR n th
- Xinput line.
- X.IT 2) If
- X.I i
- X>
- X.I n
- X> 0, then the characters are copied from the ones that
- Xwere removed from the end of the last input line.
- X.IT 3) If
- X.I n
- X= 0, then the characters are all spaces.
- X.RE
- X.LP
- XFinally, the lines are printed to the output as the OP.
- X.SH DIAGNOSTICS
- X.LP
- XIf there are no errors,
- X.B par
- Xreturns
- X.SM EXIT_SUCCESS
- X(see
- X.BR <stdlib.h> ).
- X.LP
- XIf there is an error, then an error
- Xmessage will be printed to the output, and
- X.B par
- Xwill return
- X.SM EXIT_FAILURE\s0\.
- XIf the error is local to a single paragraph, then the
- Xpreceeding paragraphs will have been output before the
- Xerror was detected. Line numbers in error messages are
- Xlocal to the IP in which the error occurred. All error
- Xmessages begin with "par error:" on a line by itself.
- X.LP
- XOf course, trying to print an error message would be
- Xfutile if an error resulted from an output function, so
- X.B par
- Xdoesn't bother doing any error checking on output functions.
- X.SH EXAMPLES
- X.de VS
- X.RS -.5i
- X.LP
- X.nf
- X.ps -1p
- X.vs -2p
- X.cs R 20
- X..
- X.de VE
- X.cs R
- X.vs
- X.ps
- X.fi
- X.RE
- X..
- X.de CM
- X\&\*Q\fB\\$1\fP\\*U:
- X..
- X.LP
- XThe superiority of
- X.BR par 's
- Xdynamic programming algorithm over a
- Xgreedy algorithm (such as the one used by
- X.BR fmt )
- Xcan be seen in the following example:
- X.LP
- XOriginal paragraph (note that
- Xeach line begins with 8 spaces):
- X.VS
- X We the people of the United States,
- X in order to form a more perfect union,
- X establish justice,
- X insure domestic tranquility,
- X provide for the common defense,
- X promote the general welfare,
- X and secure the blessing of liberty
- X to ourselves and our posterity,
- X do ordain and establish the Constitution
- X of the United States of America.
- X.VE
- X.LP
- XAfter a greedy algorithm with width = 39:
- X.VS
- X We the people of the United
- X States, in order to form a more
- X perfect union, establish
- X establish justice, insure
- X domestic tranquility, provide
- X for the common defense, promote
- X the general welfare, and secure
- X the blessing of liberty to
- X ourselves and our posterity, do
- X ordain and establish the
- X Constitution of the United
- X States of America.
- X.VE
- X.LP
- XAfter
- X.CM "par 39"
- X.VS
- X We the people of the United
- X States, in order to form a
- X more perfect union, establish
- X justice, insure domestic
- X tranquility, provide for the
- X common defense, promote the
- X general welfare, and secure
- X the blessing of liberty to
- X ourselves and our posterity,
- X do ordain and establish the
- X Constitution of the United
- X States of America.
- X.VE
- X.LP
- XThe line breaks chosen by
- X.B par
- Xare clearly more eye-pleasing.
- X.LP
- X.B par
- Xis most useful in conjunction with the text-filtering
- Xfeatures of an editor, such as the ! commands of
- X.BR vi.
- X.LP
- XThe rest of this section is a series of
- Xbefore-and-after pictures showing some typical uses of
- X.BR par .
- X.LP
- XBefore:
- X.VS
- X /* We the people of the United States, */
- X /* in order to form a more perfect union, */
- X /* establish justice, */
- X /* insure domestic tranquility, */
- X /* provide for the common defense, */
- X /* promote the general welfare, */
- X /* and secure the blessing of liberty */
- X /* to ourselves and our posterity, */
- X /* do ordain and establish the Constitution */
- X /* of the United States of America. */
- X.VE
- X.LP
- XAfter
- X.CM "par 59"
- X.VS
- X /* We the people of the United States, in */
- X /* order to form a more perfect union, establish */
- X /* justice, insure domestic tranquility, provide */
- X /* for the common defense, promote the general */
- X /* welfare, and secure the blessing of liberty */
- X /* to ourselves and our posterity, do ordain */
- X /* and establish the Constitution of the United */
- X /* States of America. */
- X.VE
- X.LP
- XOr after
- X.CM "par 59f"
- X.VS
- X /* We the people of the United States, */
- X /* in order to form a more perfect union, */
- X /* establish justice, insure domestic */
- X /* tranquility, provide for the common */
- X /* defense, promote the general welfare, */
- X /* and secure the blessing of liberty to */
- X /* ourselves and our posterity, do ordain */
- X /* and establish the Constitution of the */
- X /* United States of America. */
- X.VE
- X.LP
- XOr after
- X.CM "par 59l"
- X.VS
- X /* We the people of the United States, in */
- X /* order to form a more perfect union, establish */
- X /* justice, insure domestic tranquility, */
- X /* provide for the common defense, promote */
- X /* the general welfare, and secure the */
- X /* blessing of liberty to ourselves and our */
- X /* posterity, do ordain and establish the */
- X /* Constitution of the United States of America. */
- X.VE
- X.LP
- XOr after
- X.CM "par 59lf"
- X.VS
- X /* We the people of the United States, */
- X /* in order to form a more perfect union, */
- X /* establish justice, insure domestic */
- X /* tranquility, provide for the common */
- X /* defense, promote the general welfare, */
- X /* and secure the blessing of liberty */
- X /* to ourselves and our posterity, do */
- X /* ordain and establish the Constitution */
- X /* of the United States of America. */
- X.VE
- X.LP
- XOr after
- X.CM "par 59lft0"
- X.VS
- X /* We the people of the United States, */
- X /* in order to form a more perfect union, */
- X /* establish justice, insure domestic */
- X /* tranquility, provide for the common */
- X /* defense, promote the general welfare, */
- X /* and secure the blessing of liberty */
- X /* to ourselves and our posterity, do */
- X /* ordain and establish the Constitution */
- X /* of the United States of America. */
- X.VE
- X.LP
- XOr after
- X.CM "par 59j"
- X.VS
- X /* We the people of the United States, in */
- X /* order to form a more perfect union, establish */
- X /* justice, insure domestic tranquility, provide */
- X /* for the common defense, promote the general */
- X /* welfare, and secure the blessing of liberty */
- X /* to ourselves and our posterity, do ordain and */
- X /* establish the Constitution of the United */
- X /* States of America. */
- X.VE
- X.LP
- XOr after
- X.CM "par 59jl"
- X.VS
- X /* We the people of the United States, */
- X /* in order to form a more perfect */
- X /* union, establish justice, insure domestic */
- X /* tranquility, provide for the common defense, */
- X /* promote the general welfare, and secure */
- X /* the blessing of liberty to ourselves and */
- X /* our posterity, do ordain and establish the */
- X /* Constitution of the United States of America. */
- X.VE
- X.LP
- XBefore:
- X.VS
- X Preamble We the people of the United States,
- X to the US in order to form
- X Constitution a more perfect union,
- X establish justice,
- X insure domestic tranquility,
- X provide for the common defense,
- X promote the general welfare,
- X and secure the blessing of liberty
- X to ourselves and our posterity,
- X do ordain and establish
- X the Constitution
- X of the United States of America.
- X.VE
- X.LP
- XAfter
- X.CM "par 52h3"
- X.VS
- X Preamble We the people of the United
- X to the US States, in order to form a
- X Constitution more perfect union, establish
- X justice, insure domestic
- X tranquility, provide for the
- X common defense, promote the
- X general welfare, and secure
- X the blessing of liberty to
- X ourselves and our posterity,
- X do ordain and establish the
- X Constitution of the United
- X States of America.
- X.VE
- X.LP
- XBefore:
- X.VS
- X 1 We the people of the United States,
- X 2 in order to form a more perfect union,
- X 3 establish justice,
- X 4 insure domestic tranquility,
- X 5 provide for the common defense,
- X 6 promote the general welfare,
- X 7 and secure the blessing of liberty
- X 8 to ourselves and our posterity,
- X 9 do ordain and establish the Constitution
- X 10 of the United States of America.
- X.VE
- X.LP
- XAfter
- X.CM "par 59p12l"
- X.VS
- X 1 We the people of the United States, in order to
- X 2 form a more perfect union, establish justice,
- X 3 insure domestic tranquility, provide for the
- X 4 common defense, promote the general welfare,
- X 5 and secure the blessing of liberty to ourselves
- X 6 and our posterity, do ordain and establish the
- X 7 Constitution of the United States of America.
- X.VE
- X.LP
- XBefore:
- X.VS
- X > > We the people of the United States, in
- X > > order to form a more perfect union,
- X > > Establish justice, ensure domestic
- X > > tranquility, provide for the common defense,
- X >
- X > Promote the general welfare, and secure
- X > the blessing of liberty to ourselves and
- X > our posterity,
- X > Do ordain and establish the Constitution
- X > of the United States of America.
- X.VE
- X.LP
- XAfter
- X.CM "par 42d"
- X.VS
- X > > We the people of the United
- X > > States, in order to form a
- X > > more perfect union,
- X > > Establish justice, ensure
- X > > domestic tranquility, provide
- X > > for the common defense,
- X >
- X > Promote the general welfare,
- X > and secure the blessing of
- X > liberty to ourselves and our
- X > posterity,
- X > Do ordain and establish the
- X > Constitution of the United
- X > States of America.
- X.VE
- X.SH SEE ALSO
- X.LP
- X.B par.doc
- X.SH LIMITATIONS
- X.LP
- XIf you like two spaces between sentences, too
- Xbad. Differentiating between periods that end
- Xsentences and periods used in abbreviations
- Xis a complex problem beyond the scope of this
- Xsimple filter. Consider the following tough case:
- X.VS
- X I calc'd the approx.
- X Fermi level to 3 sig. digits.
- X.VE
- X.LP
- XSuppose that that should be reformatted to:
- X.VS
- X I calc'd the approx. Fermi
- X level to three sig. digits.
- X.VE
- X.LP
- XThe program has to decide whether to put 1 or 2 spaces
- Xbetween \*Qapprox.\*U and \*QFermi\*U. There is no obvious
- Xhint from the original paragraph because there was a line
- Xbreak between them, and \*QFermi\*U begins with a capital
- Xletter. The program would apparently have to understand
- XEnglish grammar to determine that the sentence does not
- Xend there (and then it would only work for English text).
- X.LP
- XIf you use tabs, you probably won't like the way
- X.B par
- Xhandles
- X(or doesn't handle) them. It turns them into spaces. I
- Xdidn't bother trying to make sense of tabs because they
- Xdon't make sense to begin with. Not everyone's terminal
- Xhas the same tab settings, so text files containing
- Xtabs are sometimes mangled. In fact, almost every text
- Xfile containing tabs gets mangled when something is
- Xinserted at the beginning of each line (when quoting
- Xe-mail or commenting out a section of a shell script, for
- Xexample), making them a pain to edit. In my opinion, the
- Xworld would be a nicer place if everyone stopped using
- Xtabs (so I'm doing my part by not supporting them in
- X.BR par .)
- X.LP
- XThere is currently no way for the length of the
- Xoutput prefix to differ from the length of the
- Xinput prefix. Ditto for the suffix. I may consider
- Xadding this capability in a future release, but
- Xright now I'm not sure how I'd want it to work.
- X.SH BUGS
- X.LP
- XIf I knew of any bugs, I wouldn't release the package. Of
- Xcourse, there may be bugs that I haven't yet discovered.
- X.LP
- XIf you find any bugs, or if you have
- Xany suggestions, please send e-mail to:
- X.RS
- X.LP
- Xamc@ecl.wustl.edu
- X.RE
- X.LP
- Xor send paper mail to:
- X.RS
- X.LP
- X.nf
- XAdam M. Costello
- XCampus Box 1045
- XWashington University
- XOne Brookings Dr.
- XSt. Louis, MO 63130
- XUSA
- X.fi
- X.RE
- X.LP
- XNote that both addresses could
- Xchange anytime after June 1994.
- X.LP
- XWhen reporting a bug, please include the exact input and
- Xcommand line options used, and the version number of
- X.BR par ,
- Xso that I can reproduce it.
- END_OF_FILE
- if test 25639 -ne `wc -c <'Par120/par.1'`; then
- echo shar: \"'Par120/par.1'\" unpacked with wrong size!
- fi
- # end of 'Par120/par.1'
- fi
- if test -f 'Par120/protoMakefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Par120/protoMakefile'\"
- else
- echo shar: Extracting \"'Par120/protoMakefile'\" \(1285 characters\)
- sed "s/^X//" >'Par120/protoMakefile' <<'END_OF_FILE'
- X# *********************
- X# * protoMakefile *
- X# * for Par 2.10 *
- X# * Copyright 1993 by *
- X# * Adam M. Costello *
- X# *********************
- X
- X
- X# Define CC so that the command
- X# $(CC) foo.c
- X# compiles the ANSI C source file "foo.c" into the object file "foo.o".
- X# You may assume that foo.c uses no floating point math.
- X#
- X# If your operating system or your compiler's exit() function automatically
- X# frees all memory allocated by malloc() when a process terminates, then you
- X# can choose to trade away space efficiency for time efficiency by defining
- X# DONTFREE.
- X#
- X# Example (for Solaris 2.2):
- X# CC = cc -c -O -s -Xc -DDONTFREE
- X
- XCC =
- X
- X# Define LINK1 and LINK2 so that the command
- X# $(LINK1) foo1.o foo2.o foo3.o $(LINK2) foo
- X# links the object files "foo1.o", "foo2.o", "foo3.o"
- X# into the executable file "foo".
- X# You may assume that none of the .o files use floating point math.
- X#
- X# Example (for Solaris 2.2):
- X# LINK1 = cc -s
- X# LINK2 = -o
- X
- XLINK1 =
- XLINK2 =
- X
- X# You shouldn't need to modify anything below this line.
- X
- XOBJS = buffer.o errmsg.o par.o reformat.o
- X
- X.c.o:
- X $(CC) $<
- X
- Xpar: $(OBJS)
- X $(LINK1) $(OBJS) $(LINK2) par
- X
- Xbuffer.o: buffer.c buffer.h errmsg.h
- X
- Xerrmsg.o: errmsg.c errmsg.h
- X
- Xpar.o: par.c errmsg.h buffer.h reformat.h
- X
- Xreformat.o: reformat.c reformat.h buffer.h errmsg.h
- END_OF_FILE
- if test 1285 -ne `wc -c <'Par120/protoMakefile'`; then
- echo shar: \"'Par120/protoMakefile'\" unpacked with wrong size!
- fi
- # end of 'Par120/protoMakefile'
- fi
- echo shar: End of shell archive.
- exit 0
-
- exit 0 # Just in case...
-