/*
* Copyright (c) 1998 Michael Smith.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
__FBSDID("$FreeBSD$");
/*
* Manage an environment-like space in which string variables may be stored.
* Provide support for some method-like operations for setting/retrieving
* variables in order to allow some type strength.
*/
#include "stand.h"
#include <string.h>
/*
* Look up (name) and return it's env_var structure.
*/
struct env_var *
{
break;
return(ev);
}
/*
* Some notes:
*
* If the EV_VOLATILE flag is set, a copy of the variable is made.
* If EV_DYNAMIC is set, the variable has been allocated with
* malloc and ownership transferred to the environment.
* If (value) is NULL, the variable is set but has no value.
*/
int
{
/*
* If there's a set hook, let it do the work (unless we are working
* for one already.
*/
/* If there is data in the variable, discard it. */
} else {
/*
* New variable; create and sort into list
*/
/* hooks can only be set when the variable is instantiated */
/* Sort into list */
/* Search for the record to insert before */
} else {
}
break;
}
}
} else {
}
}
}
/* If we have a new value, use it */
if (flags & EV_VOLATILE) {
} else {
}
return(0);
}
char *
{
/* Set but no value gives empty string */
return("");
}
return(NULL);
}
int
{
/* No guarantees about state, always assume volatile */
return(0);
}
int
{
int result;
*(value++) = 0;
return(result);
}
int
{
int err;
err = 0;
} else {
if (err == 0) {
}
}
return(err);
}
static void
{
}
int
{
return(EPERM);
}
int
{
return(EPERM);
}