Mercurial > octave-nkf
diff src/utils.cc @ 2234:a174011c96f2
[project @ 1996-05-17 17:51:20 by jwe]
author | jwe |
---|---|
date | Fri, 17 May 1996 17:52:28 +0000 |
parents | 0da2c91573d9 |
children | 3e0a2661f0a0 |
line wrap: on
line diff
--- a/src/utils.cc Fri May 17 17:31:30 1996 +0000 +++ b/src/utils.cc Fri May 17 17:52:28 1996 +0000 @@ -208,6 +208,35 @@ return status; } +// Return non-zero if either NR or NC is zero. Return -1 if this +// should be considered fatal; return 1 if this is ok. + +int +empty_arg (const char *name, int nr, int nc) +{ + int is_empty = 0; + + if (nr == 0 || nc == 0) + { + int flag = Vpropagate_empty_matrices; + + if (flag < 0) + { + gripe_empty_arg (name, 0); + is_empty = 1; + } + else if (flag == 0) + { + gripe_empty_arg (name, 1); + is_empty = -1; + } + else + is_empty = 1; + } + + return is_empty; +} + // See if the given file is in the path. string