home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / compiler / sozobon / scsrc20 / make / readenv.c < prev    next >
C/C++ Source or Header  |  1988-10-13  |  395b  |  22 lines

  1. /*
  2.  *    readenv() - set macro values from the environment
  3.  */
  4. #include <stdio.h>
  5.  
  6. readenv()
  7. {
  8.     extern long    _base;
  9.     char    *envp, *p, *strchr();
  10.     char    buf[256];
  11.  
  12.     envp = *((char **) (_base + 0x2c));
  13.  
  14.     for (; strncmp(envp, "ARGV=", 5) != 0 ; envp += strlen(envp) + 1) {
  15.         strcpy(buf, envp);
  16.         if ((p = strchr(buf, '=')) == NULL)
  17.             return;
  18.         *p++ = '\0';
  19.         setmacro(buf, p);
  20.     }
  21. }
  22.