#include "machine.h"#include "sciprint.h"Include dependency graph for getenvc.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Functions | |
| void C2F() | getenvc (int *ierr, char *var, char *buf, int *buflen, int *iflag) |
Retrieve a system variable
| [out] | ierr | the error code |
| [in] | var | the name of the variable |
| [out] | buf | the value of the variable |
| [out] | buflen | the length of the variable |
| [in] | iflag |
Definition at line 13 of file getenvc.c.
References buf, buflen, getenv(), ierr, iflag, and sciprint().
Referenced by getcomp(), GetenvB(), gettmpdir(), SetSci(), and setSCIHOME().
00014 { 00015 #ifdef _MSC_VER 00016 if (GetEnvironmentVariable(var,buf,(DWORD)buflen)==0) 00017 { 00018 if ( *iflag == 1 ) sciprint("You must define the environment variable %s\r\n",var); 00019 *ierr=1; 00020 } 00021 else 00022 { 00023 *buflen = strlen(buf); 00024 *ierr=0; 00025 } 00026 #else 00027 char *local; 00028 if ( (local=getenv(var)) == 0) 00029 { 00030 if ( *iflag == 1 ) sciprint("You must define the environment variable %s\r\n",var); 00031 *ierr=1; 00032 } 00033 else 00034 { 00035 strncpy(buf,local,*buflen); 00036 *buflen = strlen(buf); 00037 *ierr=0; 00038 } 00039 #endif 00040 }
Here is the call graph for this function:

Here is the caller graph for this function:

1.5.1