home *** CD-ROM | disk | FTP | other *** search
/ pc.louisiana.edu/pub/unix/ / Louisiana_UNIX.tar / Louisiana_UNIX / pch619-621.part1 < prev    next >
Internet Message Format  |  1992-06-01  |  59KB

  1. From nstar!sawmill!prslnk!buhrt@iuvax.cs.indiana.edu Fri May  8 16:11:30 1992
  2. Received: from usl.edu (rouge-gw.usl.edu) by armagnac.ucs.usl.edu with SMTP id AA21329
  3.   (5.65c/IDA-1.4.4 for <jpd@ucs>); Fri, 8 May 1992 16:11:25 -0500
  4. Received: from rex.cs.tulane.edu by usl.edu (4.1/BSS-3.4)
  5.     id AA21126; Fri, 8 May 92 16:11:09 CDT
  6. Received:  by rex.cs.tulane.edu; Fri, 8 May 92 16:10:47 -0500
  7. Received:  from iuvax.cs.indiana.edu by rex.cs.tulane.edu; Fri, 8 May 92 16:10:23 -0500
  8. Received: by iuvax.cs.indiana.edu 
  9. Received: by gator.rn.com (/\==/\ Smail3.1.25.1 #25.5)
  10.     id <m0ljbjY-0000C6C@gator.rn.com>; Fri, 8 May 92 15:40 EST
  11. Received: by sawmill.uucp (/\==/\ Smail3.1.21.1 #21.8)
  12.     id <m0ljazQ-000BEaC@sawmill.uucp>; Fri, 8 May 92 14:52 EST
  13. Received: by prslnk.uucp (/\==/\ Smail3.1.21.1 #21.3)
  14.     id <m0ljaiR-0000caC@prslnk.uucp>; Fri, 8 May 92 14:34 EST
  15. Message-Id: <m0ljaiR-0000caC@prslnk.uucp>
  16. Date: Fri, 8 May 92 14:34 EST
  17. From: prslnk!buhrt@iuvax.cs.indiana.edu (Jeff Buhrt)
  18. To: rutgers!retix!uunet!sawmill!nstar!decwrl!vixie@iuvax.cs.indiana.edu,
  19.         marc@dumbcat.sf.ca.us, jpd@usl.edu, sources-misc@uunet.uu.net
  20. Subject: sc - The SC Spreadsheet: patch4a (1of2)
  21. Status: RO
  22.  
  23.  
  24.  
  25. Submitted-By: nstar!sawmill!prslnk!buhrt (Jeff Buhrt)
  26. Archive-name: sc/patch04a
  27. Patch-To: sc - The SC Spreadsheet, release 6.16: Volume 20, Issue 035-041
  28. Environment: Curses, good yacc/bison1.18 (anything but bison1.16), sed
  29. Windowing Support: Curses
  30.  
  31. Sc is a Public Domain Spreadsheet Calculator.
  32. Sc appears in comp.sources.misc as:
  33.     v20i035-v20i041 sc/part01-7    original   (Sc6.16)
  34.     v22i095   sc/patch01a        Patch01a/2
  35.     v22i096   sc/patch01b        Patch01b/2 (6.16->6.17)
  36.     v22i104   sc/patch02         Patch02       (6.17->6.18)
  37.     v23i035   sc/patch03         Patch03    (6.18->6.19)
  38.  
  39. Details of Patch #4 (a and b)
  40.         -takes sc from 6.19 to 6.21
  41.  
  42. Changes 6.19 -> 6.21 (for more detail see CHANGES):
  43.     -possible pointer problem fixed
  44.     -Makefile changes (errors, compiler support, OS support)
  45.     -add at end of line ('A')
  46.     -support of more special keys: DC, FIND, HELP, SELECT
  47.     -troff output for quickreference
  48.     -output MIF format (FrameMaker)
  49.     -@numiter returns the number of iterations performed
  50.     -table output appends (if possible) standard suffixes (asc, cln, tbl..)
  51.     -additional system and compiler support
  52.  
  53.                         -Jeff Buhrt
  54.                     nstar!sawmill!prslnk!buhrt
  55.                     Proslink, Inc.
  56.  
  57. Unshar each part then apply the following patches to Sc6.19 with
  58.     'patch < pch619-621a' and 'patch < pch619-621b'.
  59.  
  60. *** ../619/CHANGES    Mon Mar 16 10:09:29 1992
  61. --- CHANGES    Fri May  8 12:31:13 1992
  62. ***************
  63. *** 1,3 ****
  64. --- 1,72 ----
  65. + CHANGES BETWEEN 6.21 and 6.19
  66. + Mark R. Rubin
  67. +     -noted a problem using bison 1.16 (use any version but 1.16)
  68. + Marco S Hyman/Ian */and others
  69. +     -Crypt/CRYPT_PATH define problem
  70. + Paul Eggert
  71. +     -sc.doc $Revision: 6.21 $ 'buglet'
  72. + Ulf Noren/Dave Lewis
  73. +     -AIX3.1/Microport System V/AT don't have notimeout()
  74. +         changed NONOTIMEOUT to NO_NOTIMEOUT, define if not present
  75. + Niels Baggesen
  76. +     -function keys may not return ascii codes that isascii() understands
  77. +     -added an A command for vi mode (add at end of row).
  78. +     -Special key support: DC='x' (del char in vi mode), FIND='g' (goto),
  79. +         HELP='?', SELECT='m'
  80. + Dave Davey
  81. +     -noted Ultrix 4.2 curses doesn't have idlok()
  82. +         [I added NO_IDLOK in Makefile]
  83. + Kim DeVaughn
  84. +     -added ${RIGHTBUG} is now passed to sc.o && screen.o
  85. +     -suggested a better fix on SunOS 4.x dont use the Sys V
  86. +      package (CC = /usr/5bin/cc, etc), but use the BSD 4.3 defines
  87. + David Bonnell
  88. +     -scqref [will produce] TROFF output instead of plain text, 
  89. +      [when] you define QREF_FMT=TROFF in the Makefile.
  90. +      The resulting quick reference guide uses the MS macro set and you 
  91. +      build with something like:
  92. +         scqref > quickref
  93. +          troff -ms quickref > quickref.ps
  94. + Kurt Cockrum
  95. +     - sc.h:
  96. +         If not (defined(BSD42) || defined(BSD43) && !defined(ultrix)),
  97. +         include <memory.h> for the benefit of some USG systems...
  98. +     - screen.c:
  99. +         Repaired cpp logic:
  100. +         don't mention IDLOKBAD or idlok() unless SYSV3 defined;
  101. +         idlok() does not exist for USG pre-SYSV systems (may exist for
  102. +         SYSV{2,3,4}).
  103. +     - tutorial.sc:
  104. +         Repaired a number of off-by-1 errors.
  105. + Mats Wichmann
  106. +     -cleaned up Robert E. Cousins MIF format support code which is
  107. +         compatible with FrameMaker.
  108. + Neil Skilling
  109. +     -added @numiter which returns the number of iterations performed.
  110. +      It allows you to solve equations by direct substitution. Taking a
  111. +      guess from another cell if the first iteration otherwise taking the
  112. +      last best iterate. Other uses may be found.
  113. + Martin MacLaren
  114. +     -MS-DOS cleanup of Makefile
  115. + Art Mulder
  116. +     -^T toggle: don't list crypt if not available
  117. + John Amanatides
  118. +     -pointed out a possible NULL ref in interp.c
  119. + Phil Johnson
  120. +     -sc now appends: "asc", "cln", "tbl", etc. to output files
  121. +     -made the engineering format match that used by an engineer
  122. +     -deleted an unused engmult[] reference
  123. +     -added a fix to struct enode for the HP compiler
  124. + Kevin Cosgrove
  125. +     -noted sc should use any predefined PI
  126. + Jeff Buhrt
  127. +     -'make clean' now leaves the binaries and man pages [Jean-Pierre Radley]
  128. +     -'make clobber' cleans all built files (like clean used to) [""]
  129. +     -'-D' vs '-S' was needed on a XENIX2_3 line [""]
  130. +     -'quit()' -> 'doquit()', function conflict [""]
  131. +     -change xmalloc,xrealloc,xfree -> scxmalloc,scxrealloc,scxfree
  132. +         (xmalloc is a standard malloc)
  133.   CHANGES BETWEEN 6.19 and 6.18
  134.   Tom Tkacik
  135.       -sc.doc and CHANGES changes
  136. *** ../619/README    Mon Mar 16 10:09:29 1992
  137. --- README    Fri May  8 12:31:14 1992
  138. ***************
  139. *** 1,11 ****
  140.   This is a much modified version of the public domain spread sheet sc,
  141.   posted several years ago by Mark Weiser as vc, originally by James Gosling.
  142.   
  143. ! CHANGES lists the changes since 6.1 to 6.19.
  144. !     Sc6.16 was released to comp.sources.misc and three sets of patches
  145. !     bring Sc6.16->6.17->6.18->6.19.
  146.   
  147. ! Current maintainer: {sequent, uunet}!sawmill!prslnk!buhrt (Jeff Buhrt)
  148.   
  149.   When you get it built, try "sc tutorial.sc" for a simple introduction
  150.   to the basic commands.
  151. --- 1,11 ----
  152.   This is a much modified version of the public domain spread sheet sc,
  153.   posted several years ago by Mark Weiser as vc, originally by James Gosling.
  154.   
  155. ! CHANGES lists the changes since 6.1 to 6.21.
  156. !     Sc6.16 was released to comp.sources.misc and four sets of patches
  157. !     bring Sc6.16->6.17->6.18->6.19->6.21.
  158.   
  159. ! Current maintainer: nstar!sawmill!prslnk!buhrt (Jeff Buhrt)
  160.   
  161.   When you get it built, try "sc tutorial.sc" for a simple introduction
  162.   to the basic commands.
  163. ***************
  164. *** 58,64 ****
  165.   c) Please abide by the style in the code when you make your changes.  It is easy
  166.        to break things trying to make them look "right".
  167.   d) If you do string functions, please, PLEASE pay attention to null pointers,
  168. !     use xmalloc, xrealloc, and xfree; and xfree those arguments.
  169.   e) Please don't forget to document your changes in both help.c and sc.doc.
  170.   f) WHEN sending diffs: please use diff -c (context diff, and possibly
  171.       more than three lines on each side), I get a lot of code and
  172. --- 58,64 ----
  173.   c) Please abide by the style in the code when you make your changes.  It is easy
  174.        to break things trying to make them look "right".
  175.   d) If you do string functions, please, PLEASE pay attention to null pointers,
  176. !     use scxmalloc, scxrealloc, and scxfree; and scxfree those arguments.
  177.   e) Please don't forget to document your changes in both help.c and sc.doc.
  178.   f) WHEN sending diffs: please use diff -c (context diff, and possibly
  179.       more than three lines on each side), I get a lot of code and
  180. ***************
  181. *** 81,86 ****
  182. --- 81,93 ----
  183.     Note: dumbcat speaks 9600 at V.32 -- sorry, this is not a Telebit modem.
  184.     (Grab dumbcat! /INDEX for a complete list)
  185.   
  186. + 3) Sc6.16 was posted in comp.sources.misc, about Jun 4 1991, Volume 20, Issues
  187. +     035-041. There were then 4 patches: Sc6.16->Sc6.17, Sc6.17->Sc6.18,
  188. +     Sc6.18->Sc6.19, and Sc6.19->Sc6.21.
  189. + 4) (FTP) Paul A Vixie <uunet!decwrl!vixie>
  190. +     gatekeeper.dec.com    in /pub/misc/sc-6.21.tar.Z
  191.   Sc is not a product of ProsLink, Inc.  It is supplied as is with no
  192.   warranty, express or implied, as a service to Usenet readers.  It is not
  193.   copyrighted, either.  Have at it.
  194. ***************
  195. *** 87,91 ****
  196.   
  197.                       Jeff Buhrt
  198.                       ProsLink, Inc.
  199. !                     {sequent, uunet}!sawmill!prslnk!buhrt
  200.   
  201. --- 94,98 ----
  202.   
  203.                       Jeff Buhrt
  204.                       ProsLink, Inc.
  205. !                     nstar!sawmill!prslnk!buhrt
  206.   
  207. *** ../619/sc.doc    Mon Mar 16 10:09:30 1992
  208. --- sc.doc    Fri May  8 12:31:15 1992
  209. ***************
  210. *** 15,21 ****
  211.   .\" - TPs use default indent except for function names, then 18.
  212.   .\" - Smallify uppercase strings.
  213.   .\" - Avoid passive voice and third person.
  214. ! .\" $Revision: 6.19 $
  215.   .\"
  216.   .TH PNAME\ #REVISION#\  1
  217.   .SH NAME
  218. --- 15,21 ----
  219.   .\" - TPs use default indent except for function names, then 18.
  220.   .\" - Smallify uppercase strings.
  221.   .\" - Avoid passive voice and third person.
  222. ! .\" $Revision: 6.21 $
  223.   .\"
  224.   .TH PNAME\ #REVISION#\  1
  225.   .SH NAME
  226. ***************
  227. *** 376,386 ****
  228.   .B slatex
  229.   to give a
  230.   .I SLaTeX (Scandinavian LaTeX)
  231. ! tabular environment; and
  232.   .B tex
  233.   to give a
  234.   .I TeX
  235. ! simple tabbed alignment with ampersands as delimiters.
  236.   .PP
  237.   Other
  238.   .I Set
  239. --- 376,388 ----
  240.   .B slatex
  241.   to give a
  242.   .I SLaTeX (Scandinavian LaTeX)
  243. ! tabular environment;
  244.   .B tex
  245.   to give a
  246.   .I TeX
  247. ! simple tabbed alignment with ampersands as delimiters; and
  248. ! .B frame
  249. ! to give a tblstyle output for FrameMaker.
  250.   .PP
  251.   Other
  252.   .I Set
  253. ***************
  254. *** 2174,2179 ****
  255. --- 2176,2184 ----
  256.   or to unstable cyclic references (for example, set
  257.   .IR A0 's
  258.   expression to ``A0+1'').
  259. + .TP 18
  260. + .BR @numiter 
  261. + Returns the number of iterations performed so far.
  262.   .\" ==========
  263.   .SH FILES
  264.   .TP 4in
  265. *** ../619/psc.doc    Mon Mar 16 10:09:31 1992
  266. --- psc.doc    Fri May  8 12:31:16 1992
  267. ***************
  268. *** 1,4 ****
  269. ! .\" $ Revision $
  270.   .TH PPNAME\ #REVISION#\  1
  271.   .SH NAME
  272.   ppname \- prepare pname files
  273. --- 1,4 ----
  274. ! .\" $Revision: 6.21 $
  275.   .TH PPNAME\ #REVISION#\  1
  276.   .SH NAME
  277.   ppname \- prepare pname files
  278. *** ../619/tutorial.sc    Mon Mar 16 10:08:45 1992
  279. --- tutorial.sc    Fri May  8 12:31:16 1992
  280. ***************
  281. *** 1,21 ****
  282.   # This data file was generated by the Spreadsheet Calculator.
  283.   # You almost certainly shouldn't edit it.
  284.   
  285. - define "page4" A71
  286. - define "page3" A50
  287. - define "page2" A30
  288. - define "page1" A11
  289.   define "page5" A90
  290.   leftstring A1 = "This is a brief sc tutorial, best run in a 24-line window."
  291.   leftstring A2 = "Type 'q' to exit, ^Z to suspend (w/ Job Control)."
  292.   leftstring A3 = "^G interrupts a command."
  293.   leftstring A5 = "Cells are named by their column and row number.  For example,"
  294. ! leftstring A6 = "Cell A5"
  295. ! leftstring B6 = "Cell B5"
  296. ! leftstring C6 = "Cell C5"
  297. ! leftstring A7 = "Cell A6"
  298. ! leftstring A8 = "Cell A7"
  299. ! leftstring C8 = "Cell C7"
  300.   leftstring A9 = "Cells range from A0 to ZZ(some number depending on free memory)."
  301.   leftstring A10 = "Cells can also be named by the user.  See 'range names' in the manual."
  302.   leftstring page1 = "You can move the cursor a couple of different ways:"
  303. --- 1,21 ----
  304.   # This data file was generated by the Spreadsheet Calculator.
  305.   # You almost certainly shouldn't edit it.
  306.   
  307.   define "page5" A90
  308. + define "page1" A11
  309. + define "page2" A30
  310. + define "page3" A50
  311. + define "page4" A71
  312.   leftstring A1 = "This is a brief sc tutorial, best run in a 24-line window."
  313.   leftstring A2 = "Type 'q' to exit, ^Z to suspend (w/ Job Control)."
  314.   leftstring A3 = "^G interrupts a command."
  315.   leftstring A5 = "Cells are named by their column and row number.  For example,"
  316. ! leftstring A6 = "Cell A6"
  317. ! leftstring B6 = "Cell B6"
  318. ! leftstring C6 = "Cell C6"
  319. ! leftstring A7 = "Cell A7"
  320. ! leftstring A8 = "Cell A8"
  321. ! leftstring C8 = "Cell C8"
  322.   leftstring A9 = "Cells range from A0 to ZZ(some number depending on free memory)."
  323.   leftstring A10 = "Cells can also be named by the user.  See 'range names' in the manual."
  324.   leftstring page1 = "You can move the cursor a couple of different ways:"
  325. ***************
  326. *** 28,38 ****
  327.   leftstring A19 = "Cells can contain numbers, formulas, or text."
  328.   leftstring A20 = "Most of the cells on this page contain text."
  329.   leftstring C21 = "<Type 'g page2' to continue>"
  330. ! leftstring A23 = "Cell d22 contains text"
  331.   leftstring D23 = "Text "
  332. ! leftstring A24 = "Cell d23 contains a number"
  333.   let D24 = 123.34
  334. ! leftstring A25 = "Cell d24 contains a formula"
  335.   let D25 = D24+88
  336.   leftstring A27 = "To see what the cell contains, just move the cursor"
  337.   leftstring A28 = "onto the cell.  The contents will show up on line 1 in the brackets."
  338. --- 28,38 ----
  339.   leftstring A19 = "Cells can contain numbers, formulas, or text."
  340.   leftstring A20 = "Most of the cells on this page contain text."
  341.   leftstring C21 = "<Type 'g page2' to continue>"
  342. ! leftstring A23 = "Cell d23 contains text"
  343.   leftstring D23 = "Text "
  344. ! leftstring A24 = "Cell d24 contains a number"
  345.   let D24 = 123.34
  346. ! leftstring A25 = "Cell d25 contains a formula"
  347.   let D25 = D24+88
  348.   leftstring A27 = "To see what the cell contains, just move the cursor"
  349.   leftstring A28 = "onto the cell.  The contents will show up on line 1 in the brackets."
  350. ***************
  351. *** 41,47 ****
  352.   leftstring B32 = "'>text' enters right justified text."
  353.   leftstring B33 = "'=number' enters a number"
  354.   leftstring B34 = "'=formula' enters a formula."
  355. ! leftstring A36 = "Try duplicating d22 through d24 in e22 though e24."
  356.   leftstring A38 = "You erase a cell by typing 'x' with the cursor on the cell."
  357.   leftstring C41 = "<Type 'g page3' to continue>"
  358.   leftstring A43 = "Here is a typical use for numbers and formulas:"
  359. --- 41,47 ----
  360.   leftstring B32 = "'>text' enters right justified text."
  361.   leftstring B33 = "'=number' enters a number"
  362.   leftstring B34 = "'=formula' enters a formula."
  363. ! leftstring A36 = "Try duplicating d23 through d25 in e23 though e25."
  364.   leftstring A38 = "You erase a cell by typing 'x' with the cursor on the cell."
  365.   leftstring C41 = "<Type 'g page3' to continue>"
  366.   leftstring A43 = "Here is a typical use for numbers and formulas:"
  367. ***************
  368. *** 65,74 ****
  369.   let B50 = @sum(B45:B48)
  370.   let C50 = @sum(C45:C48)
  371.   let E50 = @sum(A45:C48)
  372. ! leftstring A52 = "The data is entered in a44 through c47."
  373. ! leftstring A53 = "Cells a49, b49 and c49 sum their respective columns."
  374. ! leftstring A54 = "Cells e44, e45, e46, and e47 sum their respective rows."
  375. ! leftstring A55 = "Cell E49 is a grand total."
  376.   leftstring A56 = "Try changing some of the data cells and watch the sums change."
  377.   leftstring A58 = "You can also edit cells by putting the cursor on the cell and typing:"
  378.   leftstring B59 = "'e' to edit the numeric portion."
  379. --- 65,74 ----
  380.   let B50 = @sum(B45:B48)
  381.   let C50 = @sum(C45:C48)
  382.   let E50 = @sum(A45:C48)
  383. ! leftstring A52 = "The data is entered in a45 through c48."
  384. ! leftstring A53 = "Cells a50, b50 and c50 sum their respective columns."
  385. ! leftstring A54 = "Cells e45, e46, e47, and e48 sum their respective rows."
  386. ! leftstring A55 = "Cell E50 is a grand total."
  387.   leftstring A56 = "Try changing some of the data cells and watch the sums change."
  388.   leftstring A58 = "You can also edit cells by putting the cursor on the cell and typing:"
  389.   leftstring B59 = "'e' to edit the numeric portion."
  390. *** ../619/build.com    Thu Sep 26 10:53:00 1991
  391. --- build.com    Fri May  8 12:31:17 1992
  392. ***************
  393. *** 1,6 ****
  394.   $! VMS command file to build SC and PSC (requires bison) on VMS
  395.   $! SC:
  396. ! $! $Revision: 6.19 $
  397.   $! bison -d gram.y
  398.   $! ren gram_tab.c gram.c
  399.   $ cc'p1'  /define=("SIMPLE","SIGVOID") sc.c
  400. --- 1,6 ----
  401.   $! VMS command file to build SC and PSC (requires bison) on VMS
  402.   $! SC:
  403. ! $! $Revision: 6.21 $
  404.   $! bison -d gram.y
  405.   $! ren gram_tab.c gram.c
  406.   $ cc'p1'  /define=("SIMPLE","SIGVOID") sc.c
  407. *** ../619/Makefile    Mon Mar 16 10:09:31 1992
  408. --- Makefile    Fri May  8 12:31:18 1992
  409. ***************
  410. *** 1,4 ****
  411. ! # Makefile $Revision: 6.19 $
  412.   #
  413.   # 1) Select the proper EXDIR (path), MANDIR, MANEXT, LIBDIR, SIGVOID,
  414.   #    RE_COMP/REGCMP, DFLT_PAGER, and FMOD. Most of the other things aren't
  415. --- 1,4 ----
  416. ! # Makefile $Revision: 6.21 $
  417.   #
  418.   # 1) Select the proper EXDIR (path), MANDIR, MANEXT, LIBDIR, SIGVOID,
  419.   #    RE_COMP/REGCMP, DFLT_PAGER, and FMOD. Most of the other things aren't
  420. ***************
  421. *** 94,100 ****
  422.   # BSD
  423.   #CRYPT=-DCRYPT_PATH=\"/usr/bin/crypt\"
  424.   # other people?
  425. ! #CRYPT=CRYPT_PATH=\"/usr/local/bin/crypt\"
  426.   
  427.   # If you get errors about fmod being undefined when you try to
  428.   # compile, then define NO_FMOD (most likely BSD4.3 and Mt Xinu).
  429. --- 94,100 ----
  430.   # BSD
  431.   #CRYPT=-DCRYPT_PATH=\"/usr/bin/crypt\"
  432.   # other people?
  433. ! #CRYPT=-DCRYPT_PATH=\"/usr/local/bin/crypt\"
  434.   
  435.   # If you get errors about fmod being undefined when you try to
  436.   # compile, then define NO_FMOD (most likely BSD4.3 and Mt Xinu).
  437. ***************
  438. *** 102,113 ****
  439.   FMOD=
  440.   
  441.   # If your system doesn't have notimeout() in curses define NONOTIMEOUT
  442. ! NONOTIMEOUT=
  443. ! #NONOTIMEOUT=-DNONOTIMEOUT
  444.   
  445.   # flags for lint
  446.   LINTFLAGS=-abchxv
  447.   
  448.   # *** SPECIAL NOTES ***
  449.   # For ULTRIX: define the BSD4.2 section and SIGVOID above
  450.   #    tdw@cl.cam.ac.uk tested on Ultrix 3.1C-0
  451. --- 102,118 ----
  452.   FMOD=
  453.   
  454.   # If your system doesn't have notimeout() in curses define NONOTIMEOUT
  455. ! NO_NOTIMEOUT=
  456. ! #NO_NOTIMEOUT=-DNONOTIMEOUT
  457.   
  458.   # flags for lint
  459.   LINTFLAGS=-abchxv
  460.   
  461. + # Format of quick reference guide generated by $(name)qref
  462. + # Leave undefined for normal text output.
  463. + #QREF_FMT=
  464. + QREF_FMT=-DTROFF
  465.   # *** SPECIAL NOTES ***
  466.   # For ULTRIX: define the BSD4.2 section and SIGVOID above
  467.   #    tdw@cl.cam.ac.uk tested on Ultrix 3.1C-0
  468. ***************
  469. *** 128,135 ****
  470.   #         noticing the rows become 2, 3, 40, 41, 42... (etc).
  471.   #    Known systems/terminfos w/ curses problems:
  472.   #    {Esix Rev. D+, AT&T SysV3.2.1}:at386-m,xterm, HP-UX7.0:(not sure)
  473. ! IDLOKBAD=-DIDLOKBAD
  474. ! #IDLOKBAD=
  475.   
  476.   # If moving right off the screen causes the screen to not redraw
  477.   # properly, define RIGHT_CBUG to get around a curses problem on some
  478. --- 133,144 ----
  479.   #         noticing the rows become 2, 3, 40, 41, 42... (etc).
  480.   #    Known systems/terminfos w/ curses problems:
  481.   #    {Esix Rev. D+, AT&T SysV3.2.1}:at386-m,xterm, HP-UX7.0:(not sure)
  482. ! IDLOKISBAD=-DIDLOKBAD
  483. ! #IDLOKISBAD=
  484. ! # If you don't have idlok() in your curses define NOIDLOK
  485. ! NO_IDLOK=
  486. ! #NO_IDLOK=-DNOIDLOK
  487.   
  488.   # If moving right off the screen causes the screen to not redraw
  489.   # properly, define RIGHT_CBUG to get around a curses problem on some
  490. ***************
  491. *** 141,148 ****
  492. --- 150,162 ----
  493.   # some other yacc. Some systems don't allow you to
  494.   # increase the number of terminals (mostly AT&T), SCO's does though.
  495.   #YACC=yacc
  496. + # NOTE: Do not use with bison 1.16! Get a new version....
  497.   YACC=bison -y
  498.   
  499. + # MS-DOS needs y_tab instead of the normal y.tab
  500. + #YTAB=y_tab
  501. + YTAB=y.tab
  502.   # Command to use to make temporary copies of some source files.
  503.   LN=ln
  504.   #LN=ln -s
  505. ***************
  506. *** 166,177 ****
  507.   # Use this for system V.3
  508.   CFLAGS=  -DSYSV3 -O
  509.   LDFLAGS= -s
  510.   LIB=-lm -lcurses -lPW
  511.   # with gcc also use:
  512.   #CC=gcc
  513.   #CFLAGS=  -DSYSV3 -O -pipe -traditional
  514. ! #YACC=bison -y
  515.   
  516.   # Use this for system V.4
  517.   #CFLAGS=  -DSYSV4 -DSYSV3 -O
  518. --- 180,194 ----
  519.   # Use this for system V.3
  520.   CFLAGS=  -DSYSV3 -O
  521.   LDFLAGS= -s
  522. + #CFLAGS=  -DSYSV3 -g
  523. + #LDFLAGS= -g
  524.   LIB=-lm -lcurses -lPW
  525.   # with gcc also use:
  526.   #CC=gcc
  527.   #CFLAGS=  -DSYSV3 -O -pipe -traditional
  528. ! # debugging bison (bison 1.16 is broken)
  529. ! #CFLAGS=  -DSYSV3 -g -pipe -traditional
  530. ! #YACC=bison -y -v -t -l
  531.   
  532.   # Use this for system V.4
  533.   #CFLAGS=  -DSYSV4 -DSYSV3 -O
  534. ***************
  535. *** 190,195 ****
  536. --- 207,214 ----
  537.   #CFLAGS= -O -DBSD42
  538.   #LDFLAGS=
  539.   #LIB=-lm -lcurses -ltermcap
  540. + # with gcc also use:
  541. + #CC=gcc
  542.   
  543.   # Use this for Sequent boxes
  544.   #CC=atscc
  545. ***************
  546. *** 224,230 ****
  547.   #LIB=-lm -lcurses -ltermcap
  548.   
  549.   # Use this for XENIX Version 2.3
  550. ! #CFLAGS= -O -SSYSIII -DXENIX2_3
  551.   #LDFLAGS= -i
  552.   #LIB=-lm -lcurses -ltermcap
  553.   
  554. --- 243,249 ----
  555.   #LIB=-lm -lcurses -ltermcap
  556.   
  557.   # Use this for XENIX Version 2.3
  558. ! #CFLAGS= -O -DSYSIII -DXENIX2_3
  559.   #LDFLAGS= -i
  560.   #LIB=-lm -lcurses -ltermcap
  561.   
  562. ***************
  563. *** 282,312 ****
  564.   $(name):$(PAR)     $(OBJS)
  565.       $(CC) ${LDFLAGS} ${OBJS} ${LIB} -o $(name)
  566.   
  567. ! # Alternative for MS-DOS
  568.   #$(name):     $(OBJS)
  569.   #    link ${LDFLAGS} ${OBJS},$(name),,${LIB};
  570.   
  571.   gram.c:    gram.y
  572. !     $(YACC) -d gram.y; mv y.tab.c gram.c
  573. ! y.tab.h:    gram.y
  574.   
  575. ! # Alternative for MS-DOS
  576. ! #gram.c:    gram.y
  577. ! #    $(YACC) -d gram.y
  578. ! #    mv y_tab.c gram.c
  579. ! #
  580. ! #y_tab.h:    gram.y
  581.   
  582.   p$(name):    psc.c pvmtbl.o pxmalloc.o
  583.       $(CC) $(CFLAGS) ${LDFLAGS} -o p$(name) psc.c pvmtbl.o pxmalloc.o ${PSCLIB}
  584.   
  585.   qhelp.c: help.c
  586.       -rm -f qhelp.c
  587.       ${LN} help.c qhelp.c
  588.   
  589.   $(name)qref:    qhelp.c sc.h
  590. !     $(CC) $(CFLAGS) $(LDFLAGS) -DQREF -DSCNAME=\"$(name)\" -o $(name)qref qhelp.c
  591.   
  592.   pvmtbl.c: vmtbl.c
  593.       -rm -f pvmtbl.c
  594. --- 301,334 ----
  595.   $(name):$(PAR)     $(OBJS)
  596.       $(CC) ${LDFLAGS} ${OBJS} ${LIB} -o $(name)
  597.   
  598. ! # Alternative link for MS-DOS
  599.   #$(name):     $(OBJS)
  600.   #    link ${LDFLAGS} ${OBJS},$(name),,${LIB};
  601.   
  602.   gram.c:    gram.y
  603. !     $(YACC) -d gram.y
  604. !     mv $(YTAB).c gram.c
  605.   
  606. ! $(YTAB).h:    gram.y
  607.   
  608.   p$(name):    psc.c pvmtbl.o pxmalloc.o
  609.       $(CC) $(CFLAGS) ${LDFLAGS} -o p$(name) psc.c pvmtbl.o pxmalloc.o ${PSCLIB}
  610.   
  611. + # Alternative link for MS-DOS (NB: MSC 5.1 has no getopt.c)
  612. + #p$(name):     psc.o pvmtbl.o pxmalloc.o getopt.o
  613. + #    link ${LDFLAGS} psc.o pvmtbl.o pxmalloc.o getopt.o,p$(name);
  614.   qhelp.c: help.c
  615.       -rm -f qhelp.c
  616.       ${LN} help.c qhelp.c
  617.   
  618.   $(name)qref:    qhelp.c sc.h
  619. !     $(CC) $(CFLAGS) $(LDFLAGS) -DQREF $(QREF_FMT) -DSCNAME=\"$(NAME)\" -o $(name)qref qhelp.c
  620. ! # Alternative link for MS-DOS
  621. ! #$(name)qref:    qhelp.c sc.h
  622. ! #    $(CC) -AL -O -Foqhelp.o -c -DQREF -DSCNAME=\"$(name)\" qhelp.c
  623. ! #    link ${LDFLAGS} qhelp.o,$(name)qref;
  624.   
  625.   pvmtbl.c: vmtbl.c
  626.       -rm -f pvmtbl.c
  627. ***************
  628. *** 338,350 ****
  629.   interp.o:    interp.c sc.h
  630.       $(CC) ${CFLAGS} ${IEEE_MATH} ${SIGVOID} ${RINT} ${RE_COMP} ${REGCMP} ${FMOD} -c interp.c
  631.   
  632. ! gram.o:    sc.h y.tab.h gram.c
  633.       $(CC) ${CFLAGS} -c gram.c
  634.       sed < gram.y > experres.h -f eres.sed
  635.       sed < gram.y > statres.h -f sres.sed
  636.   
  637. ! lex.o:    sc.h y.tab.h gram.o lex.c
  638. !     $(CC) ${CFLAGS} ${SIMPLE} ${IEEE_MATH} ${SIGVOID} ${NONOTIMEOUT} -c lex.c
  639.   
  640.   pxmalloc.o: sc.h pxmalloc.c
  641.       $(CC) ${CFLAGS} -c -DPSC pxmalloc.c
  642. --- 360,372 ----
  643.   interp.o:    interp.c sc.h
  644.       $(CC) ${CFLAGS} ${IEEE_MATH} ${SIGVOID} ${RINT} ${RE_COMP} ${REGCMP} ${FMOD} -c interp.c
  645.   
  646. ! gram.o:    sc.h $(YTAB).h gram.c
  647.       $(CC) ${CFLAGS} -c gram.c
  648.       sed < gram.y > experres.h -f eres.sed
  649.       sed < gram.y > statres.h -f sres.sed
  650.   
  651. ! lex.o:    sc.h $(YTAB).h gram.o lex.c
  652. !     $(CC) ${CFLAGS} ${SIMPLE} ${IEEE_MATH} ${SIGVOID} ${NO_NOTIMEOUT} -c lex.c
  653.   
  654.   pxmalloc.o: sc.h pxmalloc.c
  655.       $(CC) ${CFLAGS} -c -DPSC pxmalloc.c
  656. ***************
  657. *** 352,361 ****
  658.   range.o: range.c sc.h
  659.   
  660.   sc.o:    sc.h sc.c
  661. !     $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c sc.c
  662.   
  663.   screen.o:    sc.h screen.c
  664. !     $(CC) ${CFLAGS} ${BROKENCURSES} ${IDLOKBAD} ${INTERNATIONAL} ${SIGVOID} -c screen.c
  665.   
  666.   vi.o: vi.c sc.h
  667.   
  668. --- 374,383 ----
  669.   range.o: range.c sc.h
  670.   
  671.   sc.o:    sc.h sc.c
  672. !     $(CC) ${CFLAGS} ${DFLT_PAGER} ${RIGHTBUG} ${SIGVOID} ${SAVE} -c sc.c
  673.   
  674.   screen.o:    sc.h screen.c
  675. !     $(CC) ${CFLAGS} ${BROKENCURSES} ${IDLOKISBAD} ${INTERNATIONAL} ${RIGHTBUG} ${SIGVOID} ${NO_IDLOK} -c screen.c
  676.   
  677.   vi.o: vi.c sc.h
  678.   
  679. ***************
  680. *** 362,370 ****
  681.   # other stuff
  682.   
  683.   clean:
  684. !     rm -f *.o *res.h y.tab.h $(name) p$(name) debug core gram.c $(name).1 \
  685.       $(name).man p$(name).man p$(name).1 y.output $(name)qref \
  686. !     pxmalloc.c pvmtbl.c qhelp.c y_tab.h
  687.   
  688.   shar: ${SRC} ${DOCS}
  689.       shar -c -m 64000 -f shar ${DOCS} ${SRC}
  690. --- 384,396 ----
  691.   # other stuff
  692.   
  693.   clean:
  694. !     rm -f *.o *res.h y.tab.h debug core gram.c $(name).1 \
  695. !     p$(name).1 y.output pxmalloc.c pvmtbl.c qhelp.c y_tab.h
  696. ! clobber:
  697. !     rm -f *.o *res.h $(YTAB).h $(name) p$(name) debug core gram.c $(name).1 \
  698.       $(name).man p$(name).man p$(name).1 y.output $(name)qref \
  699. !     pxmalloc.c pvmtbl.c qhelp.c
  700.   
  701.   shar: ${SRC} ${DOCS}
  702.       shar -c -m 64000 -f shar ${DOCS} ${SRC}
  703. ***************
  704. *** 396,402 ****
  705.       name=$(name) NAME=$(NAME) LIBDIR=$(LIBDIR) sh torev sc.doc >  $(name).1
  706.   #    sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g \
  707.   #       -e s%#LIBDIR#%$(LIBDIR)%g sc.doc >  $(name).1
  708. ! #    REVISION=`sed -e '/Revision/!D' -e 's/.*$Revision: 6.19 $(
  709.   #    sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g \
  710.   #        -e s%#LIBDIR#%$(LIBDIR)%g \
  711.   #        -e 's/#REVISION#/$(REVISION)/' sc.doc >  $(name).1
  712. --- 422,428 ----
  713.       name=$(name) NAME=$(NAME) LIBDIR=$(LIBDIR) sh torev sc.doc >  $(name).1
  714.   #    sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g \
  715.   #       -e s%#LIBDIR#%$(LIBDIR)%g sc.doc >  $(name).1
  716. ! #    REVISION=`sed -e '/Revision/!D' -e 's/.*$Revision: 6.21 $(
  717.   #    sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g \
  718.   #        -e s%#LIBDIR#%$(LIBDIR)%g \
  719.   #        -e 's/#REVISION#/$(REVISION)/' sc.doc >  $(name).1
  720. *** ../619/cmds.c    Mon Mar 16 10:09:32 1992
  721. --- cmds.c    Fri May  8 13:40:24 1992
  722. ***************
  723. *** 7,13 ****
  724.    *
  725.    *              More mods Robert Bond, 12/86
  726.    *
  727. !  *        $Revision: 6.19 $
  728.    */
  729.   
  730.   #include <sys/types.h>
  731. --- 7,13 ----
  732.    *
  733.    *              More mods Robert Bond, 12/86
  734.    *
  735. !  *        $Revision: 6.21 $
  736.    */
  737.   
  738.   #include <sys/types.h>
  739. ***************
  740. *** 459,464 ****
  741. --- 459,465 ----
  742.       modflg++;
  743.   }
  744.   
  745. + /* delete group of columns (1 or more) */
  746.   void
  747.   closecol (cs, numcol)
  748.   int cs;
  749. ***************
  750. *** 517,523 ****
  751.       fwidth[i] = DEFWIDTH;
  752.       precision[i] = DEFPREC;
  753.       realfmt[i] = DEFREFMT;
  754. !     col_hidden[i] = 0;
  755.       }
  756.   
  757.       maxcol -= numcol;
  758. --- 518,524 ----
  759.       fwidth[i] = DEFWIDTH;
  760.       precision[i] = DEFPREC;
  761.       realfmt[i] = DEFREFMT;
  762. !     col_hidden[i] = FALSE;
  763.       }
  764.   
  765.       maxcol -= numcol;
  766. ***************
  767. *** 675,681 ****
  768.       (void) fprintf(f, " tblstyle = %s", tbl_style == TBL ? "tbl" :
  769.                       tbl_style == LATEX ? "latex" :
  770.                       tbl_style == SLATEX ? "slatex" :
  771. !                     tbl_style == TEX ? "tex" : "0" );
  772.       if (craction)
  773.       (void) fprintf(f, " craction = %d", craction);
  774.       if (rowlimit >= 0)
  775. --- 676,683 ----
  776.       (void) fprintf(f, " tblstyle = %s", tbl_style == TBL ? "tbl" :
  777.                       tbl_style == LATEX ? "latex" :
  778.                       tbl_style == SLATEX ? "slatex" :
  779. !                     tbl_style == TEX ? "tex" :
  780. !                     tbl_style == FRAME ? "frame" : "0" );
  781.       if (craction)
  782.       (void) fprintf(f, " craction = %d", craction);
  783.       if (rowlimit >= 0)
  784. ***************
  785. *** 698,712 ****
  786.       int fieldlen, nextcol;
  787.       register row, col;
  788.       register struct ent **pp;
  789. !     char *xmalloc();
  790. !     char *xrealloc();
  791.   
  792.       if ((strcmp(fname, curfile) == 0) &&
  793.       !yn_ask("Confirm that you want to destroy the data base: (y,n)")) {
  794.       return;
  795.       }
  796.   
  797. !     if (!pline && (pline = xmalloc((unsigned)(FBUFLEN *
  798.                       ++fbufs_allocated))) == (char *)NULL)
  799.       {   error("Malloc failed in printfile()");
  800.           return;
  801. --- 700,731 ----
  802.       int fieldlen, nextcol;
  803.       register row, col;
  804.       register struct ent **pp;
  805. !     char file[32];
  806. !     char path[256];
  807. !     char *tpp;
  808. !     /* printfile will be the [path/]file ---> [path/]file.out,
  809. !      * file is limited to 14 characters.
  810. !      */
  811. !     if (*fname == '\0') {
  812. !     strcpy(path, curfile);
  813.   
  814. +     if ((tpp = strrchr(path, '/'))  == NULL)
  815. +         tpp = path;
  816. +     else
  817. +         tpp++;
  818. +     strcpy(file, tpp);
  819. +     file[10] = '\0';
  820. +     sprintf(tpp, "%s.asc", file);
  821. +     fname = path;
  822. +     }
  823.       if ((strcmp(fname, curfile) == 0) &&
  824.       !yn_ask("Confirm that you want to destroy the data base: (y,n)")) {
  825.       return;
  826.       }
  827.   
  828. !     if (!pline && (pline = scxmalloc((unsigned)(FBUFLEN *
  829.                       ++fbufs_allocated))) == (char *)NULL)
  830.       {   error("Malloc failed in printfile()");
  831.           return;
  832. ***************
  833. *** 741,747 ****
  834.            * attempting to write 'out of bounds'.
  835.            */
  836.           while(c > (fbufs_allocated * FBUFLEN)) {
  837. !           if((pline = xrealloc
  838.                      ((char *)pline, 
  839.                   (unsigned)(FBUFLEN * ++fbufs_allocated)))
  840.                == NULL) {
  841. --- 760,766 ----
  842.            * attempting to write 'out of bounds'.
  843.            */
  844.           while(c > (fbufs_allocated * FBUFLEN)) {
  845. !           if((pline = scxrealloc
  846.                      ((char *)pline, 
  847.                   (unsigned)(FBUFLEN * ++fbufs_allocated)))
  848.                == NULL) {
  849. ***************
  850. *** 754,760 ****
  851.           if ((*pp)->flags&is_valid) {
  852.               while(plinelim + fwidth[col] > 
  853.                 (fbufs_allocated * FBUFLEN)) {
  854. !               if((pline = ((char *)xrealloc
  855.                      ((char *)pline, 
  856.                       (unsigned)(FBUFLEN * ++fbufs_allocated))))
  857.                == NULL) {
  858. --- 773,779 ----
  859.           if ((*pp)->flags&is_valid) {
  860.               while(plinelim + fwidth[col] > 
  861.                 (fbufs_allocated * FBUFLEN)) {
  862. !               if((pline = ((char *)scxrealloc
  863.                      ((char *)pline, 
  864.                       (unsigned)(FBUFLEN * ++fbufs_allocated))))
  865.                == NULL) {
  866. ***************
  867. *** 811,821 ****
  868.               slen = fieldlen;
  869.               
  870.               while(c + fieldlen + 2 > (fbufs_allocated * FBUFLEN)) {
  871. !               if((pline = ((char *)xrealloc
  872.                      ((char *)pline, 
  873.                       (unsigned)(FBUFLEN * ++fbufs_allocated))))
  874.                == NULL) {
  875. !             error ("xrealloc failed in printfile()");
  876.               return;
  877.                 }
  878.               }          
  879. --- 830,840 ----
  880.               slen = fieldlen;
  881.               
  882.               while(c + fieldlen + 2 > (fbufs_allocated * FBUFLEN)) {
  883. !               if((pline = ((char *)scxrealloc
  884.                      ((char *)pline, 
  885.                       (unsigned)(FBUFLEN * ++fbufs_allocated))))
  886.                == NULL) {
  887. !             error ("scxrealloc failed in printfile()");
  888.               return;
  889.                 }
  890.               }          
  891. ***************
  892. *** 867,872 ****
  893. --- 886,916 ----
  894.       register row, col;
  895.       register struct ent **pp;
  896.       char coldelim = DEFCOLDELIM;
  897. +     char file[32];
  898. +     char path[256];
  899. +     char *tpp;
  900. +     /* tblprintfile will be the [path/]file ---> [path/]file.out,
  901. +      * file is limited to 14 characters.
  902. +      */
  903. +     if (*fname == '\0') {
  904. +     strcpy(path, curfile);
  905. +     if ((tpp = strrchr(path, '/'))  == NULL)
  906. +       tpp = path;
  907. +     else
  908. +       tpp++;
  909. +     strcpy(file, tpp);
  910. +     file[10] = '\0';
  911. +     if (tbl_style == 0)
  912. +       sprintf(tpp, "%s.cln", file);
  913. +     else if (tbl_style == TBL)
  914. +       sprintf(tpp, "%s.tbl", file);
  915. +     else if (tbl_style == LATEX)
  916. +       sprintf(tpp, "%s.lat", file);
  917. +     else if (tbl_style == TEX)
  918. +       sprintf(tpp, "%s.tex", file);
  919. +     fname = path;
  920. +     }
  921.   
  922.       if ((strcmp(fname, curfile) == 0) &&
  923.       !yn_ask("Confirm that you want to destroy the data base: (y,n)"))
  924. ***************
  925. *** 900,911 ****
  926. --- 944,992 ----
  927.           progname, cn-c0+1);
  928.       coldelim = '&';
  929.       }
  930. +     else if ( tbl_style == FRAME ) {
  931. +     fprintf(f,"<MIFFile 3.00> # generated by the sc spreadsheet calculator\n");
  932. +     fprintf(f,"<Tbls\n");
  933. +     fprintf(f," <Tbl \n");
  934. +     fprintf(f,"  <TblID 1> # This table's ID is 1\n");
  935. +     fprintf(f,"  <TblFormat \n");
  936. +     fprintf(f,"   <TblTag `Format A'> # Table Format Catalog\n");
  937. +     fprintf(f,"  > # end of TblFormat\n");
  938. +     fprintf(f,"  <TblNumColumns %d> # Has %d columns\n",cn-c0+1,cn-c0+1);
  939. +     fprintf(f,"  <TblTitleContent\n");
  940. +     fprintf(f,"   <Para\n");
  941. +     fprintf(f,"    <PgfTag `TableTitle'> # Forces lookup in Paragraph Format Catalog\n");
  942. +     fprintf(f,"    <ParaLine\n");
  943. +     fprintf(f,"     <String `%s'>\n",fname);
  944. +     fprintf(f,"    > # end of ParaLine\n");
  945. +     fprintf(f,"   > # end of Para\n");
  946. +     fprintf(f,"  > # end of TblTitleContent\n");
  947. +     fprintf(f,"  <TblH # The heading\n");
  948. +     fprintf(f,"   <Row # The heading row\n");
  949. +     for (col=c0; col <= cn; col++) {
  950. +         fprintf(f,"    <Cell <CellContent <Para # Cell in column \n");
  951. +         fprintf(f,"       <PgfTag `CellHeading'> # in Paragraph Format Catalog\n");
  952. +         fprintf(f,"       <ParaLine <String `%c'>>\n",'A'+col);
  953. +         fprintf(f,"    >>> # end of Cell\n");
  954. +     }
  955. +     fprintf(f,"   > # end of Row\n");
  956. +     fprintf(f,"  > # end of TblH\n");
  957. +     fprintf(f,"  <TblBody # The body\n");
  958. +     }
  959.   
  960.       for (row=r0; row<=rn; row++) {
  961.       if ( tbl_style == TEX )
  962.           (void) fprintf (f, "\\+");
  963. +     else if ( tbl_style == FRAME ) {
  964. +         fprintf(f,"   <Row # The next body row\n");
  965. +     }
  966.       
  967.       for (pp = ATBL(tbl, row, col=c0); col<=cn; col++, pp++) {
  968. +         if ( tbl_style == FRAME ) {
  969. +         fprintf(f,"    <Cell <CellContent <Para\n");
  970. +         fprintf(f,"       <PgfTag `CellBody'> # in Paragraph Format Catalog\n");
  971. +         fprintf(f,"       <ParaLine <String `");
  972. +         } 
  973.           if (*pp) {
  974.           char *s;
  975.           if ((*pp)->flags&is_valid) {
  976. ***************
  977. *** 933,940 ****
  978.                   unspecial (f, s, coldelim);
  979.           }
  980.           }
  981.           if ( col < cn )
  982. !         (void) fprintf(f,"%c", coldelim);
  983.       }
  984.       if ( tbl_style == LATEX ) {
  985.           if ( row < rn ) (void) fprintf (f, "\\\\");
  986. --- 1014,1026 ----
  987.                   unspecial (f, s, coldelim);
  988.           }
  989.           }
  990. +         if (tbl_style == FRAME) {
  991. +         fprintf(f, "'>>\n");
  992. +         fprintf(f,"    >>> # end of Cell\n");
  993. +         }
  994.           if ( col < cn )
  995. !         if (tbl_style != FRAME)
  996. !             (void) fprintf(f,"%c", coldelim);
  997.       }
  998.       if ( tbl_style == LATEX ) {
  999.           if ( row < rn ) (void) fprintf (f, "\\\\");
  1000. ***************
  1001. *** 945,950 ****
  1002. --- 1031,1039 ----
  1003.       else if ( tbl_style == TEX ) {
  1004.           (void) fprintf (f, "\\cr");
  1005.       }
  1006. +     else if ( tbl_style == FRAME ) {
  1007. +         fprintf(f,"   > # end of Row\n");
  1008. +     }
  1009.       (void) fprintf (f,"\n");
  1010.       }
  1011.   
  1012. ***************
  1013. *** 956,961 ****
  1014. --- 1045,1059 ----
  1015.       (void) fprintf (f,"!end<tabular>\n%% ** end of %s spreadsheet output\n", progname);
  1016.       else if ( tbl_style == TEX )
  1017.       (void) fprintf (f,"}\n%% ** end of %s spreadsheet output\n", progname);
  1018. +     else if ( tbl_style == FRAME ) {
  1019. +     fprintf(f,"  > # end of TblBody\n");
  1020. +     fprintf(f," ># end of Tbl\n");
  1021. +     fprintf(f,"> # end of Tbls\n");
  1022. +     fprintf(f,"<TextFlow <Para \n");
  1023. +     fprintf(f,"  <PgfTag Body> \n");
  1024. +     fprintf(f,"  <ParaLine <ATbl 1>> # Reference to table ID 1\n");
  1025. +     fprintf(f,">>\n");
  1026. +     }
  1027.   
  1028.       closeout(f, pid);
  1029.   }
  1030. ***************
  1031. *** 996,1002 ****
  1032.           freeenodes = ret->e.o.left;
  1033.       }
  1034.       else
  1035. !         ret = (struct enode *) xmalloc ((unsigned) sizeof (struct enode));
  1036.       ret->op = e->op;
  1037.       newrow=e->e.r.left.vf & FIX_ROW ? e->e.r.left.vp->row :
  1038.                         e->e.r.left.vp->row+Rdelta;
  1039. --- 1094,1100 ----
  1040.           freeenodes = ret->e.o.left;
  1041.       }
  1042.       else
  1043. !         ret = (struct enode *) scxmalloc ((unsigned) sizeof (struct enode));
  1044.       ret->op = e->op;
  1045.       newrow=e->e.r.left.vf & FIX_ROW ? e->e.r.left.vp->row :
  1046.                         e->e.r.left.vp->row+Rdelta;
  1047. ***************
  1048. *** 1016,1022 ****
  1049.           freeenodes = ret->e.o.left;
  1050.       }
  1051.       else
  1052. !         ret = (struct enode *) xmalloc ((unsigned) sizeof (struct enode));
  1053.       ret->op = e->op;
  1054.       switch (ret->op) {
  1055.       case 'v':
  1056. --- 1114,1120 ----
  1057.           freeenodes = ret->e.o.left;
  1058.       }
  1059.       else
  1060. !         ret = (struct enode *) scxmalloc ((unsigned) sizeof (struct enode));
  1061.       ret->op = e->op;
  1062.       switch (ret->op) {
  1063.       case 'v':
  1064. ***************
  1065. *** 1038,1044 ****
  1066.           ret->e.o.left = (struct enode *)0;
  1067.            break;
  1068.       case '$':
  1069. !         ret->e.s = xmalloc((unsigned) strlen(e->e.s)+1);
  1070.           (void) strcpy(ret->e.s, e->e.s);
  1071.           break;
  1072.       default:
  1073. --- 1136,1142 ----
  1074.           ret->e.o.left = (struct enode *)0;
  1075.            break;
  1076.       case '$':
  1077. !         ret->e.s = scxmalloc((unsigned) strlen(e->e.s)+1);
  1078.           (void) strcpy(ret->e.s, e->e.s);
  1079.           break;
  1080.       default:
  1081. ***************
  1082. *** 1051,1061 ****
  1083.   }
  1084.   
  1085.   /*
  1086.    * sync_refs and syncref are used to remove references to
  1087.    * deleted struct ents.  Note that the deleted structure must still
  1088.    * be hanging around before the call, but not referenced by an entry
  1089. !  * in tbl.  Thus the free_ent, fix_ent calls in sc.c
  1090.    */
  1091.   void
  1092.   sync_refs ()
  1093. --- 1149,1158 ----
  1094.   }
  1095.   
  1096.   /*
  1097.    * sync_refs and syncref are used to remove references to
  1098.    * deleted struct ents.  Note that the deleted structure must still
  1099.    * be hanging around before the call, but not referenced by an entry
  1100. !  * in tbl.  Thus the free_ent calls in sc.c
  1101.    */
  1102.   void
  1103.   sync_refs ()
  1104. ***************
  1105. *** 1144,1150 ****
  1106.       FullUpdate++;
  1107.       modflg++;
  1108.       while (c1 <= c2)
  1109. !     col_hidden[c1++] = 1;
  1110.   }
  1111.   
  1112.   /* mark a row as not-hidden */
  1113. --- 1241,1247 ----
  1114.       FullUpdate++;
  1115.       modflg++;
  1116.       while (c1 <= c2)
  1117. !     col_hidden[c1++] = TRUE;
  1118.   }
  1119.   
  1120.   /* mark a row as not-hidden */
  1121. ***************
  1122. *** 1180,1186 ****
  1123.       FullUpdate++;
  1124.       modflg++;
  1125.       while (c1 <= c2)
  1126. !     col_hidden[c1++] = 0;
  1127.   }
  1128.   
  1129.   /* Open the output file, setting up a pipe if needed */
  1130. --- 1277,1283 ----
  1131.       FullUpdate++;
  1132.       modflg++;
  1133.       while (c1 <= c2)
  1134. !     col_hidden[c1++] = FALSE;
  1135.   }
  1136.   
  1137.   /* Open the output file, setting up a pipe if needed */
  1138. ***************
  1139. *** 1282,1293 ****
  1140.       n -> expr = copye (p -> expr, dr, dc);
  1141.       n -> label = (char *)0;
  1142.       if (p -> label) {
  1143. !     n -> label = xmalloc ((unsigned) (strlen (p -> label) + 1));
  1144.       (void) strcpy (n -> label, p -> label);
  1145.       }
  1146.       n -> format = 0;
  1147.       if (p -> format) {
  1148. !         n -> format = xmalloc ((unsigned) (strlen (p -> format) + 1));
  1149.       (void) strcpy (n -> format, p -> format);
  1150.       }
  1151.   }
  1152. --- 1379,1390 ----
  1153.       n -> expr = copye (p -> expr, dr, dc);
  1154.       n -> label = (char *)0;
  1155.       if (p -> label) {
  1156. !     n -> label = scxmalloc ((unsigned) (strlen (p -> label) + 1));
  1157.       (void) strcpy (n -> label, p -> label);
  1158.       }
  1159.       n -> format = 0;
  1160.       if (p -> format) {
  1161. !         n -> format = scxmalloc ((unsigned) (strlen (p -> format) + 1));
  1162.       (void) strcpy (n -> format, p -> format);
  1163.       }
  1164.   }
  1165. ***************
  1166. *** 1457,1463 ****
  1167.       for (c=0; c++<=maxcol; pp++)
  1168.           if (*pp) {
  1169.           if ((*pp)->expr)  efree ((*pp) -> expr);
  1170. !         if ((*pp)->label) xfree ((char *)((*pp) -> label));
  1171.           (*pp)->next = freeents;    /* save [struct ent] for reuse */
  1172.           freeents = *pp;
  1173.           *pp = (struct ent *)0;
  1174. --- 1554,1560 ----
  1175.       for (c=0; c++<=maxcol; pp++)
  1176.           if (*pp) {
  1177.           if ((*pp)->expr)  efree ((*pp) -> expr);
  1178. !         if ((*pp)->label) scxfree ((char *)((*pp) -> label));
  1179.           (*pp)->next = freeents;    /* save [struct ent] for reuse */
  1180.           freeents = *pp;
  1181.           *pp = (struct ent *)0;
  1182. ***************
  1183. *** 1762,1768 ****
  1184.   #ifdef sequent
  1185.           if ((statbuf.st_blksize > buflen) || (buf == NULL))
  1186.           {    buflen = statbuf.st_blksize;
  1187. !             if ((buf = xrealloc(buf, buflen)) == (char *)0)
  1188.               {    buflen = 0;
  1189.                   return(0);
  1190.               }
  1191. --- 1859,1865 ----
  1192.   #ifdef sequent
  1193.           if ((statbuf.st_blksize > buflen) || (buf == NULL))
  1194.           {    buflen = statbuf.st_blksize;
  1195. !             if ((buf = scxrealloc(buf, buflen)) == (char *)0)
  1196.               {    buflen = 0;
  1197.                   return(0);
  1198.               }
  1199. *** ../619/crypt.c    Mon Mar 16 10:09:33 1992
  1200. --- crypt.c    Fri May  8 12:31:19 1992
  1201. ***************
  1202. *** 2,8 ****
  1203.    * Encryption utilites
  1204.    * Bradley Williams    
  1205.    * {allegra,ihnp4,uiucdcs,ctvax}!convex!williams
  1206. !  * $Revision: 6.19 $
  1207.    */
  1208.   
  1209.   #if !defined(VMS) && !defined(MSDOS) && defined(CRYPT_PATH)
  1210. --- 2,8 ----
  1211.    * Encryption utilites
  1212.    * Bradley Williams    
  1213.    * {allegra,ihnp4,uiucdcs,ctvax}!convex!williams
  1214. !  * $Revision: 6.21 $
  1215.    */
  1216.   
  1217.   #if !defined(VMS) && !defined(MSDOS) && defined(CRYPT_PATH)
  1218. ***************
  1219. *** 19,25 ****
  1220.   
  1221.   #include "sc.h"
  1222.   
  1223. - char        *strcpy();
  1224.   char        *getpass();
  1225.   
  1226.   #ifdef SYSV3
  1227. --- 19,24 ----
  1228. *** ../619/format.c    Mon Mar 16 10:09:34 1992
  1229. --- format.c    Fri May  8 13:40:26 1992
  1230. ***************
  1231. *** 3,9 ****
  1232.    * Mark Nagel <nagel@ics.uci.edu>
  1233.    * 20 July 1989
  1234.    *
  1235. !  * $Revision: 6.19 $
  1236.    *
  1237.    * bool
  1238.    * format(fmt, num, buf, buflen)
  1239. --- 3,9 ----
  1240.    * Mark Nagel <nagel@ics.uci.edu>
  1241.    * 20 July 1989
  1242.    *
  1243. !  * $Revision: 6.21 $
  1244.    *
  1245.    * bool
  1246.    * format(fmt, num, buf, buflen)
  1247. ***************
  1248. *** 134,147 ****
  1249.   
  1250.     if (strlen(fmt) + 1 > fmtlen)
  1251.     {    fmtlen = strlen(fmt) + 40;
  1252. !     tmpfmt1 = xrealloc(tmpfmt1, fmtlen);
  1253. !     tmpfmt2 = xrealloc(tmpfmt2, fmtlen);
  1254. !     exptmp = xrealloc(exptmp, fmtlen);
  1255.     }
  1256.     fmt = strcpy(tmpfmt1, fmt);
  1257.     if (buflen + 1 > mantlen)
  1258.     {    mantlen = buflen + 40;
  1259. !     mantissa = xrealloc(mantissa, mantlen);
  1260.     }
  1261.   
  1262.     /*
  1263. --- 134,147 ----
  1264.   
  1265.     if (strlen(fmt) + 1 > fmtlen)
  1266.     {    fmtlen = strlen(fmt) + 40;
  1267. !     tmpfmt1 = scxrealloc(tmpfmt1, fmtlen);
  1268. !     tmpfmt2 = scxrealloc(tmpfmt2, fmtlen);
  1269. !     exptmp = scxrealloc(exptmp, fmtlen);
  1270.     }
  1271.     fmt = strcpy(tmpfmt1, fmt);
  1272.     if (buflen + 1 > mantlen)
  1273.     {    mantlen = buflen + 40;
  1274. !     mantissa = scxrealloc(mantissa, mantlen);
  1275.     }
  1276.   
  1277.     /*
  1278. ***************
  1279. *** 167,173 ****
  1280.     
  1281.     /*
  1282.      * extract other information from format and produce a
  1283. !    * format string stored in tmpfmt2 also xmalloc()'d above
  1284.      */
  1285.     tmp = tmpfmt2;
  1286.     for (cp = fmt, tp = tmp; *cp != EOS; cp++)
  1287. --- 167,173 ----
  1288.     
  1289.     /*
  1290.      * extract other information from format and produce a
  1291. !    * format string stored in tmpfmt2 also scxmalloc()'d above
  1292.      */
  1293.     tmp = tmpfmt2;
  1294.     for (cp = fmt, tp = tmp; *cp != EOS; cp++)
  1295. ***************
  1296. *** 298,304 ****
  1297.       len_ci = strlen(ci);
  1298.       if (len_ci >= cilen)
  1299.       {    cilen = len_ci + 40;
  1300. !     citmp = xrealloc(citmp, cilen);
  1301.       }
  1302.       ci = strcpy(citmp, ci);
  1303.   
  1304. --- 298,304 ----
  1305.       len_ci = strlen(ci);
  1306.       if (len_ci >= cilen)
  1307.       {    cilen = len_ci + 40;
  1308. !     citmp = scxrealloc(citmp, cilen);
  1309.       }
  1310.       ci = strcpy(citmp, ci);
  1311.   
  1312. ***************
  1313. *** 306,312 ****
  1314.       len_cf = strlen(cf);
  1315.       if (len_cf >= cflen)
  1316.       {    cflen = len_cf + 40;
  1317. !     cftmp = xrealloc(cftmp, cilen);
  1318.       }
  1319.       cf = strcpy(cftmp, cf);
  1320.   
  1321. --- 306,312 ----
  1322.       len_cf = strlen(cf);
  1323.       if (len_cf >= cflen)
  1324.       {    cflen = len_cf + 40;
  1325. !     cftmp = scxrealloc(cftmp, cilen);
  1326.       }
  1327.       cf = strcpy(cftmp, cf);
  1328.   
  1329. ***************
  1330. *** 314,320 ****
  1331.       len_ce = strlen(ce);
  1332.   /*
  1333.    * Skip copy assuming sprintf doesn't call our format functions
  1334. !  *   ce = strcpy(xmalloc((unsigned)((len_ce = strlen(ce)) + 1)), ce);
  1335.    */
  1336.       if (len_ci + len_cf + len_ce < buflen)
  1337.       {
  1338. --- 314,320 ----
  1339.       len_ce = strlen(ce);
  1340.   /*
  1341.    * Skip copy assuming sprintf doesn't call our format functions
  1342. !  *   ce = strcpy(scxmalloc((unsigned)((len_ce = strlen(ce)) + 1)), ce);
  1343.    */
  1344.       if (len_ci + len_cf + len_ce < buflen)
  1345.       {
  1346. ***************
  1347. *** 489,495 ****
  1348.    * format is used.  The formats are:         example
  1349.    *    0:   Fixed point (default)             0.00010
  1350.    *    1:   Scientific                        1.00E-04
  1351. !  *    2:   Engineering                       100.00u
  1352.    *
  1353.    * The format command 'f' now uses three values.  The first two are the
  1354.    * width and precision, and the last one is the format value 0, 1, or 2 as
  1355. --- 489,495 ----
  1356.    * format is used.  The formats are:         example
  1357.    *    0:   Fixed point (default)             0.00010
  1358.    *    1:   Scientific                        1.00E-04
  1359. !  *    2:   Engineering                       100.00e-06
  1360.    *
  1361.    * The format command 'f' now uses three values.  The first two are the
  1362.    * width and precision, and the last one is the format value 0, 1, or 2 as
  1363. ***************
  1364. *** 499,507 ****
  1365.    * resulting string is too long to fit into the passed buffer, the
  1366.    * function returns false.  Otherwise the function returns true.
  1367.    *
  1368. !  * When a number is formatted as engineering and is outside of the range
  1369. !  * of typically used engineering exponents, the format reverts to
  1370. !  * scientific.
  1371.    *
  1372.    * To preserve compatability with old spreadsheet files, the third value
  1373.    * may be missing, and the default will be fixed point (format 0).
  1374. --- 499,506 ----
  1375.    * resulting string is too long to fit into the passed buffer, the
  1376.    * function returns false.  Otherwise the function returns true.
  1377.    *
  1378. !  * When a number is formatted as engineering and is outside of the range,
  1379. !  * the format reverts to scientific.
  1380.    *
  1381.    * To preserve compatability with old spreadsheet files, the third value
  1382.    * may be missing, and the default will be fixed point (format 0).
  1383. ***************
  1384. *** 518,525 ****
  1385.   #define REFMTDATE    3
  1386.   #endif
  1387.   
  1388. - char engmult[] = "afpnum kMGT";
  1389.   bool
  1390.   engformat(fmt, width, lprecision, val, buf, buflen)
  1391.   int fmt; 
  1392. --- 517,522 ----
  1393. ***************
  1394. *** 529,534 ****
  1395. --- 526,537 ----
  1396.   char *buf;
  1397.   int buflen;
  1398.   {
  1399. +   static char *engmult[] = {
  1400. +       "-18", "-15", "-12", "-09", "-06", "-03",
  1401. +       "+00",
  1402. +       "+03", "+06", "+09", "+12", "+15", "+18"
  1403. +   };
  1404.     int engind = 0;
  1405.     double engmant, pow(), engabs, engexp;
  1406.     if (buflen < width) return (false);
  1407. ***************
  1408. *** 557,563 ****
  1409.         if ((engabs >= 1e6) && (engabs < 1e9 )) engind=8;
  1410.         if ((engabs >= 1e9) && (engabs < 1e12 )) engind=9;
  1411.         if ((engabs >= 1e12) && (engabs < 1e15 )) engind=10;
  1412. !       if ((engabs <1e-18) || (engabs >=1e15))
  1413.         {
  1414.         /* Revert to floating point */
  1415.           (void) sprintf(buf,"%*.*E", width, lprecision, val);
  1416. --- 560,568 ----
  1417.         if ((engabs >= 1e6) && (engabs < 1e9 )) engind=8;
  1418.         if ((engabs >= 1e9) && (engabs < 1e12 )) engind=9;
  1419.         if ((engabs >= 1e12) && (engabs < 1e15 )) engind=10;
  1420. !       if ((engabs >= 1e15) && (engabs < 1e18 )) engind=11;
  1421. !       if ((engabs >= 1e18) && (engabs < 1e21 )) engind=12;
  1422. !       if ((engabs <1e-18) || (engabs >=1e21))
  1423.         {
  1424.         /* Revert to floating point */
  1425.           (void) sprintf(buf,"%*.*E", width, lprecision, val);
  1426. ***************
  1427. *** 566,572 ****
  1428.         {
  1429.           engexp= (double) (engind-6)*3;
  1430.           engmant= val/pow(10.0e0,engexp);
  1431. !         (void) sprintf(buf,"%*.*f%c", width-1,
  1432.                         lprecision, engmant, engmult[engind]);
  1433.         }
  1434.       }
  1435. --- 571,577 ----
  1436.         {
  1437.           engexp= (double) (engind-6)*3;
  1438.           engmant= val/pow(10.0e0,engexp);
  1439. !         (void) sprintf(buf,"%*.*fe%s", width-4,
  1440.                         lprecision, engmant, engmult[engind]);
  1441.         }
  1442.       }
  1443. *** ../619/gram.y    Mon Mar 16 10:08:35 1992
  1444. --- gram.y    Fri May  8 12:31:22 1992
  1445. ***************
  1446. *** 9,15 ****
  1447.    *
  1448.    *        More mods by Alan Silverstein, 3/88, see list of changes.
  1449.    *
  1450. !  *        $Revision: 6.18 $
  1451.    */
  1452.   
  1453.   
  1454. --- 9,15 ----
  1455.    *
  1456.    *        More mods by Alan Silverstein, 3/88, see list of changes.
  1457.    *
  1458. !  *        $Revision: 6.21 $
  1459.    */
  1460.   
  1461.   
  1462. ***************
  1463. *** 19,26 ****
  1464.   #include "sc.h"
  1465.   
  1466.   #define ENULL (struct enode *)0
  1467. - char *strcpy();
  1468.   %}
  1469.   
  1470.   %union {
  1471. --- 19,24 ----
  1472. ***************
  1473. *** 148,153 ****
  1474. --- 146,152 ----
  1475.   %token K_LATEX
  1476.   %token K_SLATEX
  1477.   %token K_TEX
  1478. + %token K_FRAME
  1479.   %token K_RNDINFINITY
  1480.   %token K_MYROW
  1481.   %token K_MYCOL
  1482. ***************
  1483. *** 157,162 ****
  1484. --- 156,162 ----
  1485.   %token K_CRCOL
  1486.   %token K_ROWLIMIT
  1487.   %token K_COLLIMIT
  1488. + %token K_NUMITER
  1489.     
  1490.   %left '?' ':'
  1491.   %left '|'
  1492. ***************
  1493. *** 188,223 ****
  1494.                     char *tmp;
  1495.                     tmp = $2;
  1496.                     readfile (tmp, 1);
  1497. !                   xfree(tmp);
  1498.                   }
  1499.       |    S_MERGE strarg    {
  1500.                     char *tmp;
  1501.                     tmp = $2;
  1502.                     readfile (tmp, 0);
  1503. !                   xfree(tmp);
  1504.                   }
  1505.       |    S_MDIR strarg    
  1506. !                 { if (mdir) xfree(mdir); mdir = $2; }
  1507.       |       S_PUT strarg range
  1508.                   { (void) writefile($2, ($3.left.vp)->row, 
  1509.                    ($3.left.vp)->col, ($3.right.vp)->row,
  1510.                    ($3.right.vp)->col);
  1511. !                  xfree($2); }
  1512.       |    S_PUT strarg    
  1513.                   { (void) writefile ($2, 0, 0, maxrow, maxcol);
  1514. !                  xfree($2); }
  1515.       |       S_WRITE strarg range { (void) printfile($2, ($3.left.vp)->row, 
  1516.                ($3.left.vp)->col, ($3.right.vp)->row,
  1517.                ($3.right.vp)->col);
  1518. !              xfree($2); }
  1519.       |    S_WRITE strarg    { (void) printfile ($2, 0, 0, maxrow, maxcol);
  1520. !              xfree($2); }
  1521.       |       S_TBL strarg range { (void) tblprintfile($2, ($3.left.vp)->row, 
  1522.                ($3.left.vp)->col, ($3.right.vp)->row,
  1523.                ($3.right.vp)->col);
  1524. !              xfree($2); }
  1525.       |    S_TBL strarg    { (void)tblprintfile ($2, 0, 0, maxrow, maxcol);
  1526. !              xfree($2); }
  1527.       |       S_SHOW COL ':' COL
  1528.                       { showcol( $2, $4); }
  1529.       |       S_SHOW NUMBER ':' NUMBER
  1530. --- 188,223 ----
  1531.                     char *tmp;
  1532.                     tmp = $2;
  1533.                     readfile (tmp, 1);
  1534. !                   scxfree(tmp);
  1535.                   }
  1536.       |    S_MERGE strarg    {
  1537.                     char *tmp;
  1538.                     tmp = $2;
  1539.                     readfile (tmp, 0);
  1540. !                   scxfree(tmp);
  1541.                   }
  1542.       |    S_MDIR strarg    
  1543. !                 { if (mdir) scxfree(mdir); mdir = $2; }
  1544.       |       S_PUT strarg range
  1545.                   { (void) writefile($2, ($3.left.vp)->row, 
  1546.                    ($3.left.vp)->col, ($3.right.vp)->row,
  1547.                    ($3.right.vp)->col);
  1548. !                  scxfree($2); }
  1549.       |    S_PUT strarg    
  1550.                   { (void) writefile ($2, 0, 0, maxrow, maxcol);
  1551. !                  scxfree($2); }
  1552.       |       S_WRITE strarg range { (void) printfile($2, ($3.left.vp)->row, 
  1553.                ($3.left.vp)->col, ($3.right.vp)->row,
  1554.                ($3.right.vp)->col);
  1555. !              scxfree($2); }
  1556.       |    S_WRITE strarg    { (void) printfile ($2, 0, 0, maxrow, maxcol);
  1557. !              scxfree($2); }
  1558.       |       S_TBL strarg range { (void) tblprintfile($2, ($3.left.vp)->row, 
  1559.                ($3.left.vp)->col, ($3.right.vp)->row,
  1560.                ($3.right.vp)->col);
  1561. !              scxfree($2); }
  1562.       |    S_TBL strarg    { (void)tblprintfile ($2, 0, 0, maxrow, maxcol);
  1563. !              scxfree($2); }
  1564.       |       S_SHOW COL ':' COL
  1565.                       { showcol( $2, $4); }
  1566.       |       S_SHOW NUMBER ':' NUMBER
  1567. ***************
  1568. *** 375,380 ****
  1569. --- 375,381 ----
  1570.       | '@' K_MYROW            { $$ = new(MYROW, ENULL, ENULL);}
  1571.       | '@' K_MYCOL            { $$ = new(MYCOL, ENULL, ENULL);}
  1572.       | '@' K_COLTOA '(' e ')'    { $$ = new(COLTOA, ENULL, $4);}
  1573. +     | '@' K_NUMITER            { $$ = new(NUMITER, ENULL, ENULL);}
  1574.       ;
  1575.   
  1576.   /* expressions */
  1577. ***************
  1578. *** 432,438 ****
  1579.                       s1 = $1.vp->label;
  1580.                       if (!s1)
  1581.                       s1 = "NULL_STRING";
  1582. !                     s = xmalloc((unsigned)strlen(s1)+1);
  1583.                       (void) strcpy(s, s1);
  1584.                       $$ = s;
  1585.                   }
  1586. --- 433,439 ----
  1587.                       s1 = $1.vp->label;
  1588.                       if (!s1)
  1589.                       s1 = "NULL_STRING";
  1590. !                     s = scxmalloc((unsigned)strlen(s1)+1);
  1591.                       (void) strcpy(s, s1);
  1592.                       $$ = s;
  1593.                   }
  1594. ***************
  1595. *** 468,473 ****
  1596. --- 469,475 ----
  1597.       |    K_TBLSTYLE '=' K_LATEX    { tbl_style = LATEX; }
  1598.       |    K_TBLSTYLE '=' K_SLATEX    { tbl_style = SLATEX; }
  1599.       |    K_TBLSTYLE '=' K_TEX    { tbl_style = TEX; }
  1600. +     |    K_TBLSTYLE '=' K_FRAME    { tbl_style = FRAME; }
  1601.       |    K_RNDINFINITY        { rndinfinity = 1; FullUpdate++; }
  1602.       |    '!' K_RNDINFINITY    { rndinfinity = 0; FullUpdate++; }
  1603.       |    K_CRACTION '=' NUMBER    { craction = $3; }
  1604. *** ../619/help.c    Mon Mar 16 10:09:37 1992
  1605. --- help.c    Fri May  8 12:31:24 1992
  1606. ***************
  1607. *** 2,13 ****
  1608.    * Help functions for sc 
  1609.    * R. Bond, 1988
  1610.    * J. Buhrt 1990
  1611. !  * $Revision: 6.19 $
  1612.    */
  1613.   
  1614.   #ifdef QREF
  1615.   #include <stdio.h>
  1616. ! char    *header = " Quick Reference\n\n$Revision: 6.19 $";
  1617.   #else
  1618.   #include <curses.h>
  1619.   #include "sc.h"
  1620. --- 2,14 ----
  1621.    * Help functions for sc 
  1622.    * R. Bond, 1988
  1623.    * J. Buhrt 1990
  1624. !  * $Revision: 6.21 $
  1625.    */
  1626.   
  1627.   #ifdef QREF
  1628.   #include <stdio.h>
  1629. ! char    *header = " Quick Reference";
  1630. ! char    *revision = "$Revision: 6.21 $";
  1631.   #else
  1632.   #include <curses.h>
  1633.   #include "sc.h"
  1634. ***************
  1635. *** 15,22 ****
  1636. --- 16,29 ----
  1637.   
  1638.   char *intro[] = {
  1639.   " ",
  1640. + #if defined(QREF) && defined(TROFF)
  1641. + ".SH",
  1642. + #endif
  1643.   " Overview:",
  1644.   " ",
  1645. + #if defined(QREF) && defined(TROFF)
  1646. + ".Lp",
  1647. + #endif
  1648.   " A:   This overview",
  1649.   " B:   Toggle Options",
  1650.   " C:   Set Options",
  1651. ***************
  1652. *** 40,47 ****
  1653. --- 47,60 ----
  1654.   
  1655.   char *toggleoptions[] = {
  1656.   " ",
  1657. + #if defined(QREF) && defined(TROFF)
  1658. + ".SH",
  1659. + #endif
  1660.   " B: Toggle Options",
  1661.   " ",
  1662. + #if defined(QREF) && defined(TROFF)
  1663. + ".Lp",
  1664. + #endif
  1665.   "     ^To  Toggle options. Toggle one option selected by o:",
  1666.   "          a    Recalculate automatically or on ``@'' commands.",
  1667.   "          c    Current cell highlighting enable/disable.",  
  1668. ***************
  1669. *** 65,72 ****
  1670. --- 78,91 ----
  1671.   
  1672.   char *setoptions[] = {
  1673.   " ",
  1674. + #if defined(QREF) && defined(TROFF)
  1675. + ".SH",
  1676. + #endif
  1677.   " C: Set Options",
  1678.   " ",
  1679. + #if defined(QREF) && defined(TROFF)
  1680. + ".Lp",
  1681. + #endif
  1682.   "     S  Set options.  Options include:",
  1683.   "          byrows        Recalculate in row order. (default)",
  1684.   "          bycols        Recalculate in column order.",
  1685. ***************
  1686. *** 82,89 ****
  1687. --- 101,114 ----
  1688.   
  1689.   char *cursor[] = {
  1690.   " ",
  1691. + #if defined(QREF) && defined(TROFF)
  1692. + ".SH",
  1693. + #endif
  1694.   " D: Cell cursor movement (always OK):",
  1695.   " ",
  1696. + #if defined(QREF) && defined(TROFF)
  1697. + ".Lp",
  1698. + #endif
  1699.   "     ^N ^P ^B ^F Down, up, back, forward",
  1700.   "     ^Ed         Go to end of range.  Follow ^E by a direction indicator",
  1701.   "                 such as ^P or j.",
  1702. ***************
  1703. *** 109,116 ****
  1704. --- 134,147 ----
  1705.   
  1706.   char *cell[] = {
  1707.   " ",
  1708. + #if defined(QREF) && defined(TROFF)
  1709. + ".SH",
  1710. + #endif
  1711.   " E: Cell entry and editing commands:",
  1712.   " ",
  1713. + #if defined(QREF) && defined(TROFF)
  1714. + ".Lp",
  1715. + #endif
  1716.   "     =    Enter a numeric constant or expression.",
  1717.   "     <    Enter a left justified string or string expression.",
  1718.   "     \"    Enter a centered label.",
  1719. ***************
  1720. *** 133,140 ****
  1721. --- 164,177 ----
  1722.   
  1723.   char *vi[] = {
  1724.   " ",
  1725. + #if defined(QREF) && defined(TROFF)
  1726. + ".SH",
  1727. + #endif
  1728.   " F: Line Editor",
  1729.   " ",
  1730. + #if defined(QREF) && defined(TROFF)
  1731. + ".Lp",
  1732. + #endif
  1733.   "     Hitting the ESC key while entering any command on the top line",
  1734.   "     will start a one-line vi-style editor.  Supported commands:",
  1735.   " ",
  1736. ***************
  1737. *** 145,151 ****
  1738.   "     fc           Move cursor to character c.",
  1739.   "     tc           Move the cursor the the character before c.",
  1740.   "     i a          Enter insert mode before/after the cursor.",
  1741. ! "     I            Move to cursor column 0 and enter insert mode.",
  1742.   "     x X          Delete the character under/before the cursor.",
  1743.   "     rc           Replace the character under the cursor with c.",
  1744.   "     cm           Change - m = b,f,h,l,t or w.",
  1745. --- 182,188 ----
  1746.   "     fc           Move cursor to character c.",
  1747.   "     tc           Move the cursor the the character before c.",
  1748.   "     i a          Enter insert mode before/after the cursor.",
  1749. ! "     I A          Move to column 0/end of line and enter insert mode.",
  1750.   "     x X          Delete the character under/before the cursor.",
  1751.   "     rc           Replace the character under the cursor with c.",
  1752.   "     cm           Change - m = b,f,h,l,t or w.",
  1753. ***************
  1754. *** 159,166 ****
  1755. --- 196,209 ----
  1756.   
  1757.   char *file[] = {
  1758.   " ",
  1759. + #if defined(QREF) && defined(TROFF)
  1760. + ".SH",
  1761. + #endif
  1762.   " G: File commands:",
  1763.   " ",
  1764. + #if defined(QREF) && defined(TROFF)
  1765. + ".Lp",
  1766. + #endif
  1767.   "     G    Get a new database from a file. ",
  1768.   "     M    Merge a new file into the current database.",
  1769.   "     P    Put the current database into a file.",
  1770. ***************
  1771. *** 171,178 ****
  1772. --- 214,225 ----
  1773.   "          Optionally brackets output with control lines for ``tbl'',",
  1774.   "          ``LaTeX'', ``SLaTex'', or ``TeX''.",
  1775.   " ",
  1776. + #if !defined(VMS) && !defined(MSDOS) && defined(CRYPT_PATH)
  1777.   "     If encryption mode is set, file I/O will be encrypted/decrypted.",
  1778.   "     ``\"| program\"'' for a file name will pipe (unencrypted) output to",
  1779. + #else
  1780. + "     ``\"| program\"'' for a file name will pipe output to",
  1781. + #endif
  1782.   "     a program for Put, Write and Table.  If a cell name is used",
  1783.   "     as the file name, the cell's string part will be used as the",
  1784.   "     file name.",
  1785. ***************
  1786. *** 182,189 ****
  1787. --- 229,242 ----
  1788.   
  1789.   char *row[] = {
  1790.   " ",
  1791. + #if defined(QREF) && defined(TROFF)
  1792. + ".SH",
  1793. + #endif
  1794.   " H: Row and column commands:",
  1795.   " ",
  1796. + #if defined(QREF) && defined(TROFF)
  1797. + ".Lp",
  1798. + #endif
  1799.   "     ir, ic      Insert a new, empty row (column)",
  1800.   "     ar, ac      Append a new copy of the current row (column)",
  1801.   "     dr, dc      Delete the current row (column)",
  1802. ***************
  1803. *** 209,215 ****
  1804. --- 262,274 ----
  1805.   
  1806.   char *range[] = {
  1807.   " ",
  1808. + #if defined(QREF) && defined(TROFF)
  1809. + ".SH",
  1810. + #endif
  1811.   " I: Range commands:",
  1812. + #if defined(QREF) && defined(TROFF)
  1813. + ".Lp",
  1814. + #endif
  1815.   "     /x   Clear a range. ",
  1816.   "     /v   Remove the expressions from a range of cells, leaving ",
  1817.   "          just the values.",
  1818. ***************
  1819. *** 237,244 ****
  1820. --- 296,309 ----
  1821.   
  1822.   char *misc[] = {
  1823.   " ",
  1824. + #if defined(QREF) && defined(TROFF)
  1825. + ".SH",
  1826. + #endif
  1827.   " J: Miscellaneous commands:",
  1828.   " ",
  1829. + #if defined(QREF) && defined(TROFF)
  1830. + ".Lp",
  1831. + #endif
  1832.   "     Q q ^C   Exit from the program.",
  1833.   "     ^G ESC   Abort entry of the current command.",
  1834.   "     ?        Help",
  1835. ***************
  1836. *** 259,266 ****
  1837. --- 324,337 ----
  1838.   
  1839.   char *var[] = {
  1840.   " ",
  1841. + #if defined(QREF) && defined(TROFF)
  1842. + ".SH",
  1843. + #endif
  1844.   " K: Variable names:",
  1845.   " ",
  1846. + #if defined(QREF) && defined(TROFF)
  1847. + ".Lp",
  1848. + #endif
  1849.   "     K20    Row and column can vary on copies.",
  1850.   "     $K$20  Row and column stay fixed on copies.",
  1851.   "     $K20   Row can vary; column stays fixed on copies.",
  1852. ***************
  1853. *** 285,292 ****
  1854. --- 356,369 ----
  1855.   
  1856.   char *rangef[] = {
  1857.   " ",
  1858. + #if defined(QREF) && defined(TROFF)
  1859. + ".SH",
  1860. + #endif
  1861.   " L: Range functions:",
  1862.   " ",
  1863. + #if defined(QREF) && defined(TROFF)
  1864. + ".Lp",
  1865. + #endif
  1866.   "     @sum(r)           Sum all valid cells in the range.",
  1867.   "     @prod(r)          Multiply together all valid cells in the range.",
  1868.   "     @avg(r)           Average all valid cells in the range.",
  1869. ***************
  1870. *** 311,318 ****
  1871. --- 388,401 ----
  1872.   
  1873.   char *numericf[] = {
  1874.   " ",
  1875. + #if defined(QREF) && defined(TROFF)
  1876. + ".SH",
  1877. + #endif
  1878.   " M: Numeric functions:",
  1879.   " ",
  1880. + #if defined(QREF) && defined(TROFF)
  1881. + ".Lp",
  1882. + #endif
  1883.   "     @atan2(e1,e2)     Arc tangent of e1/e2.",
  1884.   "     @ceil(e)          Smallest integer not less than e.",
  1885.   "     @eqs(se1,se2)     1 if string expr se1 has the same value as se2.",
  1886. ***************
  1887. *** 338,344 ****
  1888. --- 421,433 ----
  1889.   
  1890.   char *stringf[] = {
  1891.   " ",
  1892. + #if defined(QREF) && defined(TROFF)
  1893. + ".SH",
  1894. + #endif
  1895.   " N: String functions:",
  1896. + #if defined(QREF) && defined(TROFF)
  1897. + ".Lp",
  1898. + #endif
  1899.   "     #                 Concatenate strings.  For example, the",
  1900.   "                       string expression ``A0 # \"zy dog\"'' yields",
  1901.   "                       ``the lazy dog'' if A0 is ``the la''.",
  1902. ***************
  1903. *** 366,373 ****
  1904. --- 455,468 ----
  1905.   
  1906.   char *finf[] = {
  1907.   " ",
  1908. + #if defined(QREF) && defined(TROFF)
  1909. + ".SH",
  1910. + #endif
  1911.   " O: Financial functions:",
  1912.   " ",
  1913. + #if defined(QREF) && defined(TROFF)
  1914. + ".Lp",
  1915. + #endif
  1916.   "     @pmt(e1,e2,e3)    @pmt(60000,.01,360) computes the monthly",
  1917.   "                       payments for a $60000 mortgage at 12%",
  1918.   "                       annual interest (.01 per month) for 30",
  1919. ***************
  1920. *** 393,400 ****
  1921. --- 488,501 ----
  1922.   
  1923.   char *timef[] = {
  1924.   " ",
  1925. + #if defined(QREF) && defined(TROFF)
  1926. + ".SH",
  1927. + #endif
  1928.   " P: Time and date functions:",
  1929.   " ",
  1930. + #if defined(QREF) && defined(TROFF)
  1931. + ".Lp",
  1932. + #endif
  1933.   "     @now              Return the time encoded in seconds since 1970.",
  1934.   "     @dts(m,d,y)       Return m/d/y encoded in seconds since 1970.",
  1935.   "     @tts(h,m,s)       Return h:m:s encoded in seconds since midnight.",
  1936. ***************
  1937. *** 482,498 ****
  1938.   main()
  1939.   {   int    lineno;
  1940.       char    ***pagep = pages;
  1941.   
  1942.       while (*pagep)
  1943.       {
  1944.       (void) fputs(SCNAME, stdout);
  1945. !     (void) puts(header);
  1946.   
  1947.       for (lineno = 0; (*pagep)[lineno]; lineno++) {
  1948.           (void) puts((*pagep)[lineno]);
  1949.       }
  1950.       (void) putchar('\f');
  1951.       pagep++;
  1952.       }
  1953.       (void) exit(0);
  1954.   }
  1955. --- 583,632 ----
  1956.   main()
  1957.   {   int    lineno;
  1958.       char    ***pagep = pages;
  1959. + #ifdef TROFF
  1960. +     int    pageno = 0;
  1961. + #endif
  1962.   
  1963. + #ifdef TROFF
  1964. + puts(".nr PS 12");
  1965. + puts(".nr VS 14");
  1966. + puts(".nr HM 1i");
  1967. + puts(".nr FM 1i");
  1968. + puts(".nr PO 0.5i");
  1969. + printf(".EH '%s%s''%s'\n", SCNAME, header, revision);
  1970. + printf(".OH '%s%s''%s'\n", SCNAME, header, revision);
  1971. + puts(".EF ''%''");
  1972. + puts(".OF ''%''");
  1973. + puts(".de Lp");
  1974. + puts(".LP");
  1975. + puts(".ft CW");
  1976. + puts(".na");
  1977. + puts(".nf");
  1978. + puts("..");
  1979. + puts(".P1");
  1980. + puts(".LP");
  1981. + #endif
  1982.       while (*pagep)
  1983.       {
  1984. + #ifndef TROFF
  1985.       (void) fputs(SCNAME, stdout);
  1986. !     (void) fputs(header);
  1987. !     (void) printf("\n");
  1988. !     (void) puts(revision);
  1989. ! #endif
  1990.   
  1991.       for (lineno = 0; (*pagep)[lineno]; lineno++) {
  1992.           (void) puts((*pagep)[lineno]);
  1993.       }
  1994. + #if !defined(TROFF)
  1995.       (void) putchar('\f');
  1996. + #endif
  1997.       pagep++;
  1998. + #ifdef TROFF
  1999. +     pageno++;
  2000. +     if (!(pageno%2)) puts(".bp");
  2001. + #endif
  2002.       }
  2003.       (void) exit(0);
  2004.   }
  2005.  
  2006.