1 /* $XConsortium: setuniv.c /main/3 1995/11/01 18:03:52 rswiston $ */
2 /***************************************************************
6 * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF *
7 * AT&T BELL LABORATORIES *
8 * AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN *
9 * ACCORDANCE WITH APPLICABLE AGREEMENTS *
11 * Copyright (c) 1994 AT&T Bell Laboratories *
12 * Unpublished & Not for Publication *
13 * All Rights Reserved *
15 * The copyright notice above does not evidence any *
16 * actual or intended publication of such source code *
18 * This software was created by the *
19 * Software Engineering Research Department *
20 * AT&T Bell Laboratories *
22 * For further information contact *
23 * advsoft@research.att.com *
24 * Randy Hackbarth 908-582-5245 *
25 * Dave Belanger 908-582-7427 *
27 ***************************************************************/
29 /* : : generated by proto : : */
33 #if !defined(__PROTO__)
34 #if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
35 #if defined(__cplusplus)
36 #define __MANGLE__ "C"
41 #define __PROTO__(x) x
43 #define __PARAM__(n,o) n
44 #if !defined(__STDC__) && !defined(__cplusplus)
45 #if !defined(c_plusplus)
56 #define __PROTO__(x) ()
57 #define __OTORP__(x) x
58 #define __PARAM__(n,o) o
66 #if defined(__cplusplus) || defined(c_plusplus)
67 #define __VARARG__ ...
71 #if defined(__STDARG__)
72 #define __VA_START__(p,a) va_start(p,a)
74 #define __VA_START__(p,a) va_start(p)
82 setuniv __PARAM__((const char* buf), (buf)) __OTORP__(const char* buf;)
86 return(setuniverse(buf));
92 sfsprintf(tmp, sizeof(tmp), "%s=%-*.*s", univ_env, UNIV_SIZE - 1, UNIV_SIZE - 1, buf);
93 if ((p = strdup(tmp)) && setenv(p)) return(0);
97 #if defined(ATT_UNIV) || defined(U_GET)
100 for (n = 0; n < UNIV_MAX; n++)
101 if (streq(buf, univ_name[n]))
102 #if defined(ATT_UNIV)
103 return(setuniverse(n + 1) >= 0 ? 0 : -1);
105 return(universe(n) >= 0 ? 0 : -1);