2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: extra.c /main/4 1995/11/01 15:54:55 rswiston $ */
25 /* Copyright (c) 1991, 1992 UNIX System Laboratories, Inc. */
26 /* All Rights Reserved */
28 /* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
29 /* UNIX System Laboratories, Inc. */
30 /* The copyright notice above does not evidence any */
31 /* actual or intended publication of such source code. */
45 (void)nv_open(var, sh.var_tree, NV_ASSIGN);
62 np = nv_search(var,sh.var_tree,0);
63 if (np && (val = nv_getval(np)))
73 return((void *) hashalloc(NULL,0));
82 hashput(tbl, name, val);
90 return(hashget(tbl, name));
99 hashput(tbl, name, val);
106 sh_eval(sfopen(NIL(Sfile_t*),cmd,"s"),0);
120 if ((len = strlen(var) + strlen(val?val:"") + 2) > sizeof(tmp)) /* 11/06 CHANGED */
124 strcat(set, val?val:""); /* 11/06 CHANGED */
134 env_set_var(var, "");
147 if (cmd && (strlen(cmd) > 0))
148 printf( "%s: %s %s\n", cmd, msg1, msg2);
150 printf( "%s %s\n", msg1, msg2);
184 sprintf(buf, fmt, arg0, arg1, arg2, arg3,arg4, arg5, arg6, arg7);
185 if (cmd && (strlen(cmd) > 0))
186 printf("%s: %s\n", cmd, buf);