home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-05-06 | 2.0 KB | 56 lines | [TEXT/ALFA] |
- EnvironServer - Environment Variables for the Macintosh
- Brent Burton - brentb@math.tamu.edu 5/31/93
- ----------------------------------------
- Environment Variables for the Macintosh
-
- EnvServer.cpt.bin (or this directory) contains the full source and
- precompiled executables that implement UNIX-style environment variables
- on the Macintosh.
-
- Under UNIX, each process inherits a set of environment variables from
- the shell which the program can manipulate through the getenv() and
- putenv() routines. Since the Macintosh does not have any facility
- like this (well, Gestalt() is a small step in that direction) I decided to
- implement this feature. The idea I came up with was to have a
- server run, handling requests from the processes. The server is a
- background-only app called the "EnvironServer".
-
-
- About this version
-
- This particular version is minimal but it works. I plan to later change
- the server from a background-only app to having a nice interface for
- editing environment variables. Right now, the server reads the file
- named "Environment" for initial environment variables and then handles
- put/get-env() calls from there.
-
-
- Using this code in your projects
-
- If you are porting code that uses environment variables you will need
- to do a couple of things:
- * Add the line #include "GetPutEnv.h"
- to each source file that uses getenv() or putenv().
- * Add the library GPenv.lib to your program's project.
- (a version is already compiled and included herein)
- * In the Unix world, a call to getenv() returns a pointer to static data.
- In this implementation, getenv() returns a Macintosh Ptr type that
- points to a NewPtr()-allocated chunk of memory. If you want to be
- careful, be sure to call DisposPtr() on the result when you're done.
- See the example client's source code for more details.
-
-
- ---------
- This code was originally created under Think C 5 and I have recompiled
- everything without problems under Symantec C 6. Anyway, this code is
- freely distributable and modifiable. If you use it, I'd appreciate a
- brief mention.
-
- Enjoy!
- -Brent
-
- Brent Burton
- brentb@math.tamu.edu
-
-
-