home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume33 / remind / part01 < prev    next >
Encoding:
Text File  |  1992-11-10  |  37.5 KB  |  1,087 lines

  1. Newsgroups: comp.sources.misc
  2. From: dfs@doe.carleton.ca (David F. Skoll)
  3. Subject:  v33i058:  remind - A replacement for calendar, Part01/12
  4. Message-ID: <csm-v33i058=remind.221714@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 76d802448c6ebd7608dd2dd15c916b3d
  6. Date: Tue, 10 Nov 1992 04:17:39 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: dfs@doe.carleton.ca (David F. Skoll)
  10. Posting-number: Volume 33, Issue 58
  11. Archive-name: remind/part01
  12. Environment: UNIX, MS-DOS
  13. Supersedes: remind: Volume 17, Issue 3-6
  14.  
  15. NOTE:  If you got Remind via ftp from ftp.doe.carleton.ca before 9
  16. November, 1992, you have a BETA version WITH BUGS.  Throw it out!!
  17.  
  18. Remind is a sophisticated reminder program.  It has a flexible and
  19. powerful script language, and allows you to easily specify reminders
  20. for most occasions.  For example, you can easily specify:
  21.  
  22.     - Particular dates (birthdays, etc.)
  23.     - Holidays like Labour day, which occur on a particular
  24.       weekday of a month.
  25.     - Dates which repeat with an arbitrary period
  26.     - Meetings which are automatically moved in the event of holidays.
  27.     - etc.
  28.  
  29. Remind also includes a feature to activate timed "alarms" in the
  30. background.
  31.  
  32. Remind should work on most Un*x systems, as well as MS-DOS.  This allows
  33. you to use the same script on your Un*x and MS-DOS systems.
  34.  
  35. FTP sites:
  36.  
  37. You can get Remind from ftp.doe.carleton.ca in the pub directory.  The
  38. files are:
  39.  
  40.     Entire source distribution:    remind-3.0.0.tar.Z
  41.     MSDOS executable:        remind.exe
  42.     Man page in plain text:        remind.man
  43.     Postscript man page:        remind.ps
  44.  
  45. Thanks to Dennis Cottel and Bill Silvert, who beta-tested Remind for me.
  46.  
  47. David F. Skoll
  48. -------------------
  49. #!/bin/sh
  50. # This is Remind 03.00.00, a shell archive (shar 3.32)
  51. # made 11/09/1992 20:20 UTC by dfs@ro
  52. # Source directory /enterprise/turbolift/dfs/work/.rem/Remind-3.0/work
  53. #
  54. # existing files will NOT be overwritten
  55. #
  56. # This shar contains:
  57. # length  mode       name
  58. # ------ ---------- ------------------------------------------
  59. #   1685 -rw------- README.UNIX
  60. #    438 -rw------- README.DOS
  61. #   2732 -rw------- COPYRIGHT
  62. #   7694 -rw------- config.h
  63. #   3591 -rw------- err.h
  64. #   1010 -rw------- expr.h
  65. #   3561 -rw------- globals.h
  66. #   4850 -rw------- protos.h
  67. #   3594 -rw------- types.h
  68. #    688 -rw------- version.h
  69. #  22448 -rw------- calendar.c
  70. #  14531 -rw------- dorem.c
  71. #   9144 -rw------- dosubst.c
  72. #  36192 -rw------- expr.c
  73. #  14553 -rw------- files.c
  74. #  41381 -rw------- funcs.c
  75. #   1011 -rw------- globals.c
  76. #   9425 -rw------- init.c
  77. #  30576 -rw------- main.c
  78. #  11727 -rw------- omit.c
  79. #   9705 -rw------- queue.c
  80. #   8965 -rw------- token.c
  81. #  13395 -rw------- trigger.c
  82. #  10178 -rw------- userfns.c
  83. #   6948 -rw------- utils.c
  84. #  11570 -rw------- var.c
  85. #   2669 -rw------- Makefile
  86. #    850 -rw------- rem
  87. #    772 -rw------- rem.1
  88. #  71460 -rw------- remind.1
  89. #   1446 -rw------- remind-all.csh
  90. #   1472 -rw------- remind-all.sh
  91. #   4821 -rw------- test.rem
  92. #    384 -rwx------ test-rem
  93. #  12909 -rw------- test.cmp
  94. #   1426 -rw------- makefile.tc
  95. #   1339 -rw------- makefile.msc
  96. #    201 -rw------- lnk.msc
  97. #    168 -rw------- lnk.tc
  98. #    399 -rw------- MANIFEST.UNX
  99. #    393 -rw------- MANIFEST.DOS
  100. #   3329 -rw------- WHATSNEW.30
  101. #    852 -rwx------ kall
  102. #    679 -rw------- kall.1
  103. #
  104. if touch 2>&1 | fgrep 'amc' > /dev/null
  105.  then TOUCH=touch
  106.  else TOUCH=true
  107. fi
  108. # ============= README.UNIX ==============
  109. if test X"$1" != X"-c" -a -f 'README.UNIX'; then
  110.     echo "File already exists: skipping 'README.UNIX'"
  111. else
  112. echo "x - extracting README.UNIX (Text)"
  113. sed 's/^X//' << 'SHAR_EOF' > README.UNIX &&
  114. XREMIND version 3.0 for UNIX
  115. X
  116. X1 - Read the file COPYRIGHT.
  117. X
  118. X2-  Before compiling the software, check to see if it includes patches.
  119. X    These are files called patch.xx.  If there are patches, apply them all
  120. X    by typing:
  121. X
  122. X       cat patch.* | patch
  123. X
  124. X3 - Examine the Makefile and change any parameters which need to be
  125. X    changed for your system.  As it stands, the Makefile is set up for a
  126. X    BSD system.
  127. X
  128. X4 - Examine the file config.h and adjust parameters as needed
  129. X
  130. X5 - Type 'make'
  131. X
  132. X6 - Type 'test-rem' to run the acceptance test
  133. X
  134. X7 - Copy the remind executable to the appropriate directory, and copy
  135. X    the man page to the man directory.
  136. X
  137. XTwo shell scripts, "remind-all.csh" and "remind-all.sh" are provided.
  138. XThese allow automatic mailing of reminders to all users who create a
  139. X$HOME/.reminders file.  These two scripts are equivalent; one is a
  140. X"sh" script and the other is a "csh" script.  Pick the one you want to
  141. Xuse, and follow the instructions in the opening comments of the
  142. Xscript.
  143. X
  144. X*** NOTE *** Please be aware that "remind-all.csh" and "remind-all.sh"
  145. Xhave been changed since the last release of Remind.  If you install
  146. Xthe new remind executable, make sure you switch over to the new
  147. X"remind-all" scripts.
  148. X
  149. XA shell script called "rem" is provided for those who like to have
  150. X'remind' assume a default reminders file.  A man page for this script
  151. Xis provided.  You should examine the script to ensure that the defaults
  152. Xare correct.
  153. X
  154. XA shell script called "kall" is provided so you can kill your background
  155. Xremind processes when you log out.  See the man page.  Note that kall
  156. Xdepends on the output of "ps", and may not be portable.
  157. X
  158. X--
  159. XDavid F. Skoll <dfs@doe.carleton.ca>
  160. SHAR_EOF
  161. $TOUCH -am 1109141292 README.UNIX &&
  162. chmod 0600 README.UNIX ||
  163. echo "restore of README.UNIX failed"
  164. set `wc -c README.UNIX`;Wc_c=$1
  165. if test "$Wc_c" != "1685"; then
  166.     echo original size 1685, current size $Wc_c
  167. fi
  168. fi
  169. # ============= README.DOS ==============
  170. if test X"$1" != X"-c" -a -f 'README.DOS'; then
  171.     echo "File already exists: skipping 'README.DOS'"
  172. else
  173. echo "x - extracting README.DOS (Text)"
  174. sed 's/^X//' << 'SHAR_EOF' > README.DOS &&
  175. XREMIND version 3.0 for MS-DOS
  176. X
  177. X1 - Read the file COPYRIGHT.  (This may be called COPYRIGH on your
  178. X    MS-DOS system.)
  179. X
  180. X2 - Examine the file config.h and adjust parameters as needed
  181. X
  182. X3 - If you are using Turbo C to compile Remind, type:
  183. X
  184. X    make -fmakefile.tc
  185. X
  186. X    If you are using Microsoft C to compile Remind, type:
  187. X
  188. X    make makefile.msc
  189. X
  190. XThis will create REMIND.EXE, which is ready to be executed.
  191. X
  192. X--
  193. XDavid F. Skoll <dfs@doe.carleton.ca>
  194. SHAR_EOF
  195. $TOUCH -am 1109141292 README.DOS &&
  196. chmod 0600 README.DOS ||
  197. echo "restore of README.DOS failed"
  198. set `wc -c README.DOS`;Wc_c=$1
  199. if test "$Wc_c" != "438"; then
  200.     echo original size 438, current size $Wc_c
  201. fi
  202. fi
  203. # ============= COPYRIGHT ==============
  204. if test X"$1" != X"-c" -a -f 'COPYRIGHT'; then
  205.     echo "File already exists: skipping 'COPYRIGHT'"
  206. else
  207. echo "x - extracting COPYRIGHT (Text)"
  208. sed 's/^X//' << 'SHAR_EOF' > COPYRIGHT &&
  209. XTHE REMIND COPYRIGHT
  210. X
  211. XREMIND refers to the entire set of files and documentation in the
  212. XREMIND package.
  213. X
  214. XREMIND is Copyright 1990, 1991, 1992 by David Skoll, except for the
  215. Xfile remind-all.sh, which is Copyright 1990 by Bill Aten.
  216. X
  217. XYou may use REMIND for free, and may freely distribute it, providing
  218. Xyou do not charge the recipients to whom you distribute REMIND.
  219. X
  220. XYou may modify REMIND.  However, you must clearly indicate such
  221. Xmodifications when you distribute REMIND, and must tell the recipients
  222. Xof the modified version that it is modified.  Place that notice in the
  223. XWHATSNEW.xx file.
  224. X
  225. XYou may incorporate parts of REMIND into your own programs, providing
  226. Xyou do not sell these programs.  You must clearly indicate that the
  227. Xparts of REMIND you have incorporated are Copyright 1990, 1991, 1992
  228. Xby David Skoll.
  229. X
  230. XI will attempt to support REMIND as much as possible.  However, you
  231. Xuse it at your own risk.  I am not responsible for any damages caused
  232. Xby the use or misuse of REMIND.
  233. X
  234. XIf you wish to contribute ideas or money to help the production of
  235. Xsoftware like REMIND, you can reply to the address shown at the end of
  236. Xthis file.  Note that you are under no obligation to send me money.
  237. XIf you don't donate, you have full rights to use REMIND just as if you
  238. Xhad donated.  If you do donate, you get a big thank-you, but no
  239. Xspecial rights.  However, you will have helped support the production
  240. Xof software like REMIND.  Should you wish to donate, the suggested
  241. Xamount is $18.00 (Canadian)
  242. X
  243. XACKNOWLEDGEMENTS:
  244. X
  245. XI would like to thank the following people:
  246. X
  247. XBill Aten <netagw!bill@uunet.UU.NET> for providing remind-all.sh
  248. X
  249. XBradley D. Keister <keister@poincare.phys.cmu.edu>, Rhys Weatherly
  250. Xrhys@batserver.cs.uq.OZ.AU> and Anthony Cheng for initially providing
  251. Xthe Turbo C compiler support.
  252. X
  253. XDennis Cottel <dennis@peanuts.nosc.mil> for providing the patch to
  254. Xproduce calendars by weeks as well as by months.
  255. X
  256. XBill Silvert <bill%biomel@cs.dal.ca> and Dennis Cottel
  257. X<dennis@peanuts.nosc.mil> for suggesting many of the new features in
  258. XREMIND.
  259. X
  260. XDave Wolfe <dwolfe@pffft.sps.mot.com> and Raphael Manfredi
  261. X<ram@eiffel.com> for noticing bugs and sending me fixes.
  262. X
  263. XTimo Salmi, Keith Petersen, Bill Davidsen and Kent Landfield for
  264. Xmaintaining the uwasa and SIMTEL archives, and comp.binaries.ibm.pc
  265. Xand comp.sources.misc in the face of a flurry of updates to REMIND.
  266. X
  267. XAll others who have corresponded with me to report bugs, express
  268. Xappreciation or suggest features - too many people to list here.
  269. X
  270. XFinally, all those who donated money to support the production of
  271. XREMIND.  Your donations were gratefully appreciated.
  272. X
  273. X--
  274. XDavid F. Skoll <dfs@doe.carleton.ca>
  275. X4-317 LeBreton Street South
  276. XOttawa, Ontario K1S 4L4
  277. XCANADA
  278. X
  279. XTel. (613) 567-3662
  280. X
  281. SHAR_EOF
  282. $TOUCH -am 1109141292 COPYRIGHT &&
  283. chmod 0600 COPYRIGHT ||
  284. echo "restore of COPYRIGHT failed"
  285. set `wc -c COPYRIGHT`;Wc_c=$1
  286. if test "$Wc_c" != "2732"; then
  287.     echo original size 2732, current size $Wc_c
  288. fi
  289. fi
  290. # ============= config.h ==============
  291. if test X"$1" != X"-c" -a -f 'config.h'; then
  292.     echo "File already exists: skipping 'config.h'"
  293. else
  294. echo "x - extracting config.h (Text)"
  295. sed 's/^X//' << 'SHAR_EOF' > config.h &&
  296. X/***************************************************************/
  297. X/*                                                             */
  298. X/*  CONFIG.H                                                   */
  299. X/*                                                             */
  300. X/*  Contains various configuration parameters for Remind.      */
  301. X/*  You may have to edit this file to tweak parameters or take */
  302. X/*  care of certain system dependencies.                       */
  303. X/*                                                             */
  304. X/*  This file is part of REMIND.                               */
  305. X/*  Copyright (C) 1991 by David F. Skoll.                      */
  306. X/*                                                             */
  307. X/***************************************************************/
  308. X
  309. X/*---------------------------------------------------------------------*/
  310. X/* STRSTR:  If your system does not have the "strstr" function,        */
  311. X/* uncomment the following line.                                       */
  312. X/*---------------------------------------------------------------------*/
  313. X/* #define NO_STRSTR 1 */
  314. X
  315. X/*---------------------------------------------------------------------*/
  316. X/* STDLIB:  If you don't have the <stdlib.h> header file, comment the  */
  317. X/* following line.                                                     */
  318. X/*---------------------------------------------------------------------*/
  319. X#define HAVE_STDLIB_H 1
  320. X
  321. X/*---------------------------------------------------------------------*/
  322. X/* MALLOC:  If you do not have the <malloc.h> header file,             */
  323. X/* comment out the next 3 lines.                                       */
  324. X/*---------------------------------------------------------------------*/
  325. X#ifdef UNIX
  326. X#define HAVE_MALLOC_H 1
  327. X#endif
  328. X
  329. X/*---------------------------------------------------------------------*/
  330. X/* BASE: The base year for date calculation.  NOTE!  January 1 of the  */
  331. X/*       base year MUST be a Monday, else Remind will not work!        */
  332. X/*---------------------------------------------------------------------*/
  333. X#define BASE 1990
  334. X
  335. X/*---------------------------------------------------------------------*/
  336. X/* YR_RANGE: The range of years allowed.  Computers with 16-bit        */
  337. X/*           integers can handle about 89 years worth of reminders; if */
  338. X/*           you use 32-bit integers, you can handle over 5 867 000    */
  339. X/*           years.  Note that YR_RANGE is set to 88 rather than 89    */
  340. X/*           because we can range up to the last day of the 88th year. */
  341. X/*---------------------------------------------------------------------*/
  342. X#define YR_RANGE 88
  343. X
  344. X/*---------------------------------------------------------------------*/
  345. X/* VAR_NAME_LEN: The maximum length of variable names                  */
  346. X/*---------------------------------------------------------------------*/
  347. X#define VAR_NAME_LEN 12
  348. X
  349. X/*---------------------------------------------------------------------*/
  350. X/* MAX_PRT_LEN: The maximum number of characters to print when         */
  351. X/* displaying a string value for debugging purposes.                   */
  352. X/*---------------------------------------------------------------------*/
  353. X#define MAX_PRT_LEN 40
  354. X
  355. X/*---------------------------------------------------------------------*/
  356. X/* LINELEN: The maximum length of an input line                        */
  357. X/*---------------------------------------------------------------------*/
  358. X#define LINELEN 512
  359. X
  360. X/*---------------------------------------------------------------------*/
  361. X/* OP_STACK_SIZE: The size of the operator stack for expr. parsing     */
  362. X/*---------------------------------------------------------------------*/
  363. X#define OP_STACK_SIZE 30
  364. X
  365. X/*---------------------------------------------------------------------*/
  366. X/* VAL_STACK_SIZE: The size of the operand stack for expr. parsing     */
  367. X/*---------------------------------------------------------------------*/
  368. X#define VAL_STACK_SIZE 30
  369. X
  370. X/*---------------------------------------------------------------------*/
  371. X/* INCLUDE_NEST: How many nested INCLUDES do we handle?                */
  372. X/*---------------------------------------------------------------------*/
  373. X#define INCLUDE_NEST 8
  374. X
  375. X/*---------------------------------------------------------------------*/
  376. X/* IF_NEST: How many nested IFs do we handle?  Maximum is the number   */
  377. X/* of bits in an int, divided by two.  Beware!                         */
  378. X/*---------------------------------------------------------------------*/
  379. X#define IF_NEST (4*sizeof(unsigned int))
  380. X
  381. X/*---------------------------------------------------------------------*/
  382. X/* Do we handle queued reminders?                                      */
  383. X/*---------------------------------------------------------------------*/
  384. X#ifdef UNIX
  385. X#define HAVE_QUEUED 1
  386. X#endif
  387. X
  388. X/*---------------------------------------------------------------------*/
  389. X/* Does our C compiler have prototypes?  Override this test if you     */
  390. X/* are using a non-ANSI compiler that nevertheless has prototypes.     */
  391. X/*---------------------------------------------------------------------*/
  392. X#ifdef __STDC__
  393. X#define HAVE_PROTOS 1
  394. X#endif
  395. X
  396. X/*---------------------------------------------------------------------*/
  397. X/* Do we use the <stdarg.h> scheme for functions with variable number  */
  398. X/* of parameters?  If not, the <varargs.h> scheme is assumed.          */
  399. X/*---------------------------------------------------------------------*/
  400. X#ifdef __STDC__
  401. X#define HAVE_STDARG 1
  402. X#endif
  403. X
  404. X/*---------------------------------------------------------------------*/
  405. X/* Do we have the <unistd.h> header?  If not, use sys/files.h          */
  406. X/*---------------------------------------------------------------------*/
  407. X#define HAVE_UNISTD 1
  408. X
  409. X/*---------------------------------------------------------------------*/
  410. X/* How many attempts to resolve a weird date spec?                     */
  411. X/*---------------------------------------------------------------------*/
  412. X#define TRIG_ATTEMPTS 25
  413. X
  414. X/*---------------------------------------------------------------------*/
  415. X/* How many global omits of the form YYYY MM DD do we handle?          */
  416. X/*---------------------------------------------------------------------*/
  417. X#define MAX_FULL_OMITS 75
  418. X
  419. X/*---------------------------------------------------------------------*/
  420. X/* How many global omits of the form MM DD do we handle?               */
  421. X/*---------------------------------------------------------------------*/
  422. X#define MAX_PARTIAL_OMITS 75
  423. X
  424. X/*---------------------------------------------------------------------*/
  425. X/* The size of statically-allocated buffers for tokens.                */
  426. X/*---------------------------------------------------------------------*/
  427. X#define TOKSIZE 128
  428. X
  429. X/*---------------------------------------------------------------------*/
  430. X/* The size of the buffer for the shell() function.                    */
  431. X/*---------------------------------------------------------------------*/
  432. X#define SHELLSIZE 512
  433. X
  434. X/*---------------------------------------------------------------------*/
  435. X/* A newline - some systems need "\n\r"                                */
  436. X/*---------------------------------------------------------------------*/
  437. X#define NL "\n"
  438. X
  439. X/*---------------------------------------------------------------------*/
  440. X/* Minimum number of linefeeds in each calendar "box"                  */
  441. X/*---------------------------------------------------------------------*/
  442. X#define CAL_LINES 5
  443. X
  444. X/*---------------------------------------------------------------------*/
  445. X/* Don't change the next definitions                                   */
  446. X/*---------------------------------------------------------------------*/
  447. X#define PUBLIC
  448. X#define PRIVATE static
  449. SHAR_EOF
  450. $TOUCH -am 1109141292 config.h &&
  451. chmod 0600 config.h ||
  452. echo "restore of config.h failed"
  453. set `wc -c config.h`;Wc_c=$1
  454. if test "$Wc_c" != "7694"; then
  455.     echo original size 7694, current size $Wc_c
  456. fi
  457. fi
  458. # ============= err.h ==============
  459. if test X"$1" != X"-c" -a -f 'err.h'; then
  460.     echo "File already exists: skipping 'err.h'"
  461. else
  462. echo "x - extracting err.h (Text)"
  463. sed 's/^X//' << 'SHAR_EOF' > err.h &&
  464. X/***************************************************************/
  465. X/*                                                             */
  466. X/*  ERR.H                                                      */
  467. X/*                                                             */
  468. X/*  Error definitions.                                         */
  469. X/*                                                             */
  470. X/*  This file is part of REMIND.                               */
  471. X/*  Copyright (C) 1991 by David F. Skoll.                      */
  472. X/*                                                             */
  473. X/***************************************************************/
  474. X
  475. X#define OK                    0
  476. X#define E_MISS_END            1
  477. X#define E_MISS_QUOTE          2
  478. X#define E_OP_STK_OVER         3
  479. X#define E_VA_STK_OVER         4
  480. X#define E_MISS_RIGHT_PAREN    5
  481. X#define E_UNDEF_FUNC          6
  482. X#define E_ILLEGAL_CHAR        7
  483. X#define E_EXPECTING_BINOP     8
  484. X#define E_NO_MEM              9
  485. X#define E_BAD_NUMBER         10
  486. X#define E_OP_STK_UNDER       11
  487. X#define E_VA_STK_UNDER       12
  488. X#define E_CANT_COERCE        13
  489. X#define E_BAD_TYPE           14
  490. X#define E_DATE_OVER          15
  491. X#define E_STACK_ERR          16
  492. X#define E_DIV_ZERO           17
  493. X#define E_NOSUCH_VAR         18
  494. X#define E_EOLN             19
  495. X#define E_EOF             20
  496. X#define E_IO_ERR             21
  497. X#define E_LINE_2_LONG        22
  498. X#define E_SWERR             23
  499. X#define E_BAD_DATE           24
  500. X#define E_2FEW_ARGS         25
  501. X#define E_2MANY_ARGS         26
  502. X#define E_BAD_TIME         27
  503. X#define E_2HIGH             28
  504. X#define E_2LOW              29
  505. X#define E_CANT_OPEN          30
  506. X#define E_NESTED_INCLUDE     31
  507. X#define E_PARSE_ERR          32
  508. X#define E_CANT_TRIG          33
  509. X#define E_NESTED_IF          34
  510. X#define E_ELSE_NO_IF         35
  511. X#define E_ENDIF_NO_IF        36
  512. X#define E_2MANY_LOCALOMIT    37
  513. X#define E_EXTRANEOUS_TOKEN   38
  514. X#define E_POP_NO_PUSH        39
  515. X#define E_RUN_DISABLED       40
  516. X#define E_DOMAIN_ERR         41
  517. X#define E_BAD_ID             42
  518. X#define E_RECURSIVE          43
  519. X#define E_PARSE_AS_REM       44 /* Not really an error - just returned by
  520. X                                   DoOmit to indicate line should be executed
  521. X                                   as a REM statement, also. */
  522. X#ifdef MK_GLOBALS
  523. X#undef EXTERN
  524. X#define EXTERN
  525. X#else
  526. X#undef EXTERN
  527. X#define EXTERN extern
  528. X#endif
  529. X
  530. XEXTERN char *ErrMsg[]
  531. X
  532. X#ifdef MK_GLOBALS
  533. X= {
  534. X   "Ok",
  535. X   "Missing ']'",
  536. X   "Missing double-quote",
  537. X   "Expression too complex - too many operators",
  538. X   "Expression too complex - too many operands",
  539. X   "Missing ')'",
  540. X   "Undefined function",
  541. X   "Illegal character",
  542. X   "Expecting binary operator",
  543. X   "Out of memory",
  544. X   "Ill-formed number",
  545. X   "Op stack underflow - internal error",
  546. X   "Va stack underflow - internal error",
  547. X   "Can't coerce",
  548. X   "Type mismatch",
  549. X   "Date overflow",
  550. X   "Stack error - internal error",
  551. X   "Division by zero",
  552. X   "Undefined variable",
  553. X   "Unexpected end of line",
  554. X   "Unexpected end of file",
  555. X   "I/O error",
  556. X   "Line too long",
  557. X   "Internal error",
  558. X   "Bad date specification",
  559. X   "Not enough arguments",
  560. X   "Too many arguments",
  561. X   "Ill-formed time",
  562. X   "Number too high",
  563. X   "Number too low",
  564. X   "Can't open file",
  565. X   "INCLUDE nested too deeply",
  566. X   "Parse error",
  567. X   "Can't compute trigger",
  568. X   "Too many nested IFs",
  569. X   "ELSE with no matching IF",
  570. X   "ENDIF with no matching IF",
  571. X   "Can't OMIT every weekday",
  572. X   "Extraneous token(s) on line",
  573. X   "POP-OMIT-CONTEXT without matching PUSH-OMIT-CONTEXT",
  574. X   "RUN disabled",
  575. X   "Domain error",
  576. X   "Invalid identifier",
  577. X   "Recursive function call detected",
  578. X   ""
  579. X}
  580. X#endif
  581. X;
  582. SHAR_EOF
  583. $TOUCH -am 1109141292 err.h &&
  584. chmod 0600 err.h ||
  585. echo "restore of err.h failed"
  586. set `wc -c err.h`;Wc_c=$1
  587. if test "$Wc_c" != "3591"; then
  588.     echo original size 3591, current size $Wc_c
  589. fi
  590. fi
  591. # ============= expr.h ==============
  592. if test X"$1" != X"-c" -a -f 'expr.h'; then
  593.     echo "File already exists: skipping 'expr.h'"
  594. else
  595. echo "x - extracting expr.h (Text)"
  596. sed 's/^X//' << 'SHAR_EOF' > expr.h &&
  597. X/***************************************************************/
  598. X/*                                                             */
  599. X/*  EXPR.H                                                     */
  600. X/*                                                             */
  601. X/*  Contains a few definitions used by expression evaluator.   */
  602. X/*                                                             */
  603. X/*  This file is part of REMIND.                               */
  604. X/*  Copyright (C) 1991 by David F. Skoll.                      */
  605. X/*                                                             */
  606. X/***************************************************************/
  607. X
  608. X/* Define the types of values */
  609. X#define ERR_TYPE 0
  610. X#define INT_TYPE 1
  611. X#define TIM_TYPE 2
  612. X#define DATE_TYPE 3
  613. X#define STR_TYPE 4
  614. X
  615. X/* Define stuff for parsing expressions */
  616. X#define BEG_OF_EXPR '['
  617. X#define END_OF_EXPR ']'
  618. X#define COMMA ','
  619. X
  620. X#define UN_OP 0  /* Unary operator */
  621. X#define BIN_OP 1 /* Binary Operator */
  622. X#define FUNC 2   /* Function */
  623. SHAR_EOF
  624. $TOUCH -am 1109141292 expr.h &&
  625. chmod 0600 expr.h ||
  626. echo "restore of expr.h failed"
  627. set `wc -c expr.h`;Wc_c=$1
  628. if test "$Wc_c" != "1010"; then
  629.     echo original size 1010, current size $Wc_c
  630. fi
  631. fi
  632. # ============= globals.h ==============
  633. if test X"$1" != X"-c" -a -f 'globals.h'; then
  634.     echo "File already exists: skipping 'globals.h'"
  635. else
  636. echo "x - extracting globals.h (Text)"
  637. sed 's/^X//' << 'SHAR_EOF' > globals.h &&
  638. X/***************************************************************/
  639. X/*                                                             */
  640. X/*  GLOBALS.H                                                  */
  641. X/*                                                             */
  642. X/*  This function contains declarations of global variables.   */
  643. X/*  They are instantiated in main.c by defining                */
  644. X/*  MK_GLOBALS.  Also contains useful macro definitions.       */
  645. X/*                                                             */
  646. X/*  This file is part of REMIND.                               */
  647. X/*  Copyright (C) 1991 by David F. Skoll.                      */
  648. X/*                                                             */
  649. X/***************************************************************/
  650. X
  651. X#ifdef MK_GLOBALS
  652. X#undef EXTERN
  653. X#define EXTERN
  654. X#define INIT(var, val) var = val
  655. X#else
  656. X#undef EXTERN
  657. X#define EXTERN extern
  658. X#define INIT(var, val) var
  659. X#endif
  660. X
  661. X#define DaysInYear(y) (((y) % 4) ? 365 : ((!((y) % 100) && ((y) % 400)) ? 365 : 366 ))
  662. X#define IsLeapYear(y) (((y) % 4) ? 0 : ((!((y) % 100) && ((y) % 400)) ? 0 : 1 ))
  663. X#define DaysInMonth(m, y) ((m) != 1 ? MonthDays[m] : 28 + IsLeapYear(y))
  664. X
  665. XEXTERN    int    JulianToday;
  666. XEXTERN    int    RealToday;
  667. XEXTERN    int    CurDay;
  668. XEXTERN    int    CurMon;
  669. XEXTERN    int    CurYear;
  670. XEXTERN    int    FirstYear;
  671. XEXTERN  int    LineNo;
  672. XEXTERN  char    FreshLine;
  673. XEXTERN  char    LineBuffer[LINELEN];
  674. XEXTERN  char    SubstBuffer[LINELEN];
  675. XEXTERN  char    TokBuffer[TOKSIZE+1];
  676. XEXTERN  INIT(    char    ShowAllErrors, 0);
  677. XEXTERN  INIT(    int     DebugFlag, 0);
  678. XEXTERN  INIT(   char    DoCalendar, 0);
  679. XEXTERN  INIT(   char    DoSimpleCalendar, 0);
  680. XEXTERN  INIT(   int     CalWidth, 80);
  681. XEXTERN  INIT(   int     CalWeeks, 0);
  682. XEXTERN  INIT(   int     CalMonths, 0);
  683. XEXTERN  INIT(    char    Hush, 0);
  684. XEXTERN  INIT(    char    NextMode, 0);
  685. XEXTERN  INIT(    char    InfiniteDelta, 0);
  686. XEXTERN  INIT(   char    RunDisabled, 0);
  687. XEXTERN  INIT(   char    IgnoreOnce, 0);
  688. XEXTERN  INIT(   char    Banner[LINELEN], "Reminders for %w, %d%s %m, %y%o:");
  689. XEXTERN    char    *InitialFile;
  690. XEXTERN    int    FileAccessDate;
  691. X
  692. X#ifdef HAVE_QUEUED
  693. XEXTERN  INIT(    char    DontFork, 0);
  694. XEXTERN  INIT(    char    DontQueue, 0);
  695. XEXTERN  INIT(   int     NumQueued, 0);
  696. XEXTERN  INIT(   char    DontIssueAts, 0);
  697. XEXTERN  INIT(   char    Daemon, 0);
  698. X#endif
  699. X
  700. XEXTERN  INIT(   int     ScFormat, SC_AMPM);
  701. XEXTERN  INIT(   int     MaxSatIter, 150);
  702. XEXTERN  INIT(    char    *FileName, NULL);
  703. XEXTERN  FILE *ErrFp;
  704. XEXTERN  INIT(    int    JulFirst,  -1);
  705. XEXTERN  INIT(   int     NumIfs,    0);
  706. XEXTERN  INIT(   unsigned int IfFlags,   0);
  707. XEXTERN  INIT(   int     LastTriggerDate, 0);
  708. XEXTERN  INIT(   char    LastTrigValid, 0);
  709. XEXTERN  INIT(   int     LastTriggerTime, 0);
  710. XEXTERN  INIT(   char    ShouldCache, 0);
  711. XEXTERN  char    *CurLine;
  712. XEXTERN  INIT(   int     NumTriggered, 0);
  713. XEXTERN  int ArgC;
  714. XEXTERN  char **ArgV;
  715. X
  716. X/* List of months */
  717. XEXTERN    char    *MonthName[]
  718. X#ifdef MK_GLOBALS
  719. X= {"January", "February", "March", "April", "May", "June",
  720. X   "July", "August", "September", "October", "November", "December" }
  721. X#endif
  722. X;
  723. X
  724. XEXTERN    char    *DayName[]
  725. X#ifdef MK_GLOBALS
  726. X= {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday",
  727. X   "Sunday"}
  728. X#endif
  729. X;
  730. X
  731. XEXTERN    int    MonthDays[]
  732. X#ifdef MK_GLOBALS
  733. X= {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
  734. X#endif
  735. X;
  736. X
  737. X/* The first day of each month expressed as number of days after Jan 1.
  738. X   Second row is for leap years. */
  739. X
  740. XEXTERN    int    MonthIndex[2][12]
  741. X#ifdef MK_GLOBALS
  742. X= {
  743. X    { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 },
  744. X    { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 }
  745. X  }
  746. X#endif
  747. X;
  748. X
  749. SHAR_EOF
  750. $TOUCH -am 1109141292 globals.h &&
  751. chmod 0600 globals.h ||
  752. echo "restore of globals.h failed"
  753. set `wc -c globals.h`;Wc_c=$1
  754. if test "$Wc_c" != "3561"; then
  755.     echo original size 3561, current size $Wc_c
  756. fi
  757. fi
  758. # ============= protos.h ==============
  759. if test X"$1" != X"-c" -a -f 'protos.h'; then
  760.     echo "File already exists: skipping 'protos.h'"
  761. else
  762. echo "x - extracting protos.h (Text)"
  763. sed 's/^X//' << 'SHAR_EOF' > protos.h &&
  764. X/***************************************************************/
  765. X/*                                                             */
  766. X/*  PROTOS.H                                                   */
  767. X/*                                                             */
  768. X/*  Function Prototypes.                                       */
  769. X/*                                                             */
  770. X/*  This file is part of REMIND.                               */
  771. X/*  Copyright (C) 1991 by David F. Skoll.                      */
  772. X/*                                                             */
  773. X/***************************************************************/
  774. X#ifdef HAVE_PROTOS
  775. X#define ARGS(x) x
  776. X#else
  777. X#define ARGS(x) ()
  778. X#endif
  779. X
  780. X/* Define a string assignment macro - be careful!!! */
  781. X#define STRSET(x, str) { if (x) free(x); (x) = StrDup(str); }
  782. X
  783. X/* Define a general malloc routine for creating pointers to objects */
  784. X#define NEW(type) ((type *) malloc(sizeof(type)))
  785. X
  786. X#ifdef NO_STRSTR
  787. Xchar *strstr ARGS ((char *s1, char *s2));
  788. X#endif
  789. X
  790. Xint CallUserFunc ARGS ((char *name, int nargs));
  791. Xint DoFset ARGS ((ParsePtr p));
  792. Xvoid ProduceCalendar ARGS ((void));
  793. Xchar *SimpleTime ARGS ((int tim, char *out));
  794. Xint DoRem ARGS ((ParsePtr p));
  795. Xint ParseRem ARGS ((ParsePtr s, Trigger *trig, TimeTrig *tim));
  796. Xint TriggerReminder ARGS ((ParsePtr p, Trigger *t, TimeTrig *tim, int jul));
  797. Xint ShouldTriggerReminder ARGS ((Trigger *t, TimeTrig *tim, int jul));
  798. Xint DoSubst ARGS ((ParsePtr p, char *out, Trigger *t, TimeTrig *tt, int jul, int mode));
  799. Xint EvalExpr ARGS ((char **e, Value *v));
  800. Xint PushValStack ARGS ((Value *val));
  801. Xint PopValStack ARGS ((Value *val));
  802. Xint DoCoerce ARGS ((char type, Value *v));
  803. Xvoid DestroyValue ARGS ((Value *v));
  804. Xvoid PrintValue  ARGS ((Value *v, FILE *fp));
  805. Xint CopyValue ARGS ((Value *dest, const Value *src));
  806. Xint ReadLine ARGS ((void));
  807. Xint OpenFile ARGS ((const char *fname));
  808. Xint PopFile ARGS ((void));
  809. Xint DoInclude ARGS ((ParsePtr p));
  810. Xint IncludeFile ARGS ((const char *fname));
  811. Xint GetAccessDate ARGS ((char *file));
  812. Xint SetAccessDate ARGS ((char *fname, int jul));
  813. Xint TopLevel ARGS ((void));
  814. Xint CallFunc ARGS ((Operator *f, int nargs));
  815. Xvoid InitRemind ARGS ((int argc, char *argv[]));
  816. Xvoid Usage ARGS ((void));
  817. Xint main ARGS ((int argc, char *argv[]));
  818. Xint Julian ARGS ((int year, int month, int day));
  819. Xvoid FromJulian ARGS ((int jul, int *y, int *m, int *d));
  820. Xint ParseChar ARGS ((ParsePtr p, int *err, int peek));
  821. Xint ParseToken ARGS ((ParsePtr p, char *out));
  822. Xint ParseIdentifier ARGS ((ParsePtr p, char *out));
  823. Xint EvaluateExpr ARGS ((ParsePtr p, Value *v));
  824. Xint Evaluate ARGS ((char **s, Var *locals));
  825. Xvoid Eprint ARGS ((const char *fmt, ...));
  826. Xvoid OutputLine ARGS ((FILE *fp));
  827. Xvoid CreateParser ARGS ((char *s, ParsePtr p));
  828. Xvoid DestroyParser ARGS ((ParsePtr p));
  829. Xvoid PushToken ARGS ((const char *tok));
  830. Xlong SystemTime ARGS ((void));
  831. Xint SystemDate ARGS ((int *y, int *m, int *d));
  832. Xint DoIf ARGS ((ParsePtr p));
  833. Xint DoElse ARGS ((ParsePtr p));
  834. Xint DoEndif ARGS ((ParsePtr p));
  835. Xint DoIfTrig ARGS ((ParsePtr p));
  836. Xint ShouldIgnoreLine ARGS ((void));
  837. Xint VerifyEoln ARGS ((ParsePtr p));
  838. Xint DoDebug ARGS ((ParsePtr p));
  839. Xint DoBanner ARGS ((ParsePtr p));
  840. Xint DoRun ARGS ((ParsePtr p));
  841. Xint DoErrMsg ARGS ((ParsePtr p));
  842. Xint ClearGlobalOmits ARGS ((void));
  843. Xint DoClear ARGS ((ParsePtr p));
  844. Xint DestroyOmitContexts ARGS ((void));
  845. Xint PushOmitContext ARGS ((ParsePtr p));
  846. Xint PopOmitContext ARGS ((ParsePtr p));
  847. Xint IsOmitted ARGS ((int jul, int localomit));
  848. Xint DoOmit ARGS ((ParsePtr p));
  849. Xint QueueReminder ARGS ((ParsePtr p, int typ, TimeTrig *tim));
  850. Xvoid HandleQueuedReminders ARGS ((void));
  851. Xchar *FindInitialToken ARGS ((Token *tok, char *s));
  852. Xvoid FindToken ARGS ((const char *s, Token *tok));
  853. Xvoid FindNumericToken ARGS ((const char *s, Token *t));
  854. Xint ComputeTrigger ARGS ((int today, Trigger *trig, int *err));
  855. Xint StrEq ARGS ((const char *s1, const char *s2));
  856. Xint StriEq ARGS ((const char *s1, const char *s2));
  857. Xint StrinEq ARGS ((const char *s1, const char *s2, int n));
  858. Xchar *StrnCpy ARGS ((char *dest, const char *source, int n));
  859. Xint StrMatch ARGS ((const char *s1, const char *s2, int n));
  860. Xint StrinCmp ARGS ((const char *s1, const char *s2, int n));
  861. Xchar *StrDup ARGS ((const char *s));
  862. Xint StrCmpi ARGS ((char *s1, char *s2));
  863. XVar *FindVar ARGS ((const char *str, int create));
  864. Xint DeleteVar ARGS ((const char *str));
  865. Xint SetVar ARGS ((const char *str, Value *val));
  866. Xint GetVarValue ARGS ((const char *str, Value *val, Var *locals));
  867. Xint DoSet  ARGS ((Parser *p));
  868. Xint DoUnset  ARGS ((Parser *p));
  869. Xint DoDump ARGS ((ParsePtr p));
  870. Xvoid DumpVarTable ARGS ((void));
  871. Xvoid DestroyVars ARGS ((void));
  872. Xint PreserveVar ARGS ((char *name));
  873. Xint DoPreserve  ARGS ((Parser *p));
  874. Xint DoSatRemind ARGS ((Trigger *trig, TimeTrig *tim, ParsePtr p));
  875. Xint ParseNonSpaceChar ARGS ((ParsePtr p, int *err, int peek));
  876. SHAR_EOF
  877. $TOUCH -am 1109141292 protos.h &&
  878. chmod 0600 protos.h ||
  879. echo "restore of protos.h failed"
  880. set `wc -c protos.h`;Wc_c=$1
  881. if test "$Wc_c" != "4850"; then
  882.     echo original size 4850, current size $Wc_c
  883. fi
  884. fi
  885. # ============= types.h ==============
  886. if test X"$1" != X"-c" -a -f 'types.h'; then
  887.     echo "File already exists: skipping 'types.h'"
  888. else
  889. echo "x - extracting types.h (Text)"
  890. sed 's/^X//' << 'SHAR_EOF' > types.h &&
  891. X/***************************************************************/
  892. X/*                                                             */
  893. X/*  TYPES.H                                                    */
  894. X/*                                                             */
  895. X/*  Type definitions all dumped here.                          */
  896. X/*                                                             */
  897. X/*  This file is part of REMIND.                               */
  898. X/*  Copyright (C) 1991 by David F. Skoll.                      */
  899. X/*                                                             */
  900. X/***************************************************************/
  901. X/* Values */
  902. Xtypedef struct {
  903. X   char type;
  904. X   union {
  905. X      char *str;
  906. X      int val;
  907. X   } v;
  908. X} Value;
  909. X
  910. X/* Define the type of operators */
  911. Xtypedef struct {
  912. X   char *name;
  913. X   char prec;
  914. X   char type;
  915. X#ifdef HAVE_PROTOS
  916. X   int (*func)(void);
  917. X#else
  918. X   int (*func) ();
  919. X#endif
  920. X} Operator;
  921. X
  922. X/* Define the structure of a variable */
  923. Xtypedef struct var {
  924. X   struct var *next;
  925. X   char name[VAR_NAME_LEN+1];
  926. X   char preserve;
  927. X   Value v;
  928. X} Var;
  929. X
  930. X/* A trigger */
  931. Xtypedef struct {
  932. X   int wd;
  933. X   int d;
  934. X   int m;
  935. X   int y;
  936. X   int back;
  937. X   int delta;
  938. X   int rep;
  939. X   int localomit;
  940. X   int skip;
  941. X   int until;
  942. X   int typ;
  943. X   int once;
  944. X} Trigger;
  945. X
  946. X/* A time trigger */
  947. Xtypedef struct {
  948. X   int ttime;
  949. X   int nexttime;
  950. X   int delta;
  951. X   int rep;
  952. X} TimeTrig;
  953. X
  954. X/* The parse pointer */
  955. Xtypedef struct {
  956. X   char isnested;        /* Is it a nested expression? */
  957. X   char allownested;
  958. X   char *text;           /* Start of text */
  959. X   char *pos;            /* Current position */
  960. X   char *etext;          /* Substituted text */
  961. X   char *epos;           /* Position in substituted text */
  962. X} Parser;
  963. X
  964. Xtypedef Parser *ParsePtr;  /* Pointer to parser structure */
  965. X
  966. X/* Some useful manifest constants */
  967. X#define NO_BACK 0
  968. X#define NO_DELTA 0
  969. X#define NO_REP 0
  970. X#define NO_WD 0
  971. X#define NO_DAY -1
  972. X#define NO_MON -1
  973. X#define NO_YR -1
  974. X#define NO_UNTIL -1
  975. X#define NO_ONCE 0
  976. X#define ONCE_ONCE 1
  977. X
  978. X#define NO_SKIP 0
  979. X#define SKIP_SKIP 1
  980. X#define BEFORE_SKIP 2
  981. X#define AFTER_SKIP 3
  982. X
  983. X#define NO_TIME 1500 /* >1440, ie > than the largest possible legal time */
  984. X
  985. X#define NO_TYPE  0
  986. X#define MSG_TYPE 1
  987. X#define RUN_TYPE 2
  988. X#define CAL_TYPE 3
  989. X#define SAT_TYPE 4
  990. X
  991. X/* DEFINES for debugging flags */
  992. X#define DB_PRTLINE   1
  993. X#define DB_PRTEXPR   2
  994. X#define DB_PRTTRIG   4
  995. X#define DB_DUMP_VARS 8
  996. X#define DB_ECHO_LINE 16
  997. X
  998. X/* Enumeration of the tokens */
  999. Xenum TokTypes
  1000. X{ T_Illegal,
  1001. X  /* Commands first */
  1002. X  T_Rem, T_Push, T_Pop, T_Preserve, T_Include, T_If, T_Else, T_EndIf,
  1003. X  T_IfTrig, T_ErrMsg,
  1004. X  T_Set, T_UnSet, T_Fset, T_Omit, T_Banner, T_Exit,
  1005. X  T_WkDay,
  1006. X  T_Month, T_Time,
  1007. X  T_Skip, T_At, T_RemType, T_Until, T_Year, T_Day, T_Rep, T_Delta, T_Back,
  1008. X  T_Once,
  1009. X  T_Empty,
  1010. X  T_Comment,
  1011. X  T_Number,
  1012. X  T_Clr,
  1013. X  T_Debug,
  1014. X  T_Dumpvars
  1015. X};
  1016. X
  1017. X/* The structure of a token */
  1018. Xtypedef struct {
  1019. X   char *name;
  1020. X   char MinLen;
  1021. X   enum TokTypes type;
  1022. X   int val;
  1023. X} Token;
  1024. X
  1025. X/* Flags for the state of the "if" stack */
  1026. X#define IF_TRUE      0
  1027. X#define IF_FALSE     1
  1028. X#define BEFORE_ELSE  0
  1029. X#define AFTER_ELSE   2
  1030. X#define IF_MASK      3
  1031. X#define IF_TRUE_MASK 1
  1032. X#define IF_ELSE_MASK 2
  1033. X
  1034. X/* Flags for the DoSubst function */
  1035. X#define NORMAL_MODE 0
  1036. X#define CAL_MODE 1
  1037. X#define QUOTE_MARKER 1 /* Unlikely character to appear in reminder */
  1038. X
  1039. X/* Flags for disabling run */
  1040. X#define RUN_CMDLINE 1
  1041. X#define RUN_SCRIPT  2
  1042. X
  1043. X/* Flags for the SimpleCalendar format */
  1044. X#define SC_AMPM   0   /* Time shown as 3:00am, etc. */
  1045. X#define SC_MIL    1   /* 24-hour time format */
  1046. X#define SC_NOTIME 2   /* Do not display time in SC format. */
  1047. SHAR_EOF
  1048. $TOUCH -am 1109141292 types.h &&
  1049. chmod 0600 types.h ||
  1050. echo "restore of types.h failed"
  1051. set `wc -c types.h`;Wc_c=$1
  1052. if test "$Wc_c" != "3594"; then
  1053.     echo original size 3594, current size $Wc_c
  1054. fi
  1055. fi
  1056. # ============= version.h ==============
  1057. if test X"$1" != X"-c" -a -f 'version.h'; then
  1058.     echo "File already exists: skipping 'version.h'"
  1059. else
  1060. echo "x - extracting version.h (Text)"
  1061. sed 's/^X//' << 'SHAR_EOF' > version.h &&
  1062. X/***************************************************************/
  1063. X/*                                                             */
  1064. X/*  VERSION.H                                                  */
  1065. X/*                                                             */
  1066. X/*  What version of remind do we have?                         */
  1067. X/*                                                             */
  1068. X/*  This file is part of REMIND.                               */
  1069. X/*  Copyright (C) 1991 by David F. Skoll.                      */
  1070. X/*                                                             */
  1071. X/***************************************************************/
  1072. X
  1073. X#define VERSION "03.00.00"
  1074. SHAR_EOF
  1075. $TOUCH -am 1109141292 version.h &&
  1076. chmod 0600 version.h ||
  1077. echo "restore of version.h failed"
  1078. set `wc -c version.h`;Wc_c=$1
  1079. if test "$Wc_c" != "688"; then
  1080.     echo original size 688, current size $Wc_c
  1081. fi
  1082. fi
  1083. echo "End of part 1, continue with part 2"
  1084. exit 0
  1085.  
  1086. exit 0 # Just in case...
  1087.