home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
prgtools
/
langs
/
sozobon2.zoo
/
make
/
readenv.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1990-12-13
|
395 b
|
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);
}
}