2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 1999 - 2006, Digium, Inc.
6 * See http://www.asterisk.org for more information about
7 * the Asterisk project. Please do not directly contact
8 * any of the maintainers of this project for assistance;
9 * the project provides a web site, mailing lists and IRC
10 * channels for your use.
12 * This program is free software, distributed under the terms of
13 * the GNU General Public License Version 2. See the LICENSE file
14 * at the top of the source tree.
19 * \brief Compatibility functions for strsep and strtoq missing on Solaris
24 #include <sys/types.h>
28 char *strsep(char **str
, const char *delims
)
38 while (**str
!= '\0') {
39 if (strchr(delims
, **str
)) {
47 /* There is no other token */
55 int setenv(const char *name
, const char *value
, int overwrite
)
60 buflen
= strlen(name
) + strlen(value
) + 2;
63 if (!overwrite
&& getenv(name
))
66 snprintf(buf
, buflen
, "%s=%s", name
, value
);
73 int unsetenv(const char *name
)
75 return setenv(name
, "", 0);