libexplain  1.4.D001
Functions | Variables
libexplain/unsetenv_on_error.c File Reference
#include <libexplain/ac/errno.h>
#include <libexplain/ac/stdlib.h>
#include <libexplain/ac/string.h>
#include <libexplain/unsetenv.h>
#include <libexplain/output.h>

Go to the source code of this file.

Functions

static int unsetenv (const char *name)
int explain_unsetenv_on_error (const char *name)

Variables

char ** environ

Function Documentation

int explain_unsetenv_on_error ( const char *  name)

The explain_unsetenv_on_error function is used to call the unsetenv(3) system call. On failure an explanation will be printed to stderr, obtained from the explain_unsetenv(3) function.

Parameters:
nameThe name, exactly as to be passed to the unsetenv(3) system call.
Returns:
The value returned by the wrapped unsetenv(3) system call.
Example:
This function is intended to be used in a fashion similar to the following example:
 if (explain_unsetenv_on_error(name) < 0)
 {
     ...cope with error
     ...no need to print error message
 }

Definition at line 84 of file unsetenv_on_error.c.

static int unsetenv ( const char *  name) [static]

Definition at line 43 of file unsetenv_on_error.c.


Variable Documentation

char** environ