3 <<getenv>>---look up environment variable
12 char *getenv(const char *<[name]>);
15 <<getenv>> searches the list of environment variable names and values
16 (using the global pointer ``<<char **environ>>'') for a variable whose
17 name matches the string at <[name]>. If a variable name matches,
18 <<getenv>> returns a pointer to the associated value.
21 A pointer to the (string) value of the environment variable, or
22 <<NULL>> if there is no such environment variable.
25 <<getenv>> is ANSI, but the rules for properly forming names of environment
26 variables vary from one system to another.
28 <<getenv>> requires a global pointer <<environ>>.
32 * Copyright (c) 1987, 2000 Regents of the University of California.
33 * All rights reserved.
35 * Redistribution and use in source and binary forms are permitted
36 * provided that: (1) source distributions retain this entire copyright
37 * notice and comment, and (2) distributions including binaries display
38 * the following acknowledgement: ``This product includes software
39 * developed by the University of California, Berkeley and its contributors''
40 * in the documentation or other materials provided with the distribution.
41 * Neither the name of the University nor the names of its
42 * contributors may be used to endorse or promote products derived
43 * from this software without specific prior written permission.
44 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
45 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
46 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
57 * Returns pointer to value associated with name, if any, else NULL.
58 * Sets offset to be the offset of the name/value combination in the
59 * environmental array, for use by setenv(3) and unsetenv(3).
60 * Explicitly removes '=' in argument name.
62 * This routine *should* be a static; don't use it.
66 _findenv (register const char *name
,
69 return _findenv_r (_REENT
, name
, offset
);
74 * Returns ptr to value associated with name, if any, else NULL.
78 getenv (const char *name
)
82 return _findenv_r (_REENT
, name
, &offset
);
85 #endif /* !_REENT_ONLY */