Date Modules Changes
+2007-12-24 setenv The include file is changed from "setenv.h" to
+ <stdlib.h>. Also, the unsetenv function is no
+ longer declared in this module; use the 'unsetenv'
+ module if you need it.
+
2007-12-03 getpagesize The include file is changed from "getpagesize.h"
to <unistd.h>.
@item
This function is missing on some platforms:
AIX 5.1, HP-UX 11, IRIX 6.5, Solaris 9, mingw, BeOS.
+@item
+This function has the return type @samp{void} instead of @samp{int} on some
+platforms:
+MacOS X 10.3, FreeBSD 6.0, NetBSD 1.6, OpenBSD 3.8, OSF/1 5.1.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
-@item
-This function has the return type @samp{void} instead of @samp{int} on some
-platforms.
@end itemize
#include <stdlib.h>
#include <string.h>
-#include "setenv.h"
#include "xalloc.h"
#include "progname.h"
#include "relocatable.h"
-#include "setenv.h"
#include "c-ctype.h"
/* Return a copy of the filename, with an extra ".bin" at the end.
#endif
#include <alloca.h>
+/* Specification. */
+#include <stdlib.h>
+
#include <errno.h>
#ifndef __set_errno
# define __set_errno(ev) ((errno) = (ev))
#endif
-#include <stdlib.h>
#include <string.h>
#if _LIBC || HAVE_UNISTD_H
# include <unistd.h>
+++ /dev/null
-/* Setting environment variables.
- Copyright (C) 2001-2004, 2007 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#if HAVE_SETENV || HAVE_UNSETENV
-
-/* Get setenv(), unsetenv() declarations. */
-# include <stdlib.h>
-
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !HAVE_SETENV
-
-/* Set NAME to VALUE in the environment.
- If REPLACE is nonzero, overwrite an existing value. */
-extern int setenv (const char *name, const char *value, int replace);
-
-#endif
-
-#if HAVE_UNSETENV
-
-# if VOID_UNSETENV
-/* On some systems, unsetenv() returns void.
- This is the case for FreeBSD 4.8, NetBSD 1.6, OpenBSD 3.4. */
-# define unsetenv(name) ((unsetenv)(name), 0)
-# endif
-
-#else
-
-/* Remove the variable NAME from the environment. */
-extern int unsetenv (const char *name);
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
/* A GNU-like <stdlib.h>.
- Copyright (C) 1995, 2001-2002, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2001-2004, 2006-2007 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#endif
+#if @GNULIB_SETENV@
+# if !@HAVE_SETENV@
+/* Set NAME to VALUE in the environment.
+ If REPLACE is nonzero, overwrite an existing value. */
+extern int setenv (const char *name, const char *value, int replace);
+# endif
+#endif
+
+
+#if @GNULIB_UNSETENV@
+# if @HAVE_UNSETENV@
+# if @VOID_UNSETENV@
+/* On some systems, unsetenv() returns void.
+ This is the case for MacOS X 10.3, FreeBSD 4.8, NetBSD 1.6, OpenBSD 3.4. */
+# define unsetenv(name) ((unsetenv)(name), 0)
+# endif
+# else
+/* Remove the variable NAME from the environment. */
+extern int unsetenv (const char *name);
+# endif
+#endif
+
+
#ifdef __cplusplus
}
#endif
-/* Copyright (C) 1992,1995-1999,2000-2002,2005-2006 Free Software Foundation, Inc.
+/* Copyright (C) 1992,1995-1999,2000-2002,2005-2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software: you can redistribute it and/or modify
#include <config.h>
+/* Specification. */
+#include <stdlib.h>
+
#include <errno.h>
#if !_LIBC
# define __set_errno(ev) ((errno) = (ev))
#endif
-#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
-#include "setenv.h"
#include "error.h"
#include "gettext.h"
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Get unsetenv(). It can be used without error checking. */
-#include "setenv.h"
+#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
-# setenv.m4 serial 8
+# setenv.m4 serial 9
dnl Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_DEFUN([gl_FUNC_SETENV],
[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
AC_CHECK_FUNCS_ONCE([setenv])
if test $ac_cv_func_setenv = no; then
+ HAVE_SETENV=0
AC_LIBOBJ([setenv])
gl_PREREQ_SETENV
fi
# Like gl_FUNC_SETENV, except prepare for separate compilation (no AC_LIBOBJ).
AC_DEFUN([gl_FUNC_SETENV_SEPARATE],
[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
AC_CHECK_FUNCS_ONCE([setenv])
+ if test $ac_cv_func_setenv = no; then
+ HAVE_SETENV=0
+ fi
gl_PREREQ_SETENV
])
AC_DEFUN([gl_FUNC_UNSETENV],
[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
AC_CHECK_FUNCS([unsetenv])
if test $ac_cv_func_unsetenv = no; then
+ HAVE_UNSETENV=0
AC_LIBOBJ([unsetenv])
gl_PREREQ_UNSETENV
else
#endif
], , gt_cv_func_unsetenv_ret='int', gt_cv_func_unsetenv_ret='void')])
if test $gt_cv_func_unsetenv_ret = 'void'; then
- AC_DEFINE(VOID_UNSETENV, 1, [Define if unsetenv() returns void, not int.])
+ VOID_UNSETENV=1
fi
fi
])
-# stdlib_h.m4 serial 4
+# stdlib_h.m4 serial 5
dnl Copyright (C) 2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP])
GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP])
GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV])
+ GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV])
+ GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_CALLOC_POSIX=1; AC_SUBST([HAVE_CALLOC_POSIX])
HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT])
HAVE_MALLOC_POSIX=1; AC_SUBST([HAVE_MALLOC_POSIX])
HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP])
HAVE_REALLOC_POSIX=1; AC_SUBST([HAVE_REALLOC_POSIX])
+ HAVE_SETENV=1; AC_SUBST([HAVE_SETENV])
+ HAVE_UNSETENV=1; AC_SUBST([HAVE_UNSETENV])
REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP])
REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV])
+ VOID_UNSETENV=0; AC_SUBST([VOID_UNSETENV])
])
intprops
mktime
setenv
+unsetenv
time
verify
xalloc
lib/malloca.c
lib/relocatable.h
lib/relocatable.c
-lib/setenv.h
lib/setenv.c
lib/strerror.c
lib/c-ctype.h
pathmax
ssize_t
stdbool
+stdlib
unistd
configure.ac:
Description:
setenv() function: set an environment variable.
-unsetenv() function: remove an environment variable.
Files:
-lib/setenv.h
lib/setenv.c
-lib/unsetenv.c
m4/setenv.m4
Depends-on:
+stdlib
malloca
alloca-opt
unistd
configure.ac:
gl_FUNC_SETENV
-gl_FUNC_UNSETENV
+gl_STDLIB_MODULE_INDICATOR([setenv])
Makefile.am:
Include:
-"setenv.h"
+<stdlib.h>
License:
LGPL
-e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \
-e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \
-e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \
+ -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \
+ -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \
-e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \
-e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
-e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \
-e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
-e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \
+ -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \
+ -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \
-e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
-e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
+ -e 's|@''VOID_UNSETENV''@|$(VOID_UNSETENV)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/stdlib.in.h; \
} > $@-t
--- /dev/null
+Description:
+unsetenv() function: remove an environment variable.
+
+Files:
+lib/unsetenv.c
+m4/setenv.m4
+
+Depends-on:
+stdlib
+unistd
+
+configure.ac:
+gl_FUNC_UNSETENV
+gl_STDLIB_MODULE_INDICATOR([unsetenv])
+
+Makefile.am:
+
+Include:
+<stdlib.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
+
Depends-on:
setenv
+unsetenv
error
exit
gettext-h