home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Utilities / ENV Server / ENVserver.info < prev    next >
Encoding:
Text File  |  1994-05-06  |  2.0 KB  |  56 lines  |  [TEXT/ALFA]

  1. EnvironServer - Environment Variables for the Macintosh
  2. Brent Burton - brentb@math.tamu.edu  5/31/93
  3. ----------------------------------------
  4. Environment Variables for the Macintosh
  5.  
  6. EnvServer.cpt.bin (or this directory) contains the full source and
  7. precompiled executables that implement UNIX-style environment variables
  8. on the Macintosh.
  9.  
  10. Under UNIX, each process inherits a set of environment variables from
  11. the shell which the program can manipulate through the getenv() and
  12. putenv() routines.  Since the Macintosh does not have any facility
  13. like this (well, Gestalt() is a small step in that direction) I decided to
  14. implement this feature.  The idea I came up with was to have a
  15. server run, handling requests from the processes.  The server is a
  16. background-only app called the "EnvironServer".
  17.  
  18.  
  19. About this version
  20.  
  21. This particular version is minimal but it works.  I plan to later change
  22. the server from a background-only app to having a nice interface for
  23. editing environment variables.  Right now, the server reads the file
  24. named "Environment" for initial environment variables and then handles
  25. put/get-env() calls from there.
  26.  
  27.  
  28. Using this code in your projects
  29.  
  30. If you are porting code that uses environment variables you will need
  31. to do a couple of things:
  32. * Add the line   #include "GetPutEnv.h"
  33.   to each source file that uses getenv() or putenv().
  34. * Add the library GPenv.lib to your program's project.
  35.   (a version is already compiled and included herein)
  36. * In the Unix world, a call to getenv() returns a pointer to static data.
  37.   In this implementation, getenv() returns a Macintosh Ptr type that
  38.   points to a NewPtr()-allocated chunk of memory.  If you want to be
  39.   careful, be sure to call DisposPtr() on the result when you're done.
  40.   See the example client's source code for more details.
  41.  
  42.  
  43. ---------
  44. This code was originally created under Think C 5 and I have recompiled
  45. everything without problems under Symantec C 6. Anyway, this code is
  46. freely distributable and modifiable.  If you use it, I'd appreciate a
  47. brief mention.
  48.  
  49. Enjoy!
  50. -Brent
  51.  
  52. Brent Burton
  53. brentb@math.tamu.edu
  54.  
  55.  
  56.