changeset 12574:89604fa96d2f

Deprecate perror, strerror functions.
author Rik <octave@nomad.inbox5.com>
date Mon, 04 Apr 2011 13:37:13 -0700
parents 232a90612254
children d0b799dafede
files ChangeLog NEWS doc/ChangeLog doc/interpreter/nonlin.txi scripts/ChangeLog scripts/deprecated/module.mk scripts/deprecated/perror.m scripts/deprecated/strerror.m scripts/general/module.mk scripts/general/perror.m scripts/general/strerror.m
diffstat 9 files changed, 33 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-04-04  Rik  <octave@nomad.inbox5.com>
+
+	* NEWS: Add perror, strerror to list of functions deprecated in 3.4
+
 2011-03-31  Rik  <octave@nomad.inbox5.com>
 
 	* NEWS: Add cquad to list of functions deprecated in 3.4
--- a/NEWS
+++ b/NEWS
@@ -461,9 +461,9 @@
     be removed from Octave 3.8 (or whatever version is the second major
     release after 3.4):
 
-      autocor  cellidx   fstat    is_global  saveimage
-      autocov  cquad     gammai   krylovb    values
-      betai    dispatch  glpkmex  replot  
+      autocor  cellidx   fstat    is_global  replot     values
+      autocov  cquad     gammai   krylovb    saveimage  
+      betai    dispatch  glpkmex  perror     strerror 
 
 Summary of important user-visible changes for version 3.2:
 ---------------------------------------------------------
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2011-04-04  Rik  <octave@nomad.inbox5.com>
+
+	* interpreter/grammar.txi: Remove reference to deprecated function
+	perror().
+
 2011-04-03  Rik  <octave@nomad.inbox5.com>
 
 	* interpreter/grammar.txi, interpreter/octave.texi: Add new section
--- a/doc/interpreter/nonlin.txi
+++ b/doc/interpreter/nonlin.txi
@@ -113,16 +113,6 @@
 @noindent
 A value of @code{info = 1} indicates that the solution has converged.
 
-The function @code{perror} may be used to print English messages
-corresponding to the numeric error codes.  For example:
-
-@example
-@group
-perror ("fsolve", 1)
-     @print{} solution converged to requested tolerance
-@end group
-@end example
-
 When no Jacobian is supplied (as in the example above) it is approximated
 numerically.  This requires more function evaluations, and hence is
 less efficient.  In the example above we could compute the Jacobian 
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,8 @@
+2011-04-04  Rik  <octave@nomad.inbox5.com>
+
+	* deprecated/module.mk, general/module.mk: Deprecate perror, strerror
+	functions.
+
 2011-04-02  Rik  <octave@nomad.inbox5.com>
 
 	* statistics/base/prctile.m, statistics/base/quantile.m: Improve 
--- a/scripts/deprecated/module.mk
+++ b/scripts/deprecated/module.mk
@@ -16,11 +16,13 @@
   deprecated/is_global.m \
   deprecated/isstr.m \
   deprecated/krylovb.m \
+  deprecated/perror.m \
   deprecated/replot.m \
   deprecated/saveimage.m \
   deprecated/setstr.m \
   deprecated/sphcat.m \
   deprecated/spvcat.m \
+  deprecated/strerror.m \
   deprecated/values.m \
   deprecated/weibcdf.m \
   deprecated/weibinv.m \
rename from scripts/general/perror.m
rename to scripts/deprecated/perror.m
--- a/scripts/general/perror.m
+++ b/scripts/deprecated/perror.m
@@ -29,6 +29,13 @@
 
 function perror (funcname, num)
 
+  persistent warned = false;
+  if (! warned)
+    warned = true;
+    warning ("Octave:deprecated-function",
+             "perror is obsolete and will be removed from a future version of Octave.");
+  endif
+
   if (nargin != 2)
     print_usage ();
   else
rename from scripts/general/strerror.m
rename to scripts/deprecated/strerror.m
--- a/scripts/general/strerror.m
+++ b/scripts/deprecated/strerror.m
@@ -28,6 +28,13 @@
 
 function msg = strerror (name, num)
 
+  persistent warned = false;
+  if (! warned)
+    warned = true;
+    warning ("Octave:deprecated-function",
+             "strerror is obsolete and will be removed from a future version of Octave.");
+  endif
+
   if (nargin != 2)
     print_usage ();
   endif
--- a/scripts/general/module.mk
+++ b/scripts/general/module.mk
@@ -57,7 +57,6 @@
   general/nargoutchk.m \
   general/nextpow2.m \
   general/num2str.m \
-  general/perror.m \
   general/pol2cart.m \
   general/polyarea.m \
   general/postpad.m \
@@ -75,7 +74,6 @@
   general/shiftdim.m \
   general/sortrows.m \
   general/sph2cart.m \
-  general/strerror.m \
   general/structfun.m \
   general/subsindex.m \
   general/triplequad.m \