|
4 | 4 |
|
5 | 5 | %typemap(in) (int ARGC, char **ARGV) {
|
6 | 6 | if ($input.is_scalar_type()) {
|
7 |
| - $1 = 0; $2 = NULL; |
8 |
| - %argument_fail(SWIG_TypeError, "'int ARGC, char **ARGV' is not a list", $symname, $argnum); |
| 7 | + $1 = 0; $2 = NULL; |
| 8 | + %argument_fail(SWIG_TypeError, "'int ARGC, char **ARGV' is not a list", $symname, $argnum); |
9 | 9 | }
|
10 | 10 | octave_value_list list = $input.list_value();
|
11 | 11 | int i, len = list.length();
|
12 | 12 | $1 = ($1_ltype) len;
|
13 | 13 | $2 = (char **) malloc((len+1)*sizeof(char *));
|
14 | 14 | for (i = 0; i < len; i++) {
|
15 |
| - if(!list(i).is_string()) { |
| 15 | + if (!list(i).is_string()) { |
16 | 16 | $1 = 0;
|
17 | 17 | %argument_fail(SWIG_TypeError, "'int ARGC, char **ARGV' use a non-string", $symname, $argnum);
|
18 | 18 | }
|
|
22 | 22 | }
|
23 | 23 |
|
24 | 24 | %typemap(typecheck, precedence=SWIG_TYPECHECK_STRING_ARRAY) (int ARGC, char **ARGV) {
|
| 25 | + $1 = 0; |
25 | 26 | const octave_value& ov = $input;
|
26 |
| - $1 = !ov.is_scalar_type(); |
| 27 | + if (!ov.is_scalar_type()) { |
| 28 | + octave_value_list list = ov.list_value(); |
| 29 | + int i, len = list.length(); |
| 30 | + $1 = 1; |
| 31 | + for (i = 0; i < len; i++) { |
| 32 | + if (!list(i).is_string()) { |
| 33 | + $1 = 0; |
| 34 | + break; |
| 35 | + } |
| 36 | + } |
| 37 | + } |
27 | 38 | }
|
28 | 39 |
|
29 | 40 | %typemap(freearg) (int ARGC, char **ARGV) {
|
|
0 commit comments