home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
files
/
language
/
sozobon2
/
readenv.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-23
|
395b
|
22 lines
/*
* readenv() - set macro values from the environment
*/
#include <stdio.h>
readenv()
{
extern long _base;
char *envp, *p, *strchr();
char buf[256];
envp = *((char **) (_base + 0x2c));
for (; strncmp(envp, "ARGV=", 5) != 0 ; envp += strlen(envp) + 1) {
strcpy(buf, envp);
if ((p = strchr(buf, '=')) == NULL)
return;
*p++ = '\0';
setmacro(buf, p);
}
}