Nut/OS  5.0.5
API Reference
setenv.c File Reference
#include <dev/nvmem.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <memdebug.h>
#include <sys/environ.h>
#include <cfg/crt.h>
Include dependency graph for setenv.c:

Functions

int setenv (const char *name, const char *value, int force)
 Remove an environment variable.
void unsetenv (const char *name)
 Remove an environment variable.

Function Documentation

int setenv ( const char *  name,
const char *  value,
int  force 
)

Remove an environment variable.

Parameters:
namePoints to a string, which is the name of the variable.
valuePoints to a string, which is the value of the variable.
forceIf not zero, existing values will be updated.
Returns:
0 upon successful completion. Otherwise, -1 is returned and errno is set to indicate the error.

References _NUTENVIRONMENT::env_name, _NUTENVIRONMENT::env_next, _NUTENVIRONMENT::env_prev, _NUTENVIRONMENT::env_value, findenv(), free(), malloc(), memset(), NULL, nut_environ, strcmp(), and strdup().

Referenced by putenv().

Here is the call graph for this function:

void unsetenv ( const char *  name)

Remove an environment variable.

Parameters:
namePoints to a string, which is the name of the variable to be removed.
Returns:
0 upon successful completion. Otherwise, -1 is returned and errno is set to indicate the error.

References ENOENT, _NUTENVIRONMENT::env_name, _NUTENVIRONMENT::env_next, _NUTENVIRONMENT::env_prev, _NUTENVIRONMENT::env_value, errno, findenv(), free(), NULL, and nut_environ.

Here is the call graph for this function: