home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume35 / ss / part10 < prev    next >
Encoding:
Text File  |  1993-03-02  |  60.0 KB  |  1,826 lines

  1. Newsgroups: comp.sources.misc
  2. From: art@cs.ualberta.ca (Art Mulder)
  3. Subject: v35i096:  ss - Simple Spreadsheet program, v1.2b, Part10/11
  4. Message-ID: <1993Feb22.154142.22078@sparky.imd.sterling.com>
  5. X-Md4-Signature: 46c3a483df6365e0657aeeb093c7bcab
  6. Date: Mon, 22 Feb 1993 15:41:42 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: art@cs.ualberta.ca (Art Mulder)
  10. Posting-number: Volume 35, Issue 96
  11. Archive-name: ss/part10
  12. Environment: curses, sunos, sysv, ultrix, sgi, dec, mips, sun
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then feed it
  16. # into a shell via "sh file" or similar.  To overwrite existing files,
  17. # type "sh file -c".
  18. # Contents:  ss_12b/Copyright ss_12b/Files ss_12b/README ss_12b/Todo
  19. #   ss_12b/VMS_NOTES ss_12b/build.com ss_12b/crypt.c
  20. #   ss_12b/curses_stuff.h ss_12b/disprange.h ss_12b/menu.h
  21. #   ss_12b/menu_macro.c ss_12b/menu_misc.c ss_12b/menu_name.c
  22. #   ss_12b/pss.doc ss_12b/sc_stuff/README.sc ss_12b/sc_stuff/TODO
  23. #   ss_12b/sc_stuff/tutorial.sc ss_12b/sunfkeys/xterm-sun.ti
  24. # Wrapped by kent@sparky on Sat Feb 20 16:01:05 1993
  25. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  26. echo If this archive is complete, you will see the following message:
  27. echo '          "shar: End of archive 10 (of 11)."'
  28. if test -f 'ss_12b/Copyright' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'ss_12b/Copyright'\"
  30. else
  31.   echo shar: Extracting \"'ss_12b/Copyright'\" \(1439 characters\)
  32.   sed "s/^X//" >'ss_12b/Copyright' <<'END_OF_FILE'
  33. X=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  34. X
  35. X  Copyright (c) 1992 by Arthur E. Mulder.
  36. X
  37. X                        All Rights Reserved
  38. X
  39. X  Permission to use, copy, modify, and distribute this software and its
  40. X  documentation for any purpose and without fee is hereby granted,
  41. X  provided that the above copyright notice appears in all copies and that
  42. X  both that copyright notice and this permission notice appear in
  43. X  supporting documentation, and that the names of any persons or
  44. X  organizations involved not be used in advertising or publicity
  45. X  pertaining to distribution of the software without specific, written
  46. X  prior permission.
  47. X
  48. X  ALL PERSONS AND ORGANIZATIONS INVOLVED IN THE CREATION OF THIS SOFTWARE
  49. X  DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
  50. X  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL
  51. X  ANY OF THEM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
  52. X  DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  53. X  PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
  54. X  ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
  55. X  THIS SOFTWARE.
  56. X
  57. X  For a full list of Authors (and Contributors) of the software
  58. X  making up this package, please refer to the section "AUTHORS"
  59. X  at the end of the ss documentation (The ss.man file).
  60. X
  61. X=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  62. END_OF_FILE
  63.   if test 1439 -ne `wc -c <'ss_12b/Copyright'`; then
  64.     echo shar: \"'ss_12b/Copyright'\" unpacked with wrong size!
  65.   fi
  66.   # end of 'ss_12b/Copyright'
  67. fi
  68. if test -f 'ss_12b/Files' -a "${1}" != "-c" ; then 
  69.   echo shar: Will not clobber existing file \"'ss_12b/Files'\"
  70. else
  71.   echo shar: Extracting \"'ss_12b/Files'\" \(3529 characters\)
  72.   sed "s/^X//" >'ss_12b/Files' <<'END_OF_FILE'
  73. X**INCOMPLETE**
  74. X----------------------------------------------------------------------
  75. XHERE IS A LIST OF ALL THE FILES IN THE DISTRIBUTION:
  76. X
  77. X  NOTE:  Files marked with a "*" are files that are either unchanged
  78. X         from their ``sc 6.21'' counterparts, or have only minor
  79. X     modifications.  (OR, I've never even looked at them, and
  80. X     have no comprehension at all as to how they work :-)
  81. X
  82. X----------------------------------------------------------------------
  83. X* cmds.c    - Command routines
  84. X* crypt.c    - Encryption utilities.  Our system, being outside the US, 
  85. X          can not use this.  Therefore this file is completely
  86. X          untouched, and the encryption feature is completely
  87. X          untried in 'ss'.
  88. X
  89. X  ctrl.c / ctrl.h - Process Control Character Commands (as opposed to
  90. X          menu commands).
  91. X
  92. X  disprange.c / disprange.h     - Range Display/Manipulate functions.
  93. X* format.c    - formating a number.
  94. X
  95. X  getinput.c / getinput.h
  96. X        - Functions for getting a line of input.  Allows 
  97. X          user editting of the input, etc.  Based upon
  98. X          "input-edit" by Chris Thewalt.  
  99. X
  100. X* gram.y    - YACC file -> command parser.  Becomes gram.c
  101. X* interp.c    - Expression interpreter.
  102. X
  103. X  keys.h    - Header file, defining 'ss' key bindings.
  104. X* lex.c        - lexical analyzer (input processing also)
  105. X
  106. X  menu.c / menu.h
  107. X    - Menu Driver.  Functions for displaying the command menus and
  108. X      processing the related input.
  109. X
  110. X  menu_cell.c / menu_cell.h    - Cell Menu Operations
  111. X  menu_edit.c / menu_edit.h    - Edit Menu Operations
  112. X  menu_file.c / menu_file.h    - File Menu Operations
  113. X  menu_macro.c / menu_macro.h    - Macro Menu Operations
  114. X  menu_misc.c / menu_misc.h    - Misc Menu Operations
  115. X  menu_name.c / menu_name.h    - Name Sub-Menu Operations
  116. X  menu_rowcol.c / menu_rowcol.h    - Row Menu & Column Menu Operations
  117. X
  118. X* range.c    - Range Manipulations
  119. X* screen.c    - Curses based screen driver.  (screen update routines)
  120. X  ss.c / ss.h    - main program, main loop.
  121. X  version.c    - 'ss' release version number
  122. X* vmtbl.c    - Spreadsheet 'tbl' creation
  123. X* xmalloc.c    - a "safer saner" malloc, for careless programmers.
  124. X
  125. X----------------------------------------------------------------------
  126. XMISC FILES:
  127. X  
  128. X  Bugs        - Known problems not yet fixed.
  129. X  Copyright    - Self-explanatory.
  130. X  Files        - This file
  131. X  Makefile    - for building 'ss'
  132. X  Prog.doc    - random thoughts, directed at programmers
  133. X  README    - READ THIS FILE FIRST.  General overview, & Instructions
  134. X  Todo        - Ideas for enhancements for the next version.
  135. X
  136. X* eres.sed    -\ Sed command files.  Used in the Makefile, to build 
  137. X* sres.sed    -/ experres.h and statres.h
  138. X
  139. X  ss.man    - main man page for ss.
  140. X* torev        - Sed command file.  Used by the Makefile, in building
  141. X          'ss.l' from 'ss.man'.  (Some global changes are made,
  142. X                  see the warning comments in 'ss.man').
  143. X
  144. X  sc_stuff/    - Contains misc. files left over from sc.  No longer used.
  145. X  sunfkeys/     - See 'README' and 'sunfkeys/README' for the best 
  146. X          explanation of what this is.
  147. X
  148. X----------------------------------------------------------------------
  149. XPSS FILES:
  150. X
  151. X* pss.c        - Converts ASCII files into sc (and, therefore 'ss')
  152. X          compatible files.  See the man page for more info.
  153. X* pss.doc    - Man page for psc.c
  154. X
  155. X    NOTE: These files are identical to the "psc.c" and "psc.doc"
  156. X          files from the sc 6.21 package, they have only been
  157. X          renamed.
  158. X
  159. X----------------------------------------------------------------------
  160. XVMS FILES: 
  161. X
  162. X* VMS_NOTES    - Instructions for VMS users
  163. X* build.com    - Makefile equivalent, for VMS systems
  164. X
  165. X----------------------------------------------------------------------
  166. END_OF_FILE
  167.   if test 3529 -ne `wc -c <'ss_12b/Files'`; then
  168.     echo shar: \"'ss_12b/Files'\" unpacked with wrong size!
  169.   fi
  170.   # end of 'ss_12b/Files'
  171. fi
  172. if test -f 'ss_12b/README' -a "${1}" != "-c" ; then 
  173.   echo shar: Will not clobber existing file \"'ss_12b/README'\"
  174. else
  175.   echo shar: Extracting \"'ss_12b/README'\" \(4777 characters\)
  176.   sed "s/^X//" >'ss_12b/README' <<'END_OF_FILE'
  177. X----------------------------------------------------------------------
  178. Xss
  179. X
  180. X  This is ``ss'' release 1.2-beta.
  181. X
  182. X  SS is a spreadsheet program.  It is based upon the well known(?)
  183. X  public domain spreadsheet program sc 6.19.
  184. X
  185. X  ss is Curses based.  It should function on any ASCII terminal, or in
  186. X  any terminal window in a windowing environment.
  187. X
  188. X  ss is a major overhaul of the _user_interface_ of sc.  I tried to
  189. X  make it much more similar to the spreadsheets found on personal
  190. X  computers.  It makes use of hierarchical menus, and has a full range
  191. X  of `standard' spreadsheet functions.
  192. X
  193. X  I toyed around with starting off at version number 7.0, since I used
  194. X  sc 6.19 (and later 6.21) as my starting point, but I decided that
  195. X  would be a bit presumptuous.  So I hope this low release/version
  196. X  number doesn't scare away too many people.  There really is a *LOT*
  197. X  of work put in by a lot of people over a long period of time in the
  198. X  sc 6.19 code, which serves as the heart of ss.
  199. X
  200. X  This is an ASCII spreadsheet program.  This is not Lotus 1-2-3.  It
  201. X  is not Microsoft Excel.  It does not do graphs or charts.  It does
  202. X  not do drawings.  It does not use a mouse.
  203. X
  204. X  It _does_ do a fine job of manipulating rows and columns of numbers.
  205. X  Want a simple way of managing your student's grades, calculating class
  206. X  averages, etc?  No problem.  Want to figure out how much money you
  207. X  can borrow from the bank for a mortgage?  We can do that.
  208. X
  209. X  NOTE: THIS IS A BETA RELEASE.  TREAD CAREFULLY.
  210. X
  211. X  Jan 26, 1993
  212. X  Art Mulder  (email: art@cs.ualberta.ca)
  213. X  Department of Computing Science
  214. X  University of Alberta, Edmonton, Canada
  215. X
  216. X----------------------------------------------------------------------
  217. XTESTED SYSTEMS
  218. X
  219. X  ``ss'' has been tested (clean compile) on:
  220. X    Sun 4 (Sparc - SunOS 4.1.1)
  221. X    Sun 3 (SunOS 4.1.1)
  222. X    Mips (Risc/os 5.0)
  223. X    Dec (Ultrix 4.2A)
  224. X    Silicon Graphics (4D340S - IRIX Release 4.0.5)
  225. X
  226. X----------------------------------------------------------------------
  227. XINSTALLATION PROCEDURE
  228. X
  229. X  The included "Makefile" contains complete instructions for 
  230. X  building ``ss''.
  231. X
  232. X----------------------------------------------------------------------
  233. XINSTALLATION NOTES
  234. X
  235. X  About the "sunfkeys" directory:
  236. X
  237. X  IF you are running X11R4 on a Sun workstation, and IF you use
  238. X  "xterm(1)" for your terminal sessions, then you probably should look
  239. X  at the README file in the "sunfkeys" directory.  In it's basic state,
  240. X  Xterm does not let you use/access most of the keypad or the function keys.
  241. X  The contents of "sunfkeys" will help you modify your terminfo/termcap
  242. X  files so that you can.
  243. X
  244. X  You can use 'ss' without the sunfkeys stuff.  Conversely, you can use the
  245. X  'sunfkeys' stuff with programs other than 'ss'.  I developed sunfkeys when
  246. X  I was working on 'ss', because I wanted to be able to use the arrow keys,
  247. X  Home, End, PgUp and PgDn keys with it.
  248. X  
  249. X  See sunfkeys/README for details.
  250. X
  251. X----------------------------------------------------------------------
  252. XBUGS:
  253. X
  254. X  I'd be dreaming if I thought that this were bug-free.  For one thing,
  255. X  I've never tested it on anything but a Sun.  (I've compiled it on a MIPS,
  256. X  but have not made extensive use of it there.)  If you find bugs, I'd
  257. X  like to hear about them (I say that with a certain amount of
  258. X  trepidation).  However, I would be much more interested in hearing
  259. X  about bugs WHICH YOU HAVE FIXED, complete with code patches, etc.
  260. X
  261. X  The original sc ran on a number of platforms: VMS, MS-DOS and many Unix
  262. X  varients.  I don't have all those at my disposal.  (Neither do I have the
  263. X  time nor inclination to try them all out)  I don't *THINK* I've changed
  264. X  anything which would limit it's portability, but no guarantees are given.
  265. X
  266. X  Please let me know about your successes in porting to other platforms.
  267. X
  268. X----------------------------------------------------------------------
  269. XCOPYRIGHT
  270. X
  271. X  Please see the file "Copyright"
  272. X
  273. X  I'm not trying to restrict anyone's free use of ``ss'', I just 
  274. X  don't want anyone turning around and (a) claiming that they 
  275. X  wrote it or (b) selling it.
  276. X
  277. X----------------------------------------------------------------------
  278. XBETA RELEASE LIMITATIONS
  279. X
  280. X  The many spreadsheet functions have NOT been tested in any great
  281. X  detail.  (I mostly made cosmetic/User Interfance modifications, so I
  282. X  did not anticipate needing any major changes in the functions)
  283. X
  284. X  Hooks exist in the code for the inclusion of calls to context-sensitive
  285. X  (sort-of) help functions.
  286. X  -> writing "help" has begun, but only just, and so it is
  287. X     currently not installed.  I'm not sure whether it is 
  288. X     worth the work involved to install it.
  289. X
  290. X  There is no tutorial (either text or spreadsheet).
  291. X
  292. X  There is no quick reference card.
  293. X
  294. X----------------------------------------------------------------------
  295. Xend
  296. END_OF_FILE
  297.   if test 4777 -ne `wc -c <'ss_12b/README'`; then
  298.     echo shar: \"'ss_12b/README'\" unpacked with wrong size!
  299.   fi
  300.   # end of 'ss_12b/README'
  301. fi
  302. if test -f 'ss_12b/Todo' -a "${1}" != "-c" ; then 
  303.   echo shar: Will not clobber existing file \"'ss_12b/Todo'\"
  304. else
  305.   echo shar: Extracting \"'ss_12b/Todo'\" \(2014 characters\)
  306.   sed "s/^X//" >'ss_12b/Todo' <<'END_OF_FILE'
  307. XArt's TODO list
  308. X
  309. XIDEAS/THOUGHTS FOR THE NEXT RELEASE
  310. X=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  311. X
  312. X1) Change the <CR> feature.  Instead of toggling what to do, keep
  313. X   track of the last arrow key direction, and make *that* the 
  314. X   <CR> direction (like EZ-calc)
  315. X
  316. X- Reverse video on some of the prompts?
  317. X- Convert smaller functions to macro's
  318. X
  319. X- Clean up the code.  See if we can move some of those #IFDEF's
  320. X  into a header file and get them out of the code.  SEE the document
  321. X  on code style!
  322. X
  323. X2) /RowColumn
  324. X    - Yank should (like Merge) automagically insert Rows or Columns 
  325. X    (either-or, not both) for the yanked text.
  326. X
  327. X3) work up a cut & paste gizmo, instead of the current
  328. X   kludgey delete/yank/merge mess
  329. X
  330. X4) Context (so-so) sensitive on-line help!
  331. X
  332. X5) Tutorial Spreadsheet
  333. X
  334. X6) startup "rc" file for setting lots of things up
  335. X    -> ability to bind keys & Fkeys to actions 
  336. X       (this'll probably require a lot of work in the
  337. X       interpretation of command keys in the code, but
  338. X       it'd really make the program MUCH better)
  339. X
  340. X7) Trim the man page to a bare-bones quick-reference -> I think that's
  341. X   the best use for it -> then put together a LaTeX(?) tutorial/introduction
  342. X   manual full of verbiage & other stuff that most folks only need to see
  343. X   occaisionally.   
  344. X
  345. X   (??? Is this a good idea ???)
  346. X
  347. X8) Put an indicator in the top left corner of the spreadsheet
  348. X   display, an ``*'' to indicate when the spreadsheet has been changed.
  349. X   (This would go in the blank space left of the "   A   " and above
  350. X    the "0  ")
  351. X
  352. X   flip the row/colum labels where the cursor is located into
  353. X   inverse video ???????  make it easier to locate the cursor?
  354. X9) clean up sc.h -> distribute files amongst proper *.c files ??
  355. X         -> or leave all in one *.c file, but organize the file
  356. X
  357. X10) Row/Column Menu -> "Show".  In 'sc' you could enter a range of 
  358. X        rows or columns to show.  Add this functionality back?
  359. X
  360. X
  361. X=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  362. END_OF_FILE
  363.   if test 2014 -ne `wc -c <'ss_12b/Todo'`; then
  364.     echo shar: \"'ss_12b/Todo'\" unpacked with wrong size!
  365.   fi
  366.   # end of 'ss_12b/Todo'
  367. fi
  368. if test -f 'ss_12b/VMS_NOTES' -a "${1}" != "-c" ; then 
  369.   echo shar: Will not clobber existing file \"'ss_12b/VMS_NOTES'\"
  370. else
  371.   echo shar: Extracting \"'ss_12b/VMS_NOTES'\" \(4341 characters\)
  372.   sed "s/^X//" >'ss_12b/VMS_NOTES' <<'END_OF_FILE'
  373. XFrom: ihnp4!gargoyle!oddjob!noao!arizona!naucse!jdc (John Campbell)
  374. XTo: arizona!noao!oddjob!gargoyle!ihnp4!nsc!nscpdc!rgb
  375. XSubject: VMS SC
  376. X
  377. XVMS USERS:
  378. X
  379. XBob Bond has been generous enough to give me free rein in adding what I
  380. Xthink is needed to make SC run on VMS.  Any problems with VMS should be
  381. Xdirected to me--they are not Bob's fault.
  382. X
  383. XThe VMS SC is "SIMPLE" for the most part, except that the arrow keys
  384. X(instead of hjkl) will move you around the cells.  The VMS version of SC
  385. Xwill not interact with the Bourne shell (obviously), which means that CRYPT
  386. Xand EXTERNAL FUNCTIONS will not be available.
  387. X
  388. XIf you have a 'C' compiler and GNU Bison then you should be able to get
  389. XSC running on VMS by following the instructions below.
  390. X
  391. XStep 1:  Get all the files
  392. X
  393. XI've heard of a few sites that can unpack unix shar files directly on
  394. XVMS.  Most people, however, will need access to a unix machine to get
  395. Xthe original distribution unpacked.  At this time you should also build
  396. Xexperres.h and statres.h and perhaps run the man pages off if you need
  397. Xto port the documentation. To build the two "missing" hearder files:
  398. X   sed <gram.y >experres.h -f eres.sed
  399. X   sed <gram.y >statres.h -f sres.sed
  400. X
  401. XStep 2: Cut out BUILD.COM and GETOPT.C
  402. X
  403. XAt the end of this file are two other pieces: BUILD.COM and GETOPT.C.  After
  404. Xyou've moved everything to VMS, cut BUILD.COM and GETOPT.C out of here and
  405. Xput them in the same directory as the rest of the SC distribution.
  406. X
  407. XStep 3: Build it
  408. X
  409. XTheoretically all you now need to do is @BUILD and SC (as well as PSC)
  410. Xwill be running on VMS.  If you have problems feel free to contact me
  411. Xat ...!arizona!naucse!jdc  (or even call at 602-523-6259).
  412. X
  413. X---------------------cut here for BUILD.COM--------------------------
  414. X$! VMS command file to build SC and PSC (requires bison)
  415. X$! SC:
  416. X$ bison -d gram.y
  417. X$ ren gram_tab.c gram.c
  418. X$ cc  /define=("SIMPLE","SIGVOID") sc.c
  419. X$ cc  /define=("SIMPLE","SIGVOID") gram.c
  420. X$ cc  /define=("SIMPLE","SIGVOID") lex.c
  421. X$ cc  /define=("SIMPLE","SIGVOID") interp
  422. X$ cc  /define=("SIMPLE","SIGVOID") cmds
  423. X$ cc  /define=("SIMPLE","SIGVOID") xmalloc
  424. X$ cc  /define=("SIMPLE","SIGVOID") range
  425. X$ cc  /define=("SIMPLE","SIGVOID") help
  426. X$ link sc.obj,lex.obj,gram.obj,interp.obj,cmds.obj,xmalloc.obj,-
  427. X       range.obj,help.obj,sys$library:vaxcrtl.olb/lib
  428. X$ !
  429. X$ ! Create VMS foreign command symbol to test SC
  430. X$ !
  431. X$ sc == "$" + f$logical("SYS$DISK") + f$directory() + "SC.EXE"
  432. X$!
  433. X$! Now PSC
  434. X$!
  435. X$ cc psc.c
  436. X$ cc getopt.c
  437. X$ link psc,getopt,sys$library:vaxcrtl.olb/lib
  438. X$ !
  439. X$ ! Create VMS foreign command symbol to test PSC (Note that
  440. X$ ! PSC reads SYS$INPUT and writes to SYS$OUTPUT, so use
  441. X$ ! DEFINE/USER to redirect.)
  442. X$ !
  443. X$ psc == "$" + f$logical("SYS$DISK") + f$directory() + "PSC.EXE"
  444. X
  445. X---------------------cut here for GETOPT.C------------------------
  446. X/*
  447. X * getopt - get option letter from argv
  448. X *      This software is in the public domain
  449. X *      Originally written by Henry Spencer at the U. of Toronto
  450. X */
  451. X
  452. X#include <stdio.h>
  453. X
  454. Xchar    *optarg;        /* Global argument pointer. */
  455. Xint     optind = 0;     /* Global argv index. */
  456. X
  457. Xstatic char     *scan = NULL;   /* Private scan pointer. */
  458. X
  459. X/* extern char     *index();  obsolete, used strchr (JDC). */
  460. X
  461. Xint
  462. Xgetopt(argc, argv, optstring)
  463. Xint argc;
  464. Xchar *argv[];
  465. Xchar *optstring;
  466. X{
  467. X        register char c;
  468. X        register char *place;
  469. X
  470. X        optarg = NULL;
  471. X
  472. X        if (scan == NULL || *scan == '\0') {
  473. X                if (optind == 0)
  474. X                        optind++;
  475. X
  476. X                if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0')
  477. X                        return(EOF);
  478. X                if (strcmp(argv[optind], "--")==0) {
  479. X                        optind++;
  480. X                        return(EOF);
  481. X                }
  482. X
  483. X                scan = argv[optind]+1;
  484. X                optind++;
  485. X        }
  486. X
  487. X        c = *scan++;
  488. X        place = strchr(optstring, c);
  489. X
  490. X        if (place == NULL || c == ':') {
  491. X                fprintf(stderr, "%s: unknown option -%c\n", argv[0], c);
  492. X                return('?');
  493. X        }
  494. X
  495. X        place++;
  496. X        if (*place == ':') {
  497. X                if (*scan != '\0') {
  498. X                        optarg = scan;
  499. X                        scan = NULL;
  500. X                } else {
  501. X                        optarg = argv[optind];
  502. X                        optind++;
  503. X                }
  504. X        }
  505. X
  506. X        return(c);
  507. X}
  508. END_OF_FILE
  509.   if test 4341 -ne `wc -c <'ss_12b/VMS_NOTES'`; then
  510.     echo shar: \"'ss_12b/VMS_NOTES'\" unpacked with wrong size!
  511.   fi
  512.   # end of 'ss_12b/VMS_NOTES'
  513. fi
  514. if test -f 'ss_12b/build.com' -a "${1}" != "-c" ; then 
  515.   echo shar: Will not clobber existing file \"'ss_12b/build.com'\"
  516. else
  517.   echo shar: Extracting \"'ss_12b/build.com'\" \(1437 characters\)
  518.   sed "s/^X//" >'ss_12b/build.com' <<'END_OF_FILE'
  519. X$! VMS command file to build SC and PSC (requires bison) on VMS
  520. X$! SC:
  521. X$! $Revision: 6.21 $
  522. X$! bison -d gram.y
  523. X$! ren gram_tab.c gram.c
  524. X$ cc'p1'  /define=("SIMPLE","SIGVOID") sc.c
  525. X$ cc'p1'  /define=("SIMPLE","SIGVOID") gram.c
  526. X$ cc'p1'  /define=("SIMPLE","SIGVOID") lex.c
  527. X$ cc'p1'  /define=("SIMPLE","SIGVOID","RINT") interp
  528. X$ cc'p1'  /define=("SIMPLE","SIGVOID") cmds
  529. X$ cc'p1'  /define=("SIMPLE","SIGVOID") xmalloc
  530. X$ cc'p1'  /define=("SIMPLE","SIGVOID") range
  531. X$ cc'p1'  /define=("SIMPLE","SIGVOID") help
  532. X$ cc'p1'  /define=("SIMPLE","SIGVOID") vmtbl
  533. X$ cc'p1'  /define=("SIMPLE","SIGVOID") screen
  534. X$ cc'p1'  /define=("SIMPLE","SIGVOID") vi
  535. X$ cc'p1'  /define=("SIMPLE","SIGVOID") format
  536. X$ link'p1' sc.obj,lex.obj,gram.obj,interp.obj,cmds.obj,xmalloc.obj,-    
  537. X       range.obj,help.obj,vmtbl.obj,screen.obj,vi.obj,format.obj,-
  538. X       sys$library:vaxccurse.olb/lib,-
  539. X       sys$library:vaxcrtl/shar
  540. X$ !
  541. X$ ! Create VMS foreign command symbol to test SC
  542. X$ !
  543. X$ sc == "$" + f$logical("SYS$DISK") + f$directory() + "SC.EXE"
  544. X$!
  545. X$! Now PSC
  546. X$!
  547. X!$ cc'p1' psc.c
  548. X!$ cc'p1' getopt.c
  549. X$ link'p1' psc,getopt,vmtbl.obj,xmalloc.obj,screen.obj,vi.obj,format.obj,-    
  550. X       sys$library:vaxccurse.olb/lib,-
  551. X       sys$library:vaxcrtl/shar
  552. X$ !
  553. X$ ! Create VMS foreign command symbol to test PSC (Note that
  554. X$ ! PSC reads SYS$INPUT and writes to SYS$OUTPUT, so use
  555. X$ ! DEFINE/USER to redirect.)
  556. X$ !
  557. X$ psc == "$" + f$logical("SYS$DISK") + f$directory() + "PSC.EXE"
  558. END_OF_FILE
  559.   if test 1437 -ne `wc -c <'ss_12b/build.com'`; then
  560.     echo shar: \"'ss_12b/build.com'\" unpacked with wrong size!
  561.   fi
  562.   # end of 'ss_12b/build.com'
  563. fi
  564. if test -f 'ss_12b/crypt.c' -a "${1}" != "-c" ; then 
  565.   echo shar: Will not clobber existing file \"'ss_12b/crypt.c'\"
  566. else
  567.   echo shar: Extracting \"'ss_12b/crypt.c'\" \(4228 characters\)
  568.   sed "s/^X//" >'ss_12b/crypt.c' <<'END_OF_FILE'
  569. X/*
  570. X * Encryption utilites
  571. X * Bradley Williams    
  572. X * {allegra,ihnp4,uiucdcs,ctvax}!convex!williams
  573. X * $Revision: 6.21 $
  574. X */
  575. X
  576. X#ifndef lint
  577. X  static char Sccsid[] = "%W% %G%";
  578. X#endif
  579. X
  580. X#if !defined(VMS) && !defined(MSDOS) && defined(CRYPT_PATH)
  581. X
  582. X#include <stdio.h>
  583. X#include "curses_stuff.h"
  584. X
  585. X#if defined(BSD42) || defined(BSD43)
  586. X#include <sys/types.h>
  587. X#include <sys/file.h>
  588. X#else
  589. X#include <fcntl.h>
  590. X#endif
  591. X
  592. X#include "ss.h"
  593. X
  594. Xchar        *getpass();
  595. X
  596. X#ifdef SYSV3
  597. Xvoid exit();
  598. X#endif
  599. X
  600. Xint         Crypt = 0;
  601. X#define MAXKEYWORDSIZE 30
  602. Xchar        KeyWord[MAXKEYWORDSIZE] = {""};
  603. X
  604. Xvoid
  605. Xcreadfile (save, eraseflg)
  606. Xchar *save;
  607. Xint  eraseflg;
  608. X{
  609. X    register FILE *f;
  610. X    int pipefd[2];
  611. X    int fildes;
  612. X    int pid;
  613. X
  614. X    if (eraseflg && strcmp(save, curfile) && modcheck(" first")) return;
  615. X
  616. X    if ((fildes = open(findhome(save), O_RDONLY, 0)) < 0)
  617. X    {
  618. X    error ("Can't read file \"%s\"", save);
  619. X    return;
  620. X    }
  621. X
  622. X    if (eraseflg) erasedb ();
  623. X
  624. X    if (pipe(pipefd) < 0) {
  625. X    error("Can't make pipe to child");
  626. X    return;
  627. X    }
  628. X
  629. X    deraw();
  630. X    (void) strcpy(KeyWord, getpass("Enter key:"));
  631. X    goraw();
  632. X
  633. X    if ((pid=fork()) == 0)              /* if child  */
  634. X    {
  635. X    (void) close (0);          /* close stdin */
  636. X    (void) close (1);          /* close stdout */
  637. X    (void) close (pipefd[0]);      /* close pipe input */
  638. X    (void) dup (fildes);          /* standard in from file */
  639. X    (void) dup (pipefd[1]);          /* connect to pipe */
  640. X    (void) fprintf (stderr, " ");
  641. X    (void) execl (CRYPT_PATH, "crypt", KeyWord, 0);
  642. X    (void) fprintf (stderr, "execl(%s, \"crypt\", %s, 0) in creadfile() failed",
  643. X            CRYPT_PATH, KeyWord);
  644. X    exit (-127);
  645. X    }
  646. X    else                  /* else parent */
  647. X    {
  648. X    (void) close (fildes);
  649. X    (void) close (pipefd[1]);      /* close pipe output */
  650. X    if ((f = fdopen (pipefd[0], "r")) == (FILE *)0)
  651. X    {
  652. X        (void) kill (pid, -9);
  653. X        error ("Can't fdopen file \"%s\"", save);
  654. X        (void) close (pipefd[0]);
  655. X        return;
  656. X    }
  657. X    }
  658. X
  659. X    loading++;
  660. X    while (fgets(line,sizeof line,f)) {
  661. X    linelim = 0;
  662. X    if (line[0] != '#') (void) yyparse ();
  663. X    }
  664. X    --loading;
  665. X    (void) fclose (f);
  666. X    (void) close (pipefd[0]);
  667. X    while (pid != wait(&fildes)) /**/;
  668. X    linelim = -1;
  669. X    modflg++;
  670. X    if (eraseflg) {
  671. X    (void) strcpy (curfile, save);
  672. X    modflg = 0;
  673. X    }
  674. X    EvalAll();
  675. X}
  676. X
  677. Xint
  678. Xcwritefile (fname, r0, c0, rn, cn)
  679. Xchar *fname;
  680. Xint r0, c0, rn, cn;
  681. X{
  682. X    register FILE *f;
  683. X    int pipefd[2];
  684. X    int fildes;
  685. X    int pid;
  686. X    char save[PATHLEN];
  687. X    char *fn;
  688. X    char *busave;
  689. X
  690. X    if (*fname == '\0') fname = &curfile[0];
  691. X
  692. X    fn = fname;
  693. X    while (*fn && (*fn == ' '))  /* Skip leading blanks */
  694. X    fn++;
  695. X
  696. X    if ( *fn == '|' ) {
  697. X    error ("Can't have encrypted pipe");
  698. X    return(-1);
  699. X    }
  700. X
  701. X    (void) strcpy(save,fname);
  702. X
  703. X    busave = findhome(save);
  704. X#ifdef DOBACKUPS
  705. X    if (!backup_file(busave) &&
  706. X    (yn_ask("Could not create backup copy, Save anyhow?: (y,n)") != 1))
  707. X        return(0);
  708. X#endif
  709. X    if ((fildes = open (busave, O_TRUNC|O_WRONLY|O_CREAT, 0600)) < 0)
  710. X    {
  711. X    error ("Can't create file \"%s\"", save);
  712. X    return(-1);
  713. X    }
  714. X
  715. X    if (pipe (pipefd) < 0) {
  716. X    error ("Can't make pipe to child\n");
  717. X    return(-1);
  718. X    }
  719. X
  720. X    if (KeyWord[0] == '\0') {
  721. X    deraw();
  722. X    (void) strcpy(KeyWord, getpass("Enter key:"));
  723. X    goraw();
  724. X    }
  725. X
  726. X    if ((pid=fork()) == 0)              /* if child  */
  727. X    {
  728. X    (void) close (0);              /* close stdin */
  729. X    (void) close (1);              /* close stdout */
  730. X    (void) close (pipefd[1]);          /* close pipe output */
  731. X    (void) dup (pipefd[0]);              /* connect to pipe input */
  732. X    (void) dup (fildes);              /* standard out to file */
  733. X    (void) fprintf (stderr, " ");
  734. X    (void) execl (CRYPT_PATH, "crypt", KeyWord, 0);
  735. X    (void) fprintf (stderr, "execl(%s, \"crypt\", %s, 0) in cwritefile() failed",
  736. X            CRYPT_PATH, KeyWord);
  737. X    exit (-127);
  738. X    }
  739. X    else                  /* else parent */
  740. X    {
  741. X    (void) close (fildes);
  742. X    (void) close (pipefd[0]);          /* close pipe input */
  743. X    f = fdopen (pipefd[1], "w");
  744. X    if (f == 0)
  745. X    {
  746. X        (void) kill (pid, -9);
  747. X        error ("Can't fdopen file \"%s\"", save);
  748. X        (void) close (pipefd[1]);
  749. X        return(-1);
  750. X    }
  751. X    }
  752. X
  753. X    write_fd(f, r0, c0, rn, cn);
  754. X
  755. X    (void) fclose (f);
  756. X    (void) close (pipefd[1]);
  757. X    while (pid != wait(&fildes)) /**/;
  758. X    (void) strcpy(curfile,save);
  759. X
  760. X    modflg = 0;
  761. X    error ("File \"%s\" written (encrypted).", curfile);
  762. X    return(0);
  763. X}
  764. X
  765. X#endif /* CRYPT_PATH */
  766. END_OF_FILE
  767.   if test 4228 -ne `wc -c <'ss_12b/crypt.c'`; then
  768.     echo shar: \"'ss_12b/crypt.c'\" unpacked with wrong size!
  769.   fi
  770.   # end of 'ss_12b/crypt.c'
  771. fi
  772. if test -f 'ss_12b/curses_stuff.h' -a "${1}" != "-c" ; then 
  773.   echo shar: Will not clobber existing file \"'ss_12b/curses_stuff.h'\"
  774. else
  775.   echo shar: Extracting \"'ss_12b/curses_stuff.h'\" \(1205 characters\)
  776.   sed "s/^X//" >'ss_12b/curses_stuff.h' <<'END_OF_FILE'
  777. X/**********************************************************************
  778. X* %W% %G%
  779. X*
  780. X* ss    :       A SpreadSheet Program
  781. X*
  782. X* Art's Spreadsheet program.          Art Mulder ( art@cs.ualberta.ca )
  783. X* University of Alberta, Department of Computing Science.
  784. X***********************************************************************
  785. X* Header file for Curses-Related stuff
  786. X***********************************************************************
  787. X* 
  788. X**********************************************************************/
  789. X
  790. X#ifndef curses_stuff_h
  791. X#  define curses_stuff_h
  792. X
  793. X/*
  794. X * For Dec/Ultrix you have to include cursesX.h in order to get the
  795. X * Unix System-V curses stuff.
  796. X */
  797. X#if defined(ULTRIX)
  798. X#  include <cursesX.h>
  799. X#else    /* not Ultrix */
  800. X#  include <curses.h>
  801. X#endif
  802. X
  803. X#ifndef A_STANDOUT      /* Should be defined in curses.h */
  804. X#   define A_STANDOUT _STANDOUT
  805. X#endif
  806. X
  807. X/*
  808. X * Take care of some system specific curses definitions
  809. X */
  810. X#ifndef A_CHARTEXT      /* Should be defined in curses.h */
  811. X# ifdef INTERNATIONAL
  812. X#   define A_CHARTEXT 0xff
  813. X# else
  814. X#   define A_CHARTEXT 0x7f
  815. X# endif
  816. X#endif
  817. X
  818. X#endif /* ifndef curses_stuff_h */
  819. X/*----------------------------------------------------------------------
  820. X *    End
  821. X */
  822. END_OF_FILE
  823.   if test 1205 -ne `wc -c <'ss_12b/curses_stuff.h'`; then
  824.     echo shar: \"'ss_12b/curses_stuff.h'\" unpacked with wrong size!
  825.   fi
  826.   # end of 'ss_12b/curses_stuff.h'
  827. fi
  828. if test -f 'ss_12b/disprange.h' -a "${1}" != "-c" ; then 
  829.   echo shar: Will not clobber existing file \"'ss_12b/disprange.h'\"
  830. else
  831.   echo shar: Extracting \"'ss_12b/disprange.h'\" \(920 characters\)
  832.   sed "s/^X//" >'ss_12b/disprange.h' <<'END_OF_FILE'
  833. X/**********************************************************************
  834. X* %W% %G%
  835. X*
  836. X* ss     :    A SpreadSheet Program
  837. X*
  838. X* Art's Spreadsheet program.          Art Mulder ( art@cs.ualberta.ca )
  839. X* University of Alberta, Department of Computing Science.
  840. X***********************************************************************
  841. X* disprange.c header file
  842. X**********************************************************************/
  843. X
  844. X#ifndef disprange_h
  845. X#   define disprange_h
  846. X
  847. X/* 
  848. X * Function Prototypes
  849. X */
  850. X
  851. X    void RangeToggle();
  852. X    char * RangeGet();
  853. X    void RangeGetNum();
  854. X    char * RangeForceInput();
  855. X
  856. X/* OLD */
  857. X/**     void GetRangeInput();            **/
  858. X/**     int GetRange( minr,minc,maxr,maxc  );    **/
  859. X
  860. X    void startshow();
  861. X    void showdr();
  862. X
  863. X#endif /* disprange_h undefined */
  864. X
  865. X/**********************************************************************
  866. X*    End
  867. X**********************************************************************/
  868. END_OF_FILE
  869.   if test 920 -ne `wc -c <'ss_12b/disprange.h'`; then
  870.     echo shar: \"'ss_12b/disprange.h'\" unpacked with wrong size!
  871.   fi
  872.   # end of 'ss_12b/disprange.h'
  873. fi
  874. if test -f 'ss_12b/menu.h' -a "${1}" != "-c" ; then 
  875.   echo shar: Will not clobber existing file \"'ss_12b/menu.h'\"
  876. else
  877.   echo shar: Extracting \"'ss_12b/menu.h'\" \(981 characters\)
  878.   sed "s/^X//" >'ss_12b/menu.h' <<'END_OF_FILE'
  879. X/**********************************************************************
  880. X* %W% %G%
  881. X*
  882. X* ss     :    A SpreadSheet Program
  883. X*
  884. X* Art's Spreadsheet program.          Art Mulder ( art@cs.ualberta.ca )
  885. X* University of Alberta, Department of Computing Science.
  886. X***********************************************************************
  887. X* menu.c header file
  888. X**********************************************************************/
  889. X
  890. X#ifndef menu_h
  891. X#   define menu_h
  892. X
  893. X/* 
  894. X * Function Prototypes
  895. X */
  896. X    void MainMenu();
  897. X
  898. X    void CellNameMenu();
  899. X/*    void MacroMenu(); */
  900. X    void OptionsMenu();
  901. X
  902. X    void doShowRangeNames();
  903. X
  904. X/**     void GetCellInput(); **/
  905. X/**    void GetCommandInput(); **/
  906. X/**    void GetCommandEdit(); **/
  907. X/**    void GetCommand(); **/
  908. X    
  909. X/**    void ClearError(); **/
  910. X/**    void prompt(); **/
  911. X
  912. X#endif /* menu_h undefined */
  913. X
  914. X/**********************************************************************
  915. X*    End
  916. X**********************************************************************/
  917. END_OF_FILE
  918.   if test 981 -ne `wc -c <'ss_12b/menu.h'`; then
  919.     echo shar: \"'ss_12b/menu.h'\" unpacked with wrong size!
  920.   fi
  921.   # end of 'ss_12b/menu.h'
  922. fi
  923. if test -f 'ss_12b/menu_macro.c' -a "${1}" != "-c" ; then 
  924.   echo shar: Will not clobber existing file \"'ss_12b/menu_macro.c'\"
  925. else
  926.   echo shar: Extracting \"'ss_12b/menu_macro.c'\" \(1978 characters\)
  927.   sed "s/^X//" >'ss_12b/menu_macro.c' <<'END_OF_FILE'
  928. X/**********************************************************************
  929. X* %M%
  930. X* Art Mulder ( art@cs.ualberta.ca )
  931. X* University of Alberta, Department of Computing Science.
  932. X***********************************************************************
  933. X* Macro Menu Operations
  934. X***********************************************************************
  935. X**********************************************************************/
  936. X#ifndef lint
  937. X  static char Sccsid[] = "%W% %G%";
  938. X#endif
  939. X
  940. X/*
  941. X * Include files
  942. X */
  943. X#include <stdio.h>
  944. X#include <string.h>
  945. X#include "curses_stuff.h"
  946. X
  947. X#include "ss.h"
  948. X#include "getinput.h"
  949. X#include "menu_macro.h"
  950. X
  951. X/*    Internal Macros & Data Structures
  952. X *----------------------------------------------------------------------
  953. X */
  954. X
  955. X
  956. X/*    External Global variables
  957. X *----------------------------------------------------------------------
  958. X */
  959. X
  960. X
  961. X/*    Externally Accessible Functions
  962. X ***********************************************************************
  963. X */
  964. X
  965. Xvoid MacroRun()
  966. X/*----------------------------------------------------------------------
  967. X** Load & Run a file of Macros
  968. X*/
  969. X{
  970. X    Message("** Run Macros from file...");
  971. X    
  972. X    if (mdir) {
  973. X    char temp[MAXSTR];
  974. X
  975. X    Sprintf(temp,"%s/", mdir);
  976. X    buff = gi_editline( temp );
  977. X    } else
  978. X    buff = gi_line();
  979. X    ABORT_AND_RETURN_IF_BUFF_NULL;
  980. X
  981. X    Sprintf (line,"merge [\"macro_file\"] \"%s\" ", buff);
  982. X    ClearMessage;
  983. X    PROCESS_line;
  984. X    
  985. X} /* MacroRun() */
  986. X
  987. Xvoid MacroDefine()
  988. X/*----------------------------------------------------------------------
  989. X** Define a Sub-directory name, where macro files are to be found
  990. X*/
  991. X{
  992. X    Message("** Define path (Sub-directory) for `Run Macro'");
  993. X    buff = gi_line();
  994. X    ABORT_AND_RETURN_IF_BUFF_NULL;
  995. X
  996. X    Sprintf (line, "mdir [\"macro_directory\"] \"%s\"", buff);
  997. X    ClearMessage;
  998. X    PROCESS_line;
  999. X
  1000. X} /* MacroDefine() */
  1001. X
  1002. X/**********************************************************************
  1003. X*       End
  1004. X**********************************************************************/
  1005. X
  1006. END_OF_FILE
  1007.   if test 1978 -ne `wc -c <'ss_12b/menu_macro.c'`; then
  1008.     echo shar: \"'ss_12b/menu_macro.c'\" unpacked with wrong size!
  1009.   fi
  1010.   # end of 'ss_12b/menu_macro.c'
  1011. fi
  1012. if test -f 'ss_12b/menu_misc.c' -a "${1}" != "-c" ; then 
  1013.   echo shar: Will not clobber existing file \"'ss_12b/menu_misc.c'\"
  1014. else
  1015.   echo shar: Extracting \"'ss_12b/menu_misc.c'\" \(4157 characters\)
  1016.   sed "s/^X//" >'ss_12b/menu_misc.c' <<'END_OF_FILE'
  1017. X
  1018. X/**********************************************************************
  1019. X* %M%
  1020. X* Art Mulder ( art@cs.ualberta.ca )
  1021. X* University of Alberta, Department of Computing Science.
  1022. X***********************************************************************
  1023. X* Misc Menu Operations
  1024. X***********************************************************************
  1025. X**********************************************************************/
  1026. X#ifndef lint
  1027. X  static char Sccsid[] = "%W% %G%";
  1028. X#endif
  1029. X
  1030. X/*
  1031. X * Include files
  1032. X */
  1033. X#include <stdio.h>
  1034. X#include <string.h>
  1035. X#include <signal.h>
  1036. X#include "curses_stuff.h"
  1037. X#include <stdlib.h>
  1038. X
  1039. X#include "ss.h"
  1040. X#include "getinput.h"
  1041. X#include "disprange.h"
  1042. X#include "menu_misc.h"
  1043. X
  1044. X/*    Internal Macros & Data Structures
  1045. X *----------------------------------------------------------------------
  1046. X */
  1047. X
  1048. X
  1049. X/*    External Global variables
  1050. X *----------------------------------------------------------------------
  1051. X */
  1052. X    extern int showneed;        /* From main.c */
  1053. X    extern int anychanged;      /* ditto */
  1054. X    extern int showexpr;        /* ditto */
  1055. X    extern int ClearScreen;     /* ditto */
  1056. X
  1057. X
  1058. X
  1059. X/*    Externally Accessible Functions
  1060. X ***********************************************************************
  1061. X */
  1062. X
  1063. Xvoid MiscShell()
  1064. X/*----------------------------------------------------------------------
  1065. X** - Access to the shell
  1066. X**      "! command"  executes command
  1067. X**      "!"    forks a shell
  1068. X**      "!!" repeats last command
  1069. X*/
  1070. X{
  1071. X#if VMS || MSDOS
  1072. X    Message("Not implemented on VMS or MS-DOS");
  1073. X#else /* NOT VMS or MSDOS */
  1074. X
  1075. X    char *shl;
  1076. X    int pid, temp;
  1077. X    char cmd[MAXSTR];
  1078. X    static char lastcmd[MAXSTR];
  1079. X
  1080. X    if (!(shl = getenv("SHELL")))
  1081. X    shl = "/bin/sh";
  1082. X
  1083. X    deraw();
  1084. X    (void) fputs("! ", stdout);
  1085. X    (void) fflush(stdout);
  1086. X    (void) fgets(cmd, MAXSTR, stdin);
  1087. X    cmd[strlen(cmd) - 1] = '\0';        /* clobber \n */
  1088. X    if(strcmp(cmd,"!") == 0)            /* repeat? */
  1089. X        (void) strcpy(cmd, lastcmd);
  1090. X    else
  1091. X        (void) strcpy(lastcmd, cmd);
  1092. X
  1093. X    if (modflg) {
  1094. X    (void) puts("[No write since last change]");
  1095. X    (void) fflush (stdout);
  1096. X    }
  1097. X
  1098. X    if (!(pid = fork())) {
  1099. X    (void) signal (SIGINT, SIG_DFL);  /* reset */
  1100. X    if(strlen(cmd))
  1101. X        (void)execl(shl,shl,"-c",cmd,(char *)0);
  1102. X    else
  1103. X        (void) execl(shl, shl, (char *)0);
  1104. X    exit(-127);
  1105. X    }
  1106. X
  1107. X    while (pid != wait(&temp));
  1108. X
  1109. X    (void) printf("Press RETURN to continue ");
  1110. X    fflush(stdout);
  1111. X    (void)nmgetch();
  1112. X    goraw();
  1113. X#endif /* VMS */
  1114. X} /* MiscShell() */
  1115. X
  1116. Xvoid MiscSettings()
  1117. X/*----------------------------------------------------------------------
  1118. X** Change various spreadsheet settings.
  1119. X**
  1120. X** THIS IS UGLY.  HOLDOVER FROM 'sc'  FIX PLEASE!
  1121. X*/
  1122. X{
  1123. X
  1124. X    Message("Set:byrows,bycols,iterations=n,tblstyle=(0|tbl|latex|slatex|tex|frame),<MORE>");
  1125. X
  1126. X    buff = gi_line();
  1127. X    ABORT_AND_RETURN_IF_BUFF_NULL;
  1128. X    Sprintf (line, "set %s", buff);    
  1129. X    ClearMessage;
  1130. X    modflg++;        /* So Settings get saved in Spreadsheet file */
  1131. X    PROCESS_line
  1132. X    
  1133. X} /* MiscSettings() */
  1134. X
  1135. Xvoid MiscRedraw(show_values)
  1136. X/*----------------------------------------------------------------------
  1137. X** Redraw the screen, Highlight Cells containing Values if
  1138. X** ``show_values'' is true.
  1139. X*/
  1140. X    int show_values;
  1141. X{
  1142. X
  1143. X    if (show_values == TRUE) { 
  1144. X    Message("** All Highlighted cells contain Values.");
  1145. X    showneed = 1;
  1146. X    }
  1147. X    FullUpdate++;
  1148. X    ClearScreen++;
  1149. X    (void) clearok(stdscr,1);
  1150. X
  1151. X    /* Centering the display with cursor for middle */
  1152. X    if(currow > (LINES-RESROW)/2)
  1153. X    strow = currow - ((LINES-RESROW)/2);
  1154. X
  1155. X} /* MiscRedraw() */
  1156. X
  1157. Xvoid MiscRedraw_Expr()
  1158. X/*----------------------------------------------------------------------
  1159. X** Redraw the screen, Highlight Cells containing Expressions 
  1160. X*/
  1161. X{
  1162. X    Message("** All Highlighted cells contain Expressions.");
  1163. X
  1164. X    FullUpdate++;
  1165. X    showexpr = 1;
  1166. X    (void) clearok(stdscr,1);
  1167. X}
  1168. X
  1169. Xvoid MiscRecalc()
  1170. X/*----------------------------------------------------------------------
  1171. X** Recalculate the Spreadsheet.
  1172. X*/
  1173. X{
  1174. X    ClearMessage;
  1175. X    EvalAll ();
  1176. X    changed = 0;
  1177. X    anychanged = TRUE;
  1178. X    Message("** Spreadsheet Recalculated.");
  1179. X}
  1180. X
  1181. X/**********************************************************************
  1182. X*       End
  1183. X**********************************************************************/
  1184. END_OF_FILE
  1185.   if test 4157 -ne `wc -c <'ss_12b/menu_misc.c'`; then
  1186.     echo shar: \"'ss_12b/menu_misc.c'\" unpacked with wrong size!
  1187.   fi
  1188.   # end of 'ss_12b/menu_misc.c'
  1189. fi
  1190. if test -f 'ss_12b/menu_name.c' -a "${1}" != "-c" ; then 
  1191.   echo shar: Will not clobber existing file \"'ss_12b/menu_name.c'\"
  1192. else
  1193.   echo shar: Extracting \"'ss_12b/menu_name.c'\" \(3689 characters\)
  1194.   sed "s/^X//" >'ss_12b/menu_name.c' <<'END_OF_FILE'
  1195. X
  1196. X/**********************************************************************
  1197. X* %M%
  1198. X* Art Mulder ( art@cs.ualberta.ca )
  1199. X* University of Alberta, Department of Computing Science.
  1200. X***********************************************************************
  1201. X* Name Sub-Menu Operations
  1202. X***********************************************************************
  1203. X**********************************************************************/
  1204. X#ifndef lint
  1205. X  static char Sccsid[] = "%W% %G%";
  1206. X#endif
  1207. X
  1208. X/*
  1209. X * Include files
  1210. X */
  1211. X#include <stdio.h>
  1212. X#include <string.h>
  1213. X#include "curses_stuff.h"
  1214. X
  1215. X#include "ss.h"
  1216. X#include "getinput.h"
  1217. X#include "disprange.h"
  1218. X#include "menu_name.h"
  1219. X
  1220. Xextern  char    *getenv();
  1221. X
  1222. X/*    Internal Macros & Data Structures
  1223. X *----------------------------------------------------------------------
  1224. X */
  1225. X
  1226. X
  1227. X/*    External Global variables
  1228. X *----------------------------------------------------------------------
  1229. X */
  1230. X
  1231. X
  1232. X
  1233. X/*    Externally Accessible Functions
  1234. X ***********************************************************************
  1235. X */
  1236. X
  1237. Xvoid NameDefine()
  1238. X/*----------------------------------------------------------------------
  1239. X** Define a Name for a range of cells.  If no range is currently defined,
  1240. X** then define a name for the current cell.
  1241. X*/
  1242. X{
  1243. X    range = RangeGet();         /* Get range, if any, "" otherwise. */
  1244. X
  1245. X    if (range[0] == NULL)       /* Null range */
  1246. X        Sprintf(message, "** Define a Name for the current cell" );
  1247. X    else
  1248. X        Sprintf(message, "** Define a Name for the cell range %s", range);
  1249. X
  1250. X    Message(message);
  1251. X    buff = gi_line();
  1252. X    ABORT_AND_RETURN_IF_BUFF_NULL;
  1253. X
  1254. X    Sprintf(line,"define [string range] \"%s\" %s", buff, range);
  1255. X    modflg++;
  1256. X
  1257. X    PROCESS_line;
  1258. X
  1259. X} /* NameDefine() */
  1260. X
  1261. Xvoid NameErase()
  1262. X/*----------------------------------------------------------------------
  1263. X** Erase the name assigned to a range of cells.  If no range is
  1264. X** currently defined, then prompt for a cell name to erase.
  1265. X*/
  1266. X{
  1267. X    range = RangeGet();         /* Get range, if any, "" otherwise. */
  1268. X
  1269. X    if (range[0] == NULL) {       /* Null range */
  1270. X        Sprintf(message, "** Enter a Cell/Range Name to be erased" );
  1271. X    Message(message);
  1272. X    buff = gi_line();
  1273. X    ABORT_AND_RETURN_IF_BUFF_NULL;
  1274. X    
  1275. X    Sprintf(line,"undefine [range] %s", buff);
  1276. X    PROCESS_line;
  1277. X    modflg++;
  1278. X
  1279. X    } else {
  1280. X        Sprintf(message, "** Erase the Name for the cell range %s ?", range);
  1281. X    if (yn_ask(message) == 1) {
  1282. X        Sprintf(line,"undefine [range] %s", range);
  1283. X        linelim = 0;    
  1284. X        (void) yyparse ();
  1285. X        linelim = -1;
  1286. X        modflg++;
  1287. X    }
  1288. X    }
  1289. X} /* NameErase() */
  1290. X
  1291. Xvoid NameShow()
  1292. X/*----------------------------------------------------------------------
  1293. X** List all Names that have been assigned to cells, or ranges
  1294. X** of cells.  Pipe the output to 'sort' and then to a pager.  
  1295. X** Therefore the list of names is sorted, and it will not run off the
  1296. X** top of your display.
  1297. X*/
  1298. X{
  1299. X#   define MAXCMD 160                   /* for ! command below */
  1300. X#   ifndef DFLT_PAGER
  1301. X#       define  DFLT_PAGER "more"       /* Default pager */
  1302. X#   endif /* DFLT_PAGER */
  1303. X
  1304. X    if(are_ranges()) {
  1305. X        FILE *f;
  1306. X        int pid;
  1307. X        char px[MAXCMD] ;
  1308. X        char *pager;
  1309. X
  1310. X        (void) strcpy(px, "| sort | ");
  1311. X        if(!(pager = getenv("PAGER")))
  1312. X            pager = DFLT_PAGER;
  1313. X        (void) strcat(px,pager);
  1314. X        f = openout(px, &pid);
  1315. X        if (!f) {
  1316. X            Message("** Can't open pipe to sort");
  1317. X            return;
  1318. X        }
  1319. X        list_range(f);
  1320. X        closeout(f, pid);
  1321. X
  1322. X    } else Message("** No Names have been defined");
  1323. X    
  1324. X} /* NameShow() */
  1325. X
  1326. X/**********************************************************************
  1327. X*       End
  1328. X**********************************************************************/
  1329. END_OF_FILE
  1330.   if test 3689 -ne `wc -c <'ss_12b/menu_name.c'`; then
  1331.     echo shar: \"'ss_12b/menu_name.c'\" unpacked with wrong size!
  1332.   fi
  1333.   # end of 'ss_12b/menu_name.c'
  1334. fi
  1335. if test -f 'ss_12b/pss.doc' -a "${1}" != "-c" ; then 
  1336.   echo shar: Will not clobber existing file \"'ss_12b/pss.doc'\"
  1337. else
  1338.   echo shar: Extracting \"'ss_12b/pss.doc'\" \(2334 characters\)
  1339.   sed "s/^X//" >'ss_12b/pss.doc' <<'END_OF_FILE'
  1340. X.\" $Revision: 6.21 $
  1341. X.TH PPNAME\ #REVISION#\  1
  1342. X.SH NAME
  1343. Xppname \- prepare pname files
  1344. X.SH SYNOPSIS
  1345. X.B ppname
  1346. X[
  1347. X.I -fLkrSPv
  1348. X]
  1349. X[
  1350. X.I -s cell
  1351. X]
  1352. X[
  1353. X.I -R n
  1354. X]
  1355. X[
  1356. X.I -C n
  1357. X]
  1358. X[
  1359. X.I -n n
  1360. X]
  1361. X[
  1362. X.I -d c
  1363. X]
  1364. X
  1365. X.SH DESCRIPTION
  1366. X.I Ppname
  1367. Xis used to prepare data for input to the spread sheet calculator
  1368. X.I pname(1).
  1369. XIt accepts normal ascii data on standard input.  Standard output
  1370. Xis a
  1371. X.I pname
  1372. Xfile.
  1373. XWith no options, 
  1374. X.I ppname
  1375. Xstarts the spread sheet in cell A0.  Strings are right justified.
  1376. XAll data on a line is entered on the same row; new input lines
  1377. Xcause the output row number to increment by one.  The default delimiters
  1378. Xare tab and space.  The column formats are set to one larger
  1379. Xthan the number of columns required to hold the largest value
  1380. Xin the column.
  1381. X
  1382. XOptions:
  1383. X
  1384. X.IP "\-f"
  1385. XOmit column width calculations.  This option is for preparing
  1386. Xdata to be merged with an existing spreadsheet.  If the option is not
  1387. Xspecified, the column widths calculated for the data read by
  1388. X.I ppname
  1389. Xwill override those already set in the existing spreadsheet.
  1390. X
  1391. X.IP "\-L"
  1392. XLeft justify strings.
  1393. X
  1394. X.IP "\-k"
  1395. XKeep all delimiters.  This option causes the output cell to change on
  1396. Xeach new delimiter encountered in the input stream.   The default
  1397. Xaction is to condense multiple delimters to one, so that the cell only
  1398. Xchanges once per input data item.
  1399. X
  1400. X.IP "\-r"
  1401. XOutput the data by row first then column.  For input consisting of a single
  1402. Xcolumn, this
  1403. Xoption will result in output of one row with multiple columns
  1404. Xinstead of a single
  1405. Xcolumn spread sheet.
  1406. X
  1407. X.IP "\-s cell"
  1408. XStart the top left corner of the spread sheet in 
  1409. X.I cell.
  1410. XFor example, 
  1411. X.I "-s B33"
  1412. Xwill arrange the output data so that the
  1413. Xspread sheet starts in column B, row 33.
  1414. X
  1415. X.IP "\-R n"
  1416. XIncrement by
  1417. X.I n 
  1418. Xon each new output row.
  1419. X
  1420. X.IP "\-C n"
  1421. XIncrement by
  1422. X.I n 
  1423. Xon each new output column.
  1424. X
  1425. X.IP "\-n n"
  1426. XOutput 
  1427. X.I n
  1428. Xrows before advancing to the next column.  This option is used when
  1429. Xthe input is arranged in a single column and the spread sheet is to
  1430. Xhave multiple columns, each of which is to be length
  1431. X.I n.
  1432. X
  1433. X.IP "\-d c"
  1434. XUse the single character
  1435. X.I c
  1436. Xas the delimiter between input fields.
  1437. X
  1438. X.IP "\-P"
  1439. XPlain numbers only.
  1440. XA field is a number only when there is no imbeded [-+eE].
  1441. X
  1442. X.IP "\-S"
  1443. XAll numbers are strings.
  1444. X
  1445. X.IP "\-v"
  1446. XPrint the version of
  1447. Xppname
  1448. X
  1449. X.SH SEE ALSO
  1450. Xpname(1)
  1451. X
  1452. X.SH AUTHOR
  1453. X
  1454. XRobert Bond
  1455. END_OF_FILE
  1456.   if test 2334 -ne `wc -c <'ss_12b/pss.doc'`; then
  1457.     echo shar: \"'ss_12b/pss.doc'\" unpacked with wrong size!
  1458.   fi
  1459.   # end of 'ss_12b/pss.doc'
  1460. fi
  1461. if test -f 'ss_12b/sc_stuff/README.sc' -a "${1}" != "-c" ; then 
  1462.   echo shar: Will not clobber existing file \"'ss_12b/sc_stuff/README.sc'\"
  1463. else
  1464.   echo shar: Extracting \"'ss_12b/sc_stuff/README.sc'\" \(4252 characters\)
  1465.   sed "s/^X//" >'ss_12b/sc_stuff/README.sc' <<'END_OF_FILE'
  1466. XThis is a much modified version of the public domain spread sheet sc,
  1467. Xposted several years ago by Mark Weiser as vc, originally by James Gosling.
  1468. X
  1469. XCHANGES lists the changes since 6.1 to 6.21.
  1470. X    Sc6.16 was released to comp.sources.misc and four sets of patches
  1471. X    bring Sc6.16->6.17->6.18->6.19->6.21.
  1472. X
  1473. XCurrent maintainer: nstar!sawmill!prslnk!buhrt (Jeff Buhrt)
  1474. X
  1475. XWhen you get it built, try "sc tutorial.sc" for a simple introduction
  1476. Xto the basic commands.
  1477. X
  1478. XTo print a quick reference card, type the command:
  1479. X    scqref | [your_printer_commmand]
  1480. X
  1481. XIf you have the command 'file' that uses /etc/magic add the line:
  1482. X38    string        Spreadsheet    sc file
  1483. X
  1484. XPsc formats ascii files for use in the spreadsheet.  If you don't have
  1485. Xgetopts, there is a public domain version by Henry Spencer hidden away in
  1486. Xthe VMS_NOTES file.
  1487. X
  1488. XI have modified the Makefile to make it easy for you to call the
  1489. Xprogram what you want.  Just change "name=sc" and "NAME=SC" to
  1490. X"name=myfavoritename" and "NAME=MYFAVORITENAME" and try "make
  1491. Xmyfavoritename".
  1492. X
  1493. XSimilarly, you can make the documentation with "make myfavoritename.man".
  1494. X"make install" will make and install the code in EXDIR.  The
  1495. Xinstallation steps and documentation all key off of the name.  The
  1496. Xmakefile even changes the name in the nroffable man page.  If you don't
  1497. Xhave nroff, you will have to change sc.man yourself.
  1498. X
  1499. XThis release has been tested against a Sequent S81 running DYNIX 3.0.17
  1500. X(BSD 4.2):cc, atscc, gcc, AT&T SysV 3.2.2:cc, gcc, ESIX SysV 3.2 Rev D:cc, gcc.
  1501. XJust check the Makefile for the system flags.   I have heard
  1502. Xreports of lots of other machines that work. If you have problems with
  1503. Xlex.c, and don't care about arrow keys, define SIMPLE (-DSIMPLE in the
  1504. Xmakefile).  SIMPLE causes the arrow keys to not be used.
  1505. X
  1506. XIf you have problems with your yacc saying: too many terminals ...127...
  1507. XFind a different yacc: bison, Berkeley yacc, Pd yacc, etc. AT&T's Sys V
  1508. Xyacc has small, fixed sized tables. SCO will allow dynamic yacc tables
  1509. Xwhen given the correct flags.
  1510. X
  1511. XGuidelines for Hackers:
  1512. X
  1513. XIf you want to send changes you have made to SC, please feel free to do
  1514. Xso.  If they work :-) and seem worthwhile, I'll put them in.
  1515. X
  1516. Xa) Please refrain from wholesale "style" or "cleanup" changes.  It is easy
  1517. X    to add your changes but it makes it hard to merge in the next guy's
  1518. X    stuff if he used the release as a base.  Suggestions are welcome.
  1519. X
  1520. Xb) Leave my $Revision:  identifiers alone-they help me track what you used
  1521. X    as a base.  If you check the code into rcs, delete the "$"s on the
  1522. X    Revison lines before you do.
  1523. Xc) Please abide by the style in the code when you make your changes.  It is easy
  1524. X     to break things trying to make them look "right".
  1525. Xd) If you do string functions, please, PLEASE pay attention to null pointers,
  1526. X    use scxmalloc, scxrealloc, and scxfree; and scxfree those arguments.
  1527. Xe) Please don't forget to document your changes in both help.c and sc.doc.
  1528. Xf) WHEN sending diffs: please use diff -c (context diff, and possibly
  1529. X    more than three lines on each side), I get a lot of code and
  1530. X    things move.
  1531. Xg) Please send an explanation of what your code does and how to use/test it.
  1532. X
  1533. XDisclaimer:
  1534. X
  1535. XStarting 4/4/90: (I will be maintaining Sc for a while at least,
  1536. X    Robert Bond has been very busy lately)
  1537. X
  1538. XArchives:
  1539. X1) (FTP) jpd@usl.edu James Dugal
  1540. X    pc.usl.edu    in the pub/unix directory
  1541. X
  1542. X2) (UUCP) marc@dumbcat.sf.ca.us (Marco S Hyman)
  1543. X    dumbcat Any ACU 9600 14157850194 "" \d\r in:--in: nuucp word: guest
  1544. X    dumbcat Any ACU 2400 14157850194 "" \d\r in:-BREAK-in: nuucp word: guest
  1545. X    dumbcat Any ACU 1200 14157850194 "" \d\r in:-BREAK-in:-BREAK-in: nuucp word: guest
  1546. X  Note: dumbcat speaks 9600 at V.32 -- sorry, this is not a Telebit modem.
  1547. X  (Grab dumbcat!~/INDEX for a complete list)
  1548. X
  1549. X3) Sc6.16 was posted in comp.sources.misc, about Jun 4 1991, Volume 20, Issues
  1550. X    035-041. There were then 4 patches: Sc6.16->Sc6.17, Sc6.17->Sc6.18,
  1551. X    Sc6.18->Sc6.19, and Sc6.19->Sc6.21.
  1552. X
  1553. X4) (FTP) Paul A Vixie <uunet!decwrl!vixie>
  1554. X    gatekeeper.dec.com    in /pub/misc/sc-6.21.tar.Z
  1555. X
  1556. XSc is not a product of ProsLink, Inc.  It is supplied as is with no
  1557. Xwarranty, express or implied, as a service to Usenet readers.  It is not
  1558. Xcopyrighted, either.  Have at it.
  1559. X
  1560. X                    Jeff Buhrt
  1561. X                    ProsLink, Inc.
  1562. X                    nstar!sawmill!prslnk!buhrt
  1563. X
  1564. END_OF_FILE
  1565.   if test 4252 -ne `wc -c <'ss_12b/sc_stuff/README.sc'`; then
  1566.     echo shar: \"'ss_12b/sc_stuff/README.sc'\" unpacked with wrong size!
  1567.   fi
  1568.   # end of 'ss_12b/sc_stuff/README.sc'
  1569. fi
  1570. if test -f 'ss_12b/sc_stuff/TODO' -a "${1}" != "-c" ; then 
  1571.   echo shar: Will not clobber existing file \"'ss_12b/sc_stuff/TODO'\"
  1572. else
  1573.   echo shar: Extracting \"'ss_12b/sc_stuff/TODO'\" \(1297 characters\)
  1574.   sed "s/^X//" >'ss_12b/sc_stuff/TODO' <<'END_OF_FILE'
  1575. X
  1576. Xtodo:
  1577. X1) autobackup of things typed in.
  1578. X    idea: each cell change output to a stdio open file
  1579. X        in the save format, fflush() every so often...
  1580. X        (diffs w/r to the original file)
  1581. X2) lock/freeze (glue down) a section of the screen (the rest of the screen
  1582. X    scrolls but a row/column/block stays fixed on the screen)
  1583. X3) (seems ok, but check) FIX the insert/delete row functions.
  1584. X    a) column of equations (EX: E50 = E49+D50)
  1585. X    b) insert a few rows, look at the equations below the insert point
  1586. X    c) delete the inserted rows
  1587. X    d) The equations should now be the same as in (a), but they are not...
  1588. X4) make sure ISVALID should <not> be used in place of checkbounds
  1589. X    in interp.c
  1590. X5) hide range
  1591. X6) block moving into range
  1592. X7) chain cells w/ equations into a linked list or dependency tree
  1593. X    -have a top level eval, eval and UPDATE all lower nodes
  1594. X8) an option to go into a ^R like <mode>
  1595. X    ++data entry fields (highlight entry cells)....
  1596. X    ++only allow entry in these cells....
  1597. X10) don't redraw the whole screen all the time 
  1598. X    (only cells that change, (in addition to what is in 'fixed #9'))
  1599. X11) add uemacs keybinding stuff
  1600. X12) add uemacs macro language
  1601. X13) add uemacs command completion
  1602. X14) insertrow should be openrow w/ a count arg (limits looping)
  1603. X15) on a Get if the buffer hasn't been written, ask to overwrite
  1604. END_OF_FILE
  1605.   if test 1297 -ne `wc -c <'ss_12b/sc_stuff/TODO'`; then
  1606.     echo shar: \"'ss_12b/sc_stuff/TODO'\" unpacked with wrong size!
  1607.   fi
  1608.   # end of 'ss_12b/sc_stuff/TODO'
  1609. fi
  1610. if test -f 'ss_12b/sc_stuff/tutorial.sc' -a "${1}" != "-c" ; then 
  1611.   echo shar: Will not clobber existing file \"'ss_12b/sc_stuff/tutorial.sc'\"
  1612. else
  1613.   echo shar: Extracting \"'ss_12b/sc_stuff/tutorial.sc'\" \(4523 characters\)
  1614.   sed "s/^X//" >'ss_12b/sc_stuff/tutorial.sc' <<'END_OF_FILE'
  1615. X# This data file was generated by the Spreadsheet Calculator.
  1616. X# You almost certainly shouldn't edit it.
  1617. X
  1618. Xdefine "page5" A90
  1619. Xdefine "page1" A11
  1620. Xdefine "page2" A30
  1621. Xdefine "page3" A50
  1622. Xdefine "page4" A71
  1623. Xleftstring A1 = "This is a brief sc tutorial, best run in a 24-line window."
  1624. Xleftstring A2 = "Type 'q' to exit, ^Z to suspend (w/ Job Control)."
  1625. Xleftstring A3 = "^G interrupts a command."
  1626. Xleftstring A5 = "Cells are named by their column and row number.  For example,"
  1627. Xleftstring A6 = "Cell A6"
  1628. Xleftstring B6 = "Cell B6"
  1629. Xleftstring C6 = "Cell C6"
  1630. Xleftstring A7 = "Cell A7"
  1631. Xleftstring A8 = "Cell A8"
  1632. Xleftstring C8 = "Cell C8"
  1633. Xleftstring A9 = "Cells range from A0 to ZZ(some number depending on free memory)."
  1634. Xleftstring A10 = "Cells can also be named by the user.  See 'range names' in the manual."
  1635. Xleftstring page1 = "You can move the cursor a couple of different ways:"
  1636. Xleftstring B12 = "^n, j and the <DOWN> arrow key go down"
  1637. Xleftstring B13 = "^p, k and the <UP> arrow key go up"
  1638. Xleftstring B14 = "^b, h and the <LEFT> arrow key go left"
  1639. Xleftstring B15 = "^f, l and the <RIGHT> arrow key go right"
  1640. Xleftstring B16 = "You can go directly to a cell by typing 'g' and the cell name. "
  1641. Xleftstring B17 = "'g c6' will take you to cell c6."
  1642. Xleftstring A19 = "Cells can contain numbers, formulas, or text."
  1643. Xleftstring A20 = "Most of the cells on this page contain text."
  1644. Xleftstring C21 = "<Type 'g page2' to continue>"
  1645. Xleftstring A23 = "Cell d23 contains text"
  1646. Xleftstring D23 = "Text "
  1647. Xleftstring A24 = "Cell d24 contains a number"
  1648. Xlet D24 = 123.34
  1649. Xleftstring A25 = "Cell d25 contains a formula"
  1650. Xlet D25 = D24+88
  1651. Xleftstring A27 = "To see what the cell contains, just move the cursor"
  1652. Xleftstring A28 = "onto the cell.  The contents will show up on line 1 in the brackets."
  1653. Xleftstring page2 = "You can enter data into cells like this:"
  1654. Xleftstring B31 = "'<text' enters left justified text."
  1655. Xleftstring B32 = "'>text' enters right justified text."
  1656. Xleftstring B33 = "'=number' enters a number"
  1657. Xleftstring B34 = "'=formula' enters a formula."
  1658. Xleftstring A36 = "Try duplicating d23 through d25 in e23 though e25."
  1659. Xleftstring A38 = "You erase a cell by typing 'x' with the cursor on the cell."
  1660. Xleftstring C41 = "<Type 'g page3' to continue>"
  1661. Xleftstring A43 = "Here is a typical use for numbers and formulas:"
  1662. Xlet A45 = 10.3
  1663. Xlet B45 = 1877.5
  1664. Xlet C45 = 234.7
  1665. Xlet E45 = @sum(A45:C45)
  1666. Xlet A46 = 44.56
  1667. Xlet B46 = 44.3
  1668. Xlet C46 = -3
  1669. Xlet E46 = @sum(A46:C46)
  1670. Xlet A47 = 88.74
  1671. Xlet B47 = 8000
  1672. Xlet C47 = -9
  1673. Xlet E47 = @sum(A47:C47)
  1674. Xlet A48 = 99.2
  1675. Xlet B48 = -88
  1676. Xlet C48 = -44.6
  1677. Xlet E48 = @sum(A48:C48)
  1678. Xlet page3 = @sum(A45:A48)
  1679. Xlet B50 = @sum(B45:B48)
  1680. Xlet C50 = @sum(C45:C48)
  1681. Xlet E50 = @sum(A45:C48)
  1682. Xleftstring A52 = "The data is entered in a45 through c48."
  1683. Xleftstring A53 = "Cells a50, b50 and c50 sum their respective columns."
  1684. Xleftstring A54 = "Cells e45, e46, e47, and e48 sum their respective rows."
  1685. Xleftstring A55 = "Cell E50 is a grand total."
  1686. Xleftstring A56 = "Try changing some of the data cells and watch the sums change."
  1687. Xleftstring A58 = "You can also edit cells by putting the cursor on the cell and typing:"
  1688. Xleftstring B59 = "'e' to edit the numeric portion."
  1689. Xleftstring B60 = "'E' to edit the string portion."
  1690. Xleftstring C61 = "<Type 'g page4' to continue>"
  1691. Xleftstring A63 = "Since you are reading this, you know that you can load "
  1692. Xleftstring A64 = "a data base from a file by typing the file name as an"
  1693. Xleftstring A65 = "argument to the program.  You can also load or save a "
  1694. Xleftstring A66 = "data base using the file commands:"
  1695. Xleftstring B68 = "'G file'"
  1696. Xleftstring C68 = "Gets the data from an sc file."
  1697. Xleftstring B69 = "'P file'"
  1698. Xleftstring C69 = "Puts the data from the spreadsheet into a file."
  1699. Xleftstring page4 = "Try 'P foo.sc' to write this to the file foo.sc"
  1700. Xleftstring A72 = "The Get command erases the current spreadsheet.  "
  1701. Xleftstring A73 = "To merge a spreadsheet with the one currently in"
  1702. Xleftstring A74 = "the machine, use:"
  1703. Xleftstring B76 = "'M file'"
  1704. Xleftstring C76 = "Merge the data from a saved sc file."
  1705. Xleftstring A78 = "You can also get human readable versions of the data"
  1706. Xleftstring A79 = "by using the Write command:"
  1707. Xleftstring C81 = "<Type 'g page5' to continue>"
  1708. Xleftstring A83 = "Try 'W tut.txt' for a clear text version of the tutorial."
  1709. Xleftstring A86 = "This is the end of the tutorial.  We have explored"
  1710. Xleftstring A87 = "The basic commands.  Much more detail is available"
  1711. Xleftstring A88 = "in the man page."
  1712. Xleftstring page5 = "To quit this program, type 'q'."
  1713. Xleftstring D92 = "GOOD LUCK!"
  1714. END_OF_FILE
  1715.   if test 4523 -ne `wc -c <'ss_12b/sc_stuff/tutorial.sc'`; then
  1716.     echo shar: \"'ss_12b/sc_stuff/tutorial.sc'\" unpacked with wrong size!
  1717.   fi
  1718.   # end of 'ss_12b/sc_stuff/tutorial.sc'
  1719. fi
  1720. if test -f 'ss_12b/sunfkeys/xterm-sun.ti' -a "${1}" != "-c" ; then 
  1721.   echo shar: Will not clobber existing file \"'ss_12b/sunfkeys/xterm-sun.ti'\"
  1722. else
  1723.   echo shar: Extracting \"'ss_12b/sunfkeys/xterm-sun.ti'\" \(3339 characters\)
  1724.   sed "s/^X//" >'ss_12b/sunfkeys/xterm-sun.ti' <<'END_OF_FILE'
  1725. X#############################################################################
  1726. X# xterm-sun.ti
  1727. X#
  1728. X# Art's enhanced xterm terminfo entry.  Art Mulder ( art@cs.ualberta.ca )
  1729. X#
  1730. X# a terminfo entry for 'xterm -sf' running on a Sun Sparc (type 4 keyboard) 
  1731. X#
  1732. X# - Corrects mistakes in the default xterm terminfo entry, and
  1733. X#   adds a few key definitions that I found useful.
  1734. X# - use with 'xterm -sf' (generate Sun Function key escape codes. This
  1735. X#   is necessary, because with 'xterm +sf' you get NOTHING from the
  1736. X#   <Home> or <End> keys).
  1737. X#############################################################################
  1738. X# Keys Defined: 
  1739. X#    <end>, <f1> through <f12>, <home>, <page down>, <page up>,
  1740. X#    <Keypad Enter>, <Insert>,
  1741. X#    <Shift><end>, <Shift><home>, <Shift><left arrow>,
  1742. X#    <Shift><right arrow>.
  1743. X#
  1744. X# Keys Undefined:
  1745. X#    <a1> : conflicts with <shift><End>  (Don't ask me, I just know it does)
  1746. X#
  1747. X# BEEF: Why doesn't terminfo have a shifted Up/Down Arrow when it DOES
  1748. X#    have a shifted Left/Right Arrow?  What about shifted PageUp/PageDown,
  1749. X#    after all, there ARE shifted Home/End Keys.  Seems rather arbitrary.
  1750. X#
  1751. X#############################################################################
  1752. X# Help yourself to whatever you want from this file.
  1753. X# Caveat Emptor.
  1754. X#############################################################################
  1755. X
  1756. X#    xterm-sun
  1757. X#---------------------------------------------------------------------------
  1758. Xxterm-sun|xterm on a sun Sparc (type 4 kbd) Workstation,
  1759. X    kf1=\E[224z, kf2=\E[225z, kf3=\E[226z, kf4=\E[227z,
  1760. X    kf5=\E[228z, kf6=\E[229z, kf7=\E[230z, kf8=\E[231z, kf9=\E[232z,
  1761. X    kf10=\E[233z,kf11=\E[192z,kf12=\E[193z,
  1762. X    kend=\E[220z, khome=\E[214z, kich1=\E[2z, knp=\E[222z, kpp=\E[216z,
  1763. X    kEND=\EOq, kHOM=\EOw, kLFT=\EOt, kRIT=\EOv,
  1764. X    ka1@,
  1765. X    use=xterm,
  1766. X
  1767. X#    xterm
  1768. X#---------------------------------------------------------------------------
  1769. X# This is just a duplicate of the system xterm terminfo entry.  Put here
  1770. X# since /usr/5bin/tic needed it in order to compile 'xterm-sun'  --- and
  1771. X# I couldn't see how to make it just go get the system xterm entry.
  1772. X#
  1773. Xxterm|vs100|xterm terminal emulator,
  1774. X    am, eslok, hs, km, mir, msgr, xenl,
  1775. X    cols#80, it#8, lines#65,
  1776. X    acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
  1777. X    bel=^G, blink=\E[5m$<2>, bold=\E[1m, clear=\E[H\E[2J,
  1778. X    cr=\r, csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=\b,
  1779. X    cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C,
  1780. X    cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
  1781. X    dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M,
  1782. X    dsl=\E[?E, ed=\E[J, el=\E[K, el1=\E[1K$<3>,
  1783. X    enacs=\E(B\E)0, fsl=\E[?F, home=\E[H, ht=\t, hts=\EH,
  1784. X    ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L,
  1785. X    ind=\n, ka1=\EOq, ka3=\EOs, kb2=\EOr, kbs=\b,
  1786. X    kc1=\EOp, kc3=\EOn, kcub1=\EOD, kcud1=\EOB,
  1787. X    kcuf1=\EOC, kcuu1=\EOA, kent=\EOM, kf0=\EOy, kf1=\EOP,
  1788. X    kf10=\EOx, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\EOt,
  1789. X    kf6=\EOu, kf7=\EOv, kf8=\EOl, kf9=\EOw, rc=\E8,
  1790. X    rev=\E[7m, ri=\EM, rmacs=^O, rmcup=\E[2J\E[?47l\E8,
  1791. X    rmkx=\E[?1l\E>, rmso=\E[m, rmul=\E[m,
  1792. X    rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H, sc=\E7,
  1793. X    sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t^N%e^O%;,
  1794. X    sgr0=\E[m, smacs=^N, smcup=\E7\E[?47h, smkx=\E[?1h\E=,
  1795. X    smso=\E[7m, smul=\E[4m, tbc=\E[3g,
  1796. X    tsl=\E[?E\E[?%i%p1%dT,
  1797. X#---------------------------------------------------------------------------
  1798. X#    End.
  1799. END_OF_FILE
  1800.   if test 3339 -ne `wc -c <'ss_12b/sunfkeys/xterm-sun.ti'`; then
  1801.     echo shar: \"'ss_12b/sunfkeys/xterm-sun.ti'\" unpacked with wrong size!
  1802.   fi
  1803.   # end of 'ss_12b/sunfkeys/xterm-sun.ti'
  1804. fi
  1805. echo shar: End of archive 10 \(of 11\).
  1806. cp /dev/null ark10isdone
  1807. MISSING=""
  1808. for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
  1809.     if test ! -f ark${I}isdone ; then
  1810.     MISSING="${MISSING} ${I}"
  1811.     fi
  1812. done
  1813. if test "${MISSING}" = "" ; then
  1814.     echo You have unpacked all 11 archives.
  1815.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1816. else
  1817.     echo You still must unpack the following archives:
  1818.     echo "        " ${MISSING}
  1819. fi
  1820. exit 0
  1821. exit 0 # Just in case...
  1822.