diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /pkg/system/help/lroff/getarg.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/system/help/lroff/getarg.x')
-rw-r--r-- | pkg/system/help/lroff/getarg.x | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/pkg/system/help/lroff/getarg.x b/pkg/system/help/lroff/getarg.x new file mode 100644 index 00000000..b85c5462 --- /dev/null +++ b/pkg/system/help/lroff/getarg.x @@ -0,0 +1,35 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <chars.h> +include "lroff.h" + +.help lgetarg +.nf _________________________________________________________________________ +LGETARG -- Get an integer argument to a directive. If no argument is found, +return the default value. We are called with IP pointing to the start of +the argument field to be searched. Leave IP pointing to the next argument +field. +.endhelp ____________________________________________________________________ + +int procedure lgetarg (input_line, ip, default_value) + +char input_line[ARB] +int ip, default_value +int argument +int ctoi() + +begin + if (ctoi (input_line, ip, argument) == 0) + argument = default_value + + # Eat comma argument delimiter, if multiple arguments. Also eat + # trailing whitespace, in case a string argument follows. + while (input_line[ip] == BLANK) + ip = ip + 1 + if (input_line[ip] == ',') + ip = ip + 1 + while (input_line[ip] == BLANK) + ip = ip + 1 + + return (argument) +end |