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 /sys/etc/envnext.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/etc/envnext.x')
-rw-r--r-- | sys/etc/envnext.x | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/sys/etc/envnext.x b/sys/etc/envnext.x new file mode 100644 index 00000000..80ddf226 --- /dev/null +++ b/sys/etc/envnext.x @@ -0,0 +1,53 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include "environ.h" + +# ENV_FIRST -- Return a pointer to the first (most recently entered) entry +# in the environment list. A pointer to the string definition of the entry +# is returned as the output argument. + +pointer procedure env_first (valp) + +pointer valp # pointer to environment string +pointer el +include "environ.com" + +begin + el = envbuf + last + if (el > envbuf) { + valp = E_SETP(el) + return (el) + } else + return (NULL) +end + + +# ENV_NEXT -- Return a pointer to the next element in the environment list. +# A pointer to the string value of the element is returned as the output +# argument. + +pointer procedure env_next (last_el, valp, show_redefines) + +pointer last_el # pointer to last element returned +pointer valp # receives charp of next element define string +int show_redefines # do not skip redefined elements + +pointer el +include "environ.com" + +begin + el = envbuf + E_LASTELEM(last_el) + + while (el > envbuf) { + if (E_REDEF(el) == NO || show_redefines == YES) + break + else + el = envbuf + E_LASTELEM(el) + } + + if (el > envbuf) { + valp = E_SETP(el) + return (el) + } else + return (NULL) +end |