Last change
on this file since 6d3de83 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 8 years ago |
Imported original source code.
|
-
Property mode
set to
100755
|
File size:
1.3 KB
|
Rev | Line | |
---|
[3ae31e9] | 1 |
|
---|
| 2 | Environment Strings
|
---|
| 3 | Beckemeyer Development Tools
|
---|
| 4 |
|
---|
| 5 | ENV.O contains two functions from the UNIX (tm) run-time library.
|
---|
| 6 | It is provided at no extra cost to purchasers of MICRO C-Tools.
|
---|
| 7 |
|
---|
| 8 | The distribution diskette contains the C source file in the \SRC
|
---|
| 9 | directory.
|
---|
| 10 |
|
---|
| 11 | Descriptions of the two functions follow:
|
---|
| 12 |
|
---|
| 13 | Getenv
|
---|
| 14 | ------
|
---|
| 15 | char *getenv(name)
|
---|
| 16 | char *name; /* name of environment variable */
|
---|
| 17 |
|
---|
| 18 | The getenv function searches the envronment table for the given
|
---|
| 19 | variable. It returns a pointer the value of the variable, or
|
---|
| 20 | a NULL pointer if the variable cannot be found.
|
---|
| 21 |
|
---|
| 22 |
|
---|
| 23 | Putenv
|
---|
| 24 | ------
|
---|
| 25 | int putenv(string)
|
---|
| 26 | char *string;
|
---|
| 27 |
|
---|
| 28 | The putenv function adds a new environment variable or modifies an
|
---|
| 29 | existing one. String must be a pointer to a string of the form:
|
---|
| 30 |
|
---|
| 31 | name=value
|
---|
| 32 |
|
---|
| 33 | where name is the name of the environment variable to add or modify,
|
---|
| 34 | and value is the value to assign to that variable.
|
---|
| 35 |
|
---|
| 36 | Putenv returns 0 if it is successfull. A return value of -1 indicates
|
---|
| 37 | an error.
|
---|
| 38 |
|
---|
| 39 |
|
---|
| 40 | IMPORTANT NOTES
|
---|
| 41 | ---------------
|
---|
| 42 |
|
---|
| 43 | You cannot modify the environment directly. Always use the putenv
|
---|
| 44 | function to add or change environment variables. To change the
|
---|
| 45 | value of the string returned by getenv without affecting the
|
---|
| 46 | environment, use strcpy to make a copy of the string.
|
---|
| 47 |
|
---|
| 48 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.