home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume40 / par / part01 < prev    next >
Encoding:
Text File  |  1993-11-09  |  60.0 KB  |  1,637 lines

  1. Newsgroups: comp.sources.misc
  2. From: amc@wuecl.wustl.edu (Adam Costello)
  3. Subject: v40i124:  par - paragraph reformatter, v1.41, Part01/03
  4. Message-ID: <csm-v40i124=par.112700@sparky.Sterling.COM>
  5. X-Md4-Signature: 0a1584bccf46f27009323ca5f11dbd57
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Tue, 9 Nov 1993 17:27:25 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: amc@wuecl.wustl.edu (Adam Costello)
  12. Posting-number: Volume 40, Issue 124
  13. Archive-name: par/part01
  14. Environment: ANSI-C
  15. Supersedes: par131: Volume 39, Issue 83-85
  16.  
  17. Par 1.41 is a package containing documentation and ANSI C source code
  18. for the filter "par".
  19.  
  20. par is a paragraph reformatter, vaguely similar to fmt, but better.
  21.  
  22. For example, the command "par 44gqr", given the input:
  23.  
  24.         John Q. Public writes:
  25.         > Jane Doe writes:
  26.         > >
  27.         > > May I remind people that this newsgroup
  28.         > > is for posting binaries only.  Please keep
  29.         > > all discussion in .d where it belongs.
  30.         > Who appointed you net.god?
  31.         > I'll discuss things here if I feel like it.
  32.         Could you two please take this to e-mail?
  33.  
  34.         **********************************************
  35.         ** Main's Law: For every action there is an **
  36.         ** equal and opposite government program.   **
  37.         **********************************************
  38.  
  39. Would produce the output:
  40.  
  41.         John Q. Public writes:
  42.  
  43.         > Jane Doe writes:
  44.         >
  45.         > > May I remind people that this
  46.         > > newsgroup is for posting
  47.         > > binaries only.  Please keep
  48.         > > all discussion in .d where it
  49.         > > belongs.
  50.         >
  51.         > Who appointed you net.god?  I'll
  52.         > discuss things here if I feel like
  53.         > it.
  54.  
  55.         Could you two please take this to
  56.         e-mail?
  57.  
  58.         ************************************
  59.         ** Main's Law: For every action   **
  60.         ** there is an equal and opposite **
  61.         ** government program.            **
  62.         ************************************
  63.  
  64. Be sure to read "par.doc".
  65.  
  66. AMC
  67. amc@ecl.wustl.edu (Adam M. Costello)
  68. ------------
  69. #! /bin/sh
  70. # This is a shell archive.  Remove anything before this line, then unpack
  71. # it by saving it into a file and typing "sh file".  To overwrite existing
  72. # files, type "sh file -c".  You can also feed this as standard input via
  73. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  74. # will see the following message at the end:
  75. #        "End of shell archive."
  76. # Contents:  Par141 Par141/errmsg.c Par141/errmsg.h Par141/buffer.c
  77. #   Par141/par.doc
  78. # Wrapped by amc@siesta on Sun Oct 31 01:25:10 1993
  79. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  80. if test ! -d 'Par141' ; then
  81.     echo shar: Creating directory \"'Par141'\"
  82.     mkdir 'Par141'
  83. fi
  84. if test -f 'Par141/errmsg.c' -a "${1}" != "-c" ; then 
  85.   echo shar: Will not clobber existing file \"'Par141/errmsg.c'\"
  86. else
  87. echo shar: Extracting \"'Par141/errmsg.c'\" \(400 characters\)
  88. sed "s/^X//" >'Par141/errmsg.c' <<'END_OF_FILE'
  89. X/*********************/
  90. X/* errmsg.c          */
  91. X/* for Par 1.41      */
  92. X/* Copyright 1993 by */
  93. X/* Adam M. Costello  */
  94. X/*********************/
  95. X
  96. X/* This is ANSI C code. */
  97. X
  98. X
  99. X#include "errmsg.h"  /* Makes sure we're consistent with the declarations. */
  100. X
  101. X
  102. Xconst char * const outofmem =
  103. X  "Out of memory.\n";
  104. X
  105. Xconst char * const impossibility =
  106. X  "Impossibility #%d has occurred.  Please report it.\n";
  107. END_OF_FILE
  108. if test 400 -ne `wc -c <'Par141/errmsg.c'`; then
  109.     echo shar: \"'Par141/errmsg.c'\" unpacked with wrong size!
  110. fi
  111. # end of 'Par141/errmsg.c'
  112. fi
  113. if test -f 'Par141/errmsg.h' -a "${1}" != "-c" ; then 
  114.   echo shar: Will not clobber existing file \"'Par141/errmsg.h'\"
  115. else
  116. echo shar: Extracting \"'Par141/errmsg.h'\" \(977 characters\)
  117. sed "s/^X//" >'Par141/errmsg.h' <<'END_OF_FILE'
  118. X/*********************/
  119. X/* errmsg.h          */
  120. X/* for Par 1.41      */
  121. X/* Copyright 1993 by */
  122. X/* Adam M. Costello  */
  123. X/*********************/
  124. X
  125. X/* This is ANSI C code. */
  126. X
  127. X
  128. X#ifndef ERRMSG_H
  129. X#define ERRMSG_H
  130. X
  131. X
  132. X#define errmsg_size 163
  133. X
  134. X/* This is the maximum number of characters that will  */
  135. X/* fit in an errmsg_t, including the terminating '\0'. */
  136. X/* It will never decrease, but may increase in future  */
  137. X/* versions of this header file.                       */
  138. X
  139. X
  140. Xtypedef char errmsg_t[errmsg_size];
  141. X
  142. X/* Any function which takes the argument errmsg_t errmsg must, before */
  143. X/* returning, either set errmsg[0] to '\0' (indicating success), or   */
  144. X/* write an error message string into errmsg, (indicating failure),   */
  145. X/* being careful not to overrun the space.                            */
  146. X
  147. X
  148. Xextern const char * const outofmem;
  149. X  /* "Out of memory.\n" */
  150. X
  151. Xextern const char * const impossibility;
  152. X  /* "Impossibility #%d has occurred.  Please report it.\n" */
  153. X
  154. X
  155. X#endif
  156. END_OF_FILE
  157. if test 977 -ne `wc -c <'Par141/errmsg.h'`; then
  158.     echo shar: \"'Par141/errmsg.h'\" unpacked with wrong size!
  159. fi
  160. # end of 'Par141/errmsg.h'
  161. fi
  162. if test -f 'Par141/buffer.c' -a "${1}" != "-c" ; then 
  163.   echo shar: Will not clobber existing file \"'Par141/buffer.c'\"
  164. else
  165. echo shar: Extracting \"'Par141/buffer.c'\" \(4554 characters\)
  166. sed "s/^X//" >'Par141/buffer.c' <<'END_OF_FILE'
  167. X/*********************/
  168. X/* buffer.c          */
  169. X/* for Par 1.41      */
  170. X/* Copyright 1993 by */
  171. X/* Adam M. Costello  */
  172. X/*********************/
  173. X
  174. X/* This is ANSI C code. */
  175. X
  176. X
  177. X/* additem(), copyitems(), and nextitem() rely on the fact that */
  178. X/* sizeof (char) is 1.  See section A7.4.8 of The C Programming */
  179. X/* Language, Second Edition, by Kerninghan and Ritchie.         */
  180. X
  181. X
  182. X#include "buffer.h"  /* Makes sure we're consistent with the prototypes. */
  183. X                     /* Also includes <stddef.h> and "errmsg.h".         */
  184. X
  185. X#include <stdlib.h>
  186. X#include <string.h>
  187. X
  188. X#undef NULL
  189. X#define NULL ((void *) 0)
  190. X
  191. X#ifdef DONTFREE
  192. X#define free(ptr)
  193. X#endif
  194. X
  195. X
  196. Xstruct buffer {
  197. X  struct block *firstblk, /* The first block.                    */
  198. X               *current,  /* The last non-empty block, or        */
  199. X                          /* firstblk if all are empty.          */
  200. X               *nextblk;  /* The block containing the item to be */
  201. X                          /* returned by nextitem(), or NULL.    */
  202. X  int nextindex;          /* Index of item in nextblock->items.  */
  203. X  size_t itemsize;        /* The size of an item.                */
  204. X};
  205. X
  206. Xtypedef struct block {
  207. X  struct block *next;  /* The next block, or NULL if none.              */
  208. X  void *items;         /* Storage for the items in this block.          */
  209. X  int maxhere,         /* Number of items that fit in *items.           */
  210. X      numprevious,     /* Total of numhere for all previous blocks.     */
  211. X      numhere;         /* The first numhere slots in *items are filled. */
  212. X} block;
  213. X
  214. X
  215. Xbuffer *newbuffer(size_t itemsize, errmsg_t errmsg)
  216. X{
  217. X  buffer *buf;
  218. X  block *blk;
  219. X  void *items;
  220. X  int maxhere;
  221. X
  222. X  maxhere = 124 / itemsize;
  223. X  if (maxhere < 4) maxhere = 4;
  224. X
  225. X  buf = (buffer *) malloc(sizeof (buffer));
  226. X  blk = (block *) malloc(sizeof (block));
  227. X  items = malloc(maxhere * itemsize);
  228. X  if (!buf || !blk || !items) {
  229. X    strcpy(errmsg,outofmem);
  230. X    goto nberror;
  231. X  }
  232. X
  233. X  buf->itemsize = itemsize;
  234. X  buf->firstblk = buf->current = buf->nextblk = blk;
  235. X  buf->nextindex = 0;
  236. X  blk->next = NULL;
  237. X  blk->numprevious = blk->numhere = 0;
  238. X  blk->maxhere = maxhere;
  239. X  blk->items = items;
  240. X
  241. X  *errmsg = '\0';
  242. X  return buf;
  243. X
  244. Xnberror:
  245. X
  246. X  if (buf) free(buf);
  247. X  if (blk) free(blk);
  248. X  if (items) free(items);
  249. X  return NULL;
  250. X}
  251. X
  252. X
  253. Xvoid freebuffer(buffer *buf)
  254. X{
  255. X  block *blk, *tmp;
  256. X
  257. X  blk = buf->firstblk;
  258. X  while (blk) {
  259. X    tmp = blk;
  260. X    blk = blk->next;
  261. X    if (tmp->items) free(tmp->items);
  262. X    free(tmp);
  263. X  }
  264. X
  265. X  free(buf);
  266. X}
  267. X
  268. X
  269. Xvoid clearbuffer(buffer *buf)
  270. X{
  271. X  block *blk;
  272. X
  273. X  for (blk = buf->firstblk;  blk;  blk = blk->next)
  274. X    blk->numhere = 0;
  275. X
  276. X  buf->current = buf->firstblk;
  277. X}
  278. X
  279. X
  280. Xvoid additem(buffer *buf, const void *item, errmsg_t errmsg)
  281. X{
  282. X  block *blk, *new;
  283. X  void *items;
  284. X  int maxhere;
  285. X  size_t itemsize = buf->itemsize;
  286. X
  287. X  blk = buf->current;
  288. X
  289. X  if (blk->numhere == blk->maxhere) {
  290. X    new = blk->next;
  291. X    if (!new) {
  292. X      maxhere = 2 * blk->maxhere;
  293. X      new = (block * ) malloc(sizeof (block));
  294. X      items = malloc(maxhere * itemsize);
  295. X      if (!new || !items) {
  296. X        strcpy(errmsg,outofmem);
  297. X        goto aierror;
  298. X      }
  299. X      blk->next = new;
  300. X      new->next = NULL;
  301. X      new->maxhere = maxhere;
  302. X      new->numprevious = blk->numprevious + blk->numhere;
  303. X      new->numhere = 0;
  304. X      new->items = items;
  305. X    }
  306. X    blk = buf->current = new;
  307. X  }
  308. X
  309. X  memcpy( ((char *) blk->items) + (blk->numhere * itemsize), item, itemsize );
  310. X
  311. X  ++blk->numhere;
  312. X
  313. X  *errmsg = '\0';
  314. X  return;
  315. X
  316. Xaierror:
  317. X
  318. X  if (new) free(new);
  319. X  if (items) free(items);
  320. X}
  321. X
  322. X
  323. Xint numitems(buffer *buf)
  324. X{
  325. X  block *blk = buf->current;
  326. X  return blk->numprevious + blk->numhere;
  327. X}
  328. X
  329. X
  330. Xvoid *copyitems(buffer *buf, errmsg_t errmsg)
  331. X{
  332. X  int n;
  333. X  void *r;
  334. X  block *blk, *b;
  335. X  size_t itemsize = buf->itemsize;
  336. X
  337. X  b = buf->current;
  338. X  n = b->numprevious + b->numhere;
  339. X  if (!n) return NULL;
  340. X
  341. X  r = malloc(n * itemsize);
  342. X  if (!r) {
  343. X    strcpy(errmsg,outofmem);
  344. X    return NULL;
  345. X  }
  346. X
  347. X  b = b->next;
  348. X
  349. X  for (blk = buf->firstblk;  blk != b;  blk = blk->next)
  350. X    memcpy( ((char *) r) + (blk->numprevious * itemsize),
  351. X            blk->items, blk->numhere * itemsize);
  352. X
  353. X  *errmsg = '\0';
  354. X  return r;
  355. X}
  356. X
  357. X
  358. Xvoid rewindbuffer(buffer *buf)
  359. X{
  360. X  buf->nextblk = buf->firstblk;
  361. X  buf->nextindex = 0;
  362. X}
  363. X
  364. X
  365. Xvoid *nextitem(buffer *buf)
  366. X{
  367. X  void *r;
  368. X
  369. X  if (!buf->nextblk || buf->nextindex >= buf->nextblk->numhere)
  370. X    return NULL;
  371. X
  372. X  r = ((char *) buf->nextblk->items) + (buf->nextindex * buf->itemsize);
  373. X
  374. X  if (++buf->nextindex >= buf->nextblk->maxhere) {
  375. X    buf->nextblk = buf->nextblk->next;
  376. X    buf->nextindex = 0;
  377. X  }
  378. X
  379. X  return r;
  380. X}
  381. END_OF_FILE
  382. if test 4554 -ne `wc -c <'Par141/buffer.c'`; then
  383.     echo shar: \"'Par141/buffer.c'\" unpacked with wrong size!
  384. fi
  385. # end of 'Par141/buffer.c'
  386. fi
  387. if test -f 'Par141/par.doc' -a "${1}" != "-c" ; then 
  388.   echo shar: Will not clobber existing file \"'Par141/par.doc'\"
  389. else
  390. echo shar: Extracting \"'Par141/par.doc'\" \(49605 characters\)
  391. sed "s/^X//" >'Par141/par.doc' <<'END_OF_FILE'
  392. X  *********************
  393. X  * par.doc           *
  394. X  * for Par 1.41      *
  395. X  * Copyright 1993 by *
  396. X  * Adam M. Costello  *
  397. X  *********************
  398. X
  399. X
  400. X    Par 1.41 is a package containing:
  401. X
  402. X       + This doc file.
  403. X       + A man page based on this doc file.
  404. X       + The ANSI C source for the filter "par".
  405. X
  406. X
  407. XContents
  408. X
  409. X    Contents
  410. X    File List
  411. X    Rights and Responsibilities
  412. X    Compilation
  413. X    Synopsis
  414. X    Description
  415. X   *Quick Start
  416. X    Terminology
  417. X    Options
  418. X    Environment
  419. X    Details
  420. X    Diagnostics
  421. X    Examples
  422. X    Limitations
  423. X    Bugs
  424. X
  425. X
  426. XFile List
  427. X
  428. X    The Par 1.41 package is always distributed with at least the following
  429. X    files:
  430. X
  431. X        buffer.c
  432. X        buffer.h
  433. X        charset.c
  434. X        charset.h
  435. X        failf.c
  436. X        failf.h
  437. X        par.1
  438. X        par.c
  439. X        par.doc
  440. X        protoMakefile
  441. X        reformat.c
  442. X        reformat.h
  443. X        releasenotes
  444. X
  445. X    Each file is a text file which identifies itself on the second line, and
  446. X    identifies the version of Par to which it belongs on the third line,
  447. X    so you can always tell which file is which, even if the files have been
  448. X    renamed.
  449. X
  450. X    The file "par.1" is a man page for the filter par (not to be confused
  451. X    with the package Par, which contains the source code for par).  "par.1"
  452. X    is based on this doc file, and conveys much (not all) of the same
  453. X    information, but "par.doc" is the definitive documentation for both par
  454. X    and Par.
  455. X
  456. X
  457. XRights and Responsibilities
  458. X
  459. X    The files listed in the Files List section above are each Copyright 1993
  460. X    by Adam M. Costello (henceforth "I").
  461. X
  462. X    I grant everyone permission to use these files in any way, subject to
  463. X    the following two restrictions:
  464. X
  465. X     1) No one may distribute modifications of any of the files unless I am
  466. X        the one who modified them.
  467. X
  468. X     2) No one may distribute any one of the files unless it is accompanied
  469. X        by all of the other files.
  470. X
  471. X    I cannot disallow the distribution of patches, but I would prefer that
  472. X    users send me suggestions for changes so that I can incorporate them
  473. X    into future versions of Par.  See the Bugs section for my addresses.
  474. X
  475. X    All official versions of Par will have version numbers that fit the
  476. X    pattern "<digits>.<digits>".  Those who distribute patches should, as a
  477. X    courtesy, make sure that the patch alters all instances of the version
  478. X    number (except in the releasenotes file) to something that doesn't fit
  479. X    the pattern, to avoid confusion between official versions and patched
  480. X    versions.
  481. X
  482. X    Though I have tried to make sure that Par is free of bugs, I make no
  483. X    guarantees about its soundness.  Therefore, I am not responsible for any
  484. X    damage resulting from the use of these files.
  485. X
  486. X
  487. XCompilation
  488. X
  489. X    To compile par, you need an ANSI C compiler.  Follow the instructions in
  490. X    the comments in protoMakefile.
  491. X
  492. X    If your compiler warns you about a pointer to a constant being converted
  493. X    to a pointer to a non-constant in line 521 of reformat.c, ignore it.
  494. X    Your compiler (like mine) is in error.  What it thinks is a pointer to
  495. X    a constant is actually a pointer to a pointer to a constant, which is
  496. X    something quite different.  The conversion is legal, and I don't think a
  497. X    correct ANSI C compiler would complain.
  498. X
  499. X    If your compiler generates any other warnings that you think are
  500. X    legitimate, please tell me about them (see the Bugs section).
  501. X
  502. X    Note that all variables in par are either constant or automatic (or
  503. X    both), which means that par can be made reentrant (if your compiler
  504. X    supports it).  Given the right operating system, it should be possible
  505. X    for several par processes to share the same code space and the same data
  506. X    space (but not the same stack, of course) in memory.
  507. X
  508. X
  509. XSynopsis
  510. X    par [help] [version] [B<op><set>] [P<op><set>] [Q<op><set>] [h[<hang>]]
  511. X        [p[<prefix>]] [r[<repeat>]] [s[<suffix>]] [w[<width>]] [c[<cap>]]
  512. X        [d[<div>]] [E[<Err>]] [e[<expel>]] [f[<fit>]] [g[<guess>]]
  513. X        [i[<invis>]] [j[<just>]] [l[<last>]] [q[<quote>]] [R[<Report>]]
  514. X        [t[<touch>]]
  515. X
  516. X    Things enclosed in [square brackets] are optional.  Things enclosed in
  517. X    <angle brackets> are parameters.
  518. X
  519. X
  520. XDescription
  521. X
  522. X    par is a filter which copies its input to its output, changing all white
  523. X    characters (except newlines) to spaces, and reformatting each paragraph.
  524. X    Paragraphs are separated by protected, blank, and bodiless lines (see
  525. X    the Terminology section for definitions), and optionally delimited by
  526. X    indentation (see the d option in the Options section).
  527. X
  528. X    Each output paragraph is generated from the corresponding input
  529. X    paragraph as follows:
  530. X
  531. X     1) An optional prefix and/or suffix is removed from each input line.
  532. X     2) The remainder is divided into words (separated by spaces).
  533. X     3) The words are joined into lines to make an eye-pleasing paragraph.
  534. X     4) The prefixes and suffixes are reattached.
  535. X
  536. X     If there are suffixes, spaces are inserted before them so that they all
  537. X     end in the same column.
  538. X
  539. X
  540. XQuick Start
  541. X
  542. X    par is necessarily complex.  For those who wish to use it immediately
  543. X    and understand it later, assign the following environment variables:
  544. X
  545. X        PARBODY    = ._A_a
  546. X
  547. X        PARINIT    = Rgqr
  548. X
  549. X        PARQUOTE   = _s>|
  550. X
  551. X    The greater-than sign and the vertical bar in the value of PARQUOTE
  552. X    will probably have to be escaped or quoted to prevent your shell from
  553. X    interpreting them.
  554. X
  555. X
  556. XTerminology
  557. X
  558. X    Miscellaneous terms:
  559. X
  560. X        charset syntax
  561. X            A way of representing a set of characters as a string.  The set
  562. X            includes exactly those characters which appear in the string,
  563. X            except that the underscore (_) is an escape character.  Whenever
  564. X            it appears, it must begin one of the following escape sequences:
  565. X
  566. X                   __ = an underscore
  567. X                   _s = a space
  568. X                   _b = a backslash (\)
  569. X                   _q = a single quote (')
  570. X                   _Q = a double quote (")
  571. X                   _A = all upper case letters
  572. X                   _a = all lower case letters
  573. X                   _0 = all decimal digits
  574. X                 _xhh = the character represented by the two hexadecimal
  575. X                        digits hh (which may be upper or lower case)
  576. X
  577. X            The NUL character must not appear in the string but it may be
  578. X            included in the set with the _x00 sequence.
  579. X
  580. X        error
  581. X            A condition which causes par to abort.  See the Diagnostics
  582. X            section.
  583. X
  584. X        IP  Input paragraph.
  585. X
  586. X        OP  Output paragraph.
  587. X
  588. X        parameter
  589. X            A symbol which may take on unsigned integral values.  There are
  590. X            several parameters whose values affect the behavior of par.
  591. X            Parameters can be assigned values using command line options.
  592. X
  593. X
  594. X    Types of characters:
  595. X
  596. X        alphanumeric character
  597. X            An upper case letter, lower case letter, or decimal digit.
  598. X
  599. X        body character
  600. X            A member of the set of characters defined by the PARBODY
  601. X            environment variable (see the Environment section).
  602. X
  603. X        protective character
  604. X            A member of the set of characters defined by the PARPROTECT
  605. X            environment variable (see the Environment section).
  606. X
  607. X        quote character
  608. X            A member of the set of characters defined by the PARQUOTE
  609. X            environment variable (see the Environment section).
  610. X
  611. X        terminal character
  612. X            A period, question mark, exclamation point, or colon.
  613. X
  614. X        white character
  615. X            A space, formfeed, newline, carriage return, tab, or vertical
  616. X            tab.
  617. X
  618. X    Functions:
  619. X
  620. X        comprelen
  621. X            The comprelen of a non-empty sequence of lines is the length
  622. X            of the longest string of non-body characters appearing at the
  623. X            beginning of every line in the set.
  624. X
  625. X        comsuflen
  626. X            Given a non-empty sequence <S> of lines, let <p> be the
  627. X            comprelen of <S>.  Let <T> be the set of lines which result from
  628. X            stripping the first <p> characters from each line in <S>.  Let
  629. X            <c> be the longest string of non-body characters appearing at
  630. X            the end of every line in <T>.  Strip <c> of all initial spaces
  631. X            except the last.  The length of <c> is the comsuflen of <S>.
  632. X
  633. X        fallback prelen (suflen)
  634. X            The fallback prelen (suflen) of an IP is: the comprelen
  635. X            (comsuflen) of the IP, if the IP contains at least two lines;
  636. X            otherwise, the comprelen (comsuflen) of the block containing the
  637. X            IP, if the block contains at least two lines; otherwise, the
  638. X            length of the longer of the prefixes (suffixes) of the bodiless
  639. X            lines just above and below the block, if the segment containing
  640. X            the block has any bodiless lines; otherwise, 0.  (See below for
  641. X            the definitions of block, segment, and bodiless line.)
  642. X
  643. X        augmented fallback prelen
  644. X            Let <fp> be the fallback prelen of an IP.  If the IP contains
  645. X            more than one line, or if <quote> is 0, then the augmented
  646. X            fallback prelen of the IP is simply <fp>.  Otherwise, it is <fp>
  647. X            plus the number of quote characters immediately following the
  648. X            first <fp> characters of the line.
  649. X
  650. X        quoteprefix
  651. X            The quoteprefix of a line is the longest string of quote
  652. X            characters appearing at the beginning of the line, after this
  653. X            string has been stripped of any trailing spaces.
  654. X
  655. X    Types of lines:
  656. X
  657. X        blank line
  658. X            An empty line, or a line whose first character is not protective
  659. X            and which contains only spaces.
  660. X
  661. X        protected line
  662. X            An input line whose first character is protective.
  663. X
  664. X        bodiless line
  665. X            A line which is order <k> bodiless for some <k>.
  666. X
  667. X        order <k> bodiless line
  668. X            There is no such thing as an order 0 bodiless line.  Suppose
  669. X            <S> is a a contiguous subsequence of a segment (see below)
  670. X            containing at least two lines, containing no order <k>-1
  671. X            bodiless lines, bounded above and below by order <k>-1 bodiless
  672. X            lines and/or the beginning/end of the segment.  Let <p> and <s>
  673. X            be the comprelen and comsuflen of <S>.  Any member of <S> which,
  674. X            if stripped of its first <p> and last <s> characters, would be
  675. X            blank (or, if the parameter <repeat> is non-zero, would consist
  676. X            of the same character repeated at least <repeat> times), is
  677. X            order <k> bodiless.  The first <p> characters of the bodiless
  678. X            line comprise its prefix; the last <s> characters comprise its
  679. X            suffix.  The character which repeats in the middle is called its
  680. X            repeat character.  If the middle is empty, the space is taken to
  681. X            be its repeat character.
  682. X
  683. X        vacant line
  684. X            A bodiless line whose repeat character is the space.
  685. X
  686. X        superfluous line
  687. X            Only blank and vacant lines may be superfluous.  If contiguous
  688. X            vacant lines lie at the beginning or end of a segment, they are
  689. X            all superfluous.  But if they lie between two non-vacant lines
  690. X            within a segment, then all are superfluous except one--the one
  691. X            which contains the fewest non-spaces.  In case of a tie, the
  692. X            first of the tied lines is chosen.  Similarly, if contiguous
  693. X            blank lines lie outside of any segments at the beginning or end
  694. X            of the input, they are all superfluous.  But if they lie between
  695. X            two segments and/or protected lines, then all are superfluous
  696. X            except the first.
  697. X
  698. X    Groups of lines:
  699. X
  700. X        segment
  701. X            A contiguous sequence of input lines containing no protected or
  702. X            blank lines, bounded above and below by protected lines, blank
  703. X            lines, and/or the beginning/end of the input.
  704. X
  705. X        block
  706. X            A contiguous subsequence of a segment containing no bodiless
  707. X            lines, bounded above and below by bodiless lines and/or the
  708. X            beginning/end of the segment.
  709. X
  710. X    Types of words:
  711. X
  712. X        capitalized word
  713. X            If the parameter <cap> is 0, a capitalized word is one which
  714. X            contains at least one alphanumeric character, whose first
  715. X            alphanumeric character is not a lower case letter.  If <cap>
  716. X            is 1, every word is considered a capitalized word.  (See the c
  717. X            option in the Options section.)
  718. X
  719. X        curious word
  720. X            A word which contains a terminal character <c> such that there
  721. X            are no alphanumeric characters in the word after <c>, but there
  722. X            is at least one alphanumeric character in the word before <c>.
  723. X
  724. X
  725. XOptions
  726. X
  727. X    Any command line argument may begin with one minus sign (-) which is
  728. X    ignored.  Generally, more than one option may appear in a single command
  729. X    line argument, but there are exceptions:  The help, version, B, P, and Q
  730. X    options must have whole arguments all to themselves.
  731. X
  732. X    help        Causes all remaining arguments to be ignored.  No input
  733. X                is read.  A usage message is printed on the output briefly
  734. X                describing the options used by par.
  735. X
  736. X    version     Causes all remaining arguments to be ignored.  No input is
  737. X                read.  "par 1.41" is printed on the output.  Of course, this
  738. X                will change in future releases of Par.
  739. X
  740. X    B<op><set>  <op> is a single character, either an equal sign (=), a
  741. X                plus sign (+), or a minus sign (-). <set> is a string using
  742. X                charset syntax.  If <op> is an equal sign, the set of body
  743. X                characters is set to the character set defined by <set>.  If
  744. X                <op> is a plus/minus sign, the characters in the set defined
  745. X                by <set> are added/removed to/from the existing set of body
  746. X                characters defined by the PARBODY environment variable and
  747. X                any previous B options.  It is okay to add characters that
  748. X                are already in the set or to remove characters that are not
  749. X                in the set.
  750. X
  751. X    P<op><set>  Just like the B option, except that it applies to the set of
  752. X                protective characters.
  753. X
  754. X    Q<op><set>  Just like the B option, except that it applies to the set of
  755. X                quote characters.
  756. X
  757. X    All remaining options are used to set values of parameters.  Values set
  758. X    by command line options hold for all paragraphs.  Unset parameters are
  759. X    given default values.  Any parameters whose default values depend on
  760. X    the IP (namely <prefix> and <suffix>), if left unset, are recomputed
  761. X    separately for each paragraph.
  762. X
  763. X    The approximate role of each parameter is described here.  See the
  764. X    Details section for the rest of the story.
  765. X
  766. X    The first five parameters, <hang>, <prefix>, <repeat>, <suffix>, and
  767. X    <width>, may be set to any unsigned decimal integer less than 10000.
  768. X
  769. X    h[<hang>]   Mainly affects the default values of <prefix> and <suffix>.
  770. X                Defaults to 0.  If the h option is given without a number,
  771. X                the value 1 is inferred.  (See also the p and s options.)
  772. X
  773. X    p[<prefix>] The first <prefix> characters of each line of the OP
  774. X                are copied from the first <prefix> characters of the
  775. X                corresponding line of the IP.  If there are more than
  776. X                <hang>+1 lines in the IP, the default value is the comprelen
  777. X                of all the lines in the IP except the first <hang> of them.
  778. X                Otherwise, the default value is the augmented fallback
  779. X                prelen of the IP.  If the p option is given without a
  780. X                number, <prefix> is unset, even if it had been set earlier.
  781. X                (See also the h and q options.)
  782. X
  783. X    r[<repeat>] If <repeat> is non-zero, bodiless lines have the number of
  784. X                instances of their repeat characters increased or decreased
  785. X                until the length of the line is <width>.  The exact value of
  786. X                <repeat> affects the definition of bodiless line.  Defaults
  787. X                to 0.  If the r option is given without a number, the value
  788. X                3 is inferred.  (See also the w option.)
  789. X
  790. X    s[<suffix>] The last <suffix> characters of each line of the OP
  791. X                are copied from the last <suffix> characters of the
  792. X                corresponding line of the IP.  If there are more than
  793. X                <hang>+1 lines in the IP, the default value is the comsuflen
  794. X                of all the lines in the IP except the first <hang> of them.
  795. X                Otherwise, the default value is the fallback suflen of the
  796. X                IP.  If the s option is given without a number, <suffix> is
  797. X                unset, even if it had been set earlier.  (See also the h
  798. X                option.)
  799. X
  800. X    w[<width>]  No line in the OP may contain more than <width> characters,
  801. X                not including the trailing newlines.  Defaults to 72.  If
  802. X                the w option is given without a number, the value 79 is
  803. X                inferred.
  804. X
  805. X    The remaining twelve parameters, <cap>, <div>, <Err>, <expel>, <fit>,
  806. X    <guess>, <invis>, <just>, <last>, <quote>, <Report>, and <touch>, may be
  807. X    set to either 0 or 1.  If the number is absent in the option, the value
  808. X    1 is inferred.
  809. X
  810. X    c[<cap>]    If <cap> is 1, all words are considered capitalized.  This
  811. X                currently affects only the application of the g option.
  812. X                Defaults to 0.
  813. X
  814. X    d[<div>]    If <div> is 0, each block becomes an IP.  If <div> is 1,
  815. X                each block is subdivided into IPs as follows:  Let <p> be
  816. X                the comprelen of the block.  Let a line's status be 1 if its
  817. X                (<p>+1)st character is a space, 0 otherwise.  Every line
  818. X                in the block whose status is the same as the status of the
  819. X                first line will begin a new paragraph.  Defaults to 0.
  820. X
  821. X    E[<Err>]    If <Err> is 1, messages to the user (caused by the help and
  822. X                version options, or by errors) are sent to the error stream
  823. X                instead of the output stream.  Defaults to 0.
  824. X
  825. X    e[<expel>]  If <expel> is 1, superfluous lines withheld from the output.
  826. X                Defaults to 0.
  827. X
  828. X    f[<fit>]    If <fit> is 1 and <just> is 0, par tries to make the lines
  829. X                in the OP as nearly the same length as possible, even if it
  830. X                means making the OP narrower.  Defaults to 0.  (See also the
  831. X                j option.)
  832. X
  833. X    g[<guess>]  If <guess> is 1, then when par is choosing line breaks,
  834. X                whenever it encounters a curious word followed by a
  835. X                capitalized word, it takes one of two special actions.
  836. X                If the two words are separated by a single space in the
  837. X                input, they will be merged into one word with an embedded
  838. X                non-breaking space.  If the two words are separated by more
  839. X                than one space, or by a line break, par will insure that
  840. X                they are separated by two spaces, or by a line break, in the
  841. X                output.  Defaults to 0.
  842. X
  843. X    i[<invis>]  If <invis> is 1, then vacant lines inserted because <quote>
  844. X                is 1 are invisible; that is, they are not output.  If
  845. X                <quote> is 0, <invis> has no effect.  Defaults to 0.  (See
  846. X                also the q option.)
  847. X
  848. X    j[<just>]   If <just> is 1, par justifies the OP, inserting spaces
  849. X                between words so that all lines in the OP have length
  850. X                <width> (except the last, if <last> is 0).  Defaults to 0.
  851. X                (See also the w, l, and f options.)
  852. X
  853. X    l[<last>]   If <last> is 1, par tries to make the last line of the OP
  854. X                about the same length as the others.  Defaults to 0.
  855. X
  856. X    q[<quote>]  If <quote> is 1, then before each segment is scanned for
  857. X                bodiless lines, par supplies vacant lines between different
  858. X                quotation nesting levels as follows:  For each pair of
  859. X                adjacent lines in the segment (scanned from the top down)
  860. X                which have different quoteprefixes, one of two actions is
  861. X                taken.  If <invis> is 0, and either line consists entirely
  862. X                of quote characters and spaces (or is empty), that line is
  863. X                truncated to the longest common prefix of the two lines
  864. X                (both are truncated if both qualify).  Otherwise, a line
  865. X                consisting of the longest common prefix of the two lines is
  866. X                inserted between them.  <quote> also affects the default
  867. X                value of <prefix>.  Defaults to 0.  (See also the p and i
  868. X                options.)
  869. X
  870. X    R[<Report>] If <Report> is 1, it is considered an error for an input
  871. X                word to contain more than <L> = (<width> - <prefix> -
  872. X                <suffix>) characters.  Otherwise, such words are chopped
  873. X                after each <L>th character into shorter words.  Defaults
  874. X                to 0.  It is recommended that this option be included in
  875. X                PARINIT (see the Environment section).
  876. X
  877. X    t[<touch>]  Has no effect if <suffix> is 0 or <just> is 1.  Otherwise,
  878. X                if <touch> is 0, all lines in the OP have length <width>.
  879. X                If <touch> is 1, the length of the lines is decreased until
  880. X                the suffixes touch the body of the OP.  Defaults to the
  881. X                logical OR of <fit> and <last>.  (See also the s, j, w, f,
  882. X                and l options.)
  883. X
  884. X    If the value of any parameter is set more than once, the last value is
  885. X    used.  When unset parameters are assigned default values, <hang> and
  886. X    <quote> are assigned before <prefix>, and <fit> and <last> are assigned
  887. X    before <touch> (because of the dependencies).
  888. X
  889. X    It is an error if <width> <= <prefix> + <suffix>.
  890. X
  891. X
  892. XEnvironment
  893. X
  894. X    PARBODY     Determines the initial set of body characters (which are
  895. X                used for determining comprelens and comsuflens), using
  896. X                charset syntax.  If PARBODY is not set, the set of body
  897. X                characters is initially empty.
  898. X
  899. X    PARINIT     If set, par will read command line arguments from PARINIT
  900. X                before it reads them from the command line.  Within
  901. X                the value of PARINIT, arguments are separated by white
  902. X                characters.
  903. X
  904. X    PARPROTECT  Determines the set of protective characters, using charset
  905. X                syntax.  If PARPROTECT is not set, the set of protective
  906. X                characters is initially empty.
  907. X
  908. X    PARQUOTE    Determines the set of quote characters, using charset
  909. X                syntax.  If PARQUOTE is not set, the set of quote characters
  910. X                initially contains only the greater-than sign (>) and the
  911. X                space.
  912. X
  913. X    If a NUL character appears in the value of an environment variable, it
  914. X    and the rest of the string will not be seen by par.
  915. X
  916. X
  917. XDetails
  918. X
  919. X    Lines are terminated by newline characters, but the newlines are not
  920. X    considered to be included in the lines.  If the last character of the
  921. X    input is a non-newline, a newline will be inferred immediately after
  922. X    it (but if the input is empty, no newline will be inferred; the number
  923. X    of input lines will be 0).  Thus, the input can always be viewed as a
  924. X    sequence of lines.
  925. X
  926. X    Protected lines are copied unchanged from the input to the output.  All
  927. X    other input lines, as they are read, have any NUL characters removed,
  928. X    and every white character (except newlines) turned into a space.
  929. X
  930. X    Blank lines in the input are transformed into empty lines in the output.
  931. X
  932. X    If <repeat> is 0, all bodiless lines are vacant, and they are all simply
  933. X    stripped of trailing spaces before being output.  If <repeat> is 1, only
  934. X    vacant lines whose suffixes have length 0 are treated that way; other
  935. X    bodiless lines have the number of instances of their repeat characters
  936. X    increased or decreased until the length of the line is <width>.
  937. X
  938. X    If <expel> is 1, superfluous lines are not output.  If <quote> and
  939. X    <invis> are both 1, there may be invisible lines; they are not output.
  940. X
  941. X    The input is divided into segments, which are divided into blocks,
  942. X    which are divided into IPs.  The exact process depends on the values of
  943. X    <quote> and <div> (see q and d in the Options section).  The remainder
  944. X    of this section describes the process which is applied independently to
  945. X    each IP to construct the corresponding OP.
  946. X
  947. X    After the values of the parameters are determined (see the Options
  948. X    section), the first <prefix> characters and the last <suffix> characters
  949. X    of each input line are removed and remembered.  It is an error for any
  950. X    line to contain fewer than <prefix> + <suffix> characters.
  951. X
  952. X    The remaining text is treated as a sequence of characters, not lines.
  953. X    The text is broken into words, which are separated by spaces.  That is,
  954. X    a word is a maximal sub-sequence of non-spaces.  If <guess> is 1, some
  955. X    words might be merged (see g in the Options section).  The first word
  956. X    includes any spaces that preceed it on the same line.
  957. X
  958. X    Let <L> = <width> - <prefix> - <suffix>.
  959. X
  960. X    If <Report> is 0, some words may get chopped up at this point (see R in
  961. X    the Options section).
  962. X
  963. X    The words are reassembled, preserving their order, into lines.  If
  964. X    <just> is 0, adjacent words within a line are separated by a single
  965. X    space (or sometimes two if <guess> is 1), and line breaks are chosen so
  966. X    that the paragraph satisfies the following properties:
  967. X
  968. X         1) No line contains more than <L> characters.
  969. X
  970. X         2) If <fit> is 1, the difference between the lengths of the
  971. X            shortest and longest lines is as small as possible.
  972. X
  973. X         3) The shortest line is as long as possible, subject to properties
  974. X            1 and 2.
  975. X
  976. X         4) Let <target> be <L> if <fit> is 0, or the length of the longest
  977. X            line if <fit> is 1.  The sum of the squares of the differences
  978. X            between <target> and the lengths of the lines is as small as
  979. X            possible, subject to properties 1, 2, and 3.
  980. X
  981. X        If <last> is 0, the last line does not count as a line for the
  982. X        purposes of properties 2, 3, and 4 above.
  983. X
  984. X        If all the words fit on a single line, the properties as worded
  985. X        above don't make much sense.  In that case, no line breaks are
  986. X        inserted.
  987. X
  988. X    If <just> is 1, adjacent words within a line are separated by one space
  989. X    (or sometimes two if <guess> is 1) plus zero or more extra spaces.  The
  990. X    value of <fit> is disregarded, and line breaks are chosen so that the
  991. X    paragraph satisfies the following properties:
  992. X
  993. X         1) Every line contains exactly <L> characters.
  994. X
  995. X         2) The largest inter-word gap is as small as possible, subject
  996. X            to property 1.  (An inter-word gap consists only of the extra
  997. X            spaces, not the regular spaces.)
  998. X
  999. X         3) The sum of the squares of the lengths of the inter-word gaps is
  1000. X            as small as possible, subject to properties 1 and 2.
  1001. X
  1002. X        If <last> is 0, the last line does not count as a line for the
  1003. X        purposes of property 1, and it does not require or contain any extra
  1004. X        spaces.
  1005. X
  1006. X        Extra spaces are distributed as uniformly as possible among the
  1007. X        inter-word gaps in each line.
  1008. X
  1009. X        In a justified paragraph, every line must contain at least two
  1010. X        words, but that's not always possible to accomplish.  If the
  1011. X        paragraph cannot be justified, it is considered an error.
  1012. X
  1013. X    If the number of lines in the resulting paragraph is less than <hang>,
  1014. X    empty lines are added at the end to bring the number of lines up to
  1015. X    <hang>.
  1016. X
  1017. X    If <just> is 0 and <touch> is 1, <L> is changed to be the length of the
  1018. X    longest line.
  1019. X
  1020. X    If <suffix> is not 0, each line is padded at the end with spaces to
  1021. X    bring its length up to <L>.
  1022. X
  1023. X    To each line is prepended <prefix> characters.  Let <n> be the number of
  1024. X    lines in the IP, let <afp> be the augmented fallback prelen of the IP,
  1025. X    and let <fs> be the fallback suflen of the IP.  The characters which are
  1026. X    prepended to the <i>th line are chosen as follows:
  1027. X
  1028. X     1) If <i> <= <n>, the characters are copied from the ones that were
  1029. X        removed from the beginning of the <n>th input line.
  1030. X
  1031. X     2) If <i> > <n> > <hang>, the characters are copied from the ones that
  1032. X        were removed from the beginning of the last input line.
  1033. X
  1034. X     3) If <i> > <n> and <n> <= <hang>, the first min(<afp>,<prefix>) of
  1035. X        the characters are copied from the ones that were removed from the
  1036. X        beginning of the last input line, and the rest are all spaces.
  1037. X
  1038. X    Then to each line is appended <suffix> characters.  The characters which
  1039. X    are appended to the <i>th line are chosen as follows:
  1040. X
  1041. X     1) If <i> <= <n>, the characters are copied from the ones that were
  1042. X        removed from the end of the nth input line.
  1043. X
  1044. X     2) If <i> > <n> > <hang>, the characters are copied from the ones that
  1045. X        were removed from the end of the last input line.
  1046. X
  1047. X     3) If <i> > <n> and <n> <= <hang>, the first min(<fs>,<suffix>) of
  1048. X        the characters are copied from the ones that were removed from the
  1049. X        beginning of the last input line, and the rest are all spaces.
  1050. X
  1051. X    Finally, the lines are printed to the output as the OP.
  1052. X
  1053. X
  1054. XDiagnostics
  1055. X
  1056. X    If there are no errors, par returns EXIT_SUCCESS (see <stdlib.h>).
  1057. X
  1058. X    If there is an error, an error message will be printed to the output,
  1059. X    and par will return EXIT_FAILURE.  If the error is local to a single
  1060. X    paragraph, the preceeding paragraphs will have been output before
  1061. X    the error was detected.  Line numbers in error messages are local to
  1062. X    the IP in which the error occurred.  All error messages begin with
  1063. X    "par error:" on a line by itself.  Error messages concerning command
  1064. X    line or environment variable syntax are accompanied by the same usage
  1065. X    message that the help option produces.
  1066. X
  1067. X    Of course, trying to print an error message would be futile if an error
  1068. X    resulted from an output function, so par doesn't bother doing any error
  1069. X    checking on output functions.
  1070. X
  1071. X
  1072. XExamples
  1073. X
  1074. X    The superiority of par's dynamic programming algorithm over a greedy
  1075. X    algorithm (such as the one used by fmt) can be seen in the following
  1076. X    example:
  1077. X
  1078. X    Original paragraph:
  1079. X
  1080. X        We the people of the United States,
  1081. X        in order to form a more perfect union,
  1082. X        establish justice,
  1083. X        insure domestic tranquility,
  1084. X        provide for the common defense,
  1085. X        promote the general welfare,
  1086. X        and secure the blessing of liberty
  1087. X        to ourselves and our posterity,
  1088. X        do ordain and establish the Constitution
  1089. X        of the United States of America.
  1090. X
  1091. X    After a greedy algorithm with width = 39:
  1092. X
  1093. X        We the people of the United
  1094. X        States, in order to form a more
  1095. X        perfect union, establish
  1096. X        justice, insure domestic
  1097. X        tranquility, provide for the
  1098. X        common defense, promote the
  1099. X        general welfare, and secure the
  1100. X        blessing of liberty to
  1101. X        ourselves and our posterity, do
  1102. X        ordain and establish the
  1103. X        Constitution of the United
  1104. X        States of America.
  1105. X
  1106. X    After "par 39":
  1107. X
  1108. X        We the people of the United    
  1109. X        States, in order to form a     
  1110. X        more perfect union, establish  
  1111. X        justice, insure domestic       
  1112. X        tranquility, provide for the   
  1113. X        common defense, promote the    
  1114. X        general welfare, and secure    
  1115. X        the blessing of liberty to     
  1116. X        ourselves and our posterity,   
  1117. X        do ordain and establish the    
  1118. X        Constitution of the United     
  1119. X        States of America.             
  1120. X
  1121. X    The line breaks chosen by par are clearly more eye-pleasing.
  1122. X
  1123. X    par is most useful in conjunction with the text-filtering features of an
  1124. X    editor, such as the ! commands of vi.
  1125. X
  1126. X    The rest of this section is a series of before-and-after pictures
  1127. X    showing some typical uses of par.  In all cases, no environment
  1128. X    variables are set.
  1129. X
  1130. X    Before:
  1131. X
  1132. X        /*   We the people of the United States, */
  1133. X        /* in order to form a more perfect union, */
  1134. X        /* establish justice, */
  1135. X        /* insure domestic tranquility, */
  1136. X        /* provide for the common defense, */
  1137. X        /* promote the general welfare, */
  1138. X        /* and secure the blessing of liberty */
  1139. X        /* to ourselves and our posterity, */
  1140. X        /* do ordain and establish the Constitution */
  1141. X        /* of the United States of America. */
  1142. X
  1143. X    After "par 59":
  1144. X
  1145. X        /*   We the people of the United States, in      */
  1146. X        /* order to form a more perfect union, establish */
  1147. X        /* justice, insure domestic tranquility, provide */
  1148. X        /* for the common defense, promote the general   */
  1149. X        /* welfare, and secure the blessing of liberty   */
  1150. X        /* to ourselves and our posterity, do ordain     */
  1151. X        /* and establish the Constitution of the United  */
  1152. X        /* States of America.                            */
  1153. X
  1154. X    Or after "par 59f":
  1155. X
  1156. X        /*   We the people of the United States,  */
  1157. X        /* in order to form a more perfect union, */
  1158. X        /* establish justice, insure domestic     */
  1159. X        /* tranquility, provide for the common    */
  1160. X        /* defense, promote the general welfare,  */
  1161. X        /* and secure the blessing of liberty to  */
  1162. X        /* ourselves and our posterity, do ordain */
  1163. X        /* and establish the Constitution of the  */
  1164. X        /* United States of America.              */
  1165. X
  1166. X    Or after "par 59l":
  1167. X
  1168. X        /*   We the people of the United States, in      */
  1169. X        /* order to form a more perfect union, establish */
  1170. X        /* justice, insure domestic tranquility,         */
  1171. X        /* provide for the common defense, promote       */
  1172. X        /* the general welfare, and secure the           */
  1173. X        /* blessing of liberty to ourselves and our      */
  1174. X        /* posterity, do ordain and establish the        */
  1175. X        /* Constitution of the United States of America. */
  1176. X
  1177. X    Or after "par 59lf":
  1178. X
  1179. X        /*   We the people of the United States,  */
  1180. X        /* in order to form a more perfect union, */
  1181. X        /* establish justice, insure domestic     */
  1182. X        /* tranquility, provide for the common    */
  1183. X        /* defense, promote the general welfare,  */
  1184. X        /* and secure the blessing of liberty     */
  1185. X        /* to ourselves and our posterity, do     */
  1186. X        /* ordain and establish the Constitution  */
  1187. X        /* of the United States of America.       */
  1188. X
  1189. X    Or after "par 59lft0":
  1190. X
  1191. X        /*   We the people of the United States,         */
  1192. X        /* in order to form a more perfect union,        */
  1193. X        /* establish justice, insure domestic            */
  1194. X        /* tranquility, provide for the common           */
  1195. X        /* defense, promote the general welfare,         */
  1196. X        /* and secure the blessing of liberty            */
  1197. X        /* to ourselves and our posterity, do            */
  1198. X        /* ordain and establish the Constitution         */
  1199. X        /* of the United States of America.              */
  1200. X
  1201. X    Or after "par 59j":
  1202. X
  1203. X        /*   We  the people  of  the  United States,  in */
  1204. X        /* order to form a more perfect union, establish */
  1205. X        /* justice, insure domestic tranquility, provide */
  1206. X        /* for the  common defense, promote  the general */
  1207. X        /* welfare, and  secure the blessing  of liberty */
  1208. X        /* to ourselves and our posterity, do ordain and */
  1209. X        /* establish  the  Constitution  of  the  United */
  1210. X        /* States of America.                            */
  1211. X
  1212. X    Or after "par 59jl":
  1213. X
  1214. X        /*   We  the   people  of  the   United  States, */
  1215. X        /* in   order    to   form   a    more   perfect */
  1216. X        /* union,  establish  justice,  insure  domestic */
  1217. X        /* tranquility, provide for  the common defense, */
  1218. X        /* promote  the  general   welfare,  and  secure */
  1219. X        /* the  blessing  of  liberty to  ourselves  and */
  1220. X        /* our  posterity, do  ordain and  establish the */
  1221. X        /* Constitution of the United States of America. */
  1222. X
  1223. X    Before:
  1224. X
  1225. X        Preamble      We the people of the United States,
  1226. X        to the US     in order to form
  1227. X        Constitution  a more perfect union,
  1228. X                      establish justice,
  1229. X                      insure domestic tranquility,
  1230. X                      provide for the common defense,
  1231. X                      promote the general welfare,
  1232. X                      and secure the blessing of liberty
  1233. X                      to ourselves and our posterity,
  1234. X                      do ordain and establish
  1235. X                      the Constitution
  1236. X                      of the United States of America.
  1237. X
  1238. X    After "par 52h3":
  1239. X
  1240. X        Preamble      We the people of the United
  1241. X        to the US     States, in order to form a
  1242. X        Constitution  more perfect union, establish
  1243. X                      justice, insure domestic
  1244. X                      tranquility, provide for the
  1245. X                      common defense, promote the
  1246. X                      general welfare, and secure
  1247. X                      the blessing of liberty to
  1248. X                      ourselves and our posterity,
  1249. X                      do ordain and establish the
  1250. X                      Constitution of the United
  1251. X                      States of America.
  1252. X
  1253. X    Before:
  1254. X
  1255. X         1  We the people of the United States,
  1256. X         2  in order to form a more perfect union,
  1257. X         3  establish justice,
  1258. X         4  insure domestic tranquility,
  1259. X         5  provide for the common defense,
  1260. X         6  promote the general welfare,
  1261. X         7  and secure the blessing of liberty
  1262. X         8  to ourselves and our posterity,
  1263. X         9  do ordain and establish the Constitution
  1264. X        10  of the United States of America.
  1265. X
  1266. X    After "par 59p12l":
  1267. X
  1268. X         1  We the people of the United States, in order to
  1269. X         2  form a more perfect union, establish justice,
  1270. X         3  insure domestic tranquility, provide for the
  1271. X         4  common defense, promote the general welfare,
  1272. X         5  and secure the blessing of liberty to ourselves
  1273. X         6  and our posterity, do ordain and establish the
  1274. X         7  Constitution of the United States of America.
  1275. X
  1276. X    Before:
  1277. X
  1278. X        > > We the people
  1279. X        > > of the United States,
  1280. X        > > in order to form a more perfect union,
  1281. X        > > establish justice,
  1282. X        > > ensure domestic tranquility,
  1283. X        > > provide for the common defense,
  1284. X        >
  1285. X        > Promote the general welfare,
  1286. X        > and secure the blessing of liberty
  1287. X        > to ourselves and our posterity,
  1288. X        > do ordain and establish
  1289. X        > the Constitution of the United States of America.
  1290. X
  1291. X    After "par 52":
  1292. X
  1293. X        > > We the people of the United States, in
  1294. X        > > order to form a more perfect union,
  1295. X        > > establish justice, ensure domestic
  1296. X        > > tranquility, provide for the common
  1297. X        > > defense,
  1298. X        >
  1299. X        > Promote the general welfare, and secure
  1300. X        > the blessing of liberty to ourselves and
  1301. X        > our posterity, do ordain and establish
  1302. X        > the Constitution of the United States of
  1303. X        > America.
  1304. X
  1305. X    Before:
  1306. X
  1307. X        >   We the people
  1308. X        > of the United States,
  1309. X        > in order to form a more perfect union,
  1310. X        > establish justice,
  1311. X        > ensure domestic tranquility,
  1312. X        > provide for the common defense,
  1313. X        >   Promote the general welfare,
  1314. X        > and secure the blessing of liberty
  1315. X        > to ourselves and our posterity,
  1316. X        > do ordain and establish
  1317. X        > the Constitution of the United States of America.
  1318. X
  1319. X    After "par 52d":
  1320. X
  1321. X        >   We the people of the United States,
  1322. X        > in order to form a more perfect union,
  1323. X        > establish justice, ensure domestic
  1324. X        > tranquility, provide for the common
  1325. X        > defense,
  1326. X        >   Promote the general welfare, and secure
  1327. X        > the blessing of liberty to ourselves and
  1328. X        > our posterity, do ordain and establish
  1329. X        > the Constitution of the United States of
  1330. X        > America.
  1331. X
  1332. X    Before:
  1333. X
  1334. X        # 1. We the people of the United States.
  1335. X        # 2. In order to form a more perfect union.
  1336. X        # 3. Establish justice, ensure domestic
  1337. X        #    tranquility.
  1338. X        # 4. Provide for the common defense
  1339. X        # 5. Promote the general welfare.
  1340. X        # 6. And secure the blessing of liberty
  1341. X        #    to ourselves and our posterity.
  1342. X        # 7. Do ordain and establish the Constitution.
  1343. X        # 8. Of the United States of America.
  1344. X
  1345. X    After "par 37p13dh":
  1346. X
  1347. X        # 1. We the people of the
  1348. X        #    United States.
  1349. X        # 2. In order to form a more
  1350. X        #    perfect union.
  1351. X        # 3. Establish justice,
  1352. X        #    ensure domestic
  1353. X        #    tranquility.
  1354. X        # 4. Provide for the common
  1355. X        #    defense
  1356. X        # 5. Promote the general
  1357. X        #    welfare.
  1358. X        # 6. And secure the blessing
  1359. X        #    of liberty to ourselves
  1360. X        #    and our posterity.
  1361. X        # 7. Do ordain and establish
  1362. X        #    the Constitution.
  1363. X        # 8. Of the United States of
  1364. X        #    America.
  1365. X
  1366. X    Before:
  1367. X
  1368. X        /*****************************************/
  1369. X        /*   We the people of the United States, */
  1370. X        /* in order to form a more perfect union, */
  1371. X        /* establish justice, insure domestic    */
  1372. X        /* tranquility,                          */
  1373. X        /*                                       */
  1374. X        /*                                       */
  1375. X        /*   [ provide for the common defense, ] */
  1376. X        /*   [ promote the general welfare,    ] */
  1377. X        /*   [ and secure the blessing of liberty ] */
  1378. X        /*   [ to ourselves and our posterity, ] */
  1379. X        /*   [                                 ] */
  1380. X        /*                                       */
  1381. X        /* do ordain and establish the Constitution */
  1382. X        /* of the United States of America.       */
  1383. X        /******************************************/
  1384. X
  1385. X    After "par 42r":
  1386. X
  1387. X        /********************************/
  1388. X        /*   We the people of the       */
  1389. X        /* United States, in order to   */
  1390. X        /* form a more perfect union,   */
  1391. X        /* establish justice, insure    */
  1392. X        /* domestic tranquility,        */
  1393. X        /*                              */
  1394. X        /*                              */
  1395. X        /*   [ provide for the common ] */
  1396. X        /*   [ defense, promote the   ] */
  1397. X        /*   [ general welfare, and   ] */
  1398. X        /*   [ secure the blessing of ] */
  1399. X        /*   [ liberty to ourselves   ] */
  1400. X        /*   [ and our posterity,     ] */
  1401. X        /*   [                        ] */
  1402. X        /*                              */
  1403. X        /* do ordain and establish the  */
  1404. X        /* Constitution of the United   */
  1405. X        /* States of America.           */
  1406. X        /********************************/
  1407. X
  1408. X    Or after "par 42re":
  1409. X
  1410. X        /********************************/
  1411. X        /*   We the people of the       */
  1412. X        /* United States, in order to   */
  1413. X        /* form a more perfect union,   */
  1414. X        /* establish justice, insure    */
  1415. X        /* domestic tranquility,        */
  1416. X        /*                              */
  1417. X        /*   [ provide for the common ] */
  1418. X        /*   [ defense, promote the   ] */
  1419. X        /*   [ general welfare, and   ] */
  1420. X        /*   [ secure the blessing of ] */
  1421. X        /*   [ liberty to ourselves   ] */
  1422. X        /*   [ and our posterity,     ] */
  1423. X        /*                              */
  1424. X        /* do ordain and establish the  */
  1425. X        /* Constitution of the United   */
  1426. X        /* States of America.           */
  1427. X        /********************************/
  1428. X
  1429. X    Before:
  1430. X
  1431. X        Joe Public writes:
  1432. X        > Jane Doe writes:
  1433. X        > >
  1434. X        > >
  1435. X        > > I can't find the source for uncompress.
  1436. X        > Oh no, not again!!!
  1437. X        >
  1438. X        >
  1439. X        > Isn't there a FAQ for this?
  1440. X        >
  1441. X        >
  1442. X        That wasn't very helpful, Joe. Jane,
  1443. X        just make a link from uncompress to compress.
  1444. X
  1445. X    After "par 40q":
  1446. X
  1447. X        Joe Public writes:
  1448. X
  1449. X        > Jane Doe writes:
  1450. X        >
  1451. X        >
  1452. X        > > I can't find the source for
  1453. X        > > uncompress.
  1454. X        >
  1455. X        > Oh no, not again!!!
  1456. X        >
  1457. X        >
  1458. X        > Isn't there a FAQ for this?
  1459. X        >
  1460. X
  1461. X        That wasn't very helpful, Joe.
  1462. X        Jane, just make a link from
  1463. X        uncompress to compress.
  1464. X
  1465. X    Or after "par 40qe":
  1466. X
  1467. X        Joe Public writes:
  1468. X
  1469. X        > Jane Doe writes:
  1470. X        >
  1471. X        > > I can't find the source for
  1472. X        > > uncompress.
  1473. X        >
  1474. X        > Oh no, not again!!!
  1475. X        >
  1476. X        > Isn't there a FAQ for this?
  1477. X
  1478. X        That wasn't very helpful, Joe.
  1479. X        Jane, just make a link from
  1480. X        uncompress to compress.
  1481. X
  1482. X    Or after "par 40qi":
  1483. X
  1484. X        Joe Public writes:
  1485. X        > Jane Doe writes:
  1486. X        > >
  1487. X        > >
  1488. X        > > I can't find the source for
  1489. X        > > uncompress.
  1490. X        > Oh no, not again!!!
  1491. X        >
  1492. X        >
  1493. X        > Isn't there a FAQ for this?
  1494. X        >
  1495. X        >
  1496. X        That wasn't very helpful, Joe.
  1497. X        Jane, just make a link from
  1498. X        uncompress to compress.
  1499. X
  1500. X    Or after "par 40qie":
  1501. X
  1502. X        Joe Public writes:
  1503. X        > Jane Doe writes:
  1504. X        > > I can't find the source for
  1505. X        > > uncompress.
  1506. X        > Oh no, not again!!!
  1507. X        >
  1508. X        > Isn't there a FAQ for this?
  1509. X        That wasn't very helpful, Joe.
  1510. X        Jane, just make a link from
  1511. X        uncompress to compress.
  1512. X
  1513. X    Before:
  1514. X
  1515. X        I sure hope there's still room
  1516. X        in Dr. Jones' section of archaeology.
  1517. X        I've heard he's the bestest.  [sic]
  1518. X
  1519. X    After "par 50g":
  1520. X
  1521. X        I sure hope there's still room in
  1522. X        Dr. Jones' section of archaeology.  I've
  1523. X        heard he's the bestest. [sic]
  1524. X
  1525. X    Or after "par 50gc":
  1526. X
  1527. X        I sure hope there's still room in
  1528. X        Dr. Jones' section of archaeology.  I've
  1529. X        heard he's the bestest.  [sic]
  1530. X
  1531. X    Before:
  1532. X
  1533. X        John writes:
  1534. X        : Mary writes:
  1535. X        : + Anastasia writes:
  1536. X        : + > Hi all!
  1537. X        : + Hi Ana!
  1538. X        : Hi Ana & Mary!
  1539. X        Please unsubscribe me from alt.hello.
  1540. X
  1541. X    After "par Q+:+ q":
  1542. X
  1543. X        John writes:
  1544. X
  1545. X        : Mary writes:
  1546. X        :
  1547. X        : + Anastasia writes:
  1548. X        : +
  1549. X        : + > Hi all!
  1550. X        : +
  1551. X        : + Hi Ana!
  1552. X        :
  1553. X        : Hi Ana & Mary!
  1554. X
  1555. X        Please unsubscribe me from alt.hello.
  1556. X
  1557. X
  1558. XLimitations
  1559. X
  1560. X    The <guess> feature guesses wrong in cases like the following:
  1561. X
  1562. X        I calc'd the approx.
  1563. X        Fermi level to 3 sig. digits.
  1564. X
  1565. X    With <guess> = 1, par will incorrectly assume that "approx." ends a
  1566. X    sentence.  If the input were:
  1567. X
  1568. X        I calc'd the approx. Fermi
  1569. X        level to 3 sig. digits.
  1570. X
  1571. X    then par would refuse to put a line break between "approx." and "Fermi"
  1572. X    in the output, mainly to avoid creating the first situation (in case the
  1573. X    paragraph were to be fed back through par again).  This non-breaking
  1574. X    space policy does come in handy for cases like "Mr. Johnson" and
  1575. X    "Jan. 1", though.
  1576. X
  1577. X    The <guess> feature only goes one way.  par can preserve wide sentence
  1578. X    breaks in a paragraph, or remove them, but it can't insert them if they
  1579. X    aren't already in the input.
  1580. X
  1581. X    If you use tabs, you probably won't like the way par handles (or doesn't
  1582. X    handle) them.  It turns them into spaces.  I didn't bother trying to
  1583. X    make sense of tabs because they don't make sense to begin with.  Not
  1584. X    everyone's terminal has the same tab settings, so text files containing
  1585. X    tabs are sometimes mangled.  In fact, almost every text file containing
  1586. X    tabs gets mangled when something is inserted at the beginning of each
  1587. X    line (when quoting e-mail or commenting out a section of a shell script,
  1588. X    for example), making them a pain to edit.  In my opinion, the world
  1589. X    would be a nicer place if everyone stopped using tabs (so I'm doing my
  1590. X    part by not supporting them in par).  If you find yourself editing a
  1591. X    file containing tabs, the first thing you should do is run the whole
  1592. X    file through expand, a standard UNIX command (if there is such a thing)
  1593. X    that replaces tabs with spaces while preserving the appearance of the
  1594. X    file.  If you're not in a UNIX environment, then hopefully someone
  1595. X    has ported expand to your system.  (Thanks to ets1@cs.wustl.edu (Eric
  1596. X    T. Stuebe) for showing me the light about tabs.)
  1597. X
  1598. X    There is currently no way for the length of the output prefix to differ
  1599. X    from the length of the input prefix.  Ditto for the suffix.  I may
  1600. X    consider adding this capability in a future release, but right now I'm
  1601. X    not sure how I'd want it to work.
  1602. X
  1603. X
  1604. XBugs
  1605. X
  1606. X    If I knew of any bugs, I wouldn't release the package.  Of course, there
  1607. X    may be bugs that I haven't yet discovered.
  1608. X
  1609. X    If you find any bugs (in the program or in the documentation), or if you
  1610. X    have any suggestions, please send e-mail to:
  1611. X
  1612. X        amc@ecl.wustl.edu
  1613. X
  1614. X    or send paper mail to:
  1615. X
  1616. X        Adam M. Costello
  1617. X        Campus Box 1045
  1618. X        Washington University
  1619. X        One Brookings Dr.
  1620. X        St. Louis, MO 63130
  1621. X        USA
  1622. X
  1623. X    Note that both addresses could change anytime after June 1994.
  1624. X
  1625. X    When reporting a bug, please include the exact input and command line
  1626. X    options used, and the version number of par, so that I can reproduce it.
  1627. END_OF_FILE
  1628. if test 49605 -ne `wc -c <'Par141/par.doc'`; then
  1629.     echo shar: \"'Par141/par.doc'\" unpacked with wrong size!
  1630. fi
  1631. # end of 'Par141/par.doc'
  1632. fi
  1633. echo shar: End of shell archive.
  1634. exit 0
  1635.  
  1636. exit 0 # Just in case...
  1637.