home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume41 / p2latex / part02 < prev    next >
Encoding:
Text File  |  1994-01-09  |  53.9 KB  |  1,417 lines

  1. Newsgroups: comp.sources.misc
  2. From: torsten@diku.dk (Torsten Poulin Nielsen)
  3. Subject: v41i084:  p2latex - Pascal to LaTeX v1.0, Part02/03
  4. Message-ID: <1994Jan10.035552.13730@sparky.sterling.com>
  5. X-Md4-Signature: 30d3bc707c3bc5f81604f58a962bbe00
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Mon, 10 Jan 1994 03:55:52 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: torsten@diku.dk (Torsten Poulin Nielsen)
  12. Posting-number: Volume 41, Issue 84
  13. Archive-name: p2latex/part02
  14. Environment: UNIX, AmigaDOS
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then feed it
  18. # into a shell via "sh file" or similar.  To overwrite existing files,
  19. # type "sh file -c".
  20. # Contents:  LICENSE Makefile.amiga allocate.c getopt.c p2latex.0.UU
  21. #   version.c
  22. # Wrapped by kent@sparky on Sun Jan  9 21:45:40 1994
  23. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
  24. echo If this archive is complete, you will see the following message:
  25. echo '          "shar: End of archive 2 (of 3)."'
  26. if test -f 'LICENSE' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'LICENSE'\"
  28. else
  29.   echo shar: Extracting \"'LICENSE'\" \(17983 characters\)
  30.   sed "s/^X//" >'LICENSE' <<'END_OF_FILE'
  31. X
  32. X            GNU GENERAL PUBLIC LICENSE
  33. X               Version 2, June 1991
  34. X
  35. X Copyright (C) 1989, 1991 Free Software Foundation, Inc.
  36. X                          675 Mass Ave, Cambridge, MA 02139, USA
  37. X Everyone is permitted to copy and distribute verbatim copies
  38. X of this license document, but changing it is not allowed.
  39. X
  40. X                Preamble
  41. X
  42. X  The licenses for most software are designed to take away your
  43. Xfreedom to share and change it.  By contrast, the GNU General Public
  44. XLicense is intended to guarantee your freedom to share and change free
  45. Xsoftware--to make sure the software is free for all its users.  This
  46. XGeneral Public License applies to most of the Free Software
  47. XFoundation's software and to any other program whose authors commit to
  48. Xusing it.  (Some other Free Software Foundation software is covered by
  49. Xthe GNU Library General Public License instead.)  You can apply it to
  50. Xyour programs, too.
  51. X
  52. X  When we speak of free software, we are referring to freedom, not
  53. Xprice.  Our General Public Licenses are designed to make sure that you
  54. Xhave the freedom to distribute copies of free software (and charge for
  55. Xthis service if you wish), that you receive source code or can get it
  56. Xif you want it, that you can change the software or use pieces of it
  57. Xin new free programs; and that you know you can do these things.
  58. X
  59. X  To protect your rights, we need to make restrictions that forbid
  60. Xanyone to deny you these rights or to ask you to surrender the rights.
  61. XThese restrictions translate to certain responsibilities for you if you
  62. Xdistribute copies of the software, or if you modify it.
  63. X
  64. X  For example, if you distribute copies of such a program, whether
  65. Xgratis or for a fee, you must give the recipients all the rights that
  66. Xyou have.  You must make sure that they, too, receive or can get the
  67. Xsource code.  And you must show them these terms so they know their
  68. Xrights.
  69. X
  70. X  We protect your rights with two steps: (1) copyright the software, and
  71. X(2) offer you this license which gives you legal permission to copy,
  72. Xdistribute and/or modify the software.
  73. X
  74. X  Also, for each author's protection and ours, we want to make certain
  75. Xthat everyone understands that there is no warranty for this free
  76. Xsoftware.  If the software is modified by someone else and passed on, we
  77. Xwant its recipients to know that what they have is not the original, so
  78. Xthat any problems introduced by others will not reflect on the original
  79. Xauthors' reputations.
  80. X
  81. X  Finally, any free program is threatened constantly by software
  82. Xpatents.  We wish to avoid the danger that redistributors of a free
  83. Xprogram will individually obtain patent licenses, in effect making the
  84. Xprogram proprietary.  To prevent this, we have made it clear that any
  85. Xpatent must be licensed for everyone's free use or not licensed at all.
  86. X
  87. X  The precise terms and conditions for copying, distribution and
  88. Xmodification follow.
  89. X
  90. X            GNU GENERAL PUBLIC LICENSE
  91. X   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  92. X
  93. X  0. This License applies to any program or other work which contains
  94. Xa notice placed by the copyright holder saying it may be distributed
  95. Xunder the terms of this General Public License.  The "Program", below,
  96. Xrefers to any such program or work, and a "work based on the Program"
  97. Xmeans either the Program or any derivative work under copyright law:
  98. Xthat is to say, a work containing the Program or a portion of it,
  99. Xeither verbatim or with modifications and/or translated into another
  100. Xlanguage.  (Hereinafter, translation is included without limitation in
  101. Xthe term "modification".)  Each licensee is addressed as "you".
  102. X
  103. XActivities other than copying, distribution and modification are not
  104. Xcovered by this License; they are outside its scope.  The act of
  105. Xrunning the Program is not restricted, and the output from the Program
  106. Xis covered only if its contents constitute a work based on the
  107. XProgram (independent of having been made by running the Program).
  108. XWhether that is true depends on what the Program does.
  109. X
  110. X  1. You may copy and distribute verbatim copies of the Program's
  111. Xsource code as you receive it, in any medium, provided that you
  112. Xconspicuously and appropriately publish on each copy an appropriate
  113. Xcopyright notice and disclaimer of warranty; keep intact all the
  114. Xnotices that refer to this License and to the absence of any warranty;
  115. Xand give any other recipients of the Program a copy of this License
  116. Xalong with the Program.
  117. X
  118. XYou may charge a fee for the physical act of transferring a copy, and
  119. Xyou may at your option offer warranty protection in exchange for a fee.
  120. X
  121. X  2. You may modify your copy or copies of the Program or any portion
  122. Xof it, thus forming a work based on the Program, and copy and
  123. Xdistribute such modifications or work under the terms of Section 1
  124. Xabove, provided that you also meet all of these conditions:
  125. X
  126. X    a) You must cause the modified files to carry prominent notices
  127. X    stating that you changed the files and the date of any change.
  128. X
  129. X    b) You must cause any work that you distribute or publish, that in
  130. X    whole or in part contains or is derived from the Program or any
  131. X    part thereof, to be licensed as a whole at no charge to all third
  132. X    parties under the terms of this License.
  133. X
  134. X    c) If the modified program normally reads commands interactively
  135. X    when run, you must cause it, when started running for such
  136. X    interactive use in the most ordinary way, to print or display an
  137. X    announcement including an appropriate copyright notice and a
  138. X    notice that there is no warranty (or else, saying that you provide
  139. X    a warranty) and that users may redistribute the program under
  140. X    these conditions, and telling the user how to view a copy of this
  141. X    License.  (Exception: if the Program itself is interactive but
  142. X    does not normally print such an announcement, your work based on
  143. X    the Program is not required to print an announcement.)
  144. X
  145. XThese requirements apply to the modified work as a whole.  If
  146. Xidentifiable sections of that work are not derived from the Program,
  147. Xand can be reasonably considered independent and separate works in
  148. Xthemselves, then this License, and its terms, do not apply to those
  149. Xsections when you distribute them as separate works.  But when you
  150. Xdistribute the same sections as part of a whole which is a work based
  151. Xon the Program, the distribution of the whole must be on the terms of
  152. Xthis License, whose permissions for other licensees extend to the
  153. Xentire whole, and thus to each and every part regardless of who wrote it.
  154. X
  155. XThus, it is not the intent of this section to claim rights or contest
  156. Xyour rights to work written entirely by you; rather, the intent is to
  157. Xexercise the right to control the distribution of derivative or
  158. Xcollective works based on the Program.
  159. X
  160. XIn addition, mere aggregation of another work not based on the Program
  161. Xwith the Program (or with a work based on the Program) on a volume of
  162. Xa storage or distribution medium does not bring the other work under
  163. Xthe scope of this License.
  164. X
  165. X  3. You may copy and distribute the Program (or a work based on it,
  166. Xunder Section 2) in object code or executable form under the terms of
  167. XSections 1 and 2 above provided that you also do one of the following:
  168. X
  169. X    a) Accompany it with the complete corresponding machine-readable
  170. X    source code, which must be distributed under the terms of Sections
  171. X    1 and 2 above on a medium customarily used for software interchange; or,
  172. X
  173. X    b) Accompany it with a written offer, valid for at least three
  174. X    years, to give any third party, for a charge no more than your
  175. X    cost of physically performing source distribution, a complete
  176. X    machine-readable copy of the corresponding source code, to be
  177. X    distributed under the terms of Sections 1 and 2 above on a medium
  178. X    customarily used for software interchange; or,
  179. X
  180. X    c) Accompany it with the information you received as to the offer
  181. X    to distribute corresponding source code.  (This alternative is
  182. X    allowed only for noncommercial distribution and only if you
  183. X    received the program in object code or executable form with such
  184. X    an offer, in accord with Subsection b above.)
  185. X
  186. XThe source code for a work means the preferred form of the work for
  187. Xmaking modifications to it.  For an executable work, complete source
  188. Xcode means all the source code for all modules it contains, plus any
  189. Xassociated interface definition files, plus the scripts used to
  190. Xcontrol compilation and installation of the executable.  However, as a
  191. Xspecial exception, the source code distributed need not include
  192. Xanything that is normally distributed (in either source or binary
  193. Xform) with the major components (compiler, kernel, and so on) of the
  194. Xoperating system on which the executable runs, unless that component
  195. Xitself accompanies the executable.
  196. X
  197. XIf distribution of executable or object code is made by offering
  198. Xaccess to copy from a designated place, then offering equivalent
  199. Xaccess to copy the source code from the same place counts as
  200. Xdistribution of the source code, even though third parties are not
  201. Xcompelled to copy the source along with the object code.
  202. X
  203. X  4. You may not copy, modify, sublicense, or distribute the Program
  204. Xexcept as expressly provided under this License.  Any attempt
  205. Xotherwise to copy, modify, sublicense or distribute the Program is
  206. Xvoid, and will automatically terminate your rights under this License.
  207. XHowever, parties who have received copies, or rights, from you under
  208. Xthis License will not have their licenses terminated so long as such
  209. Xparties remain in full compliance.
  210. X
  211. X  5. You are not required to accept this License, since you have not
  212. Xsigned it.  However, nothing else grants you permission to modify or
  213. Xdistribute the Program or its derivative works.  These actions are
  214. Xprohibited by law if you do not accept this License.  Therefore, by
  215. Xmodifying or distributing the Program (or any work based on the
  216. XProgram), you indicate your acceptance of this License to do so, and
  217. Xall its terms and conditions for copying, distributing or modifying
  218. Xthe Program or works based on it.
  219. X
  220. X  6. Each time you redistribute the Program (or any work based on the
  221. XProgram), the recipient automatically receives a license from the
  222. Xoriginal licensor to copy, distribute or modify the Program subject to
  223. Xthese terms and conditions.  You may not impose any further
  224. Xrestrictions on the recipients' exercise of the rights granted herein.
  225. XYou are not responsible for enforcing compliance by third parties to
  226. Xthis License.
  227. X
  228. X  7. If, as a consequence of a court judgment or allegation of patent
  229. Xinfringement or for any other reason (not limited to patent issues),
  230. Xconditions are imposed on you (whether by court order, agreement or
  231. Xotherwise) that contradict the conditions of this License, they do not
  232. Xexcuse you from the conditions of this License.  If you cannot
  233. Xdistribute so as to satisfy simultaneously your obligations under this
  234. XLicense and any other pertinent obligations, then as a consequence you
  235. Xmay not distribute the Program at all.  For example, if a patent
  236. Xlicense would not permit royalty-free redistribution of the Program by
  237. Xall those who receive copies directly or indirectly through you, then
  238. Xthe only way you could satisfy both it and this License would be to
  239. Xrefrain entirely from distribution of the Program.
  240. X
  241. XIf any portion of this section is held invalid or unenforceable under
  242. Xany particular circumstance, the balance of the section is intended to
  243. Xapply and the section as a whole is intended to apply in other
  244. Xcircumstances.
  245. X
  246. XIt is not the purpose of this section to induce you to infringe any
  247. Xpatents or other property right claims or to contest validity of any
  248. Xsuch claims; this section has the sole purpose of protecting the
  249. Xintegrity of the free software distribution system, which is
  250. Ximplemented by public license practices.  Many people have made
  251. Xgenerous contributions to the wide range of software distributed
  252. Xthrough that system in reliance on consistent application of that
  253. Xsystem; it is up to the author/donor to decide if he or she is willing
  254. Xto distribute software through any other system and a licensee cannot
  255. Ximpose that choice.
  256. X
  257. XThis section is intended to make thoroughly clear what is believed to
  258. Xbe a consequence of the rest of this License.
  259. X
  260. X  8. If the distribution and/or use of the Program is restricted in
  261. Xcertain countries either by patents or by copyrighted interfaces, the
  262. Xoriginal copyright holder who places the Program under this License
  263. Xmay add an explicit geographical distribution limitation excluding
  264. Xthose countries, so that distribution is permitted only in or among
  265. Xcountries not thus excluded.  In such case, this License incorporates
  266. Xthe limitation as if written in the body of this License.
  267. X
  268. X  9. The Free Software Foundation may publish revised and/or new versions
  269. Xof the General Public License from time to time.  Such new versions will
  270. Xbe similar in spirit to the present version, but may differ in detail to
  271. Xaddress new problems or concerns.
  272. X
  273. XEach version is given a distinguishing version number.  If the Program
  274. Xspecifies a version number of this License which applies to it and "any
  275. Xlater version", you have the option of following the terms and conditions
  276. Xeither of that version or of any later version published by the Free
  277. XSoftware Foundation.  If the Program does not specify a version number of
  278. Xthis License, you may choose any version ever published by the Free Software
  279. XFoundation.
  280. X
  281. X  10. If you wish to incorporate parts of the Program into other free
  282. Xprograms whose distribution conditions are different, write to the author
  283. Xto ask for permission.  For software which is copyrighted by the Free
  284. XSoftware Foundation, write to the Free Software Foundation; we sometimes
  285. Xmake exceptions for this.  Our decision will be guided by the two goals
  286. Xof preserving the free status of all derivatives of our free software and
  287. Xof promoting the sharing and reuse of software generally.
  288. X
  289. X                NO WARRANTY
  290. X
  291. X  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
  292. XFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
  293. XOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
  294. XPROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
  295. XOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  296. XMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
  297. XTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  298. XPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
  299. XREPAIR OR CORRECTION.
  300. X
  301. X  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
  302. XWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
  303. XREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
  304. XINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
  305. XOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
  306. XTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
  307. XYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
  308. XPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
  309. XPOSSIBILITY OF SUCH DAMAGES.
  310. X
  311. X             END OF TERMS AND CONDITIONS
  312. X
  313. X    Appendix: How to Apply These Terms to Your New Programs
  314. X
  315. X  If you develop a new program, and you want it to be of the greatest
  316. Xpossible use to the public, the best way to achieve this is to make it
  317. Xfree software which everyone can redistribute and change under these terms.
  318. X
  319. X  To do so, attach the following notices to the program.  It is safest
  320. Xto attach them to the start of each source file to most effectively
  321. Xconvey the exclusion of warranty; and each file should have at least
  322. Xthe "copyright" line and a pointer to where the full notice is found.
  323. X
  324. X    <one line to give the program's name and a brief idea of what it does.>
  325. X    Copyright (C) 19yy  <name of author>
  326. X
  327. X    This program is free software; you can redistribute it and/or modify
  328. X    it under the terms of the GNU General Public License as published by
  329. X    the Free Software Foundation; either version 2 of the License, or
  330. X    (at your option) any later version.
  331. X
  332. X    This program is distributed in the hope that it will be useful,
  333. X    but WITHOUT ANY WARRANTY; without even the implied warranty of
  334. X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  335. X    GNU General Public License for more details.
  336. X
  337. X    You should have received a copy of the GNU General Public License
  338. X    along with this program; if not, write to the Free Software
  339. X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  340. X
  341. XAlso add information on how to contact you by electronic and paper mail.
  342. X
  343. XIf the program is interactive, make it output a short notice like this
  344. Xwhen it starts in an interactive mode:
  345. X
  346. X    Gnomovision version 69, Copyright (C) 19yy name of author
  347. X    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  348. X    This is free software, and you are welcome to redistribute it
  349. X    under certain conditions; type `show c' for details.
  350. X
  351. XThe hypothetical commands `show w' and `show c' should show the appropriate
  352. Xparts of the General Public License.  Of course, the commands you use may
  353. Xbe called something other than `show w' and `show c'; they could even be
  354. Xmouse-clicks or menu items--whatever suits your program.
  355. X
  356. XYou should also get your employer (if you work as a programmer) or your
  357. Xschool, if any, to sign a "copyright disclaimer" for the program, if
  358. Xnecessary.  Here is a sample; alter the names:
  359. X
  360. X  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
  361. X  `Gnomovision' (which makes passes at compilers) written by James Hacker.
  362. X
  363. X  <signature of Ty Coon>, 1 April 1989
  364. X  Ty Coon, President of Vice
  365. X
  366. XThis General Public License does not permit incorporating your program into
  367. Xproprietary programs.  If your program is a subroutine library, you may
  368. Xconsider it more useful to permit linking proprietary applications with the
  369. Xlibrary.  If this is what you want to do, use the GNU Library General
  370. XPublic License instead of this License.
  371. END_OF_FILE
  372.   if test 17983 -ne `wc -c <'LICENSE'`; then
  373.     echo shar: \"'LICENSE'\" unpacked with wrong size!
  374.   fi
  375.   # end of 'LICENSE'
  376. fi
  377. if test -f 'Makefile.amiga' -a "${1}" != "-c" ; then 
  378.   echo shar: Will not clobber existing file \"'Makefile.amiga'\"
  379. else
  380.   echo shar: Extracting \"'Makefile.amiga'\" \(888 characters\)
  381.   sed "s/^X//" >'Makefile.amiga' <<'END_OF_FILE'
  382. X#
  383. X#    Amiga Makefile for p2latex (SAS/C v5.10b)
  384. X#    Torsten Poulin <torsten@diku.dk>
  385. X#
  386. X
  387. XPRG        = p2latex
  388. X
  389. XLEX        = flex
  390. XLEXOPTS     = -i -8
  391. X#              ^ so we can handle 8-bit char sets
  392. X
  393. XROFF        = groff
  394. XROFFOPTS    = -Tlatin1
  395. X
  396. XCC        = lc
  397. XLCFLAGS        = -cis -v -O -mt
  398. XLINKER        = blink
  399. XBLINKFLAGS    = nodebug smallcode smalldata
  400. XLIBS        = lib:lc.lib
  401. XSTARTUP        = lib:c.o
  402. X
  403. XOBJ        = alloca.o p2latex.o main.o getopt.o getopt1.o \
  404. X          version.o allocate.o 
  405. X
  406. X
  407. X$(PRG): $(OBJ)
  408. X    $(LINKER) $(STARTUP) $(OBJ) lib $(LIBS) $(BLINKFLAGS) to $(PRG)
  409. X
  410. X.c.o:
  411. X    $(CC) $(LCFLAGS) $*
  412. X
  413. X.l.c:
  414. X    $(LEX) $(LEXOPTS) $<
  415. X    copy clone lex.yy.c $*.c
  416. X    -delete lex.yy.c
  417. X
  418. Xmanual: p2latex.1
  419. X    $(ROFF) $(ROFFOPTS) -man p2latex.1 > p2latex.0
  420. X
  421. Xclean:
  422. X    -delete $(OBJ)
  423. X
  424. Xalloca.o: alloca.c 
  425. Xp2latex.c: p2latex.l
  426. Xp2latex.o: p2latex.c
  427. Xmain.o: main.c getopt.h 
  428. Xgetopt.o: getopt.c getopt.h 
  429. Xgetopt1.o: getopt1.c getopt.h 
  430. Xversion.o: version.c 
  431. Xallocate.o: allocate.c 
  432. END_OF_FILE
  433.   if test 888 -ne `wc -c <'Makefile.amiga'`; then
  434.     echo shar: \"'Makefile.amiga'\" unpacked with wrong size!
  435.   fi
  436.   # end of 'Makefile.amiga'
  437. fi
  438. if test -f 'allocate.c' -a "${1}" != "-c" ; then 
  439.   echo shar: Will not clobber existing file \"'allocate.c'\"
  440. else
  441.   echo shar: Extracting \"'allocate.c'\" \(1311 characters\)
  442.   sed "s/^X//" >'allocate.c' <<'END_OF_FILE'
  443. X/* Allocate and clear storage for bison,
  444. X   Copyright (C) 1984, 1989 Free Software Foundation, Inc.
  445. X
  446. XThis file is part of Bison, the GNU Compiler Compiler.
  447. X
  448. XBison is free software; you can redistribute it and/or modify
  449. Xit under the terms of the GNU General Public License as published by
  450. Xthe Free Software Foundation; either version 2, or (at your option)
  451. Xany later version.
  452. X
  453. XBison is distributed in the hope that it will be useful,
  454. Xbut WITHOUT ANY WARRANTY; without even the implied warranty of
  455. XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  456. XGNU General Public License for more details.
  457. X
  458. XYou should have received a copy of the GNU General Public License
  459. Xalong with Bison; see the file COPYING.  If not, write to
  460. Xthe Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  461. X
  462. X
  463. X#include <stdio.h>
  464. X
  465. Xextern char *calloc();
  466. Xextern void done();
  467. X
  468. Xextern char *program_name;
  469. X
  470. Xchar *
  471. Xmallocate(n)
  472. Xregister unsigned n;
  473. X{
  474. X  register char *block;
  475. X
  476. X  /* Avoid uncertainty about what an arg of 0 will do.  */
  477. X  if (n == 0)
  478. X    n = 1;
  479. X  block = calloc(n,1);
  480. X  if (block == NULL)
  481. X    {
  482. X      fprintf(stderr, "%s: memory exhausted\n", program_name);
  483. X      exit(1);
  484. X    }
  485. X
  486. X  return (block);
  487. X}
  488. X
  489. X/* This name is used by alloca.c.  */
  490. X
  491. Xchar *
  492. Xxmalloc (n)
  493. X     unsigned int n;
  494. X{
  495. X  return mallocate (n);
  496. X}
  497. END_OF_FILE
  498.   if test 1311 -ne `wc -c <'allocate.c'`; then
  499.     echo shar: \"'allocate.c'\" unpacked with wrong size!
  500.   fi
  501.   # end of 'allocate.c'
  502. fi
  503. if test -f 'getopt.c' -a "${1}" != "-c" ; then 
  504.   echo shar: Will not clobber existing file \"'getopt.c'\"
  505. else
  506.   echo shar: Extracting \"'getopt.c'\" \(18791 characters\)
  507.   sed "s/^X//" >'getopt.c' <<'END_OF_FILE'
  508. X/* Getopt for GNU.
  509. X   NOTE: getopt is now part of the C library, so if you don't know what
  510. X   "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
  511. X   before changing it!
  512. X
  513. X   Copyright (C) 1987, 88, 89, 90, 91, 1992 Free Software Foundation, Inc.
  514. X
  515. X   This program is free software; you can redistribute it and/or modify
  516. X   it under the terms of the GNU General Public License as published by
  517. X   the Free Software Foundation; either version 2, or (at your option)
  518. X   any later version.
  519. X
  520. X   This program is distributed in the hope that it will be useful,
  521. X   but WITHOUT ANY WARRANTY; without even the implied warranty of
  522. X   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  523. X   GNU General Public License for more details.
  524. X
  525. X   You should have received a copy of the GNU General Public License
  526. X   along with this program; if not, write to the Free Software
  527. X   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  528. X
  529. X/* AIX requires this to be the first thing in the file. */
  530. X#ifdef __GNUC__
  531. X#define alloca __builtin_alloca
  532. X#else /* not __GNUC__ */
  533. X#ifdef sparc
  534. X#include <alloca.h>
  535. X#else
  536. X#ifdef _AIX
  537. X #pragma alloca
  538. X#else
  539. Xchar *alloca ();
  540. X#endif
  541. X#endif /* sparc */
  542. X#endif /* not __GNUC__ */
  543. X
  544. X#ifdef    LIBC
  545. X/* For when compiled as part of the GNU C library.  */
  546. X#include <ansidecl.h>
  547. X#endif
  548. X
  549. X#include <stdio.h>
  550. X
  551. X/* This needs to come after some library #include
  552. X   to get __GNU_LIBRARY__ defined.  */
  553. X#ifdef    __GNU_LIBRARY__
  554. X#undef    alloca
  555. X#include <stdlib.h>
  556. X#else    /* Not GNU C library.  */
  557. X#define    __alloca    alloca
  558. X#endif    /* GNU C library.  */
  559. X
  560. X
  561. X#ifndef __STDC__
  562. X#define const
  563. X#endif
  564. X
  565. X/* If GETOPT_COMPAT is defined, `+' as well as `--' can introduce a
  566. X   long-named option.  Because this is not POSIX.2 compliant, it is
  567. X   being phased out. */
  568. X#define GETOPT_COMPAT
  569. X
  570. X/* This version of `getopt' appears to the caller like standard Unix `getopt'
  571. X   but it behaves differently for the user, since it allows the user
  572. X   to intersperse the options with the other arguments.
  573. X
  574. X   As `getopt' works, it permutes the elements of ARGV so that,
  575. X   when it is done, all the options precede everything else.  Thus
  576. X   all application programs are extended to handle flexible argument order.
  577. X
  578. X   Setting the environment variable POSIXLY_CORRECT disables permutation.
  579. X   Then the behavior is completely standard.
  580. X
  581. X   GNU application programs can use a third alternative mode in which
  582. X   they can distinguish the relative order of options and other arguments.  */
  583. X
  584. X#include "getopt.h"
  585. X
  586. X/* For communication from `getopt' to the caller.
  587. X   When `getopt' finds an option that takes an argument,
  588. X   the argument value is returned here.
  589. X   Also, when `ordering' is RETURN_IN_ORDER,
  590. X   each non-option ARGV-element is returned here.  */
  591. X
  592. Xchar *optarg = 0;
  593. X
  594. X/* Index in ARGV of the next element to be scanned.
  595. X   This is used for communication to and from the caller
  596. X   and for communication between successive calls to `getopt'.
  597. X
  598. X   On entry to `getopt', zero means this is the first call; initialize.
  599. X
  600. X   When `getopt' returns EOF, this is the index of the first of the
  601. X   non-option elements that the caller should itself scan.
  602. X
  603. X   Otherwise, `optind' communicates from one call to the next
  604. X   how much of ARGV has been scanned so far.  */
  605. X
  606. Xint optind = 0;
  607. X
  608. X/* The next char to be scanned in the option-element
  609. X   in which the last option character we returned was found.
  610. X   This allows us to pick up the scan where we left off.
  611. X
  612. X   If this is zero, or a null string, it means resume the scan
  613. X   by advancing to the next ARGV-element.  */
  614. X
  615. Xstatic char *nextchar;
  616. X
  617. X/* Callers store zero here to inhibit the error message
  618. X   for unrecognized options.  */
  619. X
  620. Xint opterr = 1;
  621. X
  622. X/* Describe how to deal with options that follow non-option ARGV-elements.
  623. X
  624. X   If the caller did not specify anything,
  625. X   the default is REQUIRE_ORDER if the environment variable
  626. X   POSIXLY_CORRECT is defined, PERMUTE otherwise.
  627. X
  628. X   REQUIRE_ORDER means don't recognize them as options;
  629. X   stop option processing when the first non-option is seen.
  630. X   This is what Unix does.
  631. X   This mode of operation is selected by either setting the environment
  632. X   variable POSIXLY_CORRECT, or using `+' as the first character
  633. X   of the list of option characters.
  634. X
  635. X   PERMUTE is the default.  We permute the contents of ARGV as we scan,
  636. X   so that eventually all the non-options are at the end.  This allows options
  637. X   to be given in any order, even with programs that were not written to
  638. X   expect this.
  639. X
  640. X   RETURN_IN_ORDER is an option available to programs that were written
  641. X   to expect options and other ARGV-elements in any order and that care about
  642. X   the ordering of the two.  We describe each non-option ARGV-element
  643. X   as if it were the argument of an option with character code 1.
  644. X   Using `-' as the first character of the list of option characters
  645. X   selects this mode of operation.
  646. X
  647. X   The special argument `--' forces an end of option-scanning regardless
  648. X   of the value of `ordering'.  In the case of RETURN_IN_ORDER, only
  649. X   `--' can cause `getopt' to return EOF with `optind' != ARGC.  */
  650. X
  651. Xstatic enum
  652. X{
  653. X  REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
  654. X} ordering;
  655. X
  656. X#ifdef    __GNU_LIBRARY__
  657. X#include <string.h>
  658. X#define    my_index    strchr
  659. X#define    my_bcopy(src, dst, n)    memcpy ((dst), (src), (n))
  660. X#else
  661. X
  662. X/* Avoid depending on library functions or files
  663. X   whose names are inconsistent.  */
  664. X
  665. Xchar *getenv ();
  666. X
  667. Xstatic char *
  668. Xmy_index (string, chr)
  669. X     char *string;
  670. X     int chr;
  671. X{
  672. X  while (*string)
  673. X    {
  674. X      if (*string == chr)
  675. X    return string;
  676. X      string++;
  677. X    }
  678. X  return 0;
  679. X}
  680. X
  681. Xstatic void
  682. Xmy_bcopy (from, to, size)
  683. X     char *from, *to;
  684. X     int size;
  685. X{
  686. X  int i;
  687. X  for (i = 0; i < size; i++)
  688. X    to[i] = from[i];
  689. X}
  690. X#endif                /* GNU C library.  */
  691. X
  692. X/* Handle permutation of arguments.  */
  693. X
  694. X/* Describe the part of ARGV that contains non-options that have
  695. X   been skipped.  `first_nonopt' is the index in ARGV of the first of them;
  696. X   `last_nonopt' is the index after the last of them.  */
  697. X
  698. Xstatic int first_nonopt;
  699. Xstatic int last_nonopt;
  700. X
  701. X/* Exchange two adjacent subsequences of ARGV.
  702. X   One subsequence is elements [first_nonopt,last_nonopt)
  703. X   which contains all the non-options that have been skipped so far.
  704. X   The other is elements [last_nonopt,optind), which contains all
  705. X   the options processed since those non-options were skipped.
  706. X
  707. X   `first_nonopt' and `last_nonopt' are relocated so that they describe
  708. X   the new indices of the non-options in ARGV after they are moved.  */
  709. X
  710. Xstatic void
  711. Xexchange (argv)
  712. X     char **argv;
  713. X{
  714. X  int nonopts_size = (last_nonopt - first_nonopt) * sizeof (char *);
  715. X  char **temp = (char **) __alloca (nonopts_size);
  716. X
  717. X  /* Interchange the two blocks of data in ARGV.  */
  718. X
  719. X  my_bcopy (&argv[first_nonopt], temp, nonopts_size);
  720. X  my_bcopy (&argv[last_nonopt], &argv[first_nonopt],
  721. X        (optind - last_nonopt) * sizeof (char *));
  722. X  my_bcopy (temp, &argv[first_nonopt + optind - last_nonopt], nonopts_size);
  723. X
  724. X  /* Update records for the slots the non-options now occupy.  */
  725. X
  726. X  first_nonopt += (optind - last_nonopt);
  727. X  last_nonopt = optind;
  728. X}
  729. X
  730. X/* Scan elements of ARGV (whose length is ARGC) for option characters
  731. X   given in OPTSTRING.
  732. X
  733. X   If an element of ARGV starts with '-', and is not exactly "-" or "--",
  734. X   then it is an option element.  The characters of this element
  735. X   (aside from the initial '-') are option characters.  If `getopt'
  736. X   is called repeatedly, it returns successively each of the option characters
  737. X   from each of the option elements.
  738. X
  739. X   If `getopt' finds another option character, it returns that character,
  740. X   updating `optind' and `nextchar' so that the next call to `getopt' can
  741. X   resume the scan with the following option character or ARGV-element.
  742. X
  743. X   If there are no more option characters, `getopt' returns `EOF'.
  744. X   Then `optind' is the index in ARGV of the first ARGV-element
  745. X   that is not an option.  (The ARGV-elements have been permuted
  746. X   so that those that are not options now come last.)
  747. X
  748. X   OPTSTRING is a string containing the legitimate option characters.
  749. X   If an option character is seen that is not listed in OPTSTRING,
  750. X   return '?' after printing an error message.  If you set `opterr' to
  751. X   zero, the error message is suppressed but we still return '?'.
  752. X
  753. X   If a char in OPTSTRING is followed by a colon, that means it wants an arg,
  754. X   so the following text in the same ARGV-element, or the text of the following
  755. X   ARGV-element, is returned in `optarg'.  Two colons mean an option that
  756. X   wants an optional arg; if there is text in the current ARGV-element,
  757. X   it is returned in `optarg', otherwise `optarg' is set to zero.
  758. X
  759. X   If OPTSTRING starts with `-' or `+', it requests different methods of
  760. X   handling the non-option ARGV-elements.
  761. X   See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
  762. X
  763. X   Long-named options begin with `--' instead of `-'.
  764. X   Their names may be abbreviated as long as the abbreviation is unique
  765. X   or is an exact match for some defined option.  If they have an
  766. X   argument, it follows the option name in the same ARGV-element, separated
  767. X   from the option name by a `=', or else the in next ARGV-element.
  768. X   When `getopt' finds a long-named option, it returns 0 if that option's
  769. X   `flag' field is nonzero, the value of the option's `val' field
  770. X   if the `flag' field is zero.
  771. X
  772. X   The elements of ARGV aren't really const, because we permute them.
  773. X   But we pretend they're const in the prototype to be compatible
  774. X   with other systems.
  775. X
  776. X   LONGOPTS is a vector of `struct option' terminated by an
  777. X   element containing a name which is zero.
  778. X
  779. X   LONGIND returns the index in LONGOPT of the long-named option found.
  780. X   It is only valid when a long-named option has been found by the most
  781. X   recent call.
  782. X
  783. X   If LONG_ONLY is nonzero, '-' as well as '--' can introduce
  784. X   long-named options.  */
  785. X
  786. Xint
  787. X_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
  788. X     int argc;
  789. X     char *const *argv;
  790. X     const char *optstring;
  791. X     const struct option *longopts;
  792. X     int *longind;
  793. X     int long_only;
  794. X{
  795. X  int option_index;
  796. X
  797. X  optarg = 0;
  798. X
  799. X  /* Initialize the internal data when the first call is made.
  800. X     Start processing options with ARGV-element 1 (since ARGV-element 0
  801. X     is the program name); the sequence of previously skipped
  802. X     non-option ARGV-elements is empty.  */
  803. X
  804. X  if (optind == 0)
  805. X    {
  806. X      first_nonopt = last_nonopt = optind = 1;
  807. X
  808. X      nextchar = NULL;
  809. X
  810. X      /* Determine how to handle the ordering of options and nonoptions.  */
  811. X
  812. X      if (optstring[0] == '-')
  813. X    {
  814. X      ordering = RETURN_IN_ORDER;
  815. X      ++optstring;
  816. X    }
  817. X      else if (optstring[0] == '+')
  818. X    {
  819. X      ordering = REQUIRE_ORDER;
  820. X      ++optstring;
  821. X    }
  822. X      else if (getenv ("POSIXLY_CORRECT") != NULL)
  823. X    ordering = REQUIRE_ORDER;
  824. X      else
  825. X    ordering = PERMUTE;
  826. X    }
  827. X
  828. X  if (nextchar == NULL || *nextchar == '\0')
  829. X    {
  830. X      if (ordering == PERMUTE)
  831. X    {
  832. X      /* If we have just processed some options following some non-options,
  833. X         exchange them so that the options come first.  */
  834. X
  835. X      if (first_nonopt != last_nonopt && last_nonopt != optind)
  836. X        exchange ((char **) argv);
  837. X      else if (last_nonopt != optind)
  838. X        first_nonopt = optind;
  839. X
  840. X      /* Now skip any additional non-options
  841. X         and extend the range of non-options previously skipped.  */
  842. X
  843. X      while (optind < argc
  844. X         && (argv[optind][0] != '-' || argv[optind][1] == '\0')
  845. X#ifdef GETOPT_COMPAT
  846. X         && (longopts == NULL
  847. X             || argv[optind][0] != '+' || argv[optind][1] == '\0')
  848. X#endif                /* GETOPT_COMPAT */
  849. X         )
  850. X        optind++;
  851. X      last_nonopt = optind;
  852. X    }
  853. X
  854. X      /* Special ARGV-element `--' means premature end of options.
  855. X     Skip it like a null option,
  856. X     then exchange with previous non-options as if it were an option,
  857. X     then skip everything else like a non-option.  */
  858. X
  859. X      if (optind != argc && !strcmp (argv[optind], "--"))
  860. X    {
  861. X      optind++;
  862. X
  863. X      if (first_nonopt != last_nonopt && last_nonopt != optind)
  864. X        exchange ((char **) argv);
  865. X      else if (first_nonopt == last_nonopt)
  866. X        first_nonopt = optind;
  867. X      last_nonopt = argc;
  868. X
  869. X      optind = argc;
  870. X    }
  871. X
  872. X      /* If we have done all the ARGV-elements, stop the scan
  873. X     and back over any non-options that we skipped and permuted.  */
  874. X
  875. X      if (optind == argc)
  876. X    {
  877. X      /* Set the next-arg-index to point at the non-options
  878. X         that we previously skipped, so the caller will digest them.  */
  879. X      if (first_nonopt != last_nonopt)
  880. X        optind = first_nonopt;
  881. X      return EOF;
  882. X    }
  883. X
  884. X      /* If we have come to a non-option and did not permute it,
  885. X     either stop the scan or describe it to the caller and pass it by.  */
  886. X
  887. X      if ((argv[optind][0] != '-' || argv[optind][1] == '\0')
  888. X#ifdef GETOPT_COMPAT
  889. X      && (longopts == NULL
  890. X          || argv[optind][0] != '+' || argv[optind][1] == '\0')
  891. X#endif                /* GETOPT_COMPAT */
  892. X      )
  893. X    {
  894. X      if (ordering == REQUIRE_ORDER)
  895. X        return EOF;
  896. X      optarg = argv[optind++];
  897. X      return 1;
  898. X    }
  899. X
  900. X      /* We have found another option-ARGV-element.
  901. X     Start decoding its characters.  */
  902. X
  903. X      nextchar = (argv[optind] + 1
  904. X          + (longopts != NULL && argv[optind][1] == '-'));
  905. X    }
  906. X
  907. X  if (longopts != NULL
  908. X      && ((argv[optind][0] == '-'
  909. X       && (argv[optind][1] == '-' || long_only))
  910. X#ifdef GETOPT_COMPAT
  911. X      || argv[optind][0] == '+'
  912. X#endif                /* GETOPT_COMPAT */
  913. X      ))
  914. X    {
  915. X      const struct option *p;
  916. X      char *s = nextchar;
  917. X      int exact = 0;
  918. X      int ambig = 0;
  919. X      const struct option *pfound = NULL;
  920. X      int indfound;
  921. X
  922. X      while (*s && *s != '=')
  923. X    s++;
  924. X
  925. X      /* Test all options for either exact match or abbreviated matches.  */
  926. X      for (p = longopts, option_index = 0; p->name;
  927. X       p++, option_index++)
  928. X    if (!strncmp (p->name, nextchar, s - nextchar))
  929. X      {
  930. X        if (s - nextchar == strlen (p->name))
  931. X          {
  932. X        /* Exact match found.  */
  933. X        pfound = p;
  934. X        indfound = option_index;
  935. X        exact = 1;
  936. X        break;
  937. X          }
  938. X        else if (pfound == NULL)
  939. X          {
  940. X        /* First nonexact match found.  */
  941. X        pfound = p;
  942. X        indfound = option_index;
  943. X          }
  944. X        else
  945. X          /* Second nonexact match found.  */
  946. X          ambig = 1;
  947. X      }
  948. X
  949. X      if (ambig && !exact)
  950. X    {
  951. X      if (opterr)
  952. X        fprintf (stderr, "%s: option `%s' is ambiguous\n",
  953. X             argv[0], argv[optind]);
  954. X      nextchar += strlen (nextchar);
  955. X      optind++;
  956. X      return '?';
  957. X    }
  958. X
  959. X      if (pfound != NULL)
  960. X    {
  961. X      option_index = indfound;
  962. X      optind++;
  963. X      if (*s)
  964. X        {
  965. X          if (pfound->has_arg > 0)
  966. X        optarg = s + 1;
  967. X          else
  968. X        {
  969. X          if (opterr)
  970. X            {
  971. X              if (argv[optind - 1][1] == '-')
  972. X            /* --option */
  973. X            fprintf (stderr,
  974. X                 "%s: option `--%s' doesn't allow an argument\n",
  975. X                 argv[0], pfound->name);
  976. X              else
  977. X            /* +option or -option */
  978. X            fprintf (stderr,
  979. X                 "%s: option `%c%s' doesn't allow an argument\n",
  980. X                 argv[0], argv[optind - 1][0], pfound->name);
  981. X            }
  982. X          nextchar += strlen (nextchar);
  983. X          return '?';
  984. X        }
  985. X        }
  986. X      else if (pfound->has_arg == 1)
  987. X        {
  988. X          if (optind < argc)
  989. X        optarg = argv[optind++];
  990. X          else
  991. X        {
  992. X          if (opterr)
  993. X            fprintf (stderr, "%s: option `%s' requires an argument\n",
  994. X                 argv[0], argv[optind - 1]);
  995. X          nextchar += strlen (nextchar);
  996. X          return '?';
  997. X        }
  998. X        }
  999. X      nextchar += strlen (nextchar);
  1000. X      if (longind != NULL)
  1001. X        *longind = option_index;
  1002. X      if (pfound->flag)
  1003. X        {
  1004. X          *(pfound->flag) = pfound->val;
  1005. X          return 0;
  1006. X        }
  1007. X      return pfound->val;
  1008. X    }
  1009. X      /* Can't find it as a long option.  If this is not getopt_long_only,
  1010. X     or the option starts with '--' or is not a valid short
  1011. X     option, then it's an error.
  1012. X     Otherwise interpret it as a short option. */
  1013. X      if (!long_only || argv[optind][1] == '-'
  1014. X#ifdef GETOPT_COMPAT
  1015. X      || argv[optind][0] == '+'
  1016. X#endif                /* GETOPT_COMPAT */
  1017. X      || my_index (optstring, *nextchar) == NULL)
  1018. X    {
  1019. X      if (opterr)
  1020. X        {
  1021. X          if (argv[optind][1] == '-')
  1022. X        /* --option */
  1023. X        fprintf (stderr, "%s: unrecognized option `--%s'\n",
  1024. X             argv[0], nextchar);
  1025. X          else
  1026. X        /* +option or -option */
  1027. X        fprintf (stderr, "%s: unrecognized option `%c%s'\n",
  1028. X             argv[0], argv[optind][0], nextchar);
  1029. X        }
  1030. X      nextchar += strlen (nextchar);
  1031. X      optind++;
  1032. X      return '?';
  1033. X    }
  1034. X    }
  1035. X
  1036. X  /* Look at and handle the next option-character.  */
  1037. X
  1038. X  {
  1039. X    char c = *nextchar++;
  1040. X    char *temp = my_index (optstring, c);
  1041. X
  1042. X    /* Increment `optind' when we start to process its last character.  */
  1043. X    if (*nextchar == '\0')
  1044. X      optind++;
  1045. X
  1046. X    if (temp == NULL || c == ':')
  1047. X      {
  1048. X    if (opterr)
  1049. X      {
  1050. X        if (c < 040 || c >= 0177)
  1051. X          fprintf (stderr, "%s: unrecognized option, character code 0%o\n",
  1052. X               argv[0], c);
  1053. X        else
  1054. X          fprintf (stderr, "%s: unrecognized option `-%c'\n", argv[0], c);
  1055. X      }
  1056. X    return '?';
  1057. X      }
  1058. X    if (temp[1] == ':')
  1059. X      {
  1060. X    if (temp[2] == ':')
  1061. X      {
  1062. X        /* This is an option that accepts an argument optionally.  */
  1063. X        if (*nextchar != '\0')
  1064. X          {
  1065. X        optarg = nextchar;
  1066. X        optind++;
  1067. X          }
  1068. X        else
  1069. X          optarg = 0;
  1070. X        nextchar = NULL;
  1071. X      }
  1072. X    else
  1073. X      {
  1074. X        /* This is an option that requires an argument.  */
  1075. X        if (*nextchar != 0)
  1076. X          {
  1077. X        optarg = nextchar;
  1078. X        /* If we end this ARGV-element by taking the rest as an arg,
  1079. X           we must advance to the next element now.  */
  1080. X        optind++;
  1081. X          }
  1082. X        else if (optind == argc)
  1083. X          {
  1084. X        if (opterr)
  1085. X          fprintf (stderr, "%s: option `-%c' requires an argument\n",
  1086. X               argv[0], c);
  1087. X        c = '?';
  1088. X          }
  1089. X        else
  1090. X          /* We already incremented `optind' once;
  1091. X         increment it again when taking next ARGV-elt as argument.  */
  1092. X          optarg = argv[optind++];
  1093. X        nextchar = NULL;
  1094. X      }
  1095. X      }
  1096. X    return c;
  1097. X  }
  1098. X}
  1099. X
  1100. Xint
  1101. Xgetopt (argc, argv, optstring)
  1102. X     int argc;
  1103. X     char *const *argv;
  1104. X     const char *optstring;
  1105. X{
  1106. X  return _getopt_internal (argc, argv, optstring,
  1107. X               (const struct option *) 0,
  1108. X               (int *) 0,
  1109. X               0);
  1110. X}
  1111. X
  1112. X#ifdef TEST
  1113. X
  1114. X/* Compile with -DTEST to make an executable for use in testing
  1115. X   the above definition of `getopt'.  */
  1116. X
  1117. Xint
  1118. Xmain (argc, argv)
  1119. X     int argc;
  1120. X     char **argv;
  1121. X{
  1122. X  int c;
  1123. X  int digit_optind = 0;
  1124. X
  1125. X  while (1)
  1126. X    {
  1127. X      int this_option_optind = optind ? optind : 1;
  1128. X
  1129. X      c = getopt (argc, argv, "abc:d:0123456789");
  1130. X      if (c == EOF)
  1131. X    break;
  1132. X
  1133. X      switch (c)
  1134. X    {
  1135. X    case '0':
  1136. X    case '1':
  1137. X    case '2':
  1138. X    case '3':
  1139. X    case '4':
  1140. X    case '5':
  1141. X    case '6':
  1142. X    case '7':
  1143. X    case '8':
  1144. X    case '9':
  1145. X      if (digit_optind != 0 && digit_optind != this_option_optind)
  1146. X        printf ("digits occur in two different argv-elements.\n");
  1147. X      digit_optind = this_option_optind;
  1148. X      printf ("option %c\n", c);
  1149. X      break;
  1150. X
  1151. X    case 'a':
  1152. X      printf ("option a\n");
  1153. X      break;
  1154. X
  1155. X    case 'b':
  1156. X      printf ("option b\n");
  1157. X      break;
  1158. X
  1159. X    case 'c':
  1160. X      printf ("option c with value `%s'\n", optarg);
  1161. X      break;
  1162. X
  1163. X    case '?':
  1164. X      break;
  1165. X
  1166. X    default:
  1167. X      printf ("?? getopt returned character code 0%o ??\n", c);
  1168. X    }
  1169. X    }
  1170. X
  1171. X  if (optind < argc)
  1172. X    {
  1173. X      printf ("non-option ARGV-elements: ");
  1174. X      while (optind < argc)
  1175. X    printf ("%s ", argv[optind++]);
  1176. X      printf ("\n");
  1177. X    }
  1178. X
  1179. X  exit (0);
  1180. X}
  1181. X
  1182. X#endif /* TEST */
  1183. END_OF_FILE
  1184.   if test 18791 -ne `wc -c <'getopt.c'`; then
  1185.     echo shar: \"'getopt.c'\" unpacked with wrong size!
  1186.   fi
  1187.   # end of 'getopt.c'
  1188. fi
  1189. if test -f 'p2latex.0.UU' -a "${1}" != "-c" ; then 
  1190.   echo shar: Will not clobber existing file \"'p2latex.0.UU'\"
  1191. else
  1192.   echo shar: Extracting \"'p2latex.0.UU'\" \(10914 characters\)
  1193.   sed "s/^X//" >'p2latex.0.UU' <<'END_OF_FILE'
  1194. Xbegin 664 p2latex.0
  1195. XM"@H*4#),051%6"@Q*2 @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
  1196. XM(" @(" @(" @(" @(% R3$%415@H,2D*"@I."$Y!"$%-"$U%"$4*(" @(" @
  1197. XM(' R;&%T97@@+2!A(%!A<V-A;"!T;R!,851E6"!C;VYV97)T97(*"E,(4UD(
  1198. XM64X(3D\(3U (4%,(4TD(25,(4PH@(" @(" @< AP,@@R; AL80AA= AT90AE
  1199. XM> AX(%L@7PAO7PAP7PAT7PAI7PAO7PAN7PAS(%T@6R!?"&9?"&E?"&Q?"&4@
  1200. XM70H*1 A$10A%4PA30PA#4@A220A)4 A05 A420A)3PA/3@A."B @(" @("!P
  1201. XM"' R"#)L"&QA"&%T"'1E"&5X"'@@(&ES("!A("!T;V]L(&9O<B!G96YE<F%T
  1202. XM:6YG(%\(3%\(85\(5%\(95\(6"!S;W5R8V5S(&9R;VT@7PA)7PA37PA/"B @
  1203. XM(" @("!?"%!?"&%?"'-?"&-?"&%?"&P@<')O9W)A;7,N("!)="!R96-O9VYI
  1204. XM>F5S(&%L;"!K97EW;W)D<RP@<W1R:6YG<RP@86YD"B @(" @("!C;VUM96YT
  1205. XM<RX@5&AE<V4@<F5C;V=N:7IE9"!P87)T<R!C86X@8F4@='EP97-E="!I;B!D
  1206. XM:69F97(M"B @(" @("!E;G0@9F]N=',N("!P"' R"#)L"&QA"&%T"'1E"&5X
  1207. XM"'@@(&-A;B @9V5N97)A=&4@(&-O;7!L971E("!?"$Q?"&%?"%1?"&5?"%@@
  1208. XM(&9I;&5S"B @(" @("!W:&EC:" @8V%N(&)E('!A<W-E9"!D:7)E8W1L>2!T
  1209. XM:')O=6=H(&P(;&$(870(=&4(97@(>"@Q*2!O<B!P87)T<R!O9@H@(" @(" @
  1210. XM7PA,7PAA7PA47PAE7PA8(&9I;&5S('=H:6-H(&-A;B!B92!I;F-L=61E9" @
  1211. XM:6X@(&]T:&5R("!?"$Q?"&%?"%1?"&5?"%@@(&9I;&5S"B @(" @(" H96ET
  1212. XM:&5R(&UA;G5A;&QY(&]R('=I=&@@=&AE(%P(7&D(:6X(;G (<'4(=70(="!O
  1213. XM<B!<"%QI"&EN"&YC"&-L"&QU"'5D"&1E"&4@8V]M;6%N9',I+@H*(" @(" @
  1214. XM($EF('1H92!["'LM""UO"&\L""PM""TM""UO"&]U"'5T"'1P"'!U"'5T"'1]
  1215. XM"'T@;W!T:6]N(&ES(&=I=F5N+"!T:&4@;W5T<'5T(&ES("!W<FET+0H@(" @
  1216. XM(" @=&5N("!T;R @=&AE("!S<&5C:69I960@9FEL92X@268@=&AE('L(>RT(
  1217. XM+7 (<"P(+"T(+2T(+7 (<&D(:7 (<&4(97T(?2!O<'1I;VX@:7,*(" @(" @
  1218. XM(&=I=F5N+"!T:&4@;W5T<'5T(&ES('=R:71T96X@=&\@7PAS7PAT7PAD7PAO
  1219. XM7PAU7PAT("AI="!I<R!A;B!E<G)O<B @=&\*(" @(" @('5S92 @8F]T:" @
  1220. XM;W!T:6]N<R!T;V=E=&AE<BDN($EF(&YO;F4@;V8@=&AE<V4@;W!T:6]N<R!A
  1221. XM<F4*(" @(" @('5S960L('1H92!O=71P=70@:7,@=W)I='1E;B!T;R!A(&9I
  1222. XM;&4N($EF('1H92!I;G!U=" @8V]M97,*(" @(" @(&9R;VT@(&$@(&9I;&4L
  1223. XM('1H92!L87-T(&-O;7!O;F5N="!O9B!T:&%T(&YA;64@=VET:"!@+G1E>"<*
  1224. XM(" @(" @(&%P<&5N9&5D(&ES('5S960@87,@=&AE(&]U='!U="!F:6QE;F%M
  1225. XM92X*"D\(3U (4%0(5$D(24\(3TX(3E,(4PH@(" @(" @< AP,@@R; AL80AA
  1226. XM= AT90AE> AX(')E8V]G;FEZ97,@=&AE(&]P=&EO;G,@9&5S8W)I8F5D(&)E
  1227. XM;&]W+B @5&AE("!L;VYG"B @(" @("!F;W)M<R @8V%N+" @=6YL97-S("!D
  1228. XM:7-A8FQE9" @8GD@=&AE('!E<G-O;B!W:&\@:6YS=&%L;&5D"B @(" @("!P
  1229. XM"' R"#)L"&QA"&%T"'1E"&5X"'@L(&%L<V\@8F4@:6YT<F]D=6-E9"!B>2!A
  1230. XM(& K)R!O<B!@+2<@:6YS=&5A9"!O9B!T:&4*(" @(" @(% (4$\(3U,(4TD(
  1231. XM25@(6"X(+C((,B!C;VUP;&EA;G0@8"TM)RX*"B @(" @(" M""UC"&,L""P@
  1232. XM+0@M+0@M8PAC;PAO;0AM< AP; AL90AE= AT90AE+0@M9@AF:0AI; AL90AE
  1233. XM"B @(" @(" @(" @(" @5&AE("!O=71P=70@:7,@96YV96QO<&5D(&EN(&-O
  1234. XM;6UA;F1S('1H870@<')O9'5C92!A"B @(" @(" @(" @(" @8V]M<&QE=&4@
  1235. XM7PA,7PAA7PA47PAE7PA8(&1O8W5M96YT+@H*(" @(" @("T(+64(92P(+" M
  1236. XM""TM""UE"&5N"&YD"&0M""UC"&-O"&]M"&UM"&UE"&5N"&YT"'0@7PAD7PAI
  1237. XM7PAS7PAT7PAA7PAN7PAC7PAE"B @(" @(" @(" @(" @5&AI<R!C:&%N9V5S
  1238. XM('1H92!D:7-T86YC92!B971W965N('1H92 @7PA07PAA7PAS7PAC7PAA7PAL
  1239. XM("!K97DM"B @(" @(" @(" @(" @=V]R9" @90AE;@AN9 AD("AO<'1I;VYA
  1240. XM;&QY(&9O;&QO=V5D(&)Y(& [)R!O<B!@+B<I(&%N9"!A"B @(" @(" @(" @
  1241. XM(" @9F]L;&]W:6YG("!C;VUM96YT+B @($1E9F%U;'0@(&ES("!F;W5R("!T
  1242. XM:6UE<R @=&AE"B @(" @(" @(" @(" @:6YD96YT871I;VX@('-T97 @('-I
  1243. XM>F4@*'-E92!T:&4@>PA[+0@M:0AI+ @L+0@M+0@M:0AI;@AN9 AD90AE;@AN
  1244. XM= AT80AA= AT:0AI;PAO;@AN?0A]"B @(" @(" @(" @(" @;W!T:6]N*2X*
  1245. XM"B @(" @(" M""UF"&8L""P@+0@M+0@M9@AF80AA;@AN8PAC>0AY"B @(" @
  1246. XM(" @(" @(" @5&AE(&]U='!U="!A<'!R;WAI;6%T97,@=&AE('-T>6QE('5S
  1247. XM960@(&EN("!.:6ML875S"B @(" @(" @(" @(" @5VER=&@Z(%\(4%\(<E\(
  1248. XM;U\(9U\(<E\(85\(;5\(<U\(*U\(1%\(85\(=%\(82!?"%-?"'1?"')?"'5?
  1249. XM"&-?"'1?"'5?"')?"&5?"'-?"#U?"%!?"')?"&]?"&=?"')?"&%?"&U?"',N
  1250. XM"@H@(" @(" @+0@M: AH+ @L("T(+2T(+6@(:&4(96$(860(9&4(97((<@H@
  1251. XM(" @(" @(" @(" @($5A8V@@('!A9V4@(&]F(&]U='!U="!H87,@82!H96%D
  1252. XM97(@9VEV:6YG('1H92!I;G!U= H@(" @(" @(" @(" @(&9I;&5N86UE+B @
  1253. XM(" @(%1H:7,@(" @(&]P=&EO;B @(" @:6UP;&EE<R @(" @('1H90H@(" @
  1254. XM(" @(" @(" @('L(>RT(+6,(8RP(+"T(+2T(+6,(8V\(;VT(;7 (<&P(;&4(
  1255. XM970(=&4(92T(+68(9FD(:6P(;&4(97T(?2!O<'1I;VXN"@H@(" @(" @+0@M
  1256. XM:0AI+ @L("T(+2T(+6D(:6X(;F0(9&4(96X(;G0(=&$(870(=&D(:6\(;VX(
  1257. XM;B!?"&Q?"&5?"&Y?"&=?"'1?"&@*(" @(" @(" @(" @("!':79E<R @=&AE
  1258. XM("!A;6]U;G0@(&]F(&EN9&5N=&%T:6]N(&9O<B!E86-H(&QE861I;F<*(" @
  1259. XM(" @(" @(" @("!B;&%N:R H=&%B<R!A<F4@8V]N=F5R=&5D('1O("!B;&%N
  1260. XM:W,I+B @1&5F875L=" @:7,*(" @(" @(" @(" @("!@,"XU96TG+@H*"@H*
  1261. XM(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
  1262. XM(" @(" @(" @(" @(" @(" @(#$*"@H*"@I0,DQ!5$58*#$I(" @(" @(" @
  1263. XM(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @4#),051%6"@Q
  1264. XM*0H*"B @(" @(" M""UN"&XL""P@+0@M+0@M;@AN;PAO+0@M80AA; AL:0AI
  1265. XM9PAG;@AN;0AM90AE;@AN= AT"B @(" @(" @(" @(" @0V]M;65N=',@8F5L
  1266. XM;VYG:6YG('1O('-T871E;65N=',@87)E(&%L:6=N960@=&\@=&AE"B @(" @
  1267. XM(" @(" @(" @<FEG:'0@;6%R9VEN(&)Y(&1E9F%U;'0N("!9;W4@(&-A;B @
  1268. XM='5R;B @;V9F("!T:&ES"B @(" @(" @(" @(" @8F5H879I;W5R('=I=&@@
  1269. XM=&AI<R!O<'1I;VXN"@H@(" @(" @+0@M;PAO+ @L("T(+2T(+6\(;W4(=70(
  1270. XM=' (<'4(=70(="!?"&9?"&E?"&Q?"&4*(" @(" @(" @(" @("!4:&4@;W5T
  1271. XM<'5T(&ES('=R:71T96X@;VX@7PAF7PAI7PAL7PAE+@H*(" @(" @("T(+7 (
  1272. XM<"P(+" M""TM""UP"'!I"&EP"'!E"&4*(" @(" @(" @(" @("!4:&4@;W5T
  1273. XM<'5T(&=O97,@=&\@7PAS7PAT7PAD7PAO7PAU7PAT+@H*(" @(" @("T(+7,(
  1274. XM<RP(+" M""TM""UF"&9O"&]N"&YT"'0M""US"'-I"&EZ"'IE"&4@7PAF7PAO
  1275. XM7PAN7PAT7PAS7PAI7PAZ7PAE"B @(" @(" @(" @(" @5&AE("!?"$Q?"&%?
  1276. XM"%1?"&5?"%@@<V]U<F-E(&ES('-E="!I;B!?"&9?"&]?"&Y?"'1?"'-?"&E?
  1277. XM"'I?"&5P="X@($1E9F%U;'0@:7,*(" @(" @(" @(" @("!@,3 G+B!4:&ES
  1278. XM(&]P=&EO;B!I<R!M96%N:6YG;&5S<R @:68@(&YO=" @=7-E9" @:6X*(" @
  1279. XM(" @(" @(" @("!C;VUB:6YA=&EO;B!W:71H('L(>RT(+6,(8RP(+"T(+2T(
  1280. XM+6,(8V\(;VT(;7 (<&P(;&4(970(=&4(92T(+68(9FD(:6P(;&4(97T(?2X*
  1281. XM"B @(" @(" M""U#"$,L""P@+0@M+0@M8PAC;PAO;0AM;0AM90AE;@AN= AT
  1282. XM+0@M9@AF;PAO;@AN= AT(%\(9E\(;U\(;E\(= H@(" @(" @(" @(" @(%1H
  1283. XM92!C;VUM96YT<R!A<F4@<V5T(&EN('1H92!G:79E;B!?"&9?"&]?"&Y?"'0N
  1284. XM("!$969A=6QT(&ES"B @(" @(" @(" @(" @8&ET)RX*"B @(" @(" M""U(
  1285. XM"$@L""P@+0@M+0@M: AH90AE80AA9 AD90AE<@AR+0@M9@AF;PAO;@AN= AT
  1286. XM(%\(9E\(;U\(;E\(= H@(" @(" @(" @(" @(%1H92!H96%D97)S(&%R92!S
  1287. XM970@:6X@=&AE(&=I=F5N(%\(9E\(;U\(;E\(="X@($1E9F%U;'0@(&ES"B @
  1288. XM(" @(" @(" @(" @8'-L)RX*"B @(" @(" M""U)"$DL""P@+0@M+0@M:0AI
  1289. XM9 AD90AE;@AN= AT:0AI9@AF:0AI90AE<@AR+0@M9@AF;PAO;@AN= AT(%\(
  1290. XM9E\(;U\(;E\(= H@(" @(" @(" @(" @(%1H92!I9&5N=&EF:65R<R!A<F4@
  1291. XM<V5T(&EN('1H92!G:79E;B!?"&9?"&]?"&Y?"'0N("!$969A=6QT"B @(" @
  1292. XM(" @(" @(" @:7,@8&ET)RX*"B @(" @(" M""U+"$LL""P@+0@M+0@M:PAK
  1293. XM90AE>0AY=PAW;PAO<@AR9 AD+0@M9@AF;PAO;@AN= AT(%\(9E\(;U\(;E\(
  1294. XM= H@(" @(" @(" @(" @(%1H92!K97EW;W)D<R!A<F4@<V5T(&EN('1H92!G
  1295. XM:79E;B!?"&9?"&]?"&Y?"'0N("!$969A=6QT(&ES"B @(" @(" @(" @(" @
  1296. XM8&)F)RX*"B @(" @(" M""U3"%,L""P@+0@M+0@M<PAS= AT<@AR:0AI;@AN
  1297. XM9PAG+0@M9@AF;PAO;@AN= AT(%\(9E\(;U\(;E\(= H@(" @(" @(" @(" @
  1298. XM(%1H92 @<W1R:6YG("!A;F0@8VAA<F%C=&5R(&-O;G-T86YT<R!A<F4@<V5T
  1299. XM(&EN('1H90H@(" @(" @(" @(" @(&=I=F5N(%\(9E\(;U\(;E\(="X@($1E
  1300. XM9F%U;'0@:7,@8'1T)RX*"B @(" @(" M""U4"%0L""P@+0@M+0@M= AT80AA
  1301. XM8@AB<PAS= AT;PAO< AP(%\(=U\(:5\(9%\(=%\(: H@(" @(" @(" @(" @
  1302. XM(%1H92!W:61T:"!O9B!T86)S(&ES(%\(=U\(:5\(9%\(=%\(:"X@($1E9F%U
  1303. XM;'0@:7,@8#@G+@H*(" @(" @("T(+58(5BP(+" M""TM""UV"'9E"&5R"')S
  1304. XM"'-I"&EO"&]N"&X*(" @(" @(" @(" @("!0<FEN=',@=&AE('9E<G-I;VX@
  1305. XM;G5M8F5R(&]N(%\(<U\(=%\(9%\(95\(<E\(<BX*"B @(" @("!4;R!G:79E
  1306. XM(&YO(&]P=&EO;G,@870@(&%L;" @:7,@('1H92 @<V%M92 @87,@(&=I=FEN
  1307. XM9R @=&AE"B @(" @("!O<'1I;VYS"B @(" @(" @(" @(" @+6D@,"XU96T@
  1308. XM+7,@,3 @+4,@:70@+4@@<VP@+4D@:70@+4L@8F8@+5,@='0@+50@. H*1 A$
  1309. XM20A)00A!1PA'3@A.3PA/4PA35 A420A)0PA#4PA3"B @(" @("!?"$-?"&%?
  1310. XM"&Y?""=?"'0@7PAU7PAS7PAE(%\(>U\(+5\(<%\(+%\(+5\(+5\(<%\(:5\(
  1311. XM<%\(95\(?2!?"&%?"&Y?"&0@7PA[7P@M7PAO7P@L7P@M7P@M7PAO7PAU7PAT
  1312. XM7PAP7PAU7PAT7PA](%\(=%\(;U\(9U\(95\(=%\(:%\(95\(<@H@(" @(" @
  1313. XM(" @(" @($%T(&UO<W0@;VYE(&]F('1H:7,@;W!T:6]N<R!M87D@8F4@9VEV
  1314. XM96XN"@H*(" @(" @(%\(0U\(85\(;E\()U\(="!?"&]?"'!?"&5?"&X@7PA@
  1315. XM7P@\7PAF7PAI7PAL7PAE7P@^7P@G(%\(9E\(;U\(<B!?"')?"&5?"&%?"&1?
  1316. XM"&E?"&Y?"&<*(" @(" @(" @(" @("!4:&4@<')O9W)A;2!F86EL960@=&\@
  1317. XM;W!E;B \9FEL93X@9F]R(')E861I;F<N"@H*"@H@(" @(" @(" @(" @(" @
  1318. XM(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
  1319. XM(" @,@H*"@H*"E R3$%415@H,2D@(" @(" @(" @(" @(" @(" @(" @(" @
  1320. XM(" @(" @(" @(" @(" @(" @("!0,DQ!5$58*#$I"@H*(" @(" @(%\(0U\(
  1321. XM85\(;E\()U\(="!?"&]?"'!?"&5?"&X@7PA@7P@\7PAF7PAI7PAL7PAE7P@^
  1322. XM7P@G(%\(9E\(;U\(<B!?"'=?"')?"&E?"'1?"&E?"&Y?"&<*(" @(" @(" @
  1323. XM(" @("!4:&4@('!R;V=R86T@9F%I;&5D('1O(&]P96X@/&9I;&4^(&9O<B!W
  1324. XM<FET:6YG+B!!;&P*(" @(" @(" @(" @("!O=71P=70@:7,@=W)I='1E;B!I
  1325. XM;B!T:&4@8W5R<F5N="!D:7)E8W1O<GD@(&EF("!N;W0*(" @(" @(" @(" @
  1326. XM("!E>'!L:6-I=&QY(&-H86YG960@8GD@>PA[+0@M;PAO+ @L+0@M+0@M;PAO
  1327. XM=0AU= AT< AP=0AU= AT?0A]+@H*"B @(" @("!?"%9?"&E?"')?"'1?"'5?
  1328. XM"&%?"&P@7PAM7PAE7PAM7PAO7PAR7PAY(%\(95\(>%\(:%\(85\(=5\(<U\(
  1329. XM=%\(95\(9 H@(" @(" @(" @(" @(%1H92 @<')O9W)A;2!F86EL960@=&\@
  1330. XM86QL;V-A=&4@<W1O<F%G92X@07,@=&AI<R!I<PH@(" @(" @(" @(" @(&]N
  1331. XM;'D@9&]N92!F;W(@=&AE(&-O;G-T<G5C=&EO;B!O9B!T:&4@;W5T<'5T("!F
  1332. XM:6QE+0H@(" @(" @(" @(" @(&YA;64L("!T:&ES("!E<G)O<B!W:6QL(&YO
  1333. XM<FUA;&QY(&EN9&EC871E(&$@<')O9W)A;0H@(" @(" @(" @(" @(&5R<F]R
  1334. XM+@H*1@A&20A)3 A,10A%4PA3"B @(" @("!?"&9?"&%?"&Y?"&-?"'E?"&A?
  1335. XM"&5?"&%?"&1?"&E?"&Y?"&=?"'-?""Y?"'-?"'1?"'D*(" @(" @(" @(" @
  1336. XM("!5<V5D(&)Y('1H92!O=71P=70@=VAE;B M""UH"&@@;W(@("T(+2T(+6@(
  1337. XM:&4(96$(860(9&4(97((<B @:7,@('-P96-I+0H@(" @(" @(" @(" @(&9I
  1338. XM960N"@I5"%5."$Y2"%)%"$53"%-4"%12"%))"$E#"$-4"%1)"$E/"$]."$Y3
  1339. XM"%,*(" @(" @(' (<#((,FP(;&$(870(=&4(97@(>"!I<R!F<F5E.R!A;GEO
  1340. XM;F4@;6%Y(')E9&ES=')I8G5T92!C;W!I97,@;V8@< AP,@@R; AL80AA= AT
  1341. XM90AE> AX"B @(" @("!T;R!A;GEO;F4@=6YD97(@=&AE('1E<FUS('-T871E
  1342. XM9"!I;B!T:&4@1TY5($=E;F5R86P@4'5B;&EC"B @(" @("!,:6-E;F-E+"!A
  1343. XM(&-O<'D@;V8@=VAI8V@@86-C;VUP86YI97,@96%C:"!C;W!Y(&]F(' (<#((
  1344. XM,FP(;&$(870(=&4(97@(>"X*"B @(" @("!4;W)S=&5N("!0;W5L:6X@(&5N
  1345. XM8V]U<F%G97,@('EO=2 @=&\@(&EM<')O=F4@(&%N9" @97AT96YD"B @(" @
  1346. XM("!P"' R"#)L"&QA"&%T"'1E"&5X"'@L("!A;F0@=7)G97,@=&AA="!Y;W4@
  1347. XM8V]N=')I8G5T92!Y;W5R(&5X=&5N<VEO;G,@=&\*(" @(" @('1H92!W;W)L
  1348. XM9"X*"E,(4T4(144(12!!"$%,"$Q3"%-/"$\*(" @(" @(&,(8RL(*RL(*S((
  1349. XM,FP(;&$(870(=&4(97@(>"@Q*2P@; AL80AA= AT90AE> AX*#$I"@I!"$%5
  1350. XM"%54"%1("$A/"$]2"%(*(" @(" @(%1O<G-T96X@4&]U;&EN("AT;W)S=&5N
  1351. XM0&1I:W4N9&LI"@H@(" @(" @< AP,@@R; AL80AA= AT90AE> AX(&ES(&1E
  1352. XM<FEV960@9G)O;2!V97)S:6]N(#(N,"!O9B @8PAC*P@K*P@K,@@R; AL80AA
  1353. XM= AT90AE> AX("!W<FET=&5N"B @(" @("!B>2!*;V5R9R!(96ET:V]E='1E
  1354. XM<@H*(" @(" @(%1H92!O<FEG:6YA;"!C"&,K""LK""LR"#)L"&QA"&%T"'1E
  1355. XM"&5X"'@@=V%S('=R:71T96X@8GD@3F]R8F5R="!+:65S96PN"@H@(" @(" @
  1356. XM5&AI<R @;6%N=6%L("!P86=E("!I<R @86X@(&%D87!T960@=F5R<VEO;B!O
  1357. XM9B!T:&4@;VYE(&9O<@H@(" @(" @8PAC*P@K*P@K,@@R; AL80AA= AT90AE
  1358. XM> AX+@@N"@I""$)5"%5'"$=3"%,*(" @(" @($]N;'D@:VYO=W,@86)O=70@
  1359. XM56YI>"!P871H;F%M97,N(%1H=7,L('-O;64@($%M:6=A1$]3("!A;F0*(" @
  1360. XM(" @(&%L;" @35,M1$]3(&EN<'5T(&9I;&5N86UE<R!W:6QL('EI96QD('5N
  1361. XM97AP96-T960@<F5S=6QT<RX*(" @(" @(%1H:7,@('!R;V)L96T@("!C86X@
  1362. XM("!B92 @(&-I<F-U;79E;G1E9" @(&)Y(" @=7-I;F<@("!T:&4*(" @(" @
  1363. XM('L(>RT(+6\(;RP(+"T(+2T(+6\(;W4(=70(=' (<'4(=70(='T(?2!O<'1I
  1364. XM;VXN"@H@(" @(" @0F5W87)E("!O9B @9FEL96YA;65S("!T:&%T("!A<F4@
  1365. XM=&]O(&QO;F<@9F]R('1H92!A<'!E;F1E9 H@(" @(" @8"YT97@G('1O(&9I
  1366. XM="X@($ET('=O=6QD(&)E(&$@<VAA;64@:68@=&AE("!?"%!?"&%?"'-?"&-?
  1367. XM"&%?"&P@('-O=7)C90H@(" @(" @9FEL92!W87,@:6YA9'9E<G1E;G1L>2!O
  1368. XM=F5R=W)I='1E;B!B>2!T:&4@7PA,7PAA7PA47PAE7PA8(&9I;&4N"@H*"@H*
  1369. XM"@H*(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
  1370. X:(" @(" @(" @(" @(" @(" @(" @(#,*"@H@
  1371. Xend
  1372. END_OF_FILE
  1373.   if test 10914 -ne `wc -c <'p2latex.0.UU'`; then
  1374.     echo shar: \"'p2latex.0.UU'\" unpacked with wrong size!
  1375.   else
  1376.     echo shar: Uudecoding \"'p2latex.0'\" \(7901 characters\)
  1377.     cat p2latex.0.UU | uudecode
  1378.     if test 7901 -ne `wc -c <'p2latex.0'`; then
  1379.       echo shar: \"'p2latex.0'\" uudecoded with wrong size!
  1380.     else
  1381.       rm p2latex.0.UU
  1382.     fi
  1383.   fi
  1384.   # end of 'p2latex.0.UU'
  1385. fi
  1386. if test -f 'version.c' -a "${1}" != "-c" ; then 
  1387.   echo shar: Will not clobber existing file \"'version.c'\"
  1388. else
  1389.   echo shar: Extracting \"'version.c'\" \(62 characters\)
  1390.   sed "s/^X//" >'version.c' <<'END_OF_FILE'
  1391. Xchar *version_string = "p2latex version 1.0 (Patchlevel 0)";
  1392. X
  1393. END_OF_FILE
  1394.   if test 62 -ne `wc -c <'version.c'`; then
  1395.     echo shar: \"'version.c'\" unpacked with wrong size!
  1396.   fi
  1397.   # end of 'version.c'
  1398. fi
  1399. echo shar: End of archive 2 \(of 3\).
  1400. cp /dev/null ark2isdone
  1401. MISSING=""
  1402. for I in 1 2 3 ; do
  1403.     if test ! -f ark${I}isdone ; then
  1404.     MISSING="${MISSING} ${I}"
  1405.     fi
  1406. done
  1407. if test "${MISSING}" = "" ; then
  1408.     echo You have unpacked all 3 archives.
  1409.     rm -f ark[1-9]isdone
  1410. else
  1411.     echo You still must unpack the following archives:
  1412.     echo "        " ${MISSING}
  1413. fi
  1414. exit 0
  1415. exit 0 # Just in case...
  1416.