home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume30 / sc / patch04a next >
Encoding:
Text File  |  1992-05-23  |  57.2 KB  |  2,010 lines

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