lrt_tuxputenv
| Environment Variable Functions |
Modifies an existing environment value or adds a value to the environment.
int lrt_tuxputenv( char *string );
| string | String in the form "name=value." This argument should be declared as a static variable if it is declared with a function |
The lrt_tuxputenv function alters the value of an existing environment variable or creates a new variable. Use lrt_set_env_list to determine which variables can be set. This function is useful for portability of environment values across different platforms that don't normally have environment variables. By default, lrt_tuxputenv only permits changing WSNADDR, unless lrt_set_env_list is used.
Return Values
If the function succeeds, it returns 0. Otherwise, it returns a non-zero value if it was unable to obtain enough space via malloc for an expanded environment.
Parameterization
The following argument(s) can be parameterized using standard parameterization: string. Note: Only the value of the argument can be parameterized, not the attribute name.
Example
The following example shows how to work with environment variables in conjunction with lrt functions. The lrt_tuxputenv function sets the server address to //server:65535.
// set the server address
lrt_tuxputenv("WSNADDR=//server:65535");
// find out what which natural language used.
lrt_tuxgetenv("NLSPATH");
// use default settings to get environment information.
lrt_tuxreadenv(NULL, NULL);

