env.c revision 1
1N/A/*********************************************************************** 1N/A* This software is part of the ast package * 1N/A* Copyright (c) 1982-2011 AT&T Intellectual Property * 1N/A* and is licensed under the * 1N/A* Common Public License, Version 1.0 * 1N/A* by AT&T Intellectual Property * 1N/A* A copy of the License is available at * 1N/A* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * 1N/A* Information and Software Systems Research * 1N/A* David Korn <dgk@research.att.com> * 1N/A***********************************************************************/ 1N/A * Compares the name portion of name=... only. 1N/A const unsigned char *
s1=(
unsigned const char*)
key1;
1N/A const unsigned char *
s2=(
unsigned const char*)
key2;
1N/A while((c= *
s1++) && c!=
'=' && c==*
s2)
1N/A * return a pointer to the environment in sorted order 1N/A * NULL is returned if there if there is nospace 1N/A * add name=value pair given by <str> to <ep> 1N/A * if malloced is set, the variable will be freed when reassigned 1N/A * The environment list may become invalidated 1N/A * Returns 1 for success, 0 for failure 1N/A * delete name from <ep> 1N/A * The environment list may become invalidated 1N/A * Returns 1 for success, 0 for if name is not present 1N/A * open up a structure to support environment variables 1N/A * initialize with environment give by <envp> 1N/A * If <extra> > 0, <extra> slots will be left at beginning of 1N/A * environment list when env_get() is involed. 1N/A * If <extra>==ENV_USABLE, then the original environ can be 1N/A * used and returned. Otherwise, a new one will be returned 1N/A * close <ep> and free up all space used by it