#include "f2c.h"#include <stdlib.h>#include <string.h>Include dependency graph for getenv_.c:

Go to the source code of this file.
Functions | |
| char * | F77_aloc (ftnlen, char *) |
| void | getenv_ (char *fname, char *value, ftnlen flen, ftnlen vlen) |
| char* F77_aloc | ( | ftnlen | , | |
| char * | ||||
| ) |
Definition at line 29 of file F77_aloc.c.
00031 { 00032 char *rv; 00033 unsigned int uLen = (unsigned int) Len; /* for K&R C */ 00034 00035 if (!(rv = (char*)malloc(uLen))) { 00036 fprintf(stderr, "malloc(%u) failure in %s\n", 00037 uLen, whence); 00038 exit_(&memfailure); 00039 } 00040 return rv; 00041 }
Definition at line 31 of file getenv_.c.
References buf, F77_aloc(), free(), getenv(), and i.
00033 { 00034 char buf[256], *ep, *fp; 00035 integer i; 00036 00037 if (flen <= 0) 00038 goto add_blanks; 00039 for(i = 0; i < sizeof(buf); i++) { 00040 if (i == flen || (buf[i] = fname[i]) == ' ') { 00041 buf[i] = 0; 00042 ep = getenv(buf); 00043 goto have_ep; 00044 } 00045 } 00046 while(i < flen && fname[i] != ' ') 00047 i++; 00048 strncpy(fp = F77_aloc(i+1, "getenv_"), fname, (int)i); 00049 fp[i] = 0; 00050 ep = getenv(fp); 00051 free(fp); 00052 have_ep: 00053 if (ep) 00054 while(*ep && vlen-- > 0) 00055 *value++ = *ep++; 00056 add_blanks: 00057 while(vlen-- > 0) 00058 *value++ = ' '; 00059 }
Here is the call graph for this function:

1.5.1