home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / compat / stdlib / putenv.txh < prev    next >
Encoding:
Text File  |  1995-07-10  |  836 b   |  33 lines

  1. @node putenv, environment
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <stdlib.h>
  6.  
  7. int putenv(const char *env);
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. This function adds an entry to the program's environment.  The string
  13. passed must be of the form @code{NAME}=@code{VALUE}.  Any existing value
  14. for the environment variable is gone. 
  15.  
  16. @code{putenv} will copy the string passed to it, and will
  17. automatically free any existing string already in the environment.
  18. Keep this in mind if you alter the environment yourself.  The string
  19. you pass is still your responsibility to free.  Note that most
  20. implementations will not let you free the string you pass, resulting
  21. in memory leaks.
  22.  
  23. @subheading Return Value
  24.  
  25. Zero on success, nonzero on failure.
  26.  
  27. @subheading Example
  28.  
  29. @example
  30. putenv("SHELL=ksh.exe");
  31. @end example
  32.  
  33.