home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume40 / remind / patch11a < prev    next >
Encoding:
Text File  |  1993-11-26  |  45.3 KB  |  1,580 lines

  1. Newsgroups: comp.sources.misc
  2. From: dfs@doe.carleton.ca (David F. Skoll)
  3. Subject: v40i167:  remind - A replacement for calendar, Patch11a/5
  4. Message-ID: <csm-v40i167=remind.105615@sparky.Sterling.COM>
  5. X-Md4-Signature: 5114f89c24770131ddaac4399a0b15f3
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Reply-To: dfs@doe.carleton.ca (David F. Skoll)
  8. Organization: Dept. of Electronics, Carleton University
  9. Date: Fri, 26 Nov 1993 16:56:44 GMT
  10. Approved: kent@sparky.sterling.com
  11.  
  12. Submitted-by: dfs@doe.carleton.ca (David F. Skoll)
  13. Posting-number: Volume 40, Issue 167
  14. Archive-name: remind/patch11a
  15. Environment: UNIX, MS-DOS, OS/2
  16. Patch-To: remind: Volume 33, Issue 58-69
  17.  
  18. This is patch 11 for version 3.0 of Remind.
  19.  
  20. Remind is a sophisticated calendar/alarm program, which runs under
  21. MS-DOS, UNIX and OS/2.
  22.  
  23. This patch is primarily to fix bugs and improve OS/2 support.
  24. A couple of minor features have been added.
  25.  
  26. AVAILABILITY: Remind is available via anonymous ftp at ftp.doe.carleton.ca
  27. (134.117.9.35) in the directory /pub/remind-3.0 - see the file README.1st
  28. in that directory for a list of files.
  29.  
  30. TeX OUTPUT: Norman Walsh has written a program caleld 'rem2tex' which
  31. takes the output of 'remind -p ...' and produces a TeX calendar rather
  32. than a PostScript calendar.  This program is supported by Mr. Walsh
  33. and is not part of the official Remind release.  For more information,
  34. write to Norman Walsh <norm@ora.com>.
  35.  
  36.  From the WHATSNEW file:
  37.  
  38. CHANGES TO REMIND
  39.  
  40. * Version 3.0 Patch 11
  41.  
  42. + MINOR ENHANCEMENTS
  43.  
  44. - Added release notes to README.UNIX and README.OS2 describing one
  45.   way to make pop-up alarms under X-Windows and Presentation Manager.
  46.  
  47. - Added the $DefaultPrio system variable
  48.  
  49. - Improved OS/2 support, thanks to Darrel Hankerson, Russ Herman
  50.   and Norman Walsh.
  51.  
  52. - Made the pushing and popping of operators and operands during
  53.   expression evaluation in-line code instead of function calls.  Did the
  54.   same for DestroyValue.  I'm not sure if this was a good idea -- on the
  55.   Sparc using gcc, this slowed things down... go figure.
  56.  
  57. + BUG FIXES
  58.  
  59. - Fixed a potential memory leak in the char() function.
  60.  
  61. - Made the TRIGGER() built-in function return its answer in English even
  62.   for the foreign-language versions -- this was required for compilers which
  63.   are not 8-bit clean, and for languages with accented letters.
  64.  
  65. - Made expression evaluation slightly faster by eliminating some unnecessary
  66.   copying of string values.
  67.  
  68. - Corrected some non-portable definitions of the macro UPPER(c)
  69.  
  70. - Fixed typos in french.h
  71.  
  72. -------------- Cut Here ---------- Cut Here ---------- Cut Here -------------
  73. #!/bin/sh
  74. # This is Remind-3.0/Patch-11/part, a shell archive (shar 3.32)
  75. # made 11/23/1993 16:02 UTC by <dfs@doe.carleton.ca> (David F. Skoll)
  76. # Source directory /tmp_mnt/home/dfs/work/.rem/Remind-3.0/cur
  77. #
  78. # existing files WILL be overwritten
  79. #
  80. # This is part 1 of a multipart archive                                    
  81. # do not concatenate these parts, unpack them in order with /bin/sh        
  82. #
  83. # This shar contains:
  84. # length  mode       name
  85. # ------ ---------- ------------------------------------------
  86. # 169648 -rw------- patch.11
  87. #
  88. if touch 2>&1 | fgrep 'amc' > /dev/null
  89.  then TOUCH=touch
  90.  else TOUCH=true
  91. fi
  92. if test -r shar3_seq_.tmp; then
  93.     echo "Must unpack archives in sequence!"
  94.     next=`cat shar3_seq_.tmp`; echo "Please unpack part $next next"
  95.     exit 1
  96. fi
  97. # ============= patch.11 ==============
  98. echo "x - extracting patch.11 (Text)"
  99. sed 's/^X//' << 'SHAR_EOF' > patch.11 &&
  100. XOfficial Patch 11 for Remind 03.00.
  101. XMostly small fixes and better OS/2 support.
  102. X
  103. XPrereq: "03.00.10"
  104. X*** ../prev/version.h    Wed Oct 20 14:47:27 1993
  105. X--- ./version.h    Thu Oct 21 12:38:51 1993
  106. X***************
  107. X*** 9,12 ****
  108. X  /*                                                             */
  109. X  /***************************************************************/
  110. X  
  111. X! #define VERSION "03.00.10"
  112. X--- 9,12 ----
  113. X  /*                                                             */
  114. X  /***************************************************************/
  115. X  
  116. X! #define VERSION "03.00.11"
  117. X*** ../prev/Makefile    Tue Oct 12 16:29:09 1993
  118. X--- ./Makefile    Thu Oct 21 12:40:51 1993
  119. X***************
  120. X*** 53,59 ****
  121. X  # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  122. X  # in config.h; then, you should be able to type 'make'.
  123. X  #-----------------------------------------------------------------------------
  124. X! VERSION= 03.00.10
  125. X  MATHLIB= -lm
  126. X  
  127. X  HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  128. X--- 53,59 ----
  129. X  # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  130. X  # in config.h; then, you should be able to type 'make'.
  131. X  #-----------------------------------------------------------------------------
  132. X! VERSION= 03.00.11
  133. X  MATHLIB= -lm
  134. X  
  135. X  HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  136. X***************
  137. X*** 119,126 ****
  138. X  var.o: var.c $(STDHDRS) expr.h
  139. X  
  140. X  tarZ:
  141. X!     tar cvf remind-3.0.10.tar $(MANIFEST)
  142. X!     compress -v remind-3.0.10.tar
  143. X  
  144. X  shar:
  145. X      shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
  146. X--- 119,126 ----
  147. X  var.o: var.c $(STDHDRS) expr.h
  148. X  
  149. X  tarZ:
  150. X!     tar cvf remind-3.0.11.tar $(MANIFEST)
  151. X!     compress -v remind-3.0.11.tar
  152. X  
  153. X  shar:
  154. X      shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
  155. X***************
  156. X*** 192,200 ****
  157. X  release:
  158. X      -mkdir RELEASE
  159. X      -rm -f RELEASE/*
  160. X!     mkpatch ../prev . patch.10 Shar "Remind-3.0/Patch-10/part"
  161. X      mv Shar* RELEASE
  162. X!     rm -f patch.10
  163. X      for i in *.1; do nroff -man $$i | sed -e 's/_//g' > `basename $$i .1`.man; done
  164. X      mv *.man RELEASE
  165. X      for i in *.1; do groff -man -Tps $$i > `basename $$i .1`.ps; done
  166. X--- 192,200 ----
  167. X  release:
  168. X      -mkdir RELEASE
  169. X      -rm -f RELEASE/*
  170. X!     mkpatch ../prev . patch.11 Shar "Remind-3.0/Patch-11/part"
  171. X      mv Shar* RELEASE
  172. X!     rm -f patch.11
  173. X      for i in *.1; do nroff -man $$i | sed -e 's/_//g' > `basename $$i .1`.man; done
  174. X      mv *.man RELEASE
  175. X      for i in *.1; do groff -man -Tps $$i > `basename $$i .1`.ps; done
  176. X*** ../prev/README.BCC    Tue Oct 12 16:24:02 1993
  177. X--- ./README.BCC    Tue Nov 16 13:59:14 1993
  178. X***************
  179. X*** 22,30 ****
  180. X  NOTE that I do not have access to an OS/2 system, so support for this
  181. X  system may not be as good as I'd like.
  182. X  
  183. X! OS/2 support is courtesy of DARREL HANKERSON <HANK@DUCVAX.AUBURN.EDU>.
  184. X! BCC support is courtesy of Russ Herman <rwh@gov.on.ca>.
  185. X! However, if you have problems, please contact me and not Darrel.
  186. X  
  187. X  OTHER LANGUAGE SUPPORT
  188. X  
  189. X--- 22,30 ----
  190. X  NOTE that I do not have access to an OS/2 system, so support for this
  191. X  system may not be as good as I'd like.
  192. X  
  193. X! OS/2 support is courtesy of Russ Herman <rwh@gov.on.ca>, Norman Walsh 
  194. X! <norm@ora.com>, and Darrel Hankerson <hankedr@mail.auburn.edu>. 
  195. X! However, if you have problems, please contact me.
  196. X  
  197. X  OTHER LANGUAGE SUPPORT
  198. X  
  199. X*** ../prev/README.OS2    Wed Oct 13 10:51:42 1993
  200. X--- ./README.OS2    Wed Nov 17 11:56:10 1993
  201. X***************
  202. X*** 1,10 ****
  203. X  REMIND version 3.0 for OS/2
  204. X  
  205. X! This file contains instructions for compiling Remind with the
  206. X! Microsoft C compiler under OS/2.  However, there is better support
  207. X! for OS/2 using the Borland C compiler -- see the file README.BCC
  208. X! for details.
  209. X  
  210. X  REMIND is a sophisticated alarm/calendar program.  Details are given
  211. X  in the man page, "remind.1".
  212. X  
  213. X--- 1,13 ----
  214. X  REMIND version 3.0 for OS/2
  215. X  
  216. X! This file contains instructions for compiling Remind under OS/2 with
  217. X! Eberhard Mattes' emx/gcc compiler and with the Microsoft C compiler.
  218. X! There are a number of targets in Makefile.os2, including OS/2-only 
  219. X! versions and bound versions (programs which run under OS/2 and DOS).
  220. X  
  221. X+ Note that there is also support for OS/2 using the Borland C 
  222. X+ compiler--see the file README.BCC for details.
  223. X+ 
  224. X  REMIND is a sophisticated alarm/calendar program.  Details are given
  225. X  in the man page, "remind.1".
  226. X  
  227. X***************
  228. X*** 11,30 ****
  229. X  1 - Read the file COPYRIGHT.  (This may be called COPYRIGH on your
  230. X      MS-DOS system.)
  231. X  
  232. X! 2 - To compile Remind for OS/2, you must use the Microsoft C compiler.
  233. X!     You must also have a decent version of 'make', such as dmake.
  234. X  
  235. X  3 - Examine the file config.h and adjust parameters as needed
  236. X  
  237. X! 4 - Examine the file makefile.os2 and adjust parameters as needed.
  238. X  
  239. X  5 - Type:
  240. X  
  241. X!     make -f makefile.os2
  242. X  
  243. X! This will make 'remind.exe' which is an OS/2 1.x--2.0 executable, and
  244. X! 'remindb.exe' which is an OS/2 and MSDOS bound executable.
  245. X  
  246. X  The file "defs.rem" has some sample Remind definitions and commands,
  247. X  as well as U.S. and Jewish holidays.
  248. X  
  249. X--- 14,37 ----
  250. X  1 - Read the file COPYRIGHT.  (This may be called COPYRIGH on your
  251. X      MS-DOS system.)
  252. X  
  253. X! 2 - To compile Remind for OS/2, you must use the Microsoft C compiler
  254. X!     or emx/gcc. You must also have a decent version of 'make', such 
  255. X!     as dmake or GNU make.
  256. X  
  257. X  3 - Examine the file config.h and adjust parameters as needed
  258. X  
  259. X! 4 - Examine the file Makefile.os2 and adjust parameters as needed.
  260. X  
  261. X  5 - Type:
  262. X  
  263. X!     make -f Makefile.os2
  264. X  
  265. X! to see a list of targets. For example, 
  266. X  
  267. X+     make -f Makefile.os2 emx
  268. X+ 
  269. X+ will build a 32-bit emx version which runs under OS/2 2.x and DOS.
  270. X+ 
  271. X  The file "defs.rem" has some sample Remind definitions and commands,
  272. X  as well as U.S. and Jewish holidays.
  273. X  
  274. X***************
  275. X*** 31,38 ****
  276. X  NOTE that I do not have access to an OS/2 system, so support for this
  277. X  system may not be as good as I'd like.
  278. X  
  279. X! OS/2 support is courtesy of DARREL HANKERSON <HANK@DUCVAX.AUBURN.EDU>.
  280. X! However, if you have problems, please contact me and not Darrel.
  281. X  
  282. X  OTHER LANGUAGE SUPPORT
  283. X  
  284. X--- 38,46 ----
  285. X  NOTE that I do not have access to an OS/2 system, so support for this
  286. X  system may not be as good as I'd like.
  287. X  
  288. X! OS/2 support is courtesy of Russ Herman <rwh@gov.on.ca>, Norman Walsh 
  289. X! <norm@ora.com>, and Darrel Hankerson <hankedr@mail.auburn.edu>. 
  290. X! However, if you have problems, please contact me.
  291. X  
  292. X  OTHER LANGUAGE SUPPORT
  293. X  
  294. X***************
  295. X*** 61,66 ****
  296. X--- 69,130 ----
  297. X  
  298. X  - You should define L_LANGNAME to be the full English name of your language,
  299. X    with the first letter capitalized and the rest lower-case.
  300. X+ 
  301. X+ RELEASE NOTES -- miscellaneous info that couldn't go anywhere else!
  302. X+ 
  303. X+ 1. POPUP REMINDERS
  304. X+ 
  305. X+ If you define the symbol OS2_POPUP in the OS/2 Makefile, you get
  306. X+ "full-screen popups" (as implemented by Russ Herman) for all MSG-
  307. X+ and MSF-type reminders.  You may or may not like this feature.
  308. X+ 
  309. X+ One way of implementing popup reminders is to get the program
  310. X+ "pmpopup.exe" from ftp-os2.cdrom.com, and using Remind with the
  311. X+ '-k' option as follows from C:\STARTUP.CMD:
  312. X+ 
  313. X+ start /pm /inv /n remind "-kstart pmpopup %%s" remfile
  314. X+ 
  315. X+ Alternatively, if you have the Vrexx package, you can use this
  316. X+ procedure suggested by Norman Walsh:
  317. X+ 
  318. X+ Start remind like this in C:\STARTUP.CMD:
  319. X+ 
  320. X+ start /pm /inv /n \bin\remind -faz "-kstart popupmsg %%s" .reminders
  321. X+ 
  322. X+ The popups are done by POPUPMSG.CMD which looks like this:
  323. X+ 
  324. X+ -------------- Cut Here ---------- Cut Here ---------- Cut Here --------
  325. X+ /* PopUpMsg */
  326. X+ 
  327. X+ '@echo off'
  328. X+ 
  329. X+ parse arg theargs
  330. X+ if theargs = "" then
  331. X+   theargs = "Empty message"
  332. X+ 
  333. X+ call RxFuncAdd 'VInit', 'VREXX', 'VINIT'
  334. X+ initcode = VInit()
  335. X+ if initcode = 'ERROR' then signal CLEANUP
  336. X+ 
  337. X+ signal on failure name CLEANUP
  338. X+ signal on halt name CLEANUP
  339. X+ signal on syntax name CLEANUP
  340. X+ 
  341. X+ /* example VMsgBox call */
  342. X+ 
  343. X+ msg.0 = 1
  344. X+ msg.1 = theargs
  345. X+ 
  346. X+ call VDialogPos 50, 50
  347. X+ call VMsgBox 'Popup Message', msg, 1
  348. X+ 
  349. X+ /* end of CMD file */
  350. X+ 
  351. X+ CLEANUP:
  352. X+    call VExit
  353. X+ 
  354. X+ exit
  355. X+ -------------- Cut Here ---------- Cut Here ---------- Cut Here --------
  356. X  
  357. X  --
  358. X  David F. Skoll <dfs@doe.carleton.ca>
  359. X*** ../prev/README.UNIX    Tue Oct 12 16:22:35 1993
  360. X--- ./README.UNIX    Tue Nov 16 13:51:51 1993
  361. X***************
  362. X*** 88,93 ****
  363. X--- 88,134 ----
  364. X    name of your language, with the first letter capitalized and the rest
  365. X    lower-case.
  366. X  
  367. X+ RELEASE NOTES -- miscellaneous info that couldn't go anywhere else!
  368. X+ 
  369. X+ 1. POPUP REMINDERS
  370. X+ 
  371. X+ If you're running under X-Windows and you have the TCL tools,
  372. X+ you can create simple pop-up reminders by creating the following
  373. X+ TCL script called 'popup'.  It pops a message on to the screen and
  374. X+ waits for you to press the 'OK' button.  If you don't press the OK button
  375. X+ within 15 seconds, it exits anyway.  To use it, you can use the '-k' option
  376. X+ for Remind as follows:
  377. X+ 
  378. X+     remind "-kpopup '%s'&" .reminders
  379. X+ 
  380. X+ Or use the following in your Remind script:
  381. X+ 
  382. X+     REM AT 17:00 RUN popup 'Time to go home.' &
  383. X+ 
  384. X+ This TCL script is a slightly modified version of one submitted by
  385. X+ Norman Walsh.  TCL is available via FTP at ftp.uu.net in /languages/tcl.
  386. X+ 
  387. X+ -------------- Cut Here ---------- Cut Here ---------- Cut Here -------------
  388. X+ #!/usr/local/bin/wish -f
  389. X+ 
  390. X+ wm withdraw .
  391. X+ 
  392. X+ if { [ llength $argv ] == 1 } {
  393. X+   eval set msg $argv
  394. X+ } else {
  395. X+   eval set msg [ list $argv ]
  396. X+ }
  397. X+ 
  398. X+ after 15000 { destroy . ; exit }
  399. X+ 
  400. X+ tk_dialog .d { Message } $msg warning 0 { OK } 
  401. X+ 
  402. X+ destroy .
  403. X+ 
  404. X+ exit
  405. X+ -------------- Cut Here ---------- Cut Here ---------- Cut Here -------------
  406. X+ 
  407. X+ 
  408. X  --
  409. X  David F. Skoll <dfs@doe.carleton.ca>
  410. X  986 Eiffel Avenue
  411. X*** ../prev/WHATSNEW.30    Wed Oct 20 12:23:25 1993
  412. X--- ./WHATSNEW.30    Tue Nov 16 17:42:21 1993
  413. X***************
  414. X*** 1,5 ****
  415. X--- 1,37 ----
  416. X  CHANGES TO REMIND
  417. X  
  418. X+ * Version 3.0 Patch 11
  419. X+ 
  420. X+ + MINOR ENHANCEMENTS
  421. X+ 
  422. X+ - Added release notes to README.UNIX and README.OS2 describing one
  423. X+   way to make pop-up alarms under X-Windows and Presentation Manager.
  424. X+ 
  425. X+ - Added the $DefaultPrio system variable
  426. X+ 
  427. X+ - Improved OS/2 support, thanks to Darrel Hankerson, Russ Herman
  428. X+   and Norman Walsh.
  429. X+ 
  430. X+ - Made the pushing and popping of operators and operands during
  431. X+   expression evaluation in-line code instead of function calls.  Did the
  432. X+   same for DestroyValue.  I'm not sure if this was a good idea -- on the
  433. X+   Sparc using gcc, this slowed things down... go figure.
  434. X+ 
  435. X+ + BUG FIXES
  436. X+ 
  437. X+ - Fixed a potential memory leak in the char() function.
  438. X+ 
  439. X+ - Made the TRIGGER() built-in function return its answer in English even
  440. X+   for the foreign-language versions -- this was required for compilers which
  441. X+   are not 8-bit clean, and for languages with accented letters.
  442. X+ 
  443. X+ - Made expression evaluation slightly faster by eliminating some unnecessary
  444. X+   copying of string values.
  445. X+ 
  446. X+ - Corrected some non-portable definitions of the macro UPPER(c)
  447. X+ 
  448. X+ - Fixed typos in french.h
  449. X+ 
  450. X  * Version 3.0 Patch 10
  451. X  
  452. X  + MAJOR ENHANCEMENT
  453. X*** ../prev/calendar.c    Tue Oct 12 16:22:37 1993
  454. X--- ./calendar.c    Tue Nov 16 17:41:51 1993
  455. X***************
  456. X*** 688,694 ****
  457. X             strcat(s, v.v.str);
  458. X             s += strlen(s);
  459. X              }
  460. X!         DestroyValue(&v);
  461. X           }
  462. X        }
  463. X        if ( (r=DoSubst(p, s, &trig, &tim, jul, CAL_MODE)) ) return r;
  464. X--- 688,694 ----
  465. X             strcat(s, v.v.str);
  466. X             s += strlen(s);
  467. X              }
  468. X!         DestroyValue(v);
  469. X           }
  470. X        }
  471. X        if ( (r=DoSubst(p, s, &trig, &tim, jul, CAL_MODE)) ) return r;
  472. X***************
  473. X*** 703,709 ****
  474. X             strcat(s, v.v.str);
  475. X             s += strlen(s);
  476. X              }
  477. X!         DestroyValue(&v);
  478. X           }
  479. X        }
  480. X        s = obuf;
  481. X--- 703,709 ----
  482. X             strcat(s, v.v.str);
  483. X             s += strlen(s);
  484. X              }
  485. X!         DestroyValue(v);
  486. X           }
  487. X        }
  488. X        s = obuf;
  489. X*** ../prev/config.h    Wed Oct 13 10:47:47 1993
  490. X--- ./config.h    Mon Nov 15 14:25:26 1993
  491. X***************
  492. X*** 169,179 ****
  493. X  /*---------------------------------------------------------------------*/
  494. X  /* Do we handle queued reminders?                                      */
  495. X  /*---------------------------------------------------------------------*/
  496. X! #ifdef UNIX
  497. X! #define HAVE_QUEUED 1
  498. X! #endif
  499. X! 
  500. X! #if defined(__BORLANDC__) && defined(__OS2__)
  501. X  #define HAVE_QUEUED 1
  502. X  #endif
  503. X  
  504. X--- 169,175 ----
  505. X  /*---------------------------------------------------------------------*/
  506. X  /* Do we handle queued reminders?                                      */
  507. X  /*---------------------------------------------------------------------*/
  508. X! #if defined(UNIX) || defined(__OS2__)
  509. X  #define HAVE_QUEUED 1
  510. X  #endif
  511. X  
  512. X*** ../prev/defs.rem    Wed Oct 13 11:55:57 1993
  513. X--- ./defs.rem    Fri Nov  5 15:57:33 1993
  514. X***************
  515. X*** 326,331 ****
  516. X--- 326,345 ----
  517. X  [trigger(moondate(2))] PS [psmoon(2)]
  518. X  [trigger(moondate(3))] PS [psmoon(3)]
  519. X  
  520. X+ # The following example puts sunrise and sunset times in PostScript in the
  521. X+ # calendar - the sizes are hard-coded, however, and work best in landscape.
  522. X+ REM PS Border Border 5 sub moveto \
  523. X+     /SmallFont findfont 4 scalefont setfont \
  524. X+     (Sunrise: [sunrise(trigdate())] Sunset: [sunset(trigdate())]) show
  525. X+ 
  526. X+ # The next one puts the day number (1-366) and days left in the year at the
  527. X+ # bottom of the post-script calendar.  Again, the hard-coded sizes work best
  528. X+ # in landscape.
  529. X+ FSET _DayOfYear(x) x-(date(year(x),1,1) - 1)
  530. X+ REM PS BoxWidth 3 mul 4 div Border 5 sub moveto \
  531. X+     /SmallFont findfont 4 scalefont setfont \
  532. X+     ([_DayOfYear(today())]([365+isleap(today())-_DayOfYear(today())])) show
  533. X+ 
  534. X  #USHOLS
  535. X  #############################################################################
  536. X  #                                           #
  537. X*** ../prev/dorem.c    Wed Oct 20 12:14:48 1993
  538. X--- ./dorem.c    Tue Nov 16 17:41:46 1993
  539. X***************
  540. X*** 88,95 ****
  541. X  
  542. X  
  543. X     if (ShouldTriggerReminder(&trig, &tim, jul)) {
  544. X!       if ( (r=TriggerReminder(p, &trig, &tim, jul)) ) return r;
  545. X     }
  546. X  
  547. X     return OK;
  548. X  }   
  549. X--- 88,101 ----
  550. X  
  551. X  
  552. X     if (ShouldTriggerReminder(&trig, &tim, jul)) {
  553. X! #ifdef OS2_POPUP
  554. X!       if ( (r=TriggerReminder(p, &trig, &tim, jul, 0)) ) {
  555. X! #else
  556. X!       if ( (r=TriggerReminder(p, &trig, &tim, jul)) ) {
  557. X! #endif
  558. X!      return r;
  559. X     }
  560. X+    }
  561. X  
  562. X     return OK;
  563. X  }   
  564. X***************
  565. X*** 127,133 ****
  566. X     trig->once = NO_ONCE;
  567. X     trig->typ = NO_TYPE;
  568. X     trig->scanfrom = NO_DATE;
  569. X!    trig->priority = NO_PRIORITY;
  570. X     trig->sched[0] = 0;
  571. X     tim->ttime = NO_TIME;
  572. X     tim->delta = NO_DELTA;
  573. X--- 133,139 ----
  574. X     trig->once = NO_ONCE;
  575. X     trig->typ = NO_TYPE;
  576. X     trig->scanfrom = NO_DATE;
  577. X!    trig->priority = DefaultPrio;
  578. X     trig->sched[0] = 0;
  579. X     tim->ttime = NO_TIME;
  580. X     tim->delta = NO_DELTA;
  581. X***************
  582. X*** 445,458 ****
  583. X  /*                                                             */
  584. X  /***************************************************************/
  585. X  #ifdef HAVE_PROTOS
  586. X  PUBLIC int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
  587. X! #else
  588. X  int TriggerReminder(p, t, tim, jul)
  589. X  ParsePtr p;
  590. X  Trigger *t;
  591. X  TimeTrig *tim;
  592. X  int jul;
  593. X! #endif
  594. X  {
  595. X     int r, y, m, d;
  596. X     char PrioExpr[25];
  597. X--- 451,478 ----
  598. X  /*                                                             */
  599. X  /***************************************************************/
  600. X  #ifdef HAVE_PROTOS
  601. X+ #ifdef OS2_POPUP
  602. X+ PUBLIC int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul,
  603. X+                int AsPopUp)
  604. X+ #else /* ! OS2_POPUP */
  605. X  PUBLIC int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
  606. X! #endif /* OS2_POPUP */
  607. X! #else /* ! HAVE_PROTOS */
  608. X! #ifdef OS2_POPUP
  609. X! int TriggerReminder(p, t, tim, jul, AsPopUp)
  610. X! ParsePtr p;
  611. X! Trigger *t;
  612. X! TimeTrig *tim;
  613. X! int jul;
  614. X! int AsPopUp;
  615. X! #else /* ! OS2_POPUP */
  616. X  int TriggerReminder(p, t, tim, jul)
  617. X  ParsePtr p;
  618. X  Trigger *t;
  619. X  TimeTrig *tim;
  620. X  int jul;
  621. X! #endif /* OS2_POPUP */
  622. X! #endif /* HAVE_PROTOS */
  623. X  {
  624. X     int r, y, m, d;
  625. X     char PrioExpr[25];
  626. X***************
  627. X*** 468,475 ****
  628. X     if ((t->typ == MSG_TYPE || t->typ == MSF_TYPE) 
  629. X         && !NumTriggered && !NextMode && !MsgCommand) {
  630. X        if (!DoSubstFromString(Banner, SubstBuffer, JulianToday, NO_TIME) && *SubstBuffer)
  631. X! #ifdef __OS2__
  632. X              PutlPopUp(SubstBuffer);
  633. X  #else
  634. X          printf("%s\n", SubstBuffer);
  635. X  #endif
  636. X--- 488,498 ----
  637. X     if ((t->typ == MSG_TYPE || t->typ == MSF_TYPE) 
  638. X         && !NumTriggered && !NextMode && !MsgCommand) {
  639. X        if (!DoSubstFromString(Banner, SubstBuffer, JulianToday, NO_TIME) && *SubstBuffer)
  640. X! #ifdef OS2_POPUP
  641. X!         if (AsPopUp)
  642. X              PutlPopUp(SubstBuffer);
  643. X+         else
  644. X+            printf("%s\n", SubstBuffer);
  645. X  #else
  646. X          printf("%s\n", SubstBuffer);
  647. X  #endif
  648. X***************
  649. X*** 481,492 ****
  650. X        if ( (r=DoSubst(p, SubstBuffer, t, tim, jul, CAL_MODE)) ) return r;
  651. X        if (!*SubstBuffer) return OK;
  652. X        FromJulian(jul, &y, &m, &d);
  653. X! #ifdef __OS2__
  654. X!       sprintf(buf, "%04d%c%02d%c%02d %s", y, DATESEP, m+1, DATESEP, d,
  655. X                      SimpleTime(tim->ttime, NULL));
  656. X!       StartPopUp();
  657. X!       PutsPopUp(buf);
  658. X!       PutlPopUp(SubstBuffer);
  659. X  #else
  660. X        printf("%04d%c%02d%c%02d %s%s\n", y, DATESEP, m+1, DATESEP, d,
  661. X                                        SimpleTime(tim->ttime, NULL),
  662. X--- 504,521 ----
  663. X        if ( (r=DoSubst(p, SubstBuffer, t, tim, jul, CAL_MODE)) ) return r;
  664. X        if (!*SubstBuffer) return OK;
  665. X        FromJulian(jul, &y, &m, &d);
  666. X! #ifdef OS2_POPUP
  667. X!       if (AsPopUp) {
  668. X!          sprintf(buf, "%04d%c%02d%c%02d %s", y, DATESEP, m+1, DATESEP, d,
  669. X                      SimpleTime(tim->ttime, NULL));
  670. X!          StartPopUp();
  671. X!          PutsPopUp(buf);
  672. X!          PutlPopUp(SubstBuffer);
  673. X!       }
  674. X!       else
  675. X!       printf("%04d%c%02d%c%02d %s%s\n", y, DATESEP, m+1, DATESEP, d,
  676. X!                       SimpleTime(tim->ttime, NULL),
  677. X!                       SubstBuffer);
  678. X  #else
  679. X        printf("%04d%c%02d%c%02d %s%s\n", y, DATESEP, m+1, DATESEP, d,
  680. X                                        SimpleTime(tim->ttime, NULL),
  681. X***************
  682. X*** 507,513 ****
  683. X          sprintf(s2, "%s", v.v.str);
  684. X          s2 += strlen(s2);
  685. X           }
  686. X!      DestroyValue(&v);
  687. X        }
  688. X     }
  689. X     if ( (r=DoSubst(p, s2, t, tim, jul, NORMAL_MODE)) ) return r;
  690. X--- 536,542 ----
  691. X          sprintf(s2, "%s", v.v.str);
  692. X          s2 += strlen(s2);
  693. X           }
  694. X!      DestroyValue(v);
  695. X        }
  696. X     }
  697. X     if ( (r=DoSubst(p, s2, t, tim, jul, NORMAL_MODE)) ) return r;
  698. X***************
  699. X*** 521,534 ****
  700. X          sprintf(s2, "%s", v.v.str);
  701. X          s2 += strlen(s2);
  702. X           }
  703. X!      DestroyValue(&v);
  704. X        }
  705. X     }
  706. X- #ifndef __OS2__
  707. X     if (t->typ == MSG_TYPE || t->typ == MSF_TYPE) {
  708. X- #else
  709. X-    if (t->typ == MSF_TYPE) {
  710. X- #endif
  711. X        *s2++ = '\n';
  712. X     }
  713. X     *s2 = 0;
  714. X--- 550,559 ----
  715. X          sprintf(s2, "%s", v.v.str);
  716. X          s2 += strlen(s2);
  717. X           }
  718. X!      DestroyValue(v);
  719. X        }
  720. X     }
  721. X     if (t->typ == MSG_TYPE || t->typ == MSF_TYPE) {
  722. X        *s2++ = '\n';
  723. X     }
  724. X     *s2 = 0;
  725. X***************
  726. X*** 549,556 ****
  727. X              sprintf(SubstBuffer, MsgCommand, buf);
  728. X          system(SubstBuffer);
  729. X           } else {
  730. X! #ifdef __OS2__
  731. X              PutlPopUp(buf);
  732. X  #else
  733. X              printf("%s", buf);
  734. X  #endif
  735. X--- 574,584 ----
  736. X              sprintf(SubstBuffer, MsgCommand, buf);
  737. X          system(SubstBuffer);
  738. X           } else {
  739. X! #ifdef OS2_POPUP
  740. X!         if (AsPopUp)
  741. X              PutlPopUp(buf);
  742. X+         else
  743. X+            printf("%s", buf);
  744. X  #else
  745. X              printf("%s", buf);
  746. X  #endif
  747. X***************
  748. X*** 558,569 ****
  749. X       break;
  750. X  
  751. X        case MSF_TYPE:
  752. X! #ifdef __OS2__
  753. X           StartPopUp();
  754. X! #endif
  755. X!          FillParagraph(buf);
  756. X! #ifdef __OS2__
  757. X           EndPopUp();
  758. X  #endif
  759. X       break;
  760. X  
  761. X--- 586,601 ----
  762. X       break;
  763. X  
  764. X        case MSF_TYPE:
  765. X! #ifdef OS2_POPUP
  766. X!      if (AsPopUp) {
  767. X           StartPopUp();
  768. X!          FillParagraph(buf, 1);
  769. X           EndPopUp();
  770. X+      } else {
  771. X+          FillParagraph(buf, 0);
  772. X+      }
  773. X+ #else
  774. X+      FillParagraph(buf);
  775. X  #endif
  776. X       break;
  777. X  
  778. X*** ../prev/dosubst.c    Tue Oct 12 16:22:38 1993
  779. X--- ./dosubst.c    Tue Nov  2 14:50:16 1993
  780. X***************
  781. X*** 25,31 ****
  782. X  #include "types.h"
  783. X  #include "protos.h"
  784. X  
  785. X! #define UPPER(c) ( ((c) >= 'a' && (c) <= 'z') ? (c) - 'a' + 'A' : (c) )
  786. X  #define ABS(x) ( (x) < 0 ? -(x) : (x) )
  787. X  #ifndef NL
  788. X  #define NL "\n"
  789. X--- 25,31 ----
  790. X  #include "types.h"
  791. X  #include "protos.h"
  792. X  
  793. X! #define UPPER(c) (islower(c) ? toupper(c) : c)
  794. X  #define ABS(x) ( (x) < 0 ? -(x) : (x) )
  795. X  #ifndef NL
  796. X  #define NL "\n"
  797. X*** ../prev/expr.c    Tue Oct 12 16:22:39 1993
  798. X--- ./expr.c    Tue Nov 16 17:41:38 1993
  799. X***************
  800. X*** 53,60 ****
  801. X  #endif
  802. X  
  803. X  PRIVATE int MakeValue ARGS ((char *s, Value *v, Var *locals));
  804. X- PRIVATE int PushOpStack ARGS ((Operator *op));
  805. X- PRIVATE int PopOpStack ARGS ((Operator *op));
  806. X  PRIVATE int ParseLiteralDate ARGS ((char **s, int *jul));
  807. X  
  808. X  /* Binary operators - all left-associative */
  809. X--- 53,58 ----
  810. X***************
  811. X*** 145,151 ****
  812. X  {
  813. X     int i;
  814. X  
  815. X!    for (i=0; i<ValStackPtr; i++) DestroyValue(&ValStack[i]);
  816. X     ValStackPtr = 0;
  817. X  }
  818. X  
  819. X--- 143,149 ----
  820. X  {
  821. X     int i;
  822. X  
  823. X!    for (i=0; i<ValStackPtr; i++) DestroyValue(ValStack[i]);
  824. X     ValStackPtr = 0;
  825. X  }
  826. X  
  827. X***************
  828. X*** 286,293 ****
  829. X        CleanStack();
  830. X        return r;
  831. X     }
  832. X!    r = CopyValue(v, ValStack);
  833. X!    DestroyValue(ValStack);
  834. X     return r;
  835. X  }
  836. X  
  837. X--- 284,291 ----
  838. X        CleanStack();
  839. X        return r;
  840. X     }
  841. X!    *v = *ValStack;
  842. X!    ValStack[0].type = ERR_TYPE;
  843. X     return r;
  844. X  }
  845. X  
  846. X***************
  847. X*** 363,370 ****
  848. X        } else { /* Unary operator */
  849. X       f = FindFunc(ExprBuf, UnOp, NUM_UN_OPS);
  850. X           if (f) {
  851. X!             r = PushOpStack(f);
  852. X!             if (r) return r;
  853. X          continue;  /* Still looking for an atomic vlue */
  854. X       } else if (!ISID(*ExprBuf) && *ExprBuf != '$' 
  855. X                  && *ExprBuf != '"' && *ExprBuf != '\'') {
  856. X--- 361,367 ----
  857. X        } else { /* Unary operator */
  858. X       f = FindFunc(ExprBuf, UnOp, NUM_UN_OPS);
  859. X           if (f) {
  860. X!             PushOpStack(*f);
  861. X          continue;  /* Still looking for an atomic vlue */
  862. X       } else if (!ISID(*ExprBuf) && *ExprBuf != '$' 
  863. X                  && *ExprBuf != '"' && *ExprBuf != '\'') {
  864. X***************
  865. X*** 373,380 ****
  866. X       } else { /* Must be a literal value */
  867. X          r = MakeValue(ExprBuf, &va, locals);
  868. X          if (r) return r;
  869. X!         r = PushValStack(&va);
  870. X!         if (r) return r;
  871. X       }
  872. X        }
  873. X  /* OK, we've got a literal value; now, we're looking for the end of the
  874. X--- 370,376 ----
  875. X       } else { /* Must be a literal value */
  876. X          r = MakeValue(ExprBuf, &va, locals);
  877. X          if (r) return r;
  878. X!         PushValStack(va);
  879. X       }
  880. X        }
  881. X  /* OK, we've got a literal value; now, we're looking for the end of the
  882. X***************
  883. X*** 385,392 ****
  884. X     /* We've hit the end of the expression.  Pop off and evaluate until
  885. X           OpStackPtr = OpBase and ValStackPtr = ValBase+1 */
  886. X           while (OpStackPtr > OpBase) {
  887. X!             r = PopOpStack(&op);
  888. X!             if (r) return r;
  889. X          if (DebugFlag & DB_PRTEXPR)
  890. X             r=DebugPerform(&op);
  891. X          else
  892. X--- 381,387 ----
  893. X     /* We've hit the end of the expression.  Pop off and evaluate until
  894. X           OpStackPtr = OpBase and ValStackPtr = ValBase+1 */
  895. X           while (OpStackPtr > OpBase) {
  896. X!             PopOpStack(op);
  897. X          if (DebugFlag & DB_PRTEXPR)
  898. X             r=DebugPerform(&op);
  899. X          else
  900. X***************
  901. X*** 405,411 ****
  902. X        /* While operators of higher or equal precedence are on the stack,
  903. X           pop them off and evaluate */
  904. X        while (OpStackPtr > OpBase && OpStack[OpStackPtr-1].prec >= f->prec) {
  905. X!          r = PopOpStack(&op2);
  906. X           if (r) return r;
  907. X       if (DebugFlag & DB_PRTEXPR)
  908. X          r=DebugPerform(&op2);
  909. X--- 400,406 ----
  910. X        /* While operators of higher or equal precedence are on the stack,
  911. X           pop them off and evaluate */
  912. X        while (OpStackPtr > OpBase && OpStack[OpStackPtr-1].prec >= f->prec) {
  913. X!          PopOpStack(op2);
  914. X           if (r) return r;
  915. X       if (DebugFlag & DB_PRTEXPR)
  916. X          r=DebugPerform(&op2);
  917. X***************
  918. X*** 416,423 ****
  919. X          return r;
  920. X           }
  921. X        }
  922. X!       r = PushOpStack(f);
  923. X!       if (r) return r;
  924. X     }
  925. X  }
  926. X     
  927. X--- 411,417 ----
  928. X          return r;
  929. X           }
  930. X        }
  931. X!       PushOpStack(*f);
  932. X     }
  933. X  }
  934. X     
  935. X***************
  936. X*** 509,602 ****
  937. X  
  938. X  /***************************************************************/
  939. X  /*                                                             */
  940. X- /*  PushOpStack                                                */
  941. X- /*                                                             */
  942. X- /*  Push an operator onto the operator stack.                  */
  943. X- /*                                                             */
  944. X- /***************************************************************/
  945. X- #ifdef HAVE_PROTOS
  946. X- PRIVATE int PushOpStack(Operator *op)
  947. X- #else
  948. X- static int PushOpStack(op)
  949. X- Operator *op;
  950. X- #endif
  951. X- {
  952. X-    if (OpStackPtr >= OP_STACK_SIZE)
  953. X-       return E_OP_STK_OVER;
  954. X-    else {
  955. X-       OpStack[OpStackPtr++] = *op;
  956. X-       return OK;
  957. X-    }
  958. X- }
  959. X- 
  960. X- /***************************************************************/
  961. X- /*                                                             */
  962. X- /*  PushValStack                                               */
  963. X- /*                                                             */
  964. X- /*  Push a value onto the value stack.                         */
  965. X- /*                                                             */
  966. X- /***************************************************************/
  967. X- #ifdef HAVE_PROTOS
  968. X- PUBLIC int PushValStack(Value *val)
  969. X- #else
  970. X- int PushValStack(val)
  971. X- Value *val;
  972. X- #endif
  973. X- {
  974. X-    if (ValStackPtr >= VAL_STACK_SIZE)
  975. X-       return E_VA_STK_OVER;
  976. X-    else {
  977. X-       ValStack[ValStackPtr++] = *val;
  978. X-       return OK;
  979. X-    }
  980. X- }
  981. X- 
  982. X- /***************************************************************/
  983. X- /*                                                             */
  984. X- /*  PopOpStack                                                 */
  985. X- /*                                                             */
  986. X- /*  Pop an operator from the operator stack.                   */
  987. X- /*                                                             */
  988. X- /***************************************************************/
  989. X- #ifdef HAVE_PROTOS
  990. X- PRIVATE int PopOpStack(Operator *op)
  991. X- #else
  992. X- static int PopOpStack(op)
  993. X- Operator *op;
  994. X- #endif
  995. X- {
  996. X-    if (OpStackPtr <= 0)
  997. X-       return E_OP_STK_UNDER;
  998. X-    else {
  999. X-       *op = OpStack[--OpStackPtr];
  1000. X-       return OK;
  1001. X-    }
  1002. X- }
  1003. X- 
  1004. X- /***************************************************************/
  1005. X- /*                                                             */
  1006. X- /*  PopValStack                                               */
  1007. X- /*                                                             */
  1008. X- /*  Pop a value onto the value stack.                         */
  1009. X- /*                                                             */
  1010. X- /***************************************************************/
  1011. X- #ifdef HAVE_PROTOS
  1012. X- PUBLIC int PopValStack(Value *val)
  1013. X- #else
  1014. X- int PopValStack(val)
  1015. X- Value *val;
  1016. X- #endif
  1017. X- {
  1018. X-    if (ValStackPtr <= 0)
  1019. X-       return E_VA_STK_UNDER;
  1020. X-    else {
  1021. X-       *val = ValStack[--ValStackPtr];
  1022. X-       return OK;
  1023. X-    }
  1024. X- }
  1025. X- 
  1026. X- /***************************************************************/
  1027. X- /*                                                             */
  1028. X  /*  DoCoerce - actually coerce a value to the specified type.  */
  1029. X  /*                                                             */
  1030. X  /***************************************************************/
  1031. X--- 503,508 ----
  1032. X***************
  1033. X*** 726,749 ****
  1034. X  
  1035. X  /***************************************************************/
  1036. X  /*                                                             */
  1037. X- /*  DestroyValue                                               */
  1038. X- /*                                                             */
  1039. X- /*  If value is of type string, deallocate string memory.      */
  1040. X- /*                                                             */
  1041. X- /***************************************************************/
  1042. X- #ifdef HAVE_PROTOS
  1043. X- PUBLIC void DestroyValue(Value *v)
  1044. X- #else
  1045. X- void DestroyValue(v)
  1046. X- Value *v;
  1047. X- #endif
  1048. X- {
  1049. X-    if (v->type == STR_TYPE && v->v.str) free(v->v.str);
  1050. X-    v->type = ERR_TYPE;
  1051. X- }
  1052. X- 
  1053. X- /***************************************************************/
  1054. X- /*                                                             */
  1055. X  /*  Add                                                        */
  1056. X  /*                                                             */
  1057. X  /*  Perform addition.                                          */
  1058. X--- 632,637 ----
  1059. X***************
  1060. X*** 758,766 ****
  1061. X     Value v1, v2, v3;
  1062. X     int r;
  1063. X     
  1064. X!    if ( (r = PopValStack(&v2)) )return r;
  1065. X!    if ( (r = PopValStack(&v1)) ) {
  1066. X!       DestroyValue(&v2);
  1067. X        return r;
  1068. X     }
  1069. X     
  1070. X--- 646,654 ----
  1071. X     Value v1, v2, v3;
  1072. X     int r;
  1073. X     
  1074. X!    PopValStack(v2);
  1075. X!    if ( (r = FnPopValStack(&v1)) ) {
  1076. X!       DestroyValue(v2);
  1077. X        return r;
  1078. X     }
  1079. X     
  1080. X***************
  1081. X*** 767,773 ****
  1082. X  /* If both are ints, just add 'em */
  1083. X     if (v2.type == INT_TYPE && v1.type == INT_TYPE) {
  1084. X        v2.v.val += v1.v.val;
  1085. X!       return (PushValStack(&v2));
  1086. X     }
  1087. X  
  1088. X  /* If it's a date plus an int, add 'em */
  1089. X--- 655,662 ----
  1090. X  /* If both are ints, just add 'em */
  1091. X     if (v2.type == INT_TYPE && v1.type == INT_TYPE) {
  1092. X        v2.v.val += v1.v.val;
  1093. X!       PushValStack(v2);
  1094. X!       return OK;
  1095. X     }
  1096. X  
  1097. X  /* If it's a date plus an int, add 'em */
  1098. X***************
  1099. X*** 776,782 ****
  1100. X        v1.v.val += v2.v.val;
  1101. X        if (v1.v.val < 0) return E_DATE_OVER;
  1102. X        v1.type = DATE_TYPE;
  1103. X!       return PushValStack(&v1);
  1104. X     }
  1105. X     
  1106. X  /* If it's a time plus an int, add 'em mod 1440 */
  1107. X--- 665,672 ----
  1108. X        v1.v.val += v2.v.val;
  1109. X        if (v1.v.val < 0) return E_DATE_OVER;
  1110. X        v1.type = DATE_TYPE;
  1111. X!       PushValStack(v1);
  1112. X!       return OK;
  1113. X     }
  1114. X     
  1115. X  /* If it's a time plus an int, add 'em mod 1440 */
  1116. X***************
  1117. X*** 785,813 ****
  1118. X        v1.v.val = (v1.v.val + v2.v.val) % 1440;
  1119. X        if (v1.v.val < 0) v1.v.val += 1440;
  1120. X        v1.type = TIM_TYPE;
  1121. X!       return PushValStack(&v1);
  1122. X     }       
  1123. X  
  1124. X  /* If either is a string, coerce them both to strings and concatenate */
  1125. X     if (v1.type == STR_TYPE || v2.type == STR_TYPE) {
  1126. X        if ( (r = DoCoerce(STR_TYPE, &v1)) ) {
  1127. X!            DestroyValue(&v1); DestroyValue(&v2);
  1128. X           return r;
  1129. X        }
  1130. X        if ( (r = DoCoerce(STR_TYPE, &v2)) ) {
  1131. X!            DestroyValue(&v1); DestroyValue(&v2);
  1132. X             return r;
  1133. X        }
  1134. X        v3.type = STR_TYPE;
  1135. X        v3.v.str = (char *) malloc(strlen(v1.v.str) + strlen(v2.v.str) + 1);
  1136. X        if (!v3.v.str) {
  1137. X!            DestroyValue(&v1); DestroyValue(&v2);
  1138. X       return E_NO_MEM;
  1139. X        }
  1140. X        strcpy(v3.v.str, v1.v.str);
  1141. X        strcat(v3.v.str, v2.v.str);
  1142. X!       DestroyValue(&v1); DestroyValue(&v2);
  1143. X!       return (PushValStack(&v3));
  1144. X     }
  1145. X  
  1146. X     /* Don't handle other types yet */
  1147. X--- 675,705 ----
  1148. X        v1.v.val = (v1.v.val + v2.v.val) % 1440;
  1149. X        if (v1.v.val < 0) v1.v.val += 1440;
  1150. X        v1.type = TIM_TYPE;
  1151. X!       PushValStack(v1);
  1152. X!       return OK;
  1153. X     }       
  1154. X  
  1155. X  /* If either is a string, coerce them both to strings and concatenate */
  1156. X     if (v1.type == STR_TYPE || v2.type == STR_TYPE) {
  1157. X        if ( (r = DoCoerce(STR_TYPE, &v1)) ) {
  1158. X!            DestroyValue(v1); DestroyValue(v2);
  1159. X           return r;
  1160. X        }
  1161. X        if ( (r = DoCoerce(STR_TYPE, &v2)) ) {
  1162. X!            DestroyValue(v1); DestroyValue(v2);
  1163. X             return r;
  1164. X        }
  1165. X        v3.type = STR_TYPE;
  1166. X        v3.v.str = (char *) malloc(strlen(v1.v.str) + strlen(v2.v.str) + 1);
  1167. X        if (!v3.v.str) {
  1168. X!            DestroyValue(v1); DestroyValue(v2);
  1169. X       return E_NO_MEM;
  1170. X        }
  1171. X        strcpy(v3.v.str, v1.v.str);
  1172. X        strcat(v3.v.str, v2.v.str);
  1173. X!       DestroyValue(v1); DestroyValue(v2);
  1174. X!       PushValStack(v3);
  1175. X!       return OK;
  1176. X     }
  1177. X  
  1178. X     /* Don't handle other types yet */
  1179. X***************
  1180. X*** 830,838 ****
  1181. X     Value v1, v2;
  1182. X     int r;
  1183. X     
  1184. X!    if ( (r = PopValStack(&v2)) ) return r;
  1185. X!    if ( (r = PopValStack(&v1)) ) {
  1186. X!       DestroyValue(&v2);
  1187. X        return r;
  1188. X     }
  1189. X  
  1190. X--- 722,730 ----
  1191. X     Value v1, v2;
  1192. X     int r;
  1193. X     
  1194. X!    PopValStack(v2);
  1195. X!    if ( (r = FnPopValStack(&v1)) ) {
  1196. X!       DestroyValue(v2);
  1197. X        return r;
  1198. X     }
  1199. X  
  1200. X***************
  1201. X*** 839,845 ****
  1202. X     /* If they're both INTs, do subtraction */
  1203. X     if (v1.type == INT_TYPE && v2.type == INT_TYPE) {
  1204. X        v1.v.val -= v2.v.val;
  1205. X!       return PushValStack(&v1);
  1206. X     }
  1207. X  
  1208. X     /* If it's a date minus an int, do subtraction, checking for underflow */
  1209. X--- 731,738 ----
  1210. X     /* If they're both INTs, do subtraction */
  1211. X     if (v1.type == INT_TYPE && v2.type == INT_TYPE) {
  1212. X        v1.v.val -= v2.v.val;
  1213. X!       PushValStack(v1);
  1214. X!       return OK;
  1215. X     }
  1216. X  
  1217. X     /* If it's a date minus an int, do subtraction, checking for underflow */
  1218. X***************
  1219. X*** 846,852 ****
  1220. X     if (v1.type == DATE_TYPE && v2.type == INT_TYPE) {
  1221. X        v1.v.val -= v2.v.val;
  1222. X        if (v1.v.val < 0) return E_DATE_OVER;
  1223. X!       return PushValStack(&v1);
  1224. X     }
  1225. X  
  1226. X     /* If it's a time minus an int, do subtraction mod 1440 */
  1227. X--- 739,746 ----
  1228. X     if (v1.type == DATE_TYPE && v2.type == INT_TYPE) {
  1229. X        v1.v.val -= v2.v.val;
  1230. X        if (v1.v.val < 0) return E_DATE_OVER;
  1231. X!       PushValStack(v1);
  1232. X!       return OK;
  1233. X     }
  1234. X  
  1235. X     /* If it's a time minus an int, do subtraction mod 1440 */
  1236. X***************
  1237. X*** 853,859 ****
  1238. X     if (v1.type == TIM_TYPE && v2.type == INT_TYPE) {
  1239. X        v1.v.val = (v1.v.val - v2.v.val) % 1440;
  1240. X        if (v1.v.val < 0) v1.v.val += 1440;
  1241. X!       return PushValStack(&v1);
  1242. X     }
  1243. X  
  1244. X     /* If it's a time minus a time or a date minus a date, do it */
  1245. X--- 747,754 ----
  1246. X     if (v1.type == TIM_TYPE && v2.type == INT_TYPE) {
  1247. X        v1.v.val = (v1.v.val - v2.v.val) % 1440;
  1248. X        if (v1.v.val < 0) v1.v.val += 1440;
  1249. X!       PushValStack(v1);
  1250. X!       return OK;
  1251. X     }
  1252. X  
  1253. X     /* If it's a time minus a time or a date minus a date, do it */
  1254. X***************
  1255. X*** 861,871 ****
  1256. X         (v1.type == DATE_TYPE && v2.type == DATE_TYPE)) {
  1257. X        v1.v.val -= v2.v.val;
  1258. X        v1.type = INT_TYPE;
  1259. X!       return PushValStack(&v1);
  1260. X     }
  1261. X  
  1262. X     /* Must be types illegal for subtraction */
  1263. X!    DestroyValue(&v1); DestroyValue(&v2);
  1264. X     return E_BAD_TYPE;
  1265. X  }
  1266. X  
  1267. X--- 756,767 ----
  1268. X         (v1.type == DATE_TYPE && v2.type == DATE_TYPE)) {
  1269. X        v1.v.val -= v2.v.val;
  1270. X        v1.type = INT_TYPE;
  1271. X!       PushValStack(v1);
  1272. X!       return OK;
  1273. X     }
  1274. X  
  1275. X     /* Must be types illegal for subtraction */
  1276. X!    DestroyValue(v1); DestroyValue(v2);
  1277. X     return E_BAD_TYPE;
  1278. X  }
  1279. X  
  1280. X***************
  1281. X*** 885,901 ****
  1282. X     Value v1, v2;
  1283. X     int r;
  1284. X  
  1285. X!    if ( (r = PopValStack(&v2)) ) return r;
  1286. X!    if ( (r = PopValStack(&v1)) ) {
  1287. X!       DestroyValue(&v2);
  1288. X        return r;
  1289. X     }
  1290. X  
  1291. X     if (v1.type == INT_TYPE && v2.type == INT_TYPE) {
  1292. X        v1.v.val *= v2.v.val;
  1293. X!       return PushValStack(&v1);
  1294. X     }
  1295. X!    DestroyValue(&v1); DestroyValue(&v2);
  1296. X     return E_BAD_TYPE;
  1297. X  }
  1298. X  
  1299. X--- 781,798 ----
  1300. X     Value v1, v2;
  1301. X     int r;
  1302. X  
  1303. X!    PopValStack(v2);
  1304. X!    if ( (r = FnPopValStack(&v1)) ) {
  1305. X!       DestroyValue(v2);
  1306. X        return r;
  1307. X     }
  1308. X  
  1309. X     if (v1.type == INT_TYPE && v2.type == INT_TYPE) {
  1310. X        v1.v.val *= v2.v.val;
  1311. X!       PushValStack(v1);
  1312. X!       return OK;
  1313. X     }
  1314. X!    DestroyValue(v1); DestroyValue(v2);
  1315. X     return E_BAD_TYPE;
  1316. X  }
  1317. X  
  1318. X***************
  1319. X*** 915,923 ****
  1320. X     Value v1, v2;
  1321. X     int r;
  1322. X  
  1323. X!    if ( (r = PopValStack(&v2)) ) return r;
  1324. X!    if ( (r = PopValStack(&v1)) ) {
  1325. X!       DestroyValue(&v2);
  1326. X        return r;
  1327. X     }
  1328. X  
  1329. X--- 812,820 ----
  1330. X     Value v1, v2;
  1331. X     int r;
  1332. X  
  1333. X!    PopValStack(v2);
  1334. X!    if ( (r = FnPopValStack(&v1)) ) {
  1335. X!       DestroyValue(v2);
  1336. X        return r;
  1337. X     }
  1338. X  
  1339. X***************
  1340. X*** 924,932 ****
  1341. X     if (v1.type == INT_TYPE && v2.type == INT_TYPE) {
  1342. X        if (v2.v.val == 0) return E_DIV_ZERO;
  1343. X        v1.v.val /= v2.v.val;
  1344. X!       return PushValStack(&v1);
  1345. X     }
  1346. X!    DestroyValue(&v1); DestroyValue(&v2);
  1347. X     return E_BAD_TYPE;
  1348. X  }
  1349. X  
  1350. X--- 821,830 ----
  1351. X     if (v1.type == INT_TYPE && v2.type == INT_TYPE) {
  1352. X        if (v2.v.val == 0) return E_DIV_ZERO;
  1353. X        v1.v.val /= v2.v.val;
  1354. X!       PushValStack(v1);
  1355. X!       return OK;
  1356. X     }
  1357. X!    DestroyValue(v1); DestroyValue(v2);
  1358. X     return E_BAD_TYPE;
  1359. X  }
  1360. X  
  1361. X***************
  1362. X*** 946,954 ****
  1363. X     Value v1, v2;
  1364. X     int r;
  1365. X  
  1366. X!    if ( (r = PopValStack(&v2)) ) return r;
  1367. X!    if ( (r = PopValStack(&v1)) ) {
  1368. X!       DestroyValue(&v2);
  1369. X        return r;
  1370. X     }
  1371. X  
  1372. X--- 844,852 ----
  1373. X     Value v1, v2;
  1374. X     int r;
  1375. X  
  1376. X!    PopValStack(v2);
  1377. X!    if ( (r = FnPopValStack(&v1)) ) {
  1378. X!       DestroyValue(v2);
  1379. X        return r;
  1380. X     }
  1381. X  
  1382. X***************
  1383. X*** 955,963 ****
  1384. X     if (v1.type == INT_TYPE && v2.type == INT_TYPE) {
  1385. X        if (v2.v.val == 0) return E_DIV_ZERO;
  1386. X        v1.v.val %= v2.v.val;
  1387. X!       return PushValStack(&v1);
  1388. X     }
  1389. X!    DestroyValue(&v1); DestroyValue(&v2);
  1390. X     return E_BAD_TYPE;
  1391. X  }
  1392. X  
  1393. X--- 853,862 ----
  1394. X     if (v1.type == INT_TYPE && v2.type == INT_TYPE) {
  1395. X        if (v2.v.val == 0) return E_DIV_ZERO;
  1396. X        v1.v.val %= v2.v.val;
  1397. X!       PushValStack(v1);
  1398. X!       return OK;
  1399. X     }
  1400. X!    DestroyValue(v1); DestroyValue(v2);
  1401. X     return E_BAD_TYPE;
  1402. X  }
  1403. X  
  1404. X***************
  1405. X*** 1002,1010 ****
  1406. X     Value v1, v2, v3;
  1407. X     int r;
  1408. X  
  1409. X!    if ( (r = PopValStack(&v2)) ) return r;
  1410. X!    if ( (r = PopValStack(&v1)) ) {
  1411. X!       DestroyValue(&v2);
  1412. X        return r;
  1413. X     }
  1414. X  
  1415. X--- 901,909 ----
  1416. X     Value v1, v2, v3;
  1417. X     int r;
  1418. X  
  1419. X!    PopValStack(v2);
  1420. X!    if ( (r = FnPopValStack(&v1)) ) {
  1421. X!       DestroyValue(v2);
  1422. X        return r;
  1423. X     }
  1424. X  
  1425. X***************
  1426. X*** 1012,1024 ****
  1427. X  
  1428. X     v3.type = INT_TYPE;
  1429. X     if (v1.type != v2.type) {
  1430. X!       DestroyValue(&v1); DestroyValue(&v2);
  1431. X        if (how == EQ) {
  1432. X           v3.v.val = 0;
  1433. X!      return PushValStack(&v3);
  1434. X        } else if (how == NE) {
  1435. X           v3.v.val = 1;
  1436. X!      return PushValStack(&v3);
  1437. X        } else return E_BAD_TYPE;
  1438. X     }
  1439. X  
  1440. X--- 911,925 ----
  1441. X  
  1442. X     v3.type = INT_TYPE;
  1443. X     if (v1.type != v2.type) {
  1444. X!       DestroyValue(v1); DestroyValue(v2);
  1445. X        if (how == EQ) {
  1446. X           v3.v.val = 0;
  1447. X!      PushValStack(v3);
  1448. X!          return OK;
  1449. X        } else if (how == NE) {
  1450. X           v3.v.val = 1;
  1451. X!      PushValStack(v3);
  1452. X!          return OK;
  1453. X        } else return E_BAD_TYPE;
  1454. X     }
  1455. X  
  1456. X***************
  1457. X*** 1041,1048 ****
  1458. X           case GE: v3.v.val = (v1.v.val >= v2.v.val); break;
  1459. X        }
  1460. X     }
  1461. X!    DestroyValue(&v1); DestroyValue(&v2);
  1462. X!    return PushValStack(&v3);
  1463. X  }
  1464. X  
  1465. X  /***************************************************************/
  1466. X--- 942,950 ----
  1467. X           case GE: v3.v.val = (v1.v.val >= v2.v.val); break;
  1468. X        }
  1469. X     }
  1470. X!    DestroyValue(v1); DestroyValue(v2);
  1471. X!    PushValStack(v3);
  1472. X!    return OK;
  1473. X  }
  1474. X  
  1475. X  /***************************************************************/
  1476. X***************
  1477. X*** 1061,1077 ****
  1478. X     Value v1, v2;
  1479. X     int r;
  1480. X  
  1481. X!    if ( (r = PopValStack(&v2)) ) return r;
  1482. X!    if ( (r = PopValStack(&v1)) ) {
  1483. X!       DestroyValue(&v2);
  1484. X        return r;
  1485. X     }
  1486. X  
  1487. X     if (v1.type == INT_TYPE && v2.type == INT_TYPE) {
  1488. X        v1.v.val = (v1.v.val || v2.v.val) ? 1 : 0;
  1489. X!       return PushValStack(&v1);
  1490. X     }
  1491. X!    DestroyValue(&v1); DestroyValue(&v2);
  1492. X     return E_BAD_TYPE;
  1493. X  }
  1494. X  
  1495. X--- 963,980 ----
  1496. X     Value v1, v2;
  1497. X     int r;
  1498. X  
  1499. X!    PopValStack(v2);
  1500. X!    if ( (r = FnPopValStack(&v1)) ) {
  1501. X!       DestroyValue(v2);
  1502. X        return r;
  1503. X     }
  1504. X  
  1505. X     if (v1.type == INT_TYPE && v2.type == INT_TYPE) {
  1506. X        v1.v.val = (v1.v.val || v2.v.val) ? 1 : 0;
  1507. X!       PushValStack(v1);
  1508. X!       return OK;
  1509. X     }
  1510. X!    DestroyValue(v1); DestroyValue(v2);
  1511. X     return E_BAD_TYPE;
  1512. X  }
  1513. X  
  1514. X***************
  1515. X*** 1091,1107 ****
  1516. X     Value v1, v2;
  1517. X     int r;
  1518. X  
  1519. X!    if ( (r = PopValStack(&v2)) ) return r;
  1520. X!    if ( (r = PopValStack(&v1)) ) {
  1521. X!       DestroyValue(&v2);
  1522. X        return r;
  1523. X     }
  1524. X  
  1525. X     if (v1.type == INT_TYPE && v2.type == INT_TYPE) {
  1526. X        v1.v.val = (v1.v.val && v2.v.val) ? 1 : 0;
  1527. X!       return PushValStack(&v1);
  1528. X     }
  1529. X!    DestroyValue(&v1); DestroyValue(&v2);
  1530. X     return E_BAD_TYPE;
  1531. X  }
  1532. X  
  1533. X--- 994,1011 ----
  1534. X     Value v1, v2;
  1535. X     int r;
  1536. X  
  1537. X!    PopValStack(v2);
  1538. X!    if ( (r = FnPopValStack(&v1)) ) {
  1539. X!       DestroyValue(v2);
  1540. X        return r;
  1541. X     }
  1542. X  
  1543. X     if (v1.type == INT_TYPE && v2.type == INT_TYPE) {
  1544. X        v1.v.val = (v1.v.val && v2.v.val) ? 1 : 0;
  1545. X!       PushValStack(v1);
  1546. X!       return OK;
  1547. X     }
  1548. X!    DestroyValue(v1); DestroyValue(v2);
  1549. X     return E_BAD_TYPE;
  1550. X  }
  1551. X  
  1552. X***************
  1553. X*** 1276,1278 ****
  1554. X--- 1180,1207 ----
  1555. X  
  1556. X     return OK;
  1557. X  }
  1558. X+ 
  1559. X+ /***************************************************************/
  1560. X+ /*                                                             */
  1561. X+ /*  FnPopValStack                                              */
  1562. X+ /*                                                             */
  1563. X+ /*  Pop a value from the value stack - implemented as a        */
  1564. X+ /*  function for situations where we don't want an immediate   */
  1565. X+ /*  return upon failure.                                       */
  1566. X+ /*                                                             */
  1567. X+ /***************************************************************/
  1568. X+ #ifdef HAVE_PROTOS
  1569. X+ PUBLIC int FnPopValStack(Value *val)
  1570. X+ #else
  1571. X+ int FnPopValStack(val)
  1572. SHAR_EOF
  1573. echo "End of Remind-3.0/Patch-11/part part 1"
  1574. echo "File patch.11 is continued in part 2"
  1575. echo "2" > shar3_seq_.tmp
  1576. exit 0
  1577.  
  1578.  
  1579. exit 0 # Just in case...
  1580.