Mercurial > hg > octave-lyh
annotate libinterp/mk-errno-list @ 17482:997b700b6ad4
compass.m: Add %!error input validation tests.
* scripts/plot/compass.m: Add %!error input validation tests.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 24 Sep 2013 13:17:02 -0700 |
parents | 2fc554ffbc28 |
children |
rev | line source |
---|---|
5494 | 1 #! /bin/sh |
7019 | 2 # |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
3 # Copyright (C) 2005-2012 John W. Eaton |
7019 | 4 # |
5 # This file is part of Octave. | |
6 # | |
7 # Octave is free software; you can redistribute it and/or modify it | |
8 # under the terms of the GNU General Public License as published by the | |
9 # Free Software Foundation; either version 3 of the License, or (at | |
10 # your option) any later version. | |
11 # | |
12 # Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 # for more details. | |
16 # | |
17 # You should have received a copy of the GNU General Public License | |
18 # along with Octave; see the file COPYING. If not, see | |
19 # <http://www.gnu.org/licenses/>. | |
5494 | 20 |
21 if [ $# -ne 2 ]; then | |
22 echo "usage: get-errno-list [--perl PERL|--python PYTHON]" 1>&2 | |
23 exit 1 | |
24 fi | |
25 | |
26 if [ $1 = "--perl" ]; then | |
27 PERL="$2"; | |
28 $PERL -e 'foreach $key (keys(%!)) { | |
29 $x .= "#if defined ($key)\n { \"$key\", $key, },\n#endif\n"; | |
30 } | |
31 while (<>) { | |
32 s/^ *\@SYSDEP_ERRNO_LIST\@/$ x/; | |
33 print; | |
34 }' | |
35 | |
36 elif [ $1 = "--python" ]; then | |
37 PYTHON="$2"; | |
38 $PYTHON -c ' | |
39 from errno import errorcode | |
40 from sys import stdin | |
41 | |
42 t = "#if defined (%s)\n { \"%s\", %s, },\n#endif\n" | |
43 errstr = "" | |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
44 for k in errorcode.keys (): |
5494 | 45 errstr += t % tuple(3*[errorcode[k]]) |
46 | |
47 for l in stdin: | |
48 print l.replace("@SYSDEP_ERRNO_LIST@", errstr), | |
49 ' | |
50 fi | |
51 | |
52 exit $? |