home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / octa21eb.zip / octave / PATOS2.ZIP / PATCHES.OS2 < prev    next >
Text File  |  1999-05-13  |  179KB  |  6,941 lines

  1. diff -cwr n:/project/C/octave-2.1.14.orig/liboctave/cmd-edit.cc i:/project/C/octave-2.1.14/liboctave/cmd-edit.cc
  2. *** n:/project/C/octave-2.1.14.orig/liboctave/cmd-edit.cc    Mon Nov 23 16:56:38 1998
  3. --- i:/project/C/octave-2.1.14/liboctave/cmd-edit.cc    Thu Apr 15 13:59:16 1999
  4. ***************
  5. *** 616,621 ****
  6. --- 616,628 ----
  7.   }
  8.   
  9.   void
  10. + command_editor::add_current_command_number (int n)
  11. + {
  12. +   if (instance_ok ())
  13. +     instance->command_number += n;
  14. + }
  15. + void
  16.   command_editor::increment_current_command_number (void)
  17.   {
  18.     if (instance_ok ())
  19. diff -cwr n:/project/C/octave-2.1.14.orig/liboctave/cmd-edit.h i:/project/C/octave-2.1.14/liboctave/cmd-edit.h
  20. *** n:/project/C/octave-2.1.14.orig/liboctave/cmd-edit.h    Thu Nov 12 19:26:38 1998
  21. --- i:/project/C/octave-2.1.14/liboctave/cmd-edit.h    Thu Apr 15 13:58:50 1999
  22. ***************
  23. *** 97,102 ****
  24. --- 97,104 ----
  25.   
  26.     static void reset_current_command_number (int n);
  27.   
  28. +   static void add_current_command_number (int n);
  29.     static void increment_current_command_number (void);
  30.   
  31.   private:
  32. diff -cwr n:/project/C/octave-2.1.14.orig/liboctave/cmd-hist.cc i:/project/C/octave-2.1.14/liboctave/cmd-hist.cc
  33. *** n:/project/C/octave-2.1.14.orig/liboctave/cmd-hist.cc    Tue Nov 10 15:11:14 1998
  34. --- i:/project/C/octave-2.1.14/liboctave/cmd-hist.cc    Wed Apr 14 21:35:00 1999
  35. ***************
  36. *** 20,25 ****
  37. --- 20,27 ----
  38.   
  39.   */
  40.   
  41. + /* Modified by Klaus Gebhardt, 1999 */
  42.   #ifdef HAVE_CONFIG_H
  43.   #include <config.h>
  44.   #endif
  45. ***************
  46. *** 119,128 ****
  47.     if (! do_ignoring_entries ())
  48.       {
  49.         if (s.empty ()
  50. !       || (s.length () == 1 && (s[0] == '\r' || s[0] == '\n')))
  51.       return;
  52.   
  53. !       ::add_history (s.c_str ());
  54.   
  55.         lines_this_session++;
  56.       }
  57. --- 121,143 ----
  58.     if (! do_ignoring_entries ())
  59.       {
  60.         if (s.empty ()
  61. !       || (s.length () == 1 && (s[0] == '\r' || s[0] == '\n' || s[0] == ''))
  62. !       || (s.length () == 2 && (s[0] == '\r' && s[1] == '\n')))
  63.       return;
  64.   
  65. !       string t = s;
  66. !       int l    = t.length ();
  67. !       char c   = t[l-2];
  68. !       if (c == '\n' || c == '\r' || c == '')
  69. !     {
  70. !       t.resize (l - 1);
  71. !       t[l-2] = '\n';
  72. !       if (l == 2)  return;
  73. !     }
  74. !       ::add_history (t.c_str ());
  75.   
  76.         lines_this_session++;
  77.       }
  78. diff -cwr n:/project/C/octave-2.1.14.orig/liboctave/file-ops.cc i:/project/C/octave-2.1.14/liboctave/file-ops.cc
  79. *** n:/project/C/octave-2.1.14.orig/liboctave/file-ops.cc    Tue Nov 10 15:11:14 1998
  80. --- i:/project/C/octave-2.1.14/liboctave/file-ops.cc    Thu Apr 15 14:26:42 1999
  81. ***************
  82. *** 20,25 ****
  83. --- 20,27 ----
  84.   
  85.   */
  86.   
  87. + /* Modified by Klaus Gebhardt, 1996 */
  88.   #ifdef HAVE_CONFIG_H
  89.   #include <config.h>
  90.   #endif
  91. ***************
  92. *** 39,44 ****
  93. --- 41,50 ----
  94.   #include <unistd.h>
  95.   #endif
  96.   
  97. + #ifdef OS2
  98. + #include <mkfifo.h>
  99. + #endif
  100.   #include "file-ops.h"
  101.   #include "oct-env.h"
  102.   #include "oct-passwd.h"
  103. ***************
  104. *** 488,493 ****
  105. --- 494,511 ----
  106.   #endif
  107.   
  108.     return status;
  109. + }
  110. + int
  111. + file_ops::close (int handle)
  112. + {
  113. +   return ::close (handle);
  114. + }
  115. + void *
  116. + file_ops::fdopen (int handle, const string& mode)
  117. + {
  118. +   return static_cast<void *> (::fdopen (handle, mode.c_str ()));
  119.   }
  120.   
  121.   /*
  122. diff -cwr n:/project/C/octave-2.1.14.orig/liboctave/file-ops.h i:/project/C/octave-2.1.14/liboctave/file-ops.h
  123. *** n:/project/C/octave-2.1.14.orig/liboctave/file-ops.h    Tue Nov 10 15:11:14 1998
  124. --- i:/project/C/octave-2.1.14/liboctave/file-ops.h    Thu Apr 15 14:22:08 1999
  125. ***************
  126. *** 20,25 ****
  127. --- 20,27 ----
  128.   
  129.   */
  130.   
  131. + /* Modified by Klaus Gebhardt, 1999 */
  132.   #if !defined (octave_file_ops_h)
  133.   #define octave_file_ops_h 1
  134.   
  135. ***************
  136. *** 66,71 ****
  137. --- 68,76 ----
  138.   
  139.     static int unlink (const string&);
  140.     static int unlink (const string&, string&);
  141. +   static int close (int);
  142. +   static void *fdopen (int, const string&);
  143.   };
  144.   
  145.   #endif
  146. diff -cwr n:/project/C/octave-2.1.14.orig/liboctave/file-stat.cc i:/project/C/octave-2.1.14/liboctave/file-stat.cc
  147. *** n:/project/C/octave-2.1.14.orig/liboctave/file-stat.cc    Tue Nov 10 15:11:14 1998
  148. --- i:/project/C/octave-2.1.14/liboctave/file-stat.cc    Wed Apr 14 21:41:10 1999
  149. ***************
  150. *** 20,25 ****
  151. --- 20,27 ----
  152.   
  153.   */
  154.   
  155. + /* Modified by Klaus Gebhardt, 1999 */
  156.   #ifdef HAVE_CONFIG_H
  157.   #include <config.h>
  158.   #endif
  159. ***************
  160. *** 37,42 ****
  161. --- 39,70 ----
  162.   #include "file-stat.h"
  163.   #include "statdefs.h"
  164.   
  165. + #ifdef __EMX__
  166. + // Normal stat and lstat does not work with EMX!
  167. + // Using old approach.
  168. + // Modified, by Klaus Gebhardt, 1998
  169. + static __inline int _stat (const char *name, struct stat *buf)
  170. + {
  171. +   int ret;
  172. +   do
  173. +     ret = stat (name, buf);
  174. +   while (ret < 0 && errno == EINTR);
  175. +   return ret;
  176. + }
  177. + static __inline int _lstat (const char *name, struct stat *buf)
  178. + {
  179. +   int ret;
  180. +   do
  181. +     ret = lstat (name, buf);
  182. +   while (ret < 0 && errno == EINTR);
  183. +   return ret;
  184. + }
  185. + #else
  186.   #if !defined (HAVE_LSTAT)
  187.   static inline int
  188.   lstat (const char *name, struct stat *buf)
  189. ***************
  190. *** 44,49 ****
  191. --- 72,78 ----
  192.     return stat (name, buf);
  193.   }
  194.   #endif
  195. + #endif
  196.   
  197.   // XXX FIXME XXX -- the is_* and mode_as_string functions are only valid
  198.   // for initialized objects.  If called for an object that is not
  199. ***************
  200. *** 158,164 ****
  201. --- 187,197 ----
  202.   
  203.         struct stat buf;
  204.   
  205. + #ifdef __EMX__
  206. +       int status = follow_links ? _stat (cname, &buf) : _lstat (cname, &buf);
  207. + #else
  208.         int status = follow_links ? stat (cname, &buf) : lstat (cname, &buf);
  209. + #endif
  210.   
  211.         if (status < 0)
  212.       {
  213. diff -cwr n:/project/C/octave-2.1.14.orig/liboctave/lo-mappers.cc i:/project/C/octave-2.1.14/liboctave/lo-mappers.cc
  214. *** n:/project/C/octave-2.1.14.orig/liboctave/lo-mappers.cc    Tue Nov 10 15:11:14 1998
  215. --- i:/project/C/octave-2.1.14/liboctave/lo-mappers.cc    Wed Apr 14 21:21:42 1999
  216. ***************
  217. *** 20,25 ****
  218. --- 20,27 ----
  219.   
  220.   */
  221.   
  222. + /* Modified by Klaus Gebhardt, 1997 */
  223.   #ifdef HAVE_CONFIG_H
  224.   #include <config.h>
  225.   #endif
  226. ***************
  227. *** 41,46 ****
  228. --- 43,58 ----
  229.   #define finite(x) ((x) < DBL_MAX && (x) > -DBL_MAX)
  230.   #endif
  231.   
  232. + extern "C"
  233. + {
  234. +   double F77_FCN (dacosh, DACOSH) (const double*);
  235. +   double F77_FCN (dasinh, DASINH) (const double*);
  236. +   double F77_FCN (datanh, DATANH) (const double*);
  237. +   double F77_FCN (derf, DERF) (const double&);
  238. +   double F77_FCN (derfc, DERFC) (const double&);
  239. + }
  240.   #ifndef M_LOG10E
  241.   #define M_LOG10E 0.43429448190325182765
  242.   #endif
  243. ***************
  244. *** 115,127 ****
  245.   }
  246.   
  247.   double
  248.   xerf (double x)
  249.   {
  250.   #if defined (HAVE_ERF)
  251.     return erf (x);
  252.   #else
  253. !   (*current_liboctave_error_handler)
  254. !     ("erf (x) not available on this system");
  255.   #endif
  256.   }
  257.   
  258. --- 127,170 ----
  259.   }
  260.   
  261.   double
  262. + xacosh (double x)
  263. + {
  264. + #if defined (HAVE_ACOSH)
  265. +   return acosh (x);
  266. + #else
  267. +   return F77_FCN (dacosh, DACOSH) (&x);
  268. + #endif
  269. + }
  270. + double
  271. + xasinh (double x)
  272. + {
  273. + #if defined (HAVE_ASINH)
  274. +   return asinh (x);
  275. + #else
  276. +   return F77_FCN (dasinh, DASINH) (&x);
  277. + #endif
  278. + }
  279. + double
  280. + xatanh (double x)
  281. + {
  282. + #if defined (HAVE_ATANH)
  283. +   return atanh (x);
  284. + #else
  285. +   return F77_FCN (datanh, DATANH) (&x);
  286. + #endif
  287. + }
  288. + double
  289.   xerf (double x)
  290.   {
  291.   #if defined (HAVE_ERF)
  292.     return erf (x);
  293.   #else
  294. !   double y;
  295. !   F77_YXFCN (derf, DERF, y, (x));
  296. !   return y;
  297.   #endif
  298.   }
  299.   
  300. ***************
  301. *** 131,138 ****
  302.   #if defined (HAVE_ERFC)
  303.     return erfc (x);
  304.   #else
  305. !   (*current_liboctave_error_handler)
  306. !     ("erfc (x) not available on this system");
  307.   #endif
  308.   }
  309.   
  310. --- 174,182 ----
  311.   #if defined (HAVE_ERFC)
  312.     return erfc (x);
  313.   #else
  314. !   double y;
  315. !   F77_YXFCN (derfc, DERFC, y, (x));
  316. !   return y;
  317.   #endif
  318.   }
  319.   
  320. diff -cwr n:/project/C/octave-2.1.14.orig/liboctave/lo-mappers.h i:/project/C/octave-2.1.14/liboctave/lo-mappers.h
  321. *** n:/project/C/octave-2.1.14.orig/liboctave/lo-mappers.h    Tue Nov 10 15:11:14 1998
  322. --- i:/project/C/octave-2.1.14/liboctave/lo-mappers.h    Thu Apr 15 13:37:22 1999
  323. ***************
  324. *** 20,25 ****
  325. --- 20,27 ----
  326.   
  327.   */
  328.   
  329. + /* Modified by Klaus Gebhardt, 1999 */
  330.   #if !defined (octave_liboctave_mappers_h)
  331.   #define octave_liboctave_mappers_h 1
  332.   
  333. ***************
  334. *** 37,42 ****
  335. --- 39,48 ----
  336.   extern double xisnan (double x);
  337.   extern double xfinite (double x);
  338.   extern double xisinf (double x);
  339. + extern double xacosh (double x);
  340. + extern double xasinh (double x);
  341. + extern double xatanh (double x);
  342.   
  343.   extern double xisnan (const Complex& x);
  344.   extern double xfinite (const Complex& x);
  345. diff -cwr n:/project/C/octave-2.1.14.orig/liboctave/lo-specfun.cc i:/project/C/octave-2.1.14/liboctave/lo-specfun.cc
  346. *** n:/project/C/octave-2.1.14.orig/liboctave/lo-specfun.cc    Wed Nov 25 00:26:04 1998
  347. --- i:/project/C/octave-2.1.14/liboctave/lo-specfun.cc    Wed Apr 14 21:50:02 1999
  348. ***************
  349. *** 20,29 ****
  350. --- 20,35 ----
  351.   
  352.   */
  353.   
  354. + /* Modified by Klaus Gebhardt, 1997-1999 */
  355.   #ifdef HAVE_CONFIG_H
  356.   #include <config.h>
  357.   #endif
  358.   
  359. + #ifdef __EMX__
  360. + #include <float.h>
  361. + #endif
  362.   #include "Range.h"
  363.   #include "CColVector.h"
  364.   #include "CMatrix.h"
  365. ***************
  366. *** 91,97 ****
  367.   acosh (double x)
  368.   {
  369.     double retval;
  370. !   F77_XFCN (dacosh, DACOSH, (x, retval));
  371.     return retval;
  372.   }
  373.   #endif
  374. --- 97,103 ----
  375.   acosh (double x)
  376.   {
  377.     double retval;
  378. !   F77_XFCN (xdacosh, DACOSH, (x, retval));
  379.     return retval;
  380.   }
  381.   #endif
  382. ***************
  383. *** 101,107 ****
  384.   asinh (double x)
  385.   {
  386.     double retval;
  387. !   F77_XFCN (dasinh, DASINH, (x, retval));
  388.     return retval;
  389.   }
  390.   #endif
  391. --- 107,113 ----
  392.   asinh (double x)
  393.   {
  394.     double retval;
  395. !   F77_XFCN (xdasinh, DASINH, (x, retval));
  396.     return retval;
  397.   }
  398.   #endif
  399. ***************
  400. *** 111,117 ****
  401.   atanh (double x)
  402.   {
  403.     double retval;
  404. !   F77_XFCN (datanh, DATANH, (x, retval));
  405.     return retval;
  406.   }
  407.   #endif
  408. --- 117,123 ----
  409.   atanh (double x)
  410.   {
  411.     double retval;
  412. !   F77_XFCN (xdatanh, DATANH, (x, retval));
  413.     return retval;
  414.   }
  415.   #endif
  416. ***************
  417. *** 121,127 ****
  418.   erf (double x)
  419.   {
  420.     double retval;
  421. !   F77_XFCN (derf, DERF, (x, retval));
  422.     return retval;
  423.   }
  424.   #endif
  425. --- 127,133 ----
  426.   erf (double x)
  427.   {
  428.     double retval;
  429. !   F77_XFCN (xderf, DERF, (x, retval));
  430.     return retval;
  431.   }
  432.   #endif
  433. ***************
  434. *** 131,137 ****
  435.   erfc (double x)
  436.   {
  437.     double retval;
  438. !   F77_XFCN (derfc, DERFC, (x, retval));
  439.     return retval;
  440.   }
  441.   #endif
  442. --- 137,143 ----
  443.   erfc (double x)
  444.   {
  445.     double retval;
  446. !   F77_XFCN (xderfc, DERFC, (x, retval));
  447.     return retval;
  448.   }
  449.   #endif
  450. diff -cwr n:/project/C/octave-2.1.14.orig/liboctave/lo-sysdep.cc i:/project/C/octave-2.1.14/liboctave/lo-sysdep.cc
  451. *** n:/project/C/octave-2.1.14.orig/liboctave/lo-sysdep.cc    Tue Nov 10 15:11:14 1998
  452. --- i:/project/C/octave-2.1.14/liboctave/lo-sysdep.cc    Wed Apr 14 21:56:18 1999
  453. ***************
  454. *** 28,33 ****
  455. --- 28,35 ----
  456.   
  457.   */
  458.   
  459. + /* Modified by Klaus Gebhardt, 1999 */
  460.   #ifdef HAVE_CONFIG_H
  461.   #include <config.h>
  462.   #endif
  463. ***************
  464. *** 43,52 ****
  465. --- 45,59 ----
  466.   #include <unistd.h>
  467.   #endif
  468.   
  469. + #ifdef __EMX__
  470. + #include <stdlib.h>
  471. + #endif
  472.   #if ! defined (HAVE_GETHOSTNAME) && defined (HAVE_SYS_UTSNAME_H)
  473.   #include <sys/utsname.h>
  474.   #endif
  475.   
  476. + #include "lo-utils.h"
  477.   #include "lo-error.h"
  478.   #include "pathlen.h"
  479.   
  480. ***************
  481. *** 75,81 ****
  482.     return retval;
  483.   }
  484.   
  485. ! int
  486.   octave_chdir (const string& path)
  487.   {
  488.   #if defined (__EMX__)
  489. --- 82,88 ----
  490.     return retval;
  491.   }
  492.   
  493. ! bool
  494.   octave_chdir (const string& path)
  495.   {
  496.   #if defined (__EMX__)
  497. diff -cwr n:/project/C/octave-2.1.14.orig/liboctave/oct-syscalls.cc i:/project/C/octave-2.1.14/liboctave/oct-syscalls.cc
  498. *** n:/project/C/octave-2.1.14.orig/liboctave/oct-syscalls.cc    Tue Nov 10 15:11:14 1998
  499. --- i:/project/C/octave-2.1.14/liboctave/oct-syscalls.cc    Thu Apr 15 12:30:48 1999
  500. ***************
  501. *** 20,25 ****
  502. --- 20,27 ----
  503.   
  504.   */
  505.   
  506. + /* Modified by Klaus Gebhardt, 1999 */
  507.   #ifdef HAVE_CONFIG_H
  508.   #include <config.h>
  509.   #endif
  510. ***************
  511. *** 40,45 ****
  512. --- 42,49 ----
  513.   #include <fcntl.h>
  514.   #endif
  515.   
  516. + #include <process.h>
  517.   #include "oct-syscalls.h"
  518.   #include "str-vec.h"
  519.   #include "syswait.h"
  520. ***************
  521. *** 99,104 ****
  522. --- 103,154 ----
  523.       msg = ::strerror (errno);
  524.   #else
  525.     msg = NOT_SUPPORTED ("execvp");
  526. + #endif
  527. +   return status;
  528. + }
  529. + int
  530. + octave_syscalls::spawnvp (const string& mode, const string& file,
  531. +               const string_vector& argv)
  532. + {
  533. +   string msg;
  534. +   return spawnvp (mode, file, argv, msg);
  535. + }
  536. + int
  537. + octave_syscalls::spawnvp (const string& mode, const string& file,
  538. +               const string_vector& args,
  539. +               string& msg)
  540. + {
  541. +   msg = string ();
  542. +   int status = -1;
  543. + #if defined (HAVE_SPAWNVP)
  544. +   int m = P_WAIT;
  545. +   if (mode == "wait")         m = P_WAIT;
  546. +   else if (mode == "nowait")  m = P_NOWAIT;
  547. +   else if (mode == "detach")  m = P_DETACH;
  548. +   else if (mode == "session") m = P_SESSION;
  549. +   else if (mode == "pm")      m = P_PM;
  550. +   else
  551. +     {
  552. +       msg = "spawnvp: invalid mode specified.";
  553. +       return status;
  554. +     }
  555. +   char **argv = args.c_str_vec ();
  556. +   status = ::spawnvp (m, file.c_str (), argv);
  557. +   string_vector::delete_c_str_vec (argv);
  558. +   if (status < 0)
  559. +     msg = ::strerror (errno);
  560. + #else
  561. +   msg = NOT_SUPPORTED ("spawnvp");
  562.   #endif
  563.   
  564.     return status;
  565. diff -cwr n:/project/C/octave-2.1.14.orig/liboctave/oct-syscalls.h i:/project/C/octave-2.1.14/liboctave/oct-syscalls.h
  566. *** n:/project/C/octave-2.1.14.orig/liboctave/oct-syscalls.h    Tue Nov 10 15:11:14 1998
  567. --- i:/project/C/octave-2.1.14/liboctave/oct-syscalls.h    Thu Apr 15 12:24:26 1999
  568. ***************
  569. *** 20,25 ****
  570. --- 20,27 ----
  571.   
  572.   */
  573.   
  574. + /* Modified by Klaus Gebhardt, 1999 */
  575.   #if !defined (octave_syscalls_h)
  576.   #define octave_syscalls_h 1
  577.   
  578. ***************
  579. *** 39,44 ****
  580. --- 41,51 ----
  581.   
  582.     static int execvp (const string&, const string_vector&);
  583.     static int execvp (const string&, const string_vector&, string&);
  584. +   static int spawnvp (const string&, const string&,
  585. +               const string_vector&);
  586. +   static int spawnvp (const string&, const string&,
  587. +               const string_vector&, string&);
  588.   
  589.     static int fcntl (int, int, long);
  590.     static int fcntl (int, int, long, string&);
  591. diff -cwr n:/project/C/octave-2.1.14.orig/liboctave/pathsearch.cc i:/project/C/octave-2.1.14/liboctave/pathsearch.cc
  592. *** n:/project/C/octave-2.1.14.orig/liboctave/pathsearch.cc    Tue Nov 10 15:11:14 1998
  593. --- i:/project/C/octave-2.1.14/liboctave/pathsearch.cc    Sat Apr 17 12:45:16 1999
  594. ***************
  595. *** 20,25 ****
  596. --- 20,27 ----
  597.   
  598.   */
  599.   
  600. + /* Modified by Klaus Gebhardt, 1998 */
  601.   #ifdef HAVE_CONFIG_H
  602.   #include <config.h>
  603.   #endif
  604. ***************
  605. *** 145,151 ****
  606. --- 147,157 ----
  607.   void
  608.   dir_path::set_program_name (const string& nm)
  609.   {
  610. + #ifndef __EMX__
  611. +   kpse_set_program_name (nm.c_str (), "octave");
  612. + #else
  613.     kpse_set_progname (nm.c_str ());
  614. + #endif
  615.   }
  616.   
  617.   void
  618. diff -cwr n:/project/C/octave-2.1.14.orig/libcruft/misc/dostop.c i:/project/C/octave-2.1.14/libcruft/misc/dostop.c
  619. *** n:/project/C/octave-2.1.14.orig/libcruft/misc/dostop.c    Tue Nov 10 15:11:12 1998
  620. --- i:/project/C/octave-2.1.14/libcruft/misc/dostop.c    Wed Apr 14 20:55:56 1999
  621. ***************
  622. *** 21,26 ****
  623. --- 21,28 ----
  624.   
  625.   */
  626.   
  627. + /* Modified by Klaus Gebhardt, 1996 */
  628.   #ifdef HAVE_CONFIG_H
  629.   #include <config.h>
  630.   #endif
  631. ***************
  632. *** 30,35 ****
  633. --- 32,42 ----
  634.   
  635.   #include "f77-fcn.h"
  636.   #include "lo-error.h"
  637. + #ifdef __EMX__
  638. + int f77_exception_encountered;
  639. + jmp_buf f77_context;
  640. + #endif
  641.   
  642.   /* All the STOP statements in the Fortran routines have been replaced
  643.      with a call to XSTOPX, defined in the file libcruft/misc/xstopx.f.
  644. diff -cwr n:/project/C/octave-2.1.14.orig/libcruft/misc/f77-fcn.h i:/project/C/octave-2.1.14/libcruft/misc/f77-fcn.h
  645. *** n:/project/C/octave-2.1.14.orig/libcruft/misc/f77-fcn.h    Tue Nov 10 15:11:12 1998
  646. --- i:/project/C/octave-2.1.14/libcruft/misc/f77-fcn.h    Wed Apr 14 20:55:56 1999
  647. ***************
  648. *** 20,25 ****
  649. --- 20,27 ----
  650.   
  651.   */
  652.   
  653. + /* Modified by Klaus Gebhardt, 1997 */
  654.   #if !defined (octave_f77_fcn_h)
  655.   #define octave_f77_fcn_h 1
  656.   
  657. ***************
  658. *** 77,82 ****
  659. --- 79,103 ----
  660.       } \
  661.         else \
  662.       F77_FCN (f, F) args; \
  663. +       copy_f77_context ((char *) saved_f77_context, (char *) f77_context, \
  664. +             sizeof (jmp_buf)); \
  665. +     } \
  666. +   while (0)
  667. + #define F77_YXFCN(f, F, rc, args) \
  668. +   do \
  669. +     { \
  670. +       jmp_buf saved_f77_context; \
  671. +       f77_exception_encountered = 0; \
  672. +       copy_f77_context ((char *) f77_context, (char *) saved_f77_context, \
  673. +             sizeof (jmp_buf)); \
  674. +       if (setjmp (f77_context)) \
  675. +     { \
  676. +       f77_exception_encountered = 1; \
  677. +       F77_XFCN_ERROR (f, F); \
  678. +     } \
  679. +       else \
  680. +     rc = F77_FCN (f, F) args; \
  681.         copy_f77_context ((char *) saved_f77_context, (char *) f77_context, \
  682.               sizeof (jmp_buf)); \
  683.       } \
  684. diff -cwr n:/project/C/octave-2.1.14.orig/src/defaults.cc i:/project/C/octave-2.1.14/src/defaults.cc
  685. *** n:/project/C/octave-2.1.14.orig/src/defaults.cc    Fri Mar 26 07:52:42 1999
  686. --- i:/project/C/octave-2.1.14/src/defaults.cc    Thu May 13 15:01:30 1999
  687. ***************
  688. *** 20,25 ****
  689. --- 20,27 ----
  690.   
  691.   */
  692.   
  693. + /* Modified by Klaus Gebhardt, 1996 - 1997 */
  694.   #ifdef HAVE_CONFIG_H
  695.   #include <config.h>
  696.   #endif
  697. ***************
  698. *** 168,174 ****
  699.   
  700.         if (! shell_path.empty ())
  701.       {
  702. !       Vexec_path = string (":");
  703.         Vexec_path.append (shell_path);
  704.       }
  705.       }
  706. --- 170,176 ----
  707.   
  708.         if (! shell_path.empty ())
  709.       {
  710. !       Vexec_path = string (SEPCHAR_STR);
  711.         Vexec_path.append (shell_path);
  712.       }
  713.       }
  714. ***************
  715. *** 183,189 ****
  716.   
  717.     string oct_path = octave_env::getenv ("OCTAVE_PATH");
  718.   
  719. !   Vload_path = oct_path.empty () ? string (":") : oct_path;
  720.   
  721.     Vload_path_dir_path = dir_path (Vload_path, Vdefault_load_path);
  722.   }
  723. --- 185,191 ----
  724.   
  725.     string oct_path = octave_env::getenv ("OCTAVE_PATH");
  726.   
  727. !   Vload_path = oct_path.empty () ? string (SEPCHAR_STR) : oct_path;
  728.   
  729.     Vload_path_dir_path = dir_path (Vload_path, Vdefault_load_path);
  730.   }
  731. ***************
  732. *** 204,210 ****
  733.     string oct_info_prog = octave_env::getenv ("OCTAVE_INFO_PROGRAM");
  734.   
  735.     if (oct_info_prog.empty ())
  736. !     Vinfo_prog = "info";
  737.     else
  738.       Vinfo_prog = string (oct_info_prog);
  739.   }
  740. --- 206,219 ----
  741.     string oct_info_prog = octave_env::getenv ("OCTAVE_INFO_PROGRAM");
  742.   
  743.     if (oct_info_prog.empty ())
  744. !     {
  745. ! #if !defined (__EMX__)
  746. !       Vinfo_prog = Varch_lib_dir;
  747. !       Vinfo_prog.append ("/info");
  748. ! #else
  749. !       Vinfo_prog = "";
  750. ! #endif
  751. !     }
  752.     else
  753.       Vinfo_prog = string (oct_info_prog);
  754.   }
  755. ***************
  756. *** 212,218 ****
  757. --- 221,231 ----
  758.   static void
  759.   set_default_editor (void)
  760.   {
  761. + #if defined (__EMX__) && defined (OS2)
  762. +   Veditor = "e";
  763. + #else
  764.     Veditor = "emacs";
  765. + #endif
  766.   
  767.     string env_editor = octave_env::getenv ("EDITOR");
  768.   
  769. ***************
  770. *** 345,352 ****
  771.   
  772.         if (eplen > 0)
  773.       {
  774. !       bool prepend = (Vexec_path[0] == ':');
  775. !       bool append = (eplen > 1 && Vexec_path[eplen-1] == ':');
  776.   
  777.         if (prepend)
  778.           {
  779. --- 358,365 ----
  780.   
  781.         if (eplen > 0)
  782.       {
  783. !       bool prepend = (Vexec_path[0] == SEPCHAR);
  784. !       bool append = (eplen > 1 && Vexec_path[eplen-1] == SEPCHAR);
  785.   
  786.         if (prepend)
  787.           {
  788. diff -cwr n:/project/C/octave-2.1.14.orig/src/DLD-FUNCTIONS/qz.cc i:/project/C/octave-2.1.14/src/DLD-FUNCTIONS/qz.cc
  789. *** n:/project/C/octave-2.1.14.orig/src/DLD-FUNCTIONS/qz.cc    Fri Oct  9 04:24:02 1998
  790. --- i:/project/C/octave-2.1.14/src/DLD-FUNCTIONS/qz.cc    Thu Apr 15 13:25:26 1999
  791. ***************
  792. *** 20,25 ****
  793. --- 20,27 ----
  794.   
  795.   */
  796.   
  797. + /* Modified by Klaus Gebhardt, 1999 */
  798.   // Generalized eigenvalue balancing via LAPACK
  799.   // Written by A. S. Hodel <scotte@eng.auburn.edu>
  800.   
  801. ***************
  802. *** 27,33 ****
  803. --- 29,37 ----
  804.   #undef DEBUG_SORT
  805.   #undef DEBUG_EIG
  806.   
  807. + #ifdef HAVE_CONFIG_H
  808.   #include "config.h"
  809. + #endif
  810.   
  811.   #include <cfloat>
  812.   #include <iostream.h>
  813. diff -cwr n:/project/C/octave-2.1.14.orig/src/DLD-FUNCTIONS/rand.cc i:/project/C/octave-2.1.14/src/DLD-FUNCTIONS/rand.cc
  814. *** n:/project/C/octave-2.1.14.orig/src/DLD-FUNCTIONS/rand.cc    Thu Oct 15 06:57:38 1998
  815. --- i:/project/C/octave-2.1.14/src/DLD-FUNCTIONS/rand.cc    Wed Apr 14 20:57:56 1999
  816. ***************
  817. *** 20,25 ****
  818. --- 20,27 ----
  819.   
  820.   */
  821.   
  822. + /* Modified by Klaus Gebhardt, 1997 */
  823.   #ifdef HAVE_CONFIG_H
  824.   #include <config.h>
  825.   #endif
  826. diff -cwr n:/project/C/octave-2.1.14.orig/src/file-io.cc i:/project/C/octave-2.1.14/src/file-io.cc
  827. *** n:/project/C/octave-2.1.14.orig/src/file-io.cc    Thu Mar  4 09:15:50 1999
  828. --- i:/project/C/octave-2.1.14/src/file-io.cc    Wed Apr 14 20:55:58 1999
  829. ***************
  830. *** 34,39 ****
  831. --- 34,41 ----
  832.   // Completely rewritten by John W. Eaton <jwe@bevo.che.wisc.edu>,
  833.   // April 1996.
  834.   
  835. + /* Modified by Klaus Gebhardt, 1997 */
  836.   #ifdef HAVE_CONFIG_H
  837.   #include <config.h>
  838.   #endif
  839. ***************
  840. *** 62,67 ****
  841. --- 64,70 ----
  842.   #include "oct-stream.h"
  843.   #include "oct-strstrm.h"
  844.   #include "pager.h"
  845. + #include "sighandlers.h"
  846.   #include "sysdep.h"
  847.   #include "utils.h"
  848.   #include "variables.h"
  849. ***************
  850. *** 1288,1293 ****
  851. --- 1291,1331 ----
  852.   }
  853.   
  854.   DEFALIAS (octave_tmp_file_name, tmpnam);
  855. + DEFUN (child_purge_temp, args, ,
  856. +  "child_purge_temp (pid, name)\n\
  857. + Remove the file NAME, when child PID dies.")
  858. + {
  859. +   octave_value retval = -1.0;
  860. +   if (args.length () == 2)
  861. +     {
  862. +       if (args(1).is_string ())
  863. +     {
  864. +       double d_pid = args(0).double_value ();
  865. +       string name  = args(1).string_value ();
  866. +       if (!error_state)
  867. +         {
  868. +           if (D_NINT (d_pid) == d_pid)
  869. +         {
  870. +           int i_pid = NINT (d_pid);
  871. +           octave_child_list::insert (i_pid, 0, name);
  872. +           retval = 0.0;
  873. +         }
  874. +           else
  875. +         error ("child_purge_temp: pid must be an integer");
  876. +         }
  877. +     }
  878. +       else
  879. +     error ("child_purge_temp: second argument must be a string");
  880. +     }
  881. +   else
  882. +     print_usage ("child_purge_temp");
  883. +   return retval;
  884. + }
  885.   
  886.   static int
  887.   convert (int x, int ibase, int obase)
  888. diff -cwr n:/project/C/octave-2.1.14.orig/src/help.cc i:/project/C/octave-2.1.14/src/help.cc
  889. *** n:/project/C/octave-2.1.14.orig/src/help.cc    Tue Nov 10 15:06:38 1998
  890. --- i:/project/C/octave-2.1.14/src/help.cc    Tue Apr 27 23:31:20 1999
  891. ***************
  892. *** 20,25 ****
  893. --- 20,27 ----
  894.   
  895.   */
  896.   
  897. + /* Modified by Klaus Gebhardt, 1996 */
  898.   #ifdef HAVE_CONFIG_H
  899.   #include <config.h>
  900.   #endif
  901. ***************
  902. *** 66,71 ****
  903. --- 68,91 ----
  904.   #include "utils.h"
  905.   #include "variables.h"
  906.   
  907. + #if defined (__EMX__)
  908. + extern "C"
  909. + {
  910. + #include "info/info.h"
  911. + #include "info/dribble.h"
  912. + #include "info/terminal.h"
  913. +   extern int external_info_search ();
  914. +   extern int index_entry_exists ();
  915. +   extern int do_info_index_search ();
  916. +   extern void finish_info_session ();
  917. +   extern char *replace_in_documentation ();
  918. + #include <process.h>
  919. +   int _IO_system (const char *, int);
  920. + }
  921. + #endif
  922.   // Name of the info file specified on command line.
  923.   // (--info-file file)
  924.   string Vinfo_file;
  925. ***************
  926. *** 575,580 ****
  927. --- 595,602 ----
  928.   static int
  929.   try_info (const string& nm)
  930.   {
  931. +   if (Vinfo_prog.length () > 0)
  932. +     {
  933.         int status = 0;
  934.   
  935.         static char *cmd_str = 0;
  936. ***************
  937. *** 605,627 ****
  938.     volatile octave_interrupt_handler old_interrupt_handler
  939.       = octave_ignore_interrupts ();
  940.   
  941.     status = system (cmd_str);
  942.   
  943.     octave_set_interrupt_handler (old_interrupt_handler);
  944.   
  945.     if (WIFEXITED (status))
  946.       status = WEXITSTATUS (status);
  947.     else
  948.       status = 127;
  949.   
  950.     return status;
  951.   }
  952.   
  953.   static void
  954.   help_from_info (const string_vector& argv, int idx, int argc)
  955.   {
  956.     if (idx == argc)
  957. !     try_info (string ());
  958.     else
  959.       {
  960.         for (int i = idx; i < argc; i++)
  961. --- 627,722 ----
  962.         volatile octave_interrupt_handler old_interrupt_handler
  963.       = octave_ignore_interrupts ();
  964.   
  965. + #ifdef __EMX__
  966. +       status = _IO_system (cmd_str, P_WAIT);
  967. + #else
  968.         status = system (cmd_str);
  969. + #endif
  970.   
  971.         octave_set_interrupt_handler (old_interrupt_handler);
  972.   
  973. + #ifndef __EMX__
  974.         if (WIFEXITED (status))
  975.       status = WEXITSTATUS (status);
  976.         else
  977.       status = 127;
  978. + #else
  979. +       if (status > 127) status -= 256;
  980. + #endif
  981.   
  982.         return status;
  983.       }
  984. +   else
  985. +     {
  986. +       volatile octave_interrupt_handler old_interrupt_handler
  987. +     = octave_ignore_interrupts ();
  988. +       int status = 0;
  989. +       char *directory_name = strdup (Vinfo_file.c_str ());
  990. +       char *temp = filename_non_directory (directory_name);
  991. +       if (temp != directory_name)
  992. +     {
  993. +       *temp = 0;
  994. +       info_add_path (directory_name, INFOPATH_PREPEND);
  995. +     }
  996. +       delete [] directory_name;
  997. +       NODE *initial_node = info_get_node (Vinfo_file.c_str (), 0);
  998. +       if (! initial_node)  status = 127;
  999. +       else
  1000. +     {
  1001. +       status = external_info_search(initial_node, 0,
  1002. +                     Vinfo_file.c_str (), nm.c_str ());
  1003. +       if (status == 1)
  1004. +         {
  1005. +           char *format = replace_in_documentation
  1006. +         ("Type \"\\[quit]\" to quit, \"\\[get-help-window]\" for help.");
  1007. +           window_message_in_echo_area (format);
  1008. +           info_read_and_dispatch ();
  1009. + #ifdef __EMX__
  1010. +           terminal_goto_xy (0, screenheight - 2);
  1011. + #else
  1012. +           terminal_goto_xy (0, screenheight - 1);
  1013. + #endif
  1014. +           terminal_clear_to_eol ();
  1015. +           terminal_unprep_terminal ();
  1016. +         }
  1017. +       status = status * status - 1;
  1018. +       _finish_info_session (initial_node, 0);
  1019. +     }
  1020. +       octave_set_interrupt_handler (old_interrupt_handler);
  1021. +       return status;
  1022. +     }
  1023. + }
  1024.   
  1025.   static void
  1026.   help_from_info (const string_vector& argv, int idx, int argc)
  1027.   {
  1028.     if (idx == argc)
  1029. !     {
  1030. !       int status = try_info (string ());
  1031. !       if (status)
  1032. !     {
  1033. !       if (status < 0)
  1034. !         {
  1035. !           message ("help", "sorry, `%s' is not indexed in the manual",
  1036. !                string ().c_str ());
  1037. !           sleep (2);
  1038. !         }
  1039. !       else  error ("help: unable to find info!");
  1040. !     }
  1041. !     }
  1042.     else
  1043.       {
  1044.         for (int i = idx; i < argc; i++)
  1045. ***************
  1046. *** 1042,1047 ****
  1047. --- 1137,1143 ----
  1048.   
  1049.     string s = builtin_string_variable ("INFO_PROGRAM");
  1050.   
  1051. + #ifndef __EMX__
  1052.     if (s.empty ())
  1053.       {
  1054.         gripe_invalid_value_specified ("INFO_PROGRAM");
  1055. ***************
  1056. *** 1049,1054 ****
  1057. --- 1145,1153 ----
  1058.       }
  1059.     else
  1060.       Vinfo_prog = s;
  1061. + #else
  1062. +   Vinfo_prog = s;
  1063. + #endif
  1064.   
  1065.     return status;
  1066.   }
  1067. diff -cwr n:/project/C/octave-2.1.14.orig/src/input.cc i:/project/C/octave-2.1.14/src/input.cc
  1068. *** n:/project/C/octave-2.1.14.orig/src/input.cc    Thu Nov 12 19:28:40 1998
  1069. --- i:/project/C/octave-2.1.14/src/input.cc    Thu May 13 16:59:16 1999
  1070. ***************
  1071. *** 20,25 ****
  1072. --- 20,27 ----
  1073.   
  1074.   */
  1075.   
  1076. + /* Modified by Klaus Gebhardt, 1996-1999 */
  1077.   // Get command input interactively or from files.
  1078.   
  1079.   #ifdef HAVE_CONFIG_H
  1080. ***************
  1081. *** 120,125 ****
  1082. --- 122,131 ----
  1083.   // TRUE means the user forced this shell to be interactive (-i).
  1084.   bool forced_interactive = false;
  1085.   
  1086. + // Nonzero means the user forced this shell to be really interactive (-i),
  1087. + // but without using the pager.
  1088. + int really_forced_interactive = 0;
  1089.   // Should we issue a prompt?
  1090.   int promptflag = 1;
  1091.   
  1092. ***************
  1093. *** 174,180 ****
  1094.       }
  1095.     else
  1096.       {
  1097. !       if (! s.empty () && (interactive || forced_interactive))
  1098.       {
  1099.         FILE *stream = command_editor::get_output_stream ();
  1100.   
  1101. --- 180,187 ----
  1102.       }
  1103.     else
  1104.       {
  1105. !       if (! s.empty () &&
  1106. !       (interactive || forced_interactive || really_forced_interactive))
  1107.       {
  1108.         FILE *stream = command_editor::get_output_stream ();
  1109.   
  1110. ***************
  1111. *** 200,206 ****
  1112.   
  1113.     Vlast_prompt_time = time (0);
  1114.   
  1115. !   if ((interactive || forced_interactive)
  1116.         && (! (reading_fcn_file || reading_script_file)))
  1117.       {
  1118.         string ps = (promptflag > 0) ? Vps1 : Vps2;
  1119. --- 207,213 ----
  1120.   
  1121.     Vlast_prompt_time = time (0);
  1122.   
  1123. !   if ((interactive || forced_interactive || really_forced_interactive)
  1124.         && (! (reading_fcn_file || reading_script_file)))
  1125.       {
  1126.         string ps = (promptflag > 0) ? Vps1 : Vps2;
  1127. ***************
  1128. *** 345,351 ****
  1129.     FILE *instream = 0;
  1130.   
  1131.     if (name.length () > 0)
  1132. !     instream = fopen (name.c_str (), "r");
  1133.   
  1134.     if (! instream && warn)
  1135.       warning ("%s: no such file or directory", name.c_str ());
  1136. --- 352,358 ----
  1137.     FILE *instream = 0;
  1138.   
  1139.     if (name.length () > 0)
  1140. !     instream = fopen (name.c_str (), "rb");
  1141.   
  1142.     if (! instream && warn)
  1143.       warning ("%s: no such file or directory", name.c_str ());
  1144. ***************
  1145. *** 522,527 ****
  1146. --- 529,539 ----
  1147.     flush_octave_stdout ();
  1148.   
  1149.     string input_buf = gnu_readline (prompt.c_str (), true);
  1150. + #ifdef __EMX__
  1151. +   if (reading_fcn_file || reading_script_file)
  1152. +     octave_diary << prompt.c_str () << input_buf << "\n";
  1153. + #endif
  1154.   
  1155.     if (! input_buf.empty ())
  1156.       {
  1157. diff -cwr n:/project/C/octave-2.1.14.orig/src/input.h i:/project/C/octave-2.1.14/src/input.h
  1158. *** n:/project/C/octave-2.1.14.orig/src/input.h    Tue Nov 10 15:06:38 1998
  1159. --- i:/project/C/octave-2.1.14/src/input.h    Thu Apr 15 12:34:10 1999
  1160. ***************
  1161. *** 20,25 ****
  1162. --- 20,27 ----
  1163.   
  1164.   */
  1165.   
  1166. + /* Modified by Klaus Gebhardt, 1996 */
  1167.   // Use the GNU readline library for command line editing and hisory.
  1168.   
  1169.   #if !defined (octave_input_h)
  1170. ***************
  1171. *** 60,65 ****
  1172. --- 62,71 ----
  1173.   
  1174.   // TRUE means the user forced this shell to be interactive (-i).
  1175.   extern bool forced_interactive;
  1176. + // Nonzero means the user forced this shell to be really interactive (-i),
  1177. + // but without using the pager.
  1178. + extern int really_forced_interactive;
  1179.   
  1180.   // Should we issue a prompt?
  1181.   extern int promptflag;
  1182. diff -cwr n:/project/C/octave-2.1.14.orig/src/lex.l i:/project/C/octave-2.1.14/src/lex.l
  1183. *** n:/project/C/octave-2.1.14.orig/src/lex.l    Wed Mar  3 18:56:04 1999
  1184. --- i:/project/C/octave-2.1.14/src/lex.l    Thu Apr 15 12:35:42 1999
  1185. ***************
  1186. *** 20,25 ****
  1187. --- 20,27 ----
  1188.   
  1189.   */
  1190.   
  1191. + /* Modified by Klaus Gebhardt, 1996 */
  1192.   %s TEXT_FCN
  1193.   %s MATRIX
  1194.   
  1195. ***************
  1196. *** 186,192 ****
  1197.   
  1198.   D    [0-9]
  1199.   S    [ \t]
  1200. ! NL    ((\n)|(\r\n))
  1201.   SNL    ({S}|{NL})
  1202.   EL    (\.\.\.)
  1203.   BS    (\\)
  1204. --- 188,194 ----
  1205.   
  1206.   D    [0-9]
  1207.   S    [ \t]
  1208. ! NL    ((\n)|(\r)|(\r\n)|())
  1209.   SNL    ({S}|{NL})
  1210.   EL    (\.\.\.)
  1211.   BS    (\\)
  1212. ***************
  1213. *** 239,245 ****
  1214.       return handle_string (yytext[0], 1);
  1215.     }
  1216.   
  1217. ! <TEXT_FCN>[^ \t\n\;\,\"\'][^ \t\n\;\,]*{S}* {
  1218.       string tok = strip_trailing_whitespace (yytext);
  1219.       TOK_PUSH_AND_RETURN (tok, TEXT);
  1220.     }
  1221. --- 241,247 ----
  1222.       return handle_string (yytext[0], 1);
  1223.     }
  1224.   
  1225. ! <TEXT_FCN>[^ \t\r\n\;\,\"\'][^ \t\r\n\;\,]*{S}* {
  1226.       string tok = strip_trailing_whitespace (yytext);
  1227.       TOK_PUSH_AND_RETURN (tok, TEXT);
  1228.     }
  1229. ***************
  1230. *** 536,542 ****
  1231.       else
  1232.         {
  1233.       int c;
  1234. !     while ((c = yyinput ()) != EOF && c != '\n')
  1235.         ; // Eat comment.
  1236.         }
  1237.   
  1238. --- 538,544 ----
  1239.       else
  1240.         {
  1241.       int c;
  1242. !     while ((c = yyinput ()) != EOF && c != '\n' && c != '\r' && c != '')
  1243.         ; // Eat comment.
  1244.         }
  1245.   
  1246. ***************
  1247. *** 707,713 ****
  1248.   
  1249.     // Only ask for input from stdin if we are expecting interactive
  1250.     // input.
  1251. !   if ((interactive || forced_interactive)
  1252.         && ! (reading_fcn_file || get_input_from_eval_string
  1253.           || input_from_startup_file))
  1254.       yyrestart (stdin);
  1255. --- 709,715 ----
  1256.   
  1257.     // Only ask for input from stdin if we are expecting interactive
  1258.     // input.
  1259. !   if ((interactive || forced_interactive || really_forced_interactive)
  1260.         && ! (reading_fcn_file || get_input_from_eval_string
  1261.           || input_from_startup_file))
  1262.       yyrestart (stdin);
  1263. ***************
  1264. *** 728,734 ****
  1265.     char c;
  1266.     while ((c = *s++) != '\0')
  1267.       {
  1268. !       if (c == '\n')
  1269.         current_input_column = 1;
  1270.         else
  1271.       current_input_column++;
  1272. --- 730,736 ----
  1273.     char c;
  1274.     while ((c = *s++) != '\0')
  1275.       {
  1276. !       if (c == '\n' || c == '\r' || c == '')
  1277.         current_input_column = 1;
  1278.         else
  1279.       current_input_column++;
  1280. ***************
  1281. *** 1130,1136 ****
  1282.   
  1283.     bool begin_comment = true;
  1284.     bool in_comment = true;
  1285. !   int c = 0;
  1286.   
  1287.     while ((c = yyinput ()) != EOF)
  1288.       {
  1289. --- 1132,1138 ----
  1290.   
  1291.     bool begin_comment = true;
  1292.     bool in_comment = true;
  1293. !   int c = 0, d, ct;
  1294.   
  1295.     while ((c = yyinput ()) != EOF)
  1296.       {
  1297. ***************
  1298. *** 1144,1155 ****
  1299.   
  1300.         if (in_comment)
  1301.       {
  1302. !       help_buf += (char) c;
  1303.   
  1304. -       if (c == '\n')
  1305.           in_comment = false;
  1306.       }
  1307.         else
  1308.       {
  1309.         switch (c)
  1310.           {
  1311. --- 1146,1175 ----
  1312.   
  1313.         if (in_comment)
  1314.       {
  1315. !       if (c == '\n' || c == '\r' || c == '')
  1316. !         {
  1317. !           ct = 0;
  1318. !           d  = c;
  1319. !           do
  1320. !         {
  1321. !           if (d == '\n' || d == '')
  1322. !             {
  1323. !               if (++ct > 1)  break;
  1324. !               help_buf += (char) '\n';
  1325. !             }
  1326. !         }
  1327. !           while (((d = yyinput ()) != EOF) &&
  1328. !              (d == '\n' || d == '\r' || d == ''));
  1329. !           if (d != EOF)  yyunput (d, yytext);
  1330.   
  1331.           in_comment = false;
  1332.       }
  1333.         else
  1334. +         help_buf += (char) c;
  1335. +     }
  1336. +       else
  1337.       {
  1338.         switch (c)
  1339.           {
  1340. ***************
  1341. *** 1336,1341 ****
  1342. --- 1356,1363 ----
  1343.         retval |= ATE_SPACE_OR_TAB;
  1344.         break;
  1345.   
  1346. +     case '':
  1347. +     case '\r':
  1348.       case '\n':
  1349.         retval |= ATE_NEWLINE;
  1350.         in_comment = false;
  1351. ***************
  1352. *** 1468,1473 ****
  1353. --- 1490,1497 ----
  1354.           goto cleanup;
  1355.         break;
  1356.   
  1357. +     case '':
  1358. +     case '\r':
  1359.       case '\n':
  1360.         current_input_column = 0;
  1361.         promptflag--;
  1362. ***************
  1363. *** 1577,1583 ****
  1364.         if (! have_ellipsis_continuation (false))
  1365.           buf << (char) c;
  1366.       }
  1367. !       else if (c == '\n')
  1368.       {
  1369.         error ("unterminated string constant");
  1370.         break;
  1371. --- 1601,1607 ----
  1372.         if (! have_ellipsis_continuation (false))
  1373.           buf << (char) c;
  1374.       }
  1375. !       else if (c == '\n' || c == '\r' || c == '')
  1376.       {
  1377.         error ("unterminated string constant");
  1378.         break;
  1379. ***************
  1380. *** 1740,1746 ****
  1381.         int postfix_un_op = next_token_is_postfix_unary_op
  1382.           (spc_gobbled, yytext);
  1383.   
  1384. !       int other_op = match_any (c1, ",;\n]");
  1385.   
  1386.         if (! (postfix_un_op || bin_op || other_op)
  1387.             && nesting_level.is_brace ()
  1388. --- 1764,1770 ----
  1389.         int postfix_un_op = next_token_is_postfix_unary_op
  1390.           (spc_gobbled, yytext);
  1391.   
  1392. !       int other_op = match_any (c1, ",;\n\r]");
  1393.   
  1394.         if (! (postfix_un_op || bin_op || other_op)
  1395.             && nesting_level.is_brace ()
  1396. ***************
  1397. *** 1775,1781 ****
  1398.         unput (c2);
  1399.         unput (c1);
  1400.   
  1401. !       int sep_op = match_any (c1, ",;\n]");
  1402.   
  1403.         int dot_op = (c1 == '.'
  1404.               && (isalpha (c2) || isspace (c2) || c2 == '_'));
  1405. --- 1799,1805 ----
  1406.         unput (c2);
  1407.         unput (c1);
  1408.   
  1409. !       int sep_op = match_any (c1, ",;\n\r]");
  1410.   
  1411.         int dot_op = (c1 == '.'
  1412.               && (isalpha (c2) || isspace (c2) || c2 == '_'));
  1413. ***************
  1414. *** 1965,1970 ****
  1415. --- 1989,1996 ----
  1416.       case ',':
  1417.         break;
  1418.   
  1419. +     case '':
  1420. +     case '\r':
  1421.       case '\n':
  1422.         if (in_comment)
  1423.           in_comment = false;
  1424. diff -cwr n:/project/C/octave-2.1.14.orig/src/mappers.cc i:/project/C/octave-2.1.14/src/mappers.cc
  1425. *** n:/project/C/octave-2.1.14.orig/src/mappers.cc    Wed Nov 18 08:19:12 1998
  1426. --- i:/project/C/octave-2.1.14/src/mappers.cc    Wed Apr 14 20:56:00 1999
  1427. ***************
  1428. *** 137,143 ****
  1429.     DEFUN_MAPPER (acos, 0, acos, 0, acos, -1.0, 1.0, 1,
  1430.       "acos (X): compute acos (X) for each element of X");
  1431.   
  1432. !   DEFUN_MAPPER (acosh, 0, acosh, 0, acosh, 1.0, DBL_MAX, 1,
  1433.       "acosh (X): compute acosh (X) for each element of X");
  1434.   
  1435.     DEFUN_MAPPER (angle, 0, arg, arg, 0, 0.0, 0.0, 0,
  1436. --- 137,143 ----
  1437.     DEFUN_MAPPER (acos, 0, acos, 0, acos, -1.0, 1.0, 1,
  1438.       "acos (X): compute acos (X) for each element of X");
  1439.   
  1440. !   DEFUN_MAPPER (acosh, 0, xacosh, 0, acosh, 1.0, DBL_MAX, 1,
  1441.       "acosh (X): compute acosh (X) for each element of X");
  1442.   
  1443.     DEFUN_MAPPER (angle, 0, arg, arg, 0, 0.0, 0.0, 0,
  1444. ***************
  1445. *** 149,161 ****
  1446.     DEFUN_MAPPER (asin, 0, asin, 0, asin, -1.0, 1.0, 1,
  1447.       "asin (X): compute asin (X) for each element of X");
  1448.   
  1449. !   DEFUN_MAPPER (asinh, 0, asinh, 0, asinh, 0.0, 0.0, 0,
  1450.       "asinh (X): compute asinh (X) for each element of X");
  1451.   
  1452.     DEFUN_MAPPER (atan, 0, atan, 0, atan, 0.0, 0.0, 0,
  1453.       "atan (X): compute atan (X) for each element of X");
  1454.   
  1455. !   DEFUN_MAPPER (atanh, 0, atanh, 0, atanh, -1.0, 1.0, 1,
  1456.       "atanh (X): compute atanh (X) for each element of X");
  1457.   
  1458.     DEFUN_MAPPER (ceil, 0, ceil, 0, ceil, 0.0, 0.0, 0,
  1459. --- 149,161 ----
  1460.     DEFUN_MAPPER (asin, 0, asin, 0, asin, -1.0, 1.0, 1,
  1461.       "asin (X): compute asin (X) for each element of X");
  1462.   
  1463. !   DEFUN_MAPPER (asinh, 0, xasinh, 0, asinh, 0.0, 0.0, 0,
  1464.       "asinh (X): compute asinh (X) for each element of X");
  1465.   
  1466.     DEFUN_MAPPER (atan, 0, atan, 0, atan, 0.0, 0.0, 0,
  1467.       "atan (X): compute atan (X) for each element of X");
  1468.   
  1469. !   DEFUN_MAPPER (atanh, 0, xatanh, 0, atanh, -1.0, 1.0, 1,
  1470.       "atanh (X): compute atanh (X) for each element of X");
  1471.   
  1472.     DEFUN_MAPPER (ceil, 0, ceil, 0, ceil, 0.0, 0.0, 0,
  1473. diff -cwr n:/project/C/octave-2.1.14.orig/src/mkbuiltins i:/project/C/octave-2.1.14/src/mkbuiltins
  1474. *** n:/project/C/octave-2.1.14.orig/src/mkbuiltins    Wed Nov 25 06:49:18 1998
  1475. --- i:/project/C/octave-2.1.14/src/mkbuiltins    Wed Apr 14 11:17:28 1999
  1476. ***************
  1477. *** 34,40 ****
  1478.   for file in $DEF_FILES; do
  1479.     fcn=`echo $file | sed 's,^\./,,; s/\.df//; s/-/_/g'`
  1480.     echo "static void"
  1481. !   echo "install_${fcn}_fcns (void)"
  1482.     echo "{"
  1483.     cat $file
  1484.     echo "}"
  1485. --- 34,40 ----
  1486.   for file in $DEF_FILES; do
  1487.     fcn=`echo $file | sed 's,^\./,,; s/\.df//; s/-/_/g'`
  1488.     echo "static void"
  1489. !   echo "install_${fcn##*/}_fcns (void)"
  1490.     echo "{"
  1491.     cat $file
  1492.     echo "}"
  1493. ***************
  1494. *** 43,49 ****
  1495.   
  1496.   for file in $VAR_FILES; do
  1497.     f=`echo $file | sed 's,^\./,,; s/-/_/g'`
  1498. !   echo "extern void symbols_of_${f} (void);"
  1499.   done
  1500.   
  1501.   cat << \EOF
  1502. --- 43,49 ----
  1503.   
  1504.   for file in $VAR_FILES; do
  1505.     f=`echo $file | sed 's,^\./,,; s/-/_/g'`
  1506. !   echo "extern void symbols_of_${f##*/} (void);"
  1507.   done
  1508.   
  1509.   cat << \EOF
  1510. ***************
  1511. *** 55,61 ****
  1512.   
  1513.   for file in $VAR_FILES; do
  1514.     f=`echo $file | sed 's,^\./,,; s/-/_/g'`
  1515. !   echo "  symbols_of_${f} ();"
  1516.   done
  1517.   
  1518.   cat << \EOF
  1519. --- 55,61 ----
  1520.   
  1521.   for file in $VAR_FILES; do
  1522.     f=`echo $file | sed 's,^\./,,; s/-/_/g'`
  1523. !   echo "  symbols_of_${f##*/} ();"
  1524.   done
  1525.   
  1526.   cat << \EOF
  1527. ***************
  1528. *** 68,74 ****
  1529.   
  1530.   for file in $DEF_FILES; do
  1531.     fcn=`echo $file | sed 's,^\./,,; s/\.df//; s/-/_/g'`
  1532. !   echo "  install_${fcn}_fcns ();"
  1533.   done
  1534.   
  1535.   cat << \EOF
  1536. --- 68,74 ----
  1537.   
  1538.   for file in $DEF_FILES; do
  1539.     fcn=`echo $file | sed 's,^\./,,; s/\.df//; s/-/_/g'`
  1540. !   echo "  install_${fcn##*/}_fcns ();"
  1541.   done
  1542.   
  1543.   cat << \EOF
  1544. diff -cwr n:/project/C/octave-2.1.14.orig/src/mkops i:/project/C/octave-2.1.14/src/mkops
  1545. *** n:/project/C/octave-2.1.14.orig/src/mkops    Wed Nov 25 06:48:50 1998
  1546. --- i:/project/C/octave-2.1.14/src/mkops    Wed Apr 14 11:34:10 1999
  1547. ***************
  1548. *** 13,19 ****
  1549.   
  1550.   for file in "$@"; do
  1551.     f=`echo $file | sed 's,^\./,,; s%^OPERATORS/op-%%; s%\.cc%%; s%-%_%g'`
  1552. !   echo "extern void install_${f}_ops (void);"
  1553.   done
  1554.   
  1555.   cat << \EOF
  1556. --- 13,19 ----
  1557.   
  1558.   for file in "$@"; do
  1559.     f=`echo $file | sed 's,^\./,,; s%^OPERATORS/op-%%; s%\.cc%%; s%-%_%g'`
  1560. !   echo "extern void install_${f#op_}_ops (void);"
  1561.   done
  1562.   
  1563.   cat << \EOF
  1564. ***************
  1565. *** 27,33 ****
  1566.   
  1567.   for file in "$@"; do
  1568.     f=`echo $file | sed 's,^\./,,; s%^OPERATORS/op-%%; s%\.cc%%; s%-%_%g'`
  1569. !   echo "  install_${f}_ops ();"
  1570.   done
  1571.   
  1572.   cat << \EOF
  1573. --- 27,33 ----
  1574.   
  1575.   for file in "$@"; do
  1576.     f=`echo $file | sed 's,^\./,,; s%^OPERATORS/op-%%; s%\.cc%%; s%-%_%g'`
  1577. !   echo "  install_${f#op_}_ops ();"
  1578.   done
  1579.   
  1580.   cat << \EOF
  1581. diff -cwr n:/project/C/octave-2.1.14.orig/src/oct-hist.cc i:/project/C/octave-2.1.14/src/oct-hist.cc
  1582. *** n:/project/C/octave-2.1.14.orig/src/oct-hist.cc    Tue Nov 17 18:04:10 1998
  1583. --- i:/project/C/octave-2.1.14/src/oct-hist.cc    Thu Apr 15 11:13:30 1999
  1584. ***************
  1585. *** 31,36 ****
  1586. --- 31,38 ----
  1587.   
  1588.   */
  1589.   
  1590. + /* Modified by Klaus Gebhardt, 1996 */
  1591.   #ifdef HAVE_CONFIG_H
  1592.   #include <config.h>
  1593.   #endif
  1594. ***************
  1595. *** 72,77 ****
  1596. --- 74,87 ----
  1597.   #include "utils.h"
  1598.   #include "variables.h"
  1599.   
  1600. + #ifdef __EMX__
  1601. + extern "C"
  1602. + {
  1603. + #include <process.h>
  1604. +   int _IO_system (const char *, int);
  1605. + }
  1606. + #endif
  1607.   // TRUE means input is coming from temporary history file.
  1608.   bool input_from_tmp_history_file = false;
  1609.   
  1610. ***************
  1611. *** 303,309 ****
  1612.   
  1613.             int cmd_len = cmd.length ();
  1614.   
  1615. !           if (cmd[cmd_len - 1] == '\n')
  1616.           cmd.resize (cmd_len - 1);
  1617.   
  1618.             if (! cmd.empty ())
  1619. --- 313,320 ----
  1620.   
  1621.             int cmd_len = cmd.length ();
  1622.   
  1623. !           if (cmd[cmd_len - 1] == '\n' || cmd[cmd_len - 1] == '\r'
  1624. !           || cmd[cmd_len - 1] == '')
  1625.           cmd.resize (cmd_len - 1);
  1626.   
  1627.             if (! cmd.empty ())
  1628. ***************
  1629. *** 322,328 ****
  1630.   
  1631.         int len = tmp.length ();
  1632.       
  1633. !       if (len > 0 && tmp[len-1] == '\n')
  1634.       tmp.resize (len - 1);
  1635.   
  1636.         if (! tmp.empty ())
  1637. --- 333,340 ----
  1638.   
  1639.         int len = tmp.length ();
  1640.       
  1641. !       if (len > 0 &&
  1642. !       (tmp[len-1] == '\n' || tmp[len-1] == '\r' || tmp[len-1] == ''))
  1643.       tmp.resize (len - 1);
  1644.   
  1645.         if (! tmp.empty ())
  1646. ***************
  1647. *** 450,456 ****
  1648. --- 462,472 ----
  1649.     volatile octave_interrupt_handler old_interrupt_handler
  1650.       = octave_ignore_interrupts ();
  1651.   
  1652. + #ifdef __EMX__
  1653. +   _IO_system (cmd.c_str (), P_WAIT);
  1654. + #else
  1655.     system (cmd.c_str ());
  1656. + #endif
  1657.   
  1658.     octave_set_interrupt_handler (old_interrupt_handler);
  1659.   
  1660. diff -cwr n:/project/C/octave-2.1.14.orig/src/octave.cc i:/project/C/octave-2.1.14/src/octave.cc
  1661. *** n:/project/C/octave-2.1.14.orig/src/octave.cc    Tue Mar  2 08:10:20 1999
  1662. --- i:/project/C/octave-2.1.14/src/octave.cc    Wed Apr 21 15:16:50 1999
  1663. ***************
  1664. *** 22,27 ****
  1665. --- 22,29 ----
  1666.   
  1667.   // Born February 20, 1992.
  1668.   
  1669. + /* Modified by Klaus Gebhardt, 1996 */
  1670.   #ifdef HAVE_CONFIG_H
  1671.   #include <config.h>
  1672.   #endif
  1673. ***************
  1674. *** 43,48 ****
  1675. --- 45,55 ----
  1676.   #include <unistd.h>
  1677.   #endif
  1678.   
  1679. + #ifdef __EMX__
  1680. + #include <float.h>
  1681. + #include <sys/uflags.h>
  1682. + #endif
  1683.   #include "cmd-edit.h"
  1684.   #include "file-stat.h"
  1685.   #include "lo-error.h"
  1686. ***************
  1687. *** 105,111 ****
  1688.   
  1689.   // Usage message
  1690.   static const char *usage_string = 
  1691. !   "octave [-?HVdfhiqvx] [--debug] [--echo-commands] [--exec-path path]\n\
  1692.          [--help] [--info-file file] [--info-program prog] [--interactive]\n\
  1693.          [--no-history] [--no-init-file] [--no-line-editing] [--no-site-file]\n\
  1694.          [-p path] [--path path] [--silent] [--traditional] [--verbose]\n\
  1695. --- 112,118 ----
  1696.   
  1697.   // Usage message
  1698.   static const char *usage_string = 
  1699. !   "octave [-?HVdfhiIqvx] [--debug] [--echo-commands] [--exec-path path]\n\
  1700.          [--help] [--info-file file] [--info-program prog] [--interactive]\n\
  1701.          [--no-history] [--no-init-file] [--no-line-editing] [--no-site-file]\n\
  1702.          [-p path] [--path path] [--silent] [--traditional] [--verbose]\n\
  1703. ***************
  1704. *** 114,120 ****
  1705.   // This is here so that it's more likely that the usage message and
  1706.   // the real set of options will agree.  Note: the `+' must come first
  1707.   // to prevent getopt from permuting arguments!
  1708. ! static const char *short_opts = "+?HVdfhip:qvx";
  1709.   
  1710.   // Long options.  See the comments in getopt.h for the meanings of the
  1711.   // fields in this structure.
  1712. --- 121,127 ----
  1713.   // This is here so that it's more likely that the usage message and
  1714.   // the real set of options will agree.  Note: the `+' must come first
  1715.   // to prevent getopt from permuting arguments!
  1716. ! static const char *short_opts = "+?HVdfhiIp:qvx";
  1717.   
  1718.   // Long options.  See the comments in getopt.h for the meanings of the
  1719.   // fields in this structure.
  1720. ***************
  1721. *** 184,190 ****
  1722.       odb = octave_env::getenv ("OCTAVE_DB_DIR");
  1723.   
  1724.     if (odb.empty ())
  1725. !     odb = Vdata_dir + string ("/octave:") + Vlibexec_dir + string ("/octave");
  1726.   
  1727.     octave_env::putenv ("TEXMFDBS", odb);
  1728.   }
  1729. --- 191,198 ----
  1730.       odb = octave_env::getenv ("OCTAVE_DB_DIR");
  1731.   
  1732.     if (odb.empty ())
  1733. !     odb = Vdata_dir + string ("/octave") + string (SEPCHAR_STR)
  1734. !       + Vlibexec_dir + string ("/octave");
  1735.   
  1736.     octave_env::putenv ("TEXMFDBS", odb);
  1737.   }
  1738. ***************
  1739. *** 277,282 ****
  1740. --- 285,291 ----
  1741.     --info-file FILE        Use top-level info file FILE.\n\
  1742.     --info-program PROGRAM  Use PROGRAM for reading info files.\n\
  1743.     --interactive, -i       Force interactive behavior.\n\
  1744. +   -I                      Force really interactive behavior, but no pager.\n\
  1745.     --no-history, -H        Don't save commands to the history list\n\
  1746.     --no-init-file          Don't read the ~/.octaverc or .octaverc files.\n\
  1747.     --no-line-editing       Don't use readline for command-line editing.\n\
  1748. ***************
  1749. *** 417,422 ****
  1750. --- 426,435 ----
  1751.         forced_interactive = true;
  1752.         break;
  1753.   
  1754. +     case 'I':
  1755. +       really_forced_interactive = true;
  1756. +       break;
  1757.       case 'p':
  1758.         if (args.optarg ())
  1759.           bind_builtin_variable ("LOADPATH", args.optarg ());
  1760. ***************
  1761. *** 500,505 ****
  1762. --- 513,525 ----
  1763.     if (! inhibit_startup_message && reading_startup_message_printed)
  1764.       cout << endl;
  1765.   
  1766. + #if defined (__EMX__)
  1767. +   _control87 (EM_INVALID | EM_DENORMAL | EM_ZERODIVIDE | EM_OVERFLOW |
  1768. +           EM_UNDERFLOW | EM_INEXACT, MCW_EM);
  1769. +   _uflags (_UF_SBRK_MODEL, _UF_SBRK_ARBITRARY);
  1770. + #endif
  1771.     // Avoid counting commands executed from startup files.
  1772.   
  1773.     command_editor::reset_current_command_number (1);
  1774. ***************
  1775. *** 559,575 ****
  1776.     // Force input to be echoed if not really interactive, but the user
  1777.     // has forced interactive behavior.
  1778.   
  1779. !   if (! interactive && forced_interactive)
  1780.       {
  1781.         command_editor::blink_matching_paren (false);
  1782.   
  1783.         // XXX FIXME XXX -- is this the right thing to do?
  1784.   
  1785.         bind_builtin_variable ("echo_executing_commands",
  1786.                    static_cast<double> (ECHO_CMD_LINE));
  1787.       }
  1788.   
  1789. !   if (! interactive)
  1790.       line_editing = false;
  1791.   
  1792.     int retval = main_loop ();
  1793. --- 579,597 ----
  1794.     // Force input to be echoed if not really interactive, but the user
  1795.     // has forced interactive behavior.
  1796.   
  1797. !   if (! interactive && (forced_interactive || really_forced_interactive))
  1798.       {
  1799.         command_editor::blink_matching_paren (false);
  1800.   
  1801.         // XXX FIXME XXX -- is this the right thing to do?
  1802.   
  1803. + #if ! defined (__EMX__)
  1804.         bind_builtin_variable ("echo_executing_commands",
  1805.                    static_cast<double> (ECHO_CMD_LINE));
  1806. + #endif
  1807.       }
  1808.   
  1809. !   if (! (interactive || really_forced_interactive))
  1810.       line_editing = false;
  1811.   
  1812.     int retval = main_loop ();
  1813. diff -cwr n:/project/C/octave-2.1.14.orig/src/OPERATORS/op-str-str.cc i:/project/C/octave-2.1.14/src/OPERATORS/op-str-str.cc
  1814. *** n:/project/C/octave-2.1.14.orig/src/OPERATORS/op-str-str.cc    Tue Nov 10 15:06:42 1998
  1815. --- i:/project/C/octave-2.1.14/src/OPERATORS/op-str-str.cc    Wed Apr 14 20:57:34 1999
  1816. ***************
  1817. *** 20,25 ****
  1818. --- 20,27 ----
  1819.   
  1820.   */
  1821.   
  1822. + /* Modified by Klaus Gebhardt, 1997 */
  1823.   #if defined (__GNUG__)
  1824.   #pragma implementation
  1825.   #endif
  1826. ***************
  1827. *** 58,77 ****
  1828.         if (cm2.rows () == 1 && cm2.columns () == 1)
  1829.       return octave_value (cm1 (0, 0) == cm2 (0, 0));
  1830.         else
  1831. !     SC_MX_BOOL_OP (char, c, cm1 (0, 0), charMatrix, m, cm2,
  1832.                  c == m (i, j), 0.0);
  1833.       }
  1834.     else
  1835.       {
  1836. !       int cm2_nr = cm2.rows ();
  1837. !       int cm2_nc = cm2.cols ();
  1838. !       if (cm2_nr == 1 && cm2_nc == 1)
  1839. !     MX_SC_BOOL_OP (charMatrix, m, cm1, char, c, cm2 (0, 0),
  1840.                  c == m (i, j), 0.0);
  1841.         else
  1842. !     MX_MX_BOOL_OP (charMatrix, m1, cm1, charMatrix, m2, cm2,
  1843. !                m1 (i, j) == m2 (i, j), "==", 0.0, 1.0);
  1844.       }
  1845.   }
  1846.   
  1847. --- 60,80 ----
  1848.         if (cm2.rows () == 1 && cm2.columns () == 1)
  1849.       return octave_value (cm1 (0, 0) == cm2 (0, 0));
  1850.         else
  1851. !     SC_MX_BOOL_OP (char, c, cm1 (0, 0), \
  1852. !                charMatrix, m, cm2, \
  1853.                  c == m (i, j), 0.0);
  1854.       }
  1855.     else
  1856.       {
  1857. !       if (cm2.rows () == 1 && cm2.columns () == 1)
  1858. !     MX_SC_BOOL_OP (charMatrix, m, cm1, \
  1859. !                char, c, cm2 (0, 0), \
  1860.                  c == m (i, j), 0.0);
  1861.         else
  1862. !     MX_MX_BOOL_OP (charMatrix, m1, cm1, \
  1863. !                charMatrix, m2, cm2, \
  1864. !                m1 (i, j) == m2 (i, j), \
  1865. !                "==", 0.0, 1.0);
  1866.       }
  1867.   }
  1868.   
  1869. diff -cwr n:/project/C/octave-2.1.14.orig/src/ov.cc i:/project/C/octave-2.1.14/src/ov.cc
  1870. *** n:/project/C/octave-2.1.14.orig/src/ov.cc    Fri Nov 20 23:35:26 1998
  1871. --- i:/project/C/octave-2.1.14/src/ov.cc    Thu Apr 29 13:42:46 1999
  1872. ***************
  1873. *** 325,440 ****
  1874.   octave_value::octave_value (void)
  1875.     : rep (new octave_base_value ())
  1876.   {
  1877. !   rep->count = 1;
  1878.   }
  1879.   
  1880.   octave_value::octave_value (double d)
  1881.     : rep (new octave_scalar (d))
  1882.   {
  1883. !   rep->count = 1;
  1884.   }
  1885.   
  1886.   octave_value::octave_value (const Matrix& m)
  1887.     : rep (new octave_matrix (m))
  1888.   {
  1889. !   rep->count = 1;
  1890.     maybe_mutate ();
  1891.   }
  1892.   
  1893.   octave_value::octave_value (const DiagMatrix& d)
  1894.     : rep (new octave_matrix (d))
  1895.   {
  1896. !   rep->count = 1;
  1897.     maybe_mutate ();
  1898.   }
  1899.   
  1900.   octave_value::octave_value (const RowVector& v, int pcv)
  1901.     : rep (new octave_matrix (v, pcv))
  1902.   {
  1903. !   rep->count = 1;
  1904.     maybe_mutate ();
  1905.   }
  1906.   
  1907.   octave_value::octave_value (const ColumnVector& v, int pcv)
  1908.     : rep (new octave_matrix (v, pcv))
  1909.   {
  1910. !   rep->count = 1;
  1911.     maybe_mutate ();
  1912.   }
  1913.   
  1914.   octave_value::octave_value (const Complex& C)
  1915.     : rep (new octave_complex (C))
  1916.   {
  1917. !   rep->count = 1;
  1918.     maybe_mutate ();
  1919.   }
  1920.   
  1921.   octave_value::octave_value (const ComplexMatrix& m)
  1922.     : rep (new octave_complex_matrix (m))
  1923.   {
  1924. !   rep->count = 1;
  1925.     maybe_mutate ();
  1926.   }
  1927.   
  1928.   octave_value::octave_value (const ComplexDiagMatrix& d)
  1929.     : rep (new octave_complex_matrix (d))
  1930.   {
  1931. !   rep->count = 1;
  1932.     maybe_mutate ();
  1933.   }
  1934.   
  1935.   octave_value::octave_value (const ComplexRowVector& v, int pcv)
  1936.     : rep (new octave_complex_matrix (v, pcv))
  1937.   {
  1938. !   rep->count = 1;
  1939.     maybe_mutate ();
  1940.   }
  1941.   
  1942.   octave_value::octave_value (const ComplexColumnVector& v, int pcv)
  1943.     : rep (new octave_complex_matrix (v, pcv))
  1944.   {
  1945. !   rep->count = 1;
  1946.     maybe_mutate ();
  1947.   }
  1948.   
  1949.   octave_value::octave_value (bool b)
  1950.     : rep (new octave_bool (b))
  1951.   {
  1952. !   rep->count = 1;
  1953.   }
  1954.   
  1955.   octave_value::octave_value (const boolMatrix& bm)
  1956.     : rep (new octave_bool_matrix (bm))
  1957.   {
  1958. !   rep->count = 1;
  1959.     maybe_mutate ();
  1960.   }
  1961.   
  1962.   octave_value::octave_value (char c)
  1963.     : rep (new octave_char_matrix_str (c))
  1964.   {
  1965. !   rep->count = 1;
  1966.     maybe_mutate ();
  1967.   }
  1968.   
  1969.   octave_value::octave_value (const char *s)
  1970.     : rep (new octave_char_matrix_str (s))
  1971.   {
  1972. !   rep->count = 1;
  1973.     maybe_mutate ();
  1974.   }
  1975.   
  1976.   octave_value::octave_value (const string& s)
  1977.     : rep (new octave_char_matrix_str (s))
  1978.   {
  1979. !   rep->count = 1;
  1980.     maybe_mutate ();
  1981.   }
  1982.   
  1983.   octave_value::octave_value (const string_vector& s)
  1984.     : rep (new octave_char_matrix_str (s))
  1985.   {
  1986. !   rep->count = 1;
  1987.     maybe_mutate ();
  1988.   }
  1989.   
  1990. --- 325,440 ----
  1991.   octave_value::octave_value (void)
  1992.     : rep (new octave_base_value ())
  1993.   {
  1994. !   rep->ref_count = 1;
  1995.   }
  1996.   
  1997.   octave_value::octave_value (double d)
  1998.     : rep (new octave_scalar (d))
  1999.   {
  2000. !   rep->ref_count = 1;
  2001.   }
  2002.   
  2003.   octave_value::octave_value (const Matrix& m)
  2004.     : rep (new octave_matrix (m))
  2005.   {
  2006. !   rep->ref_count = 1;
  2007.     maybe_mutate ();
  2008.   }
  2009.   
  2010.   octave_value::octave_value (const DiagMatrix& d)
  2011.     : rep (new octave_matrix (d))
  2012.   {
  2013. !   rep->ref_count = 1;
  2014.     maybe_mutate ();
  2015.   }
  2016.   
  2017.   octave_value::octave_value (const RowVector& v, int pcv)
  2018.     : rep (new octave_matrix (v, pcv))
  2019.   {
  2020. !   rep->ref_count = 1;
  2021.     maybe_mutate ();
  2022.   }
  2023.   
  2024.   octave_value::octave_value (const ColumnVector& v, int pcv)
  2025.     : rep (new octave_matrix (v, pcv))
  2026.   {
  2027. !   rep->ref_count = 1;
  2028.     maybe_mutate ();
  2029.   }
  2030.   
  2031.   octave_value::octave_value (const Complex& C)
  2032.     : rep (new octave_complex (C))
  2033.   {
  2034. !   rep->ref_count = 1;
  2035.     maybe_mutate ();
  2036.   }
  2037.   
  2038.   octave_value::octave_value (const ComplexMatrix& m)
  2039.     : rep (new octave_complex_matrix (m))
  2040.   {
  2041. !   rep->ref_count = 1;
  2042.     maybe_mutate ();
  2043.   }
  2044.   
  2045.   octave_value::octave_value (const ComplexDiagMatrix& d)
  2046.     : rep (new octave_complex_matrix (d))
  2047.   {
  2048. !   rep->ref_count = 1;
  2049.     maybe_mutate ();
  2050.   }
  2051.   
  2052.   octave_value::octave_value (const ComplexRowVector& v, int pcv)
  2053.     : rep (new octave_complex_matrix (v, pcv))
  2054.   {
  2055. !   rep->ref_count = 1;
  2056.     maybe_mutate ();
  2057.   }
  2058.   
  2059.   octave_value::octave_value (const ComplexColumnVector& v, int pcv)
  2060.     : rep (new octave_complex_matrix (v, pcv))
  2061.   {
  2062. !   rep->ref_count = 1;
  2063.     maybe_mutate ();
  2064.   }
  2065.   
  2066.   octave_value::octave_value (bool b)
  2067.     : rep (new octave_bool (b))
  2068.   {
  2069. !   rep->ref_count = 1;
  2070.   }
  2071.   
  2072.   octave_value::octave_value (const boolMatrix& bm)
  2073.     : rep (new octave_bool_matrix (bm))
  2074.   {
  2075. !   rep->ref_count = 1;
  2076.     maybe_mutate ();
  2077.   }
  2078.   
  2079.   octave_value::octave_value (char c)
  2080.     : rep (new octave_char_matrix_str (c))
  2081.   {
  2082. !   rep->ref_count = 1;
  2083.     maybe_mutate ();
  2084.   }
  2085.   
  2086.   octave_value::octave_value (const char *s)
  2087.     : rep (new octave_char_matrix_str (s))
  2088.   {
  2089. !   rep->ref_count = 1;
  2090.     maybe_mutate ();
  2091.   }
  2092.   
  2093.   octave_value::octave_value (const string& s)
  2094.     : rep (new octave_char_matrix_str (s))
  2095.   {
  2096. !   rep->ref_count = 1;
  2097.     maybe_mutate ();
  2098.   }
  2099.   
  2100.   octave_value::octave_value (const string_vector& s)
  2101.     : rep (new octave_char_matrix_str (s))
  2102.   {
  2103. !   rep->ref_count = 1;
  2104.     maybe_mutate ();
  2105.   }
  2106.   
  2107. ***************
  2108. *** 446,519 ****
  2109.     else
  2110.       rep = new octave_char_matrix (chm);
  2111.   
  2112. !   rep->count = 1;
  2113.     maybe_mutate ();
  2114.   }
  2115.   
  2116.   octave_value::octave_value (double base, double limit, double inc)
  2117.     : rep (new octave_range (base, limit, inc))
  2118.   {
  2119. !   rep->count = 1;
  2120.     maybe_mutate ();
  2121.   }
  2122.   
  2123.   octave_value::octave_value (const Range& r)
  2124.     : rep (new octave_range (r))
  2125.   {
  2126. !   rep->count = 1;
  2127.     maybe_mutate ();
  2128.   }
  2129.   
  2130.   octave_value::octave_value (const Octave_map& m)
  2131.     : rep (new octave_struct (m))
  2132.   {
  2133. !   rep->count = 1;
  2134.   }
  2135.   
  2136.   octave_value::octave_value (octave_stream *s, int n)
  2137.     : rep (new octave_file (s, n))
  2138.   {
  2139. !   rep->count = 1;
  2140.   }
  2141.   
  2142.   octave_value::octave_value (octave_function *f)
  2143.     : rep (f)
  2144.   {
  2145. !   rep->count = 1;
  2146.   }
  2147.   
  2148.   octave_value::octave_value (const octave_value_list& l)
  2149.     : rep (new octave_list (l))
  2150.   {
  2151. !   rep->count = 1;
  2152.   }
  2153.   
  2154.   octave_value::octave_value (octave_value::magic_colon)
  2155.     : rep (new octave_magic_colon ())
  2156.   {
  2157. !   rep->count = 1;
  2158.   }
  2159.   
  2160.   octave_value::octave_value (octave_value::all_va_args)
  2161.     : rep (new octave_all_va_args ())
  2162.   {
  2163. !   rep->count = 1;
  2164.   }
  2165.   
  2166.   octave_value::octave_value (octave_value *new_rep)
  2167.     : rep (new_rep)
  2168.   {
  2169. !   rep->count = 1;
  2170.   }
  2171.   
  2172.   octave_value::~octave_value (void)
  2173.   {
  2174.   #if defined (MDEBUG)
  2175.     cerr << "~octave_value: rep: " << rep
  2176. !        << " rep->count: " << rep->count << "\n";
  2177.   #endif
  2178.   
  2179. !   if (rep && --rep->count == 0)
  2180.       {
  2181.         delete rep;
  2182.         rep = 0;
  2183. --- 446,519 ----
  2184.     else
  2185.       rep = new octave_char_matrix (chm);
  2186.   
  2187. !   rep->ref_count = 1;
  2188.     maybe_mutate ();
  2189.   }
  2190.   
  2191.   octave_value::octave_value (double base, double limit, double inc)
  2192.     : rep (new octave_range (base, limit, inc))
  2193.   {
  2194. !   rep->ref_count = 1;
  2195.     maybe_mutate ();
  2196.   }
  2197.   
  2198.   octave_value::octave_value (const Range& r)
  2199.     : rep (new octave_range (r))
  2200.   {
  2201. !   rep->ref_count = 1;
  2202.     maybe_mutate ();
  2203.   }
  2204.   
  2205.   octave_value::octave_value (const Octave_map& m)
  2206.     : rep (new octave_struct (m))
  2207.   {
  2208. !   rep->ref_count = 1;
  2209.   }
  2210.   
  2211.   octave_value::octave_value (octave_stream *s, int n)
  2212.     : rep (new octave_file (s, n))
  2213.   {
  2214. !   rep->ref_count = 1;
  2215.   }
  2216.   
  2217.   octave_value::octave_value (octave_function *f)
  2218.     : rep (f)
  2219.   {
  2220. !   rep->ref_count = 1;
  2221.   }
  2222.   
  2223.   octave_value::octave_value (const octave_value_list& l)
  2224.     : rep (new octave_list (l))
  2225.   {
  2226. !   rep->ref_count = 1;
  2227.   }
  2228.   
  2229.   octave_value::octave_value (octave_value::magic_colon)
  2230.     : rep (new octave_magic_colon ())
  2231.   {
  2232. !   rep->ref_count = 1;
  2233.   }
  2234.   
  2235.   octave_value::octave_value (octave_value::all_va_args)
  2236.     : rep (new octave_all_va_args ())
  2237.   {
  2238. !   rep->ref_count = 1;
  2239.   }
  2240.   
  2241.   octave_value::octave_value (octave_value *new_rep)
  2242.     : rep (new_rep)
  2243.   {
  2244. !   rep->ref_count = 1;
  2245.   }
  2246.   
  2247.   octave_value::~octave_value (void)
  2248.   {
  2249.   #if defined (MDEBUG)
  2250.     cerr << "~octave_value: rep: " << rep
  2251. !        << " rep->ref_count: " << rep->ref_count << "\n";
  2252.   #endif
  2253.   
  2254. !   if (rep && --rep->ref_count == 0)
  2255.       {
  2256.         delete rep;
  2257.         rep = 0;
  2258. ***************
  2259. *** 533,543 ****
  2260.   
  2261.     if (tmp && tmp != rep)
  2262.       {
  2263. !       if (--rep->count == 0)
  2264.       delete rep;
  2265.   
  2266.         rep = tmp;
  2267. !       rep->count = 1;
  2268.       }    
  2269.   }
  2270.   
  2271. --- 533,543 ----
  2272.   
  2273.     if (tmp && tmp != rep)
  2274.       {
  2275. !       if (--rep->ref_count == 0)
  2276.       delete rep;
  2277.   
  2278.         rep = tmp;
  2279. !       rep->ref_count = 1;
  2280.       }    
  2281.   }
  2282.   
  2283. ***************
  2284. *** 879,898 ****
  2285.           {
  2286.             octave_value *old_rep = rep;
  2287.             rep = tmp;
  2288. !           rep->count = 1;
  2289.   
  2290.             assignment_ok = try_assignment (op, idx, rhs);
  2291.   
  2292.             if (! assignment_ok && old_rep)
  2293.           {
  2294. !           if (--rep->count == 0)
  2295.               delete rep;
  2296.   
  2297.             rep = old_rep;
  2298.             old_rep = 0;
  2299.           }
  2300.   
  2301. !           if (old_rep && --old_rep->count == 0)
  2302.           delete old_rep;
  2303.           }
  2304.         else
  2305. --- 879,898 ----
  2306.           {
  2307.             octave_value *old_rep = rep;
  2308.             rep = tmp;
  2309. !           rep->ref_count = 1;
  2310.   
  2311.             assignment_ok = try_assignment (op, idx, rhs);
  2312.   
  2313.             if (! assignment_ok && old_rep)
  2314.           {
  2315. !           if (--rep->ref_count == 0)
  2316.               delete rep;
  2317.   
  2318.             rep = old_rep;
  2319.             old_rep = 0;
  2320.           }
  2321.   
  2322. !           if (old_rep && --old_rep->ref_count == 0)
  2323.           delete old_rep;
  2324.           }
  2325.         else
  2326. ***************
  2327. *** 944,950 ****
  2328.         if (tmp)
  2329.           {
  2330.             rep = tmp;
  2331. !           rep->count = 1;
  2332.           }
  2333.         else
  2334.           {
  2335. --- 944,950 ----
  2336.         if (tmp)
  2337.           {
  2338.             rep = tmp;
  2339. !           rep->ref_count = 1;
  2340.           }
  2341.         else
  2342.           {
  2343. ***************
  2344. *** 963,976 ****
  2345.   
  2346.         if (! assignment_ok && old_rep)
  2347.       {
  2348. !       if (--rep->count == 0)
  2349.           delete rep;
  2350.   
  2351.         rep = old_rep;
  2352.         old_rep = 0;
  2353.       }
  2354.   
  2355. !       if (old_rep && --old_rep->count == 0)
  2356.       delete old_rep;
  2357.       }
  2358.   
  2359. --- 963,976 ----
  2360.   
  2361.         if (! assignment_ok && old_rep)
  2362.       {
  2363. !       if (--rep->ref_count == 0)
  2364.           delete rep;
  2365.   
  2366.         rep = old_rep;
  2367.         old_rep = 0;
  2368.       }
  2369.   
  2370. !       if (old_rep && --old_rep->ref_count == 0)
  2371.       delete old_rep;
  2372.       }
  2373.   
  2374. ***************
  2375. *** 1192,1198 ****
  2376.           {
  2377.             octave_value *old_rep = rep;
  2378.             rep = tmp;
  2379. !           rep->count = 1;
  2380.   
  2381.             t = type_id ();
  2382.   
  2383. --- 1192,1198 ----
  2384.           {
  2385.             octave_value *old_rep = rep;
  2386.             rep = tmp;
  2387. !           rep->ref_count = 1;
  2388.   
  2389.             t = type_id ();
  2390.   
  2391. ***************
  2392. *** 1202,1215 ****
  2393.           {
  2394.             f (*rep);
  2395.   
  2396. !           if (old_rep && --old_rep->count == 0)
  2397.               delete old_rep;
  2398.           }
  2399.             else
  2400.           {
  2401.             if (old_rep)
  2402.               {
  2403. !               if (--rep->count == 0)
  2404.               delete rep;
  2405.   
  2406.                 rep = old_rep;
  2407. --- 1202,1215 ----
  2408.           {
  2409.             f (*rep);
  2410.   
  2411. !           if (old_rep && --old_rep->ref_count == 0)
  2412.               delete old_rep;
  2413.           }
  2414.             else
  2415.           {
  2416.             if (old_rep)
  2417.               {
  2418. !               if (--rep->ref_count == 0)
  2419.               delete rep;
  2420.   
  2421.                 rep = old_rep;
  2422. diff -cwr n:/project/C/octave-2.1.14.orig/src/ov.h i:/project/C/octave-2.1.14/src/ov.h
  2423. *** n:/project/C/octave-2.1.14.orig/src/ov.h    Sat Mar 27 00:13:02 1999
  2424. --- i:/project/C/octave-2.1.14/src/ov.h    Thu Apr 29 13:42:46 1999
  2425. ***************
  2426. *** 184,193 ****
  2427.     octave_value (const octave_value& a)
  2428.       {
  2429.         rep = a.rep;
  2430. !       rep->count++;
  2431.       }
  2432.   
  2433. !   // Delete the representation of this constant if the count drops to
  2434.     // zero.
  2435.   
  2436.     virtual ~octave_value (void);
  2437. --- 184,193 ----
  2438.     octave_value (const octave_value& a)
  2439.       {
  2440.         rep = a.rep;
  2441. !       rep->ref_count++;
  2442.       }
  2443.   
  2444. !   // Delete the representation of this constant if the ref_count drops to
  2445.     // zero.
  2446.   
  2447.     virtual ~octave_value (void);
  2448. ***************
  2449. *** 198,208 ****
  2450.   
  2451.     void make_unique (void)
  2452.       {
  2453. !       if (rep->count > 1)
  2454.       {
  2455. !       --rep->count;
  2456.         rep = rep->clone ();
  2457. !       rep->count = 1;
  2458.       }
  2459.       }
  2460.   
  2461. --- 198,208 ----
  2462.   
  2463.     void make_unique (void)
  2464.       {
  2465. !       if (rep->ref_count > 1)
  2466.       {
  2467. !       --rep->ref_count;
  2468.         rep = rep->clone ();
  2469. !       rep->ref_count = 1;
  2470.       }
  2471.       }
  2472.   
  2473. ***************
  2474. *** 212,228 ****
  2475.       {
  2476.         if (rep != a.rep)
  2477.       {
  2478. !       if (--rep->count == 0)
  2479.           delete rep;
  2480.   
  2481.         rep = a.rep;
  2482. !       rep->count++;
  2483.       }
  2484.   
  2485.         return *this;
  2486.       }
  2487.   
  2488. !   int count (void) { return rep->count; }
  2489.   
  2490.     virtual type_conv_fcn numeric_conversion_function (void) const
  2491.       { return rep->numeric_conversion_function (); }
  2492. --- 212,228 ----
  2493.       {
  2494.         if (rep != a.rep)
  2495.       {
  2496. !       if (--rep->ref_count == 0)
  2497.           delete rep;
  2498.   
  2499.         rep = a.rep;
  2500. !       rep->ref_count++;
  2501.       }
  2502.   
  2503.         return *this;
  2504.       }
  2505.   
  2506. !   int count (void) { return rep->ref_count; }
  2507.   
  2508.     virtual type_conv_fcn numeric_conversion_function (void) const
  2509.       { return rep->numeric_conversion_function (); }
  2510. ***************
  2511. *** 504,510 ****
  2512.     union
  2513.       {
  2514.         octave_value *rep;      // The real representation.
  2515. !       int count;              // A reference count.
  2516.       };
  2517.   
  2518.     bool convert_and_assign (assign_op, const octave_value_list& idx,
  2519. --- 504,510 ----
  2520.     union
  2521.       {
  2522.         octave_value *rep;      // The real representation.
  2523. !       int ref_count;              // A reference count.
  2524.       };
  2525.   
  2526.     bool convert_and_assign (assign_op, const octave_value_list& idx,
  2527. diff -cwr n:/project/C/octave-2.1.14.orig/src/pager.cc i:/project/C/octave-2.1.14/src/pager.cc
  2528. *** n:/project/C/octave-2.1.14.orig/src/pager.cc    Fri Jan 22 11:58:06 1999
  2529. --- i:/project/C/octave-2.1.14/src/pager.cc    Wed Apr 14 20:57:34 1999
  2530. ***************
  2531. *** 20,25 ****
  2532. --- 20,27 ----
  2533.   
  2534.   */
  2535.   
  2536. + /* Modified by Klaus Gebhardt, 1996 */
  2537.   #ifdef HAVE_CONFIG_H
  2538.   #include <config.h>
  2539.   #endif
  2540. ***************
  2541. *** 221,227 ****
  2542.   int
  2543.   octave_pager_buf::sync (void)
  2544.   {
  2545. !   if (! interactive
  2546.         || really_flush_to_pager
  2547.         || (Vpage_screen_output && Vpage_output_immediately)
  2548.         || ! Vpage_screen_output)
  2549. --- 223,229 ----
  2550.   int
  2551.   octave_pager_buf::sync (void)
  2552.   {
  2553. !   if ((! interactive || really_forced_interactive)
  2554.         || really_flush_to_pager
  2555.         || (Vpage_screen_output && Vpage_output_immediately)
  2556.         || ! Vpage_screen_output)
  2557. ***************
  2558. *** 230,236 ****
  2559.   
  2560.         int len = pptr () - buf;
  2561.   
  2562. !       bool bypass_pager = (! interactive
  2563.                  || ! Vpage_screen_output
  2564.                  || (really_flush_to_pager
  2565.                      && Vpage_screen_output
  2566. --- 232,238 ----
  2567.   
  2568.         int len = pptr () - buf;
  2569.   
  2570. !       bool bypass_pager = ((! interactive || really_forced_interactive)
  2571.                  || ! Vpage_screen_output
  2572.                  || (really_flush_to_pager
  2573.                      && Vpage_screen_output
  2574. diff -cwr n:/project/C/octave-2.1.14.orig/src/parse.y i:/project/C/octave-2.1.14/src/parse.y
  2575. *** n:/project/C/octave-2.1.14.orig/src/parse.y    Sat Jan 16 00:12:20 1999
  2576. --- i:/project/C/octave-2.1.14/src/parse.y    Thu Apr 15 13:47:42 1999
  2577. ***************
  2578. *** 20,25 ****
  2579. --- 20,27 ----
  2580.   
  2581.   */
  2582.   
  2583. + /* Modified by Klaus Gebhardt, 1996 */
  2584.   // Parser for Octave.
  2585.   
  2586.   // C decarations.
  2587. ***************
  2588. *** 40,45 ****
  2589. --- 42,49 ----
  2590.   
  2591.   #include <strstream.h>
  2592.   
  2593. + #include <setjmp.h>
  2594.   #include "Matrix.h"
  2595.   #include "cmd-edit.h"
  2596.   #include "cmd-hist.h"
  2597. ***************
  2598. *** 57,68 ****
  2599. --- 61,76 ----
  2600.   #include "pager.h"
  2601.   #include "parse.h"
  2602.   #include "pt-all.h"
  2603. + #include "sighandlers.h"
  2604.   #include "symtab.h"
  2605.   #include "token.h"
  2606.   #include "unwind-prot.h"
  2607.   #include "utils.h"
  2608.   #include "variables.h"
  2609.   
  2610. + // Top level context (?)
  2611. + extern jmp_buf toplevel;
  2612.   // TRUE means we print 
  2613.   static bool Vdefault_eval_print_flag = true;
  2614.   
  2615. ***************
  2616. *** 279,285 ****
  2617.       { \
  2618.         global_command = 0; \
  2619.         yyerrok; \
  2620. !       if (interactive || forced_interactive) \
  2621.       YYACCEPT; \
  2622.         else \
  2623.       YYABORT; \
  2624. --- 287,293 ----
  2625.       { \
  2626.         global_command = 0; \
  2627.         yyerrok; \
  2628. !       if (interactive || forced_interactive || really_forced_interactive) \
  2629.       YYACCEPT; \
  2630.         else \
  2631.       YYABORT; \
  2632. ***************
  2633. *** 398,404 ****
  2634.   %type <subplot_axes_type> axes
  2635.   
  2636.   // Precedence and associativity.
  2637. ! %left ';' ',' '\n'
  2638.   %right '=' ADD_EQ SUB_EQ MUL_EQ DIV_EQ LEFTDIV_EQ EMUL_EQ EDIV_EQ ELEFTDIV_EQ OR_EQ AND_EQ LSHIFT_EQ RSHIFT_EQ
  2639.   %left EXPR_AND_AND EXPR_OR_OR
  2640.   %left EXPR_AND EXPR_OR
  2641. --- 406,412 ----
  2642.   %type <subplot_axes_type> axes
  2643.   
  2644.   // Precedence and associativity.
  2645. ! %left ';' ',' '\n' '\r' ''
  2646.   %right '=' ADD_EQ SUB_EQ MUL_EQ DIV_EQ LEFTDIV_EQ EMUL_EQ EDIV_EQ ELEFTDIV_EQ OR_EQ AND_EQ LSHIFT_EQ RSHIFT_EQ
  2647.   %left EXPR_AND_AND EXPR_OR_OR
  2648.   %left EXPR_AND EXPR_OR
  2649. ***************
  2650. *** 441,450 ****
  2651. --- 449,466 ----
  2652.   
  2653.   input1        : '\n'
  2654.             { $$ = 0; }
  2655. +         | '\r'
  2656. +           { $$ = 0; }
  2657. +         | ''
  2658. +           { $$ = 0; }
  2659.           | simple_list
  2660.             { $$ = $1; }
  2661.           | simple_list '\n'
  2662.             { $$ = $1; }
  2663. +         | simple_list '\r'
  2664. +           { $$ = $1; }
  2665. +         | simple_list ''
  2666. +           { $$ = $1; }
  2667.           | simple_list END_OF_INPUT
  2668.             { $$ = $1; }
  2669.           ;
  2670. ***************
  2671. *** 1004,1015 ****
  2672. --- 1020,1033 ----
  2673.             }
  2674.           | param_list1 param_list_end
  2675.             {
  2676. +                     lexer_flags.looking_at_parameter_list = false;
  2677.               lexer_flags.quote_is_transpose = false;
  2678.               $1->mark_as_formal_parameters ();
  2679.               $$ = $1;
  2680.             }
  2681.           | param_list1 ',' ELLIPSIS param_list_end
  2682.             {
  2683. +                     lexer_flags.looking_at_parameter_list = false;
  2684.               lexer_flags.quote_is_transpose = false;
  2685.               $1->mark_as_formal_parameters ();
  2686.               $1->mark_varargs ();
  2687. ***************
  2688. *** 1332,1343 ****
  2689. --- 1350,1365 ----
  2690.             { $$ = ';'; }
  2691.           | '\n'
  2692.             { $$ = '\n'; }
  2693. +         | '\r'
  2694. +           { $$ = '\r'; }
  2695.           | sep ','
  2696.             { $$ = $1; }
  2697.           | sep ';'
  2698.             { $$ = $1; }
  2699.           | sep '\n'
  2700.             { $$ = $1; }
  2701. +         | sep '\r'
  2702. +           { $$ = $1; }
  2703.           ;
  2704.   
  2705.   opt_sep        : // empty
  2706. ***************
  2707. *** 2497,2502 ****
  2708. --- 2519,2525 ----
  2709.       case 0:
  2710.       case ',':
  2711.       case '\n':
  2712. +     case '\r':
  2713.         if (warn_missing_semi)
  2714.       maybe_warn_missing_semi (list);
  2715.         break;
  2716. ***************
  2717. *** 2510,2515 ****
  2718. --- 2533,2543 ----
  2719.   void
  2720.   parse_and_execute (FILE *f)
  2721.   {
  2722. +   volatile octave_interrupt_handler old_interrupt_handler
  2723. +     = octave_ignore_interrupts ();
  2724. +   volatile jmp_buf old_toplevel = toplevel;
  2725.     unwind_protect::begin_frame ("parse_and_execute");
  2726.     
  2727.     YY_BUFFER_STATE old_buf = current_buffer ();
  2728. ***************
  2729. *** 2528,2533 ****
  2730. --- 2556,2565 ----
  2731.   
  2732.     unwind_protect_ptr (curr_sym_tab);
  2733.   
  2734. +   if (setjmp(toplevel) == 0)
  2735. +     {
  2736. +       octave_set_interrupt_handler (old_interrupt_handler);
  2737.       int retval;
  2738.       do
  2739.         {
  2740. ***************
  2741. *** 2565,2572 ****
  2742. --- 2597,2610 ----
  2743.         }
  2744.           }
  2745.         while (retval == 0);
  2746. +     }
  2747. +   else  error ("script executing interrupted ...");
  2748.   
  2749.     unwind_protect::run_frame ("parse_and_execute");
  2750. +   octave_ignore_interrupts ();
  2751. +   toplevel = old_toplevel;
  2752. +   octave_set_interrupt_handler (old_interrupt_handler);
  2753.   }
  2754.   
  2755.   static void
  2756. ***************
  2757. *** 2579,2584 ****
  2758. --- 2617,2625 ----
  2759.   void
  2760.   parse_and_execute (const string& s, bool verbose, const char *warn_for)
  2761.   {
  2762. +   volatile octave_interrupt_handler old_interrupt_handler
  2763. +     = octave_ignore_interrupts ();
  2764.     unwind_protect::begin_frame ("parse_and_execute_2");
  2765.   
  2766.     unwind_protect_bool (reading_script_file);
  2767. ***************
  2768. *** 2615,2620 ****
  2769. --- 2656,2663 ----
  2770.       error ("%s: unable to open file `%s'", warn_for, s.c_str ());
  2771.   
  2772.     unwind_protect::run_frame ("parse_and_execute_2");
  2773. +   octave_set_interrupt_handler (old_interrupt_handler);
  2774.   }
  2775.   
  2776.   static bool
  2777. ***************
  2778. *** 2686,2695 ****
  2779.         if (! have_help_text)
  2780.           {
  2781.             first_comments_seen = true;
  2782. !           help_txt += (char) c;
  2783.           }
  2784.   
  2785. !       if (c == '\n')
  2786.           {
  2787.             if (update_pos)
  2788.           {
  2789. --- 2729,2750 ----
  2790.         if (! have_help_text)
  2791.           {
  2792.             first_comments_seen = true;
  2793. !               if (c == '\r')
  2794. !                 {
  2795. !                   int d = getc (ffile);
  2796. !                   if (c != '\n' && c != '\r' && c != '')
  2797. !                     help_txt += (char) '\n';
  2798. ! #if defined (EMX09C)
  2799. !                   fseek (ffile, -1l, SEEK_CUR);
  2800. ! #else
  2801. !                   ungetc (d, ffile);
  2802. ! #endif
  2803. !                 }
  2804. !               else if (c == '')  help_txt += (char) '\n';
  2805. !               else                 help_txt += (char) c;
  2806.           }
  2807.   
  2808. !       if ((c == '\n') || (c == ''))
  2809.           {
  2810.             if (update_pos)
  2811.           {
  2812. ***************
  2813. *** 2704,2711 ****
  2814.               {
  2815.                 if (update_pos)
  2816.               current_input_column--;
  2817.                 ungetc (c, ffile);
  2818. !               if (c == '\n')
  2819.               break;
  2820.               }
  2821.             else
  2822. --- 2759,2770 ----
  2823.               {
  2824.                 if (update_pos)
  2825.               current_input_column--;
  2826. + #if defined (EMX09C)
  2827. +                       fseek (ffile, -1l, SEEK_CUR);
  2828. + #else
  2829.                 ungetc (c, ffile);
  2830. ! #endif
  2831. !               if ((c == '\n') || (c == '\r') || (c == ''))
  2832.               break;
  2833.               }
  2834.             else
  2835. ***************
  2836. *** 2723,2728 ****
  2837. --- 2782,2793 ----
  2838.           have_help_text = true;
  2839.             break;
  2840.   
  2841. +             case '\r':
  2842. +               if (first_comments_seen)  have_help_text = true;
  2843. +               if (update_pos)           current_input_column = 0;
  2844. +               continue;
  2845. +             case '':
  2846.           case '\n':
  2847.             if (first_comments_seen)
  2848.           have_help_text = true;
  2849. ***************
  2850. *** 2742,2748 ****
  2851. --- 2807,2817 ----
  2852.           default:
  2853.             if (update_pos)
  2854.           current_input_column--;
  2855. + #if defined (EMX09C)
  2856. +               fseek (ffile, -1l, SEEK_CUR);
  2857. + #else
  2858.             ungetc (c, ffile);
  2859. + #endif
  2860.             goto done;
  2861.           }
  2862.       }
  2863. ***************
  2864. *** 2769,2775 ****
  2865.   
  2866.     if (! path.empty ())
  2867.       {
  2868. !       FILE *fptr = fopen (path.c_str (), "r");
  2869.   
  2870.         if (fptr)
  2871.       {
  2872. --- 2838,2844 ----
  2873.   
  2874.     if (! path.empty ())
  2875.       {
  2876. !       FILE *fptr = fopen (path.c_str (), "rb");
  2877.   
  2878.         if (fptr)
  2879.       {
  2880. ***************
  2881. *** 3130,3136 ****
  2882.   
  2883.     octave_value_list tmp = eval_string (s, silent, parse_status, 1);
  2884.   
  2885. -   if (! tmp.empty ())
  2886.       retval = tmp(0);
  2887.   
  2888.     return retval;
  2889. --- 3199,3204 ----
  2890. diff -cwr n:/project/C/octave-2.1.14.orig/src/pt-plot.cc i:/project/C/octave-2.1.14/src/pt-plot.cc
  2891. *** n:/project/C/octave-2.1.14.orig/src/pt-plot.cc    Fri Jan 29 11:34:00 1999
  2892. --- i:/project/C/octave-2.1.14/src/pt-plot.cc    Wed Apr 14 20:57:36 1999
  2893. ***************
  2894. *** 20,25 ****
  2895. --- 20,27 ----
  2896.   
  2897.   */
  2898.   
  2899. + /* Modified by Klaus Gebhardt, 1996 */
  2900.   #if defined (__GNUG__)
  2901.   #pragma implementation
  2902.   #endif
  2903. ***************
  2904. *** 150,162 ****
  2905.         sigemptyset (&set);
  2906.         sigaddset (&set, SIGINT);
  2907.         sigprocmask (SIG_BLOCK, &set, &oset);
  2908.   #else
  2909.        volatile octave_interrupt_handler old_interrupt_handler
  2910.       = octave_ignore_interrupts ();
  2911.   #endif
  2912.         plot_stream = new oprocstream (plot_prog.c_str ());
  2913.         if (plot_stream)
  2914.       {
  2915.         if (! *plot_stream)
  2916. --- 152,168 ----
  2917.         sigemptyset (&set);
  2918.         sigaddset (&set, SIGINT);
  2919.         sigprocmask (SIG_BLOCK, &set, &oset);
  2920. + #endif
  2921. + #if defined (__EMX__) && defined (OS2)
  2922. +       plot_stream = new oprocstream (plot_prog.c_str (), ios::out);
  2923.   #else
  2924. + #if !defined (HAVE_POSIX_SIGNALS)
  2925.        volatile octave_interrupt_handler old_interrupt_handler
  2926.       = octave_ignore_interrupts ();
  2927.   #endif
  2928.         plot_stream = new oprocstream (plot_prog.c_str ());
  2929. ! #endif
  2930.         if (plot_stream)
  2931.       {
  2932.         if (! *plot_stream)
  2933. ***************
  2934. *** 179,186 ****
  2935. --- 185,194 ----
  2936.   #if defined (HAVE_POSIX_SIGNALS)
  2937.         sigprocmask (SIG_SETMASK, &oset, 0);
  2938.   #else
  2939. + #if ! defined (__EMX__) || ! defined (OS2)
  2940.         octave_set_interrupt_handler (old_interrupt_handler);
  2941.   #endif
  2942. + #endif
  2943.       }
  2944.   
  2945.     if (! error_state && plot_stream && *plot_stream && ! initialized)
  2946. ***************
  2947. *** 1092,1097 ****
  2948. --- 1100,1106 ----
  2949.   
  2950.     char *plot_command = plot_buf.str ();
  2951.     send_to_plot_stream (plot_command);
  2952. +   sleep (2);
  2953.   
  2954.     delete [] plot_command;
  2955.   
  2956. diff -cwr n:/project/C/octave-2.1.14.orig/src/sighandlers.cc i:/project/C/octave-2.1.14/src/sighandlers.cc
  2957. *** n:/project/C/octave-2.1.14.orig/src/sighandlers.cc    Tue Nov 10 15:06:40 1998
  2958. --- i:/project/C/octave-2.1.14/src/sighandlers.cc    Thu Apr 15 11:18:18 1999
  2959. ***************
  2960. *** 20,25 ****
  2961. --- 20,27 ----
  2962.   
  2963.   */
  2964.   
  2965. + /* Modified by Klaus Gebhardt, 1995 - 1996 */
  2966.   #ifdef HAVE_CONFIG_H
  2967.   #include <config.h>
  2968.   #endif
  2969. ***************
  2970. *** 38,43 ****
  2971. --- 40,50 ----
  2972.   #include <unistd.h>
  2973.   #endif
  2974.   
  2975. + #ifdef __EMX__
  2976. + #include <float.h>
  2977. + #include <sys/uflags.h>
  2978. + #endif
  2979.   #include "error.h"
  2980.   #include "load-save.h"
  2981.   #include "pager.h"
  2982. ***************
  2983. *** 82,88 ****
  2984.   
  2985.   #if defined (__EMX__)
  2986.   #define MAYBE_ACK_SIGNAL(sig) \
  2987. !   octave_set_signal_handler (sig, SIG_ACK)
  2988.   #define ACK_USES_SIG 1
  2989.   #else
  2990.   #define MAYBE_ACK_SIGNAL(sig) \
  2991. --- 89,95 ----
  2992.   
  2993.   #if defined (__EMX__)
  2994.   #define MAYBE_ACK_SIGNAL(sig) \
  2995. !   signal (sig, SIG_ACK)
  2996.   #define ACK_USES_SIG 1
  2997.   #else
  2998.   #define MAYBE_ACK_SIGNAL(sig) \
  2999. ***************
  3000. *** 130,136 ****
  3001.       {
  3002.         been_there_done_that = true;
  3003.   
  3004. !       cerr << "error: " << sig_name << " -- stopping myself...\n";
  3005.   
  3006.         save_user_variables ();
  3007.   
  3008. --- 137,143 ----
  3009.       {
  3010.         been_there_done_that = true;
  3011.   
  3012. !       cerr << "\n\nerror: " << sig_name << " -- stopping myself...\n";
  3013.   
  3014.         save_user_variables ();
  3015.   
  3016. ***************
  3017. *** 154,159 ****
  3018. --- 161,169 ----
  3019.   
  3020.     if (can_interrupt)
  3021.       {
  3022. + #ifdef __EMX__
  3023. +       _uflags (_UF_SBRK_MODEL, _UF_SBRK_ARBITRARY);
  3024. + #endif
  3025.         jump_to_top_level ();
  3026.         panic_impossible ();
  3027.       }
  3028. ***************
  3029. *** 172,177 ****
  3030. --- 182,191 ----
  3031.     sigemptyset (&oact.sa_mask);
  3032.     sigaction (sig, &act, &oact);
  3033.     return oact.sa_handler;
  3034. + #elif defined (__EMX__)
  3035. +   sig_handler *signal_handler = signal (sig, handler);
  3036. +   MAYBE_ACK_SIGNAL(sig);
  3037. +   return signal_handler;
  3038.   #else
  3039.     return signal (sig, handler);
  3040.   #endif
  3041. ***************
  3042. *** 188,194 ****
  3043.   // Handle SIGCHLD.
  3044.   
  3045.   static RETSIGTYPE
  3046. ! sigchld_handler (int /* sig */)
  3047.   {
  3048.     volatile octave_interrupt_handler saved_interrupt_handler
  3049.        = octave_ignore_interrupts ();
  3050. --- 202,208 ----
  3051.   // Handle SIGCHLD.
  3052.   
  3053.   static RETSIGTYPE
  3054. ! sigchld_handler (int sig)
  3055.   {
  3056.     volatile octave_interrupt_handler saved_interrupt_handler
  3057.        = octave_ignore_interrupts ();
  3058. ***************
  3059. *** 200,220 ****
  3060.   #if defined (__EMX__)
  3061.     volatile sig_handler *saved_sigchld_handler
  3062.       = octave_set_signal_handler (SIGCHLD, SIG_IGN);
  3063. ! #endif
  3064.     sigset_t set, oset;
  3065.   
  3066.     BLOCK_CHILD (set, oset);
  3067.   
  3068.     int n = octave_child_list::length ();
  3069.   
  3070. !   if (n == 0)
  3071. !     {
  3072. !       waitpid (-1, 0, WNOHANG);
  3073. !     }
  3074. !   else
  3075. !     {
  3076. !       for (int i = 0; i < n; i++)
  3077.       {
  3078.         octave_child& elt = octave_child_list::elem (i);
  3079.   
  3080. --- 214,229 ----
  3081.   #if defined (__EMX__)
  3082.     volatile sig_handler *saved_sigchld_handler
  3083.       = octave_set_signal_handler (SIGCHLD, SIG_IGN);
  3084. ! #else
  3085.     sigset_t set, oset;
  3086.   
  3087.     BLOCK_CHILD (set, oset);
  3088. + #endif
  3089.   
  3090. +   int i = 0;
  3091.     int n = octave_child_list::length ();
  3092.   
  3093. !   for (i = 0; i < n; i++)
  3094.       {
  3095.         octave_child& elt = octave_child_list::elem (i);
  3096.   
  3097. ***************
  3098. *** 230,249 ****
  3099.   
  3100.             octave_child::dead_child_handler f = elt.handler;
  3101.   
  3102. !           if (f)
  3103. !             f (pid, status);
  3104.   
  3105.             break;
  3106.           }
  3107.           }
  3108.       }
  3109. !     }
  3110.   
  3111.     octave_set_interrupt_handler (saved_interrupt_handler);
  3112.   
  3113.     UNBLOCK_CHILD (oset);
  3114. ! #ifdef __EMX__
  3115.     octave_set_signal_handler (SIGCHLD, saved_sigchld_handler);
  3116.   #endif
  3117.   
  3118. --- 239,263 ----
  3119.   
  3120.             octave_child::dead_child_handler f = elt.handler;
  3121.   
  3122. !           if (f)  f (pid, status);
  3123. !           else
  3124. !         {
  3125. !           string file = elt.filename;
  3126. !           unlink (file.c_str ());
  3127. !         }
  3128.   
  3129.             break;
  3130.           }
  3131.           }
  3132.       }
  3133. !   if (i == n)  waitpid (-1, NULL, WNOHANG);
  3134.   
  3135.     octave_set_interrupt_handler (saved_interrupt_handler);
  3136.   
  3137. + #ifndef __EMX__
  3138.     UNBLOCK_CHILD (oset);
  3139. ! #else
  3140.     octave_set_signal_handler (SIGCHLD, saved_sigchld_handler);
  3141.   #endif
  3142.   
  3143. ***************
  3144. *** 256,262 ****
  3145.   
  3146.   #if defined (__alpha__)
  3147.   static RETSIGTYPE
  3148. ! sigfpe_handler (int /* sig */)
  3149.   {
  3150.     MAYBE_ACK_SIGNAL (SIGFPE);
  3151.   
  3152. --- 270,276 ----
  3153.   
  3154.   #if defined (__alpha__)
  3155.   static RETSIGTYPE
  3156. ! sigfpe_handler (int sig)
  3157.   {
  3158.     MAYBE_ACK_SIGNAL (SIGFPE);
  3159.   
  3160. ***************
  3161. *** 266,271 ****
  3162. --- 280,289 ----
  3163.   
  3164.     if (can_interrupt)
  3165.       {
  3166. + #if defined (__EMX__)
  3167. +       _control87 (EM_INVALID | EM_DENORMAL | EM_ZERODIVIDE | EM_OVERFLOW |
  3168. +           EM_UNDERFLOW | EM_INEXACT, MCW_EM);
  3169. + #endif
  3170.         jump_to_top_level ();
  3171.         panic_impossible ();
  3172.       }
  3173. ***************
  3174. *** 301,307 ****
  3175.   }
  3176.   
  3177.   static RETSIGTYPE
  3178. ! sigpipe_handler (int /* sig */)
  3179.   {
  3180.     MAYBE_ACK_SIGNAL (SIGPIPE);
  3181.   
  3182. --- 319,325 ----
  3183.   }
  3184.   
  3185.   static RETSIGTYPE
  3186. ! sigpipe_handler (int sig)
  3187.   {
  3188.     MAYBE_ACK_SIGNAL (SIGPIPE);
  3189.   
  3190. ***************
  3191. *** 324,334 ****
  3192.     octave_interrupt_handler retval;
  3193.   
  3194.   #ifdef SIGINT
  3195. !   retval.int_handler = octave_set_signal_handler (SIGINT, sigint_handler);
  3196.   #endif
  3197.   
  3198.   #ifdef SIGBREAK
  3199. !   retval.brk_handler = octave_set_signal_handler (SIGBREAK, sigint_handler);
  3200.   #endif
  3201.   
  3202.     return retval;
  3203. --- 342,356 ----
  3204.     octave_interrupt_handler retval;
  3205.   
  3206.   #ifdef SIGINT
  3207. !   octave_set_signal_handler (SIGINT, sigint_handler);
  3208. !   retval.int_handler = sigint_handler;
  3209. !   MAYBE_ACK_SIGNAL (SIGINT);
  3210.   #endif
  3211.   
  3212.   #ifdef SIGBREAK
  3213. !   octave_set_signal_handler (SIGBREAK, sigint_handler);
  3214. !   retval.brk_handler = sigint_handler;
  3215. !   MAYBE_ACK_SIGNAL (SIGBREAK);
  3216.   #endif
  3217.   
  3218.     return retval;
  3219. ***************
  3220. *** 351,366 ****
  3221. --- 373,411 ----
  3222.   }
  3223.   
  3224.   octave_interrupt_handler
  3225. + octave_set_interrupt_handler (RETSIGTYPE (*f)(int))
  3226. + {
  3227. +   octave_interrupt_handler retval;
  3228. +   if (f)
  3229. +     {
  3230. + #ifdef SIGINT
  3231. +       retval.int_handler = octave_set_signal_handler (SIGINT, f);
  3232. +       MAYBE_ACK_SIGNAL (SIGINT);
  3233. + #endif
  3234. + #ifdef SIGBREAK
  3235. +       retval.brk_handler = octave_set_signal_handler (SIGBREAK, f);
  3236. +       MAYBE_ACK_SIGNAL (SIGBREAK);
  3237. + #endif
  3238. +     }
  3239. +   return retval;
  3240. + }
  3241. + octave_interrupt_handler
  3242.   octave_set_interrupt_handler (const volatile octave_interrupt_handler& h)
  3243.   {
  3244.     octave_interrupt_handler retval;
  3245.   
  3246.   #ifdef SIGINT
  3247.     retval.int_handler = octave_set_signal_handler (SIGINT, h.int_handler);
  3248. +   MAYBE_ACK_SIGNAL (SIGINT);
  3249.   #endif
  3250.   
  3251.   #ifdef SIGBREAK
  3252.     retval.brk_handler = octave_set_signal_handler (SIGBREAK, h.brk_handler);
  3253. +   MAYBE_ACK_SIGNAL (SIGBREAK);
  3254.   #endif
  3255.   
  3256.     return retval;
  3257. ***************
  3258. *** 454,461 ****
  3259. --- 499,510 ----
  3260.   #endif
  3261.   
  3262.   #ifdef SIGTERM
  3263. + #ifdef __EMX__
  3264. +   signal (SIGTERM, SIG_DFL);
  3265. + #else
  3266.     octave_set_signal_handler (SIGTERM, generic_sig_handler);
  3267.   #endif
  3268. + #endif
  3269.   
  3270.   #ifdef SIGTRAP
  3271.     octave_set_signal_handler (SIGTRAP, generic_sig_handler);
  3272. ***************
  3273. *** 624,633 ****
  3274.   }
  3275.   
  3276.   void
  3277. ! octave_child_list::insert (pid_t pid, octave_child::dead_child_handler f)
  3278.   {
  3279.     if (instance_ok ())
  3280. !     instance->do_insert (pid, f);
  3281.   }
  3282.   
  3283.   void
  3284. --- 673,683 ----
  3285.   }
  3286.   
  3287.   void
  3288. ! octave_child_list::insert (pid_t pid, octave_child::dead_child_handler f,
  3289. !                string name)
  3290.   {
  3291.     if (instance_ok ())
  3292. !     instance->do_insert (pid, f, name);
  3293.   }
  3294.   
  3295.   void
  3296. ***************
  3297. *** 652,658 ****
  3298.   }
  3299.   
  3300.   void
  3301. ! octave_child_list::do_insert (pid_t pid, octave_child::dead_child_handler f)
  3302.   {
  3303.     // Insert item in first open slot, increasing size of list if
  3304.     // necessary.
  3305. --- 702,709 ----
  3306.   }
  3307.   
  3308.   void
  3309. ! octave_child_list::do_insert (pid_t pid, octave_child::dead_child_handler f,
  3310. !                   string name)
  3311.   {
  3312.     // Insert item in first open slot, increasing size of list if
  3313.     // necessary.
  3314. ***************
  3315. *** 665,671 ****
  3316.   
  3317.         if (tmp.pid < 0)
  3318.       {
  3319. !       list (i) = octave_child (pid, f);
  3320.         enlarge = false;
  3321.         break;
  3322.       }
  3323. --- 716,722 ----
  3324.   
  3325.         if (tmp.pid < 0)
  3326.       {
  3327. !       list (i) = octave_child (pid, f, name);
  3328.         enlarge = false;
  3329.         break;
  3330.       }
  3331. ***************
  3332. *** 683,689 ****
  3333.           list.resize (total_len * 2);
  3334.       }
  3335.   
  3336. !       list (curr_len) = octave_child (pid, f);
  3337.         curr_len++;
  3338.       }
  3339.   }
  3340. --- 734,740 ----
  3341.           list.resize (total_len * 2);
  3342.       }
  3343.   
  3344. !       list (curr_len) = octave_child (pid, f, name);
  3345.         curr_len++;
  3346.       }
  3347.   }
  3348. ***************
  3349. *** 700,705 ****
  3350. --- 751,773 ----
  3351.         if (tmp.pid == pid)
  3352.       {
  3353.         tmp.pid = -1;
  3354. +       octave_child::dead_child_handler f = tmp.handler;
  3355. +       if (f)
  3356. +         {
  3357. +           int status;
  3358. +           if (waitpid (pid, &status, WNOHANG) <= 0)  status = 127;
  3359. +           f (pid, status);
  3360. +         }
  3361. +       else
  3362. +         {
  3363. +           string file = tmp.filename;
  3364. +           unlink (file.c_str ());
  3365. +         }
  3366.         break;
  3367.       }
  3368.       }
  3369. diff -cwr n:/project/C/octave-2.1.14.orig/src/sighandlers.h i:/project/C/octave-2.1.14/src/sighandlers.h
  3370. *** n:/project/C/octave-2.1.14.orig/src/sighandlers.h    Tue Nov 10 15:06:40 1998
  3371. --- i:/project/C/octave-2.1.14/src/sighandlers.h    Wed Apr 14 20:57:58 1999
  3372. ***************
  3373. *** 30,38 ****
  3374. --- 30,42 ----
  3375.   
  3376.   // This file should always be included after config.h!
  3377.   
  3378. + /* Modified by Klaus Gebhardt, 1996 */
  3379.   #if !defined (octave_sighandlers_h)
  3380.   #define octave_sighandlers_h 1
  3381.   
  3382. + #include <string>
  3383.   #include <Array.h>
  3384.   
  3385.   #include "syswait.h"
  3386. ***************
  3387. *** 65,72 ****
  3388.   
  3389.   typedef RETSIGTYPE sig_handler (int);
  3390.   
  3391. - // XXX FIXME XXX -- the data should probably be private...
  3392.   struct
  3393.   octave_interrupt_handler
  3394.   {
  3395. --- 69,74 ----
  3396. ***************
  3397. *** 118,128 ****
  3398.   
  3399.     typedef void (*dead_child_handler) (pid_t, int);
  3400.   
  3401. !   octave_child (pid_t id = -1, dead_child_handler f = 0)
  3402. !     : pid (id), handler (f) { }
  3403.   
  3404.     octave_child (const octave_child& oc)
  3405. !     : pid (oc.pid), handler (oc.handler) { }
  3406.   
  3407.     octave_child& operator = (const octave_child& oc)
  3408.       {
  3409. --- 120,130 ----
  3410.   
  3411.     typedef void (*dead_child_handler) (pid_t, int);
  3412.   
  3413. !   octave_child (pid_t id = -1, dead_child_handler f = 0, string name = "")
  3414. !     : pid (id), handler (f), filename (name) { }
  3415.   
  3416.     octave_child (const octave_child& oc)
  3417. !     : pid (oc.pid), handler (oc.handler), filename (oc.filename) { }
  3418.   
  3419.     octave_child& operator = (const octave_child& oc)
  3420.       {
  3421. ***************
  3422. *** 130,135 ****
  3423. --- 132,138 ----
  3424.       {
  3425.         pid = oc.pid;
  3426.         handler = oc.handler;
  3427. +       filename = oc.filename;
  3428.       }
  3429.         return *this;
  3430.       }
  3431. ***************
  3432. *** 141,146 ****
  3433. --- 144,152 ----
  3434.   
  3435.     // The function we call if this child dies.
  3436.     dead_child_handler handler;
  3437. +   // The file to remove if this child dies.
  3438. +   string filename;
  3439.   };
  3440.   
  3441.   class
  3442. ***************
  3443. *** 156,162 ****
  3444.   
  3445.     static bool instance_ok (void);
  3446.   
  3447. !   static void insert (pid_t pid, octave_child::dead_child_handler f);
  3448.   
  3449.     static void remove (pid_t pid);
  3450.   
  3451. --- 162,169 ----
  3452.   
  3453.     static bool instance_ok (void);
  3454.   
  3455. !   static void insert (pid_t pid, octave_child::dead_child_handler f,
  3456. !               string name = "");
  3457.   
  3458.     static void remove (pid_t pid);
  3459.   
  3460. ***************
  3461. *** 172,178 ****
  3462.   
  3463.     static octave_child_list *instance;
  3464.   
  3465. !   void do_insert (pid_t pid, octave_child::dead_child_handler f);
  3466.   
  3467.     void do_remove (pid_t pid);
  3468.   
  3469. --- 179,186 ----
  3470.   
  3471.     static octave_child_list *instance;
  3472.   
  3473. !   void do_insert (pid_t pid, octave_child::dead_child_handler f,
  3474. !           string name = "");
  3475.   
  3476.     void do_remove (pid_t pid);
  3477.   
  3478. diff -cwr n:/project/C/octave-2.1.14.orig/src/strftime.c i:/project/C/octave-2.1.14/src/strftime.c
  3479. *** n:/project/C/octave-2.1.14.orig/src/strftime.c    Wed Nov 25 06:34:08 1998
  3480. --- i:/project/C/octave-2.1.14/src/strftime.c    Wed Apr 14 20:57:58 1999
  3481. ***************
  3482. *** 49,55 ****
  3483.   # endif
  3484.   #endif
  3485.   
  3486. ! #if HAVE_TZNAME
  3487.   extern char *tzname[];
  3488.   #endif
  3489.   
  3490. --- 49,55 ----
  3491.   # endif
  3492.   #endif
  3493.   
  3494. ! #ifdef HAVE_TZNAME
  3495.   extern char *tzname[];
  3496.   #endif
  3497.   
  3498. ***************
  3499. *** 61,68 ****
  3500.      with other C libraries that use unsafe encodings.  */
  3501.   #define DO_MULTIBYTE (HAVE_MBLEN && ! MULTIBYTE_IS_FORMAT_SAFE)
  3502.   
  3503. ! #if DO_MULTIBYTE
  3504. ! # if HAVE_MBRLEN
  3505.   #  include <wchar.h>
  3506.   # else
  3507.      /* Simulate mbrlen with mblen as best we can.  */
  3508. --- 61,68 ----
  3509.      with other C libraries that use unsafe encodings.  */
  3510.   #define DO_MULTIBYTE (HAVE_MBLEN && ! MULTIBYTE_IS_FORMAT_SAFE)
  3511.   
  3512. ! #ifdef DO_MULTIBYTE
  3513. ! #ifdef HAVE_MBRLEN
  3514.   #  include <wchar.h>
  3515.   # else
  3516.      /* Simulate mbrlen with mblen as best we can.  */
  3517. ***************
  3518. *** 73,83 ****
  3519.     static const mbstate_t mbstate_zero;
  3520.   #endif
  3521.   
  3522. ! #if HAVE_LIMITS_H
  3523.   # include <limits.h>
  3524.   #endif
  3525.   
  3526. ! #if STDC_HEADERS
  3527.   # include <stddef.h>
  3528.   # include <stdlib.h>
  3529.   # include <string.h>
  3530. --- 73,83 ----
  3531.     static const mbstate_t mbstate_zero;
  3532.   #endif
  3533.   
  3534. ! #ifdef HAVE_LIMITS_H
  3535.   # include <limits.h>
  3536.   #endif
  3537.   
  3538. ! #ifdef STDC_HEADERS
  3539.   # include <stddef.h>
  3540.   # include <stdlib.h>
  3541.   # include <string.h>
  3542. ***************
  3543. *** 180,186 ****
  3544.       } while (0)
  3545.   #define    cpy(n, s)    add ((n), memcpy((PTR) p, (PTR) (s), (n)))
  3546.   
  3547. ! #if ! HAVE_TM_GMTOFF
  3548.   /* Yield the difference between *A and *B,
  3549.      measured in seconds, ignoring leap seconds.  */
  3550.   static int tm_diff __P ((const struct tm *, const struct tm *));
  3551. --- 180,186 ----
  3552.       } while (0)
  3553.   #define    cpy(n, s)    add ((n), memcpy((PTR) p, (PTR) (s), (n)))
  3554.   
  3555. ! #ifndef HAVE_TM_GMTOFF
  3556.   /* Yield the difference between *A and *B,
  3557.      measured in seconds, ignoring leap seconds.  */
  3558.   static int tm_diff __P ((const struct tm *, const struct tm *));
  3559. ***************
  3560. *** 290,299 ****
  3561.     register const char *f;
  3562.   
  3563.     zone = 0;
  3564. ! #if HAVE_TM_ZONE
  3565.     zone = (const char *) tp->tm_zone;
  3566.   #endif
  3567. ! #if HAVE_TZNAME
  3568.     if (!(zone && *zone) && tp->tm_isdst >= 0)
  3569.       zone = tzname[tp->tm_isdst];
  3570.   #endif
  3571. --- 290,299 ----
  3572.     register const char *f;
  3573.   
  3574.     zone = 0;
  3575. ! #ifdef HAVE_TM_ZONE
  3576.     zone = (const char *) tp->tm_zone;
  3577.   #endif
  3578. ! #ifdef HAVE_TZNAME
  3579.     if (!(zone && *zone) && tp->tm_isdst >= 0)
  3580.       zone = tzname[tp->tm_isdst];
  3581.   #endif
  3582. ***************
  3583. *** 320,326 ****
  3584.               ? INT_STRLEN_BOUND (time_t)
  3585.               : INT_STRLEN_BOUND (int))];
  3586.   
  3587. ! #if DO_MULTIBYTE
  3588.   
  3589.          switch (*f)
  3590.       {
  3591. --- 320,326 ----
  3592.               ? INT_STRLEN_BOUND (time_t)
  3593.               : INT_STRLEN_BOUND (int))];
  3594.   
  3595. ! #ifdef DO_MULTIBYTE
  3596.   
  3597.          switch (*f)
  3598.       {
  3599. ***************
  3600. *** 482,488 ****
  3601.       case 'C':        /* POSIX.2 extension.  */
  3602.         if (modifier == 'O')
  3603.           goto bad_format;
  3604. ! #if HAVE_STRUCT_ERA_ENTRY
  3605.         if (modifier == 'E')
  3606.           {
  3607.             struct era_entry *era = _nl_get_era_entry (tp);
  3608. --- 482,488 ----
  3609.       case 'C':        /* POSIX.2 extension.  */
  3610.         if (modifier == 'O')
  3611.           goto bad_format;
  3612. ! #ifdef HAVE_STRUCT_ERA_ENTRY
  3613.         if (modifier == 'E')
  3614.           {
  3615.             struct era_entry *era = _nl_get_era_entry (tp);
  3616. ***************
  3617. *** 783,789 ****
  3618.         DO_NUMBER (1, tp->tm_wday);
  3619.   
  3620.       case 'Y':
  3621. ! #if HAVE_STRUCT_ERA_ENTRY
  3622.         if (modifier == 'E')
  3623.           {
  3624.             struct era_entry *era = _nl_get_era_entry (tp);
  3625. --- 783,789 ----
  3626.         DO_NUMBER (1, tp->tm_wday);
  3627.   
  3628.       case 'Y':
  3629. ! #ifdef HAVE_STRUCT_ERA_ENTRY
  3630.         if (modifier == 'E')
  3631.           {
  3632.             struct era_entry *era = _nl_get_era_entry (tp);
  3633. ***************
  3634. *** 800,806 ****
  3635.           DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
  3636.   
  3637.       case 'y':
  3638. ! #if HAVE_STRUCT_ERA_ENTRY
  3639.         if (modifier == 'E')
  3640.           {
  3641.             struct era_entry *era = _nl_get_era_entry (tp);
  3642. --- 800,806 ----
  3643.           DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
  3644.   
  3645.       case 'y':
  3646. ! #ifdef HAVE_STRUCT_ERA_ENTRY
  3647.         if (modifier == 'E')
  3648.           {
  3649.             struct era_entry *era = _nl_get_era_entry (tp);
  3650. ***************
  3651. *** 824,830 ****
  3652.   
  3653.         {
  3654.           int diff;
  3655. ! #if HAVE_TM_GMTOFF
  3656.           diff = tp->tm_gmtoff;
  3657.   #else
  3658.           struct tm gtm;
  3659. --- 824,830 ----
  3660.   
  3661.         {
  3662.           int diff;
  3663. ! #ifdef HAVE_TM_GMTOFF
  3664.           diff = tp->tm_gmtoff;
  3665.   #else
  3666.           struct tm gtm;
  3667. diff -cwr n:/project/C/octave-2.1.14.orig/src/syscalls.cc i:/project/C/octave-2.1.14/src/syscalls.cc
  3668. *** n:/project/C/octave-2.1.14.orig/src/syscalls.cc    Tue Nov 10 15:06:40 1998
  3669. --- i:/project/C/octave-2.1.14/src/syscalls.cc    Thu Apr 15 13:52:02 1999
  3670. ***************
  3671. *** 25,30 ****
  3672. --- 25,32 ----
  3673.   //
  3674.   //   mkfifo  unlink  waitpid
  3675.   
  3676. + /* Modified by Klaus Gebhardt, 1996 */
  3677.   #ifdef HAVE_CONFIG_H
  3678.   #include <config.h>
  3679.   #endif
  3680. ***************
  3681. *** 32,37 ****
  3682. --- 34,40 ----
  3683.   #include <cerrno>
  3684.   #include <cstdio>
  3685.   #include <cstring>
  3686. + #include <csignal>
  3687.   
  3688.   #ifdef HAVE_UNISTD_H
  3689.   #ifdef HAVE_SYS_TYPES_H
  3690. ***************
  3691. *** 48,53 ****
  3692. --- 51,58 ----
  3693.   #include "file-stat.h"
  3694.   #include "oct-syscalls.h"
  3695.   
  3696. + #include <process.h>
  3697.   #include "defun.h"
  3698.   #include "error.h"
  3699.   #include "gripes.h"
  3700. ***************
  3701. *** 56,61 ****
  3702. --- 61,68 ----
  3703.   #include "oct-obj.h"
  3704.   #include "oct-stdstrm.h"
  3705.   #include "oct-stream.h"
  3706. + #include "oct-fstrm.h"
  3707. + #include "sighandlers.h"
  3708.   #include "sysdep.h"
  3709.   #include "syswait.h"
  3710.   #include "utils.h"
  3711. ***************
  3712. *** 89,96 ****
  3713.     return m;
  3714.   }
  3715.   
  3716. ! DEFUN (dup2, args, ,
  3717. !  "[FID, MSG] = dup2 (OLD, NEW)\n\
  3718.   \n\
  3719.   Duplicate a file descriptor.\n\
  3720.   \n\
  3721. --- 96,152 ----
  3722.     return m;
  3723.   }
  3724.   
  3725. ! DEFUN (_dup, args, ,
  3726. !  "[FID, MSG] = _dup (old): duplicate a file descriptor")
  3727. ! {
  3728. !   octave_value_list retval;
  3729. !   retval(1) = string ();
  3730. !   retval(0) = -1.0;
  3731. !   int nargin = args.length ();
  3732. !   if (nargin == 1)
  3733. !     {
  3734. ! #if defined (HAVE_DUP)
  3735. !       double d_old = args(0).double_value ();
  3736. !       if (! error_state)
  3737. !     {
  3738. !       if (static_cast<int> (d_old) == d_old)
  3739. !         {
  3740. !           int i_old = static_cast<int> (d_old);
  3741. !           // XXX FIXME XXX -- are these checks sufficient?
  3742. !           if (i_old >= 0)
  3743. !         {
  3744. !           int status = dup (i_old);
  3745. !           retval(0) = (double) status;
  3746. !           if (status < 0)
  3747. !             retval(1) = strerror (errno);
  3748. !         }
  3749. !           else
  3750. !         error ("_dup: invalid file id");
  3751. !         }
  3752. !       else
  3753. !         error ("_dup: argument must be integer value");
  3754. !     }
  3755. !       else
  3756. !     error ("_dup: argument must be integer value");
  3757. ! #else
  3758. !       gripe_not_supported ("_dup");
  3759. ! #endif
  3760. !     }
  3761. !   else
  3762. !     print_usage ("_dup");
  3763. !   return retval;
  3764. ! }
  3765. ! DEFUN (_dup2, args, ,
  3766. !  "[FID, MSG] = _dup2 (OLD, NEW)\n\
  3767.   \n\
  3768.   Duplicate a file descriptor.\n\
  3769.   \n\
  3770. ***************
  3771. *** 106,118 ****
  3772.   
  3773.     if (nargin == 2)
  3774.       {
  3775. !       octave_stream *old_stream = octave_stream_list::lookup (args(0));
  3776. !       octave_stream *new_stream = octave_stream_list::lookup (args(1));
  3777.   
  3778.         if (! error_state)
  3779.       {
  3780. !       int i_old = old_stream->file_number ();
  3781. !       int i_new = new_stream->file_number ();
  3782.   
  3783.         if (i_old >= 0 && i_new >= 0)
  3784.           {
  3785. --- 162,177 ----
  3786.   
  3787.     if (nargin == 2)
  3788.       {
  3789. !       double d_old = args(0).double_value ();
  3790. !       double d_new = args(1).double_value ();
  3791.   
  3792.         if (! error_state)
  3793.       {
  3794. !       if ((static_cast<int> (d_old) == d_old) &&
  3795. !           (static_cast<int> (d_new) == d_new))
  3796. !         {
  3797. !           int i_old = static_cast<int> (d_old);
  3798. !           int i_new = static_cast<int> (d_new);
  3799.   
  3800.             if (i_old >= 0 && i_new >= 0)
  3801.           {
  3802. ***************
  3803. *** 124,136 ****
  3804.             retval(1) = msg;
  3805.           }
  3806.         else
  3807. !         error ("dup2: invalid file id");
  3808.       }
  3809.         else
  3810. !     error ("dup2: invalid stream");
  3811.       }
  3812.     else
  3813. !     print_usage ("dup2");
  3814.   
  3815.     return retval;
  3816.   }
  3817. --- 183,367 ----
  3818.             retval(1) = msg;
  3819.           }
  3820.             else
  3821. !         error ("_dup2: invalid file id");
  3822.           }
  3823.         else
  3824. !         error ("_dup2: arguments must be integer values");
  3825.       }
  3826.         else
  3827. !     error ("_dup2: invalid stream");
  3828. !     }
  3829. !   else
  3830. !     print_usage ("_dup2");
  3831. !   return retval;
  3832. ! }
  3833. ! DEFUN (_close, args, ,
  3834. !  "[RETVAL, MSG] = _close (fid): close a file handle")
  3835. ! {
  3836. !   octave_value_list retval;
  3837. !   retval(1) = string ();
  3838. !   retval(0) = -1.0;
  3839. !   int nargin = args.length ();
  3840. !   if (nargin == 1)
  3841. !     {
  3842. !       double d_old = args(0).double_value ();
  3843. !       if (! error_state)
  3844. !     {
  3845. !       if (static_cast<int> (d_old) == d_old)
  3846. !         {
  3847. !           int i_old = static_cast<int> (d_old);
  3848. !           // XXX FIXME XXX -- are these checks sufficient?
  3849. !           if (i_old >= 0)
  3850. !         {
  3851. !           int status = file_ops::close (i_old);
  3852. !           retval(0) = (double) status;
  3853. !           if (status < 0)
  3854. !             retval(1) = strerror (errno);
  3855. !         }
  3856. !           else
  3857. !         error ("_close: invalid file id");
  3858. !         }
  3859. !       else
  3860. !         error ("_close: argument must be integer value");
  3861. !     }
  3862. !     }
  3863. !   else
  3864. !     print_usage ("_close");
  3865. !   return retval;
  3866. ! }
  3867. ! DEFUN (_fdopen, args, ,
  3868. !  "[FID, MSG] = _fdopen (fid, mode): create a stream for file handle")
  3869. ! {
  3870. !   octave_value_list retval;
  3871. !   retval(1) = string ();
  3872. !   retval(0) = -1.0;
  3873. !   int nargin = args.length ();
  3874. !   if (nargin == 2)
  3875. !     {
  3876. !       if (args(1).is_string ())
  3877. !     {
  3878. !       string mode = args(1).string_value ();
  3879. !       double d_old = args(0).double_value ();
  3880. !       if (! error_state)
  3881. !         {
  3882. !           if (static_cast<int> (d_old) == d_old)
  3883. !         {
  3884. !           int i_old = static_cast<int> (d_old);
  3885. !           // XXX FIXME XXX -- are these checks sufficient?
  3886. !           if (i_old >= 0)
  3887. !             {
  3888. !               FILE *f = static_cast<FILE *> (file_ops::fdopen (i_old, mode));
  3889. !               if (f)
  3890. !             {
  3891. !               if (mode[0] == 'r')
  3892. !                 {
  3893. !                   octave_istdiostream *is
  3894. !                 = new octave_istdiostream ("fdopen", f);
  3895. !                   retval(0) = octave_stream_list::insert (is);
  3896. !                 }
  3897. !               else if (mode[1] == 'w')
  3898. !                 {
  3899. !                   octave_ostdiostream *os
  3900. !                 = new octave_ostdiostream ("fdopen", f);
  3901. !                   retval(0) = octave_stream_list::insert (os);
  3902. !                 }
  3903. !               else
  3904. !                 error ("_fdopen: invalid mode");
  3905. !             }
  3906. !               error ("_fdopen: error opening file id");
  3907. !             }
  3908. !           else
  3909. !             error ("_fdopen: invalid file id");
  3910. !         }
  3911. !           else
  3912. !         error ("_fdopen: argument must be integer value");
  3913. !         }
  3914. !     }
  3915. !       else
  3916. !     error ("_fdopen: mode must be a string");
  3917. !     }
  3918. !   else
  3919. !     print_usage ("_fdopen");
  3920. !   return retval;
  3921. ! }
  3922. ! DEFUN (spawn, args, ,
  3923. !  "[STATUS, MSG] = spawn (mode, file, args): run a program")
  3924. ! {
  3925. !   octave_value_list retval;
  3926. !   retval(1) = string ();
  3927. !   retval(0) = -1.0;
  3928. !   int nargin = args.length ();
  3929. !   if (nargin == 2 || nargin == 3)
  3930. !     {
  3931. !       string mode_strg = args(0).string_value ();
  3932. !       string exec_file = args(1).string_value ();
  3933. !       if (! error_state)
  3934. !     {
  3935. !       string_vector exec_args;
  3936. !       if (nargin == 3)
  3937. !         {
  3938. !           string_vector tmp = args(2).all_strings ();
  3939. !           if (! error_state)
  3940. !         {
  3941. !           int len = tmp.length ();
  3942. !           exec_args.resize (len + 1);
  3943. !           exec_args[0] = exec_file;
  3944. !           for (int i = 0; i < len; i++)
  3945. !             exec_args[i+1] = tmp[i];
  3946. !         }
  3947. !           else
  3948. !         error ("exec: arguments must be strings");
  3949. !         }
  3950. !       else
  3951. !         {
  3952. !           exec_args.resize (1);
  3953. !           exec_args[0] = exec_file;
  3954. !         }
  3955. !       if (! error_state)
  3956. !         {
  3957. !           string msg;
  3958. !           int status = octave_syscalls::spawnvp (mode_strg, exec_file, exec_args, msg);
  3959. !           retval(0) = static_cast<double> (status);
  3960. !           retval(1) = msg;
  3961. !         }
  3962. !     }
  3963. !       else
  3964. !     error ("spawn: first two arguments must be strings");
  3965. !     }
  3966. !   else
  3967. !     print_usage ("spawn");
  3968.   
  3969.     return retval;
  3970.   }
  3971. ***************
  3972. *** 202,209 ****
  3973.     return retval;
  3974.   }
  3975.   
  3976. ! DEFUN (fcntl, args, ,
  3977. !  "[STATUS, MSG] = fcntl (FID, REQUEST, ARGUMENT)\n\
  3978.   \n\
  3979.   Control open file descriptors.\n\
  3980.   \n\
  3981. --- 433,440 ----
  3982.     return retval;
  3983.   }
  3984.   
  3985. ! DEFUN (_fcntl, args, ,
  3986. !  "[STATUS, MSG] = _fcntl (FID, REQUEST, ARGUMENT)\n\
  3987.   \n\
  3988.   Control open file descriptors.\n\
  3989.   \n\
  3990. ***************
  3991. *** 474,479 ****
  3992. --- 705,757 ----
  3993.     return retval;
  3994.   }
  3995.   
  3996. + DEFUN (_pipe, args, ,
  3997. +   "[FIDS, STATUS, MSG] = _pipe (): create an interprocess channel.\n\
  3998. + \n\
  3999. + Return the FIDS corresponding to the reading and writing ends of\n\
  4000. + the pipe, as a vector.\n\
  4001. + \n\
  4002. + You must open the FIDS using _fdopen!\n\
  4003. + \n\
  4004. + If successful, STATUS is 0 and MSG is an empty string.  Otherwise,\n\
  4005. + STATUS is nonzero and MSG contains a system-dependent error message.")
  4006. + {
  4007. +   octave_value_list retval;
  4008. +   retval(2) = string ();
  4009. +   retval(1) = -1.0;
  4010. +   retval(0) = Matrix ();
  4011. +   int nargin = args.length ();
  4012. +   if (nargin == 0)
  4013. +     {
  4014. + #if defined (HAVE_PIPE)
  4015. +       int fid[2];
  4016. +       int status = pipe (fid);
  4017. +       if (status < 0)  retval(2) = strerror (errno);
  4018. +       else
  4019. +     {
  4020. +       Matrix file_ids (1, 2);
  4021. +       file_ids (0, 0) = (double) fid[0];
  4022. +       file_ids (0, 1) = (double) fid[1];
  4023. +           retval(0) = file_ids;
  4024. +       retval(1) = (double) status;
  4025. +     }      
  4026. + #else
  4027. +       gripe_not_supported ("_pipe");
  4028. + #endif
  4029. +     }
  4030. +   else
  4031. +     print_usage ("_pipe");
  4032. +   return retval;
  4033. + }
  4034.   DEFUN (pipe, args, ,
  4035.     "[FILE_LIST, STATUS, MSG] = pipe (): create an interprocess channel.\n\
  4036.   \n\
  4037. ***************
  4038. *** 679,685 ****
  4039. --- 957,976 ----
  4040.           {
  4041.             string msg;
  4042.   
  4043. + #ifdef __EMX__
  4044. +           volatile octave_interrupt_handler saved_interrupt_handler
  4045. +         = octave_ignore_interrupts ();
  4046. +           volatile sig_handler *saved_sigchld_handler
  4047. +         = octave_set_signal_handler (SIGCHLD, SIG_IGN);
  4048. + #endif
  4049.             pid_t status = octave_syscalls::waitpid (pid, options, msg);
  4050. + #ifdef __EMX__
  4051. +           octave_set_interrupt_handler (saved_interrupt_handler);
  4052. +           octave_set_signal_handler (SIGCHLD, saved_sigchld_handler);
  4053. + #endif
  4054.   
  4055.             retval(0) = static_cast<double> (status);
  4056.             retval(1) = msg;
  4057. diff -cwr n:/project/C/octave-2.1.14.orig/src/sysdep.cc i:/project/C/octave-2.1.14/src/sysdep.cc
  4058. *** n:/project/C/octave-2.1.14.orig/src/sysdep.cc    Fri Jan 29 04:30:02 1999
  4059. --- i:/project/C/octave-2.1.14/src/sysdep.cc    Thu Apr 15 14:01:04 1999
  4060. ***************
  4061. *** 20,25 ****
  4062. --- 20,27 ----
  4063.   
  4064.   */
  4065.   
  4066. + /* Modified by Klaus Gebhardt, 1996 */
  4067.   #ifdef HAVE_CONFIG_H
  4068.   #include <config.h>
  4069.   #endif
  4070. ***************
  4071. *** 52,57 ****
  4072. --- 54,64 ----
  4073.   LOSE! LOSE!
  4074.   #endif
  4075.   
  4076. + #ifdef __EMX__
  4077. + #include <float.h>
  4078. + #include <sys/uflags.h>
  4079. + #endif
  4080.   #if defined (HAVE_FLOATINGPOINT_H)
  4081.   #include <floatingpoint.h>
  4082.   #endif
  4083. ***************
  4084. *** 64,69 ****
  4085. --- 71,88 ----
  4086.   #include <sys/utsname.h>
  4087.   #endif
  4088.   
  4089. + #ifdef __EMX__
  4090. + #include <readline/readline.h>
  4091. + #include <readline/tilde.h>
  4092. + #include <sys/ioctl.h>
  4093. + extern "C"
  4094. + {
  4095. +   extern void tputs ();
  4096. +   extern char *term_clrpag;
  4097. +   extern void _rl_output_character_function ();
  4098. + }
  4099. + #endif
  4100.   #include "cmd-edit.h"
  4101.   #include "file-ops.h"
  4102.   #include "lo-mappers.h"
  4103. ***************
  4104. *** 123,128 ****
  4105. --- 142,149 ----
  4106.   {
  4107.     _control87 ((EM_INVALID | EM_DENORMAL | EM_ZERODIVIDE | EM_OVERFLOW
  4108.              | EM_UNDERFLOW | EM_INEXACT), MCW_EM);
  4109. +   _uflags (_UF_SBRK_MODEL, _UF_SBRK_ARBITRARY);
  4110.   }
  4111.   #endif
  4112.   
  4113. ***************
  4114. *** 309,314 ****
  4115. --- 330,336 ----
  4116.   kbhit (void)
  4117.   {
  4118.     int c;
  4119. +   flush_octave_stdout ();
  4120.     raw_mode (1);
  4121.     c = cin.get ();
  4122.     raw_mode (0);
  4123. ***************
  4124. *** 381,387 ****
  4125.   
  4126.     // XXX FIXME XXX -- add timeout and default value args?
  4127.   
  4128. !   if (interactive)
  4129.       {
  4130.         int c = kbhit ();
  4131.         char *s = new char [2];
  4132. --- 403,409 ----
  4133.   
  4134.     // XXX FIXME XXX -- add timeout and default value args?
  4135.   
  4136. !   if (interactive || really_forced_interactive)
  4137.       {
  4138.         int c = kbhit ();
  4139.         char *s = new char [2];
  4140. ***************
  4141. *** 483,488 ****
  4142. --- 505,515 ----
  4143.   
  4144.             if (delay > 0)
  4145.           usleep (delay);
  4146. + #elif defined (HAVE__SLEEP2)
  4147. +           int delay = NINT (dval / 1e3);
  4148. +           if (delay > 0)
  4149. +         _sleep2 (delay);
  4150.   #else
  4151.             int delay = NINT (dval / 1e6);
  4152.   
  4153. ***************
  4154. *** 536,541 ****
  4155. --- 563,589 ----
  4156.   
  4157.   DEFALIAS (EXTPROC, extproc);
  4158.   
  4159. + DEFUN (add_to_command_number, args, ,
  4160. +        "add_to_command_number: add argument to the current command number")
  4161. + {
  4162. +   octave_value_list retval;
  4163. +   int nargin;
  4164. +   if ((nargin = args.length ()) != 1)
  4165. +     {
  4166. +       print_usage ("add_to_command_number");
  4167. +       return retval;
  4168. +     }
  4169. +   double tmp_d = args(0).double_value ();
  4170. +   if (error_state || (static_cast<int> (tmp_d) != tmp_d))
  4171. +     error ("add_to_command_number: expecting integer as argument");
  4172. +   else
  4173. +     command_editor::add_current_command_number (static_cast<int> (tmp_d));
  4174. +   return retval;
  4175. + }
  4176.   #endif
  4177.   
  4178.   /*
  4179. diff -cwr n:/project/C/octave-2.1.14.orig/src/toplev.cc i:/project/C/octave-2.1.14/src/toplev.cc
  4180. *** n:/project/C/octave-2.1.14.orig/src/toplev.cc    Fri Jan 29 04:50:02 1999
  4181. --- i:/project/C/octave-2.1.14/src/toplev.cc    Thu Apr 15 13:13:50 1999
  4182. ***************
  4183. *** 20,25 ****
  4184. --- 20,27 ----
  4185.   
  4186.   */
  4187.   
  4188. + /* Modified by Klaus Gebhardt, 1996 - 1999 */
  4189.   #ifdef HAVE_CONFIG_H
  4190.   #include <config.h>
  4191.   #endif
  4192. ***************
  4193. *** 79,84 ****
  4194. --- 81,94 ----
  4195.   #include "variables.h"
  4196.   #include <version.h>
  4197.   
  4198. + #ifdef __EMX__
  4199. + extern "C"
  4200. + {
  4201. + #include <process.h>
  4202. +   int _IO_system (const char *, int);
  4203. + }
  4204. + #endif
  4205.   // TRUE means we are exiting via the builtin exit or quit functions.
  4206.   static bool quitting_gracefully = false;
  4207.   
  4208. ***************
  4209. *** 100,105 ****
  4210. --- 110,119 ----
  4211.   
  4212.     if (setjmp (toplevel) != 0)
  4213.       {
  4214. + #if defined (__EMX__) && defined (OS2)
  4215. +       unwind_protect::run_all ();
  4216. + #endif
  4217.         raw_mode (0);
  4218.   
  4219.         cout << "\n";
  4220. ***************
  4221. *** 116,121 ****
  4222. --- 130,140 ----
  4223.     int retval;
  4224.     do
  4225.       {
  4226. + #ifdef __EMX__
  4227. +       can_interrupt = 1;
  4228. +       octave_catch_interrupts ();
  4229. + #endif
  4230.         curr_sym_tab = top_level_sym_tab;
  4231.   
  4232.         reset_parser ();
  4233. ***************
  4234. *** 130,136 ****
  4235.   
  4236.         global_command = 0;
  4237.   
  4238. !       if (! (interactive || forced_interactive))
  4239.           {
  4240.             bool quit = (tree_return_command::returning
  4241.                  || tree_break_command::breaking);
  4242. --- 149,156 ----
  4243.   
  4244.         global_command = 0;
  4245.   
  4246. !       if (! (interactive || forced_interactive
  4247. !          || really_forced_interactive))
  4248.           {
  4249.             bool quit = (tree_return_command::returning
  4250.                  || tree_break_command::breaking);
  4251. ***************
  4252. *** 147,153 ****
  4253.   
  4254.         if (error_state)
  4255.           {
  4256. !           if (! (interactive || forced_interactive))
  4257.           break;
  4258.           }
  4259.         else
  4260. --- 167,174 ----
  4261.   
  4262.         if (error_state)
  4263.           {
  4264. !           if (! (interactive || forced_interactive
  4265. !              || really_forced_interactive))
  4266.           break;
  4267.           }
  4268.         else
  4269. ***************
  4270. *** 171,176 ****
  4271. --- 192,201 ----
  4272.   {
  4273.     do_octave_atexit ();
  4274.   
  4275. + #if defined (__EMX__)
  4276. +   _sleep2 (500);
  4277. + #endif
  4278.     exit (retval == EOF ? 0 : retval);
  4279.   }
  4280.   
  4281. ***************
  4282. *** 280,286 ****
  4283.   
  4284.   // Execute a shell command.
  4285.   
  4286. ! static int cmd_status = 0;
  4287.   
  4288.   static void
  4289.   cmd_death_handler (pid_t, int status)
  4290. --- 305,312 ----
  4291.   
  4292.   // Execute a shell command.
  4293.   
  4294. ! static int cmd_status = -1;
  4295. ! static int cmd_pid    = -1;
  4296.   
  4297.   static void
  4298.   cmd_death_handler (pid_t, int status)
  4299. ***************
  4300. *** 293,299 ****
  4301.   {
  4302.     iprocstream *cmd = static_cast<iprocstream *> (p);
  4303.   
  4304. !   octave_child_list::remove (cmd->pid ());
  4305.   
  4306.     delete cmd;
  4307.   }
  4308. --- 319,325 ----
  4309.   {
  4310.     iprocstream *cmd = static_cast<iprocstream *> (p);
  4311.   
  4312. !   octave_child_list::remove (cmd_pid);
  4313.   
  4314.     delete cmd;
  4315.   }
  4316. ***************
  4317. *** 306,315 ****
  4318.     iprocstream *cmd = new iprocstream (cmd_str.c_str ());
  4319.   
  4320.     cmd_status = -1;
  4321.   
  4322.     if (cmd)
  4323.       {
  4324. !       octave_child_list::insert (cmd->pid (), cmd_death_handler);
  4325.   
  4326.         unwind_protect::add (cleanup_iprocstream, cmd);
  4327.   
  4328. --- 332,342 ----
  4329.     iprocstream *cmd = new iprocstream (cmd_str.c_str ());
  4330.   
  4331.     cmd_status = -1;
  4332. +   cmd_pid    = cmd->pid ();
  4333.   
  4334.     if (cmd)
  4335.       {
  4336. !       octave_child_list::insert (cmd_pid, cmd_death_handler);
  4337.   
  4338.         unwind_protect::add (cleanup_iprocstream, cmd);
  4339.   
  4340. ***************
  4341. *** 344,350 ****
  4342.         while (cmd->get (ch))
  4343.           output_buf.put (ch);
  4344.   
  4345. !       cmd->close ();
  4346.   
  4347.         // One way or another, cmd_death_handler should be called
  4348.         // when the process exits, and it will save the exit status
  4349. --- 371,377 ----
  4350.         while (cmd->get (ch))
  4351.           output_buf.put (ch);
  4352.   
  4353. !       cmd_status = cmd->close ();
  4354.   
  4355.         // One way or another, cmd_death_handler should be called
  4356.         // when the process exits, and it will save the exit status
  4357. ***************
  4358. *** 411,417 ****
  4359. --- 438,448 ----
  4360.   
  4361.         string cmd_str = args(0).string_value ();
  4362.   
  4363. + #if defined (__EMX__) && defined (OS2)
  4364. +       enum exec_type { sync, async, pm };
  4365. + #else
  4366.         enum exec_type { sync, async };
  4367. + #endif
  4368.   
  4369.         exec_type type = sync;
  4370.   
  4371. ***************
  4372. *** 427,434 ****
  4373. --- 458,473 ----
  4374.               type = sync;
  4375.             else if (type_str == "async")
  4376.               type = async;
  4377. + #if defined (__EMX__) && defined (OS2)
  4378. +           else if (type_str == "pm")
  4379. +             type = pm;
  4380. +           else
  4381. +             error ("system: third arg must be \"sync\" , \"async\""
  4382. +                "or \"pm\"");
  4383. + #else
  4384.             else
  4385.               error ("system: third arg must be \"sync\" or \"async\"");
  4386. + #endif
  4387.           }
  4388.             else
  4389.           error ("system: third argument must be a string");
  4390. ***************
  4391. *** 439,446 ****
  4392. --- 478,490 ----
  4393.   
  4394.         if (! error_state)
  4395.       {
  4396. + #if defined (__EMX__) && defined (OS2)
  4397. +       if (type == async || type == pm)
  4398. + #else
  4399.         if (type == async)
  4400. + #endif
  4401.           {
  4402. + #ifndef __EMX__
  4403.             pid_t pid = fork ();
  4404.   
  4405.             if (pid < 0) 
  4406. ***************
  4407. *** 453,465 ****
  4408. --- 497,530 ----
  4409.           }
  4410.             else
  4411.           retval(0) = static_cast<double> (pid);
  4412. + #else
  4413. +           pid_t pid;
  4414. +           int p_mode;
  4415. + #ifdef OS2
  4416. +           if (type == pm)  p_mode = P_PM;
  4417. +           else             p_mode = P_NOWAIT;
  4418. + #else
  4419. +           p_mode = P_NOWAIT;
  4420. + #endif
  4421. +           pid = _IO_system (cmd_str.c_str (), p_mode);
  4422. +           if (pid < 0)
  4423. +         error ("system: spawn failed -- can't create child process");
  4424. +           else
  4425. +         retval(0) = (double) pid;
  4426. + #endif
  4427.           }
  4428.         else if (return_output)
  4429.           retval = run_command_and_return_output (cmd_str);
  4430.         else
  4431.           {
  4432. + #ifdef __EMX__
  4433. +           int status = _IO_system (cmd_str.c_str (), P_WAIT);
  4434. + #else
  4435.             int status = system (cmd_str.c_str ());
  4436. + #endif
  4437.   
  4438. + #ifndef __EMX__
  4439.             // The value in status is as returned by waitpid.  If
  4440.             // the process exited normally, extract the actual exit
  4441.             // status of the command.  Otherwise, return 127 as a
  4442. ***************
  4443. *** 467,472 ****
  4444. --- 532,540 ----
  4445.   
  4446.             if (WIFEXITED (status))
  4447.           status = WEXITSTATUS (status);
  4448. +           else
  4449. +         status = 127;
  4450. + #endif
  4451.   
  4452.             retval = static_cast<double> (status);
  4453.           }
  4454. ***************
  4455. *** 480,488 ****
  4456.   
  4457.   DEFALIAS (shell_cmd, system);
  4458.   
  4459. ! // XXX FIXME XXX -- this should really be static, but that causes
  4460. ! // problems on some systems.
  4461. ! SLStack<string> octave_atexit_functions;
  4462.   
  4463.   void
  4464.   do_octave_atexit (void)
  4465. --- 548,554 ----
  4466.   
  4467.   DEFALIAS (shell_cmd, system);
  4468.   
  4469. ! static SLStack<string> octave_atexit_functions;
  4470.   
  4471.   void
  4472.   do_octave_atexit (void)
  4473. ***************
  4474. *** 517,523 ****
  4475.   
  4476.         flush_octave_stdout ();
  4477.   
  4478. !       if (!quitting_gracefully && (interactive || forced_interactive))
  4479.       cout << "\n";
  4480.       }
  4481.   }
  4482. --- 583,590 ----
  4483.   
  4484.         flush_octave_stdout ();
  4485.   
  4486. !       if (!quitting_gracefully &&
  4487. !       (interactive || forced_interactive || really_forced_interactive))
  4488.       cout << "\n";
  4489.       }
  4490.   }
  4491. diff -cwr n:/project/C/octave-2.1.14.orig/src/utils.cc i:/project/C/octave-2.1.14/src/utils.cc
  4492. *** n:/project/C/octave-2.1.14.orig/src/utils.cc    Thu Dec  3 05:39:16 1998
  4493. --- i:/project/C/octave-2.1.14/src/utils.cc    Thu Apr 15 12:52:26 1999
  4494. ***************
  4495. *** 20,25 ****
  4496. --- 20,27 ----
  4497.   
  4498.   */
  4499.   
  4500. + /* Modified by Klaus Gebhardt, 1996 */
  4501.   #ifdef HAVE_CONFIG_H
  4502.   #include <config.h>
  4503.   #endif
  4504. ***************
  4505. *** 88,94 ****
  4506. --- 90,98 ----
  4507.   extern "C" void
  4508.   jump_to_top_level (void)
  4509.   {
  4510. + #if ! defined (__EMX__) || ! defined (OS2)
  4511.     unwind_protect::run_all ();
  4512. + #endif
  4513.   
  4514.     longjmp (toplevel, 1);
  4515.   }
  4516. diff -cwr n:/project/C/octave-2.1.14.orig/src/variables.cc i:/project/C/octave-2.1.14/src/variables.cc
  4517. *** n:/project/C/octave-2.1.14.orig/src/variables.cc    Fri Mar 26 23:55:32 1999
  4518. --- i:/project/C/octave-2.1.14/src/variables.cc    Thu Apr 15 14:04:56 1999
  4519. ***************
  4520. *** 20,25 ****
  4521. --- 20,27 ----
  4522.   
  4523.   */
  4524.   
  4525. + /* Modified by Klaus Gebhardt, 1996 - 1998 */
  4526.   #ifdef HAVE_CONFIG_H
  4527.   #include <config.h>
  4528.   #endif
  4529. ***************
  4530. *** 34,39 ****
  4531. --- 36,42 ----
  4532.   #include "oct-env.h"
  4533.   #include "glob-match.h"
  4534.   #include "str-vec.h"
  4535. + #include "lo-mappers.h"
  4536.   
  4537.   #include <defaults.h>
  4538.   #include "defun.h"
  4539. ***************
  4540. *** 45,50 ****
  4541. --- 48,56 ----
  4542.   #include "lex.h"
  4543.   #include "oct-map.h"
  4544.   #include "oct-obj.h"
  4545. + #ifndef __EMX__
  4546. + #include "oct-procbuf.h"
  4547. + #endif
  4548.   #include "ov.h"
  4549.   #include "pager.h"
  4550.   #include "parse.h"
  4551. ***************
  4552. *** 1214,1219 ****
  4553. --- 1220,1262 ----
  4554.       "don't check to see if function files have changed since they were\n\
  4555.   last compiled.  Possible values are \"system\" and \"all\"");
  4556.   }
  4557. + #ifdef __EMX__
  4558. + // We are using a general procbuf!
  4559. + // So this has to be defined here.
  4560. + // Klaus Gebhardt, 1998
  4561. + static int Vkluge_procbuf_delay = 0;
  4562. + static int
  4563. + kluge_procbuf_delay (void)
  4564. + {
  4565. +   double val;
  4566. +   if (builtin_real_scalar_variable ("kluge_procbuf_delay", val)
  4567. +       && ! xisnan (val))
  4568. +     {
  4569. +       int ival = static_cast<int> (val);
  4570. +       if (ival >= 0 && (double) ival == val)
  4571. +     {
  4572. +       Vkluge_procbuf_delay = ival;
  4573. +       return 0;
  4574. +     }
  4575. +     }
  4576. +   gripe_invalid_value_specified ("kluge_procbuf_delay");
  4577. +   return -1;
  4578. + }
  4579. + static void
  4580. + symbols_of_oct_procbuf (void)
  4581. + {
  4582. +   DEFVAR (kluge_procbuf_delay,  static_cast<double> (Vkluge_procbuf_delay),
  4583. +       0, kluge_procbuf_delay,
  4584. +       "number of microseconds to delay in the parent after forking\n\
  4585. + (not used under OS/2)");
  4586. + }
  4587. + #endif
  4588.   
  4589.   /*
  4590.   ;;; Local Variables: ***
  4591. diff -cwr n:/project/C/octave-2.1.14.orig/src/version.h i:/project/C/octave-2.1.14/src/version.h
  4592. *** n:/project/C/octave-2.1.14.orig/src/version.h    Tue Mar 30 08:03:18 1999
  4593. --- i:/project/C/octave-2.1.14/src/version.h    Thu Apr 15 12:39:42 1999
  4594. ***************
  4595. *** 23,28 ****
  4596. --- 23,59 ----
  4597.   #if !defined (octave_version_h)
  4598.   #define octave_version_h 1
  4599.   
  4600. + /* Modified by Klaus Gebhardt, 1996 - 1998 */
  4601. + #if defined (__EMX__) && defined (OS2)
  4602. + #define OCTAVE_VERSION "2.1.14"
  4603. + #define OCTAVE_OS2_PATCHLEVEL "2.1.14-b01"
  4604. + #define OCTAVE_COPYRIGHT \
  4605. + "Copyright (C) 1996, 1997, 1998 John W. Eaton.\n\
  4606. + OS/2-Port by Klaus Gebhardt, 1996 - 1999."
  4607. + #define OCTAVE_NAME_AND_VERSION \
  4608. + "Octave " OCTAVE_VERSION " for OS/2 2.x, Warp 3 and Warp 4.\n(Patchlevel " \
  4609. + OCTAVE_OS2_PATCHLEVEL ")"
  4610. + #define OCTAVE_NAME_VERSION_AND_COPYRIGHT \
  4611. +   OCTAVE_NAME_AND_VERSION ".\n" OCTAVE_COPYRIGHT "\n\
  4612. + This is free software with ABSOLUTELY NO WARRANTY."
  4613. + #define OCTAVE_STARTUP_MESSAGE \
  4614. +   OCTAVE_NAME_VERSION_AND_COPYRIGHT "\n\
  4615. + For details, type `warranty'.\n\
  4616. + \n\
  4617. + *** This is a development version of Octave.  Development releases\n\
  4618. + *** are provided for people who want to help test, debug, and improve\n\
  4619. + *** Octave.\n\
  4620. + ***\n\
  4621. + *** If you want a stable, well-tested version of Octave, you should be\n\
  4622. + *** using one of the stable releases (when this development release\n\
  4623. + *** was made, the latest stable version was 2.0.13)."
  4624. + #else
  4625.   #define OCTAVE_VERSION "2.1.14"
  4626.   
  4627.   #define OCTAVE_COPYRIGHT \
  4628. ***************
  4629. *** 47,52 ****
  4630. --- 78,84 ----
  4631.   *** using one of the stable releases (when this development release\n\
  4632.   *** was made, the latest stable version was 2.0.13)."
  4633.   
  4634. + #endif
  4635.   #endif
  4636.   
  4637.   /*
  4638. diff -cwr n:/project/C/octave-2.1.14.orig/scripts/image/colormap.m i:/project/C/octave-2.1.14/scripts/image/colormap.m
  4639. *** n:/project/C/octave-2.1.14.orig/scripts/image/colormap.m    Thu Mar 11 19:35:56 1999
  4640. --- i:/project/C/octave-2.1.14/scripts/image/colormap.m    Wed Nov 19 07:27:52 1997
  4641. ***************
  4642. *** 1,4 ****
  4643. ! ## Copyright (C) 1996, 1997 John W. Eaton
  4644.   ##
  4645.   ## This file is part of Octave.
  4646.   ##
  4647. --- 1,4 ----
  4648. ! ## Copyright (C) 1996 John W. Eaton
  4649.   ##
  4650.   ## This file is part of Octave.
  4651.   ##
  4652. ***************
  4653. *** 29,35 ****
  4654.   ##
  4655.   ## colormap with no arguments returns the current colormap.
  4656.   
  4657. ! ## Author: Tony Richardson <arichard@stark.cc.oh.us>
  4658.   ## Created: July 1994
  4659.   ## Adapted-By: jwe
  4660.   
  4661. --- 29,35 ----
  4662.   ##
  4663.   ## colormap with no arguments returns the current colormap.
  4664.   
  4665. ! ## Author: Tony Richardson <amr@mpl.ucsd.edu>
  4666.   ## Created: July 1994
  4667.   ## Adapted-By: jwe
  4668.   
  4669. ***************
  4670. *** 42,76 ****
  4671.     endif
  4672.   
  4673.     if (nargin == 1)
  4674.       if (isstr (map))
  4675.         if (strcmp (map, "default"))
  4676. !         map = gray ();
  4677.         else
  4678. !     unwind_protect
  4679. !       save_default_eval_print_flag = default_eval_print_flag;
  4680. !       default_eval_print_flag = 0;
  4681. !       map = eval (map);
  4682. !     unwind_protect_cleanup
  4683. !       default_eval_print_flag = save_default_eval_print_flag;
  4684. !     end_unwind_protect
  4685. !       endif
  4686. !     endif
  4687. !     if (! isempty (map))
  4688. !       if (columns (map) != 3)
  4689. !     error( "colormap: map must have 3 columns: [R,G,B]." );
  4690. !       endif
  4691. !       if (min (min (map)) < 0 || max (max (map)) > 1)
  4692. !         error( "colormap: map must have values in [0,1]." );
  4693.         endif
  4694.         ## Set the new color map
  4695.         __current_color_map__ = map;
  4696.       endif
  4697.     endif
  4698.   
  4699.     ## Return current color map.
  4700.     cmap = __current_color_map__;
  4701.   
  4702.   endfunction
  4703. --- 42,61 ----
  4704.     endif
  4705.   
  4706.     if (nargin == 1)
  4707.       if (isstr (map))
  4708.         if (strcmp (map, "default"))
  4709. !         __current_color_map__ = gray ();
  4710.         else
  4711. !         error ("invalid argument");
  4712.         endif
  4713. +     else
  4714.         ## Set the new color map
  4715.         __current_color_map__ = map;
  4716.       endif
  4717.     endif
  4718.   
  4719.     ## Return current color map.
  4720.     cmap = __current_color_map__;
  4721.   
  4722.   endfunction
  4723. diff -cwr n:/project/C/octave-2.1.14.orig/scripts/image/gray.m i:/project/C/octave-2.1.14/scripts/image/gray.m
  4724. *** n:/project/C/octave-2.1.14.orig/scripts/image/gray.m    Tue Nov 10 15:11:20 1998
  4725. --- i:/project/C/octave-2.1.14/scripts/image/gray.m    Thu Jul 11 22:25:22 1996
  4726. ***************
  4727. *** 1,4 ****
  4728. ! ## Copyright (C) 1996, 1997 John W. Eaton
  4729.   ##
  4730.   ## This file is part of Octave.
  4731.   ##
  4732. --- 1,4 ----
  4733. ! ## Copyright (C) 1996 John W. Eaton
  4734.   ##
  4735.   ## This file is part of Octave.
  4736.   ##
  4737. ***************
  4738. *** 19,25 ****
  4739.   
  4740.   ## Colormap.
  4741.   
  4742. ! ## Author: Tony Richardson <arichard@stark.cc.oh.us>
  4743.   ## Created: July 1994
  4744.   ## Adapted-By: jwe
  4745.   
  4746. --- 19,25 ----
  4747.   
  4748.   ## Colormap.
  4749.   
  4750. ! ## Author: Tony Richardson <amr@mpl.ucsd.edu>
  4751.   ## Created: July 1994
  4752.   ## Adapted-By: jwe
  4753.   
  4754. diff -cwr n:/project/C/octave-2.1.14.orig/scripts/image/gray2ind.m i:/project/C/octave-2.1.14/scripts/image/gray2ind.m
  4755. *** n:/project/C/octave-2.1.14.orig/scripts/image/gray2ind.m    Tue Nov 10 15:11:20 1998
  4756. --- i:/project/C/octave-2.1.14/scripts/image/gray2ind.m    Thu Jul 11 22:25:22 1996
  4757. ***************
  4758. *** 1,4 ****
  4759. ! ## Copyright (C) 1996, 1997 John W. Eaton
  4760.   ##
  4761.   ## This file is part of Octave.
  4762.   ##
  4763. --- 1,4 ----
  4764. ! ## Copyright (C) 1996 John W. Eaton
  4765.   ##
  4766.   ## This file is part of Octave.
  4767.   ##
  4768. ***************
  4769. *** 19,25 ****
  4770.   
  4771.   ## Image format conversion
  4772.   
  4773. ! ## Author: Tony Richardson <arichard@stark.cc.oh.us>
  4774.   ## Created: July 1994
  4775.   ## Adapted-By: jwe
  4776.   
  4777. --- 19,25 ----
  4778.   
  4779.   ## Image format conversion
  4780.   
  4781. ! ## Author: Tony Richardson <amr@mpl.ucsd.edu>
  4782.   ## Created: July 1994
  4783.   ## Adapted-By: jwe
  4784.   
  4785. diff -cwr n:/project/C/octave-2.1.14.orig/scripts/image/image.m i:/project/C/octave-2.1.14/scripts/image/image.m
  4786. *** n:/project/C/octave-2.1.14.orig/scripts/image/image.m    Tue Nov 10 15:11:20 1998
  4787. --- i:/project/C/octave-2.1.14/scripts/image/image.m    Wed Jul  1 22:00:10 1998
  4788. ***************
  4789. *** 1,4 ****
  4790. ! ## Copyright (C) 1996, 1997 John W. Eaton
  4791.   ##
  4792.   ## This file is part of Octave.
  4793.   ##
  4794. --- 1,4 ----
  4795. ! ## Copyright (C) 1996 John W. Eaton
  4796.   ##
  4797.   ## This file is part of Octave.
  4798.   ##
  4799. ***************
  4800. *** 23,66 ****
  4801.   ## indices into the current colormap and should have values between 1
  4802.   ## and the length of the colormap.
  4803.   ##
  4804. ! ## image (x, zoom) changes the zoom factor.  The default value is 4.
  4805.   ##
  4806. ! ## SEE ALSO: imshow, imagesc, colormap.
  4807.   
  4808. ! ## Author: Tony Richardson <arichard@stark.cc.oh.us>
  4809.   ## Created: July 1994
  4810.   ## Adapted-By: jwe
  4811.   
  4812.   function image (x, zoom)
  4813.   
  4814.     if (nargin == 0)
  4815.       ## Load Bobbie Jo Richardson (Born 3/16/94)
  4816. !     x = loadimage ("default.img");
  4817. !     zoom = 2;
  4818.     elseif (nargin == 1)
  4819. !     zoom = 4;
  4820.     elseif (nargin > 2)
  4821.       usage ("image (matrix, [zoom])");
  4822.     endif
  4823.   
  4824. !   ppm_name = tmpnam ();
  4825.   
  4826. !   saveimage (ppm_name, x, "ppm");
  4827.   
  4828. !   ## Start the viewer.  Try xv, then xloadimage.
  4829.   
  4830. !   xv = sprintf ("xv -expand %f %s", zoom, ppm_name);
  4831. !   xloadimage = sprintf ("xloadimage -zoom %f %s", zoom*100, ppm_name);
  4832. !   rm = sprintf ("rm -f %s", ppm_name);
  4833. !   ## Need to let the shell clean up the tmp file because we are putting
  4834. !   ## the viewer in the background.
  4835. !   command = sprintf ("( %s || %s && %s ) > /dev/null 2>&1 &",
  4836. !              xv, xloadimage, rm);
  4837. !   system (command);
  4838.   
  4839.   endfunction
  4840. --- 23,56 ----
  4841.   ## indices into the current colormap and should have values between 1
  4842.   ## and the length of the colormap.
  4843.   ##
  4844. ! ## image (x, zoom) changes the zoom factor.  The default value is 1.
  4845.   ##
  4846. ! ## SEE ALSO: imshow, imagesc, colormap.## SEE ALSO: imshow, imagesc, colormap.
  4847.   
  4848. ! ## Author: Tony Richardson <amr@mpl.ucsd.edu>
  4849.   ## Created: July 1994
  4850.   ## Adapted-By: jwe
  4851. + ## Modified by Klaus Gebhardt, 1996 - 1997
  4852.   
  4853.   function image (x, zoom)
  4854.   
  4855.     if (nargin == 0)
  4856.       ## Load Bobbie Jo Richardson (Born 3/16/94)
  4857. !     [x, map] = loadimage ("default.img");
  4858.     elseif (nargin == 1)
  4859. !     zoom = 1;
  4860.     elseif (nargin > 2)
  4861.       usage ("image (matrix, [zoom])");
  4862.     endif
  4863.   
  4864. !   pnm_name = tmpnam ();
  4865.   
  4866. !   saveimage (pnm_name, x, "pnm");
  4867.   
  4868. !   ## Start the viewer.
  4869. !   i = findstr (pnm_name, "/");
  4870. !   pnm_name (i) = "\\";
  4871.   
  4872. !   system (sprintf ("oct-view %s %f", pnm_name, zoom));
  4873.   
  4874.   endfunction
  4875. diff -cwr n:/project/C/octave-2.1.14.orig/scripts/image/imagesc.m i:/project/C/octave-2.1.14/scripts/image/imagesc.m
  4876. *** n:/project/C/octave-2.1.14.orig/scripts/image/imagesc.m    Wed Nov 25 04:45:06 1998
  4877. --- i:/project/C/octave-2.1.14/scripts/image/imagesc.m    Thu Jul 11 22:25:22 1996
  4878. ***************
  4879. *** 1,4 ****
  4880. ! ## Copyright (C) 1996, 1997 John W. Eaton
  4881.   ##
  4882.   ## This file is part of Octave.
  4883.   ##
  4884. --- 1,4 ----
  4885. ! ## Copyright (C) 1996 John W. Eaton
  4886.   ##
  4887.   ## This file is part of Octave.
  4888.   ##
  4889. ***************
  4890. *** 27,40 ****
  4891.   ##
  4892.   ## SEE ALSO: image, imshow
  4893.   
  4894. ! ## Author: Tony Richardson <arichard@stark.cc.oh.us>
  4895.   ## Created: July 1994
  4896.   ## Adapted-By: jwe
  4897.   
  4898. ! function y = imagesc (x, zoom)
  4899.   
  4900.     if (nargin < 1 || nargin > 2)
  4901. !     usage ("imagesc (matrix, [zoom])");
  4902.     elseif (nargin == 1)
  4903.       zoom = 4;
  4904.     endif
  4905. --- 27,40 ----
  4906.   ##
  4907.   ## SEE ALSO: image, imshow
  4908.   
  4909. ! ## Author: Tony Richardson <amr@mpl.ucsd.edu>
  4910.   ## Created: July 1994
  4911.   ## Adapted-By: jwe
  4912.   
  4913. ! function x = imagesc (x, zoom)
  4914.   
  4915.     if (nargin < 1 || nargin > 2)
  4916. !     usage ("image (matrix, [zoom])");
  4917.     elseif (nargin == 1)
  4918.       zoom = 4;
  4919.     endif
  4920. ***************
  4921. *** 48,59 ****
  4922.     ## length (colormap) inclusive.
  4923.   
  4924.     if (maxval == minval)
  4925. !     y = ones (high, wide);
  4926.     else
  4927.       ## Rescale values to between 1 and length (colormap) inclusive.
  4928. !     y = round ((x - minval) / (maxval - minval) * (rows (colormap) - 1)) + 1;
  4929.     endif
  4930.   
  4931. !   image (y, zoom);
  4932.   
  4933.   endfunction
  4934. --- 48,59 ----
  4935.     ## length (colormap) inclusive.
  4936.   
  4937.     if (maxval == minval)
  4938. !     x = ones (high, wide);
  4939.     else
  4940.       ## Rescale values to between 1 and length (colormap) inclusive.
  4941. !     x = fix ((x - minval) / (maxval - minval) * (length (colormap) - 1)) + 1;
  4942.     endif
  4943.   
  4944. !   image (x, zoom);
  4945.   
  4946.   endfunction
  4947. diff -cwr n:/project/C/octave-2.1.14.orig/scripts/image/imshow.m i:/project/C/octave-2.1.14/scripts/image/imshow.m
  4948. *** n:/project/C/octave-2.1.14.orig/scripts/image/imshow.m    Tue Nov 10 15:11:20 1998
  4949. --- i:/project/C/octave-2.1.14/scripts/image/imshow.m    Thu Jul 11 22:25:22 1996
  4950. ***************
  4951. *** 1,4 ****
  4952. ! ## Copyright (C) 1996, 1997 John W. Eaton
  4953.   ##
  4954.   ## This file is part of Octave.
  4955.   ##
  4956. --- 1,4 ----
  4957. ! ## Copyright (C) 1996 John W. Eaton
  4958.   ##
  4959.   ## This file is part of Octave.
  4960.   ##
  4961. ***************
  4962. *** 29,35 ****
  4963.   ##
  4964.   ## SEE ALSO: image, imagesc, colormap, gray2ind, rgb2ind.
  4965.   
  4966. ! ## Author: Tony Richardson <arichard@stark.cc.oh.us>
  4967.   ## Created: July 1994
  4968.   ## Adapted-By: jwe
  4969.   
  4970. --- 29,35 ----
  4971.   ##
  4972.   ## SEE ALSO: image, imagesc, colormap, gray2ind, rgb2ind.
  4973.   
  4974. ! ## Author: Tony Richardson <amr@mpl.ucsd.edu>
  4975.   ## Created: July 1994
  4976.   ## Adapted-By: jwe
  4977.   
  4978. diff -cwr n:/project/C/octave-2.1.14.orig/scripts/image/ind2gray.m i:/project/C/octave-2.1.14/scripts/image/ind2gray.m
  4979. *** n:/project/C/octave-2.1.14.orig/scripts/image/ind2gray.m    Tue Nov 10 15:11:20 1998
  4980. --- i:/project/C/octave-2.1.14/scripts/image/ind2gray.m    Thu Oct 10 23:38:00 1996
  4981. ***************
  4982. *** 1,4 ****
  4983. ! ## Copyright (C) 1996, 1997 John W. Eaton
  4984.   ##
  4985.   ## This file is part of Octave.
  4986.   ##
  4987. --- 1,4 ----
  4988. ! ## Copyright (C) 1996 John W. Eaton
  4989.   ##
  4990.   ## This file is part of Octave.
  4991.   ##
  4992. ***************
  4993. *** 28,34 ****
  4994.   ##
  4995.   ## SEE ALSO: gray2ind, rgb2ntsc, image, colormap
  4996.   
  4997. ! ## Author: Tony Richardson <arichard@stark.cc.oh.us>
  4998.   ## Created: July 1994
  4999.   ## Adapted-By: jwe
  5000.   
  5001. --- 28,34 ----
  5002.   ##
  5003.   ## SEE ALSO: gray2ind, rgb2ntsc, image, colormap
  5004.   
  5005. ! ## Author: Tony Richardson <amr@mpl.ucsd.edu>
  5006.   ## Created: July 1994
  5007.   ## Adapted-By: jwe
  5008.   
  5009. diff -cwr n:/project/C/octave-2.1.14.orig/scripts/image/ind2rgb.m i:/project/C/octave-2.1.14/scripts/image/ind2rgb.m
  5010. *** n:/project/C/octave-2.1.14.orig/scripts/image/ind2rgb.m    Tue Nov 10 15:11:20 1998
  5011. --- i:/project/C/octave-2.1.14/scripts/image/ind2rgb.m    Thu Oct 10 23:38:00 1996
  5012. ***************
  5013. *** 1,4 ****
  5014. ! ## Copyright (C) 1996, 1997 John W. Eaton
  5015.   ##
  5016.   ## This file is part of Octave.
  5017.   ##
  5018. --- 1,4 ----
  5019. ! ## Copyright (C) 1996 John W. Eaton
  5020.   ##
  5021.   ## This file is part of Octave.
  5022.   ##
  5023. ***************
  5024. *** 25,31 ****
  5025.   ##
  5026.   ## SEE ALSO: rgb2ind, image, imshow, ind2gray, gray2ind.
  5027.   
  5028. ! ## Author: Tony Richardson <arichard@stark.cc.oh.us>
  5029.   ## Created: July 1994
  5030.   ## Adapted-By: jwe
  5031.   
  5032. --- 25,31 ----
  5033.   ##
  5034.   ## SEE ALSO: rgb2ind, image, imshow, ind2gray, gray2ind.
  5035.   
  5036. ! ## Author: Tony Richardson <amr@mpl.ucsd.edu>
  5037.   ## Created: July 1994
  5038.   ## Adapted-By: jwe
  5039.   
  5040. diff -cwr n:/project/C/octave-2.1.14.orig/scripts/image/loadimage.m i:/project/C/octave-2.1.14/scripts/image/loadimage.m
  5041. *** n:/project/C/octave-2.1.14.orig/scripts/image/loadimage.m    Tue Nov 10 15:11:20 1998
  5042. --- i:/project/C/octave-2.1.14/scripts/image/loadimage.m    Wed Feb 11 00:32:52 1998
  5043. ***************
  5044. *** 1,64 ****
  5045. ! ## Copyright (C) 1996, 1997 John W. Eaton
  5046.   ##
  5047. - ## This file is part of Octave.
  5048. - ##
  5049. - ## Octave is free software; you can redistribute it and/or modify it
  5050. - ## under the terms of the GNU General Public License as published by
  5051. - ## the Free Software Foundation; either version 2, or (at your option)
  5052. - ## any later version.
  5053. - ##
  5054. - ## Octave is distributed in the hope that it will be useful, but
  5055. - ## WITHOUT ANY WARRANTY; without even the implied warranty of
  5056. - ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  5057. - ## General Public License for more details.
  5058. - ##
  5059. - ## You should have received a copy of the GNU General Public License
  5060. - ## along with Octave; see the file COPYING.  If not, write to the Free
  5061. - ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA
  5062. - ## 02111-1307, USA.
  5063.   ## Load an image file.
  5064.   ##
  5065. ! ## [img, map] = loadimage (img_file) loads an image and it's associated
  5066. ! ## color map from file img_file.  The image must be in stored in
  5067. ! ## octave's image format.
  5068.   ##
  5069.   ## SEE ALSO: saveimage, load, save
  5070.   
  5071. ! ## Author: Tony Richardson <arichard@stark.cc.oh.us>
  5072. ! ## Created: July 1994
  5073. ! ## Adapted-By: jwe
  5074.   
  5075. ! function [img_retval, map_retval] = loadimage (filename)
  5076.   
  5077. !   if (nargin != 1)
  5078. !     usage ("[img, map] = loadimage (filename)");
  5079.     elseif (! isstr (filename))
  5080.       error ("loadimage: expecting filename as a string");
  5081.     endif
  5082.   
  5083. !   file = file_in_path (IMAGEPATH, filename);
  5084. !   if (isempty (file))
  5085. !     error ("loadimage: unable to find image file");
  5086.     endif
  5087.   
  5088. !   ## The file is assumed to have variables img and map, or X and map.
  5089.   
  5090. !   eval (['load ', file]);
  5091.   
  5092. !   if (exist ("img"))
  5093. !     img_retval = img;
  5094. !   elseif (exist ("X"))
  5095. !     img_retval = X;
  5096. !   else
  5097. !     error ("loadimage: invalid image file found");
  5098.     endif
  5099.   
  5100. !   if (exist ("map"))
  5101. !     map_retval = map;
  5102. !   else
  5103. !     error ("loadimage: invalid image file found");
  5104. !   endif
  5105.   
  5106.   endfunction
  5107. --- 1,37 ----
  5108. ! ## Copyright (C) 1996 Klaus Gebhardt
  5109.   ##
  5110.   ## Load an image file.
  5111.   ##
  5112. ! ## [X, map] = loadimage (img_file, fmt) loads an image and its associated
  5113. ! ## color map from file img_file.
  5114.   ##
  5115.   ## SEE ALSO: saveimage, load, save
  5116.   
  5117. ! ## Author: Klaus Gebhardt <gebhardt@crunch.ikp.physik.th-darmstadt.de>
  5118. ! ## Created: November 1996
  5119.   
  5120. ! function [X, map] = loadimage (filename, fmt)
  5121.   
  5122. !   if (nargin != 1 && nargin != 2)
  5123. !     usage ("loadimage (filename[, fmt])");
  5124.     elseif (! isstr (filename))
  5125.       error ("loadimage: expecting filename as a string");
  5126.     endif
  5127.   
  5128. !   if (nargin == 1)
  5129. !     fmt = "img";
  5130.     endif
  5131.   
  5132. !   if (! isstr (fmt))
  5133. !     error ("loadimage: expecting fmt as a string");
  5134. !   endif
  5135.   
  5136. !   file = file_in_path (IMAGEPATH, filename);
  5137.   
  5138. !   if (isempty (file))
  5139. !     error ("loadimage: unable to find image file");
  5140.     endif
  5141.   
  5142. !   eval (sprintf ("[X, map] = %s_dec (file);", fmt));
  5143.   
  5144.   endfunction
  5145. diff -cwr n:/project/C/octave-2.1.14.orig/scripts/image/ntsc2rgb.m i:/project/C/octave-2.1.14/scripts/image/ntsc2rgb.m
  5146. *** n:/project/C/octave-2.1.14.orig/scripts/image/ntsc2rgb.m    Tue Nov 10 15:11:20 1998
  5147. --- i:/project/C/octave-2.1.14/scripts/image/ntsc2rgb.m    Thu Jul 11 22:25:22 1996
  5148. ***************
  5149. *** 1,4 ****
  5150. ! ## Copyright (C) 1996, 1997 John W. Eaton
  5151.   ##
  5152.   ## This file is part of Octave.
  5153.   ##
  5154. --- 1,4 ----
  5155. ! ## Copyright (C) 1996 John W. Eaton
  5156.   ##
  5157.   ## This file is part of Octave.
  5158.   ##
  5159. ***************
  5160. *** 19,25 ****
  5161.   
  5162.   ## Image format conversion.
  5163.   
  5164. ! ## Author: Tony Richardson <arichard@stark.cc.oh.us>
  5165.   ## Created: July 1994
  5166.   ## Adapted-By: jwe
  5167.   
  5168. --- 19,25 ----
  5169.   
  5170.   ## Image format conversion.
  5171.   
  5172. ! ## Author: Tony Richardson <amr@mpl.ucsd.edu>
  5173.   ## Created: July 1994
  5174.   ## Adapted-By: jwe
  5175.   
  5176. diff -cwr n:/project/C/octave-2.1.14.orig/scripts/image/ocean.m i:/project/C/octave-2.1.14/scripts/image/ocean.m
  5177. *** n:/project/C/octave-2.1.14.orig/scripts/image/ocean.m    Tue Nov 10 15:11:20 1998
  5178. --- i:/project/C/octave-2.1.14/scripts/image/ocean.m    Mon Jul 15 23:20:20 1996
  5179. ***************
  5180. *** 1,4 ****
  5181. ! ## Copyright (C) 1996, 1997 John W. Eaton
  5182.   ##
  5183.   ## This file is part of Octave.
  5184.   ##
  5185. --- 1,4 ----
  5186. ! ## Copyright (C) 1996 John W. Eaton
  5187.   ##
  5188.   ## This file is part of Octave.
  5189.   ##
  5190. ***************
  5191. *** 19,25 ****
  5192.   
  5193.   ## Colormap.
  5194.   
  5195. ! ## Author: Tony Richardson <arichard@stark.cc.oh.us>
  5196.   ## Created: July 1994
  5197.   ## Adapted-By: jwe
  5198.   
  5199. --- 19,25 ----
  5200.   
  5201.   ## Colormap.
  5202.   
  5203. ! ## Author: Tony Richardson <amr@mpl.ucsd.edu>
  5204.   ## Created: July 1994
  5205.   ## Adapted-By: jwe
  5206.   
  5207. diff -cwr n:/project/C/octave-2.1.14.orig/scripts/image/rgb2ind.m i:/project/C/octave-2.1.14/scripts/image/rgb2ind.m
  5208. *** n:/project/C/octave-2.1.14.orig/scripts/image/rgb2ind.m    Tue Nov 10 15:11:20 1998
  5209. --- i:/project/C/octave-2.1.14/scripts/image/rgb2ind.m    Thu Oct 10 23:38:02 1996
  5210. ***************
  5211. *** 1,4 ****
  5212. ! ## Copyright (C) 1996, 1997 John W. Eaton
  5213.   ##
  5214.   ## This file is part of Octave.
  5215.   ##
  5216. --- 1,4 ----
  5217. ! ## Copyright (C) 1996 John W. Eaton
  5218.   ##
  5219.   ## This file is part of Octave.
  5220.   ##
  5221. ***************
  5222. *** 25,31 ****
  5223.   ##
  5224.   ## Bugs: The color map may have duplicate entries.
  5225.   
  5226. ! ## Author: Tony Richardson <arichard@stark.cc.oh.us>
  5227.   ## Created: July 1994
  5228.   ## Adapted-By: jwe
  5229.   
  5230. --- 25,31 ----
  5231.   ##
  5232.   ## Bugs: The color map may have duplicate entries.
  5233.   
  5234. ! ## Author: Tony Richardson <amr@mpl.ucsd.edu>
  5235.   ## Created: July 1994
  5236.   ## Adapted-By: jwe
  5237.   
  5238. diff -cwr n:/project/C/octave-2.1.14.orig/scripts/image/rgb2ntsc.m i:/project/C/octave-2.1.14/scripts/image/rgb2ntsc.m
  5239. *** n:/project/C/octave-2.1.14.orig/scripts/image/rgb2ntsc.m    Tue Nov 10 15:11:20 1998
  5240. --- i:/project/C/octave-2.1.14/scripts/image/rgb2ntsc.m    Thu Jul 11 22:25:22 1996
  5241. ***************
  5242. *** 1,4 ****
  5243. ! ## Copyright (C) 1996, 1997 John W. Eaton
  5244.   ##
  5245.   ## This file is part of Octave.
  5246.   ##
  5247. --- 1,4 ----
  5248. ! ## Copyright (C) 1996 John W. Eaton
  5249.   ##
  5250.   ## This file is part of Octave.
  5251.   ##
  5252. ***************
  5253. *** 19,25 ****
  5254.   
  5255.   ## Image format conversion.
  5256.   
  5257. ! ## Author: Tony Richardson <arichard@stark.cc.oh.us>
  5258.   ## Created: July 1994
  5259.   ## Adapted-By: jwe
  5260.   
  5261. --- 19,25 ----
  5262.   
  5263.   ## Image format conversion.
  5264.   
  5265. ! ## Author: Tony Richardson <amr@mpl.ucsd.edu>
  5266.   ## Created: July 1994
  5267.   ## Adapted-By: jwe
  5268.   
  5269. diff -cwr n:/project/C/octave-2.1.14.orig/scripts/image/saveimage.m i:/project/C/octave-2.1.14/scripts/image/saveimage.m
  5270. *** n:/project/C/octave-2.1.14.orig/scripts/image/saveimage.m    Wed Nov 25 05:01:32 1998
  5271. --- i:/project/C/octave-2.1.14/scripts/image/saveimage.m    Wed Feb 11 00:32:52 1998
  5272. ***************
  5273. *** 1,101 ****
  5274. ! ## Copyright (C) 1996, 1997 John W. Eaton
  5275.   ##
  5276. - ## This file is part of Octave.
  5277. - ##
  5278. - ## Octave is free software; you can redistribute it and/or modify it
  5279. - ## under the terms of the GNU General Public License as published by
  5280. - ## the Free Software Foundation; either version 2, or (at your option)
  5281. - ## any later version.
  5282. - ##
  5283. - ## Octave is distributed in the hope that it will be useful, but
  5284. - ## WITHOUT ANY WARRANTY; without even the implied warranty of
  5285. - ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  5286. - ## General Public License for more details.
  5287. - ##
  5288. - ## You should have received a copy of the GNU General Public License
  5289. - ## along with Octave; see the file COPYING.  If not, write to the Free
  5290. - ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA
  5291. - ## 02111-1307, USA.
  5292.   ## Save a matrix to disk in image format.
  5293.   ##
  5294. ! ## saveimage (filename, x) saves matrix x to file filename in octave's
  5295.   ## image format.  The current colormap is saved in the file also.
  5296.   ##
  5297. - ## saveimage (filename, x, "img") saves the image in the default format
  5298. - ## and is the same as saveimage (filename, x).
  5299. - ##
  5300. - ## saveimage (filename, x, "ppm") saves the image in ppm format instead
  5301. - ## of the default octave image format.
  5302. - ##
  5303. - ## saveimage (filename, x, "ps") saves the image in PostScript format
  5304. - ## instead of the default octave image format. (Note: images saved in
  5305. - ## PostScript format can not be read back into octave with loadimage.)
  5306. - ##
  5307.   ## saveimage (filename, x, format, map) saves the image along with the
  5308.   ## specified colormap in the specified format.
  5309.   ##
  5310. - ## Note: If the colormap contains only two entries and these entries
  5311. - ## are black and white, the bitmap ppm and PostScript formats are used.
  5312. - ## If the image is a gray scale image (the entries within each row of
  5313. - ## the colormap are equal) the gray scale ppm and PostScript image
  5314. - ## formats are used, otherwise the full color formats are used.
  5315. - ##
  5316. - ## The conversion to PostScript is based on pbmtolps.c, which was
  5317. - ## written by
  5318. - ##
  5319. - ##   George Phillips <phillips@cs.ubc.ca>
  5320. - ##   Department of Computer Science
  5321. - ##   University of British Columbia
  5322. - ##
  5323. - ## and is part of the portable bitmap utilities,
  5324. - ##
  5325. - ## SEE ALSO: loadimage, save, load, colormap
  5326. - ## Author: Tony Richardson <arichard@stark.cc.oh.us>
  5327. - ## Created: July 1994
  5328. - ## Adapted-By: jwe
  5329.   
  5330. ! ## Rewritten by jwe to avoid using octoppm and pbm routines so that
  5331. ! ## people who don't have the the pbm stuff installed can still use this
  5332. ! ## function.
  5333. ! ##
  5334. ! ## The conversion to PostScript is based on pnmtops.c, which is part of
  5335. ! ## the portable bitmap utilties and bears this copyright notice:
  5336. ! ##
  5337. ! ## Copyright (C) 1989 by Jef Poskanzer.
  5338. ! ##
  5339. ! ## Permission to use, copy, modify, and distribute this software and its
  5340. ! ## documentation for any purpose and without fee is hereby granted, provided
  5341. ! ## that the above copyright notice appear in all copies and that both that
  5342. ! ## copyright notice and this permission notice appear in supporting
  5343. ! ## documentation.  This software is provided "as is" without express or
  5344. ! ## implied warranty.
  5345.   
  5346. ! function saveimage (filename, img, img_form, map)
  5347.   
  5348. !   if (nargin < 2 || nargin > 4)
  5349. !     usage ("saveimage (filename, matrix, [format, [colormap]])");
  5350.     endif
  5351.   
  5352.     if (nargin < 4)
  5353.       map = colormap ();
  5354.     endif
  5355.   
  5356. -   [map_nr, map_nc] = size (map);
  5357. -   if (map_nc != 3)
  5358. -     error ("colormap should be an N x 3 matrix");
  5359. -   endif
  5360.     if (nargin < 3)
  5361.       img_form = "img";
  5362.     elseif (! isstr (img_form))
  5363.       error ("image format specification must be a string");
  5364. -   elseif (! (strcmp (img_form, "img")
  5365. -              || strcmp (img_form, "ppm")
  5366. -          || strcmp (img_form, "ps")))
  5367. -     error ("unsupported image format specification");
  5368.     endif
  5369.   
  5370.     if (! is_matrix (img))
  5371. --- 1,31 ----
  5372. ! ## Copyright (C) 1996 Klaus Gebhardt
  5373.   ##
  5374.   ## Save a matrix to disk in image format.
  5375.   ##
  5376. ! ## saveimage (filename, x) saves matrix x to file filename in octaves
  5377.   ## image format.  The current colormap is saved in the file also.
  5378.   ##
  5379.   ## saveimage (filename, x, format, map) saves the image along with the
  5380.   ## specified colormap in the specified format.
  5381.   ##
  5382.   
  5383. ! ## Author: Klaus Gebhardt <gebhardt@crunch.ikp.physik.th-darmstadt.de>
  5384. ! ## Created: November 1996
  5385.   
  5386. ! function saveimage (filename, img, img_form, map, opt)
  5387.   
  5388. !   if (nargin < 2 || nargin > 5)
  5389. !     usage ("saveimage (filename, matrix, [format, [colormap, [opt]]])");
  5390.     endif
  5391.   
  5392.     if (nargin < 4)
  5393.       map = colormap ();
  5394.     endif
  5395.   
  5396.     if (nargin < 3)
  5397.       img_form = "img";
  5398.     elseif (! isstr (img_form))
  5399.       error ("image format specification must be a string");
  5400.     endif
  5401.   
  5402.     if (! is_matrix (img))
  5403. ***************
  5404. *** 106,303 ****
  5405.       error ("file name must be a string");
  5406.     endif
  5407.   
  5408. !   ## If we just want Octave image format, save and return.
  5409. !   if (strcmp (img_form, "img"))
  5410. !     eval (strcat ("save -ascii ", filename, " map img"));
  5411. !     return;
  5412. !   endif
  5413. !   ## Convert to another format if requested.
  5414. !   grey = all (map(:,1) == map(:,2) && map(:,1) == map (:,3));
  5415. !   pbm = pgm = ppm = 0;
  5416. !   map_sz = map_nr * map_nc;
  5417. !   map = reshape (map, map_sz, 1);
  5418. !   idx = find (map > 1);
  5419. !   map (idx) = ones (size (idx));
  5420. !   idx = find (map < 0);
  5421. !   map (idx) = zeros (size (idx));
  5422. !   map = round (255 * map);
  5423. !   bw = (map_nr == 2
  5424. !         && ((map(1,1) == 0 && map(2,1) == 255)
  5425. !             || (map(1,1) == 255 && map(2,1) == 0)));
  5426. !   img = round (img');
  5427. !   [img_nr, img_nc] = size (img);
  5428. !   img_sz = img_nr * img_nc;
  5429. !   img = reshape (img, img_sz, 1);
  5430. !   idx = find (img > map_nr);
  5431. !   img (idx) = ones (size (idx)) * map_nr;
  5432. !   idx = find (img <= 0);
  5433. !   img (idx) = ones (size (idx));
  5434. !   if (strcmp (img_form, "ppm"))
  5435. !     if (grey && map_nr == 2 && bw)
  5436. !       if (map(1) != 0)
  5437. !           map = [1; 0];
  5438. !       else
  5439. !           map = [0; 1];
  5440. !       endif
  5441. !       n_long = rem (img_nc, 8);
  5442. !       tmp = zeros (ceil (img_nc/8), img_nr);
  5443. !       for i = 1:img_nr
  5444. !     idx = (i-1)*img_nc+1:i*img_nc;
  5445. !           if (n_long > 0)
  5446. !       img_row = [map(img(idx)); zeros (8-n_long, 1)];
  5447. !     else
  5448. !             img_row = map(img(idx));
  5449. !     endif
  5450. !     img_row
  5451. !     tmp
  5452. !     if (img_nc < 8)
  5453. !       for j = 1:8
  5454. !         tmp(:,i) = tmp(:,i) + img_row (j) * 2^(8-j);
  5455. !       endfor
  5456. !     else
  5457. !       for j = 1:8
  5458. !         tmp(:,i) = tmp(:,i) + img_row (j:8:img_nc) * 2^(8-j);
  5459. !       endfor
  5460. !     endif
  5461. !       endfor
  5462. !       fid = fopen (filename, "w");
  5463. !       fprintf (fid, "P4\n%d %d\n", img_nr, img_nc);
  5464. !       fwrite (fid, tmp, "char");
  5465. !       fprintf (fid, "\n");
  5466. !       fclose (fid);
  5467. !     elseif (grey)
  5468. !       fid = fopen (filename, "w");
  5469. !       fprintf (fid, "P5\n%d %d\n255\n", img_nr, img_nc);
  5470. !       fwrite (fid, map(img), "uchar");
  5471. !       fprintf (fid, "\n");
  5472. !       fclose (fid);
  5473. !     else
  5474. !       img_idx = ((1:3:3*img_sz)+2)';
  5475. !       map_idx = ((2*map_nr+1):map_sz)';
  5476. !       tmap = map(map_idx);
  5477. !       tmp(img_idx--) = tmap(img);
  5478. !       map_idx = map_idx - map_nr;
  5479. !       tmap = map(map_idx);
  5480. !       tmp(img_idx--) = tmap(img);
  5481. !       map_idx = map_idx - map_nr;
  5482. !       tmap = map(map_idx);
  5483. !       tmp(img_idx--) = tmap(img);
  5484. !       fid = fopen (filename, "w");
  5485. !       fprintf (fid, "P6\n%d %d\n255\n", img_nr, img_nc);
  5486. !       fwrite (fid, tmp, "uchar");
  5487. !       fprintf (fid, "\n");
  5488. !       fclose (fid);
  5489. !     endif
  5490. !   elseif (strcmp (img_form, "ps") == 1)
  5491. !     if (! grey)
  5492. !       error ("must have a greyscale color map for conversion to PostScript");
  5493. !     endif
  5494. !     bps = 8;
  5495. !     dpi = 300;
  5496. !     pagewid = 612;
  5497. !     pagehgt = 762;
  5498. !     MARGIN = 0.95;
  5499. !     devpix = dpi / 72.0 + 0.5;
  5500. !     pixfac = 72.0 / dpi * devpix;
  5501. !     ## Compute padding to round cols * bps up to the nearest multiple of 8
  5502. !     ## (nr and nc are switched because we transposed the image above).
  5503. !     padright = (((img_nr * bps + 7) / 8) * 8 - img_nr * bps) / bps;
  5504. !     scols = img_nr * pixfac;
  5505. !     srows = img_nc * pixfac;
  5506. !     if (scols > pagewid * MARGIN || srows > pagehgt * MARGIN)
  5507. !       if (scols > pagewid * MARGIN)
  5508. !     scale = scale * (pagewid / scols * MARGIN);
  5509. !     scols = scale * img_nr * pixfac;
  5510. !     srows = scale * img_nc * pixfac;
  5511. !       endif
  5512. !       if (srows > pagehgt * MARGIN)
  5513. !     scale = scale * (pagehgt / srows * MARGIN);
  5514. !     scols = scale * img_nr * pixfac;
  5515. !     srows = scale * img_nc * pixfac;
  5516. !       endif
  5517. !       warning ("image too large for page, rescaling to %g", scale);
  5518. !     endif
  5519. !     llx = (pagewid - scols) / 2;
  5520. !     lly = (pagehgt - srows) / 2;
  5521. !     urx = llx + fix (scols + 0.5);
  5522. !     ury = lly + fix (srows + 0.5);
  5523. !     fid = fopen (filename, "w");
  5524. !     fprintf (fid, "%%!PS-Adobe-2.0 EPSF-2.0\n");
  5525. !     fprintf (fid, "%%%%Creator: Octave %s (saveimage.m)\n", OCTAVE_VERSION);
  5526. !     fprintf (fid, "%%%%Title: %s\n", filename);
  5527. !     fprintf (fid, "%%%%Pages: 1\n");
  5528. !     fprintf (fid, "%%%%BoundingBox: %d %d %d %d\n",
  5529. !              fix (llx), fix (lly), fix (urx), fix (ury));
  5530. !     fprintf (fid, "%%%%EndComments\n" );
  5531. !     fprintf (fid, "/readstring {\n");
  5532. !     fprintf (fid, "  currentfile exch readhexstring pop\n");
  5533. !     fprintf (fid, "} bind def\n");
  5534. !     fprintf (fid, "/picstr %d string def\n",
  5535. !              fix ((img_nr + padright) * bps / 8));
  5536. !     fprintf (fid, "%%%%EndProlog\n");
  5537. !     fprintf (fid, "%%%%Page: 1 1\n");
  5538. !     fprintf (fid, "gsave\n");
  5539. !     fprintf (fid, "%g %g translate\n", llx, lly);
  5540. !     fprintf (fid, "%g %g scale\n", scols, srows);
  5541. !     fprintf (fid, "%d %d %d\n", img_nr, img_nc, bps);
  5542. !     fprintf (fid, "[ %d 0 0 -%d 0 %d ]\n", img_nr, img_nc, img_nc);
  5543. !     fprintf (fid, "{ picstr readstring }\n" );
  5544. !     fprintf (fid, "image\n" );
  5545. !     img = map(img);
  5546. !     fmt = "%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x\n";
  5547. !     fprintf (fid, fmt, img);
  5548. !     if (rem (img_sz, 30) != 0)
  5549. !       fprintf (fid, "\n" );
  5550. !     endif
  5551. !     fprintf (fid, "grestore\n" );
  5552. !     fprintf (fid, "showpage\n" );
  5553. !     fprintf (fid, "%%%%Trailer\n" );
  5554. !     fclose (fid);
  5555.     else
  5556. !     error ("saveimage: what happened to the image type?");
  5557.     endif
  5558.   
  5559.   endfunction
  5560. --- 36,45 ----
  5561.       error ("file name must be a string");
  5562.     endif
  5563.   
  5564. !   if (nargin < 5)
  5565. !     eval (sprintf ("%s_enc (filename, map, img);", img_form));
  5566.     else
  5567. !     eval (sprintf ("%s_enc (filename, map, img, opt);", img_form));
  5568.     endif
  5569.   
  5570.   endfunction
  5571. diff -cwr n:/project/C/octave-2.1.14.orig/scripts/miscellaneous/bug_report.m i:/project/C/octave-2.1.14/scripts/miscellaneous/bug_report.m
  5572. *** n:/project/C/octave-2.1.14.orig/scripts/miscellaneous/bug_report.m    Tue Nov 10 15:11:22 1998
  5573. --- i:/project/C/octave-2.1.14/scripts/miscellaneous/bug_report.m    Wed Apr 14 20:58:14 1999
  5574. ***************
  5575. *** 24,29 ****
  5576. --- 24,30 ----
  5577.   ## you are finished editing.
  5578.   
  5579.   ## Author: jwe
  5580. + ## Modified by Klaus Gebhardt, 1997
  5581.   
  5582.   function bug_report ()
  5583.   
  5584. ***************
  5585. *** 49,55 ****
  5586.         endif
  5587.       endif
  5588.   
  5589. !     cmd = "octave-bug";
  5590.   
  5591.       if (length (subject) > 0)
  5592.         cmd = sprintf ("%s -s \"%s\"", cmd, subject);
  5593. --- 50,56 ----
  5594.         endif
  5595.       endif
  5596.   
  5597. !     cmd = "/octave-bug";
  5598.   
  5599.       if (length (subject) > 0)
  5600.         cmd = sprintf ("%s -s \"%s\"", cmd, subject);
  5601. diff -cwr n:/project/C/octave-2.1.14.orig/scripts/miscellaneous/popen2.m i:/project/C/octave-2.1.14/scripts/miscellaneous/popen2.m
  5602. *** n:/project/C/octave-2.1.14.orig/scripts/miscellaneous/popen2.m    Tue Nov 10 15:11:24 1998
  5603. --- i:/project/C/octave-2.1.14/scripts/miscellaneous/popen2.m    Wed Apr 14 20:58:14 1999
  5604. ***************
  5605. *** 21,28 ****
  5606.   ##
  5607.   ## Start a subprocess with two-way communication.  COMMAND specifies
  5608.   ## the name of the command to start.  ARGS is an array of strings
  5609. ! ## containing options for COMMAND.  IN and out are the file ids of the
  5610. ! ## input and streams for the subprocess, and PID is the process id of
  5611.   ## the subprocess, or -1 if COMMAND could not be executed.
  5612.   ##
  5613.   ## Example:
  5614. --- 21,28 ----
  5615.   ##
  5616.   ## Start a subprocess with two-way communication.  COMMAND specifies
  5617.   ## the name of the command to start.  ARGS is an array of strings
  5618. ! ## containing options for COMMAND.  IN and OUT are the file ids of the
  5619. ! ## input and output streams for the subprocess, and PID is the process id of
  5620.   ## the subprocess, or -1 if COMMAND could not be executed.
  5621.   ##
  5622.   ## Example:
  5623. ***************
  5624. *** 38,44 ****
  5625.   ##  endwhile
  5626.   ##  fclose (out);
  5627.   
  5628. ! ## Author: jwe
  5629.   
  5630.   function [in, out, pid] = popen2 (command, args)
  5631.   
  5632. --- 38,44 ----
  5633.   ##  endwhile
  5634.   ##  fclose (out);
  5635.   
  5636. ! ## Author: Klaus Gebhardt, 1997
  5637.   
  5638.   function [in, out, pid] = popen2 (command, args)
  5639.   
  5640. ***************
  5641. *** 48,98 ****
  5642.   
  5643.     if (nargin == 1 || nargin == 2)
  5644.   
  5645. -     if (nargin == 1)
  5646. -       args = "";
  5647. -     endif
  5648.       if (isstr (command))
  5649.   
  5650. !       [stdin_pipe, stdin_status] = pipe ();
  5651. !       [stdout_pipe, stdout_status] = pipe ();
  5652.   
  5653. !       if (stdin_status == 0 && stdout_status == 0)
  5654.   
  5655. !     pid = fork ();
  5656.   
  5657. !     if (pid == 0)
  5658.   
  5659. !       fclose (stdin_pipe (2));
  5660. !       fclose (stdout_pipe (1));
  5661.   
  5662. !       dup2 (stdin_pipe (1), stdin);
  5663. !       fclose (stdin_pipe (1));
  5664.   
  5665. !       dup2 (stdout_pipe (2), stdout);
  5666. !       fclose (stdout_pipe (2));
  5667.   
  5668. !       if (exec (command, args) < 0)
  5669. !         error ("popen2: unable to start process `%s'", command);
  5670. !         exit (0);
  5671.         endif
  5672.   
  5673. !     elseif (pid)
  5674.   
  5675. !       fclose (stdin_pipe (1));
  5676. !       fclose (stdout_pipe (2));
  5677.   
  5678. -       if (fcntl (stdout_pipe (1), __F_SETFL__, __O_NONBLOCK__) < 0)
  5679. -         error ("popen2: error setting file mode");
  5680.         else
  5681. !         in = stdin_pipe (2);
  5682. !         out = stdout_pipe (1);
  5683.         endif
  5684.   
  5685. !     elseif (pid < 0)
  5686. !       error ("popen2: fork failed -- unable to create child process");
  5687.       endif
  5688. !       else
  5689.       error ("popen2: pipe creation failed");
  5690.         endif
  5691.       else
  5692. --- 48,114 ----
  5693.   
  5694.     if (nargin == 1 || nargin == 2)
  5695.   
  5696.       if (isstr (command))
  5697.   
  5698. !       [r_pipe,  r_status]  = _pipe ();
  5699. !       [w_pipe,  w_status]  = _pipe ();
  5700.   
  5701. !       if ((r_status != -1) && (w_status != -1))
  5702.   
  5703. !     r_parent_end = r_pipe(1);
  5704. !     r_child_end  = r_pipe(2);
  5705. !     _fcntl (r_parent_end, F_SETFD, 1);
  5706. !     r_org = _dup (1);
  5707.   
  5708. !     w_parent_end = w_pipe(2);
  5709. !     w_child_end  = w_pipe(1);
  5710. !     _fcntl (w_parent_end, F_SETFD, 1);
  5711. !     w_org = _dup (0);
  5712.   
  5713. !     if ((r_org != -1) && (w_org != -1))
  5714.   
  5715. !       _dup2 (r_child_end, 1);  _close (r_child_end);  r_child_end = -1;
  5716. !       _dup2 (w_child_end, 0);  _close (w_child_end);  w_child_end = -1;
  5717.   
  5718. !       if (nargin == 1)
  5719. !         pid = spawn ("nowait", command);
  5720. !       else
  5721. !         pid = spawn ("nowait", command, args);
  5722. !       endif
  5723.   
  5724. !       _dup2 (r_org, 1);  _close (r_org);
  5725. !       _dup2 (w_org, 0);  _close (w_org);
  5726. !     endif
  5727. !     if (r_child_end != -1)
  5728. !       _close (r_child_end);
  5729.         endif
  5730.   
  5731. !     if (w_child_end != -1)
  5732. !       _close (w_child_end);
  5733. !     endif
  5734.   
  5735. !     if (pid < 0)
  5736. !       _close (r_parent_end);
  5737. !       _close (w_parent_end);
  5738. !       error ("popen2: unable to start process `%s'", command);
  5739. !     else
  5740. !       out = _fdopen (r_parent_end, "r");
  5741. !       in  = _fdopen (w_parent_end, "w");
  5742. !     endif
  5743.   
  5744.         else
  5745. !     if (r_status != -1)
  5746. !       _close (r_pipe(1));
  5747. !       _close (r_pipe(2));
  5748.         endif
  5749.   
  5750. !     if (wr_status != -1)
  5751. !       _close (w_pipe(1));
  5752. !       _close (w_pipe(2));
  5753.       endif
  5754.       error ("popen2: pipe creation failed");
  5755.         endif
  5756.       else
  5757. diff -cwr n:/project/C/octave-2.1.14.orig/scripts/startup/octaverc i:/project/C/octave-2.1.14/scripts/startup/octaverc
  5758. *** n:/project/C/octave-2.1.14.orig/scripts/startup/octaverc    Tue Nov 10 15:11:26 1998
  5759. --- i:/project/C/octave-2.1.14/scripts/startup/octaverc    Thu Apr 15 14:39:22 1999
  5760. ***************
  5761. *** 2,4 ****
  5762. --- 2,37 ----
  5763.   ##
  5764.   ## This file should contain any commands that should be executed each
  5765.   ## time Octave starts for every user at this site.
  5766. + ## System-wide startup file
  5767. + ## Octave 2.0.10 for OS/2
  5768. + ## (c) 1996, Klaus Gebhardt
  5769. + PS1 = "octave:\\#>";
  5770. + EDITOR = "e";
  5771. + oct_home = "h:/apps/science/octave";
  5772. + if length(getenv("OCTAVE_HOME"))
  5773. +   oct_home = getenv("OCTAVE_HOME");
  5774. + endif
  5775. + LOADPATH  = sprintf ("%s/scripts//;%s/dlfcn/examples", oct_home, oct_home);
  5776. + INFO_FILE = sprintf ("%s/doc/octave", oct_home);
  5777. + if length(file_in_path(getenv("PATH"),"less.exe"))
  5778. +   PAGER = sprintf("%s -ce",file_in_path(getenv("PATH"),"less.exe"));
  5779. + else
  5780. +   PAGER = "more";
  5781. + endif
  5782. + if length(getenv("GNUPLOT"))
  5783. +   gnuplot_binary = sprintf ("%s/gnuplot.exe", getenv("GNUPLOT"));
  5784. + else
  5785. +   gnuplot_binary = "gnuplot";
  5786. + endif
  5787. + implicit_str_to_num_ok     = 1;
  5788. + ok_to_lose_imaginary_part  = 1;
  5789. + ignore_function_time_stamp = 1;
  5790. + auto_unload_dot_oct_files  = 1;
  5791. diff -cwr n:/project/C/octave-2.1.14.orig/scripts/strings/deblank.m i:/project/C/octave-2.1.14/scripts/strings/deblank.m
  5792. *** n:/project/C/octave-2.1.14.orig/scripts/strings/deblank.m    Thu Nov  5 20:30:44 1998
  5793. --- i:/project/C/octave-2.1.14/scripts/strings/deblank.m    Wed Apr 14 20:58:14 1999
  5794. ***************
  5795. *** 23,28 ****
  5796. --- 23,29 ----
  5797.   
  5798.   ## Author: Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at>
  5799.   ## Adapted-By: jwe
  5800. + ## Modified by Klaus Gebhardt, 1998
  5801.   
  5802.   function t = deblank (s)
  5803.   
  5804. diff -cwr n:/project/C/octave-2.1.14.orig/doc/conf.tex i:/project/C/octave-2.1.14/doc/conf.tex
  5805. *** n:/project/C/octave-2.1.14.orig/doc/conf.tex    Tue Apr 13 13:11:30 1999
  5806. --- i:/project/C/octave-2.1.14/doc/conf.tex    Thu Apr 15 10:42:20 1999
  5807. ***************
  5808. *** 2,7 ****
  5809.   @c This is part of the Octave manual.
  5810.   @c For copying conditions, see the file gpl.tex.
  5811.   
  5812. ! @set VERSION 2.0.5
  5813. ! @set OCTAVEHOME /usr/local
  5814. ! @set TARGETHOSTTYPE i586-pc-linux-gnu
  5815. --- 2,7 ----
  5816.   @c This is part of the Octave manual.
  5817.   @c For copying conditions, see the file gpl.tex.
  5818.   
  5819. ! @set VERSION 2.1.14
  5820. ! @set OCTAVEHOME 
  5821. ! @set TARGETHOSTTYPE i486-pc-os/2
  5822. diff -cwr n:/project/C/octave-2.1.14.orig/doc/faq/oct-faq.tex i:/project/C/octave-2.1.14/doc/faq/oct-faq.tex
  5823. *** n:/project/C/octave-2.1.14.orig/doc/faq/oct-faq.tex    Tue Apr 13 13:11:30 1999
  5824. --- i:/project/C/octave-2.1.14/doc/faq/oct-faq.tex    Wed Apr 14 20:58:14 1999
  5825. ***************
  5826. *** 1,3 ****
  5827. --- 1,4 ----
  5828. + % Modified by Klaus Gebhardt, 1997
  5829.   \input texinfo.tex      @c -*-texinfo-*-
  5830.   
  5831.   @setfilename oct-faq.
  5832. ***************
  5833. *** 19,24 ****
  5834. --- 20,33 ----
  5835.   @top
  5836.   @unnumbered Preface
  5837.   @cindex FAQ for Octave, latest version
  5838. + @macro email{text}
  5839. + (\text\)
  5840. + @end macro
  5841. + @macro url{text}
  5842. + (\text\)
  5843. + @end macro
  5844.   @end ifinfo
  5845.   
  5846.   This is a list of frequently asked questions (FAQ) for Octave users.
  5847. diff -cwr n:/project/C/octave-2.1.14.orig/doc/interpreter/control.tex i:/project/C/octave-2.1.14/doc/interpreter/control.tex
  5848. *** n:/project/C/octave-2.1.14.orig/doc/interpreter/control.tex    Tue Apr 13 13:11:32 1999
  5849. --- i:/project/C/octave-2.1.14/doc/interpreter/control.tex    Thu Apr 15 11:01:56 1999
  5850. ***************
  5851. *** 224,230 ****
  5852.   @strong{Inputs:}
  5853.   @table @var
  5854.   @item num
  5855. !  vector of coefficients @math{[c_0 c_1 ... c_n]}
  5856.   of the SISO FIR transfer function 
  5857.   @ifinfo
  5858.   
  5859. --- 224,230 ----
  5860.   @strong{Inputs:}
  5861.   @table @var
  5862.   @item num
  5863. !  vector of coefficients @code{[c_0 c_1 ... c_n]}
  5864.   of the SISO FIR transfer function 
  5865.   @ifinfo
  5866.   
  5867. ***************
  5868. *** 291,297 ****
  5869.                  default: @var{d} = zero matrix
  5870.   
  5871.   @item   tsam
  5872. !  sampling rate.  Default: @math{tsam = 0} (continuous system)
  5873.   
  5874.   @item  n, nz
  5875.    number of continuous, discrete states in the system
  5876. --- 291,297 ----
  5877.                  default: @var{d} = zero matrix
  5878.   
  5879.   @item   tsam
  5880. !  sampling rate.  Default: @code{tsam = 0} (continuous system)
  5881.   
  5882.   @item  n, nz
  5883.    number of continuous, discrete states in the system
  5884. ***************
  5885. *** 299,308 ****
  5886.           default:
  5887.   @table @var
  5888.   @item tsam = 0
  5889. ! @math{n = @code{rows}(@var{a})}, @math{nz = 0}
  5890.   
  5891.   @item tsam > 0
  5892. ! @math{ n = 0},       @math{nz = @code{rows}(@var{a})}
  5893.   
  5894.           see below for system partitioning
  5895.   
  5896. --- 299,308 ----
  5897.           default:
  5898.   @table @var
  5899.   @item tsam = 0
  5900. ! @code{n = @code{rows}(@var{a})}, @code{nz = 0}
  5901.   
  5902.   @item tsam > 0
  5903. ! @code{ n = 0},       @code{nz = @code{rows}(@var{a})}
  5904.   
  5905.           see below for system partitioning
  5906.   
  5907. ***************
  5908. *** 331,339 ****
  5909.              default: 
  5910.   @table @var
  5911.   @item tsam = 0  
  5912. ! @math{outlist = []}
  5913.   @item tsam > 0  
  5914. ! @math{outlist = 1:@code{rows}(@var{c})}
  5915.   @end table
  5916.   
  5917.   Unlike states, discrete/continous outputs may appear in any order.
  5918. --- 331,339 ----
  5919.              default: 
  5920.   @table @var
  5921.   @item tsam = 0  
  5922. ! @code{outlist = []}
  5923.   @item tsam > 0  
  5924. ! @code{outlist = 1:@code{rows}(@var{c})}
  5925.   @end table
  5926.   
  5927.   Unlike states, discrete/continous outputs may appear in any order.
  5928. ***************
  5929. *** 365,377 ****
  5930.   @end example
  5931.   with dynamic equations:
  5932.   @ifinfo
  5933. ! @math{  d/dt xc(t)     = acc*xc(t)      + acd*xd(k*tsam) + bc*u(t)}
  5934.   
  5935. ! @math{  xd((k+1)*tsam) = adc*xc(k*tsam) + add*xd(k*tsam) + bd*u(k*tsam)}
  5936.   
  5937. ! @math{  yc(t)      = ccc*xc(t)      + ccd*xd(k*tsam) + dc*u(t)}
  5938.   
  5939. ! @math{  yd(k*tsam) = cdc*xc(k*tsam) + cdd*xd(k*tsam) + dd*u(k*tsam)}
  5940.   @end ifinfo
  5941.   @iftex
  5942.   @tex
  5943. --- 365,377 ----
  5944.   @end example
  5945.   with dynamic equations:
  5946.   @ifinfo
  5947. ! @code{  d/dt xc(t)     = acc*xc(t)      + acd*xd(k*tsam) + bc*u(t)}
  5948.   
  5949. ! @code{  xd((k+1)*tsam) = adc*xc(k*tsam) + add*xd(k*tsam) + bd*u(k*tsam)}
  5950.   
  5951. ! @code{  yc(t)      = ccc*xc(t)      + ccd*xd(k*tsam) + dc*u(t)}
  5952.   
  5953. ! @code{  yd(k*tsam) = cdc*xc(k*tsam) + cdd*xd(k*tsam) + dd*u(k*tsam)}
  5954.   @end ifinfo
  5955.   @iftex
  5956.   @tex
  5957. ***************
  5958. *** 399,405 ****
  5959.   ----------------------------------------------------
  5960.   @end group
  5961.   @end example
  5962. ! where @math{cout} is the list of in 1:@code{rows}(@var{p}) 
  5963.   that are not contained in outlist. (Discrete/continuous outputs
  5964.   may be entered in any order desired by the user.)
  5965.   
  5966. --- 399,405 ----
  5967.   ----------------------------------------------------
  5968.   @end group
  5969.   @end example
  5970. ! where @code{cout} is the list of in 1:@code{rows}(@var{p}) 
  5971.   that are not contained in outlist. (Discrete/continuous outputs
  5972.   may be entered in any order desired by the user.)
  5973.   
  5974. ***************
  5975. *** 669,675 ****
  5976.   @item  yd
  5977.    binary vector; @var{yd}(@var{ii}) is nonzero if output @var{ii} is
  5978.   discrete.
  5979. ! @math{yd(ii) = 0} if output @var{ii} is continous
  5980.   @end table
  5981.   
  5982.   @end deftypefn
  5983. --- 669,675 ----
  5984.   @item  yd
  5985.    binary vector; @var{yd}(@var{ii}) is nonzero if output @var{ii} is
  5986.   discrete.
  5987. ! @code{yd(ii) = 0} if output @var{ii} is continous
  5988.   @end table
  5989.   
  5990.   @end deftypefn
  5991. ***************
  5992. *** 986,992 ****
  5993.   @end deftypefn
  5994.   
  5995.   @deftypefn {Function File } { } tfout (@var{num}, @var{denom}@{, @var{x}@})
  5996. !  print formatted transfer function @math{n(s)/d(s) } to the screen
  5997.    @var{x} defaults to the string @code{"s"}
  5998.   @end deftypefn
  5999.   
  6000. --- 986,992 ----
  6001.   @end deftypefn
  6002.   
  6003.   @deftypefn {Function File } { } tfout (@var{num}, @var{denom}@{, @var{x}@})
  6004. !  print formatted transfer function @code{n(s)/d(s) } to the screen
  6005.    @var{x} defaults to the string @code{"s"}
  6006.   @end deftypefn
  6007.   
  6008. ***************
  6009. *** 1008,1014 ****
  6010.   @item   yd
  6011.    indices of strings to append with the string "(discrete)"
  6012.              (used by @var{sysout}; minimal checking of this argument)
  6013. !        @math{yd = [] } indicates all outputs are continuous
  6014.   @item ilist
  6015.   index numbers to print with names.  
  6016.   
  6017. --- 1008,1014 ----
  6018.   @item   yd
  6019.    indices of strings to append with the string "(discrete)"
  6020.              (used by @var{sysout}; minimal checking of this argument)
  6021. !            @code{yd = [] } indicates all outputs are continuous
  6022.   @item ilist
  6023.   index numbers to print with names.  
  6024.   
  6025. ***************
  6026. *** 1188,1194 ****
  6027.   @end table
  6028.   @strong{Outputs}
  6029.   @var{outsys}
  6030. !       system data structure has representation with @math{w = 2 * pi * nfreq}:
  6031.   @example
  6032.       /                                        \
  6033.       | / -2w*damp -w \  / w \                 |
  6034. --- 1188,1194 ----
  6035.   @end table
  6036.   @strong{Outputs}
  6037.   @var{outsys}
  6038. !       system data structure has representation with @code{w = 2 * pi * nfreq}:
  6039.   @example
  6040.       /                                        \
  6041.       | / -2w*damp -w \  / w \                 |
  6042. ***************
  6043. *** 1263,1270 ****
  6044.   list of names for new inputs
  6045.   
  6046.   @item yd
  6047. ! binary vector; @math{yd(ii)=0} indicates a continuous output;
  6048. ! @math{yd(ii)=1} indicates a discrete output.
  6049.   @end table
  6050.   
  6051.   @strong{Outputs} @var{sys}
  6052. --- 1263,1270 ----
  6053.   list of names for new inputs
  6054.   
  6055.   @item yd
  6056. ! binary vector; @code{yd(ii)=0} indicates a continuous output;
  6057. ! @code{yd(ii)=1} indicates a discrete output.
  6058.   @end table
  6059.   
  6060.   @strong{Outputs} @var{sys}
  6061. ***************
  6062. *** 1305,1312 ****
  6063.   @item   sys
  6064.   system data structure
  6065.   @item   out_idx, in_idx
  6066. ! list of connections indices; @math{y(out_idx(ii))}
  6067. ! is connected to @math{u(in_idx(ii))}.
  6068.   @item   order
  6069.   logical flag (default = 0)
  6070.   @table @code
  6071. --- 1305,1312 ----
  6072.   @item   sys
  6073.   system data structure
  6074.   @item   out_idx, in_idx
  6075. ! list of connections indices; @code{y(out_idx(ii))}
  6076. ! is connected to @code{u(in_idx(ii))}.
  6077.   @item   order
  6078.   logical flag (default = 0)
  6079.   @table @code
  6080. ***************
  6081. *** 1448,1454 ****
  6082.   @var{Asys}, @var{Bsys}: system data structures
  6083.   
  6084.   @strong{Outputs}
  6085. !  @math{sys = @r{block diag}(Asys,Bsys)}
  6086.   @example
  6087.   @group
  6088.            __________________
  6089. --- 1448,1454 ----
  6090.   @var{Asys}, @var{Bsys}: system data structures
  6091.   
  6092.   @strong{Outputs}
  6093. !  @code{sys = @r{block diag}(Asys,Bsys)}
  6094.   @example
  6095.   @group
  6096.            __________________
  6097. ***************
  6098. *** 1477,1483 ****
  6099.   
  6100.   @node sysmult, sysprune,  sysgroupn, blockdiag
  6101.   @deftypefn {Function File } { @var{sys} =} sysmult( @var{Asys}, @var{Bsys})
  6102. ! Compute @math{sys = Asys*Bsys} (series connection):
  6103.   @example
  6104.   @group
  6105.   u   ----------     ----------
  6106. --- 1477,1483 ----
  6107.   
  6108.   @node sysmult, sysprune,  sysgroupn, blockdiag
  6109.   @deftypefn {Function File } { @var{sys} =} sysmult( @var{Asys}, @var{Bsys})
  6110. ! Compute @code{sys = Asys*Bsys} (series connection):
  6111.   @example
  6112.   @group
  6113.   u   ----------     ----------
  6114. ***************
  6115. *** 1560,1566 ****
  6116.   
  6117.   @node syssub, ,  sysscale, blockdiag
  6118.   @deftypefn {Function File } { @var{sys} =} syssub (@var{Gsys}, @var{Hsys})
  6119. !  returns @math{sys = Gsys - Hsys}
  6120.   
  6121.    Method: @var{Gsys} and @var{Hsys} are connected in parallel
  6122.    The input vector is connected to both systems; the outputs are
  6123. --- 1560,1566 ----
  6124.   
  6125.   @node syssub, ,  sysscale, blockdiag
  6126.   @deftypefn {Function File } { @var{sys} =} syssub (@var{Gsys}, @var{Hsys})
  6127. !  returns @code{sys = Gsys - Hsys}
  6128.   
  6129.    Method: @var{Gsys} and @var{Hsys} are connected in parallel
  6130.    The input vector is connected to both systems; the outputs are
  6131. ***************
  6132. *** 1628,1637 ****
  6133.   @var{n}x@var{n} matrix.
  6134.   @item b
  6135.     @var{n}x@var{n} matrix or @var{n}x@var{m} matrix; in the latter case
  6136. !   @var{b} is replaced by @math{b:=b*b'}.
  6137.   @item c
  6138.     @var{n}x@var{n} matrix or @var{p}x@var{m} matrix; in the latter case
  6139. !   @var{c} is replaced by @math{c:=c'*c}.
  6140.   @item opt
  6141.   (optional argument; default = @code{"B"}):
  6142.   String option passed to @code{balance} prior to ordered Schur decomposition.
  6143. --- 1628,1637 ----
  6144.   @var{n}x@var{n} matrix.
  6145.   @item b
  6146.     @var{n}x@var{n} matrix or @var{n}x@var{m} matrix; in the latter case
  6147. !   @var{b} is replaced by @code{b:=b*b'}.
  6148.   @item c
  6149.     @var{n}x@var{n} matrix or @var{p}x@var{m} matrix; in the latter case
  6150. !   @var{c} is replaced by @code{c:=c'*c}.
  6151.   @item opt
  6152.   (optional argument; default = @code{"B"}):
  6153.   String option passed to @code{balance} prior to ordered Schur decomposition.
  6154. ***************
  6155. *** 1675,1681 ****
  6156.   
  6157.   @item c
  6158.   @var{n} by @var{n}, symmetric positive semidefinite, or @var{p} by @var{n}.
  6159. ! In the latter case @math{c:=c'*c} is used.
  6160.   
  6161.   @item r
  6162.   @var{m} by @var{m}, symmetric positive definite (invertible).
  6163. --- 1675,1681 ----
  6164.   
  6165.   @item c
  6166.   @var{n} by @var{n}, symmetric positive semidefinite, or @var{p} by @var{n}.
  6167. ! In the latter case @code{c:=c'*c} is used.
  6168.   
  6169.   @item r
  6170.   @var{m} by @var{m}, symmetric positive definite (invertible).
  6171. ***************
  6172. *** 1765,1773 ****
  6173.   
  6174.   @deftypefn {Function File } { @var{m} =} gram (@var{a}, @var{b})
  6175.    Return controllability grammian @var{m} of the continuous time system
  6176. ! @math{ dx/dt = a x + b u}.  
  6177.   
  6178. ! @var{m} satisfies @math{ a m + m a' + b b' = 0 }.
  6179.   @end deftypefn
  6180.   
  6181.   
  6182. --- 1765,1773 ----
  6183.   
  6184.   @deftypefn {Function File } { @var{m} =} gram (@var{a}, @var{b})
  6185.    Return controllability grammian @var{m} of the continuous time system
  6186. ! @code{ dx/dt = a x + b u}.  
  6187.   
  6188. ! @var{m} satisfies @code{ a m + m a' + b b' = 0 }.
  6189.   @end deftypefn
  6190.   
  6191.   
  6192. ***************
  6193. *** 1885,1891 ****
  6194.   @item zgscal
  6195.   Generalized conjugate gradient iteration to 
  6196.    solve zero-computation generalized eigenvalue problem balancing equation 
  6197. !  @math{fx=z};
  6198.    called by @code{zgepbal}
  6199.   
  6200.   @item zgsgiv
  6201. --- 1885,1891 ----
  6202.   @item zgscal
  6203.   Generalized conjugate gradient iteration to 
  6204.    solve zero-computation generalized eigenvalue problem balancing equation 
  6205. !  @code{fx=z};
  6206.    called by @code{zgepbal}
  6207.   
  6208.   @item zgsgiv
  6209. ***************
  6210. *** 2166,2178 ****
  6211.   @item      Bu
  6212.    (@var{n} x @var{nu}) @var{Ru}-transformed controlled input matrix;
  6213.   
  6214. !           @strong{Note} @math{B = [Bw Bu] }
  6215.   @item      Cz
  6216.    (@var{nz} x @var{n}) Qz-transformed error output matrix
  6217.   @item      Cy
  6218.    (@var{ny} x @var{n}) @var{Ry}-transformed measured output matrix 
  6219.   
  6220. !           @strong{Note} @math{C = [Cz; Cy] }
  6221.   @item      Dzu, Dyw
  6222.    off-diagonal blocks of transformed @var{D} matrix that enter 
  6223.   @var{z}, @var{y} from @var{u}, @var{w} respectively
  6224. --- 2166,2178 ----
  6225.   @item      Bu
  6226.    (@var{n} x @var{nu}) @var{Ru}-transformed controlled input matrix;
  6227.   
  6228. !           @strong{Note} @code{B = [Bw Bu] }
  6229.   @item      Cz
  6230.    (@var{nz} x @var{n}) Qz-transformed error output matrix
  6231.   @item      Cy
  6232.    (@var{ny} x @var{n}) @var{Ry}-transformed measured output matrix 
  6233.   
  6234. !           @strong{Note} @code{C = [Cz; Cy] }
  6235.   @item      Dzu, Dyw
  6236.    off-diagonal blocks of transformed @var{D} matrix that enter 
  6237.   @var{z}, @var{y} from @var{u}, @var{w} respectively
  6238. ***************
  6239. *** 2340,2346 ****
  6240.       @code{1e-8}.
  6241.   @item        "bi"
  6242.    Conversion is performed via bilinear transform 
  6243. ! @math{z = (1 + s T / 2)/(1 - s T / 2)} where @var{T} is the 
  6244.   system sampling time (see @code{sysgettsam}).
  6245.   
  6246.   FIXME: bilinear option exits with an error if @var{sys} is not purely discrete
  6247. --- 2340,2346 ----
  6248.           @code{1e-8}.
  6249.   @item        "bi"
  6250.    Conversion is performed via bilinear transform 
  6251. ! @code{z = (1 + s T / 2)/(1 - s T / 2)} where @var{T} is the 
  6252.   system sampling time (see @code{sysgettsam}).
  6253.   
  6254.   FIXME: bilinear option exits with an error if @var{sys} is not purely discrete
  6255. ***************
  6256. *** 2373,2379 ****
  6257.   "constant u flag" if @var{cuflg} is nonzero then the system inputs are 
  6258.           assumed to be constant over the revised sampling interval @var{Ts2}.
  6259.           Otherwise, since the inputs can change during the interval
  6260. !         @var{t} in @math{[k Ts2, (k+1) Ts2]}, an additional set of inputs is
  6261.           included in the revised B matrix so that these intersample inputs
  6262.           may be included in the single-rate system.
  6263.           default
  6264. --- 2373,2379 ----
  6265.   "constant u flag" if @var{cuflg} is nonzero then the system inputs are 
  6266.           assumed to be constant over the revised sampling interval @var{Ts2}.
  6267.           Otherwise, since the inputs can change during the interval
  6268. !         @var{t} in @code{[k Ts2, (k+1) Ts2]}, an additional set of inputs is
  6269.           included in the revised B matrix so that these intersample inputs
  6270.           may be included in the single-rate system.
  6271.           default
  6272. ***************
  6273. *** 2476,2498 ****
  6274.   @item   w
  6275.    frequency values for evaluation.
  6276.   
  6277. ! if @var{sys} is continuous, then bode evaluates @math{G(jw)} where
  6278. ! @math{G(s)} is the system transfer function.
  6279.   
  6280.   if @var{sys} is discrete, then bode evaluates G(@code{exp}(jwT)), where 
  6281.   @itemize @bullet
  6282.   @item @var{T}=@code{sysgettsam(@var{sys})} (the system sampling time) and
  6283. ! @item @math{G(z)} is the system transfer function.
  6284.   @end itemize
  6285.   
  6286.   @strong{ Default} the default frequency range is selected as follows: (These
  6287.           steps are NOT performed if @var{w} is specified)
  6288.   @enumerate
  6289.   @item via routine bodquist, isolate all poles and zeros away from
  6290. ! @var{w}=0 (@var{jw}=0 or @math{@code{exp}(jwT)}=1) and select the frequency
  6291.   range based on the breakpoint locations of the frequencies.
  6292.   @item if @var{sys} is discrete time, the frequency range is limited
  6293. !               to @math{jwT} in 
  6294.   @ifinfo
  6295.   [0,2 pi /T]
  6296.   @end ifinfo
  6297. --- 2476,2498 ----
  6298.   @item   w
  6299.    frequency values for evaluation.
  6300.   
  6301. ! if @var{sys} is continuous, then bode evaluates @code{G(jw)} where
  6302. ! @code{G(s)} is the system transfer function.
  6303.   
  6304.   if @var{sys} is discrete, then bode evaluates G(@code{exp}(jwT)), where 
  6305.   @itemize @bullet
  6306.   @item @var{T}=@code{sysgettsam(@var{sys})} (the system sampling time) and
  6307. ! @item @code{G(z)} is the system transfer function.
  6308.   @end itemize
  6309.   
  6310.   @strong{ Default} the default frequency range is selected as follows: (These
  6311.           steps are NOT performed if @var{w} is specified)
  6312.   @enumerate
  6313.   @item via routine bodquist, isolate all poles and zeros away from
  6314. ! @var{w}=0 (@var{jw}=0 or @code{@code{exp}(jwT)}=1) and select the frequency
  6315.   range based on the breakpoint locations of the frequencies.
  6316.   @item if @var{sys} is discrete time, the frequency range is limited
  6317. !               to @code{jwT} in 
  6318.   @ifinfo
  6319.   [0,2 pi /T]
  6320.   @end ifinfo
  6321. ***************
  6322. *** 2514,2520 ****
  6323.   @table @var
  6324.   @item  mag, phase
  6325.    the magnitude and phase of the frequency response
  6326. !        @math{G(jw)} or @math{G(@code{exp}(jwT))} at the selected frequency values.
  6327.   @item w
  6328.   the vector of frequency values used
  6329.   @end table
  6330. --- 2514,2520 ----
  6331.   @table @var
  6332.   @item  mag, phase
  6333.    the magnitude and phase of the frequency response
  6334. !        @code{G(jw)} or @code{G(@code{exp}(jwT))} at the selected frequency values.
  6335.   @item w
  6336.   the vector of frequency values used
  6337.   @end table
  6338. ***************
  6339. *** 2532,2538 ****
  6340.   being printed to the screen (@code{ans = []}).
  6341.   
  6342.   @item If the requested plot is for an MIMO system, mag is set to
  6343. !  @math{||G(jw)||} or @math{||G(@code{exp}(jwT))||}
  6344.   and phase information is not computed.
  6345.   @end enumerate
  6346.   @end deftypefn
  6347. --- 2532,2538 ----
  6348.   being printed to the screen (@code{ans = []}).
  6349.   
  6350.   @item If the requested plot is for an MIMO system, mag is set to
  6351. !  @code{||G(jw)||} or @code{||G(@code{exp}(jwT))||}
  6352.   and phase information is not computed.
  6353.   @end enumerate
  6354.   @end deftypefn
  6355. ***************
  6356. *** 2566,2572 ****
  6357.   @item w
  6358.    list of frequencies 
  6359.   @item f
  6360. !  frequency response of sys; @math{f(ii) = f(omega(ii))}
  6361.   @end table
  6362.   @strong{Note} bodquist could easily be incorporated into a Nichols
  6363.   plot function; this is in a "to do" list.
  6364. --- 2566,2572 ----
  6365.   @item w
  6366.    list of frequencies 
  6367.   @item f
  6368. !  frequency response of sys; @code{f(ii) = f(omega(ii))}
  6369.   @end table
  6370.   @strong{Note} bodquist could easily be incorporated into a Nichols
  6371.   plot function; this is in a "to do" list.
  6372. ***************
  6373. *** 2593,2599 ****
  6374.   @strong{Outputs}
  6375.   @table @var
  6376.   @item @var{out} 
  6377. ! vector of finite @math{G(j*w)} entries (or @math{||G(j*w)||} for MIMO)
  6378.   @item w 
  6379.   vector of corresponding frequencies 
  6380.   @end table
  6381. --- 2593,2599 ----
  6382.   @strong{Outputs}
  6383.   @table @var
  6384.   @item @var{out} 
  6385. ! vector of finite @code{G(j*w)} entries (or @code{||G(j*w)||} for MIMO)
  6386.   @item w 
  6387.   vector of corresponding frequencies 
  6388.   @end table
  6389. ***************
  6390. *** 2605,2611 ****
  6391.   @strong{Inputs}
  6392.   @table @var
  6393.   @item A, B
  6394. ! coefficient matrices of @math{dx/dt = A x + B u}
  6395.   @item sys
  6396.    system data structure
  6397.   @item w
  6398. --- 2605,2611 ----
  6399.   @strong{Inputs}
  6400.   @table @var
  6401.   @item A, B
  6402. ! coefficient matrices of @code{dx/dt = A x + B u}
  6403.   @item sys
  6404.    system data structure
  6405.   @item w
  6406. ***************
  6407. *** 2617,2623 ****
  6408.                              -1
  6409.               G(s) = (jw I-A) B
  6410.   @end example
  6411. ! for complex frequencies @math{s = jw}.
  6412.   @end deftypefn
  6413.   
  6414.   @deftypefn {Function File } {[@var{realp}, @var{imagp}, @var{w}] =} nyquist (@var{sys}@{, @var{w}, @var{out_idx}, @var{in_idx}, @var{atol}@})
  6415. --- 2617,2623 ----
  6416.                              -1
  6417.               G(s) = (jw I-A) B
  6418.   @end example
  6419. ! for complex frequencies @code{s = jw}.
  6420.   @end deftypefn
  6421.   
  6422.   @deftypefn {Function File } {[@var{realp}, @var{imagp}, @var{w}] =} nyquist (@var{sys}@{, @var{w}, @var{out_idx}, @var{in_idx}, @var{atol}@})
  6423. ***************
  6424. *** 2639,2645 ****
  6425.   @table @var
  6426.   @item    realp, imagp
  6427.   the real and imaginary parts of the frequency response
  6428. !        @math{G(jw)} or @math{G(exp(jwT))} at the selected frequency values.
  6429.   @item    w
  6430.    the vector of frequency values used
  6431.   @end table
  6432. --- 2639,2645 ----
  6433.   @table @var
  6434.   @item    realp, imagp
  6435.   the real and imaginary parts of the frequency response
  6436. !        @code{G(jw)} or @code{G(exp(jwT))} at the selected frequency values.
  6437.   @item    w
  6438.    the vector of frequency values used
  6439.   @end table
  6440. diff -cwr n:/project/C/octave-2.1.14.orig/doc/interpreter/install.tex i:/project/C/octave-2.1.14/doc/interpreter/install.tex
  6441. *** n:/project/C/octave-2.1.14.orig/doc/interpreter/install.tex    Tue Apr 13 13:11:34 1999
  6442. --- i:/project/C/octave-2.1.14/doc/interpreter/install.tex    Wed Apr 14 20:58:22 1999
  6443. ***************
  6444. *** 442,447 ****
  6445. --- 442,455 ----
  6446.   @email{bug-octave@@bevo.che.wisc.edu} if you are interested in helping
  6447.   make a binary distribution available for your system.)
  6448.   
  6449. + Also, binary distributions are limited to static binaries that do not
  6450. + support dynamic linking.  For earlier versions of Octave, I tried
  6451. + distributing dynamically linked binaries but that proved to be too much
  6452. + trouble to support.  If you want to have a copy of Octave that includes
  6453. + all the features described in this manual, you will have to build it
  6454. + from the sources yourself, or find someone else who is willing to do it
  6455. + for you.
  6456.   @menu
  6457.   * Installing Octave from a Binary Distribution::  
  6458.   * Creating a Binary Distribution::  
  6459. ***************
  6460. *** 561,566 ****
  6461.   @end example
  6462.   
  6463.   This will create a compressed tar file ready for distribution.
  6464. ! It will have a name like
  6465.   @file{octave-@value{VERSION}-@value{TARGETHOSTTYPE}.tar.gz}
  6466.   @end itemize
  6467. --- 569,574 ----
  6468.   @end example
  6469.   
  6470.   This will create a compressed tar file ready for distribution.
  6471. ! It will contain statically linked binaries and have a name like
  6472.   @file{octave-@value{VERSION}-@value{TARGETHOSTTYPE}.tar.gz}
  6473.   @end itemize
  6474. diff -cwr n:/project/C/octave-2.1.14.orig/doc/interpreter/linalg.tex i:/project/C/octave-2.1.14/doc/interpreter/linalg.tex
  6475. *** n:/project/C/octave-2.1.14.orig/doc/interpreter/linalg.tex    Tue Apr 13 13:11:34 1999
  6476. --- i:/project/C/octave-2.1.14/doc/interpreter/linalg.tex    Thu Apr 15 11:02:12 1999
  6477. ***************
  6478. *** 382,398 ****
  6479.   
  6480.   
  6481.   @deftypefn {Function File} {@var{lambda} =} qz (@var{a}, @var{b})
  6482. ! Generalized eigenvalue problem @math{A x = s B x},
  6483.   @var{QZ} decomposition.  Three ways to call:
  6484.   @enumerate
  6485.   @item @code{lambda = qz(A,B)}
  6486.   
  6487. ! Computes the generalized eigenvalues @var{lambda} of @math{(A - sB)}.
  6488.   
  6489.   @item @code{[AA, BB, Q, Z @{, V, W, lambda@}] = qz (A, B)}
  6490.   
  6491.   Computes qz decomposition, generalized eigenvectors, and 
  6492. !         generalized eigenvalues of @math{(A - sB)}
  6493.   @example
  6494.   @group
  6495.           A V = B V diag(lambda)
  6496. --- 382,398 ----
  6497.   
  6498.   
  6499.   @deftypefn {Function File} {@var{lambda} =} qz (@var{a}, @var{b})
  6500. ! Generalized eigenvalue problem @code{A x = s B x},
  6501.   @var{QZ} decomposition.  Three ways to call:
  6502.   @enumerate
  6503.   @item @code{lambda = qz(A,B)}
  6504.   
  6505. ! Computes the generalized eigenvalues @var{lambda} of @code{(A - sB)}.
  6506.   
  6507.   @item @code{[AA, BB, Q, Z @{, V, W, lambda@}] = qz (A, B)}
  6508.   
  6509.   Computes qz decomposition, generalized eigenvectors, and 
  6510. !         generalized eigenvalues of @code{(A - sB)}
  6511.   @example
  6512.   @group
  6513.           A V = B V diag(lambda)
  6514. diff -cwr n:/project/C/octave-2.1.14.orig/doc/interpreter/octave.tex i:/project/C/octave-2.1.14/doc/interpreter/octave.tex
  6515. *** n:/project/C/octave-2.1.14.orig/doc/interpreter/octave.tex    Tue Apr 13 13:11:34 1999
  6516. --- i:/project/C/octave-2.1.14/doc/interpreter/octave.tex    Wed Apr 14 20:58:24 1999
  6517. ***************
  6518. *** 1,6 ****
  6519. --- 1,7 ----
  6520.   % Copyright (C) 1996, 1997 John W. Eaton
  6521.   % This is part of the Octave manual.
  6522.   % For copying conditions, see the file gpl.tex.
  6523. + % Modified by Klaus Gebhardt, 1997
  6524.   
  6525.   \input texinfo
  6526.   @setfilename octave.
  6527. ***************
  6528. *** 11,16 ****
  6529. --- 12,25 ----
  6530.   * Octave: (octave).    Interactive language for numerical computations.
  6531.   END-INFO-DIR-ENTRY
  6532.   @end format
  6533. + @macro email{text}
  6534. + (\text\)
  6535. + @end macro
  6536. + @macro url{text}
  6537. + (\text\)
  6538. + @end macro
  6539.   @end ifinfo
  6540.   
  6541.   @c Settings for printing on 8-1/2 by 11 inch paper:
  6542. ***************
  6543. *** 36,42 ****
  6544.   @c This file doesn't include a chapter, so it must not be included
  6545.   @c if you want to run the Emacs function texinfo-multiple-files-update.
  6546.   
  6547. ! @include conf.tex
  6548.   
  6549.   @settitle GNU Octave
  6550.   
  6551. --- 45,51 ----
  6552.   @c This file doesn't include a chapter, so it must not be included
  6553.   @c if you want to run the Emacs function texinfo-multiple-files-update.
  6554.   
  6555. ! @include ../conf.tex
  6556.   
  6557.   @settitle GNU Octave
  6558.   
  6559. diff -cwr n:/project/C/octave-2.1.14.orig/doc/interpreter/poly.tex i:/project/C/octave-2.1.14/doc/interpreter/poly.tex
  6560. *** n:/project/C/octave-2.1.14.orig/doc/interpreter/poly.tex    Tue Apr 13 13:11:34 1999
  6561. --- i:/project/C/octave-2.1.14/doc/interpreter/poly.tex    Wed Apr 14 20:58:24 1999
  6562. ***************
  6563. *** 8,22 ****
  6564.   In Octave, a polynomial is represented by its coefficients (arranged
  6565.   in descending order).  For example, a vector
  6566.   @iftex
  6567.   @end iftex
  6568.   @ifinfo
  6569. !  $c$
  6570.   @end ifinfo
  6571.   of length
  6572.   @iftex
  6573.   @tex
  6574.    $N+1$
  6575.   @end tex
  6576.   @ifinfo
  6577.    @var{N+1}
  6578.   @end ifinfo
  6579. --- 8,24 ----
  6580.   In Octave, a polynomial is represented by its coefficients (arranged
  6581.   in descending order).  For example, a vector
  6582.   @iftex
  6583. +  $c$
  6584.   @end iftex
  6585.   @ifinfo
  6586. !  @var{c}
  6587.   @end ifinfo
  6588.   of length
  6589.   @iftex
  6590.   @tex
  6591.    $N+1$
  6592.   @end tex
  6593. + @end iftex
  6594.   @ifinfo
  6595.    @var{N+1}
  6596.   @end ifinfo
  6597. diff -cwr n:/project/C/octave-2.1.14.orig/doc/liboctave/gpl.tex i:/project/C/octave-2.1.14/doc/liboctave/gpl.tex
  6598. *** n:/project/C/octave-2.1.14.orig/doc/liboctave/gpl.tex    Tue Apr 13 13:11:38 1999
  6599. --- i:/project/C/octave-2.1.14/doc/liboctave/gpl.tex    Wed Apr 14 20:58:28 1999
  6600. ***************
  6601. *** 1,4 ****
  6602. ! @c Copyright (C) 1996, 1997 John W. Eaton
  6603.   @c This is part of the Octave manual.
  6604.   @c For copying conditions, see the file gpl.tex.
  6605.   
  6606. --- 1,4 ----
  6607. ! @c Copyright (C) 1996 John W. Eaton
  6608.   @c This is part of the Octave manual.
  6609.   @c For copying conditions, see the file gpl.tex.
  6610.   
  6611. diff -cwr n:/project/C/octave-2.1.14.orig/doc/liboctave/liboct.tex i:/project/C/octave-2.1.14/doc/liboctave/liboct.tex
  6612. *** n:/project/C/octave-2.1.14.orig/doc/liboctave/liboct.tex    Tue Apr 13 13:11:38 1999
  6613. --- i:/project/C/octave-2.1.14/doc/liboctave/liboct.tex    Thu Apr 15 10:47:16 1999
  6614. ***************
  6615. *** 1,6 ****
  6616. --- 1,7 ----
  6617.   % Copyright (C) 1996, 1997 John W. Eaton
  6618.   % This is part of the Octave manual.
  6619.   % For copying conditions, see the file gpl.tex.
  6620. + % Modified by Klaus Gebhardt, 1997
  6621.   
  6622.   \input texinfo  @c -*-texinfo-*-
  6623.   @setfilename liboct.
  6624. ***************
  6625. *** 28,38 ****
  6626.   @c This file doesn't include a chapter, so it must not be included
  6627.   @c if you want to run the Emacs function texinfo-multiple-files-update.
  6628.   
  6629. ! @c @include conf.tex
  6630.   
  6631.   @settitle Octave C++ Classes
  6632.   
  6633.   @ifinfo
  6634.   
  6635.   Copyright (C) 1996, 1997 John W. Eaton.
  6636.   
  6637. --- 29,47 ----
  6638.   @c This file doesn't include a chapter, so it must not be included
  6639.   @c if you want to run the Emacs function texinfo-multiple-files-update.
  6640.   
  6641. ! @include ../conf.tex
  6642.   
  6643.   @settitle Octave C++ Classes
  6644.   
  6645.   @ifinfo
  6646. + @macro email{text}
  6647. + (\text\)
  6648. + @end macro
  6649. + @macro url{text}
  6650. + (\text\)
  6651. + @end macro
  6652.   
  6653.   Copyright (C) 1996, 1997 John W. Eaton.
  6654.   
  6655.