+2016-09-05 Pino Toscano <ptoscano@redhat.com>
+
+ * NEWS: Document the deprecation of the 'progname' module.
+
+2016-08-18 Pino Toscano <ptoscano@redhat.com>
+
+ getprogname: new module
+ This provides a LGPL module for getting the name of the current
+ program, using the same API found on *BSD systems.
+ * lib/getprogname.c, lib/getprogname.h, m4/getprogname.m4:
+ * modules/getprogname: New files.
+ * MODULES.html.sh (Misc): Add getprogname.
+
2016-09-02 Jim Meyering <meyering@fb.com>
manywarnings: add -fno-common
func_module xgetdomainname
func_module getloadavg
func_module getpagesize
+ func_module getprogname
func_module getusershell
func_module lib-symbol-visibility
func_module login_tty
Date Modules Changes
+2016-09-05 progname This module is deprecated. Please switch to the
+ 'getprogname' module and its getprogname()
+ function to obtain the name of the current program.
+ Note that there is no longer any need to export a
+ 'const char *program_name' variable.
+ Currently there is no replacement for
+ set_program_name().
+
2016-08-17 stdbool This no longer supports _Bool for C++.
Programs intended to be portable to C++
compilers should use plain 'bool' instead.
--- /dev/null
+/* Program name management.
+ Copyright (C) 2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "getprogname.h"
+
+#include <errno.h> /* get program_invocation_name declaration */
+#include <string.h>
+
+
+#ifndef HAVE_GETPROGNAME
+const char *
+getprogname (void)
+{
+#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
+ return program_invocation_short_name;
+#elif HAVE_DECL_PROGRAM_INVOCATION_NAME
+ const char *base = program_invocation_name;
+ const char *slash;
+
+ slash = strrchr (base, '/');
+ if (slash != NULL)
+ base = slash + 1;
+
+ return base;
+#else
+ #error "getprogname module not ported to this OS"
+#endif
+}
+#endif
--- /dev/null
+/* Program name management.
+ Copyright (C) 2016 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _GL_GETPROGNAME_H
+#define _GL_GETPROGNAME_H
+
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef HAVE_GETPROGNAME
+extern const char *getprogname (void);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+# getprogname.m4 - check for getprogname or replacements for it
+
+# Copyright (C) 2016 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+AC_DEFUN([gl_FUNC_GETPROGNAME],
+[
+ AC_CHECK_FUNCS_ONCE([getprogname])
+])
--- /dev/null
+Description:
+Program name management.
+
+Files:
+lib/getprogname.h
+lib/getprogname.c
+m4/getprogname.m4
+
+Depends-on:
+extensions
+
+configure.ac:
+gl_FUNC_GETPROGNAME
+AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>])
+AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>])
+
+Makefile.am:
+lib_SOURCES += getprogname.h getprogname.c
+
+Include:
+"getprogname.h"
+
+License:
+LGPL
+
+Maintainer:
+All