home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume38 / par / part01 < prev    next >
Encoding:
Text File  |  1993-08-12  |  44.2 KB  |  1,236 lines

  1. Newsgroups: comp.sources.misc
  2. From: amc@wuecl.wustl.edu (Adam Costello)
  3. Subject: v38i114:  par - paragraph reformatter, v1.20, Part01/03
  4. Message-ID: <csm-v38i114=par.090444@sparky.Sterling.COM>
  5. X-Md4-Signature: 73f63789c1b2e30eb07c909f01a2b044
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Thu, 12 Aug 1993 14:05:04 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: amc@wuecl.wustl.edu (Adam Costello)
  12. Posting-number: Volume 38, Issue 114
  13. Archive-name: par/part01
  14. Environment: ANSI-C
  15.  
  16. Par 1.20 is a package containing documentation and ANSI C source code
  17. for the filter "par".
  18.  
  19. par is a paragraph reformatter, vaguely similar to fmt, but better.
  20.  
  21. For example, the command "par 38d", given the input:
  22.  
  23.     > >   We the people of the United States, in
  24.     > > order to form a more perfect union,
  25.     > >   Establish justice, ensure domestic
  26.     > > tranquility, provide for the common defense,
  27.     >
  28.     >   Promote the general welfare, and secure
  29.     > the blessing of liberty to ourselves and
  30.     > our posterity,
  31.     >   Do ordain and establish the Constitution
  32.     > of the United States of America.
  33.  
  34. Would produce the output:
  35.  
  36.     > >   We the people of the United
  37.     > > States, in order to form a
  38.     > > more perfect union,
  39.     > >   Establish justice, ensure
  40.     > > domestic tranquility, provide
  41.     > > for the common defense,
  42.     >
  43.     >   Promote the general welfare,
  44.     > and secure the blessing of
  45.     > liberty to ourselves and our
  46.     > posterity,
  47.     >   Do ordain and establish the
  48.     > Constitution of the United
  49.     > States of America.
  50.  
  51. Be sure to read "par.doc".
  52.  
  53. AMC
  54. amc@ecl.wustl.edu (Adam M. Costello)
  55.  
  56. #! /bin/sh
  57. # This is a shell archive.  Remove anything before this line, then unpack
  58. # it by saving it into a file and typing "sh file".  To overwrite existing
  59. # files, type "sh file -c".  You can also feed this as standard input via
  60. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  61. # will see the following message at the end:
  62. #        "End of shell archive."
  63. # Contents:  Par120 Par120/par.doc Par120/buffer.c Par120/buffer.h
  64. #   Par120/errmsg.c Par120/errmsg.h
  65. # Wrapped by amc@wuecl on Mon Aug  9 11:00:11 1993
  66. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  67. if test ! -d 'Par120' ; then
  68.     echo shar: Creating directory \"'Par120'\"
  69.     mkdir 'Par120'
  70. fi
  71. if test -f 'Par120/par.doc' -a "${1}" != "-c" ; then 
  72.   echo shar: Will not clobber existing file \"'Par120/par.doc'\"
  73. else
  74. echo shar: Extracting \"'Par120/par.doc'\" \(31676 characters\)
  75. sed "s/^X//" >'Par120/par.doc' <<'END_OF_FILE'
  76. X  *********************
  77. X  * par.doc           *
  78. X  * for Par 1.20      *
  79. X  * Copyright 1993 by *
  80. X  * Adam M. Costello  *
  81. X  *********************
  82. X
  83. X
  84. X    Par 1.20 is a package containing:
  85. X
  86. X       + This doc file.
  87. X       + A man page based on this doc file.
  88. X       + The ANSI C source for the filter "par".
  89. X
  90. X
  91. XContents
  92. X
  93. X    Contents
  94. X    File List
  95. X    Rights and Responsibilities
  96. X    Release Notes
  97. X    Compilation
  98. X    Synopsis
  99. X    Description
  100. X    Terms
  101. X    Options
  102. X    Environment
  103. X    Details
  104. X    Diagnostics
  105. X    Examples
  106. X    Limitations
  107. X    Bugs
  108. X
  109. X
  110. XFile List
  111. X
  112. X    The Par 1.20 package is always distributed with at least the following
  113. X    files:
  114. X
  115. X        buffer.h
  116. X        buffer.c
  117. X        failf.h
  118. X        failf.c
  119. X        par.1
  120. X        par.c
  121. X        par.doc
  122. X        protoMakefile
  123. X        reformat.h
  124. X        reformat.c
  125. X
  126. X    Each file is a text file which identifies itself on the second line, and
  127. X    identifies the version of Par to which it belongs on the third line,
  128. X    so you can always tell which file is which even if the files have been
  129. X    renamed.
  130. X
  131. X    The file "par.1" is a man page for the filter par (not to be confused
  132. X    with the package Par, which contains the source code for par). "par.1"
  133. X    is based on this doc file, and conveys much (not all) of the same
  134. X    information, but "par.doc" is the definitive documentation for both par
  135. X    and Par.
  136. X
  137. X
  138. XRights and Responsibilities
  139. X
  140. X    The files listed in the Files List section above are each Copyright 1993
  141. X    by Adam M. Costello (henceforth "I").
  142. X
  143. X    I grant everyone permission to use these files in any way, subject to
  144. X    the following two restrictions:
  145. X
  146. X     1) No one may distribute modifications of any of the files unless I am
  147. X        the one who modified them.
  148. X
  149. X     2) No one may distribute any one of the files unless it is accompanied
  150. X        by all of the other files.
  151. X
  152. X    I cannot disallow the distribution of patches, but I would prefer that
  153. X    users send me suggestions for changes so that I can incorporate them
  154. X    into future versions of Par. See the Bugs section for my addresses.
  155. X
  156. X    Though I have tried to make sure that Par is free of bugs, I make no
  157. X    guarantees about its soundness. Therefore, I am not responsible for any
  158. X    damage resulting from the use of these files.
  159. X
  160. X
  161. XRelease Notes
  162. X
  163. X    Each entry below describes changes since the previous version.
  164. X
  165. X    Par 1.00 released 25 July 1993
  166. X        The first release.
  167. X
  168. X    Par 1.10 released 2 August 1993
  169. X        Fixed the following bugs:
  170. X            In reformat.c I used sprintf() but forgot to #include <stdio.h>.
  171. X            I forgot to verify that <width> > <prefix> + <suffix>.
  172. X            The first word of a paragraph was expanded to include initial
  173. X            white characters, not just spaces, contrary to par.doc.
  174. X            Some invalid options were not complained about.
  175. X            NUL characters in the input were not handled.
  176. X            A pointer foul-up in freelines() in par.c could cause a crash.
  177. X        Added the following features:
  178. X            Multiple options may be concatenated into a single argument.
  179. X            The PARBODY environment variable.
  180. X            The j option.
  181. X            The f option.
  182. X            The t option.
  183. X        Removed the m option, since its function is better performed by the
  184. X            f and t options. Normally I would avoid making incompatible
  185. X            changes, unless I were doing a complete overhaul of the whole
  186. X            program, in which case I'd make the version number 2.00 to alert
  187. X            users to possible incompatibilities. However, in this particular
  188. X            instance I allowed an incompatibility in a minor upgrade because
  189. X            version 1.00 was distributed to only four people.
  190. X        Changed the handling of white characters: par now changes all of
  191. X            them (except newlines) to spaces as they are read. This is
  192. X            another incompatible change, excused for the same reason.
  193. X        Made all error messages begin with "par error:".
  194. X
  195. X    Par 1.20 released 10 Aug 1993
  196. X        Since Par 1.10 was distributed to no one, I've made some more
  197. X          incompatible change in Par 1.20.
  198. X        Paragraphs are now delimited by vacant rather than blank lines.
  199. X        <hang> now affects not only <prefix> but also <suffix>.
  200. X        Added the d[<div>] option.
  201. X
  202. X
  203. XCompilation
  204. X
  205. X    To compile par, you need an ANSI C compiler. Copy protoMakefile to
  206. X    Makefile and edit it, following the instructions in the comments. Then
  207. X    use make (or the equivalent on your system) to compile par.
  208. X
  209. X    If you have no make, compile each .c file into an object file and link
  210. X    all the object files together by whatever method works on your system.
  211. X    Then go look for a version of make that works on your system, since it
  212. X    will come in handy in the future.
  213. X
  214. X    If your compiler warns you about a pointer to a constant being converted
  215. X    to a pointer to a non-constant in line 404 of reformat.c, ignore it.
  216. X    Your compiler (like mine) is in error. What it thinks is a pointer to
  217. X    a constant is actually a pointer to a pointer to a constant, which is
  218. X    something quite different. The conversion is legal, and I don't think a
  219. X    correct ANSI C compiler would complain.
  220. X
  221. X    If your compiler generates any other warnings that you think are
  222. X    legitimate, please tell me about them (see the Bugs section).
  223. X
  224. X    Note that all variables in par are either constant or automatic (or
  225. X    both), which means that par can be made reentrant (if your compiler
  226. X    supports it). Given the right operating system, it should be possible
  227. X    for several par processes to share the same code space in memory.
  228. X
  229. X
  230. XSynopsis
  231. X
  232. X    par [version] [h[<hang>]] [p<prefix>] [s<suffix>] [w<width>]
  233. X        [d[<div>]] [f[<fit>]] [j[<just>]] [l[<last>]] [t[<touch>]]
  234. X
  235. X    Things enclosed in [square brackets] are optional. Things enclosed in
  236. X    <angle brackets> are variables.
  237. X
  238. X
  239. XDescription
  240. X
  241. X    par is a filter which copies its input to its output, changing all white
  242. X    characters (except newlines) to spaces, and reformatting each paragraph.
  243. X    Paragraphs are delimited by vacant lines, which are lines containing
  244. X    no more than a prefix, suffix, and intervening spaces (see the Details
  245. X    section for a precise definition).
  246. X
  247. X    Each output paragraph is generated from the corresponding input
  248. X    paragraph as follows:
  249. X
  250. X     1. An optional prefix and/or suffix is removed from each input line.
  251. X     2. The remainder is divided into words (delimited by spaces).
  252. X     3. The words are joined into lines to make an eye-pleasing paragraph.
  253. X     4. The prefixes and suffixes are reattached.
  254. X
  255. X     If there are suffixes, spaces are inserted before them so that they all
  256. X     end in the same column.
  257. X
  258. X
  259. XTerms
  260. X
  261. X    body        A member of the set of characters defined by the PARBODY
  262. X    character   environment variable (see the Environment section).
  263. X
  264. X    comprelen   The comprelen of a non-empty set of lines is the length of
  265. X                the longest string of non-body characters appearing at the
  266. X                beginning of every line in the set.
  267. X
  268. X    comsuflen   Given a non-empty set <S> of lines, let <p> be the comprelen
  269. X                of <S>. Let <T> be the set of lines which result from
  270. X                stripping the first <p> characters from each line in <S>.
  271. X                Let <c> be the longest string of non-body characters
  272. X                appearing at the end of every line in <T>. Strip <c> of all
  273. X                initial spaces except the last. The length of <c> is the
  274. X                comsuflen of <S>.
  275. X
  276. X    IP          Input paragraph.
  277. X
  278. X    OP          Output paragraph.
  279. X
  280. X    white       A space, formfeed, newline, carriage return, tab, or
  281. X    character   vertical tab.
  282. X
  283. X
  284. XOptions
  285. X
  286. X    Any command line argument may begin with one minus sign (-) which is
  287. X    ignored. Generally, more than one option may appear in a single command
  288. X    line argument, but there is one exception: the version option must have
  289. X    a whole argument all to itself.
  290. X
  291. X    version     Causes all remaining arguments to be ignored. No input is
  292. X                read. "par 1.20" is printed on the output. Of course, this
  293. X                will change in future releases of Par.
  294. X
  295. X    All remaining options are used to set values of variables. Values set by
  296. X    command line options hold for all paragraphs. Unset variables are given
  297. X    default values. Any unset variables whose default values depend on the
  298. X    IP are recomputed separately for each paragraph.
  299. X
  300. X    The approximate role of each variable is described here. See the Details
  301. X    section for a much more complete and precise description.
  302. X
  303. X    The first four variables, <hang>, <prefix>, <suffix>, and <width>, may
  304. X    be set to any unsigned decimal integer less than 10000.
  305. X
  306. X    h[<hang>]   Mainly affects the default values of <prefix> and <suffix>.
  307. X                Defaults to 0. If the h option is given without a number,
  308. X                the value 1 is inferred. (See also the p and s options.)
  309. X
  310. X    p<prefix>   The first <prefix> characters of each line of the OP
  311. X                are copied from the first <prefix> characters of the
  312. X                corresponding line of the IP. Defaults to 0 if there are
  313. X                less than <hang> + 2 lines in the IP. Otherwise, defaults to
  314. X                the comprelen of all the lines in the IP except the first
  315. X                <hang> of them. (See also the h option.)
  316. X
  317. X    s<suffix>   The last <suffix> characters of each line of the OP
  318. X                are copied from the last <suffix> characters of the
  319. X                corresponding line of the IP. Defaults to 0 if there are
  320. X                less than <hang> + 2 lines in the IP. Otherwise, defaults to
  321. X                the comsuflen of all the lines of the IP except the first
  322. X                <hang> of them. (See also the h option.)
  323. X
  324. X    w<width>    No line in the OP will contain more than <width> characters,
  325. X                not including the trailing newlines. Defaults to 72.
  326. X
  327. X    The remaining five variables, <div>, <fit>, <just>, <last>, and
  328. X    <touch>, may be set to either 0 or 1. If the number is absent in the
  329. X    option, the value 1 is inferred.
  330. X
  331. X    d[<div>]    If <div> is 1, then each block of text that would normally
  332. X                count as a paragraph (delimited by vacant lines) will be
  333. X                further subdivided into paragraphs as follows. Let <p> be
  334. X                the comprelen of all the lines in the block. Let a line's
  335. X                status be 1 if its (<p> + 1)st character is a space, 0
  336. X                otherwise. Every line in the block whose status is the same
  337. X                as the status of the first line will begin a new paragraph.
  338. X                Defaults to 0.
  339. X
  340. X    f[<fit>]    If <fit> is 1 and <just> is 0, par will try to make the
  341. X                lines in the OP as nearly the same length as possible, even
  342. X                if it means making the OP narrower. Defaults to 0. (See also
  343. X                the j option.)
  344. X
  345. X    j[<just>]   If <just> is 1, par justifies the OP, inserting spaces
  346. X                between words so that all lines in the OP have length
  347. X                <width> (except the last, if <last> is 0). <fit> has no
  348. X                effect if <just> is 1. Defaults to 0. (See also the w, l,
  349. X                and f options.)
  350. X
  351. X    l[<last>]   If <last> is 1, par tries to make the last line of the OP
  352. X                about the same length as the others. Defaults to 0.
  353. X
  354. X    t[<touch>]  Has no effect if <suffix> is 0 or <just> is 1. Otherwise,
  355. X                if <touch> is 0, all lines in the OP have length <width>.
  356. X                If <touch> is 1, then the length of the lines is decreased
  357. X                until the suffixes touch the body of the OP. Defaults to the
  358. X                logical OR of <fit> and <last>. (See also the s, j, w, f,
  359. X                and l options.)
  360. X
  361. X    If the value of any variable is set more than once, the last value
  362. X    is used. When unset variables are assigned default values, <hang> is
  363. X    assigned before <prefix>, and <fit> and <last> are assigned before
  364. X    <touch> (because of the dependencies).
  365. X
  366. X    It is an error if <width> <= <prefix> + <suffix>.
  367. X
  368. X
  369. XEnvironment
  370. X
  371. X    PARINIT     If set, par will read command line options from PARINIT
  372. X                before it reads them from the command line.
  373. X
  374. X    PARBODY     All and only the characters appearing in the value of
  375. X                PARBODY count as body characters (which are used for
  376. X                determining comprelens and comsuflens). The underscore is
  377. X                an escape character, which may begin the following escape
  378. X                sequences:
  379. X
  380. X                   __ = an underscore
  381. X                   _s = a space
  382. X                   _A = all upper case characters
  383. X                   _a = all lower case characters
  384. X                   _0 = all decimal digits
  385. X                 _xhh = the character represented by the two hexadecimal
  386. X                        digits hh (which may be upper or lower case)
  387. X
  388. X                If PARBODY is not set, there are no body characters.
  389. X
  390. X                A good value for PARBODY might be "_a_A.", but it depends on
  391. X                the application.
  392. X
  393. X    If a NUL character appears in the value of an environment variable, it
  394. X    and the rest of the string will not be seen by par.
  395. X
  396. X
  397. XDetails
  398. X
  399. X    Every white character in the input (unless it is a newline) is changed
  400. X    into a space immediately after it has been read. NUL characters in the
  401. X    input are invisible, just as if they weren't there at all.
  402. X
  403. X    Lines are terminated by newline characters, but the newlines are not
  404. X    considered to be included in the lines. If the last character of the
  405. X    input is a non-newline, then a newline will be inferred immediately
  406. X    after it (but if the input is empty, no newline will be inferred; the
  407. X    number of input lines will be 0). Thus, the input can always be viewed
  408. X    as a sequence of lines.
  409. X
  410. X    Vacant lines in the input are defined recursively by the following
  411. X    rules:
  412. X
  413. X     1) Any line which is empty or contains only spaces is vacant.
  414. X
  415. X     2) Suppose <A> and <B> are two vacant lines with at least two lines
  416. X        between them. Let <p> and <s> be the comprelen and comsuflen of
  417. X        the intervening lines. Any intervening line which, if stripped of
  418. X        its first <p> characters and last <s> characters, would be empty,
  419. X        or would contain only spaces, is vacant.
  420. X
  421. X     3) If a line cannot be shown to be vacant by repeated application of
  422. X        rules 1 and 2, then it is not vacant.
  423. X
  424. X    A subsequence of non-vacant lines in the input is called a block if
  425. X    there is no non-vacant line immediately above or below it (i.e., if it
  426. X    is maximal). If <div> is 0, then the IPs are exactly the blocks. If
  427. X    <div> is 1, then the IPs are the subdivisions of the blocks as described
  428. X    in the Options section in the entry for <div>.
  429. X
  430. X    Each vacant line of the input is copied to the output unchanged except
  431. X    that any trailing spaces are stripped. The remainder of this section
  432. X    describes the process which is applied independently to each IP to
  433. X    construct the corresponding OP.
  434. X
  435. X    After the values of the variables are determined (see the Options
  436. X    section), the first <prefix> characters and the last <suffix> characters
  437. X    of each input line are removed and remembered. It is an error for any
  438. X    line to contain fewer than <prefix> + <suffix> characters.
  439. X
  440. X    The remaining text is treated as a sequence of characters, not lines.
  441. X    The text is broken into words, which are delimited by spaces. That is, a
  442. X    word is a maximal sub-sequence of non-spaces. If there is at least one
  443. X    word, and the first word is preceeded only by spaces, then the first
  444. X    word is expanded to include those spaces.
  445. X
  446. X    Let <L> = <width> - <prefix> - <suffix>.
  447. X
  448. X    Every word which contains more than <L> characters is broken, after each
  449. X    <L>th character, into multiple words.
  450. X
  451. X    These words are reassembled, preserving their order, into lines. If
  452. X    <just> is 0, adjacent words within a line are separated by a single
  453. X    space, and line breaks are chosen so that the paragraph satisfies the
  454. X    following properties:
  455. X
  456. X         1) No line contains more than <L> characters.
  457. X
  458. X         2) If <fit> is 1, the difference between the lengths of the
  459. X            shortest and longest lines is as small as possible.
  460. X
  461. X         3) The shortest line is as long as possible, subject to properties
  462. X            1 and 2.
  463. X
  464. X         4) Let <target> be <L> if <fit> is 0, or the length of the longest
  465. X            line if <fit> is 1. The sum of the squares of the differences
  466. X            between <target> and the lengths of the lines is as small as
  467. X            possible, subject to properties 1, 2, and 3.
  468. X
  469. X        If <last> is 0, then the last line does not count as a line for the
  470. X        purposes of properties 2, 3, and 4 above.
  471. X
  472. X        If all the words fit on a single line, then the properties as worded
  473. X        above don't make much sense. In that case, no line breaks are
  474. X        inserted.
  475. X
  476. X    If <just> is 1, then adjacent words within a line are separated by one
  477. X    space plus zero or more extra spaces, the value of <fit> is disregarded,
  478. X    and line breaks are chosen so that the paragraph satisfies the following
  479. X    properties:
  480. X
  481. X         1) Every line contains exactly <L> characters.
  482. X
  483. X         2) The largest inter-word gap is as small as possible, subject to
  484. X            property 1.
  485. X
  486. X         3) The sum of the squares of the numbers of extra spaces required
  487. X            in each inter-word gap is as small as possible, subject to
  488. X            properties 1 and 2.
  489. X
  490. X        If <last> is 0, then the last line does not count as a line for the
  491. X        purposes of property 1, and it does not require or contain any extra
  492. X        spaces.
  493. X
  494. X        Extra spaces are distributed as uniformly as possible among the
  495. X        inter-word gaps in each line.
  496. X
  497. X        Some paragraphs are impossible to justify, because they contain
  498. X        words too long relative to <L>. If this is the case, it is
  499. X        considered an error (see the Diagnostics section).
  500. X
  501. X    If the number of lines in the resulting paragraph is less than <hang>,
  502. X    then empty lines are added at the end to bring the number of lines up to
  503. X    <hang>.
  504. X
  505. X    If <just> is 0 and <touch> is 1, then <L> is changed to be the length of
  506. X    the longest line.
  507. X
  508. X    If <suffix> is not 0, then each line is padded at the end with spaces to
  509. X    bring its length up to <L>.
  510. X
  511. X    To each line is prepended <prefix> characters. Let <n> be the number of
  512. X    lines in the IP. The characters which are prepended to the <i>th line are
  513. X    chosen as follows:
  514. X
  515. X     1) If <i> <= <n>, then the characters are copied from the ones that
  516. X        were removed from the beginning of the <n>th input line.
  517. X
  518. X     2) If <i> > <n> > <hang>, then the characters are copied from the ones
  519. X        that were removed from the beginning of the last input line.
  520. X
  521. X     3) If <i> > <n> and <n> <= <hang>, then the characters are all spaces.
  522. X
  523. X    Then to each line is appended <suffix> characters. The characters which
  524. X    are appended to the <i>th line are chosen as follows:
  525. X
  526. X     1) If <i> <= <n>, then the characters are copied from the ones that
  527. X        were removed from the end of the nth input line.
  528. X
  529. X     2) If <i> > <n> > 0, then the characters are copied from the ones that
  530. X        were removed from the end of the last input line.
  531. X
  532. X     3) If <n> = 0, then the characters are all spaces.
  533. X
  534. X    Finally, the lines are printed to the output as the OP.
  535. X
  536. X
  537. XDiagnostics
  538. X
  539. X    If there are no errors, par returns EXIT_SUCCESS (see <stdlib.h>).
  540. X
  541. X    If there is an error, then an error message will be printed to the
  542. X    output, and par will return EXIT_FAILURE. If the error is local to a
  543. X    single paragraph, then the preceeding paragraphs will have been output
  544. X    before the error was detected. Line numbers in error messages are local
  545. X    to the IP in which the error occurred. All error messages begin with
  546. X    "par error:" on a line by itself.
  547. X
  548. X    Of course, trying to print an error message would be futile if an error
  549. X    resulted from an output function, so par doesn't bother doing any error
  550. X    checking on output functions.
  551. X
  552. X
  553. XExamples
  554. X
  555. X    The superiority of par's dynamic programming algorithm over a greedy
  556. X    algorithm (such as the one used by fmt) can be seen in the following
  557. X    example:
  558. X
  559. X    Original paragraph:
  560. X
  561. X        We the people of the United States,
  562. X        in order to form a more perfect union,
  563. X        establish justice,
  564. X        insure domestic tranquility,
  565. X        provide for the common defense,
  566. X        promote the general welfare,
  567. X        and secure the blessing of liberty
  568. X        to ourselves and our posterity,
  569. X        do ordain and establish the Constitution
  570. X        of the United States of America.
  571. X
  572. X    After a greedy algorithm with width = 39:
  573. X
  574. X        We the people of the United
  575. X        States, in order to form a more
  576. X        perfect union, establish
  577. X        establish justice, insure
  578. X        domestic tranquility, provide
  579. X        for the common defense, promote
  580. X        the general welfare, and secure
  581. X        the blessing of liberty to
  582. X        ourselves and our posterity, do
  583. X        ordain and establish the
  584. X        Constitution of the United
  585. X        States of America.
  586. X
  587. X    After "par 39":
  588. X
  589. X        We the people of the United    
  590. X        States, in order to form a     
  591. X        more perfect union, establish  
  592. X        justice, insure domestic       
  593. X        tranquility, provide for the   
  594. X        common defense, promote the    
  595. X        general welfare, and secure    
  596. X        the blessing of liberty to     
  597. X        ourselves and our posterity,   
  598. X        do ordain and establish the    
  599. X        Constitution of the United     
  600. X        States of America.             
  601. X
  602. X    The line breaks chosen by par are clearly more eye-pleasing.
  603. X
  604. X    par is most useful in conjunction with the text-filtering features of an
  605. X    editor, such as the ! commands of vi.
  606. X
  607. X    The rest of this section is a series of before-and-after pictures
  608. X    showing some typical uses of par.
  609. X
  610. X    Before:
  611. X
  612. X        /*   We the people of the United States, */
  613. X        /* in order to form a more perfect union, */
  614. X        /* establish justice, */
  615. X        /* insure domestic tranquility, */
  616. X        /* provide for the common defense, */
  617. X        /* promote the general welfare, */
  618. X        /* and secure the blessing of liberty */
  619. X        /* to ourselves and our posterity, */
  620. X        /* do ordain and establish the Constitution */
  621. X        /* of the United States of America. */
  622. X
  623. X    After "par 59":
  624. X
  625. X        /*   We the people of the United States, in      */
  626. X        /* order to form a more perfect union, establish */
  627. X        /* justice, insure domestic tranquility, provide */
  628. X        /* for the common defense, promote the general   */
  629. X        /* welfare, and secure the blessing of liberty   */
  630. X        /* to ourselves and our posterity, do ordain     */
  631. X        /* and establish the Constitution of the United  */
  632. X        /* States of America.                            */
  633. X
  634. X    Or after "par 59f":
  635. X
  636. X        /*   We the people of the United States,  */
  637. X        /* in order to form a more perfect union, */
  638. X        /* establish justice, insure domestic     */
  639. X        /* tranquility, provide for the common    */
  640. X        /* defense, promote the general welfare,  */
  641. X        /* and secure the blessing of liberty to  */
  642. X        /* ourselves and our posterity, do ordain */
  643. X        /* and establish the Constitution of the  */
  644. X        /* United States of America.              */
  645. X
  646. X    Or after "par 59l":
  647. X
  648. X        /*   We the people of the United States, in      */
  649. X        /* order to form a more perfect union, establish */
  650. X        /* justice, insure domestic tranquility,         */
  651. X        /* provide for the common defense, promote       */
  652. X        /* the general welfare, and secure the           */
  653. X        /* blessing of liberty to ourselves and our      */
  654. X        /* posterity, do ordain and establish the        */
  655. X        /* Constitution of the United States of America. */
  656. X
  657. X    Or after "par 59lf":
  658. X
  659. X        /*   We the people of the United States,  */
  660. X        /* in order to form a more perfect union, */
  661. X        /* establish justice, insure domestic     */
  662. X        /* tranquility, provide for the common    */
  663. X        /* defense, promote the general welfare,  */
  664. X        /* and secure the blessing of liberty     */
  665. X        /* to ourselves and our posterity, do     */
  666. X        /* ordain and establish the Constitution  */
  667. X        /* of the United States of America.       */
  668. X
  669. X    Or after "par 59lft0":
  670. X
  671. X        /*   We the people of the United States,         */
  672. X        /* in order to form a more perfect union,        */
  673. X        /* establish justice, insure domestic            */
  674. X        /* tranquility, provide for the common           */
  675. X        /* defense, promote the general welfare,         */
  676. X        /* and secure the blessing of liberty            */
  677. X        /* to ourselves and our posterity, do            */
  678. X        /* ordain and establish the Constitution         */
  679. X        /* of the United States of America.              */
  680. X
  681. X    Or after "par 59j":
  682. X
  683. X        /*   We  the people  of  the  United States,  in */
  684. X        /* order to form a more perfect union, establish */
  685. X        /* justice, insure domestic tranquility, provide */
  686. X        /* for the  common defense, promote  the general */
  687. X        /* welfare, and  secure the blessing  of liberty */
  688. X        /* to ourselves and our posterity, do ordain and */
  689. X        /* establish  the  Constitution  of  the  United */
  690. X        /* States of America.                            */
  691. X
  692. X    Or after "par 59jl":
  693. X
  694. X        /*   We  the   people  of  the   United  States, */
  695. X        /* in   order    to   form   a    more   perfect */
  696. X        /* union,  establish  justice,  insure  domestic */
  697. X        /* tranquility, provide for  the common defense, */
  698. X        /* promote  the  general   welfare,  and  secure */
  699. X        /* the  blessing  of  liberty to  ourselves  and */
  700. X        /* our  posterity, do  ordain and  establish the */
  701. X        /* Constitution of the United States of America. */
  702. X
  703. X    Before:
  704. X
  705. X        Preamble      We the people of the United States,
  706. X        to the US     in order to form
  707. X        Constitution  a more perfect union,
  708. X                      establish justice,
  709. X                      insure domestic tranquility,
  710. X                      provide for the common defense,
  711. X                      promote the general welfare,
  712. X                      and secure the blessing of liberty
  713. X                      to ourselves and our posterity,
  714. X                      do ordain and establish
  715. X                      the Constitution
  716. X                      of the United States of America.
  717. X
  718. X    After "par 52h3":
  719. X
  720. X        Preamble      We the people of the United
  721. X        to the US     States, in order to form a
  722. X        Constitution  more perfect union, establish
  723. X                      justice, insure domestic
  724. X                      tranquility, provide for the
  725. X                      common defense, promote the
  726. X                      general welfare, and secure
  727. X                      the blessing of liberty to
  728. X                      ourselves and our posterity,
  729. X                      do ordain and establish the
  730. X                      Constitution of the United
  731. X                      States of America.
  732. X
  733. X    Before:
  734. X
  735. X         1  We the people of the United States,
  736. X         2  in order to form a more perfect union,
  737. X         3  establish justice,
  738. X         4  insure domestic tranquility,
  739. X         5  provide for the common defense,
  740. X         6  promote the general welfare,
  741. X         7  and secure the blessing of liberty
  742. X         8  to ourselves and our posterity,
  743. X         9  do ordain and establish the Constitution
  744. X        10  of the United States of America.
  745. X
  746. X    After "par 59p12l":
  747. X
  748. X         1  We the people of the United States, in order to
  749. X         2  form a more perfect union, establish justice,
  750. X         3  insure domestic tranquility, provide for the
  751. X         4  common defense, promote the general welfare,
  752. X         5  and secure the blessing of liberty to ourselves
  753. X         6  and our posterity, do ordain and establish the
  754. X         7  Constitution of the United States of America.
  755. X
  756. X    Before:
  757. X
  758. X        > >   We the people of the United States, in
  759. X        > > order to form a more perfect union,
  760. X        > >   Establish justice, ensure domestic
  761. X        > > tranquility, provide for the common defense,
  762. X        >
  763. X        >   Promote the general welfare, and secure
  764. X        > the blessing of liberty to ourselves and
  765. X        > our posterity,
  766. X        >   Do ordain and establish the Constitution
  767. X        > of the United States of America.
  768. X
  769. X    After "par 42d":
  770. X
  771. X        > >   We the people of the United
  772. X        > > States, in order to form a
  773. X        > > more perfect union,
  774. X        > >   Establish justice, ensure
  775. X        > > domestic tranquility, provide
  776. X        > > for the common defense,
  777. X        >
  778. X        >   Promote the general welfare,
  779. X        > and secure the blessing of
  780. X        > liberty to ourselves and our
  781. X        > posterity,
  782. X        >   Do ordain and establish the
  783. X        > Constitution of the United
  784. X        > States of America.
  785. X
  786. X
  787. XLimitations
  788. X
  789. X    If you like two spaces between sentences, too bad. Differentiating
  790. X    between periods that end sentences and periods used in abbreviations is
  791. X    a complex problem beyond the scope of this simple filter. Consider the
  792. X    following tough case:
  793. X
  794. X        I calc'd the approx.
  795. X        Fermi level to 3 sig. digits.
  796. X
  797. X    Suppose that that should be reformatted to:
  798. X
  799. X        I calc'd the approx. Fermi
  800. X        level to three sig. digits.
  801. X
  802. X    The program has to decide whether to put 1 or 2 spaces between "approx."
  803. X    and "Fermi". There is no obvious hint from the original paragraph
  804. X    because there was a line break between them, and "Fermi" begins with a
  805. X    capital letter. The program would apparently have to understand English
  806. X    grammar to determine that the sentence does not end there (and then it
  807. X    would only work for English text).
  808. X
  809. X    If you use tabs, you probably won't like the way par handles (or doesn't
  810. X    handle) them. It turns them into spaces. I didn't bother trying to
  811. X    make sense of tabs because they don't make sense to begin with. Not
  812. X    everyone's terminal has the same tab settings, so text files containing
  813. X    tabs are sometimes mangled. In fact, almost every text file containing
  814. X    tabs gets mangled when something is inserted at the beginning of each
  815. X    line (when quoting e-mail or commenting out a section of a shell script,
  816. X    for example), making them a pain to edit. In my opinion, the world would
  817. X    be a nicer place if everyone stopped using tabs (so I'm doing my part by
  818. X    not supporting them in par.)
  819. X
  820. X    There is currently no way for the length of the output prefix to differ
  821. X    from the length of the input prefix. Ditto for the suffix. I may
  822. X    consider adding this capability in a future release, but right now I'm
  823. X    not sure how I'd want it to work.
  824. X
  825. X
  826. XBugs
  827. X
  828. X    If I knew of any bugs, I wouldn't release the package. Of course, there
  829. X    may be bugs that I haven't yet discovered.
  830. X
  831. X    If you find any bugs, or if you have any suggestions, please send e-mail
  832. X    to:
  833. X
  834. X        amc@ecl.wustl.edu
  835. X
  836. X    or send paper mail to:
  837. X
  838. X        Adam M. Costello
  839. X        Campus Box 1045
  840. X        Washington University
  841. X        One Brookings Dr.
  842. X        St. Louis, MO 63130
  843. X        USA
  844. X
  845. X    Note that both addresses could change anytime after June 1994.
  846. X
  847. X    When reporting a bug, please include the exact input and command line
  848. X    options used, and the version number of par, so that I can reproduce it.
  849. END_OF_FILE
  850. if test 31676 -ne `wc -c <'Par120/par.doc'`; then
  851.     echo shar: \"'Par120/par.doc'\" unpacked with wrong size!
  852. fi
  853. # end of 'Par120/par.doc'
  854. fi
  855. if test -f 'Par120/buffer.c' -a "${1}" != "-c" ; then 
  856.   echo shar: Will not clobber existing file \"'Par120/buffer.c'\"
  857. else
  858. echo shar: Extracting \"'Par120/buffer.c'\" \(4696 characters\)
  859. sed "s/^X//" >'Par120/buffer.c' <<'END_OF_FILE'
  860. X/*********************/
  861. X/* buffer.c          */
  862. X/* for Par 1.20      */
  863. X/* Copyright 1993 by */
  864. X/* Adam M. Costello  */
  865. X/*********************/
  866. X
  867. X/* This is ANSI C code. */
  868. X
  869. X
  870. X/* additem(), copyitems(), and nextitem() rely   */
  871. X/* on the fact that sizeof (char) is 1. See      */
  872. X/* section A7.4.8 of The C Programming Language, */
  873. X/* Second Edition, by Kerninghan and Ritchie.    */
  874. X
  875. X
  876. X#include "buffer.h"  /* Makes sure we're consistent with the prototypes. */
  877. X                     /* Also includes <stddef.h> and "errmsg.h".         */
  878. X
  879. X#include <stdlib.h>
  880. X#include <string.h>
  881. X
  882. X#undef NULL
  883. X#define NULL ((void *) 0)
  884. X
  885. X#ifdef DONTFREE
  886. X#define free(ptr)
  887. X#endif
  888. X
  889. X
  890. Xstruct buffer {
  891. X  struct block *firstblk, /* The first block.                    */
  892. X               *current,  /* The last non-empty block, or        */
  893. X                          /* firstblk if all are empty.          */
  894. X               *nextblk;  /* The block containing the item to be */
  895. X                          /* returned by nextitem(), or NULL.    */
  896. X  int nextindex;          /* Index of item in nextblock->items.  */
  897. X  size_t itemsize;        /* The size of an item.                */
  898. X};
  899. X
  900. Xstruct block {
  901. X  struct block *next;  /* The next block, or NULL if none.              */
  902. X  void *items;         /* Storage for the items in this block.          */
  903. X  int maxhere,         /* Number of items that fit in *items.           */
  904. X      numprevious,     /* Total of numhere for all previous blocks.     */
  905. X      numhere;         /* The first numhere slots in *items are filled. */
  906. X};
  907. X
  908. X
  909. Xstruct buffer *newbuffer(size_t itemsize, errmsg_t errmsg)
  910. X{
  911. X  struct buffer *buf;
  912. X  struct block *blk;
  913. X  void *items;
  914. X  int maxhere;
  915. X
  916. X  maxhere = 124 / itemsize;
  917. X  if (maxhere < 4) maxhere = 4;
  918. X
  919. X  buf = (struct buffer *) malloc(sizeof (struct buffer));
  920. X  blk = (struct block *) malloc(sizeof (struct block));
  921. X  items = malloc(maxhere * itemsize);
  922. X  if (!buf || !blk || !items) {
  923. X    strcpy(errmsg,outofmem);
  924. X    goto nberror;
  925. X  }
  926. X
  927. X  buf->itemsize = itemsize;
  928. X  buf->firstblk = buf->current = buf->nextblk = blk;
  929. X  buf->nextindex = 0;
  930. X  blk->next = NULL;
  931. X  blk->numprevious = blk->numhere = 0;
  932. X  blk->maxhere = maxhere;
  933. X  blk->items = items;
  934. X
  935. X  *errmsg = '\0';
  936. X  return buf;
  937. X
  938. X  nberror:
  939. X  if (buf) free(buf);
  940. X  if (blk) free(blk);
  941. X  if (items) free(items);
  942. X  return NULL;
  943. X}
  944. X
  945. X
  946. Xvoid freebuffer(struct buffer *buf)
  947. X{
  948. X  struct block *blk, *tmp;
  949. X
  950. X  blk = buf->firstblk;
  951. X  while (blk) {
  952. X    tmp = blk;
  953. X    blk = blk->next;
  954. X    if (tmp->items) free(tmp->items);
  955. X    free(tmp);
  956. X  }
  957. X
  958. X  free(buf);
  959. X}
  960. X
  961. X
  962. Xvoid clearbuffer(struct buffer *buf)
  963. X{
  964. X  struct block *blk;
  965. X
  966. X  for (blk = buf->firstblk;  blk;  blk = blk->next)
  967. X    blk->numhere = 0;
  968. X
  969. X  buf->current = buf->firstblk;
  970. X}
  971. X
  972. X
  973. Xvoid additem(struct buffer *buf, const void *item, errmsg_t errmsg)
  974. X{
  975. X  struct block *blk, *new;
  976. X  void *items;
  977. X  int maxhere;
  978. X  size_t itemsize = buf->itemsize;
  979. X
  980. X  blk = buf->current;
  981. X
  982. X  if (blk->numhere == blk->maxhere) {
  983. X    new = blk->next;
  984. X    if (!new) {
  985. X      maxhere = 2 * blk->maxhere;
  986. X      new = (struct block * ) malloc(sizeof (struct block));
  987. X      items = malloc(maxhere * itemsize);
  988. X      if (!new || !items) {
  989. X        strcpy(errmsg,outofmem);
  990. X        goto aierror;
  991. X      }
  992. X      blk->next = new;
  993. X      new->next = NULL;
  994. X      new->maxhere = maxhere;
  995. X      new->numprevious = blk->numprevious + blk->numhere;
  996. X      new->numhere = 0;
  997. X      new->items = items;
  998. X    }
  999. X    blk = buf->current = new;
  1000. X  }
  1001. X
  1002. X  memcpy( ((char *) blk->items) + (blk->numhere * itemsize), item, itemsize );
  1003. X
  1004. X  ++blk->numhere;
  1005. X
  1006. X  *errmsg = '\0';
  1007. X  return;
  1008. X
  1009. X  aierror:
  1010. X  if (new) free(new);
  1011. X  if (items) free(items);
  1012. X}
  1013. X
  1014. X
  1015. Xint numitems(struct buffer *buf)
  1016. X{
  1017. X  struct block *blk = buf->current;
  1018. X  return blk->numprevious + blk->numhere;
  1019. X}
  1020. X
  1021. X
  1022. Xvoid *copyitems(struct buffer *buf, errmsg_t errmsg)
  1023. X{
  1024. X  int n;
  1025. X  void *r;
  1026. X  struct block *blk, *b;
  1027. X  size_t itemsize = buf->itemsize;
  1028. X
  1029. X  b = buf->current;
  1030. X  n = b->numprevious + b->numhere;
  1031. X  if (!n) return NULL;
  1032. X
  1033. X  r = malloc(n * itemsize);
  1034. X  if (!r) {
  1035. X    strcpy(errmsg,outofmem);
  1036. X    return NULL;
  1037. X  }
  1038. X
  1039. X  b = b->next;
  1040. X
  1041. X  for (blk = buf->firstblk;  blk != b;  blk = blk->next)
  1042. X    memcpy( ((char *) r) + (blk->numprevious * itemsize),
  1043. X            blk->items, blk->numhere * itemsize);
  1044. X
  1045. X  *errmsg = '\0';
  1046. X  return r;
  1047. X}
  1048. X
  1049. X
  1050. Xvoid rewindbuffer(struct buffer *buf)
  1051. X{
  1052. X  buf->nextblk = buf->firstblk;
  1053. X  buf->nextindex = 0;
  1054. X}
  1055. X
  1056. X
  1057. Xvoid *nextitem(struct buffer *buf)
  1058. X{
  1059. X  void *r;
  1060. X
  1061. X  if (!buf->nextblk || buf->nextindex >= buf->nextblk->numhere)
  1062. X    return NULL;
  1063. X
  1064. X  r = ((char *) buf->nextblk->items) + (buf->nextindex * buf->itemsize);
  1065. X
  1066. X  if (++buf->nextindex >= buf->nextblk->maxhere) {
  1067. X    buf->nextblk = buf->nextblk->next;
  1068. X    buf->nextindex = 0;
  1069. X  }
  1070. X
  1071. X  return r;
  1072. X}
  1073. END_OF_FILE
  1074. if test 4696 -ne `wc -c <'Par120/buffer.c'`; then
  1075.     echo shar: \"'Par120/buffer.c'\" unpacked with wrong size!
  1076. fi
  1077. # end of 'Par120/buffer.c'
  1078. fi
  1079. if test -f 'Par120/buffer.h' -a "${1}" != "-c" ; then 
  1080.   echo shar: Will not clobber existing file \"'Par120/buffer.h'\"
  1081. else
  1082. echo shar: Extracting \"'Par120/buffer.h'\" \(2367 characters\)
  1083. sed "s/^X//" >'Par120/buffer.h' <<'END_OF_FILE'
  1084. X/*********************/
  1085. X/* buffer.h          */
  1086. X/* for Par 1.20      */
  1087. X/* Copyright 1993 by */
  1088. X/* Adam M. Costello  */
  1089. X/*********************/
  1090. X
  1091. X/* This is ANSI C code. */
  1092. X
  1093. X
  1094. X/* Note: Those functions declared here which do not use errmsg    */
  1095. X/* always succeed, provided that they are passed valid arguments. */
  1096. X
  1097. X
  1098. X#include "errmsg.h"
  1099. X
  1100. X#include <stddef.h>
  1101. X
  1102. X
  1103. Xstruct buffer;
  1104. X
  1105. X
  1106. Xstruct buffer *newbuffer(size_t itemsize, errmsg_t errmsg);
  1107. X
  1108. X  /* newbuffer(itemsize,errmsg) returns a pointer to */
  1109. X  /* a new empty struct buffer which holds items of  */
  1110. X  /* size itemsize. Any struct buffer *buf passed to */
  1111. X  /* any function declared in this header must have  */
  1112. X  /* been obtained from this function. itemsize must */
  1113. X  /* not be 0. Returns NULL on failure.              */
  1114. X
  1115. X
  1116. Xvoid freebuffer(struct buffer *buf);
  1117. X
  1118. X  /* freebuffer(buf) frees the memory associated     */
  1119. X  /* with *buf. buf may not be used after this call. */
  1120. X
  1121. X
  1122. Xvoid clearbuffer(struct buffer *buf);
  1123. X
  1124. X  /* clearbuffer(buf) removes  */
  1125. X  /* all items from *buf, but  */
  1126. X  /* does not free any memory. */
  1127. X
  1128. X
  1129. Xvoid additem(struct buffer *buf, const void *item, errmsg_t errmsg);
  1130. X
  1131. X  /* additem(buf,item,errmsg) copies *item to the end of *buf. */
  1132. X  /* item must point to an object of the proper size for *buf. */
  1133. X
  1134. X
  1135. Xint numitems(struct buffer *buf);
  1136. X
  1137. X  /* numitems(buf) returns the number of items in *buf. */
  1138. X
  1139. X
  1140. Xvoid *copyitems(struct buffer *buf, errmsg_t errmsg);
  1141. X
  1142. X  /* copyitems(buf,errmsg) returns an array of objects of the proper size */
  1143. X  /* for *buf, one for each item in *buf, or (void *) 0 if there are no   */
  1144. X  /* items in buf. The elements of the array are copied from the items in */
  1145. X  /* *buf, in order. The array is allocated with malloc(), so it may be   */
  1146. X  /* freed with free(). Returns NULL on failure.                          */
  1147. X
  1148. X
  1149. Xvoid *nextitem(struct buffer *buf);
  1150. X
  1151. X  /* When buf was created by newbuffer, a pointer associated with buf  */
  1152. X  /* was initialized to point at the first slot in buf. If there is an */
  1153. X  /* item in this slot, nextitem(buf) advances the pointer to the next */
  1154. X  /* slot and returns the old value. If there is no item in the slot,  */
  1155. X  /* nextitem(buf) leaves the pointer where it is and returns NULL.    */
  1156. X
  1157. X
  1158. Xvoid rewindbuffer(struct buffer *buf);
  1159. X
  1160. X  /* rewindbuffer(buf) resets the pointer used by  */
  1161. X  /* nextitem() to point at the first slot in buf. */
  1162. END_OF_FILE
  1163. if test 2367 -ne `wc -c <'Par120/buffer.h'`; then
  1164.     echo shar: \"'Par120/buffer.h'\" unpacked with wrong size!
  1165. fi
  1166. # end of 'Par120/buffer.h'
  1167. fi
  1168. if test -f 'Par120/errmsg.c' -a "${1}" != "-c" ; then 
  1169.   echo shar: Will not clobber existing file \"'Par120/errmsg.c'\"
  1170. else
  1171. echo shar: Extracting \"'Par120/errmsg.c'\" \(303 characters\)
  1172. sed "s/^X//" >'Par120/errmsg.c' <<'END_OF_FILE'
  1173. X/*********************/
  1174. X/* errmsg.c          */
  1175. X/* for Par 1.20      */
  1176. X/* Copyright 1993 by */
  1177. X/* Adam M. Costello  */
  1178. X/*********************/
  1179. X
  1180. X/* This is ANSI C code. */
  1181. X
  1182. X
  1183. X#include "errmsg.h"  /* Makes sure we're consistent with the declaration. */
  1184. X
  1185. X
  1186. Xconst char * const outofmem = "Out of memory.\n";
  1187. END_OF_FILE
  1188. if test 303 -ne `wc -c <'Par120/errmsg.c'`; then
  1189.     echo shar: \"'Par120/errmsg.c'\" unpacked with wrong size!
  1190. fi
  1191. # end of 'Par120/errmsg.c'
  1192. fi
  1193. if test -f 'Par120/errmsg.h' -a "${1}" != "-c" ; then 
  1194.   echo shar: Will not clobber existing file \"'Par120/errmsg.h'\"
  1195. else
  1196. echo shar: Extracting \"'Par120/errmsg.h'\" \(688 characters\)
  1197. sed "s/^X//" >'Par120/errmsg.h' <<'END_OF_FILE'
  1198. X/*********************/
  1199. X/* errmsg.h          */
  1200. X/* for Par 1.20      */
  1201. X/* Copyright 1993 by */
  1202. X/* Adam M. Costello  */
  1203. X/*********************/
  1204. X
  1205. X/* This is ANSI C code. */
  1206. X
  1207. X
  1208. X#ifndef ERRMSG_H
  1209. X#define ERRMSG_H
  1210. X
  1211. X
  1212. X#define errmsg_size 163  /* This will never decrease, but may increase. */
  1213. X
  1214. Xtypedef char errmsg_t[errmsg_size];
  1215. X
  1216. X/* Any function which takes the argument errmsg_t errmsg must, before */
  1217. X/* returning, either set errmsg[0] to '\0' (indicating success), or   */
  1218. X/* write an error message string into errmsg, (indicating failure),   */
  1219. X/* being careful not to overrun the space.                            */
  1220. X
  1221. X
  1222. Xextern const char * const outofmem;  /* "Out of memory.\n" */
  1223. X
  1224. X
  1225. X#endif
  1226. END_OF_FILE
  1227. if test 688 -ne `wc -c <'Par120/errmsg.h'`; then
  1228.     echo shar: \"'Par120/errmsg.h'\" unpacked with wrong size!
  1229. fi
  1230. # end of 'Par120/errmsg.h'
  1231. fi
  1232. echo shar: End of shell archive.
  1233. exit 0
  1234.  
  1235. exit 0 # Just in case...
  1236.