home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume1 / 8712 / mkmf / 2 / src / getproject.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-07-13  |  602 b   |  25 lines

  1. /* $Header: getproject.c,v 1.1 85/03/14 16:59:01 nicklin Exp $ */
  2.  
  3. /*
  4.  * Author: Peter J. Nicklin
  5.  */
  6.  
  7. /*
  8.  * getproject() saves the contents of the PROJECT environment variable.
  9.  * If the PROJECT variable is undefined or a null string, null is returned.
  10.  */
  11. #include "null.h"
  12.  
  13. char *_PROJECT = NULL;            /* project root directory pathname */
  14.  
  15. void
  16. getproject()
  17. {
  18.     register char *pv;        /* ptr to start of PROJECT variable */
  19.     char *getenv();            /* get environment variable */
  20.     char *strsav();            /* save a string somewhere */
  21.  
  22.     if ((pv = getenv("PROJECT")) != NULL && *pv != '\0')
  23.         _PROJECT = strsav(pv);
  24. }
  25.