comparison scripts/deprecated/perror.m @ 12574:89604fa96d2f

Deprecate perror, strerror functions.
author Rik <octave@nomad.inbox5.com>
date Mon, 04 Apr 2011 13:37:13 -0700
parents scripts/general/perror.m@fd0a3ac60b0e
children 72c96de7a403
comparison
equal deleted inserted replaced
12573:232a90612254 12574:89604fa96d2f
1 ## Copyright (C) 1993-2011 John W. Eaton
2 ##
3 ## This file is part of Octave.
4 ##
5 ## Octave is free software; you can redistribute it and/or modify it
6 ## under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 3 of the License, or (at
8 ## your option) any later version.
9 ##
10 ## Octave is distributed in the hope that it will be useful, but
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ## General Public License for more details.
14 ##
15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>.
18
19 ## -*- texinfo -*-
20 ## @deftypefn {Function File} {} perror (@var{funcname}, @var{num})
21 ## Print the error message for function @var{funcname} corresponding to the
22 ## error number @var{num}. This function is intended to be used to print
23 ## useful error messages for those functions that return numeric error
24 ## codes.
25 ## @seealso{strerror}
26 ## @end deftypefn
27
28 ## Author: jwe
29
30 function perror (funcname, num)
31
32 persistent warned = false;
33 if (! warned)
34 warned = true;
35 warning ("Octave:deprecated-function",
36 "perror is obsolete and will be removed from a future version of Octave.");
37 endif
38
39 if (nargin != 2)
40 print_usage ();
41 else
42 printf (strerror (funcname, num));
43 endif
44
45 endfunction