Mercurial > octave-nkf
annotate 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 |
rev | line source |
---|---|
11523 | 1 ## Copyright (C) 1993-2011 John W. Eaton |
2313 | 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 | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## your option) any later version. | |
2313 | 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 | |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
245 | 18 |
3381 | 19 ## -*- texinfo -*- |
11469
c776f063fefe
Overhaul m-script files to use common variable name between code and documentation.
Rik <octave@nomad.inbox5.com>
parents:
7017
diff
changeset
|
20 ## @deftypefn {Function File} {} perror (@var{funcname}, @var{num}) |
c776f063fefe
Overhaul m-script files to use common variable name between code and documentation.
Rik <octave@nomad.inbox5.com>
parents:
7017
diff
changeset
|
21 ## Print the error message for function @var{funcname} corresponding to the |
3373 | 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. | |
5642 | 25 ## @seealso{strerror} |
3373 | 26 ## @end deftypefn |
4 | 27 |
2314 | 28 ## Author: jwe |
29 | |
11469
c776f063fefe
Overhaul m-script files to use common variable name between code and documentation.
Rik <octave@nomad.inbox5.com>
parents:
7017
diff
changeset
|
30 function perror (funcname, num) |
4 | 31 |
12574
89604fa96d2f
Deprecate perror, strerror functions.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
32 persistent warned = false; |
89604fa96d2f
Deprecate perror, strerror functions.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
33 if (! warned) |
89604fa96d2f
Deprecate perror, strerror functions.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
34 warned = true; |
89604fa96d2f
Deprecate perror, strerror functions.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
35 warning ("Octave:deprecated-function", |
89604fa96d2f
Deprecate perror, strerror functions.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
36 "perror is obsolete and will be removed from a future version of Octave."); |
89604fa96d2f
Deprecate perror, strerror functions.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
37 endif |
89604fa96d2f
Deprecate perror, strerror functions.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
38 |
4 | 39 if (nargin != 2) |
6046 | 40 print_usage (); |
1577 | 41 else |
11469
c776f063fefe
Overhaul m-script files to use common variable name between code and documentation.
Rik <octave@nomad.inbox5.com>
parents:
7017
diff
changeset
|
42 printf (strerror (funcname, num)); |
4 | 43 endif |
44 | |
45 endfunction |