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

  1. Newsgroups: comp.sources.misc
  2. From: art@cs.ualberta.ca (Art Mulder)
  3. Subject: v35i092:  ss - Simple Spreadsheet program, v1.2b, Part06/11
  4. Message-ID: <1993Feb22.152930.21625@sparky.imd.sterling.com>
  5. X-Md4-Signature: e45c1a9fb9505d7eb368ce6afdf0256a
  6. Date: Mon, 22 Feb 1993 15:29:30 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: art@cs.ualberta.ca (Art Mulder)
  10. Posting-number: Volume 35, Issue 92
  11. Archive-name: ss/part06
  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/Makefile ss_12b/Makefile.mips ss_12b/Makefile.sgi
  19. #   ss_12b/pss.c
  20. # Wrapped by kent@sparky on Sat Feb 20 16:01:03 1993
  21. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  22. echo If this archive is complete, you will see the following message:
  23. echo '          "shar: End of archive 6 (of 11)."'
  24. if test -f 'ss_12b/Makefile' -a "${1}" != "-c" ; then 
  25.   echo shar: Will not clobber existing file \"'ss_12b/Makefile'\"
  26. else
  27.   echo shar: Extracting \"'ss_12b/Makefile'\" \(16608 characters\)
  28.   sed "s/^X//" >'ss_12b/Makefile' <<'END_OF_FILE'
  29. X#############################################################################
  30. X# Makefile $Revision: 6.21 $
  31. X#
  32. X# How to build the 'ss' package:
  33. X# 1) Read this Makefile, keeping an eye out for anything that appears to
  34. X#    have a bearing on your situation.
  35. X#
  36. X# 2) Customize these variables, to match the situation at your site:
  37. X#    EXDIR (path), MANDIR, MANEXT, LIBDIR, SIGVOID, RE_COMP/REGCMP, 
  38. X#    DFLT_PAGER, and FMOD. 
  39. X#
  40. X#    There are lost of other variables, but most shouldn't need to be
  41. X#    changed.  (If you followed #1, you probably already know that, and
  42. X#    have probably already changed any you think should be changed.)
  43. X#
  44. X# 3) Underneath the heading "SYSTEM DEFINES", below, there are sections
  45. X#    of code for many different machine/compiler/OS setups.  Select
  46. X#    the section that corresponds to your site, and:
  47. X#      (a) Uncomment it.
  48. X#      (b) Customize it, if needed.
  49. X#      (c) Ensure that all other System Defines are commented out.
  50. X#
  51. X# 4) "make"
  52. X#    This will build everything, but will not install it.  If you want
  53. X#    you can install the pieces yourself, or issue the "make install"
  54. X#    command.  ( "make man" will build the ss man page )
  55. X#
  56. X# 5) If you have the command 'file' that uses /etc/magic you can
  57. X#    add the line to /etc/magic:
  58. X#    38    string        Spreadsheet    sc/ss file
  59. X#############################################################################
  60. X
  61. X#
  62. X#       Commonly Changed Variables.  Modify as necessary for your site
  63. X#---------------------------------------------------------------------------
  64. X
  65. X# This is where the install step puts the executables.
  66. X# EXDIR        = /site/bin
  67. X  EXDIR        = /usr/local/bin
  68. X
  69. X# This is where the man page goes.
  70. X# MANDIR    = /usr/local/src/man/man1    # reno
  71. X# MANEXT    = 1                # reno
  72. X  MANDIR    = /usr/man/manl
  73. X  MANEXT    = l
  74. X  MANMODE    = 644
  75. X
  76. X# This is where the library file (tutorial) goes.
  77. X# LIBDIR    =/usr/local/share/$(name) # reno
  78. X  LIBDIR    = /usr/local/lib/$(name)
  79. X
  80. X# Set SIGVOID if signal routines are type void.
  81. X# use: SIGVOID=-DSIGVOID for:
  82. X#    System 5.3, SunOS 4.X, VMS, BSD4.4 (reno), and ANSI C Compliant systems
  83. X# use: SIGVOID=         for:
  84. X#  BSD systems (excluding reno, BSD4.4), and the UNIXPC 'cc'
  85. X  SIGVOID    =-DSIGVOID
  86. X# SIGVOID    =
  87. X
  88. X# Set RE_COMP if you have the re_comp/re_exec regular expression routines
  89. X# (most BSD based systems do).
  90. X  RE_COMP    =-DRE_COMP
  91. X##RE_COMP    =
  92. X
  93. X# Set REGCMP if you have the regcmp/regex regular expression routines
  94. X# (most System V based systems do)
  95. X##REGCMP    =-DREGCMP
  96. X  REGCMP    =
  97. X
  98. X# This is the name of a pager like "more".
  99. X# "pg" may be appropriate for SYSV.
  100. X  DFLT_PAGER    =-DDFLT_PAGER=\"less\"
  101. X# DFLT_PAGER    =-DDFLT_PAGER=\"more\"    # generic && reno
  102. X
  103. X# If you get errors about fmod being undefined when you try to
  104. X# compile, then define NO_FMOD (most likely BSD4.3 and Mt Xinu).
  105. X# FMOD        =-DNO_FMOD
  106. X  FMOD        =
  107. X
  108. X#
  109. X#       Variables which are NOT commonly changed.  
  110. X#---------------------------------------------------------------------------
  111. X
  112. X# Specify the name of the program.
  113. X# All documentation and installation keys on this value.
  114. X  name        = ss
  115. X  NAME        = SS
  116. X
  117. X# Set NOUNGETCH for lex.c if you don't have ungetch() in your
  118. X# curses library.
  119. X# NOUNGETCH = -DNOUNGETCH
  120. X  NOUNGETCH = 
  121. X
  122. X# Set SIMPLE for lex.c if you don't want arrow keys or lex.c blows up
  123. X  SIMPLE    =
  124. X# SIMPLE    =-DSIMPLE
  125. X
  126. X# Set BROKENCURSES if your curses has the nl/nonl bug
  127. X# if it does and you don't set BROKENCURSES, the display will
  128. X# be staggered across the screen. Also try IDLOKBAD below.
  129. X  BROKENCURSES    =
  130. X# BROKENCURSES    =-DBROKENCURSES
  131. X
  132. X# Set DOBACKUPS if you would like a backup copy of a source file on a save
  133. X# DOBACKUPS    =
  134. X  DOBACKUPS    =-DDOBACKUPS
  135. X
  136. X# Set INTERNATIONAL if you need 8 bit characters.  You should
  137. X# not set this if you are running 5.3.0.  I think it is OK in 5.3.1.
  138. X# INTERNATIONAL    =-DINTERNATIONAL
  139. X  INTERNATIONAL    =
  140. X
  141. X# Set IEEE_MATH if you need setsticky() calls in your signal handlers
  142. X# IEEE_MATH    =-DIEEE_MATH
  143. X  IEEE_MATH    =
  144. X
  145. X# Set RINT=-DRINT if you do not have rint() in math.h
  146. X# Set RINT=    on/with (they have rint):
  147. X#    SunOS 4.0.3c, 4.1.1 compiler
  148. X#    BSD4.4 (reno)
  149. X  RINT    =
  150. X# RINT    =-DRINT
  151. X
  152. X# this is the name to save back ups in
  153. X  SAVE        =-DSAVENAME=\"$(NAME).SAVE\"
  154. X
  155. X# Path to crypt, do NOT define if you don't have crypt.
  156. X# most systems:
  157. X##CRYPT        =-DCRYPT_PATH=\"/bin/crypt\"
  158. X# BSD:
  159. X# CRYPT        =-DCRYPT_PATH=\"/usr/bin/crypt\"
  160. X# other people?:
  161. X# CRYPT        =-DCRYPT_PATH=\"/usr/local/bin/crypt\"
  162. X
  163. X# If your system doesn't have notimeout() in curses define NONOTIMEOUT
  164. X  NO_NOTIMEOUT    =
  165. X# NO_NOTIMEOUT    =-DNONOTIMEOUT
  166. X
  167. X# flags for lint
  168. X  LINTFLAGS    =-abchxv
  169. X
  170. X## # Format of quick reference guide generated by $(name)qref
  171. X## # Leave undefined for normal text output.
  172. X## # QREF_FMT=
  173. X##   QREF_FMT=-DTROFF
  174. X
  175. X
  176. X# *** SPECIAL NOTES ***
  177. X# HP-UX 7.0: Do NOT use -O
  178. X#    (known broken, try sc's boolean operators if you wish)
  179. X#
  180. X# **** SYSV curses bugs... ****
  181. X# Try setting IDLOKBAD to fix (with an empty spreadsheet):
  182. X#    a) Redrawing the bottom half of the screen when you
  183. X#         move between row 9 <-> 10
  184. X#    b) the highlighted row labels being trash when you
  185. X#        move between row 9 <-> 10
  186. X#    c) On an xterm on Esix Rev. D+ from eating lines
  187. X#         -goto (or move) a few lines (or more) past the bottom
  188. X#         of the screen, goto (or move) to the top line on the
  189. X#         screen, move upward and the current line is deleted, the
  190. X#         others move up even when they should not, check by
  191. X#         noticing the rows become 2, 3, 40, 41, 42... (etc).
  192. X#    Known systems/terminfos w/ curses problems:
  193. X#    {Esix Rev. D+, AT&T SysV3.2.1}:at386-m,xterm, HP-UX7.0:(not sure)
  194. X  IDLOKISBAD    =-DIDLOKBAD
  195. X# IDLOKISBAD    =
  196. X
  197. X# If you don't have idlok() in your curses define NOIDLOK
  198. X  NO_IDLOK=
  199. X# NO_IDLOK=-DNOIDLOK
  200. X
  201. X# If moving right off the screen causes the screen to not redraw
  202. X# properly, define RIGHT_CBUG to get around a curses problem on some
  203. X# boxes, this forces screen redraws when going right off the screen
  204. X  RIGHTBUG    =
  205. X# RIGHTBUG    =-DRIGHT_CBUG
  206. X
  207. X# IF you have problems w/ your yacc try bison, Berkeley yacc, or
  208. X# some other yacc. Some systems don't allow you to
  209. X# increase the number of terminals (mostly AT&T), SCO's does though.
  210. X# NOTE: Do not use with bison 1.16! Get a new version...
  211. X# YACC        =yacc
  212. X  YACC        =bison -y
  213. X
  214. X# MS-DOS needs y_tab instead of the normal y.tab
  215. X# YTAB            =y_tab
  216. X  YTAB            =y.tab
  217. X
  218. X# Command to use to make temporary copies of some source files.
  219. X  LN        =ln
  220. X# LN        =ln -s
  221. X# LN        =cp
  222. X
  223. X#    SYSTEM DEFINES
  224. X#---------------------------------------------------------------------------
  225. X# Locate your System in the following ALPHABETICAL list of systems, and
  226. X# uncomment the defintions relating to it.  See the comments accompanying
  227. X# each system for further information.  
  228. X#
  229. X# **> Make sure that all other systems are commented out! <**
  230. X
  231. X# system AIX V3.1
  232. X#- - - - - - - - - - - - - - - - - - - -
  233. X#CFLAGS        = -O -DSYSV2 -DCHTYPE=int -DNLS
  234. X#LDFLAGS    =
  235. X#LIB        =-lm -lPW -lcurses
  236. X
  237. X# BSD 4.2
  238. X#- - - - - - - - - - - - - - - - - - - -
  239. X#CFLAGS        = -O -DBSD42
  240. X#LDFLAGS    =
  241. X#LIB        =-lm -lcurses -ltermcap
  242. X# with gcc also use:
  243. X#CC        =gcc
  244. X
  245. X# BSD 4.3
  246. X#- - - - - - - - - - - - - - - - - - - -
  247. X#CFLAGS        = -O -DBSD43
  248. X#LDFLAGS    =
  249. X#LIB        =-lm -lcurses -ltermcap
  250. X
  251. X# Microport
  252. X#- - - - - - - - - - - - - - - - - - - -
  253. X#CFLAGS        = -DSYSV2 -O -DUPORT -Ml
  254. X#LDFLAGS    =-Ml
  255. X#LIB        =-lm -lcurses -lPW
  256. X
  257. X# Mips (preliminary, based on System V.3 entry)
  258. X#- - - - - - - - - - - - - - - - - - - -
  259. X# On Mips use: "/usr/bsd43/bin/make"
  260. X# CC            = gcc
  261. X# CFLAGS        = -DSYSV3 -O -I/usr/include -I/usr/include/posix
  262. X# LDFLAGS       = -s
  263. X# YACC          = bison -y
  264. X# LIB           = -lm -lcurses -lPW
  265. X
  266. X# MS-DOS, Microsoft C 5.1 and NDMAKE
  267. X#- - - - - - - - - - - - - - - - - - - -
  268. X#CC        =cl
  269. X#CFLAGS        = -AL -O -Fo$*.o
  270. X#LDFLAGS    =/noi /st:0x4000
  271. X#LIB        =lcurses
  272. X#YACC        =bison -y
  273. X#
  274. X#.SUFFIXES : .o .c
  275. X#.c.o:
  276. X#    $(CC) $(CFLAGS) -c $*.c
  277. X
  278. X# SCO Unix V rel. 3.2.0
  279. X#- - - - - - - - - - - - - - - - - - - -
  280. X#       -compile using rcc, cc does not cope with gram.c
  281. X#       -edit /usr/include/curses.h, rcc does not understand #error
  282. X#       -link: make CC=cc, rcc's loader gets unresolved __cclass, __range
  283. X#               (rather strange,?)
  284. X#CC        =rcc
  285. X#CC        =cc
  286. X#CC        =gcc -fstrength-reduce
  287. X#SIGVOID    =-DSIGVOID
  288. X#CFLAGS        = -O -DSYSV3
  289. X#LDFLAGS    =
  290. X#LIB        =-lm -lcurses -ltinfo -lPW
  291. X#YACC        =yacc -Sm10000
  292. X
  293. X# SCO Unix 3.2.2 and ODT 1.1
  294. X#- - - - - - - - - - - - - - - - - - - -
  295. X#CC        =cc
  296. X#CFLAGS        = -O -DSYSV3
  297. X#LDFLAGS    =
  298. X#LIB        =-lm -lcurses -lPW -lmalloc -lc_s
  299. X#YACC        =yacc -Sm10000
  300. X
  301. X# Sequent boxes
  302. X#- - - - - - - - - - - - - - - - - - - -
  303. X#CC        =atscc
  304. X#CFLAGS        =-O -DBSD42
  305. X#LDFLAGS    = 
  306. X#LIB        =-lm -lcurses  -ltermcap
  307. X#PSCLIB        =-lseq
  308. X# with gcc also use:
  309. X#CC        =gcc
  310. X#CFLAGS        = -O -DBSD42 -pipe
  311. X
  312. X# Sun Systems
  313. X#- - - - - - - - - - - - - - - - - - - -
  314. X# Use this for SunOS 4.X if you have the System V package installed.
  315. X# This will link with the System V curses which is preferable to the
  316. X# BSD curses (especially helps scrolling on slow (9600bps or less)
  317. X# serial lines).
  318. X#
  319. X# Be sure to define SIGVOID and RE_COMP above.
  320. X# 
  321. X# CC        = /usr/5bin/cc
  322. X# CFLAGS    = -O -DSYSV3 
  323. X# LDFLAGS    =
  324. X  LIB        = -lm -lcurses 
  325. X
  326. X### Try gcc 2.0
  327. X  CC        = /usr/gnu/bin/gcc
  328. X  CFLAGS    = -O -DSYSV3  -I/usr/5include
  329. X  LDFLAGS    = -L/usr/5lib
  330. X
  331. X# Ultrix Systems (preliminary - Ultrix V4.2a, Rev. 47)
  332. X#- - - - - - - - - - - - - - - - - - - -
  333. X# The following comments came with `sc'.
  334. X#       # For ULTRIX: define the BSD4.2 section and SIGVOID above
  335. X#       #   tdw@cl.cam.ac.uk tested on Ultrix 3.1C-0
  336. X# I'm not _quite_ listening to them.  Specifically: I use gcc and am
  337. X# using the System V curses -- cursesX -- in Ultrix.  Art Mulder
  338. X# CC            = /usr/gnu/bin/gcc
  339. X# CFLAGS        = -O -DULTRIX
  340. X# LIB           = -lm -lcursesX
  341. X# LDFLAGS       =
  342. X
  343. X# system V.2 (includes: HP-UX 7.05, UNIXPC)
  344. X#- - - - - - - - - - - - - - - - - - - -
  345. X#CFLAGS        = -O -DSYSV2 
  346. X#LDFLAGS    =
  347. X#LIB        =-lm -lPW -lcurses
  348. X# with gcc on a Sequent also use:
  349. X#CC        =att gcc
  350. X#CFLAGS        =  -DSYSV2 -g -pipe -traditional
  351. X
  352. X# system V.3
  353. X#- - - - - - - - - - - - - - - - - - - -
  354. X##CFLAGS    =  -DSYSV3 -O
  355. X##LDFLAGS    = -s
  356. X##CFLAGS    =  -DSYSV3 -g
  357. X##LDFLAGS    = -g
  358. X##LIB        =-lm -lcurses -lPW
  359. X
  360. X# with gcc also use:
  361. X#CC        =gcc
  362. X#CFLAGS        = -DSYSV3 -O -pipe -traditional
  363. X#YACC        =bison -y
  364. X# debugging bison (bison 1.16 is broken)
  365. X#CFLAGS=  -DSYSV3 -g -pipe -traditional
  366. X#YACC=bison -y -v -t -l
  367. X
  368. X
  369. X# system V.4
  370. X#- - - - - - - - - - - - - - - - - - - -
  371. X#CFLAGS        =  -DSYSV4 -DSYSV3 -O
  372. X#LDFLAGS    = -s
  373. X#LIB        =-lm -lcurses -lgen
  374. X# with gcc also use:
  375. X#CC        =gcc
  376. X#CFLAGS        =  -DSYSV3 -O -pipe
  377. X
  378. X# VENIX
  379. X#- - - - - - - - - - - - - - - - - - - -
  380. X#CFLAGS        = -DVENIX -DBSD42 -DV7
  381. X#LDFLAGS    = -z -i 
  382. X#LIB        =-lm -lcurses -ltermcap
  383. X
  384. X# XENIX Version 2.3
  385. X#- - - - - - - - - - - - - - - - - - - -
  386. X#CFLAGS        = -O -DSYSIII -DXENIX2_3
  387. X#LDFLAGS    = -i
  388. X#LIB        =-lm -lcurses -ltermcap
  389. X
  390. X# XENIX system III 
  391. X#- - - - - - - - - - - - - - - - - - - -
  392. X#CFLAGS        = -O -DSYSIII
  393. X#LDFLAGS    = -i
  394. X#LIB        =-lm -lcurses -ltermcap
  395. X
  396. X#
  397. X#       Some Definitions used in compiling/installing
  398. X#---------------------------------------------------------------------------
  399. X
  400. X# All of the source files
  401. XSRC=Makefile cmds.c crypt.c eres.sed format.c gram.y interp.c \
  402. X    lex.c pss.c range.c ss.c ss.h screen.c sres.sed version.c \
  403. X    vmtbl.c xmalloc.c ctrl.c disprange.c getinput.c \
  404. X        menu.c menu_file.c menu_edit.c menu_cell.c menu_rowcol.c \
  405. X        menu_name.c menu_misc.c menu_macro.c help.c
  406. X
  407. X# The objects
  408. XOBJS=cmds.o crypt.o format.o gram.o interp.o lex.o range.o ss.o \
  409. X    screen.o version.o vmtbl.o xmalloc.o ctrl.o \
  410. X        disprange.o getinput.o \
  411. X    menu.o menu_file.o menu_edit.o menu_cell.o menu_rowcol.o \
  412. X    menu_name.o menu_misc.o menu_macro.o help.o
  413. X
  414. X# The documents in the Archive
  415. XDOCS=README ss.man pss.doc VMS_NOTES torev build.com
  416. X
  417. X
  418. X#       MAIN MAKE TARGETS
  419. X#---------------------------------------------------------------------------
  420. X
  421. X# Default Make Target:  Make ``ss'' and ``pss''.
  422. X# Nothing is installed.
  423. X#- - - - - - - - - - - - - - - - - - - -
  424. X
  425. Xall:    $(name) p$(name) 
  426. X
  427. X
  428. X# Make ``ss''
  429. X#- - - - - - - - - - - - - - - - - - - -
  430. X
  431. X$(name):$(PAR)     $(OBJS)
  432. X    $(CC) ${LDFLAGS} ${OBJS} ${LIB} -o $(name)
  433. X
  434. X# Alternative link for MS-DOS
  435. X# $(name):     $(OBJS)
  436. X#    link ${LDFLAGS} ${OBJS},$(name),,${LIB};
  437. X
  438. X
  439. X# Make ``pss''
  440. X#- - - - - - - - - - - - - - - - - - - -
  441. X
  442. Xp$(name):    pss.c pvmtbl.o pxmalloc.o
  443. X    $(CC) $(CFLAGS) ${LDFLAGS} -o p$(name) pss.c pvmtbl.o pxmalloc.o ${PSCLIB}
  444. X
  445. X# Alternative link for MS-DOS (NB: MSC 5.1 has no getopt.c)
  446. X# p$(name):    pss.o pvmtbl.o pxmalloc.o getopt.o
  447. X#     link ${LDFLAGS} pss.o pvmtbl.o pxmalloc.o getopt.o,p$(name);
  448. X
  449. X# Documentation
  450. X#- - - - - - - - - - - - - - - - - - - -
  451. X
  452. X# 1) convert ``ss.man'' to ``ss.l''
  453. X#    - replace all occurances of ``pname'' with ``ss'' (or whatever
  454. X#      the NAME is above)
  455. X#    - insert the proper revision number
  456. X
  457. Xman:    ss.man
  458. X    name=$(name) NAME=$(NAME) LIBDIR=$(LIBDIR) sh torev ss.man > $(name).$(MANEXT)
  459. X
  460. X# - Do the same for ``pss.doc''
  461. Xpman:    pss.doc
  462. X    name=$(name) NAME=$(NAME) LIBDIR=$(LIBDIR) sh torev pss.doc > p$(name).$(MANEXT)
  463. X#      Make Install
  464. X#---------------------------------------------------------------------------
  465. X
  466. Xinstall: $(EXDIR)/$(name) $(EXDIR)/p$(name) \
  467. X     $(MANDIR)/$(name).$(MANEXT) $(MANDIR)/p$(name).$(MANEXT)
  468. X
  469. X$(EXDIR)/$(name): $(name)
  470. X    cp $(name) $(EXDIR)
  471. X    strip $(EXDIR)/$(name)
  472. X
  473. X$(EXDIR)/p$(name): p$(name)
  474. X    cp p$(name) $(EXDIR)
  475. X    strip $(EXDIR)/p$(name)
  476. X
  477. X$(MANDIR)/$(name).$(MANEXT): man
  478. X    cp $(name).$(MANEXT) $(MANDIR)/$(name).$(MANEXT)
  479. X    chmod $(MANMODE) $(MANDIR)/$(name).$(MANEXT)
  480. X
  481. X$(MANDIR)/p$(name).$(MANEXT): pman
  482. X    cp p$(name).$(MANEXT) $(MANDIR)/p$(name).$(MANEXT)
  483. X    chmod $(MANMODE) $(MANDIR)/p$(name).$(MANEXT)
  484. X
  485. X
  486. X#     SUPPLEMENTARY MAKE TARGETS
  487. X#---------------------------------------------------------------------------
  488. X# (These are usually not made directly themselves)
  489. X
  490. X
  491. X# ``ss'' supplementary objects
  492. X#- - - - - - - - - - - - - - - - - - - -
  493. X
  494. Xgram.c:    gram.y
  495. X    $(YACC) -d gram.y
  496. X    mv $(YTAB).c gram.c
  497. X
  498. X$(YTAB).h:    gram.y
  499. X
  500. Xcmds.o: cmds.c ss.h
  501. X    $(CC) ${CFLAGS} ${DOBACKUPS} ${CRYPT} -c cmds.c
  502. X
  503. Xcrypt.o: crypt.c ss.h
  504. X    $(CC) ${CFLAGS} ${CRYPT} ${DOBACKUPS} -c crypt.c
  505. X
  506. Xformat.o: format.c
  507. X
  508. Xinterp.o:    interp.c ss.h
  509. X    $(CC) ${CFLAGS} ${IEEE_MATH} ${SIGVOID} ${RINT} ${RE_COMP} ${REGCMP} ${FMOD} -c interp.c
  510. X
  511. Xgram.o:    ss.h $(YTAB).h gram.c
  512. X    $(CC) ${CFLAGS} -c gram.c
  513. X    sed < gram.y > experres.h -f eres.sed
  514. X    sed < gram.y > statres.h -f sres.sed
  515. X
  516. Xlex.o:    ss.h $(YTAB).h gram.o lex.c
  517. X    $(CC) ${CFLAGS} ${NOUNGETCH} ${SIMPLE} ${IEEE_MATH} ${SIGVOID} ${NONOTIMEOUT} -c lex.c
  518. X
  519. Xrange.o: range.c ss.h
  520. X
  521. Xss.o:    ss.h ss.c menu.h disprange.h ctrl.h
  522. X    $(CC) ${CFLAGS} ${DFLT_PAGER} $(RIGHTBUG) ${SIGVOID} ${SAVE} -c ss.c
  523. X
  524. Xdisprange.o:    ss.h disprange.c ctrl.h
  525. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c disprange.c
  526. X
  527. Xmenu.o:    ss.h menu.c ctrl.h menu_file.h menu_edit.h menu_cell.h\
  528. X    menu_rowcol.h menu_name.h menu_misc.h menu_macro.h
  529. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu.c
  530. X
  531. Xmenu_file.o:    ss.h menu_file.c getinput.h disprange.h
  532. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu_file.c
  533. X
  534. Xmenu_edit.o:    ss.h menu_edit.c getinput.h disprange.h
  535. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu_edit.c
  536. X
  537. Xmenu_cell.o:    ss.h menu_cell.c getinput.h 
  538. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu_cell.c
  539. X
  540. Xmenu_rowcol.o:    ss.h menu_rowcol.c getinput.h 
  541. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu_rowcol.c
  542. X
  543. Xmenu_misc.o:    ss.h menu_misc.c getinput.h 
  544. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu_misc.c
  545. X
  546. Xmenu_macro.o:    ss.h menu_macro.c getinput.h 
  547. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu_macro.c
  548. X
  549. Xmenu_name.o:    ss.h menu_name.c getinput.h 
  550. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu_name.c
  551. X
  552. Xgetinput.o:    ss.h getinput.h
  553. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c getinput.c
  554. X
  555. Xctrl.o:    ss.h ctrl.c ctrl.h menu.h disprange.h menu_cell.h menu_misc.h
  556. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c ctrl.c
  557. X
  558. Xscreen.o:    ss.h screen.c
  559. X    $(CC) ${CFLAGS} ${BROKENCURSES} ${IDLOKISBAD} ${INTERNATIONAL} ${RIGHTBUG} ${SIGVOID} -c screen.c
  560. X
  561. Xhelp.o: ss.h help.c
  562. X    $(CC) ${CFLAGS} -c help.c
  563. X
  564. X
  565. X# ``pss'' supplementary objects
  566. X#- - - - - - - - - - - - - - - - - - - -
  567. X
  568. Xpvmtbl.c: vmtbl.c
  569. X    -rm -f pvmtbl.c
  570. X    ${LN} vmtbl.c pvmtbl.c
  571. X
  572. Xpvmtbl.o: ss.h pvmtbl.c
  573. X    $(CC) ${CFLAGS} -c -DPSC pvmtbl.c
  574. X
  575. Xpxmalloc.c: xmalloc.c
  576. X    -rm -f pxmalloc.c
  577. X    ${LN} xmalloc.c pxmalloc.c
  578. X
  579. Xpxmalloc.o: ss.h pxmalloc.c
  580. X    $(CC) ${CFLAGS} -c -DPSC pxmalloc.c
  581. X
  582. X
  583. X#     OTHER MAKE TARGETS
  584. X#---------------------------------------------------------------------------
  585. X
  586. Xclean:
  587. X    rm -f *.o *res.h $(YTAB).h debug core gram.c $(name).$(MANEXT) \
  588. X    $(name).$(MANEXT) p$(name).man p$(name).$(MANEXT) y.output \
  589. X    pxmalloc.c pvmtbl.c qhelp.c y_tab.h
  590. X
  591. Xspotless: clean
  592. X    rm -f $(name) p$(name) 
  593. X
  594. X#---------------------------------------------------------------------------
  595. X#       end
  596. END_OF_FILE
  597.   if test 16608 -ne `wc -c <'ss_12b/Makefile'`; then
  598.     echo shar: \"'ss_12b/Makefile'\" unpacked with wrong size!
  599.   fi
  600.   # end of 'ss_12b/Makefile'
  601. fi
  602. if test -f 'ss_12b/Makefile.mips' -a "${1}" != "-c" ; then 
  603.   echo shar: Will not clobber existing file \"'ss_12b/Makefile.mips'\"
  604. else
  605.   echo shar: Extracting \"'ss_12b/Makefile.mips'\" \(16584 characters\)
  606.   sed "s/^X//" >'ss_12b/Makefile.mips' <<'END_OF_FILE'
  607. X#############################################################################
  608. X# Makefile $Revision: 6.21 $
  609. X#
  610. X# How to build the 'ss' package:
  611. X# 1) Read this Makefile, keeping an eye out for anything that appears to
  612. X#    have a bearing on your situation.
  613. X#
  614. X# 2) Customize these variables, to match the situation at your site:
  615. X#    EXDIR (path), MANDIR, MANEXT, LIBDIR, SIGVOID, RE_COMP/REGCMP, 
  616. X#    DFLT_PAGER, and FMOD. 
  617. X#
  618. X#    There are lost of other variables, but most shouldn't need to be
  619. X#    changed.  (If you followed #1, you probably already know that, and
  620. X#    have probably already changed any you think should be changed.)
  621. X#
  622. X# 3) Underneath the heading "SYSTEM DEFINES", below, there are sections
  623. X#    of code for many different machine/compiler/OS setups.  Select
  624. X#    the section that corresponds to your site, and:
  625. X#      (a) Uncomment it.
  626. X#      (b) Customize it, if needed.
  627. X#      (c) Ensure that all other System Defines are commented out.
  628. X#
  629. X# 4) "make"
  630. X#    This will build everything, but will not install it.  If you want
  631. X#    you can install the pieces yourself, or issue the "make install"
  632. X#    command.
  633. X#
  634. X# 4) If you have the command 'file' that uses /etc/magic you can
  635. X#    add the line:
  636. X#    38    string        Spreadsheet    sc/ss file
  637. X#############################################################################
  638. X
  639. X#
  640. X#       Commonly Changed Variables.  Modify as necessary for your site
  641. X#---------------------------------------------------------------------------
  642. X
  643. X# This is where the install step puts the executables.
  644. X# EXDIR        = /site/bin
  645. X  EXDIR        = /usr/local/bin
  646. X
  647. X# This is where the man page goes.
  648. X# MANDIR    = /usr/local/src/man/man1    # reno
  649. X# MANEXT    = 1                # reno
  650. X  MANDIR    = /usr/man/l_man/manl
  651. X  MANEXT    = l
  652. X  MANMODE    = 644
  653. X
  654. X# This is where the library file (tutorial) goes.
  655. X# LIBDIR    =/usr/local/share/$(name) # reno
  656. X  LIBDIR    = /usr/local/lib/$(name)
  657. X
  658. X# Set SIGVOID if signal routines are type void.
  659. X# use: SIGVOID=-DSIGVOID for:
  660. X#    System 5.3, SunOS 4.X, VMS, BSD4.4 (reno), and ANSI C Compliant systems
  661. X# use: SIGVOID=         for:
  662. X#  BSD systems (excluding reno, BSD4.4), and the UNIXPC 'cc'
  663. X  SIGVOID    =-DSIGVOID
  664. X# SIGVOID    =
  665. X
  666. X# Set RE_COMP if you have the re_comp/re_exec regular expression routines
  667. X# (most BSD based systems do).
  668. X# RE_COMP    =-DRE_COMP
  669. X  RE_COMP    =
  670. X
  671. X# Set REGCMP if you have the regcmp/regex regular expression routines
  672. X# (most System V based systems do)
  673. X# REGCMP    =-DREGCMP
  674. X  REGCMP    =
  675. X
  676. X# This is the name of a pager like "more".
  677. X# "pg" may be appropriate for SYSV.
  678. X  DFLT_PAGER    =-DDFLT_PAGER=\"less\"
  679. X# DFLT_PAGER    =-DDFLT_PAGER=\"more\"    # generic && reno
  680. X
  681. X# If you get errors about fmod being undefined when you try to
  682. X# compile, then define NO_FMOD (most likely BSD4.3 and Mt Xinu).
  683. X# FMOD        =-DNO_FMOD
  684. X  FMOD        =
  685. X
  686. X#
  687. X#       Variables which are NOT commonly changed.  
  688. X#---------------------------------------------------------------------------
  689. X
  690. X# Specify the name of the program.
  691. X# All documentation and installation keys on this value.
  692. X  name        = ss
  693. X  NAME        = SS
  694. X
  695. X# Set NOUNGETCH for lex.c if you don't have ungetch() in your
  696. X# curses library.
  697. X# NOUNGETCH = -DNOUNGETCH
  698. X  NOUNGETCH = 
  699. X
  700. X# Set SIMPLE for lex.c if you don't want arrow keys or lex.c blows up
  701. X  SIMPLE    =
  702. X# SIMPLE    =-DSIMPLE
  703. X
  704. X# Set BROKENCURSES if your curses has the nl/nonl bug
  705. X# if it does and you don't set BROKENCURSES, the display will
  706. X# be staggered across the screen. Also try IDLOKBAD below.
  707. X  BROKENCURSES    =
  708. X# BROKENCURSES    =-DBROKENCURSES
  709. X
  710. X# Set DOBACKUPS if you would like a backup copy of a source file on a save
  711. X# DOBACKUPS    =
  712. X  DOBACKUPS    =-DDOBACKUPS
  713. X
  714. X# Set INTERNATIONAL if you need 8 bit characters.  You should
  715. X# not set this if you are running 5.3.0.  I think it is OK in 5.3.1.
  716. X# INTERNATIONAL    =-DINTERNATIONAL
  717. X  INTERNATIONAL    =
  718. X
  719. X# Set IEEE_MATH if you need setsticky() calls in your signal handlers
  720. X# IEEE_MATH    =-DIEEE_MATH
  721. X  IEEE_MATH    =
  722. X
  723. X# Set RINT=-DRINT if you do not have rint() in math.h
  724. X# Set RINT=    on/with (they have rint):
  725. X#    SunOS 4.0.3c, 4.1.1 compiler
  726. X#    BSD4.4 (reno)
  727. X  RINT    =
  728. X# RINT    =-DRINT
  729. X
  730. X# this is the name to save back ups in
  731. X  SAVE        =-DSAVENAME=\"$(NAME).SAVE\"
  732. X
  733. X# Path to crypt, do NOT define if you don't have crypt.
  734. X# most systems:
  735. X##CRYPT        =-DCRYPT_PATH=\"/bin/crypt\"
  736. X# BSD:
  737. X# CRYPT        =-DCRYPT_PATH=\"/usr/bin/crypt\"
  738. X# other people?:
  739. X# CRYPT        =-DCRYPT_PATH=\"/usr/local/bin/crypt\"
  740. X
  741. X# If your system doesn't have notimeout() in curses define NONOTIMEOUT
  742. X  NO_NOTIMEOUT    =
  743. X# NO_NOTIMEOUT    =-DNONOTIMEOUT
  744. X
  745. X# flags for lint
  746. X  LINTFLAGS    =-abchxv
  747. X
  748. X## # Format of quick reference guide generated by $(name)qref
  749. X## # Leave undefined for normal text output.
  750. X## # QREF_FMT=
  751. X##   QREF_FMT=-DTROFF
  752. X
  753. X
  754. X# *** SPECIAL NOTES ***
  755. X# HP-UX 7.0: Do NOT use -O
  756. X#    (known broken, try sc's boolean operators if you wish)
  757. X#
  758. X# **** SYSV curses bugs... ****
  759. X# Try setting IDLOKBAD to fix (with an empty spreadsheet):
  760. X#    a) Redrawing the bottom half of the screen when you
  761. X#         move between row 9 <-> 10
  762. X#    b) the highlighted row labels being trash when you
  763. X#        move between row 9 <-> 10
  764. X#    c) On an xterm on Esix Rev. D+ from eating lines
  765. X#         -goto (or move) a few lines (or more) past the bottom
  766. X#         of the screen, goto (or move) to the top line on the
  767. X#         screen, move upward and the current line is deleted, the
  768. X#         others move up even when they should not, check by
  769. X#         noticing the rows become 2, 3, 40, 41, 42... (etc).
  770. X#    Known systems/terminfos w/ curses problems:
  771. X#    {Esix Rev. D+, AT&T SysV3.2.1}:at386-m,xterm, HP-UX7.0:(not sure)
  772. X  IDLOKISBAD    =-DIDLOKBAD
  773. X# IDLOKISBAD    =
  774. X
  775. X# If you don't have idlok() in your curses define NOIDLOK
  776. X  NO_IDLOK=
  777. X# NO_IDLOK=-DNOIDLOK
  778. X
  779. X# If moving right off the screen causes the screen to not redraw
  780. X# properly, define RIGHT_CBUG to get around a curses problem on some
  781. X# boxes, this forces screen redraws when going right off the screen
  782. X  RIGHTBUG    =
  783. X# RIGHTBUG    =-DRIGHT_CBUG
  784. X
  785. X# IF you have problems w/ your yacc try bison, Berkeley yacc, or
  786. X# some other yacc. Some systems don't allow you to
  787. X# increase the number of terminals (mostly AT&T), SCO's does though.
  788. X# NOTE: Do not use with bison 1.16! Get a new version...
  789. X# YACC        =yacc
  790. X  YACC        =bison -y
  791. X
  792. X# MS-DOS needs y_tab instead of the normal y.tab
  793. X# YTAB            =y_tab
  794. X  YTAB            =y.tab
  795. X
  796. X# Command to use to make temporary copies of some source files.
  797. X  LN        =ln
  798. X# LN        =ln -s
  799. X# LN        =cp
  800. X
  801. X#    SYSTEM DEFINES
  802. X#---------------------------------------------------------------------------
  803. X# Locate your System in the following ALPHABETICAL list of systems, and
  804. X# uncomment the defintions relating to it.  See the comments accompanying
  805. X# each system for further information.  
  806. X#
  807. X# **> Make sure that all other systems are commented out! <**
  808. X
  809. X# system AIX V3.1
  810. X#- - - - - - - - - - - - - - - - - - - -
  811. X#CFLAGS        = -O -DSYSV2 -DCHTYPE=int -DNLS
  812. X#LDFLAGS    =
  813. X#LIB        =-lm -lPW -lcurses
  814. X
  815. X# BSD 4.2
  816. X#- - - - - - - - - - - - - - - - - - - -
  817. X#CFLAGS        = -O -DBSD42
  818. X#LDFLAGS    =
  819. X#LIB        =-lm -lcurses -ltermcap
  820. X# with gcc also use:
  821. X#CC        =gcc
  822. X
  823. X# BSD 4.3
  824. X#- - - - - - - - - - - - - - - - - - - -
  825. X#CFLAGS        = -O -DBSD43
  826. X#LDFLAGS    =
  827. X#LIB        =-lm -lcurses -ltermcap
  828. X
  829. X# Microport
  830. X#- - - - - - - - - - - - - - - - - - - -
  831. X#CFLAGS        = -DSYSV2 -O -DUPORT -Ml
  832. X#LDFLAGS    =-Ml
  833. X#LIB        =-lm -lcurses -lPW
  834. X
  835. X# Mips (preliminary, based on System V.3 entry)
  836. X#- - - - - - - - - - - - - - - - - - - -
  837. X# On Mips use: "/usr/bsd43/bin/make"
  838. X# CC        = gcc
  839. X  CC        = cc
  840. X  CFLAGS    = -DSYSV3 -O -I/usr/include -I/usr/include/posix
  841. X  LDFLAGS    = -s
  842. X  YACC        = bison -y
  843. X  LIB        = -lm -lcurses -lPW
  844. X
  845. X# MS-DOS, Microsoft C 5.1 and NDMAKE
  846. X#- - - - - - - - - - - - - - - - - - - -
  847. X#CC        =cl
  848. X#CFLAGS        = -AL -O -Fo$*.o
  849. X#LDFLAGS    =/noi /st:0x4000
  850. X#LIB        =lcurses
  851. X#YACC        =bison -y
  852. X#
  853. X#.SUFFIXES : .o .c
  854. X#.c.o:
  855. X#    $(CC) $(CFLAGS) -c $*.c
  856. X
  857. X# SCO Unix V rel. 3.2.0
  858. X#- - - - - - - - - - - - - - - - - - - -
  859. X#       -compile using rcc, cc does not cope with gram.c
  860. X#       -edit /usr/include/curses.h, rcc does not understand #error
  861. X#       -link: make CC=cc, rcc's loader gets unresolved __cclass, __range
  862. X#               (rather strange,?)
  863. X#CC        =rcc
  864. X#CC        =cc
  865. X#CC        =gcc -fstrength-reduce
  866. X#SIGVOID    =-DSIGVOID
  867. X#CFLAGS        = -O -DSYSV3
  868. X#LDFLAGS    =
  869. X#LIB        =-lm -lcurses -ltinfo -lPW
  870. X#YACC        =yacc -Sm10000
  871. X
  872. X# SCO Unix 3.2.2 and ODT 1.1
  873. X#- - - - - - - - - - - - - - - - - - - -
  874. X#CC        =cc
  875. X#CFLAGS        = -O -DSYSV3
  876. X#LDFLAGS    =
  877. X#LIB        =-lm -lcurses -lPW -lmalloc -lc_s
  878. X#YACC        =yacc -Sm10000
  879. X
  880. X# Sequent boxes
  881. X#- - - - - - - - - - - - - - - - - - - -
  882. X#CC        =atscc
  883. X#CFLAGS        =-O -DBSD42
  884. X#LDFLAGS    = 
  885. X#LIB        =-lm -lcurses  -ltermcap
  886. X#PSCLIB        =-lseq
  887. X# with gcc also use:
  888. X#CC        =gcc
  889. X#CFLAGS        = -O -DBSD42 -pipe
  890. X
  891. X# Sun Systems
  892. X#- - - - - - - - - - - - - - - - - - - -
  893. X# Use this for SunOS 4.X if you have the System V package installed.
  894. X# This will link with the System V curses which is preferable to the
  895. X# BSD curses (especially helps scrolling on slow (9600bps or less)
  896. X# serial lines).
  897. X#
  898. X# Be sure to define SIGVOID and RE_COMP above.
  899. X# 
  900. X# CC        = /usr/5bin/cc
  901. X# CFLAGS    = -O -DSYSV3 
  902. X# LDFLAGS    =
  903. X# LIB        = -lm -lcurses 
  904. X
  905. X### Try gcc 2.0
  906. X# CC        = /usr/gnu/bin/gcc
  907. X# CFLAGS    = -O -DSYSV3  -I/usr/5include
  908. X# LDFLAGS    = -L/usr/5lib
  909. X
  910. X# Ultrix Systems (preliminary - Ultrix V4.2a, Rev. 47)
  911. X#- - - - - - - - - - - - - - - - - - - -
  912. X# The following comments came with `sc'.
  913. X#       # For ULTRIX: define the BSD4.2 section and SIGVOID above
  914. X#       #   tdw@cl.cam.ac.uk tested on Ultrix 3.1C-0
  915. X# I'm not _quite_ listening to them.  Specifically: I use gcc and am
  916. X# using the System V curses -- cursesX -- in Ultrix.  Art Mulder
  917. X# CC            = /usr/gnu/bin/gcc
  918. X# CFLAGS        = -O -DULTRIX
  919. X# LIB           = -lm -lcursesX
  920. X# LDFLAGS       =
  921. X
  922. X
  923. X# system V.2 (includes: HP-UX 7.05, UNIXPC)
  924. X#- - - - - - - - - - - - - - - - - - - -
  925. X#CFLAGS        = -O -DSYSV2 
  926. X#LDFLAGS    =
  927. X#LIB        =-lm -lPW -lcurses
  928. X# with gcc on a Sequent also use:
  929. X#CC        =att gcc
  930. X#CFLAGS        =  -DSYSV2 -g -pipe -traditional
  931. X
  932. X# system V.3
  933. X#- - - - - - - - - - - - - - - - - - - -
  934. X##CFLAGS    =  -DSYSV3 -O
  935. X# LDFLAGS    = -s
  936. X##CFLAGS    =  -DSYSV3 -g
  937. X##LDFLAGS    = -g
  938. X# LIB        =-lm -lcurses -lPW
  939. X
  940. X# with gcc also use:
  941. X# CC        = gcc
  942. X# CFLAGS    = -DSYSV3 -O -pipe -traditional
  943. X# YACC        = bison -y
  944. X# debugging bison (bison 1.16 is broken)
  945. X#CFLAGS=  -DSYSV3 -g -pipe -traditional
  946. X#YACC=bison -y -v -t -l
  947. X
  948. X
  949. X# system V.4
  950. X#- - - - - - - - - - - - - - - - - - - -
  951. X#CFLAGS        =  -DSYSV4 -DSYSV3 -O
  952. X#LDFLAGS    = -s
  953. X#LIB        =-lm -lcurses -lgen
  954. X# with gcc also use:
  955. X#CC        =gcc
  956. X#CFLAGS        =  -DSYSV3 -O -pipe
  957. X
  958. X# VENIX
  959. X#- - - - - - - - - - - - - - - - - - - -
  960. X#CFLAGS        = -DVENIX -DBSD42 -DV7
  961. X#LDFLAGS    = -z -i 
  962. X#LIB        =-lm -lcurses -ltermcap
  963. X
  964. X# XENIX Version 2.3
  965. X#- - - - - - - - - - - - - - - - - - - -
  966. X#CFLAGS        = -O -DSYSIII -DXENIX2_3
  967. X#LDFLAGS    = -i
  968. X#LIB        =-lm -lcurses -ltermcap
  969. X
  970. X# XENIX system III 
  971. X#- - - - - - - - - - - - - - - - - - - -
  972. X#CFLAGS        = -O -DSYSIII
  973. X#LDFLAGS    = -i
  974. X#LIB        =-lm -lcurses -ltermcap
  975. X
  976. X#
  977. X#       Some Definitions used in compiling/installing
  978. X#---------------------------------------------------------------------------
  979. X
  980. X# All of the source files
  981. XSRC=Makefile cmds.c crypt.c eres.sed format.c gram.y interp.c \
  982. X    lex.c pss.c range.c ss.c ss.h screen.c sres.sed version.c \
  983. X    vmtbl.c xmalloc.c ctrl.c disprange.c getinput.c \
  984. X        menu.c menu_file.c menu_edit.c menu_cell.c menu_rowcol.c \
  985. X        menu_name.c menu_misc.c menu_macro.c help.c
  986. X
  987. X# The objects
  988. XOBJS=cmds.o crypt.o format.o gram.o interp.o lex.o range.o ss.o \
  989. X    screen.o version.o vmtbl.o xmalloc.o ctrl.o \
  990. X        disprange.o getinput.o \
  991. X    menu.o menu_file.o menu_edit.o menu_cell.o menu_rowcol.o \
  992. X    menu_name.o menu_misc.o menu_macro.o help.o
  993. X
  994. X# The documents in the Archive
  995. XDOCS=README ss.man pss.doc VMS_NOTES torev build.com
  996. X
  997. X
  998. X#       MAIN MAKE TARGETS
  999. X#---------------------------------------------------------------------------
  1000. X
  1001. X# Default Make Target:  Make ``ss'' and ``pss''.
  1002. X# Nothing is installed.
  1003. X#- - - - - - - - - - - - - - - - - - - -
  1004. X
  1005. Xall:    $(name) p$(name) 
  1006. X
  1007. X
  1008. X# Make ``ss''
  1009. X#- - - - - - - - - - - - - - - - - - - -
  1010. X
  1011. X$(name):$(PAR)     $(OBJS)
  1012. X    $(CC) ${LDFLAGS} ${OBJS} ${LIB} -o $(name)
  1013. X
  1014. X# Alternative link for MS-DOS
  1015. X# $(name):     $(OBJS)
  1016. X#    link ${LDFLAGS} ${OBJS},$(name),,${LIB};
  1017. X
  1018. X
  1019. X# Make ``pss''
  1020. X#- - - - - - - - - - - - - - - - - - - -
  1021. X
  1022. Xp$(name):    pss.c pvmtbl.o pxmalloc.o
  1023. X    $(CC) $(CFLAGS) ${LDFLAGS} -o p$(name) pss.c pvmtbl.o pxmalloc.o ${PSCLIB}
  1024. X
  1025. X# Alternative link for MS-DOS (NB: MSC 5.1 has no getopt.c)
  1026. X# p$(name):    pss.o pvmtbl.o pxmalloc.o getopt.o
  1027. X#     link ${LDFLAGS} pss.o pvmtbl.o pxmalloc.o getopt.o,p$(name);
  1028. X
  1029. X# Documentation
  1030. X#- - - - - - - - - - - - - - - - - - - -
  1031. X
  1032. X# 1) convert ``ss.man'' to ``ss.l''
  1033. X#    - replace all occurances of ``pname'' with ``ss'' (or whatever
  1034. X#      the NAME is above)
  1035. X#    - insert the proper revision number
  1036. X
  1037. Xman:    ss.man
  1038. X    name=$(name) NAME=$(NAME) LIBDIR=$(LIBDIR) sh torev ss.man > $(name).$(MANEXT)
  1039. X
  1040. X# - Do the same for ``pss.doc''
  1041. Xpman:    pss.doc
  1042. X    name=$(name) NAME=$(NAME) LIBDIR=$(LIBDIR) sh torev pss.doc > p$(name).$(MANEXT)
  1043. X#      Make Install
  1044. X#---------------------------------------------------------------------------
  1045. X
  1046. Xinstall: $(EXDIR)/$(name) $(EXDIR)/p$(name) \
  1047. X     $(MANDIR)/$(name).$(MANEXT) $(MANDIR)/p$(name).$(MANEXT)
  1048. X
  1049. X$(EXDIR)/$(name): $(name)
  1050. X    cp $(name) $(EXDIR)
  1051. X    strip $(EXDIR)/$(name)
  1052. X
  1053. X$(EXDIR)/p$(name): p$(name)
  1054. X    cp p$(name) $(EXDIR)
  1055. X    strip $(EXDIR)/p$(name)
  1056. X
  1057. X$(MANDIR)/$(name).$(MANEXT): man
  1058. X    cp $(name).$(MANEXT) $(MANDIR)/$(name).$(MANEXT)
  1059. X    chmod $(MANMODE) $(MANDIR)/$(name).$(MANEXT)
  1060. X
  1061. X$(MANDIR)/p$(name).$(MANEXT): pman
  1062. X    cp p$(name).$(MANEXT) $(MANDIR)/p$(name).$(MANEXT)
  1063. X    chmod $(MANMODE) $(MANDIR)/p$(name).$(MANEXT)
  1064. X
  1065. X
  1066. X#     SUPPLEMENTARY MAKE TARGETS
  1067. X#---------------------------------------------------------------------------
  1068. X# (These are usually not made directly themselves)
  1069. X
  1070. X
  1071. X# ``ss'' supplementary objects
  1072. X#- - - - - - - - - - - - - - - - - - - -
  1073. X
  1074. Xgram.c:    gram.y
  1075. X    $(YACC) -d gram.y
  1076. X    mv $(YTAB).c gram.c
  1077. X
  1078. X$(YTAB).h:    gram.y
  1079. X
  1080. Xcmds.o: cmds.c ss.h
  1081. X    $(CC) ${CFLAGS} ${DOBACKUPS} ${CRYPT} -c cmds.c
  1082. X
  1083. Xcrypt.o: crypt.c ss.h
  1084. X    $(CC) ${CFLAGS} ${CRYPT} ${DOBACKUPS} -c crypt.c
  1085. X
  1086. Xformat.o: format.c
  1087. X
  1088. Xinterp.o:    interp.c ss.h
  1089. X    $(CC) ${CFLAGS} ${IEEE_MATH} ${SIGVOID} ${RINT} ${RE_COMP} ${REGCMP} ${FMOD} -c interp.c
  1090. X
  1091. X# default sed (gnu sed) dies on the mips
  1092. Xgram.o:    ss.h $(YTAB).h gram.c
  1093. X    $(CC) ${CFLAGS} -c gram.c
  1094. X    /bin/sed < gram.y > experres.h -f eres.sed
  1095. X    /bin/sed < gram.y > statres.h -f sres.sed
  1096. X
  1097. Xlex.o:    ss.h $(YTAB).h gram.o lex.c
  1098. X    $(CC) ${CFLAGS} ${NOUNGETCH} ${SIMPLE} ${IEEE_MATH} ${SIGVOID} ${NONOTIMEOUT} -c lex.c
  1099. X
  1100. Xrange.o: range.c ss.h
  1101. X
  1102. Xss.o:    ss.h ss.c menu.h disprange.h ctrl.h
  1103. X    $(CC) ${CFLAGS} ${DFLT_PAGER} $(RIGHTBUG) ${SIGVOID} ${SAVE} -c ss.c
  1104. X
  1105. Xdisprange.o:    ss.h disprange.c ctrl.h
  1106. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c disprange.c
  1107. X
  1108. Xmenu.o:    ss.h menu.c ctrl.h menu_file.h menu_edit.h menu_cell.h\
  1109. X    menu_rowcol.h menu_name.h menu_misc.h menu_macro.h
  1110. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu.c
  1111. X
  1112. Xmenu_file.o:    ss.h menu_file.c getinput.h disprange.h
  1113. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu_file.c
  1114. X
  1115. Xmenu_edit.o:    ss.h menu_edit.c getinput.h disprange.h
  1116. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu_edit.c
  1117. X
  1118. Xmenu_cell.o:    ss.h menu_cell.c getinput.h 
  1119. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu_cell.c
  1120. X
  1121. Xmenu_rowcol.o:    ss.h menu_rowcol.c getinput.h 
  1122. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu_rowcol.c
  1123. X
  1124. Xmenu_misc.o:    ss.h menu_misc.c getinput.h 
  1125. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu_misc.c
  1126. X
  1127. Xmenu_macro.o:    ss.h menu_macro.c getinput.h 
  1128. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu_macro.c
  1129. X
  1130. Xmenu_name.o:    ss.h menu_name.c getinput.h 
  1131. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu_name.c
  1132. X
  1133. Xgetinput.o:    ss.h getinput.h
  1134. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c getinput.c
  1135. X
  1136. Xctrl.o:    ss.h ctrl.c ctrl.h menu.h disprange.h menu_cell.h menu_misc.h
  1137. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c ctrl.c
  1138. X
  1139. Xscreen.o:    ss.h screen.c
  1140. X    $(CC) ${CFLAGS} ${BROKENCURSES} ${IDLOKISBAD} ${INTERNATIONAL} ${RIGHTBUG} ${SIGVOID} -c screen.c
  1141. X
  1142. Xhelp.o: ss.h help.c
  1143. X    $(CC) ${CFLAGS} -c help.c
  1144. X
  1145. X
  1146. X# ``pss'' supplementary objects
  1147. X#- - - - - - - - - - - - - - - - - - - -
  1148. X
  1149. Xpvmtbl.c: vmtbl.c
  1150. X    -rm -f pvmtbl.c
  1151. X    ${LN} vmtbl.c pvmtbl.c
  1152. X
  1153. Xpvmtbl.o: ss.h pvmtbl.c
  1154. X    $(CC) ${CFLAGS} -c -DPSC pvmtbl.c
  1155. X
  1156. Xpxmalloc.c: xmalloc.c
  1157. X    -rm -f pxmalloc.c
  1158. X    ${LN} xmalloc.c pxmalloc.c
  1159. X
  1160. Xpxmalloc.o: ss.h pxmalloc.c
  1161. X    $(CC) ${CFLAGS} -c -DPSC pxmalloc.c
  1162. X
  1163. X
  1164. X#     OTHER MAKE TARGETS
  1165. X#---------------------------------------------------------------------------
  1166. X
  1167. Xclean:
  1168. X    rm -f *.o *res.h $(YTAB).h debug core gram.c $(name).$(MANEXT) \
  1169. X    $(name).$(MANEXT) p$(name).man p$(name).$(MANEXT) y.output \
  1170. X    pxmalloc.c pvmtbl.c qhelp.c y_tab.h
  1171. X
  1172. Xspotless: clean
  1173. X    rm -f $(name) p$(name) 
  1174. X
  1175. X#---------------------------------------------------------------------------
  1176. X#       end
  1177. END_OF_FILE
  1178.   if test 16584 -ne `wc -c <'ss_12b/Makefile.mips'`; then
  1179.     echo shar: \"'ss_12b/Makefile.mips'\" unpacked with wrong size!
  1180.   fi
  1181.   # end of 'ss_12b/Makefile.mips'
  1182. fi
  1183. if test -f 'ss_12b/Makefile.sgi' -a "${1}" != "-c" ; then 
  1184.   echo shar: Will not clobber existing file \"'ss_12b/Makefile.sgi'\"
  1185. else
  1186.   echo shar: Extracting \"'ss_12b/Makefile.sgi'\" \(16755 characters\)
  1187.   sed "s/^X//" >'ss_12b/Makefile.sgi' <<'END_OF_FILE'
  1188. X#############################################################################
  1189. X# Makefile $Revision: 6.21 $
  1190. X#
  1191. X# How to build the 'ss' package:
  1192. X# 1) Read this Makefile, keeping an eye out for anything that appears to
  1193. X#    have a bearing on your situation.
  1194. X#
  1195. X# 2) Customize these variables, to match the situation at your site:
  1196. X#    EXDIR (path), MANDIR, MANEXT, LIBDIR, SIGVOID, RE_COMP/REGCMP, 
  1197. X#    DFLT_PAGER, and FMOD. 
  1198. X#
  1199. X#    There are lost of other variables, but most shouldn't need to be
  1200. X#    changed.  (If you followed #1, you probably already know that, and
  1201. X#    have probably already changed any you think should be changed.)
  1202. X#
  1203. X# 3) Underneath the heading "SYSTEM DEFINES", below, there are sections
  1204. X#    of code for many different machine/compiler/OS setups.  Select
  1205. X#    the section that corresponds to your site, and:
  1206. X#      (a) Uncomment it.
  1207. X#      (b) Customize it, if needed.
  1208. X#      (c) Ensure that all other System Defines are commented out.
  1209. X#
  1210. X# 4) "make"
  1211. X#    This will build everything, but will not install it.  If you want
  1212. X#    you can install the pieces yourself, or issue the "make install"
  1213. X#    command.  ( "make man" will build the ss man page )
  1214. X#
  1215. X# 5) If you have the command 'file' that uses /etc/magic you can
  1216. X#    add the line to /etc/magic:
  1217. X#    38    string        Spreadsheet    sc/ss file
  1218. X#############################################################################
  1219. X
  1220. X#
  1221. X#       Commonly Changed Variables.  Modify as necessary for your site
  1222. X#---------------------------------------------------------------------------
  1223. X
  1224. X# This is where the install step puts the executables.
  1225. X# EXDIR        = /site/bin
  1226. X  EXDIR        = /usr/local/bin
  1227. X
  1228. X# This is where the man page goes.
  1229. X# MANDIR    = /usr/local/src/man/man1    # reno
  1230. X# MANEXT    = 1                # reno
  1231. X  MANDIR    = /usr/man/manl
  1232. X  MANEXT    = l
  1233. X  MANMODE    = 644
  1234. X
  1235. X# This is where the library file (tutorial) goes.
  1236. X# LIBDIR    =/usr/local/share/$(name) # reno
  1237. X  LIBDIR    = /usr/local/lib/$(name)
  1238. X
  1239. X# Set SIGVOID if signal routines are type void.
  1240. X# use: SIGVOID=-DSIGVOID for:
  1241. X#    System 5.3, SunOS 4.X, VMS, BSD4.4 (reno), and ANSI C Compliant systems
  1242. X# use: SIGVOID=         for:
  1243. X#  BSD systems (excluding reno, BSD4.4), and the UNIXPC 'cc'
  1244. X  SIGVOID    =-DSIGVOID
  1245. X# SIGVOID    =
  1246. X
  1247. X# Set RE_COMP if you have the re_comp/re_exec regular expression routines
  1248. X# (most BSD based systems do).
  1249. X  RE_COMP    =-DRE_COMP
  1250. X##RE_COMP    =
  1251. X
  1252. X# Set REGCMP if you have the regcmp/regex regular expression routines
  1253. X# (most System V based systems do)
  1254. X# REGCMP    =-DREGCMP
  1255. X  REGCMP    =
  1256. X
  1257. X# This is the name of a pager like "more".
  1258. X# "pg" may be appropriate for SYSV.
  1259. X  DFLT_PAGER    =-DDFLT_PAGER=\"less\"
  1260. X# DFLT_PAGER    =-DDFLT_PAGER=\"more\"    # generic && reno
  1261. X
  1262. X# If you get errors about fmod being undefined when you try to
  1263. X# compile, then define NO_FMOD (most likely BSD4.3 and Mt Xinu).
  1264. X  FMOD        =-DNO_FMOD
  1265. X# FMOD        =
  1266. X
  1267. X#
  1268. X#       Variables which are NOT commonly changed.  
  1269. X#---------------------------------------------------------------------------
  1270. X
  1271. X# Specify the name of the program.
  1272. X# All documentation and installation keys on this value.
  1273. X  name        = ss
  1274. X  NAME        = SS
  1275. X
  1276. X# Set NOUNGETCH for lex.c if you don't have ungetch() in your
  1277. X# curses library.
  1278. X# NOUNGETCH = -DNOUNGETCH
  1279. X  NOUNGETCH = 
  1280. X
  1281. X# Set SIMPLE for lex.c if you don't want arrow keys or lex.c blows up
  1282. X  SIMPLE    =
  1283. X# SIMPLE    =-DSIMPLE
  1284. X
  1285. X# Set BROKENCURSES if your curses has the nl/nonl bug
  1286. X# if it does and you don't set BROKENCURSES, the display will
  1287. X# be staggered across the screen. Also try IDLOKBAD below.
  1288. X  BROKENCURSES    =
  1289. X# BROKENCURSES    =-DBROKENCURSES
  1290. X
  1291. X# Set DOBACKUPS if you would like a backup copy of a source file on a save
  1292. X# DOBACKUPS    =
  1293. X  DOBACKUPS    =-DDOBACKUPS
  1294. X
  1295. X# Set INTERNATIONAL if you need 8 bit characters.  You should
  1296. X# not set this if you are running 5.3.0.  I think it is OK in 5.3.1.
  1297. X# INTERNATIONAL    =-DINTERNATIONAL
  1298. X  INTERNATIONAL    =
  1299. X
  1300. X# Set IEEE_MATH if you need setsticky() calls in your signal handlers
  1301. X# IEEE_MATH    =-DIEEE_MATH
  1302. X  IEEE_MATH    =
  1303. X
  1304. X# Set RINT=-DRINT if you do not have rint() in math.h
  1305. X# Set RINT=    on/with (they have rint):
  1306. X#    SunOS 4.0.3c, 4.1.1 compiler
  1307. X#    BSD4.4 (reno)
  1308. X  RINT    =
  1309. X# RINT    =-DRINT
  1310. X
  1311. X# this is the name to save back ups in
  1312. X  SAVE        =-DSAVENAME=\"$(NAME).SAVE\"
  1313. X
  1314. X# Path to crypt, do NOT define if you don't have crypt.
  1315. X# most systems:
  1316. X##CRYPT        =-DCRYPT_PATH=\"/bin/crypt\"
  1317. X# BSD:
  1318. X# CRYPT        =-DCRYPT_PATH=\"/usr/bin/crypt\"
  1319. X# other people?:
  1320. X# CRYPT        =-DCRYPT_PATH=\"/usr/local/bin/crypt\"
  1321. X
  1322. X# If your system doesn't have notimeout() in curses define NONOTIMEOUT
  1323. X  NO_NOTIMEOUT    =
  1324. X# NO_NOTIMEOUT    =-DNONOTIMEOUT
  1325. X
  1326. X# flags for lint
  1327. X  LINTFLAGS    =-abchxv
  1328. X
  1329. X## # Format of quick reference guide generated by $(name)qref
  1330. X## # Leave undefined for normal text output.
  1331. X## # QREF_FMT=
  1332. X##   QREF_FMT=-DTROFF
  1333. X
  1334. X
  1335. X# *** SPECIAL NOTES ***
  1336. X# HP-UX 7.0: Do NOT use -O
  1337. X#    (known broken, try sc's boolean operators if you wish)
  1338. X#
  1339. X# **** SYSV curses bugs... ****
  1340. X# Try setting IDLOKBAD to fix (with an empty spreadsheet):
  1341. X#    a) Redrawing the bottom half of the screen when you
  1342. X#         move between row 9 <-> 10
  1343. X#    b) the highlighted row labels being trash when you
  1344. X#        move between row 9 <-> 10
  1345. X#    c) On an xterm on Esix Rev. D+ from eating lines
  1346. X#         -goto (or move) a few lines (or more) past the bottom
  1347. X#         of the screen, goto (or move) to the top line on the
  1348. X#         screen, move upward and the current line is deleted, the
  1349. X#         others move up even when they should not, check by
  1350. X#         noticing the rows become 2, 3, 40, 41, 42... (etc).
  1351. X#    Known systems/terminfos w/ curses problems:
  1352. X#    {Esix Rev. D+, AT&T SysV3.2.1}:at386-m,xterm, HP-UX7.0:(not sure)
  1353. X  IDLOKISBAD    =-DIDLOKBAD
  1354. X# IDLOKISBAD    =
  1355. X
  1356. X# If you don't have idlok() in your curses define NOIDLOK
  1357. X  NO_IDLOK=
  1358. X# NO_IDLOK=-DNOIDLOK
  1359. X
  1360. X# If moving right off the screen causes the screen to not redraw
  1361. X# properly, define RIGHT_CBUG to get around a curses problem on some
  1362. X# boxes, this forces screen redraws when going right off the screen
  1363. X  RIGHTBUG    =
  1364. X# RIGHTBUG    =-DRIGHT_CBUG
  1365. X
  1366. X# IF you have problems w/ your yacc try bison, Berkeley yacc, or
  1367. X# some other yacc. Some systems don't allow you to
  1368. X# increase the number of terminals (mostly AT&T), SCO's does though.
  1369. X# NOTE: Do not use with bison 1.16! Get a new version...
  1370. X# YACC        =yacc
  1371. X  YACC        =bison -y
  1372. X
  1373. X# MS-DOS needs y_tab instead of the normal y.tab
  1374. X# YTAB            =y_tab
  1375. X  YTAB            =y.tab
  1376. X
  1377. X# Command to use to make temporary copies of some source files.
  1378. X  LN        =ln
  1379. X# LN        =ln -s
  1380. X# LN        =cp
  1381. X
  1382. X#    SYSTEM DEFINES
  1383. X#---------------------------------------------------------------------------
  1384. X# Locate your System in the following ALPHABETICAL list of systems, and
  1385. X# uncomment the defintions relating to it.  See the comments accompanying
  1386. X# each system for further information.  
  1387. X#
  1388. X# **> Make sure that all other systems are commented out! <**
  1389. X
  1390. X# system AIX V3.1
  1391. X#- - - - - - - - - - - - - - - - - - - -
  1392. X#CFLAGS        = -O -DSYSV2 -DCHTYPE=int -DNLS
  1393. X#LDFLAGS    =
  1394. X#LIB        =-lm -lPW -lcurses
  1395. X
  1396. X# BSD 4.2
  1397. X#- - - - - - - - - - - - - - - - - - - -
  1398. X#CFLAGS        = -O -DBSD42
  1399. X#LDFLAGS    =
  1400. X#LIB        =-lm -lcurses -ltermcap
  1401. X# with gcc also use:
  1402. X#CC        =gcc
  1403. X
  1404. X# BSD 4.3
  1405. X#- - - - - - - - - - - - - - - - - - - -
  1406. X#CFLAGS        = -O -DBSD43
  1407. X#LDFLAGS    =
  1408. X#LIB        =-lm -lcurses -ltermcap
  1409. X
  1410. X# Microport
  1411. X#- - - - - - - - - - - - - - - - - - - -
  1412. X#CFLAGS        = -DSYSV2 -O -DUPORT -Ml
  1413. X#LDFLAGS    =-Ml
  1414. X#LIB        =-lm -lcurses -lPW
  1415. X
  1416. X# Mips (preliminary, based on System V.3 entry)
  1417. X#- - - - - - - - - - - - - - - - - - - -
  1418. X# On Mips use: "/usr/bsd43/bin/make"
  1419. X# CC            = gcc
  1420. X# CFLAGS        = -DSYSV3 -O -I/usr/include -I/usr/include/posix
  1421. X# LDFLAGS       = -s
  1422. X# YACC          = bison -y
  1423. X# LIB           = -lm -lcurses -lPW
  1424. X
  1425. X# MS-DOS, Microsoft C 5.1 and NDMAKE
  1426. X#- - - - - - - - - - - - - - - - - - - -
  1427. X#CC        =cl
  1428. X#CFLAGS        = -AL -O -Fo$*.o
  1429. X#LDFLAGS    =/noi /st:0x4000
  1430. X#LIB        =lcurses
  1431. X#YACC        =bison -y
  1432. X#
  1433. X#.SUFFIXES : .o .c
  1434. X#.c.o:
  1435. X#    $(CC) $(CFLAGS) -c $*.c
  1436. X
  1437. X# SCO Unix V rel. 3.2.0
  1438. X#- - - - - - - - - - - - - - - - - - - -
  1439. X#       -compile using rcc, cc does not cope with gram.c
  1440. X#       -edit /usr/include/curses.h, rcc does not understand #error
  1441. X#       -link: make CC=cc, rcc's loader gets unresolved __cclass, __range
  1442. X#               (rather strange,?)
  1443. X#CC        =rcc
  1444. X#CC        =cc
  1445. X#CC        =gcc -fstrength-reduce
  1446. X#SIGVOID    =-DSIGVOID
  1447. X#CFLAGS        = -O -DSYSV3
  1448. X#LDFLAGS    =
  1449. X#LIB        =-lm -lcurses -ltinfo -lPW
  1450. X#YACC        =yacc -Sm10000
  1451. X
  1452. X# SCO Unix 3.2.2 and ODT 1.1
  1453. X#- - - - - - - - - - - - - - - - - - - -
  1454. X#CC        =cc
  1455. X#CFLAGS        = -O -DSYSV3
  1456. X#LDFLAGS    =
  1457. X#LIB        =-lm -lcurses -lPW -lmalloc -lc_s
  1458. X#YACC        =yacc -Sm10000
  1459. X
  1460. X# Sequent boxes
  1461. X#- - - - - - - - - - - - - - - - - - - -
  1462. X#CC        =atscc
  1463. X#CFLAGS        =-O -DBSD42
  1464. X#LDFLAGS    = 
  1465. X#LIB        =-lm -lcurses  -ltermcap
  1466. X#PSCLIB        =-lseq
  1467. X# with gcc also use:
  1468. X#CC        =gcc
  1469. X#CFLAGS        = -O -DBSD42 -pipe
  1470. X
  1471. X# Silicon Graphics (Preliminary)
  1472. X#- - - - - - - - - - - - - - - - - - - -
  1473. X  CC        = /usr/gnu/bin/gcc
  1474. X  CFLAGS    = -O -DSYSV3  
  1475. X  LIB        = -lm -lcurses 
  1476. X
  1477. X# Sun Systems
  1478. X#- - - - - - - - - - - - - - - - - - - -
  1479. X# Use this for SunOS 4.X if you have the System V package installed.
  1480. X# This will link with the System V curses which is preferable to the
  1481. X# BSD curses (especially helps scrolling on slow (9600bps or less)
  1482. X# serial lines).
  1483. X#
  1484. X# Be sure to define SIGVOID and RE_COMP above.
  1485. X# 
  1486. X# CC        = /usr/5bin/cc
  1487. X# CFLAGS    = -O -DSYSV3 
  1488. X# LDFLAGS    =
  1489. X# LIB        = -lm -lcurses 
  1490. X
  1491. X### Try gcc 2.0
  1492. X# CC        = /usr/gnu/bin/gcc
  1493. X# CFLAGS    = -O -DSYSV3  -I/usr/5include
  1494. X# LDFLAGS    = -L/usr/5lib
  1495. X
  1496. X# Ultrix Systems (preliminary - Ultrix V4.2a, Rev. 47)
  1497. X#- - - - - - - - - - - - - - - - - - - -
  1498. X# The following comments came with `sc'.
  1499. X#       # For ULTRIX: define the BSD4.2 section and SIGVOID above
  1500. X#       #   tdw@cl.cam.ac.uk tested on Ultrix 3.1C-0
  1501. X# I'm not _quite_ listening to them.  Specifically: I use gcc and am
  1502. X# using the System V curses -- cursesX -- in Ultrix.  Art Mulder
  1503. X# CC            = /usr/gnu/bin/gcc
  1504. X# CFLAGS        = -O -DULTRIX
  1505. X# LIB           = -lm -lcursesX
  1506. X# LDFLAGS       =
  1507. X
  1508. X# system V.2 (includes: HP-UX 7.05, UNIXPC)
  1509. X#- - - - - - - - - - - - - - - - - - - -
  1510. X#CFLAGS        = -O -DSYSV2 
  1511. X#LDFLAGS    =
  1512. X#LIB        =-lm -lPW -lcurses
  1513. X# with gcc on a Sequent also use:
  1514. X#CC        =att gcc
  1515. X#CFLAGS        =  -DSYSV2 -g -pipe -traditional
  1516. X
  1517. X# system V.3
  1518. X#- - - - - - - - - - - - - - - - - - - -
  1519. X##CFLAGS    =  -DSYSV3 -O
  1520. X##LDFLAGS    = -s
  1521. X##CFLAGS    =  -DSYSV3 -g
  1522. X##LDFLAGS    = -g
  1523. X##LIB        =-lm -lcurses -lPW
  1524. X
  1525. X# with gcc also use:
  1526. X#CC        =gcc
  1527. X#CFLAGS        = -DSYSV3 -O -pipe -traditional
  1528. X#YACC        =bison -y
  1529. X# debugging bison (bison 1.16 is broken)
  1530. X#CFLAGS=  -DSYSV3 -g -pipe -traditional
  1531. X#YACC=bison -y -v -t -l
  1532. X
  1533. X
  1534. X# system V.4
  1535. X#- - - - - - - - - - - - - - - - - - - -
  1536. X#CFLAGS        =  -DSYSV4 -DSYSV3 -O
  1537. X#LDFLAGS    = -s
  1538. X#LIB        =-lm -lcurses -lgen
  1539. X# with gcc also use:
  1540. X#CC        =gcc
  1541. X#CFLAGS        =  -DSYSV3 -O -pipe
  1542. X
  1543. X# VENIX
  1544. X#- - - - - - - - - - - - - - - - - - - -
  1545. X#CFLAGS        = -DVENIX -DBSD42 -DV7
  1546. X#LDFLAGS    = -z -i 
  1547. X#LIB        =-lm -lcurses -ltermcap
  1548. X
  1549. X# XENIX Version 2.3
  1550. X#- - - - - - - - - - - - - - - - - - - -
  1551. X#CFLAGS        = -O -DSYSIII -DXENIX2_3
  1552. X#LDFLAGS    = -i
  1553. X#LIB        =-lm -lcurses -ltermcap
  1554. X
  1555. X# XENIX system III 
  1556. X#- - - - - - - - - - - - - - - - - - - -
  1557. X#CFLAGS        = -O -DSYSIII
  1558. X#LDFLAGS    = -i
  1559. X#LIB        =-lm -lcurses -ltermcap
  1560. X
  1561. X#
  1562. X#       Some Definitions used in compiling/installing
  1563. X#---------------------------------------------------------------------------
  1564. X
  1565. X# All of the source files
  1566. XSRC=Makefile cmds.c crypt.c eres.sed format.c gram.y interp.c \
  1567. X    lex.c pss.c range.c ss.c ss.h screen.c sres.sed version.c \
  1568. X    vmtbl.c xmalloc.c ctrl.c disprange.c getinput.c \
  1569. X        menu.c menu_file.c menu_edit.c menu_cell.c menu_rowcol.c \
  1570. X        menu_name.c menu_misc.c menu_macro.c help.c
  1571. X
  1572. X# The objects
  1573. XOBJS=cmds.o crypt.o format.o gram.o interp.o lex.o range.o ss.o \
  1574. X    screen.o version.o vmtbl.o xmalloc.o ctrl.o \
  1575. X        disprange.o getinput.o \
  1576. X    menu.o menu_file.o menu_edit.o menu_cell.o menu_rowcol.o \
  1577. X    menu_name.o menu_misc.o menu_macro.o help.o
  1578. X
  1579. X# The documents in the Archive
  1580. XDOCS=README ss.man pss.doc VMS_NOTES torev build.com
  1581. X
  1582. X
  1583. X#       MAIN MAKE TARGETS
  1584. X#---------------------------------------------------------------------------
  1585. X
  1586. X# Default Make Target:  Make ``ss'' and ``pss''.
  1587. X# Nothing is installed.
  1588. X#- - - - - - - - - - - - - - - - - - - -
  1589. X
  1590. Xall:    $(name) p$(name) 
  1591. X
  1592. X
  1593. X# Make ``ss''
  1594. X#- - - - - - - - - - - - - - - - - - - -
  1595. X
  1596. X$(name):$(PAR)     $(OBJS)
  1597. X    $(CC) ${LDFLAGS} ${OBJS} ${LIB} -o $(name)
  1598. X
  1599. X# Alternative link for MS-DOS
  1600. X# $(name):     $(OBJS)
  1601. X#    link ${LDFLAGS} ${OBJS},$(name),,${LIB};
  1602. X
  1603. X
  1604. X# Make ``pss''
  1605. X#- - - - - - - - - - - - - - - - - - - -
  1606. X
  1607. Xp$(name):    pss.c pvmtbl.o pxmalloc.o
  1608. X    $(CC) $(CFLAGS) ${LDFLAGS} -o p$(name) pss.c pvmtbl.o pxmalloc.o ${PSCLIB}
  1609. X
  1610. X# Alternative link for MS-DOS (NB: MSC 5.1 has no getopt.c)
  1611. X# p$(name):    pss.o pvmtbl.o pxmalloc.o getopt.o
  1612. X#     link ${LDFLAGS} pss.o pvmtbl.o pxmalloc.o getopt.o,p$(name);
  1613. X
  1614. X# Documentation
  1615. X#- - - - - - - - - - - - - - - - - - - -
  1616. X
  1617. X# 1) convert ``ss.man'' to ``ss.l''
  1618. X#    - replace all occurances of ``pname'' with ``ss'' (or whatever
  1619. X#      the NAME is above)
  1620. X#    - insert the proper revision number
  1621. X
  1622. Xman:    ss.man
  1623. X    name=$(name) NAME=$(NAME) LIBDIR=$(LIBDIR) sh torev ss.man > $(name).$(MANEXT)
  1624. X
  1625. X# - Do the same for ``pss.doc''
  1626. Xpman:    pss.doc
  1627. X    name=$(name) NAME=$(NAME) LIBDIR=$(LIBDIR) sh torev pss.doc > p$(name).$(MANEXT)
  1628. X#      Make Install
  1629. X#---------------------------------------------------------------------------
  1630. X
  1631. Xinstall: $(EXDIR)/$(name) $(EXDIR)/p$(name) \
  1632. X     $(MANDIR)/$(name).$(MANEXT) $(MANDIR)/p$(name).$(MANEXT)
  1633. X
  1634. X$(EXDIR)/$(name): $(name)
  1635. X    cp $(name) $(EXDIR)
  1636. X    strip $(EXDIR)/$(name)
  1637. X
  1638. X$(EXDIR)/p$(name): p$(name)
  1639. X    cp p$(name) $(EXDIR)
  1640. X    strip $(EXDIR)/p$(name)
  1641. X
  1642. X$(MANDIR)/$(name).$(MANEXT): man
  1643. X    cp $(name).$(MANEXT) $(MANDIR)/$(name).$(MANEXT)
  1644. X    chmod $(MANMODE) $(MANDIR)/$(name).$(MANEXT)
  1645. X
  1646. X$(MANDIR)/p$(name).$(MANEXT): pman
  1647. X    cp p$(name).$(MANEXT) $(MANDIR)/p$(name).$(MANEXT)
  1648. X    chmod $(MANMODE) $(MANDIR)/p$(name).$(MANEXT)
  1649. X
  1650. X
  1651. X#     SUPPLEMENTARY MAKE TARGETS
  1652. X#---------------------------------------------------------------------------
  1653. X# (These are usually not made directly themselves)
  1654. X
  1655. X
  1656. X# ``ss'' supplementary objects
  1657. X#- - - - - - - - - - - - - - - - - - - -
  1658. X
  1659. Xgram.c:    gram.y
  1660. X    $(YACC) -d gram.y
  1661. X    mv $(YTAB).c gram.c
  1662. X
  1663. X$(YTAB).h:    gram.y
  1664. X
  1665. Xcmds.o: cmds.c ss.h
  1666. X    $(CC) ${CFLAGS} ${DOBACKUPS} ${CRYPT} -c cmds.c
  1667. X
  1668. Xcrypt.o: crypt.c ss.h
  1669. X    $(CC) ${CFLAGS} ${CRYPT} ${DOBACKUPS} -c crypt.c
  1670. X
  1671. Xformat.o: format.c
  1672. X
  1673. Xinterp.o:    interp.c ss.h
  1674. X    $(CC) ${CFLAGS} ${IEEE_MATH} ${SIGVOID} ${RINT} ${RE_COMP} ${REGCMP} ${FMOD} -c interp.c
  1675. X
  1676. Xgram.o:    ss.h $(YTAB).h gram.c
  1677. X    $(CC) ${CFLAGS} -c gram.c
  1678. X    sed < gram.y > experres.h -f eres.sed
  1679. X    sed < gram.y > statres.h -f sres.sed
  1680. X
  1681. Xlex.o:    ss.h $(YTAB).h gram.o lex.c
  1682. X    $(CC) ${CFLAGS} ${NOUNGETCH} ${SIMPLE} ${IEEE_MATH} ${SIGVOID} ${NONOTIMEOUT} -c lex.c
  1683. X
  1684. Xrange.o: range.c ss.h
  1685. X
  1686. Xss.o:    ss.h ss.c menu.h disprange.h ctrl.h
  1687. X    $(CC) ${CFLAGS} ${DFLT_PAGER} $(RIGHTBUG) ${SIGVOID} ${SAVE} -c ss.c
  1688. X
  1689. Xdisprange.o:    ss.h disprange.c ctrl.h
  1690. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c disprange.c
  1691. X
  1692. Xmenu.o:    ss.h menu.c ctrl.h menu_file.h menu_edit.h menu_cell.h\
  1693. X    menu_rowcol.h menu_name.h menu_misc.h menu_macro.h
  1694. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu.c
  1695. X
  1696. Xmenu_file.o:    ss.h menu_file.c getinput.h disprange.h
  1697. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu_file.c
  1698. X
  1699. Xmenu_edit.o:    ss.h menu_edit.c getinput.h disprange.h
  1700. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu_edit.c
  1701. X
  1702. Xmenu_cell.o:    ss.h menu_cell.c getinput.h 
  1703. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu_cell.c
  1704. X
  1705. Xmenu_rowcol.o:    ss.h menu_rowcol.c getinput.h 
  1706. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu_rowcol.c
  1707. X
  1708. Xmenu_misc.o:    ss.h menu_misc.c getinput.h 
  1709. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu_misc.c
  1710. X
  1711. Xmenu_macro.o:    ss.h menu_macro.c getinput.h 
  1712. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu_macro.c
  1713. X
  1714. Xmenu_name.o:    ss.h menu_name.c getinput.h 
  1715. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c menu_name.c
  1716. X
  1717. Xgetinput.o:    ss.h getinput.h
  1718. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c getinput.c
  1719. X
  1720. Xctrl.o:    ss.h ctrl.c ctrl.h menu.h disprange.h menu_cell.h menu_misc.h
  1721. X    $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c ctrl.c
  1722. X
  1723. Xscreen.o:    ss.h screen.c
  1724. X    $(CC) ${CFLAGS} ${BROKENCURSES} ${IDLOKISBAD} ${INTERNATIONAL} ${RIGHTBUG} ${SIGVOID} -c screen.c
  1725. X
  1726. Xhelp.o: ss.h help.c
  1727. X    $(CC) ${CFLAGS} -c help.c
  1728. X
  1729. X
  1730. X# ``pss'' supplementary objects
  1731. X#- - - - - - - - - - - - - - - - - - - -
  1732. X
  1733. Xpvmtbl.c: vmtbl.c
  1734. X    -rm -f pvmtbl.c
  1735. X    ${LN} vmtbl.c pvmtbl.c
  1736. X
  1737. Xpvmtbl.o: ss.h pvmtbl.c
  1738. X    $(CC) ${CFLAGS} -c -DPSC pvmtbl.c
  1739. X
  1740. Xpxmalloc.c: xmalloc.c
  1741. X    -rm -f pxmalloc.c
  1742. X    ${LN} xmalloc.c pxmalloc.c
  1743. X
  1744. Xpxmalloc.o: ss.h pxmalloc.c
  1745. X    $(CC) ${CFLAGS} -c -DPSC pxmalloc.c
  1746. X
  1747. X
  1748. X#     OTHER MAKE TARGETS
  1749. X#---------------------------------------------------------------------------
  1750. X
  1751. Xclean:
  1752. X    rm -f *.o *res.h $(YTAB).h debug core gram.c $(name).$(MANEXT) \
  1753. X    $(name).$(MANEXT) p$(name).man p$(name).$(MANEXT) y.output \
  1754. X    pxmalloc.c pvmtbl.c qhelp.c y_tab.h
  1755. X
  1756. Xspotless: clean
  1757. X    rm -f $(name) p$(name) 
  1758. X
  1759. X#---------------------------------------------------------------------------
  1760. X#       end
  1761. END_OF_FILE
  1762.   if test 16755 -ne `wc -c <'ss_12b/Makefile.sgi'`; then
  1763.     echo shar: \"'ss_12b/Makefile.sgi'\" unpacked with wrong size!
  1764.   fi
  1765.   # end of 'ss_12b/Makefile.sgi'
  1766. fi
  1767. if test -f 'ss_12b/pss.c' -a "${1}" != "-c" ; then 
  1768.   echo shar: Will not clobber existing file \"'ss_12b/pss.c'\"
  1769. else
  1770.   echo shar: Extracting \"'ss_12b/pss.c'\" \(7238 characters\)
  1771.   sed "s/^X//" >'ss_12b/pss.c' <<'END_OF_FILE'
  1772. X/* Sc parse routine
  1773. X *
  1774. X * usage psc options
  1775. X * options:
  1776. X *   -L        Left justify strings.  Default is right justify.
  1777. X *   -r        Assemble data into rows first, not columns.
  1778. X *   -R    n    Increment by n between rows 
  1779. X *   -C n    Increment by n between columns
  1780. X *   -n n    Length of the row (column) should be n.
  1781. X *   -s v    Top left location in the spreadsheet should be v; eg, k5
  1782. X *   -d c       Use c as the delimiter between the fields.
  1783. X *   -k         Keep all delimiters - Default is strip multiple delimiters to 1.
  1784. X *   -f         suppress 'format' lines in output
  1785. X *   -S        Use strings vs numbers for numbers
  1786. X *   -P        Use numbers only when there is no [-+eE] (plain numbers only)
  1787. X *
  1788. X *  Author: Robert Bond
  1789. X *  Adjustments: Jeff Buhrt and Eric Putz
  1790. X */
  1791. Xchar *rev = "$Revision: 6.21 $";
  1792. X
  1793. X#include <ctype.h>
  1794. X#include <stdio.h>
  1795. X#include "ss.h"
  1796. X
  1797. X#define END    0
  1798. X#define NUM    1
  1799. X#define ALPHA    2
  1800. X#define SPACE    3
  1801. X#define EOL    4
  1802. X
  1803. Xextern char *optarg;
  1804. Xextern int   optind, getopt(), atoi();
  1805. Xchar    *coltoa();
  1806. Xchar    *progname;
  1807. Xint    getrow(), getcol(), scan();
  1808. X
  1809. X#ifdef SYSV3
  1810. Xextern void exit();
  1811. X#else
  1812. Xextern int exit();
  1813. X#endif
  1814. X
  1815. Xint *fwidth;
  1816. Xint *precision;
  1817. Xint maxcols;
  1818. Xint *realfmt;
  1819. X
  1820. X/* option flags reset */
  1821. Xint colfirst = FALSE;
  1822. Xint leftadj = FALSE;
  1823. Xint r0 = 0;
  1824. Xint c0 = 0;
  1825. Xint rinc = 1;
  1826. Xint cinc = 1;
  1827. Xint len = 20000;
  1828. Xchar delim1 = ' ';
  1829. Xchar delim2 = '\t';
  1830. Xint strip_delim = TRUE;
  1831. Xint drop_format = FALSE;
  1832. Xint strnums    = FALSE;
  1833. Xint plainnums    = FALSE;
  1834. X
  1835. Xchar token[1000];
  1836. X
  1837. Xmain(argc, argv)
  1838. Xint argc;
  1839. Xchar **argv;
  1840. X{
  1841. X    int curlen;
  1842. X    int curcol, coff;
  1843. X    int currow, roff;
  1844. X    int first;
  1845. X    int c;
  1846. X    register effr, effc;
  1847. X    int i,j;
  1848. X    register char *p;
  1849. X
  1850. X    progname = argv[0];
  1851. X    while ((c = getopt(argc, argv, "rfLks:R:C:n:d:SPv")) != EOF) {
  1852. X    switch(c) {
  1853. X    case 'r':
  1854. X        colfirst = TRUE;
  1855. X        break;
  1856. X    case 'L':
  1857. X        leftadj = TRUE;
  1858. X        break;
  1859. X    case 's':
  1860. X        c0 = getcol(optarg);
  1861. X        r0 = getrow(optarg);
  1862. X        break;
  1863. X    case 'R':
  1864. X        rinc = atoi(optarg);
  1865. X        break;
  1866. X    case 'C':
  1867. X        cinc = atoi(optarg);
  1868. X        break;
  1869. X    case 'n':
  1870. X        len = atoi(optarg);
  1871. X        break;
  1872. X    case 'd':
  1873. X        delim1 = optarg[0];
  1874. X        delim2 = '\0';
  1875. X        break;
  1876. X    case 'k':
  1877. X        strip_delim = FALSE;
  1878. X        break;
  1879. X    case 'f':
  1880. X        drop_format = TRUE;
  1881. X        break;
  1882. X    case 'S':
  1883. X        strnums = TRUE;
  1884. X        break;
  1885. X    case 'P':
  1886. X        plainnums = TRUE;
  1887. X        break;
  1888. X    case 'v':
  1889. X        (void) fprintf(stderr,"%s: %s\n", progname, rev);
  1890. X    default:
  1891. X        (void) fprintf(stderr,"Usage: %s [-rkfLSPv] [-s v] [-R i] [-C i] [-n i] [-d c]\n", progname);
  1892. X        exit(1);
  1893. X        }
  1894. X    }
  1895. X
  1896. X    if (optind < argc) {
  1897. X        (void) fprintf(stderr,"Usage: %s [-rL] [-s v] [-R i] [-C i] [-n i] [-d c]\n", progname);
  1898. X        exit(1);
  1899. X    }
  1900. X
  1901. X    /* setup the spreadsheet arrays */
  1902. X    if (!growtbl(GROWNEW, 0, 0))
  1903. X    exit(1);
  1904. X
  1905. X    curlen = 0;
  1906. X    curcol = c0; coff = 0;
  1907. X    currow = r0; roff = 0;
  1908. X    first = TRUE;
  1909. X
  1910. X    while(1) {
  1911. X
  1912. X    effr = currow+roff;
  1913. X    effc = curcol+coff;
  1914. X
  1915. X    switch(scan()) {
  1916. X    case END:
  1917. X        if(drop_format) exit(0);
  1918. X        for (i = 0; i<maxcols; i++) {
  1919. X        if (fwidth[i])
  1920. X            (void) printf("format %s %d %d\n", coltoa(i), 
  1921. X            fwidth[i]+1, precision[i]);
  1922. X        }
  1923. X        exit(0);
  1924. X    case NUM:
  1925. X        first = FALSE;
  1926. X        (void) printf("let %s%d = %s\n", coltoa(effc), effr, token);
  1927. X        if (effc >= maxcols - 1)
  1928. X        {    if (!growtbl(GROWCOL, 0, effc))
  1929. X        {    (void) fprintf(stderr, "Invalid column used: %s\n", coltoa(effc));
  1930. X            continue;
  1931. X        }
  1932. X        }
  1933. X        i = 0;
  1934. X        j = 0;
  1935. X        p = token;
  1936. X        while (*p && *p != '.') {
  1937. X        p++; i++;
  1938. X        }
  1939. X        if (*p) {
  1940. X        p++; i++;
  1941. X        }
  1942. X        while (*p) {
  1943. X        p++; i++; j++;
  1944. X        }
  1945. X        {   int    ow, nw;
  1946. X
  1947. X        ow = fwidth[effc] - precision[effc];
  1948. X        if (precision[effc] < j)
  1949. X            precision[effc] = j;
  1950. X    
  1951. X        if (fwidth[effc] < i)
  1952. X            fwidth[effc] = i;
  1953. X
  1954. X        /* now make sure:
  1955. X         *    1234.567890 (format 11 6)
  1956. X         *    1234567.890 (format 11 3)
  1957. X         *    both show (format 14 6)
  1958. X         *        (really it uses 15 6 to separate columns)
  1959. X         */
  1960. X        if ((nw = i - j) > ow)
  1961. X            fwidth[effc] += nw - (fwidth[effc] - precision[effc]);
  1962. X        }
  1963. X        break;
  1964. X    case ALPHA:
  1965. X        first = FALSE;
  1966. X        if (leftadj)
  1967. X        (void) printf("leftstring %s%d = \"%s\"\n", coltoa(effc),effr,token); 
  1968. X        else
  1969. X        (void) printf("rightstring %s%d = \"%s\"\n",coltoa(effc),effr,token); 
  1970. X        if (effc >= maxcols - 1)
  1971. X        {    if (!growtbl(GROWCOL, 0, effc))
  1972. X        {    (void) fprintf(stderr, "Invalid column used: %s\n", coltoa(effc));
  1973. X            continue;
  1974. X        }
  1975. X        }
  1976. X        i = strlen(token);
  1977. X        if (i > fwidth[effc])
  1978. X        fwidth[effc] = i;
  1979. X        break;
  1980. X    case SPACE:
  1981. X        if (first && strip_delim)
  1982. X        break;
  1983. X        if (colfirst)
  1984. X        roff++;
  1985. X        else
  1986. X        coff++;
  1987. X        break;
  1988. X    case EOL:
  1989. X        curlen++;
  1990. X        roff = 0;
  1991. X        coff = 0;
  1992. X        first = TRUE;
  1993. X        if (colfirst) {
  1994. X        if (curlen >= len) {
  1995. X            curcol = c0;
  1996. X            currow += rinc;
  1997. X            curlen = 0;
  1998. X        } else {
  1999. X            curcol += cinc;
  2000. X        }
  2001. X        } else {
  2002. X        if (curlen >= len) {
  2003. X            currow = r0;
  2004. X            curcol += cinc;
  2005. X            curlen = 0;
  2006. X        } else {
  2007. X            currow += rinc;
  2008. X        }
  2009. X        }
  2010. X        break;
  2011. X    }
  2012. X    }
  2013. X}
  2014. X
  2015. Xint
  2016. Xscan()
  2017. X{
  2018. X    register int c;
  2019. X    register char *p;
  2020. X    register int founddigit;
  2021. X
  2022. X    p = token;
  2023. X    c = getchar();
  2024. X
  2025. X    if (c == EOF)
  2026. X    return(END);
  2027. X
  2028. X    if (c == '\n')
  2029. X    return(EOL);
  2030. X
  2031. X    if (c == delim1 || c == delim2) {
  2032. X        if (strip_delim) {
  2033. X        while ((c = getchar()) && (c == delim1 || c == delim2))
  2034. X            ;
  2035. X        (void)ungetc(c, stdin);
  2036. X    } 
  2037. X    return(SPACE);
  2038. X    }
  2039. X
  2040. X    if (c == '\"') {
  2041. X    while ((c = getchar()) && c != '\"' && c != '\n' && c != EOF)
  2042. X        *p++ = c;
  2043. X    if (c != '\"')
  2044. X        (void)ungetc(c, stdin);
  2045. X    *p = '\0';
  2046. X    return(ALPHA);
  2047. X    }
  2048. X
  2049. X    while (c != delim1 && c != delim2 && c!= '\n' && c != EOF) {
  2050. X    *p++ = c;
  2051. X    c = getchar();
  2052. X    }
  2053. X    *p = '\0';
  2054. X    (void)ungetc(c, stdin);
  2055. X
  2056. X    p = token;
  2057. X    c = *p;
  2058. X    founddigit = FALSE;
  2059. X    /*
  2060. X     * str_nums always returns numbers as strings
  2061. X     * plainnums returns 'numbers' with [-+eE] in them as strings
  2062. X     * lastprtnum makes sure a number ends in one of [0-9eE.]
  2063. X     */
  2064. X    if (!strnums && (isdigit(c) || c == '.' || c == '-' || c == '+')) {
  2065. X    int    lastprtnum = FALSE;
  2066. X
  2067. X    while(isdigit(c) || c == '.' || (!plainnums && (c == '-' ||
  2068. X                    c == '+' || c == 'e' || c == 'E'))) {
  2069. X        if (isdigit(c)) 
  2070. X            lastprtnum = founddigit = TRUE;
  2071. X        else
  2072. X        if (!(c == '.' || c == 'e' || c == 'E'))
  2073. X            lastprtnum = FALSE;
  2074. X        c = *p++;
  2075. X    }
  2076. X    if (c == '\0' && founddigit && lastprtnum)
  2077. X        return(NUM);
  2078. X    else
  2079. X        return(ALPHA);
  2080. X    }
  2081. X
  2082. X    return(ALPHA);
  2083. X}
  2084. X    
  2085. X/* turns [A-Z][A-Z] into a number */
  2086. Xint
  2087. Xgetcol(p)
  2088. Xchar *p;
  2089. X{
  2090. X    register  col;
  2091. X
  2092. X    col = 0;
  2093. X    if (!p)
  2094. X    return(0);
  2095. X    while(*p && !isalpha(*p)) 
  2096. X    p++; 
  2097. X    if (!*p)
  2098. X    return(0);
  2099. X    col = ((*p & 0137) - 'A');
  2100. X    if (isalpha(*++p)) 
  2101. X    col = (col + 1)*26 + ((*p & 0137) - 'A');
  2102. X    return(col);
  2103. X}
  2104. X
  2105. X/* given a string turn it into a row number */
  2106. Xint
  2107. Xgetrow(p)
  2108. Xchar *p;
  2109. X{
  2110. X    int row;
  2111. X
  2112. X    row = 0;
  2113. X    if (!p)
  2114. X    return(0);
  2115. X    while(*p && !isdigit(*p))
  2116. X    p++; 
  2117. X    if (!*p)
  2118. X    return(0);
  2119. X    while(*p && isdigit(*p))
  2120. X    {    row = row * 10 + *p - '0';
  2121. X    p++;
  2122. X    }
  2123. X    return(row);
  2124. X}
  2125. X
  2126. X/* turns a column number into [A-Z][A-Z] */
  2127. Xchar *
  2128. Xcoltoa(col)
  2129. Xint col;
  2130. X{
  2131. X    static char rname[3];
  2132. X    register char *p = rname;
  2133. X
  2134. X    if (col < 0 || col > 27*26)    /* A-Z, AA-ZZ */
  2135. X    (void) fprintf(stderr,"coltoa: invalid col: %d", col);
  2136. X
  2137. X    if (col > 25) {
  2138. X    *p++ = col/26 + 'A' - 1;
  2139. X    col %= 26;
  2140. X    }
  2141. X    *p++ = col+'A';
  2142. X    *p = '\0';
  2143. X    return(rname);
  2144. X}
  2145. END_OF_FILE
  2146.   if test 7238 -ne `wc -c <'ss_12b/pss.c'`; then
  2147.     echo shar: \"'ss_12b/pss.c'\" unpacked with wrong size!
  2148.   fi
  2149.   # end of 'ss_12b/pss.c'
  2150. fi
  2151. echo shar: End of archive 6 \(of 11\).
  2152. cp /dev/null ark6isdone
  2153. MISSING=""
  2154. for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
  2155.     if test ! -f ark${I}isdone ; then
  2156.     MISSING="${MISSING} ${I}"
  2157.     fi
  2158. done
  2159. if test "${MISSING}" = "" ; then
  2160.     echo You have unpacked all 11 archives.
  2161.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2162. else
  2163.     echo You still must unpack the following archives:
  2164.     echo "        " ${MISSING}
  2165. fi
  2166. exit 0
  2167. exit 0 # Just in case...
  2168.