5 extern char *F77_aloc (ftnlen
, char *);
8 * getenv - f77 subroutine to return environment variables
11 * call getenv (ENV_NAME, char_var)
13 * ENV_NAME is the name of an environment variable
14 * char_var is a character variable which will receive
15 * the current value of ENV_NAME, or all blanks
16 * if ENV_NAME is not defined
20 G77_getenv_0 (char *fname
, char *value
, ftnlen flen
, ftnlen vlen
)
22 char buf
[256], *ep
, *fp
;
27 for (i
= 0; i
< (integer
) sizeof (buf
); i
++)
29 if (i
== flen
|| (buf
[i
] = fname
[i
]) == ' ')
36 while (i
< flen
&& fname
[i
] != ' ')
38 strncpy (fp
= F77_aloc (i
+ 1, "getenv_"), fname
, (int) i
);
44 while (*ep
&& vlen
-- > 0)